The AttachableObject class is the thing to extend an object with that should be attachable. More...
#include <AttachExtension.h>
Public Member Functions | |
Attacher::AttachEngine & | attacher (void) const |
AttachExtension () | |
bool | changeAttacherType (const char *typeName) |
changeAttacherType More... | |
virtual App::DocumentObjectExecReturn * | extensionExecute (void) |
virtual short int | extensionMustExecute (void) |
virtual PyObject * | getExtensionPyObject (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::DocumentObjectExecReturn * | extensionExecute () |
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::DocumentObject * | getExtendedObject () |
const App::DocumentObject * | getExtendedObject () const |
virtual PyObject * | getExtensionPyObject () 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::ExtensionContainer * | getExtendedContainer () |
const App::ExtensionContainer * | getExtendedContainer () const |
virtual PyObject * | getExtensionPyObject () |
virtual void | initExtension (App::ExtensionContainer *obj) |
bool | isPythonExtension () |
std::string | name () const |
virtual | ~Extension () |
virtual Property * | extensionGetPropertyByName (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::PropertyPlacement & | getPlacement () 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 |
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.
AttachExtension::AttachExtension | ( | ) |
References Attacher::mmDeactivated, Attacher::mmDummy_NumberOfModes, and App::Prop_None.
|
virtual |
Attacher::AttachEngine & Part::AttachExtension::attacher | ( | void | ) | const |
Referenced by AttachmentEditor.TaskAttachmentEditor.AttachmentEditorTaskPanel::attachmentOffsetChanged(), AttachmentEditor.TaskAttachmentEditor.AttachmentEditorTaskPanel::checkBoxFlipClicked(), AttachmentEditor.TaskAttachmentEditor.AttachmentEditorTaskPanel::fillAllRefLines(), AttachmentEditor.TaskAttachmentEditor.AttachmentEditorTaskPanel::getCurrentMode(), AttachmentEditor.TaskAttachmentEditor.AttachmentEditorTaskPanel::modeSelected(), AttachmentEditor.TaskAttachmentEditor.AttachmentEditorTaskPanel::parseAllRefLines(), AttachmentEditor.TaskAttachmentEditor.AttachmentEditorTaskPanel::readParameters(), setAttacher(), AttachmentEditor.TaskAttachmentEditor.AttachmentEditorTaskPanel::updateListOfModes(), AttachmentEditor.TaskAttachmentEditor.AttachmentEditorTaskPanel::updatePreview(), AttachmentEditor.TaskAttachmentEditor.AttachmentEditorTaskPanel::updateRefButtons(), and AttachmentEditor.TaskAttachmentEditor.AttachmentEditorTaskPanel::writeParameters().
bool AttachExtension::changeAttacherType | ( | const char * | typeName | ) |
changeAttacherType
typeName | is the typename of new attacher class. Must be derived from Attacher::AttachEngine. |
References Base::Type::createInstanceByName(), Base::Type::fromName(), and setAttacher().
Referenced by extensionOnChanged().
|
virtual |
Reimplemented from App::DocumentObjectExtension.
References App::DocumentObjectExtension::extensionExecute(), isTouched_Mapping(), and positionBySupport().
|
virtual |
Reimplemented from App::DocumentObjectExtension.
|
protectedvirtual |
Reimplemented from App::Extension.
References AttacherType, AttachmentOffset, changeAttacherType(), Base::Console(), App::Error, Base::ConsoleSingleton::Error(), App::Extension::extensionOnChanged(), App::DocumentObjectExtension::getExtendedObject(), getPlacement(), App::PropertyEnumeration::getValue(), App::PropertyString::getValue(), MapMode, MapPathParameter, MapReversed, Attacher::mmConcentric, Attacher::mmFrenetNB, Attacher::mmFrenetTB, Attacher::mmFrenetTN, Attacher::mmNormalToPath, Attacher::mmRevolutionSection, Attacher::mmTranslate, positionBySupport(), App::Property::setReadOnly(), App::DocumentObject::setStatus(), App::Property::setStatus(), and Support.
|
protectedvirtual |
References AttachmentOffset, Base::Type::fromName(), Base::Persistence::getClassTypeId(), and App::PropertyPlacement::Restore().
Referenced by Part::Datum::handleChangedPropertyName(), Part::Part2DObject::handleChangedPropertyName(), Part::Primitive::handleChangedPropertyName(), and PartDesign::FeaturePrimitive::handleChangedPropertyName().
|
virtual |
Reimplemented from App::DocumentObjectExtension.
References App::Extension::ExtensionPythonObject.
|
protected |
References App::DocumentObjectExtension::getExtendedObject().
Referenced by extensionOnChanged(), isAttacherActive(), onExtendedDocumentRestored(), and positionBySupport().
bool AttachExtension::isAttacherActive | ( | ) | const |
Return whether this attacher is active.
References getPlacement().
|
virtual |
Referenced by extensionExecute().
|
virtual |
get called after a document has been fully restored
Reimplemented from App::DocumentObjectExtension.
References AttachmentOffset, getPlacement(), App::PropertyEnumeration::getValue(), MapMode, MapPathParameter, MapReversed, Attacher::mmConcentric, Attacher::mmFrenetNB, Attacher::mmFrenetTB, Attacher::mmFrenetTN, Attacher::mmNormalToPath, Attacher::mmRevolutionSection, Attacher::mmTranslate, positionBySupport(), App::Property::setReadOnly(), and App::Property::setStatus().
|
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().
|
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.
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().
void AttachExtension::updateAttacherVals | ( | ) |
References App::PropertyLinkSubList::getValue(), App::PropertyEnumeration::getValue(), MapMode, and Support.
Referenced by positionBySupport(), and setAttacher().
App::PropertyString Part::AttachExtension::AttacherType |
Referenced by extensionOnChanged(), and setAttacher().
App::PropertyPlacement Part::AttachExtension::AttachmentOffset |
App::PropertyEnumeration Part::AttachExtension::MapMode |
Referenced by PartGui::TaskDlgAttacher::accept(), extensionOnChanged(), PartDesign::ProfileBased::getSupportFace(), Part::Part2DObject::handleChangedPropertyType(), PartDesignGui::TaskFeaturePick::makeCopy(), onExtendedDocumentRestored(), PartGui::TaskAttacher::TaskAttacher(), and updateAttacherVals().
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().
App::PropertyBool Part::AttachExtension::MapReversed |
App::PropertyLinkSubList Part::AttachExtension::Support |
Referenced by PartGui::TaskDlgAttacher::accept(), PartDesignGui::TaskDlgDatumParameters::accept(), Sketcher::SketchObject::evaluateSupport(), extensionOnChanged(), PartDesignGui::fixSketchSupport(), PartDesign::ProfileBased::getBaseObject(), PartDesign::ProfileBased::getSupportFace(), PartDesignGui::TaskFeaturePick::makeCopy(), Sketcher::SketchObject::onChanged(), Part::Datum::onDocumentRestored(), PartDesign::ProfileBased::positionByPrevious(), SketcherGui::SketchSelection::setUp(), PartGui::TaskAttacher::TaskAttacher(), Part::Part2DObject::transformPlacement(), and updateAttacherVals().