App::LinkBaseExtension Class Reference

#include <Link.h>

Classes

struct  PropInfo
 

Public Types

enum  { LinkModeNone , LinkModeAutoDelete , LinkModeAutoLink , LinkModeAutoUnlink }
 

Public Member Functions

 LinkBaseExtension ()
 
virtual ~LinkBaseExtension ()
 
- Public Member Functions inherited from App::DocumentObjectExtension
 DocumentObjectExtension ()
 
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 onExtendedSettingDocument ()
 get called after setting the document More...
 
virtual void onExtendedSetupObject ()
 get called after a brand new object was created 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 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
 

Parameter definition

Parameter definition (Name, Type, Property Type, Default, Document).

The variadic is here so that the parameter can be extended by adding extra fields. See LINK_PARAM_EXT() for an example

enum  PropIndex { PropMax }
 
typedef std::map< std::string, PropInfoPropInfoMap
 
typedef std::map< const Property *, std::pair< LinkBaseExtension *, int > > LinkPropMap
 
std::vector< Property * > props
 
std::unordered_set< const App::DocumentObject * > myHiddenElements
 
std::vector< std::string > mySubElements
 
std::string mySubName
 
std::unordered_map< const App::DocumentObject *, boost::signals2::scoped_connection > plainGroupConns
 
long myOwner
 
std::unordered_map< std::string, int > myLabelCache
 
bool enableLabelCache
 
bool hasOldSubElement
 
bool checkingProperty = false
 
virtual void setProperty (int idx, Property *prop)
 
PropertygetProperty (int idx)
 
PropertygetProperty (const char *)
 
virtual const std::vector< PropInfo > & getPropertyInfo () const
 
virtual const PropInfoMapgetPropertyInfoMap () const
 
std::vector< DocumentObject * > getLinkedChildren (bool filter=true) const
 
const char * flattenSubname (const char *subname) const
 
void expandSubname (std::string &subname) const
 
DocumentObjectgetLink (int depth=0) const
 
Base::Matrix4D getTransform (bool transform) const
 
Base::Vector3d getScaleVector () const
 
App::GroupExtensionlinkedPlainGroup () const
 
bool linkTransform () const
 
const char * getSubName () const
 
const std::vector< std::string > & getSubElements () const
 
bool extensionGetSubObject (DocumentObject *&ret, const char *subname, PyObject **pyObj=0, Base::Matrix4D *mat=0, bool transform=false, int depth=0) const override
 Get the sub object by name. More...
 
bool extensionGetSubObjects (std::vector< std::string > &ret, int reason) const override
 Get name references of all sub objects. More...
 
bool extensionGetLinkedObject (DocumentObject *&ret, bool recurse, Base::Matrix4D *mat, bool transform, int depth) const override
 Get the linked object. More...
 
virtual App::DocumentObjectExecReturnextensionExecute (void) override
 
virtual short extensionMustExecute (void) override
 
virtual void extensionOnChanged (const Property *p) override
 
virtual void onExtendedUnsetupObject () override
 get called when object is going to be removed from the document More...
 
virtual void onExtendedDocumentRestored () override
 get called after a document has been fully restored More...
 
virtual int extensionSetElementVisible (const char *, bool) override
 
virtual int extensionIsElementVisible (const char *) override
 
virtual bool extensionHasChildElement () const override
 
virtual PyObjectgetExtensionPyObject (void) override
 
virtual PropertyextensionGetPropertyByName (const char *name) const override
 find a property by its name More...
 
int getElementIndex (const char *subname, const char **psubname=0) const
 
void elementNameFromIndex (int idx, std::ostream &ss) const
 
DocumentObjectgetContainer ()
 
const DocumentObjectgetContainer () const
 
void setLink (int index, DocumentObject *obj, const char *subname=0, const std::vector< std::string > &subs=std::vector< std::string >())
 
DocumentObjectgetTrueLinkedObject (bool recurse, Base::Matrix4D *mat=0, int depth=0, bool noElement=false) const
 
