Gui::ViewProvider Class Reference

General interface for all visual stuff in FreeCAD This class is used to generate and handle all around visualizing and presenting objects from the FreeCAD App layer to the user. More...

#include <ViewProvider.h>

Public Member Functions

virtual bool canAddToSceneGraph () const
 Indicate whether to be added to scene graph or not. More...
 
virtual std::vector< App::DocumentObject * > claimChildren3D (void) const
 deliver the children belonging to this object this method is used to deliver the objects to the 3DView which should be grouped under its scene graph. More...
 
SoSeparatorgetAnnotation (void)
 
virtual SoSeparatorgetBackRoot (void) const
 
virtual SoGroupgetChildRoot (void) const
 
virtual SoSeparatorgetFrontRoot (void) const
 
SoSwitch * getModeSwitch (void) const
 
virtual SoSeparatorgetRoot (void) const
 
SoTransform * getTransformNode () const
 
 ViewProvider ()
 constructor. More...
 
virtual ~ViewProvider ()
 destructor. More...
 
Selection handling

This group of methods do the selection handling.

Here you can define how the selection for your ViewProfider works.

virtual bool useNewSelectionModel (void) const
 indicates if the ViewProvider use the new Selection model More...
 
virtual bool isSelectable (void) const
 
virtual bool getElementPicked (const SoPickedPoint *, std::string &subname) const
 return a hit element given the picked point which contains the full node path More...
 
virtual std::string getElement (const SoDetail *) const
 return a hit element to the selection path or 0 More...
 
virtual SoDetail * getDetail (const char *) const
 return the coin node detail of the subelement More...
 
virtual bool getDetailPath (const char *subname, SoFullPath *pPath, bool append, SoDetail *&det) const
 return the coin node detail and path to the node of the subelement More...
 
int partialRender (const std::vector< std::string > &subelements, bool clear)
 partial rendering setup More...
 
virtual std::vector< Base::Vector3dgetModelPoints (const SoPickedPoint *) const
 
virtual std::vector< Base::Vector3dgetSelectionShape (const char *Element) const
 return the highlight lines for a given element or the whole shape More...
 
Base::BoundBox3d getBoundingBox (const char *subname=0, bool transform=true, MDIView *view=0) const
 Return the bound box of this view object. More...
 
virtual bool onDelete (const std::vector< std::string > &subNames)
 Get called if the object is about to get deleted. More...
 
virtual void beforeDelete ()
 Called before deletion. More...
 
virtual bool canDelete (App::DocumentObject *obj) const
 Asks the view provider if the given object that is part of its outlist can be removed from there without breaking it. More...
 
Drag and drop

To enable drag and drop you have to re-implement canDragObjects() and canDropObjects() to return true.

For finer control you can also re-implement canDragObject() or canDropObject() to filter certain object types, by default these methods don't filter any types. To take action of drag and drop the method dragObject() and dropObject() must be re-implemented, too.

virtual bool canDragObjects () const
 Check whether children can be removed from the view provider by drag and drop. More...
 
virtual bool canDragObject (App::DocumentObject *) const
 Check whether the object can be removed from the view provider by drag and drop. More...
 
virtual void dragObject (App::DocumentObject *)
 Remove a child from the view provider by drag and drop. More...
 
virtual bool canDropObjects () const
 Check whether objects can be added to the view provider by drag and drop or drop only. More...
 
virtual bool canDropObject (App::DocumentObject *) const
 Check whether the object can be dropped to the view provider by drag and drop or drop only. More...
 
virtual bool canDragAndDropObject (App::DocumentObject *) const
 Return false to force drop only operation for a given object. More...
 
virtual void dropObject (App::DocumentObject *)
 Add an object to the view provider by drag and drop. More...
 
virtual bool canDropObjectEx (App::DocumentObject *obj, App::DocumentObject *owner, const char *subname, const std::vector< std::string > &elements) const
 Query object dropping with full qualified name. More...
 
virtual std::string getDropPrefix () const
 return a subname referencing the sub-object holding the dropped objects More...
 
virtual std::string dropObjectEx (App::DocumentObject *obj, App::DocumentObject *owner, const char *subname, const std::vector< std::string > &elements)
 Add an object with full qualified name to the view provider by drag and drop. More...
 
virtual int replaceObject (App::DocumentObject *oldObj, App::DocumentObject *newObj)
 Replace an object to the view provider by drag and drop. More...
 
virtual bool showInTree () const
 Tell the tree view if this object should appear there. More...
 
virtual bool canRemoveChildrenFromRoot () const
 Tell the tree view to remove children items from the tree root. More...
 
Display mode methods
std::string getActiveDisplayMode (void) const
 
virtual void setDisplayMode (const char *ModeName)
 set the display mode More...
 
virtual const char * getDefaultDisplayMode () const
 get the default display mode More...
 
virtual std::vector< std::string > getDisplayModes (void) const
 returns a list of all possible display modes More...
 
virtual void hide (void)
 Hides the view provider. More...
 
virtual void show (void)
 Shows the view provider. More...
 
virtual bool isShow (void) const
 checks whether the view provider is visible or not More...
 
void setVisible (bool)
 
bool isVisible () const
 
void setLinkVisible (bool)
 
bool isLinkVisible () const
 
virtual void setOverrideMode (const std::string &mode)
 Overrides the display mode with mode. More...
 
const std::string getOverrideMode ()
 
Task panel

With this interface the ViewProvider can steer the appearance of widgets in the task view

virtual void getTaskViewContent (std::vector< Gui::TaskView::TaskContent * > &) const
 get a list of TaskBoxes associated with this object More...
 
virtual bool keyPressed (bool pressed, int key)
 is called when the provider is in edit and a key event occurs. Only ESC ends edit. More...
 
virtual const char * getTransactionText () const
 Is called by the tree if the user double clicks on the object. More...
 
virtual bool doubleClicked (void)
 is called by the tree if the user double clicks on the object More...
 
virtual bool mouseMove (const SbVec2s &cursorPos, View3DInventorViewer *viewer)
 is called when the provider is in edit and the mouse is moved More...
 
virtual bool mouseButtonPressed (int button, bool pressed, const SbVec2s &cursorPos, const View3DInventorViewer *viewer)
 is called when the Provider is in edit and the mouse is clicked More...
 
virtual void setupContextMenu (QMenu *, QObject *, const char *)
 set up the context-menu with the supported edit modes More...
 
- Public Member Functions inherited from App::TransactionalObject
virtual const char * detachFromDocument ()
 
virtual bool isAttachedToDocument () const
 
 TransactionalObject (void)
 Constructor. More...
 
virtual ~TransactionalObject ()
 
- Public Member Functions inherited from App::ExtensionContainer
ExtensionIterator extensionBegin ()
 
 ExtensionContainer ()
 
ExtensionIterator extensionEnd ()
 
App::ExtensiongetExtension (Base::Type, bool derived=true, bool no_except=false) const
 
App::ExtensiongetExtension (const std::string &name) const
 
template<typename ExtensionT >
ExtensionTgetExtensionByType (bool no_except=false, bool derived=true) const
 
std::vector< Extension * > getExtensionsDerivedFrom (Base::Type type) const
 
template<typename ExtensionT >
std::vector< ExtensionT * > getExtensionsDerivedFromType () const
 
bool hasExtension (Base::Type, bool derived=true) const
 
bool hasExtension (const std::string &name) const
 
bool hasExtensions () const
 
void registerExtension (Base::Type extension, App::Extension *ext)
 
virtual ~ExtensionContainer ()
 
virtual PropertygetPropertyByName (const char *name) const override
 find a property by its name More...
 
virtual const char * getPropertyName (const Property *prop) const override
 get the name of a property More...
 
virtual void getPropertyMap (std::map< std::string, Property * > &Map) const override
 get all properties of the class (including properties of the parent) More...
 
virtual void getPropertyList (std::vector< Property * > &List) const override
 get all properties of the class (including properties of the parent) More...
 
virtual short getPropertyType (const Property *prop) const override
 get the Type of a Property More...
 
virtual short getPropertyType (const char *name) const override
 get the Type of a named Property More...
 
virtual const char * getPropertyGroup (const Property *prop) const override
 get the Group of a Property More...
 
virtual const char * getPropertyGroup (const char *name) const override
 get the Group of a named Property More...
 
virtual const char * getPropertyDocumentation (const Property *prop) const override
 get the Group of a Property More...
 
virtual const char * getPropertyDocumentation (const char *name) const override
 get the Group of a named Property More...
 
virtual void Save (Base::Writer &writer) const override
 This method is used to save properties to an XML document. More...
 
void saveExtensions (Base::Writer &writer) const
 
void restoreExtensions (Base::XMLReader &reader)
 
- Public Member Functions inherited from App::PropertyContainer
virtual App::PropertyaddDynamicProperty (const char *type, const char *name=0, const char *group=0, const char *doc=0, short attr=0, bool ro=false, bool hidden=false)
 
virtual App::PropertygetDynamicPropertyByName (const char *name) const
 
DynamicProperty::PropData getDynamicPropertyData (const Property *prop) const
 
virtual std::vector< std::string > getDynamicPropertyNames () const
 
virtual std::string getFullName () const
 
virtual unsigned int getMemSize (void) const
 This method is used to get the size of objects It is not meant to have the exact size, it is more or less an estimation which runs fast! Is it two bytes or a GB? More...
 
const char * getPropertyPrefix () const
 
bool isHidden (const char *name) const
 check if the named property is hidden More...
 
bool isHidden (const Property *prop) const
 check if the property is hidden More...
 
bool isReadOnly (const char *name) const
 check if the named property is read-only More...
 
bool isReadOnly (const Property *prop) const
 check if the property is read-only More...
 
virtual void onPropertyStatusChanged (const Property &prop, unsigned long oldStatus)
 
 PropertyContainer ()
 A constructor. More...
 
virtual bool removeDynamicProperty (const char *name)
 
void setPropertyPrefix (const char *prefix)
 
void setPropertyStatus (unsigned char bit, bool value)
 set the Status bit of all properties at once More...
 
virtual ~PropertyContainer ()
 A destructor. More...
 
- Public Member Functions inherited from Base::Persistence
void dumpToStream (std::ostream &stream, int compression)
 
virtual Base::Type getTypeId (void) const
 
virtual void RestoreDocFile (Reader &)
 This method is used to restore large amounts of data from a file In this method you simply stream in your SaveDocFile() saved data. More...
 
void restoreFromStream (std::istream &stream)
 
virtual void SaveDocFile (Writer &) const
 This method is used to save large amounts of data to a binary file. More...
 
- Public Member Functions inherited from Base::BaseClass
 BaseClass ()
 Construction. More...
 
bool isDerivedFrom (const Type type) const
 
virtual void setPyObject (PyObject *)
 
virtual ~BaseClass ()
 Destruction. More...
 

Edit methods

if the Viewprovider goes in edit mode you can handle most of the events in the viewer by yourself

enum  EditMode { Default = 0 , Transform , Cutting , Color }
 
virtual ViewProviderstartEditing (int ModNum=0)
 
bool isEditing () const
 
void finishEditing ()
 
virtual void setEditViewer (View3DInventorViewer *, int ModNum)
 adjust viewer settings when editing a view provider More...
 
virtual void unsetEditViewer (View3DInventorViewer *)
 restores viewer settings when leaving editing mode More...
 
virtual bool setEdit (int ModNum)
 is called by the document when the provider goes in edit mode More...
 
virtual void unsetEdit (int ModNum)
 is called when you lose the edit mode More...
 
int getEditingMode () const
 return the edit mode or -1 if nothing is being edited More...
 

Signals of the view provider

boost::signals2::signal< void()> signalChangeIcon
 signal on icon change More...
 
boost::signals2::signal< void(const QString &)> signalChangeToolTip
 signal on tooltip change More...
 
boost::signals2::signal< void(const QString &)> signalChangeStatusTip
 signal on status tip change More...
 
virtual void update (const App::Property *)
 update the content of the ViewProvider this method have to implement the recalculation of the ViewProvider. More...
 
virtual void updateData (const App::Property *)
 
bool isUpdatesEnabled () const
 
void setUpdatesEnabled (bool enable)
 
unsigned long getStatus () const
 return the status bits More...
 
bool testStatus (ViewStatus pos) const
 
void setStatus (ViewStatus pos, bool on)
 
std::string toString () const
 
PyObjectgetPyObject ()
 This method returns the Python wrapper for a C++ object. More...
 

Methods used by the Tree

If you want to take control over the viewprovider specific overlay icons, that will be grayed out together with the base icon, you can reimplement this method.

SoSeparatorpcRoot
 The root Separator of the ViewProvider. More...
 
SoTransform * pcTransform
 this is transformation for the provider More...
 
const char * sPixmap
 
SoSwitch * pcModeSwitch
 this is the mode switch, all the different viewing modes are collected here More...
 
SoSeparatorpcAnnotation
 The root separator for annotations. More...
 
ViewProviderPypyViewObject
 
std::string overrideMode
 
std::bitset< 32 > StatusBits
 
virtual QIcon getIcon (void) const
 deliver the icon shown in the tree view More...
 
virtual QIcon mergeColorfulOverlayIcons (const QIcon &orig) const
 
virtual std::vector< App::DocumentObject * > claimChildren (void) const
 deliver the children belonging to this object this method is used to deliver the objects to the tree framework which should be grouped under its label. More...
 
virtual QIcon mergeGreyableOverlayIcons (const QIcon &orig) const
 
virtual void setModeSwitch ()
 Turn on mode switch. More...
 

Color management methods

virtual std::map< std::string, App::ColorgetElementColors (const char *element=0) const
 
virtual void setElementColors (const std::map< std::string, App::Color > &colors)
 
static const std::string & hiddenMarker ()
 
static const char * hasHiddenMarker (const char *subname)
 

direct handling methods

This group of methods is to direct influence the appearance of the viewed content.

It's only for fast interactions! If you want to set the visual parameters you have to do it on the object viewed by this provider!

virtual void setTransformation (const Base::Matrix4D &rcMatrix)
 set the viewing transformation of the provider More...
 
virtual void setTransformation (const SbMatrix &rcMatrix)
 
virtual MDIViewgetMDIView () const
 
virtual void Restore (Base::XMLReader &reader)
 This method is used to restore properties from an XML document. More...
 
bool isRestoring ()
 
static SbMatrix convert (const Base::Matrix4D &rcMatrix)
 
static Base::Matrix4D convert (const SbMatrix &sbMat)
 
static void eventCallback (void *ud, SoEventCallback *node)
 

Display mask modes

Mainly controls an SoSwitch node which selects the display mask modes.

The number of display mask modes doesn't necessarily match with the number of display modes. E.g. various display modes like Gaussian curvature, mean curvature or gray values are displayed by one display mask mode that handles color values.

void addDisplayMaskMode (SoNode *node, const char *type)
 Adds a new display mask mode. More...
 
void setDisplayMaskMode (const char *type)
 Activates the display mask mode type. More...
 
SoNodegetDisplayMaskMode (const char *type) const
 Get the node to the display mask mode type. More...
 
std::vector< std::string > getDisplayMaskModes () const
 Returns a list of added display mask modes. More...
 
void setDefaultMode (int)
 
int getDefaultMode () const
 
virtual void setRenderCacheMode (int)
 
bool checkRecursion (SoNode *)
 Helper method to check that the node is valid, i.e. More...
 
SoPickedPoint * getPointOnRay (const SbVec2s &pos, const View3DInventorViewer *viewer) const
 Helper method to get picked entities while editing. More...
 
SoPickedPoint * getPointOnRay (const SbVec3f &pos, const SbVec3f &dir, const View3DInventorViewer *viewer) const
 Helper method to get picked entities while editing. More...
 
void onBeforeChange (const App::Property *prop)
 Reimplemented from subclass. More...
 
void onChanged (const App::Property *prop)
 Reimplemented from subclass. More...
 

Additional Inherited Members

- Public Types inherited from App::ExtensionContainer
typedef std::map< Base::Type, App::Extension * >::iterator ExtensionIterator
 
- Static Public Member Functions inherited from Base::Persistence
static void * create (void)
 
static std::string encodeAttribute (const std::string &)
 Encodes an attribute upon saving. More...
 
static Base::Type getClassTypeId (void)
 
static void init (void)
 
- Static Public Member Functions inherited from Base::BaseClass
static void * create (void)
 
static Type getClassTypeId (void)
 
static void init (void)
 
- Protected Member Functions inherited from App::TransactionalObject
void onBeforeChangeProperty (Document *doc, const Property *prop)
 
- Protected Member Functions inherited from App::PropertyContainer
virtual const PropertyDatagetPropertyData (void) const
 
virtual void handleChangedPropertyName (Base::XMLReader &reader, const char *TypeName, const char *PropName)
 PropertyContainer::handleChangedPropertyName is called during restore to possibly fix reading of older versions of this property container. More...
 
virtual void handleChangedPropertyType (Base::XMLReader &reader, const char *TypeName, Property *prop)
 PropertyContainer::handleChangedPropertyType is called during restore to possibly fix reading of older versions of the property container. More...
 
- Static Protected Member Functions inherited from App::PropertyContainer
static const PropertyDatagetPropertyDataPtr (void)
 
- Static Protected Member Functions inherited from Base::BaseClass
static void initSubclass (Base::Type &toInit, const char *ClassName, const char *ParentName, Type::instantiationMethod method=nullptr)
 
- Protected Attributes inherited from App::PropertyContainer
DynamicProperty dynamicProps
 

Detailed Description

General interface for all visual stuff in FreeCAD This class is used to generate and handle all around visualizing and presenting objects from the FreeCAD App layer to the user.

This class and its descendents have to be implemented for any object type in order to show them in the 3DView and TreeView.

Member Enumeration Documentation

◆ EditMode

Enumerator
Default 
Transform 
Cutting 
Color 

Constructor & Destructor Documentation

◆ ViewProvider()

ViewProvider::ViewProvider ( )

constructor.

References Gui::UpdateData.

◆ ~ViewProvider()

ViewProvider::~ViewProvider ( )
virtual

Member Function Documentation

◆ addDisplayMaskMode()

◆ beforeDelete()

void ViewProvider::beforeDelete ( )
virtual

Called before deletion.

Unlike onDelete(), this function is guaranteed to be called before deletion, either by Document::remObject(), or on document deletion.

Reimplemented in SpreadsheetGui::ViewProviderSheet.

Referenced by Gui::ViewProviderLink::onBeforeChange(), and Gui::Document::slotDeletedObject().

◆ canAddToSceneGraph()

virtual bool Gui::ViewProvider::canAddToSceneGraph ( ) const
virtual

Indicate whether to be added to scene graph or not.

Referenced by Gui::View3DInventorViewer::addViewProvider(), and Gui::Document::toggleInSceneGraph().

◆ canDelete()

◆ canDragAndDropObject()

bool ViewProvider::canDragAndDropObject ( App::DocumentObject obj) const
virtual

Return false to force drop only operation for a given object.

Reimplemented in PartDesignGui::ViewProviderSubShapeBinder, and Gui::ViewProviderLink.

Referenced by Gui::ViewProviderPy::canDragAndDropObject(), Gui::TreeWidget::dragMoveEvent(), and Gui::TreeWidget::dropEvent().

◆ canDragObject()

◆ canDragObjects()

◆ canDropObject()

◆ canDropObjectEx()

bool ViewProvider::canDropObjectEx ( App::DocumentObject obj,
App::DocumentObject owner,
const char *  subname,
const std::vector< std::string > &  elements 
) const
virtual

Query object dropping with full qualified name.

Tree view now calls this function instead of canDropObject(), and may query for objects from other document. The default implementation (actually in ViewProviderDocumentObject) inhibites cross document dropping, and calls canDropObject(obj) for the rest. Override this function to enable cross document linking.

Parameters
objthe object being dropped
ownerthe (grand)parent object of the dropping object. Maybe null. This may not be the top parent object, as tree view will try to find a parent of the dropping object relative to this object to avoid cyclic dependency
subnamesubname reference to the dropping object
elementsnon-object sub-elements, e.g. Faces, Edges, selected when the object is being dropped
Returns
Return whether the dropping action is allowed.

Reimplemented in Gui::ViewProviderLink, PartDesignGui::ViewProviderSubShapeBinder, and Gui::ViewProviderDocumentObject.

References canDropObject().

Referenced by Gui::ViewProviderPy::canDropObject().

◆ canDropObjects()

◆ canRemoveChildrenFromRoot()

virtual bool Gui::ViewProvider::canRemoveChildrenFromRoot ( ) const
virtual

Tell the tree view to remove children items from the tree root.

Referenced by Gui::DocumentObjectData::DocumentObjectData().

◆ checkRecursion()

bool ViewProvider::checkRecursion ( SoNode node)
protected

Helper method to check that the node is valid, i.e.

it must not cause and infinite recursion.

References Gui::addNodes().

Referenced by Gui::ViewProviderVRMLObject::updateData().

◆ claimChildren()

std::vector< App::DocumentObject * > ViewProvider::claimChildren ( void  ) const
virtual

deliver the children belonging to this object this method is used to deliver the objects to the tree framework which should be grouped under its label.

Obvious is the usage in the group but it can be used for any kind of grouping needed for a special purpose.

Reimplemented in TechDrawGui::ViewProviderPage, PartDesignGui::ViewProviderSubShapeBinder, Gui::ViewProviderLink, TechDrawGui::ViewProviderWeld, TechDrawGui::ViewProviderViewSection, TechDrawGui::ViewProviderViewPart, TechDrawGui::ViewProviderViewClip, TechDrawGui::ViewProviderProjGroup, TechDrawGui::ViewProviderLeader, RobotGui::ViewProviderTrajectoryDressUp, RobotGui::ViewProviderTrajectoryCompound, PathGui::ViewProviderPathShape, PathGui::ViewProviderPathCompound, PathGui::ViewProviderAreaView, PathGui::ViewProviderArea, PartDesignGui::ViewProviderSketchBased, PartDesignGui::ViewProviderPipe, PartDesignGui::ViewProviderMultiTransform, PartDesignGui::ViewProviderMainPart, PartDesignGui::ViewProviderLoft, PartDesignGui::ViewProviderHole, PartDesignGui::ViewProviderHelix, PartGui::ViewProviderFace, PartGui::ViewProviderThickness, PartGui::ViewProviderOffset, PartGui::ViewProviderSweep, PartGui::ViewProviderLoft, PartGui::ViewProviderRevolution, PartGui::ViewProviderExtrusion, PartGui::ViewProviderMultiCommon, PartGui::ViewProviderMultiFuse, PartGui::ViewProviderBoolean, FemGui::ViewProviderFemPostPipeline, FemGui::ViewProviderFemPostFunctionProvider, FemGui::ViewProviderFemConstraint, FemGui::ViewProviderFemAnalysis, Gui::ViewProviderOrigin, PartGui::ViewProviderRuledSurface, PartGui::ViewProviderChamfer, PartGui::ViewProviderFillet, PartGui::ViewProviderMirror, and PartGui::ViewProviderCompound.

References draftgeoutils.general::vec().

Referenced by Gui::Document::addRootObjectsToGroup(), Gui::ViewProviderPy::claimChildren(), FemGui::ViewProviderFemAnalysis::claimChildren(), Gui::ViewProviderGeoFeatureGroupExtension::extensionClaimChildren(), femviewprovider.view_mesh_gmsh.VPMeshGmsh::onDelete(), femviewprovider.view_result_mechanical.VPResultMechanical::onDelete(), BOPTools.JoinFeatures.ViewProviderConnect::onDelete(), BOPTools.SplitFeatures.ViewProviderBooleanFragments::onDelete(), BOPTools.SplitFeatures.ViewProviderSlice::onDelete(), BOPTools.SplitFeatures.ViewProviderXOR::onDelete(), and Gui::DocumentObjectData::updateChildren().

◆ claimChildren3D()

std::vector< App::DocumentObject * > ViewProvider::claimChildren3D ( void  ) const
virtual

deliver the children belonging to this object this method is used to deliver the objects to the 3DView which should be grouped under its scene graph.

This affects the visibility and the 3D position of the object.

Reimplemented in FemGui::ViewProviderFemPostPipeline, FemGui::ViewProviderFemPostFunctionProvider, and Gui::ViewProviderOrigin.

References draftgeoutils.general::vec().

Referenced by Gui::LinkInfo::updateChildren().

◆ convert() [1/2]

◆ convert() [2/2]

Base::Matrix4D ViewProvider::convert ( const SbMatrix &  sbMat)
static

◆ doubleClicked()

virtual bool Gui::ViewProvider::doubleClicked ( void  )
virtual

is called by the tree if the user double clicks on the object

Reimplemented in TechDrawGui::ViewProviderPage, TechDrawGui::ViewProviderHatch, TechDrawGui::ViewProviderGeomHatch, SpreadsheetGui::ViewProviderSheet, SketcherGui::ViewProviderSketch, PartDesignGui::ViewProviderDatum, PartDesignGui::ViewProviderBody, PartDesignGui::ViewProvider, Gui::ViewProviderPart, Gui::ViewProviderDragger, TechDrawGui::ViewProviderWeld, TechDrawGui::ViewProviderViewSection, TechDrawGui::ViewProviderViewPart, TechDrawGui::ViewProviderRichAnno, TechDrawGui::ViewProviderProjGroupItem, TechDrawGui::ViewProviderProjGroup, TechDrawGui::ViewProviderLeader, TechDrawGui::ViewProviderDimension, TechDrawGui::ViewProviderBalloon, RobotGui::ViewProviderEdge2TracObject, RaytracingGui::ViewProviderPovray, RaytracingGui::ViewProviderLux, PartDesignGui::ViewProviderBase, PartGui::ViewProviderPart, MeshGui::ViewProviderMesh, FemGui::ViewProviderSetNodes, FemGui::ViewProviderSetGeometry, FemGui::ViewProviderSetFaces, FemGui::ViewProviderSetElements, FemGui::ViewProviderFemPostObject, FemGui::ViewProviderFemPostFunction, FemGui::ViewProviderFemAnalysis, DrawingGui::ViewProviderDrawingPage, Gui::ViewProviderMaterialObject, Gui::ViewProviderAnnotationLabel, PartDesignGui::ViewProviderSubShapeBinder, Gui::ViewProviderLink, PartDesignGui::ViewProviderPipe, PartDesignGui::ViewProviderLoft, and Gui::ViewProviderTextDocument.

Referenced by Gui::ViewProviderLink::doubleClicked(), PartDesignGui::makeBody(), and Gui::TreeWidget::mouseDoubleClickEvent().

◆ dragObject()

◆ dropObject()

◆ dropObjectEx()

std::string ViewProvider::dropObjectEx ( App::DocumentObject obj,
App::DocumentObject owner,
const char *  subname,
const std::vector< std::string > &  elements 
)
virtual

Add an object with full qualified name to the view provider by drag and drop.

Parameters
objthe object being dropped
ownerthe (grand)parent object of the dropping object. Maybe null. This may not be the top parent object, as tree view will try to find a parent of the dropping object relative to this object to avoid cyclic dependency
subnamesubname reference to the dropping object
elementsnon-object sub-elements, e.g. Faces, Edges, selected when the object is being dropped
Returns
Optionally returns a subname reference locating the dropped object, which may or may not be the actual dropped object, e.g. it may be a link.

Reimplemented in Gui::ViewProviderLink, and PartDesignGui::ViewProviderSubShapeBinder.

References dropObject().

Referenced by Gui::TreeWidget::dropEvent(), and Gui::ViewProviderPy::dropObject().

◆ eventCallback()

◆ finishEditing()

◆ getActiveDisplayMode()

◆ getAnnotation()

SoSeparator * ViewProvider::getAnnotation ( void  )

References pcAnnotation, and pcRoot.

Referenced by Gui::ViewProviderPy::getAnnotation().

◆ getBackRoot()

SoSeparator * ViewProvider::getBackRoot ( void  ) const
virtual

◆ getBoundingBox()

Base::BoundBox3d ViewProvider::getBoundingBox ( const char *  subname = 0,
bool  transform = true,
MDIView view = 0 
) const

◆ getChildRoot()

◆ getDefaultDisplayMode()

◆ getDefaultMode()

◆ getDetail()

virtual SoDetail* Gui::ViewProvider::getDetail ( const char *  ) const
virtual

◆ getDetailPath()

bool ViewProvider::getDetailPath ( const char *  subname,
SoFullPath *  pPath,
bool  append,
SoDetail *&  det 
) const
virtual

return the coin node detail and path to the node of the subelement

Parameters
subnamedot separated string reference to the sub element
pPathoutput coin path leading to the returned element detail
appendIf true, pPath will be first appended with the root node and the mode switch node of this view provider.
Returns
the coint detail of the subelement

If this view provider links to other view provider, then the implementation of getDetailPath() shall also append all intermediate nodes starting just after the mode switch node up till the mode switch of the linked view provider.

Reimplemented in Gui::ViewProviderDocumentObject, Gui::ViewProviderPlacement, and Gui::ViewProviderLink.

References getDetail(), pcModeSwitch, and pcRoot.

Referenced by Gui::SoFCUnifiedSelection::doAction(), getBoundingBox(), Gui::ViewProviderDocumentObject::getDetailPath(), and partialRender().

◆ getDisplayMaskMode()

SoNode * ViewProvider::getDisplayMaskMode ( const char *  type) const

Get the node to the display mask mode type.

References pcModeSwitch.

Referenced by Gui::Dialog::DlgInspector::setNodeNames().

◆ getDisplayMaskModes()

std::vector< std::string > ViewProvider::getDisplayMaskModes ( ) const

Returns a list of added display mask modes.

Referenced by Gui::Dialog::DlgInspector::setNodeNames().

◆ getDisplayModes()

vector< std::string > ViewProvider::getDisplayModes ( void  ) const
virtual

returns a list of all possible display modes

Reimplemented in TechDrawGui::ViewProviderTemplate, TechDrawGui::ViewProviderPage, TechDrawGui::ViewProviderHatch, TechDrawGui::ViewProviderGeomHatch, TechDrawGui::ViewProviderDrawingView, PartDesignGui::ViewProviderDatum, PartDesignGui::ViewProviderBody, PartGui::ViewProviderPartExt, Gui::ViewProviderPlacement, Gui::ViewProviderLink, Gui::ViewProviderDocumentObjectGroup, TechDrawGui::ViewProviderWeld, TechDrawGui::ViewProviderViewSection, TechDrawGui::ViewProviderViewPart, TechDrawGui::ViewProviderViewClip, TechDrawGui::ViewProviderTile, TechDrawGui::ViewProviderSymbol, TechDrawGui::ViewProviderSpreadsheet, TechDrawGui::ViewProviderProjGroupItem, TechDrawGui::ViewProviderProjGroup, TechDrawGui::ViewProviderImage, TechDrawGui::ViewProviderDimension, TechDrawGui::ViewProviderBalloon, TechDrawGui::ViewProviderAnnotation, PointsGui::ViewProviderPoints, PartGui::ViewProviderTorusParametric, PartGui::ViewProviderEllipsoid, PartGui::ViewProviderSphereParametric, PartGui::ViewProviderRuledSurface, PartGui::ViewProviderRegularPolygon, PartGui::ViewProviderPartReference, PartGui::ViewProviderWedge, PartGui::ViewProviderPrism, PartGui::ViewProviderPointParametric, PartGui::ViewProviderPlaneParametric, PartGui::ViewProviderLineParametric, PartGui::ViewProviderSpiralParametric, PartGui::ViewProviderHelixParametric, PartGui::ViewProviderEllipseParametric, PartGui::ViewProviderCylinderParametric, PartGui::ViewProviderCurveNet, PartGui::ViewProviderConeParametric, PartGui::ViewProviderCircleParametric, PartGui::ViewProviderBox, PartGui::ViewProvider2DObject, PartGui::ViewProviderCrossSections, MeshPartGui::ViewProviderCrossSections, MeshGui::ViewProviderMeshTransformDemolding, MeshGui::ViewProviderMeshTransform, MeshGui::ViewProviderMeshCurvature, MeshGui::ViewProviderMesh, MeshGui::ViewProviderExport, MeshGui::ViewProviderFace, InspectionGui::ViewProviderInspection, FemGui::ViewProviderSolver, FemGui::ViewProviderFemConstraint, FemGui::ViewProviderFemAnalysis, DrawingGui::ViewProviderDrawingClip, DrawingGui::ViewProviderDrawingView, DrawingGui::ViewProviderDrawingPage, Gui::ViewProviderOrigin, Gui::ViewProviderMeasureDistance, Gui::ViewProviderExtern, Gui::ViewProviderAnnotationLabel, Gui::ViewProviderAnnotation, SpreadsheetGui::ViewProviderSheet, RobotGui::ViewProviderTrajectory, RobotGui::ViewProviderRobotObject, PathGui::ViewProviderPath, MeshGui::ViewProviderMeshNode, ImageGui::ViewProviderImagePlane, FemGui::ViewProviderFemPostObject, FemGui::ViewProviderFemPostFunction, FemGui::ViewProviderFemMesh, Gui::ViewProviderVRMLObject, Gui::ViewProviderOriginFeature, and Gui::ViewProviderInventorObject.

Referenced by Gui::ViewProviderDocumentObject::attach(), Gui::ViewProviderLink::getDisplayModes(), and Gui::ViewProviderPy::listDisplayModes().

◆ getDropPrefix()

virtual std::string Gui::ViewProvider::getDropPrefix ( ) const
virtual

return a subname referencing the sub-object holding the dropped objects

◆ getEditingMode()

int ViewProvider::getEditingMode ( ) const
protected

◆ getElement()

virtual std::string Gui::ViewProvider::getElement ( const SoDetail *  ) const
virtual

◆ getElementColors()

virtual std::map<std::string, App::Color> Gui::ViewProvider::getElementColors ( const char *  element = 0) const
virtual

◆ getElementPicked()

bool ViewProvider::getElementPicked ( const SoPickedPoint *  pp,
std::string &  subname 
) const
virtual

◆ getFrontRoot()

◆ getIcon()

◆ getMDIView()

◆ getModelPoints()

std::vector< Base::Vector3d > ViewProvider::getModelPoints ( const SoPickedPoint *  pp) const
virtual

◆ getModeSwitch()

SoSwitch* Gui::ViewProvider::getModeSwitch ( void  ) const

◆ getOverrideMode()

const string ViewProvider::getOverrideMode ( )

◆ getPointOnRay() [1/2]

SoPickedPoint * ViewProvider::getPointOnRay ( const SbVec2s &  pos,
const View3DInventorViewer viewer 
) const
protected

Helper method to get picked entities while editing.

It's in the responsibility of the caller to delete the returned instance.

References OfflineRenderingUtils::viewer().

◆ getPointOnRay() [2/2]

SoPickedPoint * ViewProvider::getPointOnRay ( const SbVec3f &  pos,
const SbVec3f &  dir,
const View3DInventorViewer viewer 
) const
protected

Helper method to get picked entities while editing.

It's in the responsibility of the caller to delete the returned instance.

References OfflineRenderingUtils::viewer().

◆ getPyObject()

PyObject * ViewProvider::getPyObject ( void  )
virtual

This method returns the Python wrapper for a C++ object.

It's in the responsibility of the programmer to do the correct reference counting. Basically there are two ways how to implement that: Either always return a new Python object then reference counting is not a matter or return always the same Python object then the reference counter must be incremented by one. However, it's absolutely forbidden to return always the same Python object without incrementing the reference counter.

The default implementation returns 'None'.

Reimplemented from Base::BaseClass.

Reimplemented in PartDesignGui::ViewProvider, Gui::ViewProviderLink, Gui::ViewProviderDocumentObject, MeshGui::ViewProviderMesh, and FemGui::ViewProviderFemMesh.

References Base::PyObjectBase::IncRef(), and pyViewObject.

Referenced by Gui::DocumentPy::activeObject(), Gui::DocumentPy::getActiveObject(), Gui::DocumentPy::getInEdit(), and Gui::DocumentPy::getObject().

◆ getRoot()

◆ getSelectionShape()

virtual std::vector<Base::Vector3d> Gui::ViewProvider::getSelectionShape ( const char *  Element) const
virtual

return the highlight lines for a given element or the whole shape

Reimplemented in PartGui::ViewProviderPartExt, and FemGui::ViewProviderFemMesh.

◆ getStatus()

unsigned long Gui::ViewProvider::getStatus ( ) const

return the status bits

◆ getTaskViewContent()

virtual void Gui::ViewProvider::getTaskViewContent ( std::vector< Gui::TaskView::TaskContent * > &  ) const
virtual

get a list of TaskBoxes associated with this object

Reimplemented in Gui::ViewProviderDocumentObject.

◆ getTransactionText()

virtual const char* Gui::ViewProvider::getTransactionText ( ) const
virtual

Is called by the tree if the user double clicks on the object.

It returns the string for the transaction that will be shown in the undo/redo dialog. If null is returned then no transaction will be opened.

Reimplemented in SketcherGui::ViewProviderSketch, and Gui::ViewProviderDocumentObject.

◆ getTransformNode()

SoTransform* Gui::ViewProvider::getTransformNode ( ) const

◆ hasHiddenMarker()

const char * ViewProvider::hasHiddenMarker ( const char *  subname)
static

◆ hiddenMarker()

const std::string & ViewProvider::hiddenMarker ( )
static

◆ hide()

◆ isEditing()

bool ViewProvider::isEditing ( ) const

◆ isLinkVisible()

bool ViewProvider::isLinkVisible ( ) const

◆ isRestoring()

◆ isSelectable()

◆ isShow()

◆ isUpdatesEnabled()

bool ViewProvider::isUpdatesEnabled ( ) const

References testStatus(), and Gui::UpdateData.

Referenced by update().

◆ isVisible()

◆ keyPressed()

bool ViewProvider::keyPressed ( bool  pressed,
int  key 
)
virtual

is called when the provider is in edit and a key event occurs. Only ESC ends edit.

Reimplemented in SketcherGui::ViewProviderSketch.

◆ mergeColorfulOverlayIcons()

◆ mergeGreyableOverlayIcons()

◆ mouseButtonPressed()

bool ViewProvider::mouseButtonPressed ( int  button,
bool  pressed,
const SbVec2s &  cursorPos,
const View3DInventorViewer viewer 
)
virtual

is called when the Provider is in edit and the mouse is clicked

Reimplemented in SketcherGui::ViewProviderSketch.

References OfflineRenderingUtils::viewer().

◆ mouseMove()

bool ViewProvider::mouseMove ( const SbVec2s &  cursorPos,
View3DInventorViewer viewer 
)
virtual

is called when the provider is in edit and the mouse is moved

Reimplemented in SketcherGui::ViewProviderSketch.

References OfflineRenderingUtils::viewer().

◆ onBeforeChange()

◆ onChanged()

void ViewProvider::onChanged ( const App::Property prop)
protectedvirtual

Reimplemented from subclass.

Reimplemented from App::ExtensionContainer.

Reimplemented in TechDrawGui::ViewProviderTemplate, TechDrawGui::ViewProviderPage, TechDrawGui::ViewProviderHatch, TechDrawGui::ViewProviderGeomHatch, TechDrawGui::ViewProviderDrawingView, SketcherGui::ViewProviderSketch, PartDesignGui::ViewProviderBoolean, PartDesignGui::ViewProviderBody, PartDesignGui::ViewProvider, PartGui::ViewProviderPartExt, Gui::ViewProviderPlacement, Gui::ViewProviderPart, Gui::ViewProviderLink, Gui::ViewProviderDocumentObject, TechDrawGui::ViewProviderViewSection, TechDrawGui::ViewProviderViewPart, TechDrawGui::ViewProviderProjGroup, TechDrawGui::ViewProviderImage, SketcherGui::ViewProviderCustom, RobotGui::ViewProviderRobotObject, PointsGui::ViewProviderPoints, PathGui::ViewProviderPath, PartDesignGui::ViewProviderDatumPoint, PartGui::ViewProviderSpline, PartGui::ViewProviderPartReference, PartGui::ViewProviderCustom, PartGui::ViewProvider2DObjectGrid, MeshGui::ViewProviderMeshNode, MeshGui::ViewProviderMeshDefects, MeshGui::ViewProviderMeshCurvature, MeshGui::ViewProviderMesh, InspectionGui::ViewProviderInspection, FemGui::ViewProviderFemPostObject, FemGui::ViewProviderFemPostFunction, FemGui::ViewProviderFemPostFunctionProvider, FemGui::ViewProviderFemMesh, FemGui::ViewProviderFemConstraint, Gui::ViewProviderTextDocument, Gui::ViewProviderOriginFeature, Gui::ViewProviderOrigin, Gui::ViewProviderMeasureDistance, Gui::ViewProviderGeometryObject, Gui::ViewProviderAnnotationLabel, Gui::ViewProviderAnnotation, TechDrawGui::ViewProviderWeld, TechDrawGui::ViewProviderRichAnno, TechDrawGui::ViewProviderLeader, TechDrawGui::ViewProviderDimension, TechDrawGui::ViewProviderBalloon, and PartDesignGui::ViewProviderDatumCoordinateSystem.

References Gui::Application::Instance, App::ExtensionContainer::onChanged(), Gui::Application::signalChangedObject, and Gui::Application::updateActions().

Referenced by draftviewproviders.view_base.ViewProviderDraft::attach(), ArchSite.Compass::buildCoordinates(), draftobjects.wire.Wire::execute(), ArchAxis.CommandArchGrid::IsActive(), Gui::ViewProviderDocumentObject::onChanged(), ArchBuildingPart.ViewProviderBuildingPart::updateData(), ArchPanel.ViewProviderPanelCut::updateData(), ArchPanel.ViewProviderPanelSheet::updateData(), draftviewproviders.view_label.ViewProviderLabel::updateData(), draftviewproviders.view_layer.ViewProviderLayer::updateData(), and draftviewproviders.view_wpproxy.ViewProviderWorkingPlaneProxy::updateData().

◆ onDelete()

bool ViewProvider::onDelete ( const std::vector< std::string > &  subNames)
virtual

Get called if the object is about to get deleted.

Here you can delete other objects, switch their visibility or prevent the deletion of the object.

Parameters
subNameslist of selected subelements
Returns
true if the deletion is approved by the view provider.

Reimplemented in PartDesignGui::ViewProviderHole, TechDrawGui::ViewProviderTemplate, TechDrawGui::ViewProviderPage, SketcherGui::ViewProviderSketch, PartDesignGui::ViewProviderTransformed, PartDesignGui::ViewProviderDatum, PartDesignGui::ViewProviderBoolean, PartDesignGui::ViewProviderBody, PartDesignGui::ViewProvider, Gui::ViewProviderLink, TechDrawGui::ViewProviderWeld, TechDrawGui::ViewProviderViewPart, TechDrawGui::ViewProviderProjGroupItem, TechDrawGui::ViewProviderProjGroup, TechDrawGui::ViewProviderLeader, PathGui::ViewProviderPathShape, PathGui::ViewProviderAreaView, PathGui::ViewProviderArea, PartDesignGui::ViewProviderSketchBased, PartDesignGui::ViewProviderPipe, PartDesignGui::ViewProviderMultiTransform, PartDesignGui::ViewProviderLoft, PartDesignGui::ViewProviderHelix, PartGui::ViewProviderRuledSurface, PartGui::ViewProviderThickness, PartGui::ViewProviderOffset, PartGui::ViewProviderSweep, PartGui::ViewProviderLoft, PartGui::ViewProviderRevolution, PartGui::ViewProviderChamfer, PartGui::ViewProviderFillet, PartGui::ViewProviderMirror, PartGui::ViewProviderCompound, PartGui::ViewProviderMultiCommon, PartGui::ViewProviderMultiFuse, PartGui::ViewProviderBoolean, FemGui::ViewProviderFemAnalysis, DrawingGui::ViewProviderDrawingPage, Gui::ViewProviderOriginFeature, and Gui::ViewProviderOrigin.

Referenced by StdCmdDelete::activated(), SketcherGui::ConstraintView::deleteSelectedItems(), SketcherGui::ElementView::deleteSelectedItems(), SketcherGui::ViewProviderSketch::onDelete(), and Gui::Document::slotDeletedObject().

◆ partialRender()

int ViewProvider::partialRender ( const std::vector< std::string > &  subelements,
bool  clear 
)

partial rendering setup

Parameters
subelementsa list of dot separated string refer to the sub element
clearif true, remove the the subelement from partial rendering. If else, add the subelement for rendering.
Returns
Return the number of subelement found

Partial rendering only works if there is at least one SoFCSelectRoot node in this view provider

References Gui::SoSelectionElementAction::Append, getDetailPath(), hasHiddenMarker(), hiddenMarker(), Gui::SoSelectionElementAction::Hide, pcModeSwitch, Gui::SoSelectionElementAction::Remove, and Gui::SoSelectionElementAction::Show.

Referenced by Gui::ElementColors::leaveEvent().

◆ replaceObject()

int ViewProvider::replaceObject ( App::DocumentObject oldObj,
App::DocumentObject newObj 
)
virtual

Replace an object to the view provider by drag and drop.

Parameters
oldObjobject to be replaced
newObjobject to replace with
Returns
Returns 0 if not found, 1 if succeeded, -1 if not supported

Reimplemented in Gui::ViewProviderDocumentObject.

Referenced by Gui::ViewProviderDocumentObject::replaceObject(), and Gui::ViewProviderPy::replaceObject().

◆ Restore()

void ViewProvider::Restore ( Base::XMLReader )
virtual

This method is used to restore properties from an XML document.

It uses the XMLReader class, which bases on SAX, to read the in Save() written information. Again the Vector as an example:

void PropertyVector::Restore(Base::XMLReader &reader)
{
// read my Element
reader.readElement("PropertyVector");
// get the value of my Attribute
_cVec.x = reader.getAttributeAsFloat("valueX");
_cVec.y = reader.getAttributeAsFloat("valueY");
_cVec.z = reader.getAttributeAsFloat("valueZ");
}
The XML reader class This is an important helper class for the store and retrieval system of objects ...
Definition: Reader.h:118
void readElement(const char *ElementName=0)
read until a start element is found (<name>) or start-end element (<name/>) (with special name if giv...
Definition: Reader.cpp:240
double getAttributeAsFloat(const char *AttrName) const
return the named attribute as a double floating point (does type checking)
Definition: Reader.cpp:158

Reimplemented from App::ExtensionContainer.

Reimplemented in PartGui::ViewProvider2DObjectGrid.

Referenced by Gui::Document::importObjects(), PartGui::ViewProvider2DObjectGrid::Restore(), and Gui::Document::RestoreDocFile().

◆ setDefaultMode()

void ViewProvider::setDefaultMode ( int  val)

◆ setDisplayMaskMode()

void ViewProvider::setDisplayMaskMode ( const char *  type)

◆ setDisplayMode()

void ViewProvider::setDisplayMode ( const char *  ModeName)
virtual

set the display mode

If you add new viewing modes in getDisplayModes() then you need to reimplement also seDisplaytMode() to handle these new modes by setting the appropriate display mode.

Reimplemented in TechDrawGui::ViewProviderTemplate, TechDrawGui::ViewProviderPage, TechDrawGui::ViewProviderHatch, TechDrawGui::ViewProviderGeomHatch, TechDrawGui::ViewProviderDrawingView, SpreadsheetGui::ViewProviderSheet, PartDesignGui::ViewProviderDatum, PartDesignGui::ViewProviderBody, PartGui::ViewProviderPartExt, Gui::ViewProviderPlacement, TechDrawGui::ViewProviderWeld, TechDrawGui::ViewProviderViewSection, TechDrawGui::ViewProviderViewPart, TechDrawGui::ViewProviderViewClip, TechDrawGui::ViewProviderTile, TechDrawGui::ViewProviderSymbol, TechDrawGui::ViewProviderSpreadsheet, TechDrawGui::ViewProviderProjGroupItem, TechDrawGui::ViewProviderProjGroup, TechDrawGui::ViewProviderImage, TechDrawGui::ViewProviderDimension, TechDrawGui::ViewProviderBalloon, TechDrawGui::ViewProviderAnnotation, RobotGui::ViewProviderTrajectory, RobotGui::ViewProviderRobotObject, PointsGui::ViewProviderPoints, PathGui::ViewProviderPath, PartGui::ViewProviderPartReference, PartGui::ViewProviderCurveNet, MeshPartGui::ViewProviderCurveOnMesh, MeshGui::ViewProviderMeshTransformDemolding, MeshGui::ViewProviderMeshTransform, MeshGui::ViewProviderMeshNode, MeshGui::ViewProviderMeshCurvature, MeshGui::ViewProviderMesh, MeshGui::ViewProviderFace, InspectionGui::ViewProviderInspection, ImageGui::ViewProviderImagePlane, FemGui::ViewProviderFemPostObject, FemGui::ViewProviderFemMesh, FemGui::ViewProviderFemConstraint, DrawingGui::ViewProviderDrawingClip, DrawingGui::ViewProviderDrawingView, DrawingGui::ViewProviderDrawingPage, Gui::ViewProviderVRMLObject, Gui::ViewProviderOriginFeature, Gui::ViewProviderOrigin, Gui::ViewProviderMeasureDistance, Gui::ViewProviderInventorObject, Gui::ViewProviderAnnotationLabel, and Gui::ViewProviderAnnotation.

Referenced by Gui::ViewProviderDocumentObject::setActiveMode(), Gui::ViewProviderAnnotation::setDisplayMode(), Gui::ViewProviderAnnotationLabel::setDisplayMode(), Gui::ViewProviderInventorObject::setDisplayMode(), Gui::ViewProviderMeasureDistance::setDisplayMode(), Gui::ViewProviderOrigin::setDisplayMode(), Gui::ViewProviderOriginFeature::setDisplayMode(), Gui::ViewProviderVRMLObject::setDisplayMode(), ImageGui::ViewProviderImagePlane::setDisplayMode(), RobotGui::ViewProviderRobotObject::setDisplayMode(), RobotGui::ViewProviderTrajectory::setDisplayMode(), and Gui::ViewProviderPlacement::setDisplayMode().

◆ setEdit()

bool ViewProvider::setEdit ( int  ModNum)
protectedvirtual

is called by the document when the provider goes in edit mode

Reimplemented in Gui::ViewProviderOriginFeature, MeshGui::ViewProviderMeshNode, TechDrawGui::ViewProviderPage, TechDrawGui::ViewProviderHatch, TechDrawGui::ViewProviderGeomHatch, SpreadsheetGui::ViewProviderSheet, SketcherGui::ViewProviderSketch, PartDesignGui::ViewProviderTransformed, PartDesignGui::ViewProviderSubShapeBinder, PartDesignGui::ViewProviderShapeBinder, PartDesignGui::ViewProviderDatum, PartDesignGui::ViewProviderBoolean, PartDesignGui::ViewProvider, PartGui::ViewProviderPartExt, Gui::ViewProviderLink, Gui::ViewProviderDragger, TechDrawGui::ViewProviderWeld, TechDrawGui::ViewProviderViewSection, TechDrawGui::ViewProviderViewPart, TechDrawGui::ViewProviderRichAnno, TechDrawGui::ViewProviderProjGroupItem, TechDrawGui::ViewProviderProjGroup, TechDrawGui::ViewProviderLeader, TechDrawGui::ViewProviderDimension, TechDrawGui::ViewProviderBalloon, SurfaceGui::ViewProviderSections, SurfaceGui::ViewProviderGeomFillSurface, SurfaceGui::ViewProviderFilling, RobotGui::ViewProviderTrajectoryDressUp, RobotGui::ViewProviderTrajectoryCompound, RobotGui::ViewProviderEdge2TracObject, RaytracingGui::ViewProviderPovray, RaytracingGui::ViewProviderLux, PointsGui::ViewProviderPoints, PathGui::ViewProviderPathCompound, PartDesignGui::ViewProviderPrimitive, PartDesignGui::ViewProviderPipe, PartDesignGui::ViewProviderLoft, PartDesignGui::ViewProviderHole, PartDesignGui::ViewProviderHelix, PartDesignGui::ViewProviderDressUp, PartDesignGui::ViewProviderBase, PartGui::ViewProviderPrimitive, PartGui::ViewProviderThickness, PartGui::ViewProviderOffset, PartGui::ViewProviderChamfer, PartGui::ViewProviderFillet, PartGui::ViewProviderMirror, PartGui::ViewProviderImport, PartGui::ViewProviderCurveNet, PartGui::ViewProvider2DObjectGrid, MeshGui::ViewProviderMesh, FemGui::ViewProviderSetNodes, FemGui::ViewProviderSetGeometry, FemGui::ViewProviderSetFaces, FemGui::ViewProviderSetElements, FemGui::ViewProviderFemPostObject, FemGui::ViewProviderFemPostFunction, FemGui::ViewProviderFemMeshShapeNetgen, FemGui::ViewProviderFemConstraintTransform, FemGui::ViewProviderFemConstraintTemperature, FemGui::ViewProviderFemConstraintPulley, FemGui::ViewProviderFemConstraintPressure, FemGui::ViewProviderFemConstraintPlaneRotation, FemGui::ViewProviderFemConstraintInitialTemperature, FemGui::ViewProviderFemConstraintHeatflux, FemGui::ViewProviderFemConstraintGear, FemGui::ViewProviderFemConstraintForce, FemGui::ViewProviderFemConstraintFluidBoundary, FemGui::ViewProviderFemConstraintFixed, FemGui::ViewProviderFemConstraintDisplacement, FemGui::ViewProviderFemConstraintContact, FemGui::ViewProviderFemConstraintBearing, FemGui::ViewProviderFemConstraint, FemGui::ViewProviderFemAnalysis, DrawingGui::ViewProviderDrawingPage, and Gui::ViewProviderAnnotationLabel.

Referenced by ArchAxis.ViewProviderArchGrid::doubleClicked(), ArchReference.ViewProviderArchReference::doubleClicked(), draftviewproviders.view_dimension.ViewProviderDimensionBase::doubleClicked(), PathScripts.PathPropertyBagGui.ViewProvider::doubleClicked(), PathScripts.PathSetupSheetGui.ViewProvider::doubleClicked(), PathScripts.PathToolBitGui.ViewProvider::doubleClicked(), Spreadsheet_legacy.ViewProviderSpreadsheet::doubleClicked(), ArchAxis.CommandArchGrid::IsActive(), ArchSchedule.CommandArchSchedule::IsActive(), FemGui::ViewProviderFemAnalysis::setEdit(), TechDrawGui::ViewProviderBalloon::setEdit(), TechDrawGui::ViewProviderDimension::setEdit(), TechDrawGui::ViewProviderLeader::setEdit(), TechDrawGui::ViewProviderRichAnno::setEdit(), TechDrawGui::ViewProviderViewPart::setEdit(), TechDrawGui::ViewProviderViewSection::setEdit(), TechDrawGui::ViewProviderWeld::setEdit(), Gui::ViewProviderLink::setEdit(), TechDrawGui::ViewProviderPage::setEdit(), PathScripts.PathIconViewProvider.ViewProvider::setupContextMenu(), PathScripts.PathJobGui.ViewProvider::setupContextMenu(), PathScripts.PathOpGui.ViewProvider::setupContextMenu(), PathScripts.PathToolControllerGui.ViewProvider::setupContextMenu(), and startEditing().

◆ setEditViewer()

void ViewProvider::setEditViewer ( View3DInventorViewer ,
int  ModNum 
)
virtual

adjust viewer settings when editing a view provider

Reimplemented in Gui::ViewProviderLink, Gui::ViewProviderDragger, and SketcherGui::ViewProviderSketch.

Referenced by Gui::View3DInventorViewer::setEditingViewProvider().

◆ setElementColors()

virtual void Gui::ViewProvider::setElementColors ( const std::map< std::string, App::Color > &  colors)
virtual

◆ setLinkVisible()

void ViewProvider::setLinkVisible ( bool  visible)

◆ setModeSwitch()

void ViewProvider::setModeSwitch ( )
protectedvirtual

◆ setOverrideMode()

void ViewProvider::setOverrideMode ( const std::string &  mode)
virtual

◆ setRenderCacheMode()

void ViewProvider::setRenderCacheMode ( int  mode)
virtual

References pcRoot.

◆ setStatus()

◆ setTransformation() [1/2]

◆ setTransformation() [2/2]

void ViewProvider::setTransformation ( const SbMatrix &  rcMatrix)
virtual

References pcTransform.

◆ setupContextMenu()

void ViewProvider::setupContextMenu ( QMenu menu,
QObject receiver,
const char *  method 
)
virtual

set up the context-menu with the supported edit modes

Reimplemented in SpreadsheetGui::ViewProviderSheet, SketcherGui::ViewProviderSketch, PartDesignGui::ViewProviderSubShapeBinder, PartDesignGui::ViewProviderBody, PartDesignGui::ViewProvider, Gui::ViewProviderPart, RobotGui::ViewProviderTrajectory, RaytracingGui::ViewProviderPovray, RaytracingGui::ViewProviderLux, PartDesignGui::ViewProviderPrimitive, PartDesignGui::ViewProviderHole, PartDesignGui::ViewProviderBase, PartGui::ViewProviderSpline, FemGui::ViewProviderFemMeshShapeNetgen, Gui::ViewProviderTextDocument, TechDrawGui::ViewProviderPage, PartDesignGui::ViewProviderTransformed, PartDesignGui::ViewProviderShapeBinder, PartDesignGui::ViewProviderDatum, PartDesignGui::ViewProviderBoolean, PartGui::ViewProviderPartExt, Gui::ViewProviderLink, Gui::ViewProviderDragger, TechDrawGui::ViewProviderProjGroupItem, TechDrawGui::ViewProviderProjGroup, TechDrawGui::ViewProviderDimension, TechDrawGui::ViewProviderBalloon, SurfaceGui::ViewProviderSections, SurfaceGui::ViewProviderGeomFillSurface, SurfaceGui::ViewProviderFilling, PartDesignGui::ViewProviderRevolution, PartDesignGui::ViewProviderPocket, PartDesignGui::ViewProviderPipe, PartDesignGui::ViewProviderPad, PartDesignGui::ViewProviderLoft, PartDesignGui::ViewProviderHelix, PartDesignGui::ViewProviderGroove, PartDesignGui::ViewProviderDressUp, PartGui::ViewProviderPrimitive, PartGui::ViewProviderThickness, PartGui::ViewProviderOffset, PartGui::ViewProviderChamfer, PartGui::ViewProviderFillet, PartGui::ViewProviderMirror, PartGui::ViewProviderSpiralParametric, PartGui::ViewProviderHelixParametric, MeshGui::ViewProviderMesh, FemGui::ViewProviderFemConstraint, FemGui::ViewProviderFemAnalysis, DrawingGui::ViewProviderDrawingPage, and Gui::ViewProviderAnnotationLabel.

Referenced by Gui::TreeWidget::contextMenuEvent(), TechDrawGui::ViewProviderBalloon::setupContextMenu(), TechDrawGui::ViewProviderDimension::setupContextMenu(), Gui::ViewProviderDragger::setupContextMenu(), Gui::ViewProviderLink::setupContextMenu(), TechDrawGui::ViewProviderPage::setupContextMenu(), Gui::ViewProviderTextDocument::setupContextMenu(), and PartDesignGui::ViewProvider::setupContextMenu().

◆ setUpdatesEnabled()

void ViewProvider::setUpdatesEnabled ( bool  enable)

References setStatus(), and Gui::UpdateData.

◆ setVisible()

◆ show()

◆ showInTree()

virtual bool Gui::ViewProvider::showInTree ( ) const
virtual

Tell the tree view if this object should appear there.

Reimplemented in Gui::ViewProviderDocumentObject.

◆ startEditing()

◆ testStatus()

◆ toString()

std::string ViewProvider::toString ( void  ) const

◆ unsetEdit()

void ViewProvider::unsetEdit ( int  ModNum)
protectedvirtual

is called when you lose the edit mode

Reimplemented in Gui::ViewProviderOriginFeature, TechDrawGui::ViewProviderPage, TechDrawGui::ViewProviderHatch, TechDrawGui::ViewProviderGeomHatch, TechDrawGui::ViewProviderDrawingView, SketcherGui::ViewProviderSketch, PartDesignGui::ViewProviderTransformed, PartDesignGui::ViewProviderShapeBinder, PartDesignGui::ViewProviderDatum, PartDesignGui::ViewProvider, PartGui::ViewProviderPartExt, Gui::ViewProviderDragger, TechDrawGui::ViewProviderWeld, TechDrawGui::ViewProviderViewSection, TechDrawGui::ViewProviderViewPart, TechDrawGui::ViewProviderRichAnno, TechDrawGui::ViewProviderProjGroupItem, TechDrawGui::ViewProviderProjGroup, TechDrawGui::ViewProviderLeader, TechDrawGui::ViewProviderDimension, TechDrawGui::ViewProviderBalloon, SurfaceGui::ViewProviderSections, SurfaceGui::ViewProviderGeomFillSurface, SurfaceGui::ViewProviderFilling, RobotGui::ViewProviderTrajectoryDressUp, RobotGui::ViewProviderTrajectoryCompound, RobotGui::ViewProviderEdge2TracObject, RaytracingGui::ViewProviderPovray, RaytracingGui::ViewProviderLux, PointsGui::ViewProviderPoints, PathGui::ViewProviderPathCompound, PartDesignGui::ViewProviderPrimitive, PartDesignGui::ViewProviderPipe, PartDesignGui::ViewProviderLoft, PartDesignGui::ViewProviderHelix, PartDesignGui::ViewProviderBase, PartGui::ViewProviderPrimitive, PartGui::ViewProviderThickness, PartGui::ViewProviderOffset, PartGui::ViewProviderChamfer, PartGui::ViewProviderFillet, PartGui::ViewProviderMirror, PartGui::ViewProviderImport, PartGui::ViewProviderCurveNet, PartGui::ViewProvider2DObjectGrid, MeshGui::ViewProviderMesh, FemGui::ViewProviderSetNodes, FemGui::ViewProviderSetGeometry, FemGui::ViewProviderSetFaces, FemGui::ViewProviderSetElements, FemGui::ViewProviderFemPostObject, FemGui::ViewProviderFemPostFunction, FemGui::ViewProviderFemConstraint, FemGui::ViewProviderFemAnalysis, and Gui::ViewProviderAnnotationLabel.

Referenced by finishEditing(), PathScripts.PathJobGui.ViewProvider::uneditObject(), FemGui::ViewProviderFemAnalysis::unsetEdit(), and TechDrawGui::ViewProviderDrawingView::unsetEdit().

◆ unsetEditViewer()

void ViewProvider::unsetEditViewer ( View3DInventorViewer )
virtual

restores viewer settings when leaving editing mode

Reimplemented in Gui::ViewProviderLink, Gui::ViewProviderDragger, and SketcherGui::ViewProviderSketch.

Referenced by Gui::View3DInventorViewer::resetEditingViewProvider().

◆ update()

◆ updateData()

void ViewProvider::updateData ( const App::Property prop)
virtual

Reimplemented in TechDrawGui::ViewProviderPage, SpreadsheetGui::ViewProviderSheet, PartDesignGui::ViewProviderBody, TechDrawGui::ViewProviderViewClip, PartGui::ViewProviderSpline, FemGui::ViewProviderFemPostPipeline, FemGui::ViewProviderFemConstraint, TechDrawGui::ViewProviderTemplate, TechDrawGui::ViewProviderHatch, TechDrawGui::ViewProviderGeomHatch, TechDrawGui::ViewProviderDrawingView, SketcherGui::ViewProviderSketch, PartDesignGui::ViewProvider, PartGui::ViewProviderPartExt, Gui::ViewProviderPlacement, Gui::ViewProviderLink, Gui::ViewProviderDragger, TechDrawGui::ViewProviderWeld, TechDrawGui::ViewProviderViewSection, TechDrawGui::ViewProviderViewPart, TechDrawGui::ViewProviderTile, TechDrawGui::ViewProviderSymbol, TechDrawGui::ViewProviderSpreadsheet, TechDrawGui::ViewProviderRichAnno, TechDrawGui::ViewProviderProjGroupItem, TechDrawGui::ViewProviderProjGroup, TechDrawGui::ViewProviderLeader, TechDrawGui::ViewProviderImage, TechDrawGui::ViewProviderDimension, TechDrawGui::ViewProviderBalloon, TechDrawGui::ViewProviderAnnotation, SketcherGui::ViewProviderCustom, RobotGui::ViewProviderTrajectory, RobotGui::ViewProviderRobotObject, PointsGui::ViewProviderStructured, PointsGui::ViewProviderScattered, PathGui::ViewProviderPathShape, PathGui::ViewProviderPath, PathGui::ViewProviderAreaView, PathGui::ViewProviderArea, PartDesignGui::ViewProviderPrimitive, PartDesignGui::ViewProviderDatumPlane, PartDesignGui::ViewProviderDatumLine, PartDesignGui::ViewProviderDatumCoordinateSystem, PartDesignGui::ViewProviderAddSub, PartGui::ViewProviderRuledSurface, PartGui::ViewProviderPartReference, PartGui::ViewProviderCustom, PartGui::ViewProviderChamfer, PartGui::ViewProviderFillet, PartGui::ViewProviderCurveNet, PartGui::ViewProviderCompound, PartGui::ViewProviderMultiCommon, PartGui::ViewProviderMultiFuse, PartGui::ViewProviderBoolean, PartGui::ViewProvider2DObjectGrid, PartGui::ViewProviderCrossSections, MeshPartGui::ViewProviderCrossSections, MeshGui::ViewProviderMeshTransform, MeshGui::ViewProviderMeshNode, MeshGui::ViewProviderMeshFaceSet, MeshGui::ViewProviderMeshCurvature, MeshGui::ViewProviderMeshObject, MeshGui::ViewProviderIndexedFaceSet, MeshGui::ViewProviderMesh, InspectionGui::ViewProviderInspection, ImageGui::ViewProviderImagePlane, FemGui::ViewProviderFemPostObject, FemGui::ViewProviderFemPostSphereFunction, FemGui::ViewProviderFemPostPlaneFunction, FemGui::ViewProviderFemPostFunctionProvider, FemGui::ViewProviderFemMeshShapeNetgen, FemGui::ViewProviderFemMesh, FemGui::ViewProviderFemConstraintTransform, FemGui::ViewProviderFemConstraintTemperature, FemGui::ViewProviderFemConstraintPulley, FemGui::ViewProviderFemConstraintPressure, FemGui::ViewProviderFemConstraintPlaneRotation, FemGui::ViewProviderFemConstraintInitialTemperature, FemGui::ViewProviderFemConstraintHeatflux, FemGui::ViewProviderFemConstraintGear, FemGui::ViewProviderFemConstraintForce, FemGui::ViewProviderFemConstraintFluidBoundary, FemGui::ViewProviderFemConstraintFixed, FemGui::ViewProviderFemConstraintDisplacement, FemGui::ViewProviderFemConstraintContact, FemGui::ViewProviderFemConstraintBearing, DrawingGui::ViewProviderDrawingClip, DrawingGui::ViewProviderDrawingView, DrawingGui::ViewProviderDrawingPage, Gui::ViewProviderVRMLObject, Gui::ViewProviderOriginFeature, Gui::ViewProviderMeasureDistance, Gui::ViewProviderInventorObject, Gui::ViewProviderGeometryObject, Gui::ViewProviderExtern, Gui::ViewProviderAnnotationLabel, and Gui::ViewProviderAnnotation.

Referenced by PathScripts.PathJobDlg.JobCreate::exec_(), draftviewproviders.view_dimension.ViewProviderLinearDimension::onChanged(), draftviewproviders.view_dimension.ViewProviderAngularDimension::onChanged(), draftviewproviders.view_wire.ViewProviderWire::onChanged(), PathScripts.PathOpGui.TaskPanelPage::pageUpdateData(), PathScripts.PathPropertyBagGui.TaskPanel::setupUi(), PathScripts.PathSetupSheetGui.OpTaskPanel::setupUi(), update(), Gui::ViewProviderAnnotation::updateData(), Gui::ViewProviderAnnotationLabel::updateData(), Gui::ViewProviderMeasureDistance::updateData(), DrawingGui::ViewProviderDrawingPage::updateData(), FemGui::ViewProviderFemPostFunctionProvider::updateData(), FemGui::ViewProviderFemPostPlaneFunction::updateData(), FemGui::ViewProviderFemPostSphereFunction::updateData(), TechDrawGui::ViewProviderProjGroupItem::updateData(), Gui::ViewProviderDragger::updateData(), Gui::ViewProviderLink::updateData(), TechDrawGui::ViewProviderDrawingView::updateData(), TechDrawGui::ViewProviderGeomHatch::updateData(), TechDrawGui::ViewProviderHatch::updateData(), TechDrawGui::ViewProviderTemplate::updateData(), TechDrawGui::ViewProviderPage::updateData(), and Gui::ViewProviderDocumentObject::updateView().

◆ useNewSelectionModel()

Member Data Documentation

◆ overrideMode

◆ pcAnnotation

SoSeparator* Gui::ViewProvider::pcAnnotation
protected

The root separator for annotations.

Referenced by getAnnotation(), and ~ViewProvider().

◆ pcModeSwitch

◆ pcRoot

◆ pcTransform

◆ pyViewObject

◆ signalChangeIcon

◆ signalChangeStatusTip

boost::signals2::signal<void (const QString&)> Gui::ViewProvider::signalChangeStatusTip

signal on status tip change

Referenced by Gui::DocumentObjectData::DocumentObjectData().

◆ signalChangeToolTip

boost::signals2::signal<void (const QString&)> Gui::ViewProvider::signalChangeToolTip

signal on tooltip change

Referenced by Gui::DocumentObjectData::DocumentObjectData().

◆ sPixmap

◆ StatusBits

std::bitset<32> Gui::ViewProvider::StatusBits
protected

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