Part::AttachExtension Class Reference

The AttachableObject class is the thing to extend an object with that should be attachable. More...

#include <AttachExtension.h>

Public Member Functions

Attacher::AttachEngineattacher (void) const
 
 AttachExtension ()
 
bool changeAttacherType (const char *typeName)
 changeAttacherType More...
 
virtual App::DocumentObjectExecReturnextensionExecute (void)
 
virtual short int extensionMustExecute (void)
 
virtual PyObjectgetExtensionPyObject (void)
 
bool isAttacherActive () const
 Return whether this attacher is active. More...
 
virtual bool isTouched_Mapping ()
 
virtual void onExtendedDocumentRestored ()
 get called after a document has been fully restored More...
 
virtual bool positionBySupport (void)
 calculate and update the Placement property based on the Support, and mode. More...
 
virtual void setAttacher (Attacher::AttachEngine *attacher)
 setAttacher sets the AttachEngine object. More...
 
void updateAttacherVals ()
 
virtual ~AttachExtension ()
 
- Public Member Functions inherited from App::DocumentObjectExtension
 DocumentObjectExtension ()
 
virtual App::DocumentObjectExecReturnextensionExecute ()
 
virtual bool extensionGetLinkedObject (DocumentObject *&ret, bool recursive, Base::Matrix4D *mat, bool transform, int depth) const
 Get the linked object. More...
 
virtual bool extensionGetSubObject (DocumentObject *&ret, const char *subname, PyObject **pyObj, Base::Matrix4D *mat, bool transform, int depth) const
 Get the sub object by name. More...
 
virtual bool extensionGetSubObjects (std::vector< std::string > &ret, int reason) const
 Get name references of all sub objects. More...
 
virtual bool extensionHasChildElement () const
 
virtual int extensionIsElementVisible (const char *)
 
virtual short extensionMustExecute ()
 
virtual int extensionSetElementVisible (const char *, bool)
 
App::DocumentObjectgetExtendedObject ()
 
const App::DocumentObjectgetExtendedObject () const
 
virtual PyObjectgetExtensionPyObject () override
 
virtual const char * getViewProviderExtensionName () 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 PyObjectgetExtensionPyObject ()
 
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
 

Public Attributes

App::PropertyString AttacherType
 
App::PropertyPlacement AttachmentOffset
 
App::PropertyEnumeration MapMode
 
App::PropertyFloat MapPathParameter
 MapPathParameter is a parameter value for mmNormalToPath (the sketch will be mapped normal to a curve at point specified by parameter (from 0.0 to 1.0, from start to end) ) More...
 
App::PropertyBool MapReversed
 
App::PropertyLinkSubList Support
 

Protected Member Functions

virtual void extensionOnChanged (const App::Property *)
 
virtual void extHandleChangedPropertyName (Base::XMLReader &reader, const char *TypeName, const char *PropName)
 
App::PropertyPlacementgetPlacement () const
 
- Protected Member Functions inherited from App::Extension
void initExtensionType (Base::Type type)
 

Additional Inherited Members

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

Detailed Description

The AttachableObject class is the thing to extend an object with that should be attachable.

It includes the required properties, and shortcuts for accessing the attachment math class.

Constructor & Destructor Documentation

◆ AttachExtension()

AttachExtension::AttachExtension ( )

◆ ~AttachExtension()

AttachExtension::~AttachExtension ( )
virtual

Member Function Documentation

◆ attacher()

◆ changeAttacherType()

bool AttachExtension::changeAttacherType ( const char *  typeName)

changeAttacherType

Parameters
typeNameis the typename of new attacher class. Must be derived from Attacher::AttachEngine.
Returns
true if attacher was changed. false if attacher is already of the type requested. Throws if invalid type is supplied.

References Base::Type::createInstanceByName(), Base::Type::fromName(), and setAttacher().

Referenced by extensionOnChanged().

◆ extensionExecute()

App::DocumentObjectExecReturn * AttachExtension::extensionExecute ( void  )
virtual

◆ extensionMustExecute()

short int AttachExtension::extensionMustExecute ( void  )
virtual

Reimplemented from App::DocumentObjectExtension.

◆ extensionOnChanged()

◆ extHandleChangedPropertyName()

◆ getExtensionPyObject()

PyObject * AttachExtension::getExtensionPyObject ( void  )
virtual

◆ getPlacement()

◆ isAttacherActive()

bool AttachExtension::isAttacherActive ( ) const

Return whether this attacher is active.

References getPlacement().

◆ isTouched_Mapping()

virtual bool Part::AttachExtension::isTouched_Mapping ( )
virtual

Referenced by extensionExecute().

◆ onExtendedDocumentRestored()

◆ positionBySupport()

bool AttachExtension::positionBySupport ( void  )
virtual

calculate and update the Placement property based on the Support, and mode.

Can throw FreeCAD and OCC exceptions. Returns true if attached, false if not, throws if attachment failed.

References getPlacement(), Attacher::mmDeactivated, App::PropertyPlacement::setValue(), and updateAttacherVals().

Referenced by extensionExecute(), extensionOnChanged(), onExtendedDocumentRestored(), and Part::Part2DObject::transformPlacement().

◆ setAttacher()

void AttachExtension::setAttacher ( Attacher::AttachEngine attacher)
virtual

setAttacher sets the AttachEngine object.

The class takes the ownership of the pointer, it will be deleted when the class is destroyed, or when a new attacher is set. The default attacher is AttachEngine3D.

Parameters
attacher.AttachableObject takes ownership and will delete it eventually.

References attacher(), AttacherType, Base::Type::getName(), Base::BaseClass::getTypeId(), App::PropertyString::getValue(), App::PropertyString::setValue(), and updateAttacherVals().

Referenced by changeAttacherType().

◆ updateAttacherVals()

void AttachExtension::updateAttacherVals ( )

Member Data Documentation

◆ AttacherType

App::PropertyString Part::AttachExtension::AttacherType

Referenced by extensionOnChanged(), and setAttacher().

◆ AttachmentOffset

◆ MapMode

◆ MapPathParameter

App::PropertyFloat Part::AttachExtension::MapPathParameter

MapPathParameter is a parameter value for mmNormalToPath (the sketch will be mapped normal to a curve at point specified by parameter (from 0.0 to 1.0, from start to end) )

Referenced by PartGui::TaskDlgAttacher::accept(), extensionOnChanged(), and onExtendedDocumentRestored().

◆ MapReversed

◆ Support


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