bool hasPlacement () const
 
void cacheChildLabel (int enable=-1) const
 
static int getArrayIndex (const char *subname, const char **psubname=0)
 
void parseSubName () const
 
void update (App::DocumentObject *parent, const Property *prop)
 
void syncElementList ()
 
void detachElement (App::DocumentObject *obj)
 
void checkGeoElementMap (const App::DocumentObject *obj, const App::DocumentObject *linked, PyObject **pyObj, const char *postfix) const
 
void updateGroup ()
 
void slotChangedPlainGroup (const App::DocumentObject &, const App::Property &)
 

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
 

Member Typedef Documentation

◆ LinkPropMap

typedef std::map<const Property*,std::pair<LinkBaseExtension*,int> > App::LinkBaseExtension::LinkPropMap

◆ PropInfoMap

typedef std::map<std::string, PropInfo> App::LinkBaseExtension::PropInfoMap

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
LinkModeNone 
LinkModeAutoDelete 
LinkModeAutoLink 
LinkModeAutoUnlink 

◆ PropIndex

Enumerator
PropMax 

Constructor & Destructor Documentation

◆ LinkBaseExtension()

LinkBaseExtension::LinkBaseExtension ( void  )

◆ ~LinkBaseExtension()

LinkBaseExtension::~LinkBaseExtension ( )
virtual

Member Function Documentation

◆ cacheChildLabel()

void LinkBaseExtension::cacheChildLabel ( int  enable = -1) const

◆ checkGeoElementMap()

void LinkBaseExtension::checkGeoElementMap ( const App::DocumentObject obj,
const App::DocumentObject linked,
PyObject **  pyObj,
const char *  postfix 
) const
protected

◆ detachElement()

void LinkBaseExtension::detachElement ( App::DocumentObject obj)
protected

◆ elementNameFromIndex()

void LinkBaseExtension::elementNameFromIndex ( int  idx,
std::ostream &  ss 
) const

◆ expandSubname()

void LinkBaseExtension::expandSubname ( std::string &  subname) const

◆ extensionExecute()

◆ extensionGetLinkedObject()

bool LinkBaseExtension::extensionGetLinkedObject ( DocumentObject *&  ret,
bool  recursive,
Base::Matrix4D mat,
bool  transform,
int  depth 
) const
overridevirtual

Get the linked object.

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

Reimplemented from App::DocumentObjectExtension.

References getContainer(), getTransform(), and getTrueLinkedObject().

◆ extensionGetPropertyByName()

Property * LinkBaseExtension::extensionGetPropertyByName ( const char *  name) const
overridevirtual

find a property by its name

Reimplemented from App::Extension.

References checkingProperty, App::Extension::extensionGetPropertyByName(), getContainer(), and getTrueLinkedObject().

◆ extensionGetSubObject()

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

◆ extensionGetSubObjects()

bool LinkBaseExtension::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.

References App::DocumentObject::getSubObjects(), getTrueLinkedObject(), mySubElements, and App::Extension::name().

◆ extensionHasChildElement()

bool LinkBaseExtension::extensionHasChildElement ( ) const
overridevirtual

◆ extensionIsElementVisible()

int LinkBaseExtension::extensionIsElementVisible ( const char *  element)
overridevirtual

◆ extensionMustExecute()

short LinkBaseExtension::extensionMustExecute ( void  )
overridevirtual

Reimplemented from App::DocumentObjectExtension.

References getLink().

◆ extensionOnChanged()

void LinkBaseExtension::extensionOnChanged ( const Property p)
overridevirtual

◆ extensionSetElementVisible()

int LinkBaseExtension::extensionSetElementVisible ( const char *  element,
bool  visible 
)
overridevirtual

◆ flattenSubname()

const char * LinkBaseExtension::flattenSubname ( const char *  subname) const

◆ getArrayIndex()

int LinkBaseExtension::getArrayIndex ( const char *  subname,
const char **  psubname = 0 
)
static

◆ getContainer() [1/2]

◆ getContainer() [2/2]

