OpenLexocad  27.1
Core::DocObject Class Reference

#include <DocObject.h>

Inheritance diagram for Core::DocObject:
Core::PropertyContainer Base::Persistence Base::BaseClass Core::ExecObject Core::PostSolver Core::PreSolver Core::PropertyDescriptor Core::PythonClassObject Core::PythonScriptObject Core::Geometry Core::PropertyBoolDescriptor Core::PropertyButtonDescriptor Core::PropertyColorDescriptor Core::PropertyDoubleDescriptor Core::PropertyEnumDescriptor Core::PropertyGroupDescriptor Core::PropertyIntegerDescriptor Core::PropertyLxAttributeDescriptor Core::PropertyLxFormulaDescriptor Core::PropertyStringDescriptor

Public Types

typedef std::string IdType
 

Public Member Functions

void setDocument (Core::CoreDocument *doc)
 Sets the CoreDocument of this DocObject. More...
 
Core::CoreDocumentgetDocument () const
 Returns the CoreDocument of this DocObject. More...
 
IdType getId () const
 Returns the id of the object. More...
 
virtual bool onBeforeChange (Core::Property *p, const Core::Variant &newValue=Core::Variant()) override
 get called before the value is changed More...
 
virtual void onChanged (Core::Property *p)
 Is called when a property has changed its value. More...
 
virtual void onUndoRedoFinished ()
 get called after an undo/redo transaction is finished More...
 
virtual bool isExecutable () const
 Checks if the DocObject is executable. More...
 
long getRefCount () const
 Returns the reference count of this object. More...
 
virtual std::string getViewProviderName ()
 
virtual bool hasLazyViewProvider () const
 
virtual bool attachViewProvider () const
 
virtual void breakLinks () override
 Sets all links of this container to null. More...
 
virtual long getIfcId () const
 Returns the IFC Entity Id (not the GUID) More...
 
virtual bool ignoreInGraph () const
 The object should not added to the graph. More...
 
virtual void shallowCopyProperties (const DocObject *source)
 
virtual void setNewTimestamp (int aTimeStamp)
 
virtual void setUpdatedTimestamp (int aTimeStamp)
 
virtual void setDeletedTimestamp (int aTimeStamp)
 
virtual void setImportedTimestamp (int aTimeStamp)
 
virtual int getNewTimestamp () const
 
virtual int getUpdatedTimestamp () const
 
virtual int getDeletedTimestamp () const
 
virtual int getImportedTimestamp () const
 
virtual void checkAfterOnDeleted () override
 
virtual bool onChangedDebug (Core::Property *p) override
 Is called after a property in a PropertyContainers has been changed, it ignores notify-flag. More...
 
unsigned long getObjectStatus () const
 
bool testObjectStatus (ObjectStatus pos) const
 
void setObjectStatus (ObjectStatus pos, bool on)
 
void ref (void)
 
void unref (void)
 
void setTimeSlot (int p)
 
int getTimeSlot () const
 
std::vector< Base::StringgetFilesInTemp () const
 
void addFileInTemp (const Base::String &s)
 
void removeFileInTemp (const Base::String &s)
 
virtual bool replace (Core::DocObject *source, Core::CoreDocument *fromDoc)
 
virtual void onCreated ()
 
virtual void initDocObject ()
 
Base::String getTypeName () const
 
const char * getTypeCName () const
 
virtual std::shared_ptr< Core::DbgInfogetDbgInfo () const
 
virtual std::shared_ptr< Core::DbgInfogetDbgInfo (const Core::Property *p) const
 
virtual bool viewProviderDisabled () const
 
virtual void setViewProviderDisabled (bool)
 
virtual bool isTemporary () const
 
virtual Base::GlobalId getGlobalId () const
 
void __setId__ (const DocObject::IdType &id)
 For internal use only. More...
 
virtual Base::GlobalId __createAndSetGUID__ ()
 For internal use only. Sets a random GUID. More...
 
virtual bool createSQLColumnNames (Base::AbstractWriter &writer, Base::PersistenceVersion &save_version, bool dataMode)
 
virtual bool createSQL (Base::AbstractWriter &, Base::PersistenceVersion &, bool data) override
 This method is used to save properties or very small amounts of data to an XML document. More...
 
