App::GroupExtension Class Reference

#include <GroupExtension.h>

Public Member Functions

 GroupExtension (void)
 Constructor. More...
 
virtual ~GroupExtension ()
 
- Public Member Functions inherited from App::DocumentObjectExtension
 DocumentObjectExtension ()
 
virtual bool extensionGetLinkedObject (DocumentObject *&ret, bool recursive, Base::Matrix4D *mat, bool transform, int depth) const
 Get the linked object. More...
 
virtual bool extensionHasChildElement () const
 
virtual int extensionIsElementVisible (const char *)
 
virtual short extensionMustExecute (void)
 
virtual int extensionSetElementVisible (const char *, bool)
 
App::DocumentObjectgetExtendedObject ()
 
const App::DocumentObjectgetExtendedObject () const
 
virtual const char * getViewProviderExtensionName (void) const
 returns the type name of the ViewProviderExtension which is automatically attached to the viewprovider object when it is initiated More...
 
virtual void onExtendedDocumentRestored ()
 get called after a document has been fully restored More...
 
virtual void onExtendedSettingDocument ()
 get called after setting the document More...
 
virtual void onExtendedSetupObject ()
 get called after a brand new object was created More...
 
virtual void onExtendedUnsetupObject ()
 get called when object is going to be removed from the document More...
 
virtual ~DocumentObjectExtension ()
 
- Public Member Functions inherited from App::Extension
 Extension ()
 
App::ExtensionContainergetExtendedContainer ()
 
const App::ExtensionContainergetExtendedContainer () const
 
virtual void initExtension (App::ExtensionContainer *obj)
 
bool isPythonExtension ()
 
std::string name () const
 
virtual ~Extension ()
 
virtual PropertyextensionGetPropertyByName (const char *name) const
 find a property by its name More...
 
virtual const char * extensionGetPropertyName (const Property *prop) const
 get the name of a property More...
 
virtual void extensionGetPropertyMap (std::map< std::string, Property * > &Map) const
 get all properties of the class (including properties of the parent) More...
 
virtual void extensionGetPropertyList (std::vector< Property * > &List) const
 get all properties of the class (including properties of the parent) More...
 
virtual short extensionGetPropertyType (const Property *prop) const
 get the Type of a Property More...
 
virtual short extensionGetPropertyType (const char *name) const
 get the Type of a named Property More...
 
virtual const char * extensionGetPropertyGroup (const Property *prop) const
 get the Group of a Property More...
 
virtual const char * extensionGetPropertyGroup (const char *name) const
 get the Group of a named Property More...
 
virtual const char * extensionGetPropertyDocumentation (const Property *prop) const
 get the Group of a Property More...
 
virtual const char * extensionGetPropertyDocumentation (const char *name) const
 get the Group of a named Property More...
 
virtual void extensionSave (Base::Writer &) const
 
virtual void extensionRestore (Base::XMLReader &)
 
bool extensionIsDerivedFrom (const Base::Type type) const
 

Object handling <br>

PropertyLinkList Group
 Properties. More...
 
virtual DocumentObjectaddObject (const char *sType, const char *pObjectName)
 Adds an object of sType with pObjectName to the document this group belongs to and append it to this group as well. More...
 
virtual std::vector< DocumentObject * > addObject (DocumentObject *obj)
 
virtual std::vector< DocumentObject * > addObjects (std::vector< DocumentObject * > obj)
 
virtual std::vector< DocumentObject * > setObjects (std::vector< DocumentObject * > obj)
 
virtual bool allowObject (DocumentObject *)
 
virtual std::vector< DocumentObject * > removeObject (DocumentObject *obj)
 Removes an object from this group. More...
 
virtual std::vector< DocumentObject * > removeObjects (std::vector< DocumentObject * > obj)
 Removes objects from this group. More...
 
virtual void removeObjectsFromDocument ()
 Removes all children objects from this group and the document. More...
 
DocumentObjectgetObject (const char *Name) const
 Returns the object of this group with Name. More...
 
virtual bool hasObject (const DocumentObject *obj, bool recursive=false) const
 Checks whether the object obj is part of this group. More...
 
bool isChildOf (const GroupExtension *group, bool recursive=true) const
 Checks whether this group object is a child (or sub-child if enabled) of the given group object. More...
 
const std::vector< DocumentObject * > & getObjects () const
 Returns a list of all objects this group does have. More...
 
std::vector< DocumentObject * > getObjectsOfType (const Base::Type &typeId) const
 Returns a list of all objects of typeId this group does have. More...
 
int countObjectsOfType (const Base::Type &typeId) const
 Returns the number of objects of typeId this group does have. More...
 
virtual PyObjectgetExtensionPyObject (void) override
 
