FreeCAD C++
|
#include <App/DocumentObject.h>
Base class of all Classes handled in the Document
Public Member Functions | |
virtual const char * | getViewProviderName (void) const |
returns the type name of the ViewProvider | |
DocumentObject (void) | |
Constructor. | |
const char * | getNameInDocument (void) const |
returns the name which is set in the document for this object (not the name property!) | |
App::Document * | getDocument (void) const |
gets the document in which this Object is handled | |
bool | testIfLinkDAGCompatible (DocumentObject *linkTo) const |
testIfLinkIsDAG tests a link that is about to be created for circular references. More... | |
virtual short | mustExecute (void) const |
bool | recomputeFeature () |
Recompute only this feature. | |
const char * | getStatusString (void) const |
get the status Message | |
virtual void | onLostLinkToObject (DocumentObject *) |
virtual std::vector< PyObject * > | getPySubObjects (const std::vector< std::string > &) const |
its used to get the python sub objects by name (e.g. by the selection) | |
void | touch (void) |
set this document object touched (cause recomputation on dependent features) More... | |
bool | isTouched (void) const |
test if this document object is touched | |
void | enforceRecompute () |
Enforce this document object to be recomputed. | |
bool | mustRecompute (void) const |
Test if this document object must be recomputed. | |
void | purgeTouched (void) |
reset this document object touched | |
bool | isError (void) const |
set this feature to error | |
void | purgeError (void) |
remove the error from the object | |
bool | isRecomputing () const |
returns true if this objects is currently recomputing | |
bool | isRestoring () const |
returns true if this objects is currently restoring from file | |
bool | isRemoving () const |
returns true if this objects is currently removed from the document | |
unsigned long | getStatus () const |
return the status bits | |
std::vector< App::DocumentObject * > | getOutList (void) const |
returns a list of objects this object is pointing to by Links More... | |
std::vector< App::DocumentObject * > | getOutListOfProperty (App::Property *) const |
returns a list of objects linked by the property | |
std::vector< App::DocumentObject * > | getOutListRecursive (void) const |
returns a list of objects this object is pointing to by Links and all further descended | |
std::vector< std::list< App::DocumentObject * > > | getPathsByOutList (App::DocumentObject *to) const |
get all possible paths from this to another object following the OutList | |
std::vector< App::DocumentObject * > | getInList (void) const |
get all objects link to this object | |
std::vector< App::DocumentObject * > | getInListRecursive (void) const |
get all objects link directly or indirectly to this object | |
DocumentObjectGroup * | getGroup () const |
get group if object is part of a group, otherwise 0 is returned | |
bool | isInInListRecursive (DocumentObject *objToTest) const |
test if this object is in the InList and recursive further down | |
bool | isInInList (DocumentObject *objToTest) const |
test if this object is directly (non recursive) in the InList | |
bool | isInOutListRecursive (DocumentObject *objToTest) const |
test if the given object is in the OutList and recursive further down | |
bool | isInOutList (DocumentObject *objToTest) const |
test if this object is directly (non recursive) in the OutList | |
void | _removeBackLink (DocumentObject *) |
internal, used by PropertyLink to maintain DAG back links | |
void | _addBackLink (DocumentObject *) |
internal, used by PropertyLink to maintain DAG back links | |
![]() | |
TransactionalObject (void) | |
Constructor. | |
![]() | |
virtual Property * | getPropertyByName (const char *name) const override |
find a property by its name | |
virtual const char * | getPropertyName (const Property *prop) const override |
get the name of a property | |
virtual void | getPropertyMap (std::map< std::string, Property * > &Map) const override |
get all properties of the class (including properties of the parent) | |
virtual void | getPropertyList (std::vector< Property * > &List) const override |
get all properties of the class (including properties of the parent) | |
virtual short | getPropertyType (const Property *prop) const override |
get the Type of a Property | |
virtual short | getPropertyType (const char *name) const override |
get the Type of a named Property | |
virtual const char * | getPropertyGroup (const Property *prop) const override |
get the Group of a Property | |
virtual const char * | getPropertyGroup (const char *name) const override |
get the Group of a named Property | |
virtual const char * | getPropertyDocumentation (const Property *prop) const override |
get the Group of a Property | |
virtual const char * | getPropertyDocumentation (const char *name) const override |
get the Group of a named Property | |
![]() | |
PropertyContainer () | |
virtual | ~PropertyContainer () |
void | setPropertyStatus (unsigned char bit, bool value) |
set the Status bit of all properties at once | |
bool | isReadOnly (const Property *prop) const |
check if the property is read-only | |
bool | isReadOnly (const char *name) const |
check if the named property is read-only | |
bool | isHidden (const Property *prop) const |
check if the property is hidden | |
bool | isHidden (const char *name) const |
check if the named property is hidden | |
![]() | |
virtual void | SaveDocFile (Writer &) const |
virtual void | RestoreDocFile (Reader &) |
![]() | |
BaseClass () | |
Construction. | |
virtual | ~BaseClass () |
Destruction. | |
Protected Member Functions | |
virtual App::DocumentObjectExecReturn * | recompute (void) |
recompute only this object | |
virtual App::DocumentObjectExecReturn * | execute (void) |
virtual void | onBeforeChange (const Property *prop) |
get called before the value is changed | |
virtual void | onChanged (const Property *prop) |
get called by the container when a property was changed | |
virtual void | onDocumentRestored () |
get called after a document has been fully restored | |
virtual void | onSettingDocument () |
get called after setting the document | |
virtual void | setupObject () |
get called after a brand new object was created | |
virtual void | unsetupObject () |
get called when object is going to be removed from the document | |
Protected Attributes | |
std::bitset< 32 > | StatusBits |
Py::Object | PythonObject |
python object of this class and all descendent | |
App::Document * | _pDoc |
pointer to the document this object belongs to | |
std::string | oldLabel |
Old label; used for renaming expressions. | |
Additional Inherited Members | |
![]() | |
static std::string | encodeAttribute (const std::string &) |
Encodes an attribute upon saving. | |
|
protectedvirtual |
get called by the document to recompute this feature Normally this method get called in the processing of Document::recompute(). In execute() the output properties get recomputed with the data from linked objects and objects own properties.
Reimplemented in Mesh::RemoveComponents, Mesh::FillHoles, Inspection::Feature, Mesh::FixIndices, Mesh::FixDeformations, Mesh::FixDegenerations, Mesh::FixDuplicatedPoints, Mesh::FixDuplicatedFaces, App::FeatureTestException, App::Origin, Mesh::FixNonManifolds, Fem::Constraint, App::FeatureTest, Mesh::FlipNormals, TechDraw::DrawProjGroup, Part::Part2DObject, PartDesign::Transformed, Mesh::HarmonizeNormals, Part::Feature, Mesh::Feature, Points::Feature, TechDraw::DrawView, TechDraw::DrawViewMulti, Drawing::FeatureProjection, Drawing::FeatureViewPart, Mesh::SegmentByMesh, Drawing::FeatureViewAnnotation, Raytracing::LuxFeature, Raytracing::RayFeature, Drawing::FeatureViewSymbol, Mesh::SetOperations, Raytracing::LuxProject, Raytracing::RayProject, Drawing::FeatureClip, Drawing::FeatureViewSpreadsheet, Mesh::FixDefects, Raytracing::RaySegment, Drawing::FeaturePage, Mesh::Export, Mesh::Transform, Mesh::Curvature, Mesh::TransformDemolding, Part::FeatureReference, PartDesign::Boolean, Mesh::Import, Points::Structured, Mesh::Sphere, Assembly::Item, and Part::CustomFeature.
std::vector<App::DocumentObject*> App::DocumentObject::getOutList | ( | void | ) | const |
returns a list of objects this object is pointing to by Links
DAG handling This part of the interface deals with viewing the document as a DAG (directed acyclic graph).
|
virtual |
mustExecute We call this method to check if the object was modified to be invoked. If the object label or an argument is modified. If we must recompute the object - to call the method execute(). 0: no recomputation is needed 1: recomputation needed
Reimplemented in App::Origin.
|
virtual |
Called in case of losing a link Get called by the document when a object got deleted a link property of this object ist pointing to. The standard behaviour of the DocumentObject implementation is to reset the links to nothing. You may override this method to implement additional or different behavior.
bool App::DocumentObject::testIfLinkDAGCompatible | ( | DocumentObject * | linkTo | ) | const |
testIfLinkIsDAG tests a link that is about to be created for circular references.
objToLinkIn | (input). The object this object is to depend on after the link is going to be created. |
void App::DocumentObject::touch | ( | void | ) |
set this document object touched (cause recomputation on dependent features)
Set the property touched -> changed, cause recomputation in Update()
|
protected |
Status bits of the document object The first 8 bits are used for the base system the rest can be used in descendent 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