virtual void collectDocProperties (Core::DocProperties &props) const
 
- Public Member Functions inherited from Core::PropertyContainer
 PropertyContainer (void)
 
 PropertyContainer (const PropertyContainer &rhs)
 
virtual ~PropertyContainer (void)=default
 
bool addProperty (Core::Property *p, const std::string &name)
 
Core::PropertyaddProperty (Base::Type t, const std::string &name, const Core::Variant &defaultValue)
 Adds a property to the PropertyContainer. Returns the added property on success, '0' on failure. More...
 
Core::PropertyUseraddPropertyUser (const std::string &name, const Core::Variant &value)
 Convenience method for Python bindings. More...
 
void removeProperty (Core::Property *p, std::string pName)
 Removes a property from the PropertyContainer and deletes it. More...
 
void removeAllProperties ()
 Removes all properties from the PropertyContainer and deletes them. More...
 
Core::PropertygetPropertyByName (const std::string &name) const
 Returns the property with name 'name'. Returns '0' on failure. More...
 
Core::PropertygetPropertyByName (const Base::String &name) const
 Returns the property with name 'name'. Returns '0' on failure. More...
 
virtual const char * getPropertyName (const Property *prop) const
 get the name of a property More...
 
template<typename T >
T * getPropertyByName (const std::string &name) const
 Returns the property of type T with name 'name'. Returns 'nullptr' on failure. More...
 
void getPropertyMap (Core::PropertyMap &) const
 Fills a PropertyMap. More...
 
std::vector< std::pair< Core::Property *, std::string > > getPropertiesAndNameByType (Base::Type type) const
 Returns all properties of type 'type'. More...
 
std::vector< Core::Property * > getPropertiesByType (Base::Type type) const
 
std::vector< Core::Property * > getPropertiesByTypes (const std::vector< Base::Type > &type) const
 
bool setPropertyFromVariant (const std::string &name, const Core::Variant &value)
 Sets a property to value. More...
 
bool setProperty (const std::string &name, double value)
 
bool setProperty (const std::string &name, int value)
 
bool setProperty (const std::string &name, const Geom::Vec &value)
 
bool setProperty (const std::string &name, const std::list< Geom::Vec > &value)
 
bool setProperty (const std::string &name, const Geom::Trsf &value)
 
bool setProperty (const std::string &name, const std::string &value)
 
bool setProperty (const std::string &name, const char *value)
 
bool setProperty (const std::string &name, const Base::String &value)
 
bool setProperty (const std::string &name, const Geom::Pnt &value)
 
bool setProperty (const std::string &name, const Geom::Pnt2d &value)
 
bool setProperty (const std::string &name, const std::vector< Geom::Pnt > &value)
 
bool setProperty (const std::string &name, const std::vector< Geom::Pnt2d > &value)
 
bool setProperty (const std::string &name, const MD5 &value)
 
bool setProperty (const std::string &name, bool value)
 
bool setProperty (const std::string &name, Core::DocObject *value)
 
bool setProperty (const std::string &name, const Core::DocObject *value)
 
bool setProperty (const std::string &name, const std::unordered_set< Core::DocObject * > &value)
 
bool setProperty (const std::string &name, const std::list< Core::DocObject * > &value)
 
bool setProperty (const std::string &name, const std::vector< int > &value)
 
bool setProperty (const std::string &name, const QFont &value)
 
bool setProperty (const std::string &name, const Draw::DrawStyle &value)
 
bool setProperty (const std::string &name, const Draw::Arrowheads &value)
 
bool setProperty (const std::string &name, const Geom::Dir &value)
 
bool setProperty (const std::string &name, const Geom::Dir2d &value)
 
bool setProperty (const std::string &name, const Base::Color &value)
 
bool setProperty (const std::string &name, const Geom::Ax1 &value)
 
bool setProperty (const std::string &name, const Geom::Ax2 &value)
 
bool setProperty (const std::string &name, const Draw::Texture2Transform &value)
 
bool setProperty (const std::string &name, const std::list< std::list< Geom::Pnt > > &value)
 
bool setProperty (const std::string &name, const std::vector< double > &value)
 
bool setProperty (const std::string &name, pBrepData &value)
 
