Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
Slic3r::LayerHeightProfile Class Referencefinal

#include <src/libslic3r/Model.hpp>

+ Inheritance diagram for Slic3r::LayerHeightProfile:
+ Collaboration diagram for Slic3r::LayerHeightProfile:

Public Types

using Timestamp = uint64_t
 

Public Member Functions

void assign (const LayerHeightProfile &rhs)
 
void assign (LayerHeightProfile &&rhs)
 
const std::vector< coordf_t > & get () const throw ()
 
bool empty () const throw ()
 
void set (const std::vector< coordf_t > &data)
 
void set (std::vector< coordf_t > &&data)
 
void clear ()
 
template<class Archive >
void serialize (Archive &ar)
 
Timestamp timestamp () const override throw ()
 
bool timestamp_matches (const ObjectWithTimestamp &rhs) const throw ()
 
bool object_id_and_timestamp_match (const ObjectWithTimestamp &rhs) const throw ()
 
void touch ()
 
ObjectID id () const
 

Protected Member Functions

void copy_timestamp (const ObjectWithTimestamp &rhs)
 
void set_new_unique_id ()
 
void set_invalid_id ()
 
void copy_id (const ObjectBase &rhs)
 
virtual void assign_new_unique_ids_recursive ()
 

Private Member Functions

 LayerHeightProfile ()=default
 
 LayerHeightProfile (int)
 
 LayerHeightProfile (const LayerHeightProfile &rhs)=default
 
 LayerHeightProfile (LayerHeightProfile &&rhs)=default
 
LayerHeightProfileoperator= (const LayerHeightProfile &rhs)=default
 
LayerHeightProfileoperator= (LayerHeightProfile &&rhs)=default
 

Static Private Member Functions

static ObjectID generate_new_id ()
 
template<class Archive >
static void load_and_construct (Archive &ar, cereal::construct< ObjectBase > &construct)
 

Private Attributes

std::vector< coordf_tm_data
 
Timestamp m_timestamp { 1 }
 
ObjectID m_id
 

Static Private Attributes

static Timestamp s_last_timestamp = 1
 
static size_t s_last_id = 0
 

Friends

class ModelObject
 

Detailed Description

Member Typedef Documentation

◆ Timestamp

Constructor & Destructor Documentation

◆ LayerHeightProfile() [1/4]

Slic3r::LayerHeightProfile::LayerHeightProfile ( )
explicitprivatedefault

◆ LayerHeightProfile() [2/4]

Slic3r::LayerHeightProfile::LayerHeightProfile ( int  )
inlineexplicitprivate

◆ LayerHeightProfile() [3/4]

Slic3r::LayerHeightProfile::LayerHeightProfile ( const LayerHeightProfile rhs)
explicitprivatedefault

◆ LayerHeightProfile() [4/4]

Slic3r::LayerHeightProfile::LayerHeightProfile ( LayerHeightProfile &&  rhs)
explicitprivatedefault

Member Function Documentation

◆ assign() [1/2]

void Slic3r::LayerHeightProfile::assign ( const LayerHeightProfile rhs)
inline
188{ if (! this->timestamp_matches(rhs)) { m_data = rhs.m_data; this->copy_timestamp(rhs); } }
std::vector< coordf_t > m_data
Definition Model.hpp:218
bool timestamp_matches(const ObjectWithTimestamp &rhs) const
Definition ObjectID.hpp:120
void copy_timestamp(const ObjectWithTimestamp &rhs)
Definition ObjectID.hpp:112

References Slic3r::ObjectWithTimestamp::copy_timestamp(), m_data, and Slic3r::ObjectWithTimestamp::timestamp_matches().

Referenced by Slic3r::GUI::Selection::copy_to_clipboard().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ assign() [2/2]

void Slic3r::LayerHeightProfile::assign ( LayerHeightProfile &&  rhs)
inline
189{ if (! this->timestamp_matches(rhs)) { m_data = std::move(rhs.m_data); this->copy_timestamp(rhs); } }

References Slic3r::ObjectWithTimestamp::copy_timestamp(), m_data, and Slic3r::ObjectWithTimestamp::timestamp_matches().