virtual void extensionOnChanged (const Property *p) override
 
virtual bool extensionGetSubObject (DocumentObject *&ret, const char *subname, PyObject **pyObj, Base::Matrix4D *mat, bool transform, int depth) const override
 Get the sub object by name. More...
 
virtual bool extensionGetSubObjects (std::vector< std::string > &ret, int reason) const override
 Get name references of all sub objects. More...
 
virtual App::DocumentObjectExecReturnextensionExecute (void) override
 
std::vector< DocumentObject * > getAllChildren () const
 
void getAllChildren (std::vector< DocumentObject * > &, std::set< DocumentObject * > &) const
 
static DocumentObjectgetGroupOfObject (const DocumentObject *obj)
 Returns the object group of the document which the given object obj is part of. More...
 

Additional Inherited Members

- Protected Member Functions inherited from App::Extension
void initExtensionType (Base::Type type)
 
- Static Protected Member Functions inherited from App::Extension
static void initExtensionSubclass (Base::Type &toInit, const char *ClassName, const char *ParentName, Base::Type::instantiationMethod method=0)
 
- Protected Attributes inherited from App::Extension
bool m_isPythonExtension = false
 
Py::Object ExtensionPythonObject
 

Constructor & Destructor Documentation

◆ GroupExtension()

GroupExtension::GroupExtension ( void  )

◆ ~GroupExtension()

GroupExtension::~GroupExtension ( )
virtual

Member Function Documentation

◆ addObject() [1/2]

DocumentObject * GroupExtension::addObject ( const char *  sType,
const char *  pObjectName 
)
virtual

◆ addObject() [2/2]

std::vector< DocumentObject * > GroupExtension::addObject ( DocumentObject obj)
virtual

◆ addObjects()

◆ allowObject()

virtual bool App::GroupExtension::allowObject ( DocumentObject )
virtual

◆ countObjectsOfType()

int GroupExtension::countObjectsOfType ( const Base::Type typeId) const

Returns the number of objects of typeId this group does have.

References App::PropertyListsT< T, ListT, ParentT >::getValues(), and Group.

◆ extensionExecute()

App::DocumentObjectExecReturn * GroupExtension::extensionExecute ( void  )
overridevirtual

◆ extensionGetSubObject()

bool GroupExtension::extensionGetSubObject ( DocumentObject *&  ret,
const char *  subname,
PyObject **  pyObj,
Base::Matrix4D mat,
bool  transform,
int  depth 
) const
overridevirtual

◆ extensionGetSubObjects()

bool GroupExtension::extensionGetSubObjects ( std::vector< std::string > &  ret,
int  reason 
) const
overridevirtual

Get name references of all sub objects.

See also
DocumentObject::getSubObjects()
Returns
Return turn if handled, the sub object is returned in ret

Reimplemented from App::DocumentObjectExtension.

Reimplemented in App::GeoFeatureGroupExtension.

References App::PropertyListsT< T, ListT, ParentT >::getValues(), and Group.

◆ extensionOnChanged()

◆ getAllChildren() [1/2]

std::vector< App::DocumentObject * > GroupExtension::getAllChildren ( ) const

◆ getAllChildren() [2/2]

void GroupExtension::getAllChildren ( std::vector< DocumentObject * > &  res,
std::set< DocumentObject * > &  rset 
) const

◆ getExtensionPyObject()

PyObject * GroupExtension::getExtensionPyObject ( void  )
overridevirtual

◆ getGroupOfObject()

DocumentObject * GroupExtension::getGroupOfObject ( const DocumentObject obj)
static

Returns the object group of the document which the given object obj is part of.

In case this object is not part of a group 0 is returned.

Note
This only returns objects that are normal groups, not any special derived type like GeoFeatureGroups or OriginGroups. To retrieve those please use their appropriate functions

Referenced by PartDesign::Body::addObject(), addObjects(), App::LinkBaseExtension::elementNameFromIndex(), App::DocumentObjectPy::getParentGroup(), PartDesignGui::ViewProviderDatum::getRelevantBoundBox(), and Gui::LinkView::setChildren().

◆ getObject()

DocumentObject * GroupExtension::getObject ( const char *  Name) const

Returns the object of this group with Name.

If the group doesn't have such an object 0 is returned.

Note
This method might return 0 even if the document this group belongs to contains an object with this name.

References App::DocumentObject::getDocument(), App::DocumentObjectExtension::getExtendedObject(), App::Document::getObject(), and hasObject().

Referenced by App::GroupExtensionPy::getObject(), and Gui::DocumentObjectItem::testStatus().

◆ getObjects()

const std::vector< DocumentObject * > & GroupExtension::getObjects ( ) const

Returns a list of all objects this group does have.