virtual void onDeleted ()
 Is called when a PropertyContainer's status is set to MarkedForDelete. More...
 
virtual void onNew ()
 Is called when a PropertyContainer's status is set to New. More...
 
virtual void onPropertyStatusBitsChanged (const Property &prop, unsigned long oldStatus)
 Is called when the Property StatusBits are changed. More...
 
virtual void save (Base::AbstractWriter &writer, Base::PersistenceVersion &version)
 Saves the PropertyContainer to writer. More...
 
virtual void restore (Base::AbstractXMLReader &reader, Base::PersistenceVersion &version)
 Restores the PropertyContainer from reader in specified version. More...
 
bool enableNotify (const bool enable)
 
bool isNotifyEnabled (void) const
 Returns whether notification of changes to the field values in the container is propagated to its auditors. More...
 
void touch ()
 Sets all properties of this PropertyContainer to updated. More...
 
bool isDeleted () const
 
bool isStatusDeleted () const
 Returns true if the status is set to 'Deleted'. More...
 
bool isMarkedForDelete () const
 Returns true if the status is set to 'MarkedForDelete'. More...
 
bool isMarkedForDeleteFinal () const
 Returns true if the status is set to 'MarkedForDeleteFinal'. More...
 
bool isDeletedFinal () const
 Returns true if the status is set to 'DeletedFinal'. More...
 
bool isNew () const
 Returns true if the status is set to 'New'. More...
 
bool isUpdated () const
 Returns true if the status is set to 'Updated'. More...
 
bool isValid () const
 Returns true if the status is set to 'Valid'. More...
 
bool hasErrors () const
 Returns true if the status is set to 'Error'. More...
 
void setData (const std::string &key, void *data)
 Adds arbitrary data for this key to the PropertyContainer (Used in SDK) More...
 
void * getData (const std::string &key, bool *ok=nullptr) const
 Returns data for this key from the PropertyContainer (Used in SDK) More...
 
void removeData (const std::string &key)
 Removes the data from the PropertyContainer (Used in SDK) More...
 
bool hasSameValuesAs (const PropertyContainer *container) const
 Returns 'true' if all values in 'container' match the corresponding property in this PropertyContainer. More...
 
void setPropertyValues (const PropertyContainer *other)
 Copies the property values from 'other' PropertyContainer to this PropertyContainer. More...
 
template<typename T >
getPropertyValueByName (const std::string &propertyName, bool *ok=0) const
 Returns the property value T with this name. If ok=true T holds a valid value. More...
 
virtual void ensureIntegrity ()
 
void integrityMaintained ()
 
void integrityLost ()
 Sets _integrity to false. More...
 
bool checkIntegrity ()
 Returns the value of _integrity. More...
 
Core::PropertyValueMap getPropertyValueMap () const
 Returns a map with the name of the property and its PropertyValue as a struct of the property type and the Core::Variant value. More...
 
std::map< std::string, Core::VariantgetKeyValueMap () const
 Returns all keys and sub keys with their values of this container. More...
 
bool setPropertyFromKeyValue (const std::string &propertyName, const std::string &key, const Core::Variant &value)
 Sets the key in a property to value. More...
 
std::set< Core::Property * > getUpdatedProperties () const
 Returns all properties that were updated since the last recompute. More...
 
void setUpdated ()
 Sets the status to 'Updated' if the old status was 'Valid'. More...
 
void setUpdated (const Core::Property *p)
 
void setHasErrors ()
 Sets the status to 'Error'. More...
 
void setNew ()
 Sets the status to 'New'. More...
 
void setValid ()
 Sets the status to 'Valid'. More...
 
void setDeleted ()
 Sets the status to 'Delete'. More...
 
void setMarkedForDelete ()
 Sets the status to 'MarkedForDelete'. More...
 
void setMarkedForDeleteFinal ()
 Sets the status to 'MarkedForDeleteFinal'. More...
 
void setDeleteFinal ()
 Sets the status to 'DeleteFinal'. More...
 
unsigned int getPropertyChangeStatus () const
 
void setAllPropertiesValid ()
 Sets the status of all properties to 'Valid'. More...
 
void setPropertyValues (const Core::PropertyValueMap &other)
 Copies the property values from a Core::PropertyValueMap to this PropertyContainer. More...
 