+ Here is the call graph for this function:

◆ assign_new_unique_ids_recursive()

virtual void Slic3r::ObjectBase::assign_new_unique_ids_recursive ( )
inlineprotectedvirtualinherited

Reimplemented in Slic3r::Model, Slic3r::ModelObject, and Slic3r::ModelVolume.

79{ this->set_new_unique_id(); }
void set_new_unique_id()
Definition ObjectID.hpp:73

References Slic3r::ObjectBase::set_new_unique_id().

+ Here is the call graph for this function:

◆ clear()

void Slic3r::LayerHeightProfile::clear ( )
inline
195{ m_data.clear(); this->touch(); }
void touch()
Definition ObjectID.hpp:122

References m_data, and Slic3r::ObjectWithTimestamp::touch().

+ Here is the call graph for this function:

◆ copy_id()

void Slic3r::ObjectBase::copy_id ( const ObjectBase rhs)
inlineprotectedinherited
76{ m_id = rhs.id(); }
ObjectID m_id
Definition ObjectID.hpp:82
size_t id
Definition ObjectID.hpp:37

References Slic3r::ObjectBase::id(), and Slic3r::ObjectBase::m_id.

Referenced by Slic3r::CutObjectBase::copy().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copy_timestamp()

void Slic3r::ObjectWithTimestamp::copy_timestamp ( const ObjectWithTimestamp rhs)
inlineprotectedinherited
112{ m_timestamp = rhs.m_timestamp; }
Timestamp m_timestamp
Definition ObjectID.hpp:126

References Slic3r::ObjectWithTimestamp::m_timestamp.

Referenced by Slic3r::FacetsAnnotation::assign(), assign(), Slic3r::FacetsAnnotation::assign(), and assign().

+ Here is the caller graph for this function:

◆ empty()

bool Slic3r::LayerHeightProfile::empty ( ) const
throw (
)
inline
192{ return m_data.empty(); }

References m_data.

Referenced by Slic3r::Print::apply(), Slic3r::ModelObject::has_custom_layering(), and Slic3r::GUI::ObjectList::update_info_items().

+ Here is the caller graph for this function:

◆ generate_new_id()

static ObjectID Slic3r::ObjectBase::generate_new_id ( )
inlinestaticprivateinherited
84{ return ObjectID(++ s_last_id); }
static size_t s_last_id
Definition ObjectID.hpp:85

References Slic3r::ObjectBase::s_last_id.

Referenced by Slic3r::ObjectBase::set_new_unique_id().

+ Here is the caller graph for this function:

◆ get()

const std::vector< coordf_t > & Slic3r::LayerHeightProfile::get ( ) const
throw (
)
inline
191{ return m_data; }

References m_data.

Referenced by Slic3r::PrintObject::update_layer_height_profile().

+ Here is the caller graph for this function:

◆ id()

ObjectID Slic3r::ObjectBase::id ( ) const
inlineinherited
55{ return m_id; }

References Slic3r::ObjectBase::m_id.

