Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
Slic3r::ObjectWithTimestamp Class Reference

#include <src/libslic3r/ObjectID.hpp>

+ Inheritance diagram for Slic3r::ObjectWithTimestamp:
+ Collaboration diagram for Slic3r::ObjectWithTimestamp:

Public Types

using Timestamp = uint64_t
 

Public Member Functions

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

 ObjectWithTimestamp ()=default
 
 ObjectWithTimestamp (int)
 
virtual ~ObjectWithTimestamp ()=default
 
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

template<class Archive >
void serialize (Archive &ar)
 

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

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 cereal::access
 
class Slic3r::UndoRedo::StackImpl
 

Detailed Description

Member Typedef Documentation

◆ Timestamp

Constructor & Destructor Documentation

◆ ObjectWithTimestamp() [1/2]

Slic3r::ObjectWithTimestamp::ObjectWithTimestamp ( )
protecteddefault

◆ ObjectWithTimestamp() [2/2]

Slic3r::ObjectWithTimestamp::ObjectWithTimestamp ( int  )
inlineprotected
107: ObjectBase(-1) {}
ObjectBase()
Definition ObjectID.hpp:65

◆ ~ObjectWithTimestamp()

virtual Slic3r::ObjectWithTimestamp::~ObjectWithTimestamp ( )
protectedvirtualdefault

Member Function Documentation

◆ 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:

◆ 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)
inlineprotected
112{ m_timestamp = rhs.m_timestamp; }
Timestamp m_timestamp
Definition ObjectID.hpp:126

References m_timestamp.

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

+ 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:

◆ 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(), 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 (
)
inline
121{ return this->id() == rhs.id() && m_timestamp == rhs.m_timestamp; }

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

+ Here is the call graph for this function:

◆ serialize()

template<class Archive >
void Slic3r::ObjectWithTimestamp::serialize ( Archive &  ar)
inlineprivate
131{ ar(m_timestamp); }

References m_timestamp.

◆ 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 (
)
inlineoverridevirtual

Reimplemented from Slic3r::ObjectBase.

119{ return m_timestamp; }

References m_timestamp.

◆ timestamp_matches()

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

References m_timestamp.

Referenced by Slic3r::Print::apply(), Slic3r::FacetsAnnotation::assign(), Slic3r::LayerHeightProfile::assign(), Slic3r::FacetsAnnotation::assign(), Slic3r::LayerHeightProfile::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 ( )
inline
static Timestamp s_last_timestamp
Definition ObjectID.hpp:127

References m_timestamp, and s_last_timestamp.

Referenced by Slic3r::LayerHeightProfile::clear(), Slic3r::LayerHeightProfile::set(), and Slic3r::LayerHeightProfile::set().

+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ cereal::access

friend class cereal::access
friend

◆ Slic3r::UndoRedo::StackImpl

friend class Slic3r::UndoRedo::StackImpl
friend

Member Data Documentation

◆ m_id

◆ m_timestamp

Timestamp Slic3r::ObjectWithTimestamp::m_timestamp { 1 }
private

◆ s_last_id

size_t Slic3r::ObjectBase::s_last_id = 0
staticprivateinherited

◆ s_last_timestamp

ObjectWithTimestamp::Timestamp Slic3r::ObjectWithTimestamp::s_last_timestamp = 1
staticprivate

Referenced by touch().


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