const DocumentObject * LinkBaseExtension::getContainer ( ) const

◆ getElementIndex()

◆ getExtensionPyObject()

PyObject * LinkBaseExtension::getExtensionPyObject ( void  )
overridevirtual

◆ getLink()

◆ getLinkedChildren()

std::vector< App::DocumentObject * > LinkBaseExtension::getLinkedChildren ( bool  filter = true) const

◆ getProperty() [1/2]

Property * LinkBaseExtension::getProperty ( const char *  name)

◆ getProperty() [2/2]

◆ getPropertyInfo()

const std::vector< LinkBaseExtension::PropInfo > & LinkBaseExtension::getPropertyInfo ( ) const
virtual

Referenced by getPropertyInfoMap(), and setProperty().

◆ getPropertyInfoMap()

const LinkBaseExtension::PropInfoMap & LinkBaseExtension::getPropertyInfoMap ( ) const
virtual

References getPropertyInfo().

Referenced by getProperty().

◆ getScaleVector()

Base::Vector3d LinkBaseExtension::getScaleVector ( ) const

◆ getSubElements()

const std::vector<std::string>& App::LinkBaseExtension::getSubElements ( ) const

◆ getSubName()

const char* App::LinkBaseExtension::getSubName ( ) const

Referenced by getTrueLinkedObject().

◆ getTransform()

Base::Matrix4D LinkBaseExtension::getTransform ( bool  transform) const

◆ getTrueLinkedObject()

◆ hasPlacement()

bool App::LinkBaseExtension::hasPlacement ( ) const

◆ linkedPlainGroup()

App::GroupExtension * LinkBaseExtension::linkedPlainGroup ( ) const

References getTrueLinkedObject(), and mySubElements.

Referenced by update(), and updateGroup().

◆ linkTransform()

bool LinkBaseExtension::linkTransform ( ) const

Referenced by getTrueLinkedObject().

◆ onExtendedDocumentRestored()

void LinkBaseExtension::onExtendedDocumentRestored ( )
overridevirtual

◆ onExtendedUnsetupObject()

void LinkBaseExtension::onExtendedUnsetupObject ( )
overridevirtual

get called when object is going to be removed from the document

Reimplemented from App::DocumentObjectExtension.

References detachElement().

◆ parseSubName()

void LinkBaseExtension::parseSubName ( ) const
protected

◆ setLink()

void LinkBaseExtension::setLink ( int  index,
DocumentObject obj,
const char *  subname = 0,
const std::vector< std::string > &  subs = std::vector<std::string>() 
)

◆ setProperty()

◆ slotChangedPlainGroup()

void LinkBaseExtension::slotChangedPlainGroup ( const App::DocumentObject obj,
const App::Property prop 
)
protected

References updateGroup().

Referenced by updateGroup().

◆ syncElementList()

void LinkBaseExtension::syncElementList ( )
protected

◆ update()

◆ updateGroup()

Member Data Documentation

◆ checkingProperty

bool App::LinkBaseExtension::checkingProperty = false
mutableprotected

◆ enableLabelCache

bool App::LinkBaseExtension::enableLabelCache
mutableprotected

◆ hasOldSubElement

bool App::LinkBaseExtension::hasOldSubElement
protected

◆ myHiddenElements

std::unordered_set<const App::DocumentObject*> App::LinkBaseExtension::myHiddenElements
protected

◆ myLabelCache

std::unordered_map<std::string,int> App::LinkBaseExtension::myLabelCache
mutableprotected

◆ myOwner

long App::LinkBaseExtension::myOwner
protected

◆ mySubElements

std::vector<std::string> App::LinkBaseExtension::mySubElements
mutableprotected

◆ mySubName

std::string App::LinkBaseExtension::mySubName
mutableprotected

Referenced by parseSubName().

◆ plainGroupConns

std::unordered_map<const App::DocumentObject*, boost::signals2::scoped_connection> App::LinkBaseExtension::plainGroupConns
protected

Referenced by updateGroup().

◆ props


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