std::vector< Core::Property * > getPropertiesOrdered () const
 Returns the properties in the init order. More...
 
virtual bool check_lx (char *f, char *n)
 
bool rollBack ()
 Brings back the PropertyContainer to its last valid status. More...
 
void saveLastValidPropertyMap ()
 Saves the last valid property map, p.e. before a recompute to enable a rollback. More...
 
const Core::PropertyValueMapgetLastValidPropertyMap () const
 Returns the last valid PropertyValueMap. More...
 
virtual Core::PropertyaddDynamicProperty (const char *type, const char *name=0, const char *group=0, const char *doc=0, short attr=0, bool ro=false, bool hidden=false)
 
DynamicProperty::PropData getDynamicPropertyData (const Property *prop) const
 
virtual bool removeDynamicProperty (const char *name)
 
virtual std::vector< std::string > getDynamicPropertyNames () const
 
virtual Core::PropertygetDynamicPropertyByName (const char *name) const
 
- Public Member Functions inherited from Base::Persistence
virtual void saveDocFile (Base::AbstractWriter &, const Base::String &, const Base::String &)
 This method is used to save large amounts of data to a binary file. More...
 
virtual void restoreDocFile (Base::Reader &, const Base::String &)
 This method is used to restore large amounts of data from a binary file. More...
 
virtual bool mustbeSaved () const
 Return 'true' if this object must always be saved in the file. More...
 
- Public Member Functions inherited from Base::BaseClass
virtual Type getTypeId (void) const
 
template<typename T >
bool isDerivedFrom () const
 
bool isDerivedFrom (const Type type) const
 
 BaseClass ()
 Construction. More...
 
virtual ~BaseClass ()
 Destruction. More...
 

Protected Member Functions

 DocObject ()
 
virtual ~DocObject ()
 
void onBeforeChangeProperty (const Property *prop) override
 
void onChangedProperty (const Property *prop) override
 
virtual DocObjectcopy (Core::CoreDocument *toCoreDoc, DocObjectMap &copyMap)
 
virtual DocObjectshallowCopy (Core::CoreDocument *toDoc)
 
virtual DocObjectcopyToDifferentType (Base::Type aNewType, DocObjectMap &aCopyMap)
 
- Protected Member Functions inherited from Core::PropertyContainer
void addPropertiesFrom (const Core::PropertyContainer *other)
 Adds copy of all properties from other to this PropertyContainer. More...
 
virtual void setStatus (Status status)
 
Status getStatus () const
 
bool checkForAlreadyExistingProperty (Core::Property *property)
 
virtual void restoreProperty (Core::Property *property, const Base::String &name, Base::AbstractXMLReader &reader, Base::PersistenceVersion &version)
 Restores property from from reader in specified version. More...
 

Protected Attributes

std::bitset< 32 > StatusBits
 
- Protected Attributes inherited from Core::PropertyContainer
unsigned int _changedProperties
 

Friends

class CoreDocument
 

Additional Inherited Members

- Static Public Member Functions inherited from Base::Persistence
static std::string encodeAttribute (const std::string &)
 
- Static Public Member Functions inherited from Base::BaseClass
static Type getClassTypeId (void)
 
static void init (void)
 
static void * create (void)
 
static void setIfcNameAndID (const std::string &n, int id)
 
- Public Attributes inherited from Core::PropertyContainer
bool isRestored = false
 
- Public Attributes inherited from Base::BaseClass
long ____deadVal = 0xBADEAFFE
 
- Protected Types inherited from Core::PropertyContainer
enum  Status {
  Status::New = 1, Status::Updated = 2, Status::Valid = 3, Status::MarkedForDelete = 4,
  Status::MarkedForDeleteFinal, Status::Deleted, Status::DeletedFinal, Status::Error
}
 
- Static Protected Member Functions inherited from Base::BaseClass
static void initSubclass (Base::Type &toInit, const char *ClassName, const char *ParentName, Type::instantiationMethod method=0)
 
static void initIfcTypes (const std::string &s, Base::Type classTypeId, int id)
 

Member Typedef Documentation

◆ IdType

typedef std::string Core::DocObject::IdType

Constructor & Destructor Documentation

◆ DocObject()

Core::DocObject::DocObject ( )
protected

◆ ~DocObject()

virtual Core::DocObject::~DocObject ( )
protectedvirtual

Member Function Documentation

◆ __createAndSetGUID__()

virtual Base::GlobalId Core::DocObject::__createAndSetGUID__ ( )
virtual

For internal use only. Sets a random GUID.

◆ __setId__()

void Core::DocObject::__setId__ ( const DocObject::IdType id)

For internal use only.

◆ addFileInTemp()

void Core::DocObject::addFileInTemp ( const Base::String s)

◆ attachViewProvider()

virtual bool Core::DocObject::attachViewProvider ( ) const
virtual

◆ breakLinks()

virtual void Core::DocObject::breakLinks ( )
overridevirtual

Sets all links of this container to null.

Reimplemented from Core::PropertyContainer.

◆ checkAfterOnDeleted()

virtual void Core::DocObject::checkAfterOnDeleted ( )
overridevirtual

Reimplemented from Core::PropertyContainer.

◆ collectDocProperties()

virtual void Core::DocObject::collectDocProperties ( Core::DocProperties props) const
virtual

◆ copy()

◆ copyToDifferentType()

virtual DocObject* Core::DocObject::copyToDifferentType ( Base::Type  aNewType,
DocObjectMap aCopyMap 
)
protectedvirtual

◆ createSQL()

virtual bool Core::DocObject::createSQL ( Base::AbstractWriter ,
Base::PersistenceVersion ,
bool   
)
overridevirtual

This method is used to save properties or very small amounts of data to an XML document.

Reimplemented from Base::Persistence.

◆ createSQLColumnNames()

virtual bool Core::DocObject::createSQLColumnNames ( Base::AbstractWriter writer,
Base::PersistenceVersion save_version,
bool  dataMode 
)
virtual

◆ getDbgInfo() [1/2]

virtual std::shared_ptr<Core::DbgInfo> Core::DocObject::getDbgInfo ( ) const
virtual

◆ getDbgInfo() [2/2]

virtual std::shared_ptr<Core::DbgInfo> Core::DocObject::getDbgInfo ( const Core::Property p) const
virtual

◆ getDeletedTimestamp()

virtual int Core::DocObject::getDeletedTimestamp ( ) const
inlinevirtual

◆ getDocument()

Core::CoreDocument* Core::DocObject::getDocument ( ) const

Returns the CoreDocument of this DocObject.

◆ getFilesInTemp()

std::vector<Base::String> Core::DocObject::getFilesInTemp ( ) const

◆ getGlobalId()

virtual Base::GlobalId Core::DocObject::getGlobalId ( ) const
virtual

◆ getId()

IdType Core::DocObject::getId ( ) const

Returns the id of the object.

◆ getIfcId()

virtual long Core::DocObject::getIfcId ( ) const
inlinevirtual

Returns the IFC Entity Id (not the GUID)

◆ getImportedTimestamp()

virtual int Core::DocObject::getImportedTimestamp ( ) const
inlinevirtual

◆ getNewTimestamp()

virtual int Core::DocObject::getNewTimestamp ( ) const
inlinevirtual

◆ getObjectStatus()

unsigned long Core::DocObject::getObjectStatus ( ) const
inline

◆ getRefCount()

long Core::DocObject::getRefCount ( ) const

Returns the reference count of this object.

◆ getTimeSlot()

int Core::DocObject::getTimeSlot ( ) const

◆ getTypeCName()

const char* Core::DocObject::getTypeCName ( ) const

◆ getTypeName()

Base::String Core::DocObject::getTypeName ( ) const

◆ getUpdatedTimestamp()

virtual int Core::DocObject::getUpdatedTimestamp ( ) const
inlinevirtual

◆ getViewProviderName()

virtual std::string Core::DocObject::getViewProviderName ( )
virtual

◆ hasLazyViewProvider()

virtual bool Core::DocObject::hasLazyViewProvider ( ) const
virtual

◆ ignoreInGraph()

virtual bool Core::DocObject::ignoreInGraph ( ) const
inlinevirtual

The object should not added to the graph.

Reimplemented in Core::PostSolver, and Core::PreSolver.

◆ initDocObject()

virtual void Core::DocObject::initDocObject ( )
virtual

◆ isExecutable()

virtual bool Core::DocObject::isExecutable ( ) const
inlinevirtual

Checks if the DocObject is executable.

Reimplemented in Core::ExecObject.

◆ isTemporary()

virtual bool Core::DocObject::isTemporary ( ) const
inlinevirtual

◆ onBeforeChange()

virtual bool Core::DocObject::onBeforeChange ( Core::Property p,
const Core::Variant newValue = Core::Variant() 
)
overridevirtual

get called before the value is changed

Reimplemented from Core::PropertyContainer.

◆ onBeforeChangeProperty()

void Core::DocObject::onBeforeChangeProperty ( const Property prop)
overrideprotectedvirtual

Reimplemented from Core::PropertyContainer.

◆ onChanged()

virtual void Core::DocObject::onChanged ( Core::Property p)
virtual

Is called when a property has changed its value.

Reimplemented from Core::PropertyContainer.

◆ onChangedDebug()

virtual bool Core::DocObject::onChangedDebug ( Core::Property p)
overridevirtual

Is called after a property in a PropertyContainers has been changed, it ignores notify-flag.

Reimplemented from Core::PropertyContainer.

◆ onChangedProperty()

void Core::DocObject::onChangedProperty ( const Property prop)
overrideprotectedvirtual

Reimplemented from Core::PropertyContainer.

◆ onCreated()

virtual void Core::DocObject::onCreated ( )
virtual

◆ onUndoRedoFinished()

virtual void Core::DocObject::onUndoRedoFinished ( )
virtual

get called after an undo/redo transaction is finished

◆ ref()

void Core::DocObject::ref ( void  )

◆ removeFileInTemp()

void Core::DocObject::removeFileInTemp ( const Base::String s)

◆ replace()

virtual bool Core::DocObject::replace ( Core::DocObject source,
Core::CoreDocument fromDoc 
)
virtual

◆ setDeletedTimestamp()

virtual void Core::DocObject::setDeletedTimestamp ( int  aTimeStamp)
inlinevirtual

◆ setDocument()

void Core::DocObject::setDocument ( Core::CoreDocument doc)

Sets the CoreDocument of this DocObject.

◆ setImportedTimestamp()

virtual void Core::DocObject::setImportedTimestamp ( int  aTimeStamp)
inlinevirtual

◆ setNewTimestamp()

virtual void Core::DocObject::setNewTimestamp ( int  aTimeStamp)
inlinevirtual

◆ setObjectStatus()

void Core::DocObject::setObjectStatus ( ObjectStatus  pos,
bool  on 
)
inline

◆ setTimeSlot()

void Core::DocObject::setTimeSlot ( int  p)

◆ setUpdatedTimestamp()

virtual void Core::DocObject::setUpdatedTimestamp ( int  aTimeStamp)
inlinevirtual

◆ setViewProviderDisabled()

virtual void Core::DocObject::setViewProviderDisabled ( bool  )
inlinevirtual

◆ shallowCopy()

virtual DocObject* Core::DocObject::shallowCopy ( Core::CoreDocument toDoc)
protectedvirtual

◆ shallowCopyProperties()

virtual void Core::DocObject::shallowCopyProperties ( const DocObject source)
virtual

◆ testObjectStatus()

bool Core::DocObject::testObjectStatus ( ObjectStatus  pos) const
inline

◆ unref()

void Core::DocObject::unref ( void  )

◆ viewProviderDisabled()

virtual bool Core::DocObject::viewProviderDisabled ( ) const
inlinevirtual

Friends And Related Function Documentation

◆ CoreDocument

friend class CoreDocument
friend

Member Data Documentation

◆ StatusBits

std::bitset<32> Core::DocObject::StatusBits
protected

Status bits of the document object The first 8 bits are used for the base system the rest can be used in derived classes to mark special statuses on the objects. The bits and their meaning are listed below: 0 - object is marked as 'touched' 1 - object is marked as 'erroneous' 2 - object is marked as 'new' 3 - object is marked as 'recompute', i.e. the object gets recomputed now 4 - object is marked as 'restoring', i.e. the object gets loaded at the moment 5 - object is marked as 'deleting', i.e. the object gets deleted at the moment 6 - reserved 7 - reserved 16 - object is marked as 'expanded' in the tree view


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