Base class of all classes with properties. More...
#include <PropertyContainer.h>
Public Member Functions | |
virtual App::Property * | addDynamicProperty (const char *type, const char *name=0, const char *group=0, const char *doc=0, short attr=0, bool ro=false, bool hidden=false) |
virtual App::Property * | getDynamicPropertyByName (const char *name) const |
DynamicProperty::PropData | getDynamicPropertyData (const Property *prop) const |
virtual std::vector< std::string > | getDynamicPropertyNames () const |
virtual std::string | getFullName () const |
virtual unsigned int | getMemSize (void) const |
This method is used to get the size of objects It is not meant to have the exact size, it is more or less an estimation which runs fast! Is it two bytes or a GB? More... | |
virtual Property * | getPropertyByName (const char *name) const |
find a property by its name More... | |
virtual const char * | getPropertyDocumentation (const char *name) const |
get the Group of a named Property More... | |
virtual const char * | getPropertyDocumentation (const Property *prop) const |
get the Group of a Property More... | |
virtual const char * | getPropertyGroup (const char *name) const |
get the Group of a named Property More... | |
virtual const char * | getPropertyGroup (const Property *prop) const |
get the Group of a Property More... | |
virtual void | getPropertyList (std::vector< Property * > &List) const |
get all properties of the class (including properties of the parent) More... | |
virtual void | getPropertyMap (std::map< std::string, Property * > &Map) const |
get all properties of the class (including properties of the parent) More... | |
virtual const char * | getPropertyName (const Property *prop) const |
get the name of a property More... | |
const char * | getPropertyPrefix () const |
virtual short | getPropertyType (const char *name) const |
get the Type of a named Property More... | |
virtual short | getPropertyType (const Property *prop) const |
get the Type of a Property More... | |
bool | isHidden (const char *name) const |
check if the named property is hidden More... | |
bool | isHidden (const Property *prop) const |
check if the property is hidden More... | |
bool | isReadOnly (const char *name) const |
check if the named property is read-only More... | |
bool | isReadOnly (const Property *prop) const |
check if the property is read-only More... | |
virtual void | onPropertyStatusChanged (const Property &prop, unsigned long oldStatus) |
PropertyContainer () | |
A constructor. More... | |
virtual bool | removeDynamicProperty (const char *name) |
virtual void | Restore (Base::XMLReader &reader) |
This method is used to restore properties from an XML document. More... | |
virtual void | Save (Base::Writer &writer) const |
This method is used to save properties to an XML document. More... | |
void | setPropertyPrefix (const char *prefix) |
void | setPropertyStatus (unsigned char bit, bool value) |
set the Status bit of all properties at once More... | |
virtual | ~PropertyContainer () |
A destructor. More... | |
Public Member Functions inherited from Base::Persistence | |
void | dumpToStream (std::ostream &stream, int compression) |
virtual Base::Type | getTypeId (void) const |
virtual void | RestoreDocFile (Reader &) |
This method is used to restore large amounts of data from a file In this method you simply stream in your SaveDocFile() saved data. More... | |
void | restoreFromStream (std::istream &stream) |
virtual void | SaveDocFile (Writer &) const |
This method is used to save large amounts of data to a binary file. More... | |
Public Member Functions inherited from Base::BaseClass | |
BaseClass () | |
Construction. More... | |
virtual PyObject * | getPyObject (void) |
This method returns the Python wrapper for a C++ object. More... | |
bool | isDerivedFrom (const Type type) const |
virtual void | setPyObject (PyObject *) |
virtual | ~BaseClass () |
Destruction. More... | |
Protected Member Functions | |
virtual const PropertyData & | getPropertyData (void) const |
virtual void | handleChangedPropertyName (Base::XMLReader &reader, const char *TypeName, const char *PropName) |
PropertyContainer::handleChangedPropertyName is called during restore to possibly fix reading of older versions of this property container. More... | |
virtual void | handleChangedPropertyType (Base::XMLReader &reader, const char *TypeName, Property *prop) |
PropertyContainer::handleChangedPropertyType is called during restore to possibly fix reading of older versions of the property container. More... | |
virtual void | onBeforeChange (const Property *) |
get called before the value is changed More... | |
virtual void | onChanged (const Property *) |
get called by the container when a property has changed More... | |
Static Protected Member Functions | |
static const PropertyData * | getPropertyDataPtr (void) |
Static Protected Member Functions inherited from Base::BaseClass | |
static void | initSubclass (Base::Type &toInit, const char *ClassName, const char *ParentName, Type::instantiationMethod method=nullptr) |
Protected Attributes | |
DynamicProperty | dynamicProps |
Friends | |
class | DynamicProperty |
class | Property |
Additional Inherited Members | |
Static Public Member Functions inherited from Base::Persistence | |
static void * | create (void) |
static std::string | encodeAttribute (const std::string &) |
Encodes an attribute upon saving. More... | |
static Base::Type | getClassTypeId (void) |
static void | init (void) |
Static Public Member Functions inherited from Base::BaseClass | |
static void * | create (void) |
static Type | getClassTypeId (void) |
static void | init (void) |
Detailed Description
Base class of all classes with properties.
Constructor & Destructor Documentation
◆ PropertyContainer()
PropertyContainer::PropertyContainer | ( | ) |
A constructor.
A more elaborate description of the constructor.
◆ ~PropertyContainer()
|
virtual |
A destructor.
A more elaborate description of the destructor.
Member Function Documentation
◆ addDynamicProperty()
|
virtual |
Reimplemented in App::DocumentObject, and Gui::ViewProviderDocumentObject.
References App::DynamicProperty::addDynamicProperty(), and dynamicProps.
Referenced by Gui::ViewProviderDocumentObject::addDynamicProperty(), Gui::ViewProviderPy::addProperty(), and App::TransactionObject::applyChn().
◆ getDynamicPropertyByName()
|
virtual |
Referenced by App::TransactionObject::applyChn(), Gui::ViewProviderPy::getCustomAttributes(), App::DocumentObjectPy::getCustomAttributes(), Gui::ViewProviderDocumentObject::removeDynamicProperty(), Gui::ViewProviderPy::setCustomAttributes(), App::DocumentObjectPy::setCustomAttributes(), and PartDesign::SubShapeBinder::update().
◆ getDynamicPropertyData()
DynamicProperty::PropData App::PropertyContainer::getDynamicPropertyData | ( | const Property * | prop | ) | const |
Referenced by App::TransactionObject::addOrRemoveProperty(), and App::TransactionObject::setProperty().
◆ getDynamicPropertyNames()
|
virtual |
Referenced by PartDesign::SubShapeBinder::update().
◆ getFullName()
|
virtual |
Reimplemented in App::Document, App::DocumentObject, and Gui::ViewProviderDocumentObject.
Referenced by App::Property::getFullName(), and App::PropertyLinkBase::tryReplaceLink().
◆ getMemSize()
|
virtual |
This method is used to get the size of objects It is not meant to have the exact size, it is more or less an estimation which runs fast! Is it two bytes or a GB?
Implements Base::Persistence.
Reimplemented in App::Document, Sketcher::SketchObject, TechDraw::DrawSVGTemplate, TechDraw::DrawTemplate, and TechDraw::DrawParametricTemplate.
References getPropertyMap().
Referenced by App::Document::getMemSize().
◆ getPropertyByName()
|
virtual |
find a property by its name
Reimplemented in Gui::ViewProviderLink, App::ExtensionContainer, and Spreadsheet::Sheet.
References dynamicProps, App::DynamicProperty::getDynamicPropertyByName(), App::PropertyData::getPropertyByName(), and getPropertyData().
Referenced by App::PropertyContainerPy::dumpPropertyContent(), App::PropertyContainerPy::getCustomAttributes(), App::DocumentPy::getCustomAttributes(), App::PropertyContainerPy::getDocumentationOfProperty(), App::PropertyContainerPy::getEditorMode(), App::PropertyContainerPy::getGroupOfProperty(), App::PropertyContainerPy::getPropertyByName(), App::ExtensionContainer::getPropertyByName(), getPropertyType(), App::PropertyContainerPy::getTypeIdOfProperty(), App::PropertyContainerPy::getTypeOfProperty(), Restore(), App::PropertyContainerPy::restorePropertyContent(), App::PropertyContainerPy::setCustomAttributes(), App::DocumentPy::setCustomAttributes(), and App::PropertyContainerPy::setEditorMode().
◆ getPropertyData()
|
protectedvirtual |
Reimplemented in App::Origin.
Referenced by getPropertyByName(), getPropertyDocumentation(), getPropertyGroup(), getPropertyList(), getPropertyMap(), and getPropertyName().
◆ getPropertyDataPtr()
|
staticprotected |
◆ getPropertyDocumentation() [1/2]
|
virtual |
get the Group of a named Property
Reimplemented in App::ExtensionContainer.
References dynamicProps, App::PropertyData::getDocumentation(), getPropertyData(), and App::DynamicProperty::getPropertyDocumentation().
◆ getPropertyDocumentation() [2/2]
|
virtual |
get the Group of a Property
Reimplemented in App::ExtensionContainer.
References dynamicProps, App::PropertyData::getDocumentation(), getPropertyData(), and App::DynamicProperty::getPropertyDocumentation().
Referenced by App::Property::getDocumentation(), App::PropertyContainerPy::getDocumentationOfProperty(), and App::ExtensionContainer::getPropertyDocumentation().
◆ getPropertyGroup() [1/2]
|
virtual |
get the Group of a named Property
Reimplemented in App::ExtensionContainer.
References dynamicProps, App::PropertyData::getGroup(), getPropertyData(), and App::DynamicProperty::getPropertyGroup().
◆ getPropertyGroup() [2/2]
|
virtual |
get the Group of a Property
Reimplemented in App::ExtensionContainer.
References dynamicProps, App::PropertyData::getGroup(), getPropertyData(), and App::DynamicProperty::getPropertyGroup().
Referenced by App::Property::getGroup(), App::PropertyContainerPy::getGroupOfProperty(), and App::ExtensionContainer::getPropertyGroup().
◆ getPropertyList()
|
virtual |
get all properties of the class (including properties of the parent)
Reimplemented in App::ExtensionContainer, and Gui::ViewProviderLink.
References dynamicProps, getPropertyData(), App::DynamicProperty::getPropertyList(), and App::PropertyData::getPropertyList().
Referenced by App::ExtensionContainer::getPropertyList(), PartDesignGui::isAnyNonPartDesignLinksTo(), Gui::Application::reopen(), and setPropertyStatus().
◆ getPropertyMap()
|
virtual |
get all properties of the class (including properties of the parent)
Reimplemented in App::ExtensionContainer, and Gui::ViewProviderLink.
References dynamicProps, getPropertyData(), App::DynamicProperty::getPropertyMap(), and App::PropertyData::getPropertyMap().
Referenced by App::PropertyContainerPy::getCustomAttributes(), getMemSize(), App::PropertyContainerPy::getPropertiesList(), App::ExtensionContainer::getPropertyMap(), and Save().
◆ getPropertyName()
|
virtual |
get the name of a property
Reimplemented in App::ExtensionContainer.
References dynamicProps, App::PropertyData::getName(), getPropertyData(), and App::DynamicProperty::getPropertyName().
Referenced by App::ExtensionContainer::getPropertyName().
◆ getPropertyPrefix()
const char* App::PropertyContainer::getPropertyPrefix | ( | ) | const |
Referenced by Gui::PropertyEditor::PropertyItem::setPropertyValue().
◆ getPropertyType() [1/2]
|
virtual |
get the Type of a named Property
Reimplemented in App::ExtensionContainer.
References getPropertyByName(), and getPropertyType().
◆ getPropertyType() [2/2]
|
virtual |
get the Type of a Property
Reimplemented in App::ExtensionContainer.
References App::Property::getType().
Referenced by getPropertyType(), App::ExtensionContainer::getPropertyType(), isHidden(), isReadOnly(), Restore(), and Save().
◆ handleChangedPropertyName()
|
protectedvirtual |
PropertyContainer::handleChangedPropertyName is called during restore to possibly fix reading of older versions of this property container.
This method is typically called if the property on file has changed its name in more recent versions.
The default implementation does nothing.
- Parameters
-
reader The XML stream to read from. TypeName Name of property type on file. PropName Name of property on file that does not exist in the container anymore.
Reimplemented in App::LinkElement, App::Link, TechDraw::DrawViewPart, Part::BodyBase, PartDesign::FeaturePrimitive, Part::Datum, PartDesign::Boolean, Part::Part2DObject, TechDraw::DrawViewBalloon, and Fem::FemAnalysis.
Referenced by TechDraw::DrawViewBalloon::handleChangedPropertyName(), Fem::FemAnalysis::handleChangedPropertyName(), TechDraw::DrawViewPart::handleChangedPropertyName(), Part::BodyBase::onBeforeChange(), and Restore().
◆ handleChangedPropertyType()
|
protectedvirtual |
PropertyContainer::handleChangedPropertyType is called during restore to possibly fix reading of older versions of the property container.
This method is typically called if the property on file has changed its type in more recent versions.
The default implementation does nothing.
- Parameters
-
reader The XML stream to read from. TypeName Name of property type on file. prop Pointer to property to restore. Its type differs from TypeName.
Reimplemented in TechDraw::DrawProjGroup, PartDesign::SubShapeBinder, PartDesign::ShapeBinder, TechDraw::DrawPage, Part::Part2DObject, TechDraw::DrawView, TechDraw::DrawViewBalloon, Part::Thickness, TechDrawGui::ViewProviderDimension, TechDrawGui::ViewProviderViewPart, TechDraw::DrawViewAnnotation, TechDrawGui::ViewProviderBalloon, Part::Mirroring, TechDraw::DrawTile, TechDrawGui::ViewProviderLeader, PartGui::ViewProvider2DObject, and TechDrawGui::ViewProviderRichAnno.
Referenced by PartDesign::SubShapeBinder::handleChangedPropertyType(), and Restore().
◆ isHidden() [1/2]
bool PropertyContainer::isHidden | ( | const char * | name | ) | const |
check if the named property is hidden
References getPropertyType(), and App::Prop_Hidden.
◆ isHidden() [2/2]
check if the property is hidden
References getPropertyType(), and App::Prop_Hidden.
Referenced by Gui::Dialog::find_placement::operator()().
◆ isReadOnly() [1/2]
bool PropertyContainer::isReadOnly | ( | const char * | name | ) | const |
check if the named property is read-only
References getPropertyType(), and App::Prop_ReadOnly.
◆ isReadOnly() [2/2]
check if the property is read-only
References getPropertyType(), and App::Prop_ReadOnly.
Referenced by Gui::Dialog::find_placement::operator()(), Gui::PropertyEditor::PropertyItem::setPropertyData(), Gui::PropertyEditor::PropertyItem::setPropertyValue(), and Gui::PropertyEditor::PropertyItem::updateData().
◆ onBeforeChange()
|
protectedvirtual |
get called before the value is changed
Reimplemented in App::DocumentObject, App::Document, Gui::ViewProviderDocumentObject, TechDraw::DrawPage, Part::BodyBase, Gui::ViewProvider, Drawing::FeaturePage, and Gui::ViewProviderLink.
Referenced by App::Property::aboutToSetValue(), and Gui::ViewProvider::onBeforeChange().
◆ onChanged()
|
protectedvirtual |
get called by the container when a property has changed
Reimplemented in App::DocumentObject, App::Document, App::MeasureDistance, App::TextDocument, App::ExtensionContainer, TechDraw::DrawViewPart, Gui::ViewProviderLink, Gui::ViewProviderDocumentObject, TechDraw::DrawViewDimension, PartGui::ViewProviderPartExt, TechDraw::DrawPage, TechDraw::DrawProjGroup, PartDesign::Body, PartDesign::SubShapeBinder, Part::BodyBase, TechDraw::DrawView, TechDraw::DrawLeaderLine, Part::Feature, TechDraw::DrawProjGroupItem, PartDesign::Boolean, PartDesign::FeaturePrimitive, Part::Revolution, PartDesign::Point, PartDesignGui::ViewProviderBoolean, Part::Primitive, Gui::ViewProviderPart, TechDraw::DrawHatch, TechDraw::DrawViewSymbol, TechDraw::DrawViewBalloon, TechDraw::DrawViewSection, PartDesignGui::ViewProvider, TechDrawGui::ViewProviderPage, TechDraw::LandmarkDimension, PartDesignGui::ViewProviderBody, Gui::ViewProviderPlacement, TechDraw::DrawViewDetail, TechDraw::DrawViewMulti, TechDrawGui::ViewProviderDrawingView, TechDraw::DrawGeomHatch, TechDrawGui::ViewProviderGeomHatch, TechDrawGui::ViewProviderHatch, TechDrawGui::ViewProviderTemplate, Gui::ViewProvider, Part::Wedge, Part::Spiral, Part::Helix, SketcherGui::ViewProviderSketch, Fem::FemPostCutFilter, Fem::FemPostWarpVectorFilter, Fem::Constraint, Fem::FemPostScalarClipFilter, MeshGui::ViewProviderMesh, Fem::FemPostDataAtPointFilter, PartDesign::ProfileBased, Fem::FemPostSphereFunction, Fem::FemPostDataAlongLineFilter, FemGui::ViewProviderFemMesh, Part::Sweep, Fem::FemPostPlaneFunction, Fem::ConstraintDisplacement, FemGui::ViewProviderFemPostFunction, Gui::ViewProviderAnnotationLabel, TechDraw::DrawViewClip, Robot::RobotObject, Fem::ConstraintFluidBoundary, Fem::FemPostClipFilter, TechDrawGui::ViewProviderViewPart, TechDraw::DrawViewAnnotation, Fem::FemPostPipeline, TechDraw::DrawTileWeld, TechDraw::DrawViewCollection, Fem::ConstraintPulley, Part::Loft, Robot::TrajectoryDressUpObject, Fem::ConstraintBearing, Fem::ConstraintContact, TechDraw::DrawViewSpreadsheet, Drawing::FeaturePage, Drawing::FeatureViewSymbol, Fem::ConstraintTemperature, TechDraw::DrawSVGTemplate, Drawing::FeatureClip, Fem::ConstraintGear, Fem::ConstraintInitialTemperature, PartDesign::DressUp, Robot::Edge2TracObject, Fem::ConstraintForce, Fem::ConstraintHeatflux, Fem::ConstraintTransform, Path::Feature, TechDraw::DrawViewImage, Robot::TrajectoryObject, TechDrawGui::ViewProviderProjGroup, TechDrawGui::ViewProviderViewSection, Gui::ViewProviderOrigin, Fem::FemMeshObject, TechDraw::DrawTemplate, Gui::ViewProviderMeasureDistance, Fem::ConstraintFixed, Fem::FemPostFunctionProvider, TechDraw::DrawViewDimExtent, TechDraw::DrawRichAnno, PointsGui::ViewProviderPoints, MeshGui::ViewProviderMeshCurvature, Part::Mirroring, Part::Box, Sandbox::SandboxObject, TechDraw::DrawTile, Part::RuledSurface, Fem::ConstraintPlaneRotation, PartDesign::Hole, Fem::ConstraintPressure, Gui::ViewProviderGeometryObject, PathGui::ViewProviderPath, TechDrawGui::ViewProviderImage, FemGui::ViewProviderFemPostFunctionProvider, PartGui::ViewProviderSpline, PartDesign::FeatureBase, FemGui::ViewProviderFemPostObject, PartDesignGui::ViewProviderDatumPoint, PartDesign::Plane, PartDesign::Line, TechDraw::DrawWeldSymbol, PartGui::ViewProviderCustom, PartGui::ViewProviderPartReference, SketcherGui::ViewProviderCustom, InspectionGui::ViewProviderInspection, TechDraw::DrawParametricTemplate, MeshGui::ViewProviderMeshNode, Points::Feature, FemGui::ViewProviderFemConstraint, Mesh::Feature, PartGui::ViewProvider2DObject, Gui::ViewProviderAnnotation, Gui::ViewProviderOriginFeature, MeshGui::ViewProviderMeshDefects, RobotGui::ViewProviderRobotObject, Gui::ViewProviderTextDocument, TechDrawGui::ViewProviderDimension, TechDrawGui::ViewProviderBalloon, TechDrawGui::ViewProviderWeld, TechDrawGui::ViewProviderLeader, TechDrawGui::ViewProviderRichAnno, PartDesign::Chamfer, Sketcher::SketchObject, Part::Ellipse, Part::Line, App::VRMLObject, Part::Vertex, Surface::GeomFillSurface, Part::Circle, and PartDesignGui::ViewProviderDatumCoordinateSystem.
Referenced by draftviewproviders.view_base.ViewProviderDraft::attach(), ArchSite.Compass::buildCoordinates(), draftobjects.wire.Wire::execute(), App::Property::hasSetValue(), ArchAxis.CommandArchGrid::IsActive(), App::ExtensionContainer::onChanged(), App::Property::touch(), draftviewproviders.view_wpproxy.ViewProviderWorkingPlaneProxy::updateData(), draftviewproviders.view_label.ViewProviderLabel::updateData(), DraftLayer.ViewProviderLayer::updateData(), ArchBuildingPart.ViewProviderBuildingPart::updateData(), ArchPanel.ViewProviderPanelCut::updateData(), and ArchPanel.ViewProviderPanelSheet::updateData().
◆ onPropertyStatusChanged()
|
virtual |
Reimplemented in App::DocumentObject, and Gui::ViewProviderDocumentObject.
Referenced by App::Property::setStatusValue().
◆ removeDynamicProperty()
|
virtual |
Reimplemented in App::DocumentObject, and Gui::ViewProviderDocumentObject.
Referenced by App::TransactionObject::applyChn(), Gui::ViewProviderDocumentObject::removeDynamicProperty(), and Gui::ViewProviderPy::removeProperty().
◆ Restore()
|
virtual |
This method is used to restore properties from an XML document.
It uses the XMLReader class, which bases on SAX, to read the in Save() written information. Again the Vector as an example:
Implements Base::Persistence.
Reimplemented in App::Document, App::ExtensionContainer, PartDesign::Chamfer, Part::Part2DObject, Part::Primitive, Gui::ViewProvider, PartDesign::Transformed, PartDesign::ProfileBased, PartDesign::Fillet, Part::Box, App::VRMLObject, PartDesign::Hole, PartGui::ViewProvider2DObject, Points::Feature, Sketcher::SketchObject, and Robot::RobotObject.
References Base::XMLReader::clearPartialRestoreProperty(), Base::Console(), dynamicProps, Base::ConsoleSingleton::Error(), Base::XMLReader::getAttribute(), Base::XMLReader::getAttributeAsInteger(), Base::XMLReader::getAttributeAsUnsigned(), App::Property::getName(), getPropertyByName(), getPropertyType(), handleChangedPropertyName(), handleChangedPropertyType(), Base::XMLReader::hasAttribute(), App::Prop_Transient, App::Property::PropTransient, Base::XMLReader::readElement(), Base::XMLReader::readEndElement(), App::DynamicProperty::restore(), Base::XMLReader::setPartialRestore(), App::Property::setStatusValue(), App::Property::StatusBits, Base::XMLReader::testStatus(), and App::Property::Transient.
Referenced by App::ExtensionContainer::Restore(), and App::Document::Restore().
◆ Save()
|
virtual |
This method is used to save properties to an XML document.
A good example you'll find in PropertyStandard.cpp, e.g. the vector:
The writer.ind() expression writes the indentation, just for pretty printing of the XML. As you see, the writing of the XML document is not done with a DOM implementation because of performance reasons. Therefore the programmer has to take care that a valid XML document is written. This means closing tags and writing UTF-8.
- See also
- Base::Writer
Implements Base::Persistence.
Reimplemented in App::DocumentObject, App::Document, App::ExtensionContainer, App::VRMLObject, Sketcher::SketchObject, and Robot::RobotObject.
References Base::Console(), Base::Writer::decInd(), dynamicProps, Base::ConsoleSingleton::Error(), getPropertyMap(), getPropertyType(), Base::Writer::incInd(), Base::Writer::ind(), App::Prop_Transient, App::Property::PropDynamic, App::Property::PropNoPersist, App::DynamicProperty::save(), Base::Writer::Stream(), and App::Property::Transient.
Referenced by App::ExtensionContainer::Save(), and App::Document::Save().
◆ setPropertyPrefix()
void App::PropertyContainer::setPropertyPrefix | ( | const char * | prefix | ) |
Referenced by Gui::ViewProviderLink::onChanged().
◆ setPropertyStatus()
void PropertyContainer::setPropertyStatus | ( | unsigned char | bit, |
bool | value | ||
) |
set the Status bit of all properties at once
References getPropertyList().
Friends And Related Function Documentation
◆ DynamicProperty
|
friend |
◆ Property
Member Data Documentation
◆ dynamicProps
|
protected |
The documentation for this class was generated from the following files:
- src/App/PropertyContainer.h
- src/App/PropertyContainer.cpp