Referenced by Slic3r::Model::Model(), Slic3r::ModelInstance::ModelInstance(), Slic3r::ModelMaterial::ModelMaterial(), Slic3r::ModelObject::ModelObject(), Slic3r::ModelObject::ModelObject(), Slic3r::ModelObject::ModelObject(), Slic3r::ModelObject::ModelObject(), Slic3r::ModelObject::ModelObject(), Slic3r::ModelVolume::ModelVolume(), Slic3r::ModelVolume::ModelVolume(), Slic3r::ModelVolume::ModelVolume(), Slic3r::_3MF_Importer::_load_model_from_file(), Slic3r::GUI::Plater::priv::actualize_slicing_warnings(), Slic3r::ModelObjectStatusDB::add(), Slic3r::ModelObjectStatusDB::add_if_new(), Slic3r::Print::apply(), Slic3r::SLAPrint::apply(), Slic3r::GUI::GLGizmoFdmSupports::apply_data_from_backend(), Slic3r::ModelVolume::check(), Slic3r::check_model_ids_equal(), Slic3r::ModelObject::convert_units(), Slic3r::ObjectBase::copy_id(), Slic3r::PrintObjectStatusDB::count(), anonymous_namespace{RaycastManager.cpp}::create_key(), priv::create_volume(), Slic3r::GUI::Emboss::create_volume_sources(), Slic3r::GUI::GLGizmoHollow::data_changed(), Slic3r::GUI::GLGizmoPainterBase::data_changed(), Slic3r::GUI::GLGizmoSlaSupports::data_changed(), Slic3r::Model::delete_object(), Slic3r::GUI::Plater::export_stl_obj(), Slic3r::ModelObjectStatusDB::get(), Slic3r::GUI::get_arrange_poly(), Slic3r::GUI::GLGizmoSlaSupports::get_data_from_backend(), Slic3r::PrintObjectStatusDB::get_range(), Slic3r::GUI::GLGizmoFdmSupports::has_backend_supports(), Slic3r::GUI::GLGizmoSlaSupports::has_backend_supports(), Slic3r::CutObjectBase::has_same_id(), Slic3r::UndoRedo::StackImpl::immutable_object_id_impl(), Slic3r::GUI::GLGizmoSimplify::init_model(), Slic3r::inner_brim_area(), Slic3r::ModelObject::is_cut(), Slic3r::CutObjectBase::is_equal(), Slic3r::ObjectBase::load_and_construct(), Slic3r::UndoRedo::StackImpl::load_snapshot(), Slic3r::GUI::ObjectList::merge(), Slic3r::model_property_changed(), Slic3r::model_volume_list_changed(), Slic3r::model_volume_list_copy_configs(), Slic3r::ModelConfigObject::object_id_and_timestamp_match(), Slic3r::ObjectWithTimestamp::object_id_and_timestamp_match(), Slic3r::GUI::GLGizmoEmboss::on_mouse_change_selection(), Slic3r::GUI::CommonGizmosDataObjects::SelectionInfo::on_update(), Slic3r::CutObjectBase::operator<(), Slic3r::Model::operator=(), Slic3r::ModelObject::operator=(), Slic3r::ModelObject::operator=(), Slic3r::CutObjectBase::operator==(), Slic3r::GUI::GLGizmoCut3D::perform_cut(), Slic3r::GUI::GLGizmoEmboss::process(), Slic3r::GUI::processed_objects_idxs(), Slic3r::GUI::GLCanvas3D::reload_scene(), Slic3r::GUI::GLCanvas3D::LayersEditing::select_object(), Slic3r::ModelMaterial::serialize(), Slic3r::SLAPrintObject::SliceRecord::set_model_slice_idx(), Slic3r::SLAPrintObject::SliceRecord::set_support_slice_idx(), Slic3r::slices_to_regions(), Slic3r::ModelObject::split(), Slic3r::UndoRedo::StackImpl::take_snapshot(), Slic3r::top_level_outer_brim_area(), Slic3r::GUI::update_object_cut_id(), and anonymous_namespace{EmbossJob.cpp}::update_volume_name().

◆ load_and_construct()

template<class Archive >
static void Slic3r::ObjectBase::load_and_construct ( Archive &  ar,
cereal::construct< ObjectBase > &  construct 
)
inlinestaticprivateinherited
96{ ObjectID id; ar(id); construct(id); }
ObjectID id() const
Definition ObjectID.hpp:55

References Slic3r::ObjectBase::id().

+ Here is the call graph for this function:

◆ object_id_and_timestamp_match()

bool Slic3r::ObjectWithTimestamp::object_id_and_timestamp_match ( const ObjectWithTimestamp rhs) const
throw (
)
inlineinherited
121{ return this->id() == rhs.id() && m_timestamp == rhs.m_timestamp; }

References Slic3r::ObjectID::id, Slic3r::ObjectBase::id(), and Slic3r::ObjectWithTimestamp::m_timestamp.

+ Here is the call graph for this function:

◆ operator=() [1/2]

LayerHeightProfile & Slic3r::LayerHeightProfile::operator= ( const LayerHeightProfile rhs)
privatedefault

◆ operator=() [2/2]