References App::PropertyListsT< T, ListT, ParentT >::getValues(), and Group.

◆ getObjectsOfType()

std::vector< DocumentObject * > GroupExtension::getObjectsOfType ( const Base::Type typeId) const

Returns a list of all objects of typeId this group does have.

References App::PropertyListsT< T, ListT, ParentT >::getValues(), and Group.

◆ hasObject()

bool GroupExtension::hasObject ( const DocumentObject obj,
bool  recursive = false 
) const
virtual

Checks whether the object obj is part of this group.

Parameters
objthe object to check for.
recursiveif true check also if the obj is child of some sub group (default is false).

Reimplemented in App::OriginGroupExtension.

References App::DocumentObjectExtension::getExtendedObject(), App::PropertyListsT< T, ListT, ParentT >::getValues(), and Group.

Referenced by App::GroupExtensionPy::addObject(), addObjects(), App::GeoFeatureGroupExtension::addObjects(), getObject(), App::OriginGroupExtension::hasObject(), and App::GroupExtensionPy::hasObject().

◆ isChildOf()

bool GroupExtension::isChildOf ( const GroupExtension group,
bool  recursive = true 
) const

Checks whether this group object is a child (or sub-child if enabled) of the given group object.

References App::DocumentObjectExtension::getExtendedObject().

◆ removeObject()

std::vector< DocumentObject * > GroupExtension::removeObject ( DocumentObject obj)
virtual

Removes an object from this group.

Returns all objects that have been removed.

References removeObjects(), and draftgeoutils.general::vec().

Referenced by addObjects(), and App::GeoFeatureGroupExtension::addObjects().

◆ removeObjects()

std::vector< DocumentObject * > GroupExtension::removeObjects ( std::vector< DocumentObject * >  obj)
virtual

Removes objects from this group.

Returns all objects that have been removed.

Reimplemented in App::GeoFeatureGroupExtension.

References App::PropertyListsT< T, ListT, ParentT >::getValues(), Group, and App::PropertyLinkList::setValues().

Referenced by removeObject().

◆ removeObjectsFromDocument()

void GroupExtension::removeObjectsFromDocument ( )
virtual

◆ setObjects()

std::vector< DocumentObject * > GroupExtension::setObjects ( std::vector< DocumentObject * >  obj)
virtual

Member Data Documentation

◆ Group

PropertyLinkList App::GroupExtension::Group ( void  )

Properties.

Referenced by ReverseEngineeringGui::Segmentation::accept(), PartDesign::Body::addObject(), addObjects(), App::GeoFeatureGroupExtension::addObjects(), countObjectsOfType(), PartDesignGui::ViewProviderBody::dropObject(), Drawing::FeaturePage::execute(), PartDesign::Boolean::execute(), Import::ExportOCAF::exportObject(), Gui::ViewProviderGeoFeatureGroupExtension::extensionClaimChildren(), App::GeoFeatureGroupExtension::extensionGetSubObject(), extensionGetSubObject(), App::GeoFeatureGroupExtension::extensionGetSubObjects(), extensionGetSubObjects(), App::GeoFeatureGroupExtension::extensionOnChanged(), extensionOnChanged(), getAllChildren(), PartDesign::Body::getNextSolidFeature(), getObjects(), getObjectsOfType(), PartDesign::Body::getPrevSolidFeature(), TechDraw::ShapeExtractor::getShapes2d(), TechDraw::ShapeExtractor::getShapesFromObject(), PartDesign::Body::getSubObject(), GroupExtension(), Part::BodyBase::handleChangedPropertyName(), PartDesign::Boolean::handleChangedPropertyName(), hasObject(), PartDesign::Body::insertObject(), Part::BodyBase::isAfter(), PartDesign::Boolean::mustExecute(), PartDesign::Body::onChanged(), PartDesignGui::ViewProvider::onChanged(), PartDesignGui::ViewProviderBoolean::onDelete(), PartDesign::Body::onDocumentRestored(), PartDesignGui::TaskBooleanParameters::onSelectionChanged(), PartDesign::Body::removeObject(), removeObjects(), App::GeoFeatureGroupExtension::removeObjects(), removeObjectsFromDocument(), setObjects(), PartDesignGui::ViewProviderBody::setVisualBodyMode(), PartDesignGui::TaskBooleanParameters::TaskBooleanParameters(), FemGui::TaskFemConstraintFluidBoundary::TaskFemConstraintFluidBoundary(), PartDesignGui::ViewProviderBody::unifyVisualProperty(), and PartDesignGui::ViewProviderBody::updateData().


The documentation for this class was generated from the following files:
  • Sources/FreeCAD/src/App/GroupExtension.h
  • Sources/FreeCAD/src/App/GroupExtension.cpp