FreeCAD C++
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | List of all members
Part::BodyBase Class Reference

#include <Mod/Part/App/BodyBase.h>

Detailed Description

Base class of all body objects in FreeCAD A body is used, e.g. in PartDesign, to aggregate some modeling features to one shape. As long as not in edit or active on a workbench, the body shows only the resulting shape to the outside (Tip link).

Public Member Functions

std::vector< App::DocumentObject * > getFullModel ()
 Returns all Group objects prepanded by BaseFeature (if any)
 
bool isAfter (const App::DocumentObject *feature, const App::DocumentObject *target) const
 Return true if the feature belongs to the body and is located after the target.
 
- Public Member Functions inherited from Part::Feature
 Feature (void)
 Constructor.
 
virtual const char * getViewProviderName (void) const
 returns the type name of the ViewProvider
 
virtual short mustExecute (void) const
 
- Public Member Functions inherited from App::GeoFeature
 GeoFeature (void)
 Constructor.
 
virtual void transformPlacement (const Base::Placement &transform)
 transformPlacement applies transform to placement of this shape. Override this function to propagate the change of placement to base features, for example. By the time of writing this comment, the function was only called by alignment task (Edit->Alignment) More...
 
Base::Placement globalPlacement () const
 Calculates the placement in the global reference coordinate system. More...
 
- Public Member Functions inherited from App::DocumentObject
 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::DocumentgetDocument (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...
 
bool recomputeFeature ()
 Recompute only this feature.
 
const char * getStatusString (void) const
 get the status Message
 
virtual void onLostLinkToObject (DocumentObject *)
 
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
 
- Public Member Functions inherited from App::TransactionalObject
 TransactionalObject (void)
 Constructor.
 
- Public Member Functions inherited from App::ExtensionContainer
virtual PropertygetPropertyByName (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
 
- Public Member Functions inherited from App::PropertyContainer
 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
 
- Public Member Functions inherited from Base::Persistence
virtual void SaveDocFile (Writer &) const
 
virtual void RestoreDocFile (Reader &)
 
- Public Member Functions inherited from Base::BaseClass
 BaseClass ()
 Construction.
 
virtual ~BaseClass ()
 Destruction.
 
- Public Member Functions inherited from App::OriginGroupExtension
App::OrigingetOrigin () const
 Returns the origin link or throws an exception.
 
virtual const char * getViewProviderName () const
 returns the type name of the ViewProvider
 
virtual short extensionMustExecute () override
 Returns true on changing OriginFeature set.
 
- Public Member Functions inherited from App::GeoFeatureGroupExtension
virtual void transformPlacement (const Base::Placement &transform)
 transformPlacement applies transform to placement of this shape. Override this function to propagate the change of placement to base features. More...
 
 GeoFeatureGroupExtension (void)
 Constructor.
 
Base::Placement globalGroupPlacement ()
 Calculates the global placement of this group. More...
 

Static Public Member Functions

static BodyBasefindBodyOf (const App::DocumentObject *f)
 
- Static Public Member Functions inherited from Base::Persistence
static std::string encodeAttribute (const std::string &)
 Encodes an attribute upon saving.
 
- Static Public Member Functions inherited from App::OriginGroupExtension
static DocumentObjectgetGroupOfObject (const DocumentObject *obj)
 
- Static Public Member Functions inherited from App::GeoFeatureGroupExtension
static DocumentObjectgetGroupOfObject (const DocumentObject *obj)
 
static bool isNonGeoGroup (const DocumentObject *obj)
 Returns true if the given DocumentObject is DocumentObjectGroup but not GeoFeatureGroup.
 
static std::vector< App::DocumentObject * > getCSRelevantLinks (const App::DocumentObject *obj)
 
static bool areLinksValid (const App::DocumentObject *obj)
 
static bool isLinkValid (App::Property *link)
 

Public Attributes

App::PropertyLink Tip
 
App::PropertyLink BaseFeature
 
- Public Attributes inherited from App::OriginGroupExtension
PropertyLink Origin
 Origin linked to the group.
 

Protected Member Functions

virtual void onBeforeChange (const App::Property *prop)
 If BaseFeature is getting changed and Tip points to it reset the Tip.
 
virtual void onChanged (const App::Property *prop)
 If BaseFeature is set and Tip is null set the Tip to it.
 
- Protected Member Functions inherited from Part::Feature
virtual App::DocumentObjectExecReturnrecompute (void)
 recompute only this object
 
virtual App::DocumentObjectExecReturnexecute (void)
 recalculate the feature
 
ShapeHistory buildHistory (BRepBuilderAPI_MakeShape &, TopAbs_ShapeEnum type, const TopoDS_Shape &newS, const TopoDS_Shape &oldS)
 
- Protected Member Functions inherited from App::DocumentObject
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 Member Functions inherited from App::OriginGroupExtension
virtual App::DocumentObjectExecReturnextensionExecute () override
 Checks integrity of the Origin.
 
virtual void onExtendedSetupObject () override
 Creates the corresponding Origin object.
 
virtual void onExtendedUnsetupObject () override
 Removes all planes and axis if they are still linked to the document.
 

Additional Inherited Members

- Protected Attributes inherited from App::DocumentObject
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.
 

Member Function Documentation

◆ findBodyOf()

static BodyBase* Part::BodyBase::findBodyOf ( const App::DocumentObject f)
static

Return the body which this feature belongs too, or NULL. Note: Normally each PartDesign feature belongs to a single body, But if a body is based on the feature it also will be return... But there are could be more features based on the same body. TODO introduce a findBodiesOf() if needed (2015-08-04, Fat-Zer)

Member Data Documentation

◆ BaseFeature

App::PropertyLink Part::BodyBase::BaseFeature

A base object of the body, serves as a base object for the first feature of the body. A Part::Feature link to make bodies be able based upon non-PartDesign Features.

◆ Tip

App::PropertyLink Part::BodyBase::Tip

The final feature of the body it is associated with. Note: tip may either point to the BaseFeature or to some feature inside the Group list. in case it points to the model the PartDesign::Body guaranties that it is a solid.