LayerHeightProfile & Slic3r::LayerHeightProfile::operator= ( LayerHeightProfile &&  rhs)
privatedefault

◆ serialize()

template<class Archive >
void Slic3r::LayerHeightProfile::serialize ( Archive &  ar)
inline
198 {
199 ar(cereal::base_class<ObjectWithTimestamp>(this), m_data);
200 }

References m_data.

◆ set() [1/2]

void Slic3r::LayerHeightProfile::set ( const std::vector< coordf_t > &  data)
inline
193{ if (m_data != data) { m_data = data; this->touch(); } }
constexpr auto data(C &c) -> decltype(c.data())
Definition span.hpp:195

References m_data, and Slic3r::ObjectWithTimestamp::touch().

Referenced by Slic3r::_3MF_Importer::_load_model_from_file(), and Slic3r::AMFParserContext::endElement().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set() [2/2]

void Slic3r::LayerHeightProfile::set ( std::vector< coordf_t > &&  data)
inline
194{ if (m_data != data) { m_data = std::move(data); this->touch(); } }

References m_data, and Slic3r::ObjectWithTimestamp::touch().

+ Here is the call graph for this function:

◆ set_invalid_id()

void Slic3r::ObjectBase::set_invalid_id ( )
inlineprotectedinherited
74{ m_id = 0; }

References Slic3r::ObjectBase::m_id.

Referenced by Slic3r::CutObjectBase::invalidate().

+ Here is the caller graph for this function:

◆ set_new_unique_id()

void Slic3r::ObjectBase::set_new_unique_id ( )
inlineprotectedinherited
73{ m_id = generate_new_id(); }
static ObjectID generate_new_id()
Definition ObjectID.hpp:84

References Slic3r::ObjectBase::generate_new_id(), and Slic3r::ObjectBase::m_id.

Referenced by Slic3r::ModelVolume::ModelVolume(), Slic3r::Model::assign_new_unique_ids_recursive(), Slic3r::ObjectBase::assign_new_unique_ids_recursive(), Slic3r::ModelObject::assign_new_unique_ids_recursive(), Slic3r::CutObjectBase::init(), Slic3r::ModelMaterial::set_new_unique_id(), Slic3r::ModelObject::set_new_unique_id(), and Slic3r::ModelVolume::set_new_unique_id().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ timestamp()

Timestamp Slic3r::ObjectWithTimestamp::timestamp ( ) const
throw (
)
inlineoverridevirtualinherited

Reimplemented from Slic3r::ObjectBase.

119{ return m_timestamp; }

References Slic3r::ObjectWithTimestamp::m_timestamp.

◆ timestamp_matches()

bool Slic3r::ObjectWithTimestamp::timestamp_matches ( const ObjectWithTimestamp rhs) const
throw (
)
inlineinherited
120{ return m_timestamp == rhs.m_timestamp; }

References Slic3r::ObjectWithTimestamp::m_timestamp.

Referenced by Slic3r::Print::apply(), Slic3r::FacetsAnnotation::assign(), assign(), Slic3r::FacetsAnnotation::assign(), assign(), Slic3r::model_custom_seam_data_changed(), Slic3r::model_custom_supports_data_changed(), and Slic3r::model_mmu_segmentation_data_changed().

+ Here is the caller graph for this function:

◆ touch()

void Slic3r::ObjectWithTimestamp::touch ( )
inlineinherited
static Timestamp s_last_timestamp
Definition ObjectID.hpp:127

References Slic3r::ObjectWithTimestamp::m_timestamp, and Slic3r::ObjectWithTimestamp::s_last_timestamp.

Referenced by clear(), set(), and set().

+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ ModelObject

friend class ModelObject
friend

Member Data Documentation

◆ m_data

std::vector<coordf_t> Slic3r::LayerHeightProfile::m_data
private

◆ m_id

◆ m_timestamp

◆ s_last_id

size_t Slic3r::ObjectBase::s_last_id = 0
staticprivateinherited

◆ s_last_timestamp

ObjectWithTimestamp::Timestamp Slic3r::ObjectWithTimestamp::s_last_timestamp = 1
staticprivateinherited

The documentation for this class was generated from the following file: