SketcherGui::ViewProviderSketch Class Reference

The Sketch ViewProvider. More...

#include <ViewProviderSketch.h>

Public Member Functions

Classes storing the state of Dragging, Selection and Preselection

All these classes enable the identification of a Vertex, a Curve, the root Point, axes, and constraints.

A word on indices and ways to identify elements and parts of them:

The Sketcher has a general main way to identify geometry, {GeoId, PointPos}, these can be provided as separate data, or using Sketcher::GeoElementId. The latter defines comparison and equality operators enabling, for example to use it as key in a std::map.

While it is indeed possible to refer to any point using that nomenclature, creating maps in certain circumnstances leads to a performance drawback. Additionally, the legacy selection mechanism refers to positive indexed Vertices (for both normal and external vertices). Both reasons discourage moving to a single identification. This situation has been identified at different levels:

(1) In sketch.cpp, the solver facade defining the interface with GCS, both {GeoId, PointPos} and PointId are used.

(2) In SketchObject.cpp, the actual document object, both {GeoId, PointPos} and VertexId are used (see VertexId2GeoId and VertexId2GeoPosId).

(3) In ViewProviderSketch, both {GeoId, PointPos} an Point indices are used (see these structures)

(4) At CoinManager level, {GeoId, PointPos}, Point indices (for selection) and MultiFieldIds (specific structure defining a coin multifield index and layer) are used.

Using a single index instead of a multi-index field, allows mappings to be implemented via std::vectors instead of std::maps. Direct mappings using std::vectors are accessed in constant time. Multi-index mappings relying on std::maps involve a search for the key. This leads to a drop in performance.

What are these indices and how do they relate each other?

  1. PointId, VertexId depend on the order of the geometries in the sketch. GeoList and GeoListFacade enable to convert between indices.
  2. CurveId is basically the GeoId assuming PointPos to be PointPos::none (edge)
  3. Sometimes, Axes and root point are separated into a third index or enum. Legacy reasons aside, the root point is has GeoId=-1, which is sometimes used as invalid value in positive only indices. Additionally, root point and the Horizontal Axes both have GeoId=-1 (differing in PointPos only). Following the decision not to rely on PointPos, creating a separate index, best when enum-ed, appears justified.
 ViewProviderSketch ()
 constructor More...
 
virtual ~ViewProviderSketch ()
 destructor More...
 
handler control
void activateHandler (DrawSketchHandler *newHandler)
 sets an DrawSketchHandler in control More...
 
void purgeHandler (void)
 removes the active handler More...
 
Drawing functions
void draw (bool temp=false, bool rebuildinformationoverlay=true)
 draw the sketch in the inventor nodes temp => use temporary solver solution in SketchObject recreateinformationscenography => forces a rebuild of the information overlay scenography More...
 
void updateColor (void)
 helper change the color of the sketch according to selection and solver status More...
 
Access to Sketch and Solver objects
Sketcher::SketchObjectgetSketchObject (void) const
 get the pointer to the sketch document object More...
 
const Sketcher::SketchgetSolvedSketch (void) const
 returns a const reference to the last solved sketch object. More...
 
constraint Virtual Space visibility management
void updateVirtualSpace (void)
 updates the visibility of the virtual space of constraints More...
 
void setIsShownVirtualSpace (bool isshownvirtualspace)
 determines whether the constraints in the normal space or the ones in the virtual are to be shown More...
 
bool getIsShownVirtualSpace (void) const
 returns whether the virtual space is being shown More...
 
- Public Member Functions inherited from PartGui::ViewProvider2DObjectGrid
virtual void attach (App::DocumentObject *)
 Attaches the document object to this view provider. More...
 
SoSeparatorcreateGrid (void)
 creates the grid More...
 
virtual void updateData (const App::Property *)
 
 ViewProvider2DObjectGrid ()
 constructor More...
 
virtual ~ViewProvider2DObjectGrid ()
 destructor More...
 
- Public Member Functions inherited from PartGui::ViewProvider2DObject
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 modes More...
 
 ViewProvider2DObject ()
 constructor More...
 
virtual ~ViewProvider2DObject ()
 destructor More...
 
- Public Member Functions inherited from PartGui::ViewProviderPart
virtual bool doubleClicked (void)
 is called by the tree if the user double clicks on the object More...
 
 ViewProviderPart ()
 constructor More...
 
virtual ~ViewProviderPart ()
 destructor More...
 
- Public Member Functions inherited from PartGui::ViewProviderPartExt
virtual void attach (App::DocumentObject *) override
 Attaches the document object to this view provider. More...
 
bool changeFaceColors ()
 If no other task is pending it opens a dialog to allow to change face colors. More...
 
virtual std::vector< std::string > getDisplayModes (void) const override
 returns a list of all possible modes More...
 
void reload ()
 Update the view representation. More...
 
virtual void setDisplayMode (const char *ModeName) override
 set the display mode More...
 
virtual void updateData (const App::Property *) override
 
 ViewProviderPartExt ()
 constructor More...
 
virtual ~ViewProviderPartExt ()
 destructor More...
 
virtual bool useNewSelectionModel (void) const override
 indicates if the ViewProvider use the new Selection model More...
 
virtual std::string getElement (const SoDetail *) const override
 return a hit element to the selection path or 0 More...
 
virtual SoDetail * getDetail (const char *) const override
 return the coin node detail of the subelement More...
 
virtual std::vector< Base::Vector3dgetModelPoints (const SoPickedPoint *) const override
 
virtual std::vector< Base::Vector3dgetSelectionShape (const char *Element) const override
 return the highlight lines for a given element or the whole shape More...
 
void setHighlightedFaces (const std::vector< App::Color > &colors)
 
void setHighlightedFaces (const std::vector< App::Material > &colors)
 
void unsetHighlightedFaces ()
 
void setHighlightedEdges (const std::vector< App::Color > &colors)
 
void unsetHighlightedEdges ()
 
void setHighlightedPoints (const std::vector< App::Color > &colors)
 
void unsetHighlightedPoints ()
 
virtual std::map< std::string, App::ColorgetElementColors (const char *element=nullptr) const override
 
virtual bool isUpdateForced () const override
 
virtual void forceUpdate (bool enable=true) override
 
virtual bool allowOverride (const App::DocumentObject &) const override
 Allow this class to be used as an override for the original view provider of the given object. More...
 
- Public Member Functions inherited from Gui::ViewProviderGeometryObject
void attach (App::DocumentObject *pcObject)
 Attaches the document object to this view provider. More...
 
SoPickedPoint * getPickedPoint (const SbVec2s &pos, const View3DInventorViewer &viewer) const
 This method is provided for convenience and does basically the same as getPickedPoints() unless that only the closest point to the camera will be picked. More...
 
SoPickedPointList getPickedPoints (const SbVec2s &pos, const View3DInventorViewer &viewer, bool pickAll=false) const
 Returns a list of picked points from the geometry under getRoot(). More...
 
bool isSelectable (void) const
 
void updateData (const App::Property *)
 
 ViewProviderGeometryObject ()
 constructor. More...
 
virtual ~ViewProviderGeometryObject ()
 destructor. More...
 
virtual void showBoundingBox (bool)
 
- Public Member Functions inherited from Gui::ViewProviderDragger
 ViewProviderDragger ()
 constructor. More...
 
virtual ~ViewProviderDragger ()
 destructor. More...
 
virtual ViewProviderstartEditing (int ModNum=0) override
 
- Public Member Functions inherited from Gui::ViewProviderDocumentObject
virtual void attach (App::DocumentObject *pcObject)
 
virtual bool canDelete (App::DocumentObject *obj) const override
 Asks the view provider if the given object can be deleted. More...
 
virtual bool canDropObjectEx (App::DocumentObject *, App::DocumentObject *, const char *, const std::vector< std::string > &) const override
 Query object dropping with full qualified name. More...
 
virtual void forceUpdate (bool enable=true)
 
virtual bool getDetailPath (const char *subname, SoFullPath *pPath, bool append, SoDetail *&det) const override
 return the coin node detail and path to the node of the subname More...
 
Gui::DocumentgetDocument () const
 Get the GUI document to this ViewProvider object. More...
 
virtual bool getElementPicked (const SoPickedPoint *, std::string &subname) const override
 return a hit element given the picked point which contains the full node path More...
 
App::DocumentObjectgetObject (void) const
 Get the object of this ViewProvider object. More...
 
PyObjectgetPyObject () override
 Get the python wrapper for that ViewProvider. More...
 
virtual void getTaskViewContent (std::vector< Gui::TaskView::TaskContent * > &) const override
 Get a list of TaskBoxes associated with this object. More...
 
virtual const char * getTransactionText () const override
 Is called by the tree if the user double clicks on the object. More...
 
virtual void hide (void) override
 Hide the object in the view. More...
 
virtual bool isUpdateForced () const
 
virtual void reattach (App::DocumentObject *)
 
virtual int replaceObject (App::DocumentObject *, App::DocumentObject *) override
 Replace an object to the view provider by drag and drop. More...
 
void setActiveMode ()
 Set the active mode, i.e. the first item of the 'Display' property. More...
 
virtual void show (void) override
 Show the object in the view. More...
 
virtual bool showInTree () const override
 Tell the tree view if this object should appear there. More...
 
virtual void update (const App::Property *) override
 update the content of the ViewProvider this method have to implement the recalculation of the ViewProvider. More...
 
void updateView ()
 Run a redraw. More...
 
 ViewProviderDocumentObject ()
 constructor. More...
 
virtual ~ViewProviderDocumentObject ()
 destructor. More...
 
virtual void startRestoring ()
 
virtual void finishRestoring ()
 
virtual bool removeDynamicProperty (const char *prop) override
 
virtual App::PropertyaddDynamicProperty (const char *type, const char *name=nullptr, const char *group=nullptr, const char *doc=nullptr, short attr=0, bool ro=false, bool hidden=false) override
 
virtual ViewProviderDocumentObjectgetLinkedViewProvider (std::string *subname=nullptr, bool recursive=false) const
 Return the linked view object. More...
 
virtual std::string getFullName () const override
 
void setShowable (bool enable)
 
bool isShowable () const
 
void startDefaultEditMode ()
 Start the edit mode with ViewProvider::Default. More...
 
- Public Member Functions inherited from Gui::ViewProvider
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...
 
int partialRender (const std::vector< std::string > &subelements, bool clear)
 partial rendering setup More...
 
Base::BoundBox3d getBoundingBox (const char *subname=nullptr, bool transform=true, MDIView *view=nullptr) const
 Return the bound box of this view object. More...
 
virtual void beforeDelete ()
 Called before deletion. More...
 
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 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 bool canRemoveChildrenFromRoot () const
 Tell the tree view to remove children items from the tree root. More...
 
std::string getActiveDisplayMode (void) const
 
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 ()
 
bool isEditing () const
 
void finishEditing ()
 
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
 
virtual QIcon getIcon (void) const
 deliver the icon shown in the tree view More...
 
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 void setElementColors (const std::map< std::string, App::Color > &colors)
 
virtual void setTransformation (const Base::Matrix4D &rcMatrix)
 set the viewing transformation of the provider More...
 
virtual void setTransformation (const SbMatrix &rcMatrix)
 
virtual MDIViewgetMDIView () const
 
bool isRestoring ()
 
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)
 
- 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=nullptr, const char *group=nullptr, const char *doc=nullptr, short attr=0, bool ro=false, bool hidden=false)
 
bool changeDynamicProperty (const Property *prop, const char *group, const char *doc)
 
virtual void editProperty (const char *)
 
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...
 
virtual PropertygetPropertyByName (const char *name) const
 find a property by its name More...
 
virtual const char * getPropertyDocumentation (const char *name) const
 get the Group of a named Property More...
 
virtual const char * getPropertyDocumentation (const Property *prop) const
 get the Group of a Property More...
 
virtual const char * getPropertyGroup (const char *name) const
 get the Group of a named Property More...
 
virtual const char * getPropertyGroup (const Property *prop) const
 get the Group of a Property More...
 
virtual void getPropertyList (std::vector< Property * > &List) const
 get all properties of the class (including properties of the parent) More...
 
virtual void getPropertyMap (std::map< std::string, Property * > &Map) const
 get all properties of the class (including properties of the parent) More...
 
virtual const char * getPropertyName (const Property *prop) const
 get the name of a property More...
 
virtual void getPropertyNamedList (std::vector< std::pair< const char *, Property * > > &List) const
 get all properties with their names, may contain duplicates and aliases More...
 
const char * getPropertyPrefix () const
 
virtual short getPropertyType (const char *name) const
 get the Type of a named Property More...
 
virtual short getPropertyType (const Property *prop) const
 get the Type of a Property More...
 
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)
 
virtual void Restore (Base::XMLReader &reader)
 This method is used to restore properties from an XML document. More...
 
virtual void Save (Base::Writer &writer) const
 This method is used to save properties to an XML document. More...
 
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 unsigned int getMemSize () const =0
 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...
 
virtual Base::Type getTypeId (void) const
 
virtual void Restore (XMLReader &)=0
 This method is used to restore properties from an XML document. More...
 
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 Save (Writer &) const =0
 This method is used to save properties to an XML document. More...
 
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...
 
 BaseClass (const BaseClass &)=default
 
virtual PyObjectgetPyObject ()
 This method returns the Python wrapper for a C++ object. More...
 
virtual Type getTypeId () const
 
bool isDerivedFrom (const Type type) const
 
BaseClassoperator= (const BaseClass &)=default
 
virtual void setPyObject (PyObject *)
 
virtual ~BaseClass ()
 Destruction. More...
 
- Public Member Functions inherited from PartGui::ViewProviderAttachExtension
virtual QIcon extensionMergeColorfullOverlayIcons (const QIcon &orig) const override
 
virtual void extensionSetupContextMenu (QMenu *, QObject *, const char *) override
 
virtual void extensionUpdateData (const App::Property *) override
 
 ViewProviderAttachExtension (void)
 Constructor. More...
 
virtual ~ViewProviderAttachExtension ()=default
 
- Public Member Functions inherited from Gui::ViewProviderExtension
virtual void extensionAttach (App::DocumentObject *)
 
virtual void extensionBeforeDelete ()
 
virtual bool extensionCanDragAndDropObject (App::DocumentObject *) const
 
virtual bool extensionCanDragObject (App::DocumentObject *) const
 
virtual bool extensionCanDragObjects () const
 
virtual bool extensionCanDropObject (App::DocumentObject *) const
 
virtual bool extensionCanDropObjectEx (App::DocumentObject *, App::DocumentObject *, const char *, const std::vector< std::string > &) const
 
virtual bool extensionCanDropObjects () const
 
virtual std::vector< App::DocumentObject * > extensionClaimChildren (void) const
 
virtual std::vector< App::DocumentObject * > extensionClaimChildren3D (void) const
 
virtual void extensionDragObject (App::DocumentObject *)
 
virtual void extensionDropObject (App::DocumentObject *)
 
virtual std::string extensionDropObjectEx (App::DocumentObject *obj, App::DocumentObject *, const char *, const std::vector< std::string > &)
 
virtual void extensionFinishRestoring ()
 
virtual SoSeparatorextensionGetBackRoot (void) const
 
virtual SoGroupextensionGetChildRoot (void) const
 
virtual bool extensionGetDetailPath (const char *, SoFullPath *, SoDetail *&) const
 
virtual std::vector< std::string > extensionGetDisplayModes (void) const
 
virtual bool extensionGetElementPicked (const SoPickedPoint *, std::string &) const
 
virtual SoSeparatorextensionGetFrontRoot (void) const
 
virtual void extensionHide (void)
 Hides the view provider. More...
 
virtual QIcon extensionMergeColorfullOverlayIcons (const QIcon &orig) const
 
virtual QIcon extensionMergeGreyableOverlayIcons (const QIcon &orig) const
 
virtual void extensionModeSwitchChange (void)
 
virtual bool extensionOnDelete (const std::vector< std::string > &)
 
virtual void extensionReattach (App::DocumentObject *)
 
virtual int extensionReplaceObject (App::DocumentObject *, App::DocumentObject *)
 
virtual void extensionSetDisplayMode (const char *)
 
virtual void extensionSetupContextMenu (QMenu *, QObject *, const char *)
 
virtual void extensionShow (void)
 Shows the view provider. More...
 
virtual void extensionStartRestoring ()
 
virtual void extensionUpdateData (const App::Property *)
 
Gui::ViewProviderDocumentObjectgetExtendedViewProvider ()
 
const Gui::ViewProviderDocumentObjectgetExtendedViewProvider () const
 
virtual PyObjectgetExtensionPyObject ()
 
bool ignoreOverlayIcon () const
 
void setIgnoreOverlayIcon (bool on)
 
 ViewProviderExtension ()
 
virtual ~ViewProviderExtension ()
 
- 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 Member Functions inherited from Gui::SelectionObserver
void attachSelection ()
 Attaches to the selection. More...
 
bool blockSelection (bool block)
 
void detachSelection ()
 Detaches from the selection. More...
 
bool isSelectionAttached () const
 
bool isSelectionBlocked () const
 
 SelectionObserver (bool attach=true, ResolveMode resolve=ResolveMode::OldStyleElement)
 Constructor. More...
 
 SelectionObserver (const Gui::ViewProviderDocumentObject *vp, bool attach=true, ResolveMode resolve=ResolveMode::OldStyleElement)
 Constructor. More...
 
virtual ~SelectionObserver ()
 

Public Attributes

Properties
App::PropertyBool Autoconstraints
 
App::PropertyBool AvoidRedundant
 
App::PropertyPythonObject TempoVis
 
App::PropertyBool HideDependent
 
App::PropertyBool ShowLinks
 
App::PropertyBool ShowSupport
 
App::PropertyBool RestoreCamera
 
App::PropertyBool ForceOrtho
 
App::PropertyBool SectionView
 
App::PropertyString EditingWorkbench
 
Signals for controlling information in Task dialogs
boost::signals2::signal< void()> signalConstraintsChanged
 signals if the constraints list has changed More...
 
boost::signals2::signal< void(const QString &state, const QString &msg, const QString &url, const QString &linkText)> signalSetUp
 signals if the sketch has been set up More...
 
boost::signals2::signal< void()> signalElementsChanged
 signals if the elements list has changed More...
 
- Public Attributes inherited from PartGui::ViewProvider2DObjectGrid
App::PropertyBool GridAutoSize
 
App::PropertyLength GridSize
 
App::PropertyBool GridSnap
 
App::PropertyEnumeration GridStyle
 
App::PropertyInteger maxNumberOfLines
 
App::PropertyBool ShowGrid
 Property to switch the grid on and off. More...
 
App::PropertyBool ShowOnlyInEditMode
 
App::PropertyBool TightGrid
 
- Public Attributes inherited from PartGui::ViewProviderPartExt
App::PropertyAngle AngularDeflection
 
App::PropertyBool ControlPoints
 
App::PropertyFloatConstraint Deviation
 
App::PropertyColorList DiffuseColor
 
App::PropertyEnumeration DrawStyle
 
App::PropertyEnumeration Lighting
 
App::PropertyColor LineColor
 
App::PropertyColorList LineColorArray
 
App::PropertyMaterial LineMaterial
 
App::PropertyFloatConstraint LineWidth
 
App::PropertyColor PointColor
 
App::PropertyColorList PointColorArray
 
App::PropertyMaterial PointMaterial
 
App::PropertyFloatConstraint PointSize
 
- Public Attributes inherited from Gui::ViewProviderGeometryObject
App::PropertyBool BoundingBox
 
App::PropertyBool Selectable
 
App::PropertyColor ShapeColor
 
App::PropertyMaterial ShapeMaterial
 
App::PropertyPercent Transparency
 
- Public Attributes inherited from Gui::ViewProviderDocumentObject
App::PropertyEnumeration DisplayMode
 
App::PropertyEnumeration OnTopWhenSelected
 
App::PropertyEnumeration SelectionStyle
 
App::PropertyBool ShowInTree
 
App::PropertyBool Visibility
 
- Public Attributes inherited from Gui::ViewProvider
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...
 

Protected Member Functions

enter/exit edit mode
virtual bool setEdit (int ModNum) override
 is called by the document when the provider goes in edit mode More...
 
virtual void unsetEdit (int ModNum) override
 is called when you lose the edit mode More...
 
virtual void setEditViewer (Gui::View3DInventorViewer *, int ModNum) override
 adjust viewer settings when editing a view provider More...
 
virtual void unsetEditViewer (Gui::View3DInventorViewer *) override
 restores viewer settings when leaving editing mode More...
 
miscelanea editing functions
void deactivateHandler ()
 purges the DrawHandler if existing and tidies up More...
 
void editDoubleClicked (void)
 get called if a subelement is double clicked while editing More...
 
manage updates during undo/redo operations
void slotUndoDocument (const Gui::Document &)
 
void slotRedoDocument (const Gui::Document &)
 
void forceUpdateData ()
 
- Protected Member Functions inherited from PartGui::ViewProvider2DObjectGrid
virtual void handleChangedPropertyType (Base::XMLReader &reader, const char *TypeName, App::Property *prop)
 PropertyContainer::handleChangedPropertyType is called during restore to possibly fix reading of older versions of the property container. More...
 
virtual void onChanged (const App::Property *prop)
 get called by the container whenever a property has been changed More...
 
virtual void Restore (Base::XMLReader &reader)
 This method is used to restore properties from an XML document. 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...
 
void updateGridExtent (float minx, float maxx, float miny, float maxy)
 
- Protected Member Functions inherited from PartGui::ViewProviderPart
void applyColor (const Part::ShapeHistory &hist, const std::vector< App::Color > &colBase, std::vector< App::Color > &colBool)
 
void applyTransparency (const float &transparency, std::vector< App::Color > &colors)
 
- Protected Member Functions inherited from PartGui::ViewProviderPartExt
bool loadParameter ()
 
void updateVisual ()
 
- Protected Member Functions inherited from Gui::ViewProviderGeometryObject
void setSelectable (bool Selectable=true)
 
virtual unsigned long getBoundColor () const
 
- Protected Member Functions inherited from Gui::ViewProviderDragger
- Protected Member Functions inherited from Gui::ViewProviderDocumentObject
virtual bool isAttachedToDocument () const override
 
virtual const char * detachFromDocument () override
 
virtual void onPropertyStatusChanged (const App::Property &prop, unsigned long oldStatus) override
 get called when a property status has changed More...
 
virtual void setModeSwitch () override
 Turn on mode switch. More...
 
void addDefaultAction (QMenu *, const QString &)
 Adds a menu item and bind it with startDefaultEditMode(). More...
 
Gui::MDIViewgetActiveView () const
 
Gui::MDIViewgetEditingView () const
 
Gui::MDIViewgetInventorView () const
 
Gui::MDIViewgetViewOfNode (SoNode *node) const
 
virtual void onBeforeChange (const App::Property *prop) override
 get called before the value is changed More...
 
SoNodefindFrontRootOfType (const SoType &type) const
 Searches in all view providers that are attached to an object that is part of the same document as the object this view provider is attached to for an front root of type. More...
 
- Protected Member Functions inherited from Gui::ViewProvider
int getEditingMode () const
 return the edit mode or -1 if nothing is being edited More...
 
virtual QIcon mergeGreyableOverlayIcons (const QIcon &orig) const
 
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...
 
- 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...
 
virtual void onBeforeChange (const Property *)
 get called before the value is changed More...
 
virtual void onChanged (const Property *)
 get called by the container when a property has changed More...
 
- Protected Member Functions inherited from App::Extension
virtual void extensionOnChanged (const Property *p)
 
void initExtensionType (Base::Type type)
 

Friends

Attorneys for collaboration with helper classes
class ViewProviderSketchDrawSketchHandlerAttorney
 
class ViewProviderSketchCoinAttorney
 
class ViewProviderSketchShortcutListenerAttorney
 
- Friends inherited from Gui::ViewProviderDocumentObject
class DynamicProperty
 
class Property
 
- Friends inherited from App::Extension

modus handling

enum  SketchMode {
  STATUS_NONE , STATUS_SELECT_Point , STATUS_SELECT_Edge , STATUS_SELECT_Constraint ,
  STATUS_SELECT_Cross , STATUS_SKETCH_DragPoint , STATUS_SKETCH_DragCurve , STATUS_SKETCH_DragConstraint ,
  STATUS_SKETCH_UseHandler , STATUS_SKETCH_StartRubberBand , STATUS_SKETCH_UseRubberBand
}
 mode table More...
 
void setSketchMode (SketchMode mode)
 is called by GuiCommands to set the drawing mode More...
 
SketchMode getSketchMode (void) const
 get the sketch mode More...
 

base class implementer

virtual void attach (App::DocumentObject *) override
 Attaches the document object to this view provider. More...
 
virtual void updateData (const App::Property *) override
 
virtual void setupContextMenu (QMenu *menu, QObject *receiver, const char *member) override
 set up the context-menu with the supported edit modes More...
 
virtual bool onDelete (const std::vector< std::string > &) override
 is called when the Provider is in edit and a deletion request occurs More...
 
virtual const char * getTransactionText () const override
 Is called by the tree if the user double clicks on the object. More...
 
virtual bool doubleClicked (void) override
 is called by the tree if the user double clicks on the object More...
 
virtual bool mouseMove (const SbVec2s &pos, Gui::View3DInventorViewer *viewer) override
 is called when the Provider is in edit and the mouse is moved More...
 
virtual bool keyPressed (bool pressed, int key) override
 is called when the Provider is in edit and a key event ocours. Only ESC ends edit. More...
 
virtual bool mouseButtonPressed (int Button, bool pressed, const SbVec2s &cursorPos, const Gui::View3DInventorViewer *viewer) override
 is called when the Provider is in edit and the mouse is clicked More...
 
virtual bool mouseWheelEvent (int delta, const SbVec2s &cursorPos, const Gui::View3DInventorViewer *viewer) override
 
virtual QIcon mergeColorfulOverlayIcons (const QIcon &orig) const override
 Control the overlays appearing on the Tree and reflecting different sketcher states. More...
 
virtual void onChanged (const App::Property *prop) override
 get called by the container whenever a property has been changed More...
 

Selection functions

bool isSelectable (void) const override
 Is the view provider selectable. More...
 
virtual void onSelectionChanged (const Gui::SelectionChanges &msg) override
 Observer message from the Selection. More...
 

miscelanea utilities

void centerSelection ()
 
float getScaleFactor () const
 returns the scale factor More...
 

Solver Information

void UpdateSolverInformation (void)
 update solver information based on last solving at SketchObject More...
 
static QString appendConstraintMsg (const QString &singularmsg, const QString &pluralmsg, const std::vector< int > &vector)
 Auxiliary function to generate messages about conflicting, redundant and malformed constraints. More...
 

Additional Inherited Members

- Public Types inherited from Gui::ViewProvider
enum  EditMode { Default = 0 , Transform , Cutting , Color }
 
- Public Types inherited from App::ExtensionContainer
typedef std::map< Base::Type, App::Extension * >::iterator ExtensionIterator
 
- Static Public Member Functions inherited from Gui::ViewProviderDragger
static void updateTransform (const Base::Placement &from, SoTransform *to)
 
- Static Public Member Functions inherited from Gui::ViewProvider
static const std::string & hiddenMarker ()
 
static const char * hasHiddenMarker (const char *subname)
 
static SbMatrix convert (const Base::Matrix4D &rcMatrix)
 
static Base::Matrix4D convert (const SbMatrix &sbMat)
 
static void eventCallback (void *ud, SoEventCallback *node)
 
- 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 ()
 
static Type getClassTypeId ()
 
static void init ()
 
- 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)
 
- 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 PartGui::ViewProvider2DObjectGrid
SoSeparatorGridRoot
 
- Protected Attributes inherited from PartGui::ViewProviderPartExt
SoMaterialBinding * pcFaceBind
 
SoMaterialBinding * pcLineBind
 
SoMaterialBinding * pcPointBind
 
SoMaterial * pcLineMaterial
 
SoMaterial * pcPointMaterial
 
SoDrawStyle * pcLineStyle
 
SoDrawStyle * pcPointStyle
 
SoShapeHints * pShapeHints
 
SoCoordinate3 * coords
 
SoBrepFaceSetfaceset
 
SoNormal * norm
 
SoNormalBinding * normb
 
SoBrepEdgeSetlineset
 
SoBrepPointSetnodeset
 
bool VisualTouched
 
bool NormalsFromUV
 
- Protected Attributes inherited from Gui::ViewProviderGeometryObject
SoMaterial * pcShapeMaterial
 
SoFCBoundingBoxpcBoundingBox
 
SoSwitch * pcBoundSwitch
 
SoBaseColor * pcBoundColor
 
- Protected Attributes inherited from Gui::ViewProviderDragger
SoFCCSysDraggercsysDragger = nullptr
 
- Protected Attributes inherited from Gui::ViewProviderDocumentObject
App::DocumentObjectpcObject
 
Gui::DocumentpcDocument
 
- Protected Attributes inherited from Gui::ViewProvider
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...
 
ViewProviderPy * pyViewObject
 
std::string overrideMode
 
std::bitset< 32 > StatusBits
 
- Protected Attributes inherited from App::PropertyContainer
DynamicProperty dynamicProps
 
- Protected Attributes inherited from App::Extension
bool m_isPythonExtension = false
 
Py::SmartPtr ExtensionPythonObject
 
- Static Protected Attributes inherited from PartGui::ViewProvider2DObjectGrid
static App::PropertyQuantityConstraint::Constraints GridSizeRange = {0.001,DBL_MAX,1.0}
 
static const char * GridStyleEnums [] = {"Dashed","Light",nullptr}
 

Detailed Description

The Sketch ViewProvider.

As any ViewProvider, this class is responsible for the view representation of Sketches.

Functionality inherited from parent classes deal with the majority of the representation of a sketch when it is ** not ** in edit mode.

This class handles mainly the drawing and editing of the sketch.

The class delegates a substantial part of this functionality on two main classes, DrawSketchHandler and EditModeCoinManager.

In order to enforce a certain degree of encapsulation and promote a not too tight coupling, while still allowing well defined collaboration, DrawSketchHandler and EditModeCoinManager access ViewProviderSketch via two Attorney classes (Attorney-Client pattern), ViewProviderSketchDrawSketchHandlerAttorney and ViewProviderSketchCoinAttorney.

Given the substantial amount of code involved in coin node management, EditModeCoinManager further delegates on other specialised helper classes. Some of them share the ViewProviderSketchCoinAttorney, which defines the maximum coupling and minimum encapsulation.

DrawSketchHandler aids temporary edit mode drawing and is extensively used for the creation of geometry.

EditModeCoinManager takes over the responsibility of creating the Coin (Inventor) scenograph and modifying it, including all the drawing of geometry, constraints and overlay layer. This is an exclusive responsibility under the Single Responsibility Principle.

EditModeCoinManager exposes a public interface to be used by ViewProviderSketch. Where, EditModeCoinManager needs special access to facilities of ViewProviderSketch in order to fulfil its responsibility, this access is defined by ViewProviderSketchCoinAttorney.

Similarly, DrawSketchHandler takes over the responsibility of drawing edit temporal curves and markers necessary to enable visual feedback to the user, as well as the UI interaction during such edits. This is its exclusive responsibility under the Single Responsibility Principle.

A plethora of speciliased handlers derive from DrawSketchHandler for each specialised editing (see for example all the handlers for creation of new geometry). These derived classes do * not * have direct access to the ViewProviderSketchDrawSketchHandlerAttorney. This is intended to keep coupling under control. However, generic functionality requiring access to the Attorney can be implemented in DrawSketchHandler and used from its derived classes by virtue of the inheritance. This promotes a concentrating the coupling in a single point (and code reuse).

Member Enumeration Documentation

◆ SketchMode

mode table

Enumerator
STATUS_NONE 

enum value View provider is in neutral.

STATUS_SELECT_Point 

enum value a point was selected.

STATUS_SELECT_Edge 

enum value an edge was selected.

STATUS_SELECT_Constraint 

enum value a constraint was selected.

STATUS_SELECT_Cross 

enum value the base coordinate system was selected.

STATUS_SKETCH_DragPoint 

enum value while dragging a point.

STATUS_SKETCH_DragCurve 

enum value while dragging a curve.

STATUS_SKETCH_DragConstraint 

enum value while dragging a compatible constraint.

STATUS_SKETCH_UseHandler 

enum value a DrawSketchHandler is in control.

STATUS_SKETCH_StartRubberBand 

enum value for initiating a rubber band selection

STATUS_SKETCH_UseRubberBand 

enum value when making a rubber band selection

Constructor & Destructor Documentation

◆ ViewProviderSketch()

ViewProviderSketch::ViewProviderSketch ( )

constructor

References App::Extension::initExtension(), and App::Prop_None.

◆ ~ViewProviderSketch()

ViewProviderSketch::~ViewProviderSketch ( )
virtual

destructor

Member Function Documentation

◆ activateHandler()

void ViewProviderSketch::activateHandler ( DrawSketchHandler newHandler)

◆ appendConstraintMsg()

QString ViewProviderSketch::appendConstraintMsg ( const QString &  singularmsg,
const QString &  pluralmsg,
const std::vector< int > &  vector 
)
staticprotected

Auxiliary function to generate messages about conflicting, redundant and malformed constraints.

◆ attach()

void ViewProviderSketch::attach ( App::DocumentObject pcObject)
overridevirtual

Attaches the document object to this view provider.

Reimplemented from PartGui::ViewProvider2DObjectGrid.

Referenced by SketcherGui::ViewProviderCustom::updateData().

◆ centerSelection()

void ViewProviderSketch::centerSelection ( )

◆ deactivateHandler()

void ViewProviderSketch::deactivateHandler ( )
protected

purges the DrawHandler if existing and tidies up

References STATUS_NONE.

Referenced by purgeHandler(), and unsetEdit().

◆ doubleClicked()

bool ViewProviderSketch::doubleClicked ( void  )
overridevirtual

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

Reimplemented from PartGui::ViewProviderPart.

References Gui::Application::activeDocument(), Gui::Application::Instance, and Gui::Document::setEdit().

◆ draw()

void ViewProviderSketch::draw ( bool  temp = false,
bool  rebuildinformationoverlay = true 
)

draw the sketch in the inventor nodes temp => use temporary solver solution in SketchObject recreateinformationscenography => forces a rebuild of the information overlay scenography

References Sketcher::Sketch::extractGeoListFacade(), Sketcher::GeoListModel< T >::geomlist, Gui::ViewProviderDocumentObject::getActiveView(), Base::BaseClass::getClassTypeId(), Sketcher::SketchObject::getGeoListFacade(), getSketchObject(), getSolvedSketch(), Base::BaseClass::isDerivedFrom(), STATUS_NONE, and STATUS_SKETCH_UseHandler.

Referenced by mouseButtonPressed(), mouseMove(), onDelete(), and updateData().

◆ editDoubleClicked()

◆ forceUpdateData()

void ViewProviderSketch::forceUpdateData ( )
protected

◆ getIsShownVirtualSpace()

bool ViewProviderSketch::getIsShownVirtualSpace ( void  ) const

◆ getScaleFactor()

◆ getSketchMode()

SketchMode SketcherGui::ViewProviderSketch::getSketchMode ( void  ) const

get the sketch mode

Referenced by SketcherGui::ReleaseHandler().

◆ getSketchObject()

Sketcher::SketchObject * ViewProviderSketch::getSketchObject ( void  ) const

get the pointer to the sketch document object

References Gui::ViewProviderDocumentObject::pcObject.

Referenced by CmdSketcherConstrainHorizontal::applyConstraint(), CmdSketcherConstrainVertical::applyConstraint(), CmdSketcherConstrainLock::applyConstraint(), CmdSketcherConstrainCoincident::applyConstraint(), CmdSketcherConstrainDistance::applyConstraint(), CmdSketcherConstrainPointOnObject::applyConstraint(), CmdSketcherConstrainDistanceX::applyConstraint(), CmdSketcherConstrainDistanceY::applyConstraint(), CmdSketcherConstrainParallel::applyConstraint(), CmdSketcherConstrainPerpendicular::applyConstraint(), CmdSketcherConstrainTangent::applyConstraint(), CmdSketcherConstrainRadius::applyConstraint(), CmdSketcherConstrainDiameter::applyConstraint(), CmdSketcherConstrainRadiam::applyConstraint(), CmdSketcherConstrainAngle::applyConstraint(), CmdSketcherConstrainEqual::applyConstraint(), CmdSketcherConstrainSymmetric::applyConstraint(), draw(), SketcherGui::EditDatumDialog::EditDatumDialog(), editDoubleClicked(), forceUpdateData(), SketcherGui::DrawSketchHandler::getHighestCurveIndex(), SketcherGui::DrawSketchHandler::getHighestVertexIndex(), SketcherGui::DrawSketchHandler::getSketchObject(), getSolvedSketch(), keyPressed(), mergeColorfulOverlayIcons(), mouseButtonPressed(), SketcherGui::DrawSketchHandlerExtend::mouseMove(), mouseMove(), SketcherGui::TaskSketcherConstraints::on_listWidgetConstraints_itemChanged(), SketcherGui::TaskSketcherConstraints::on_listWidgetConstraints_itemSelectionChanged(), SketcherGui::TaskSketcherElements::on_listWidgetElements_itemEntered(), SketcherGui::TaskSketcherElements::on_listWidgetElements_itemSelectionChanged(), onDelete(), SketcherGui::TaskSketcherConstraints::onSelectionChanged(), SketcherGui::TaskSketcherElements::onSelectionChanged(), onSelectionChanged(), SketcherGui::DrawSketchHandlerLineSet::pressButton(), SketcherGui::DrawSketchHandlerLineSet::registerPressedKey(), DrawSketchHandlerGenConstraint::releaseButton(), DrawSketchHandlerCoincident::releaseButton(), SketcherGui::DrawSketchHandlerExtend::releaseButton(), SketcherGui::DrawSketchHandlerFillet::releaseButton(), SketcherGui::DrawSketchHandlerSplitting::releaseButton(), SketcherGui::DrawSketchHandlerTrimming::releaseButton(), SketcherGui::DrawSketchHandler::seekAutoConstraint(), setEdit(), setEditViewer(), SketcherGui::TaskSketcherMessages::TaskSketcherMessages(), unsetEdit(), updateData(), SketcherGui::TaskSketcherSolverAdvanced::updateDefaultMethodParameters(), SketcherGui::TaskSketcherSolverAdvanced::updateRedundantMethodParameters(), SketcherGui::TaskSketcherSolverAdvanced::updateSketchObject(), UpdateSolverInformation(), and SketcherGui::DrawSketchHandlerLineSet::updateTransitionData().

◆ getSolvedSketch()

const Sketcher::Sketch & ViewProviderSketch::getSolvedSketch ( void  ) const

returns a const reference to the last solved sketch object.

It guarantees that the solver object does not lose synchronisation with the SketchObject properties.

NOTE: Operations requiring * write * access to the solver must be done via SketchObject interface. See for example functions: -> inline void setRecalculateInitialSolutionWhileMovingPoint(bool recalculateInitialSolutionWhileMovingPoint) -> inline int initTemporaryMove(int geoId, PointPos pos, bool fine=true) -> inline int moveTemporaryPoint(int geoId, PointPos pos, Base::Vector3d toPoint, bool relative=false) -> inline void updateSolverExtension(int geoId, std::unique_ptr<Part::GeometryExtension> && ext)

References getSketchObject(), and getSolvedSketch().

Referenced by draw(), getSolvedSketch(), mouseMove(), and updateData().

◆ getTransactionText()

virtual const char * SketcherGui::ViewProviderSketch::getTransactionText ( ) const
overridevirtual

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 from Gui::ViewProviderDocumentObject.

◆ isSelectable()

bool ViewProviderSketch::isSelectable ( void  ) const
overridevirtual

Is the view provider selectable.

Reimplemented from Gui::ViewProviderGeometryObject.

References Gui::ViewProvider::isEditing(), and Gui::ViewProviderGeometryObject::isSelectable().

◆ keyPressed()

bool ViewProviderSketch::keyPressed ( bool  pressed,
int  key 
)
overridevirtual

is called when the Provider is in edit and a key event ocours. Only ESC ends edit.

Reimplemented from Gui::ViewProvider.

References Sketcher::SketchObject::getGeoVertexIndex(), getSketchObject(), Sketcher::SketchObject::movePoint(), Sketcher::none, STATUS_NONE, and STATUS_SKETCH_UseHandler.

◆ mergeColorfulOverlayIcons()

QIcon ViewProviderSketch::mergeColorfulOverlayIcons ( const QIcon &  orig) const
overridevirtual

Control the overlays appearing on the Tree and reflecting different sketcher states.

Reimplemented from Gui::ViewProvider.

References Gui::BitmapFactoryInst::BottomRight, getSketchObject(), Gui::ViewProvider::mergeColorfulOverlayIcons(), and Gui::BitmapFactoryInst::mergePixmap().

◆ mouseButtonPressed()

bool ViewProviderSketch::mouseButtonPressed ( int  Button,
bool  pressed,
const SbVec2s &  cursorPos,
const Gui::View3DInventorViewer viewer 
)
overridevirtual

◆ mouseMove()

◆ mouseWheelEvent()

bool ViewProviderSketch::mouseWheelEvent ( int  delta,
const SbVec2s &  cursorPos,
const Gui::View3DInventorViewer viewer 
)
overridevirtual

Reimplemented from Gui::ViewProvider.

References OfflineRenderingUtils::viewer().

◆ onChanged()

◆ onDelete()

◆ onSelectionChanged()

◆ purgeHandler()

void ViewProviderSketch::purgeHandler ( void  )

removes the active handler

References Gui::SelectionSingleton::clearSelection(), deactivateHandler(), Gui::Application::editDocument(), Gui::Document::getActiveView(), Gui::Application::Instance, Gui::Selection(), and OfflineRenderingUtils::viewer().

Referenced by SketcherGui::ActivateHandler(), SketcherGui::DrawSketchHandlerLineSet::pressButton(), SketcherGui::DrawSketchHandler::quit(), DrawSketchHandlerBSplineInsertKnot::releaseButton(), DrawSketchHandlerCopy::releaseButton(), DrawSketchHandlerRectangularArray::releaseButton(), SketcherGui::DrawSketchHandlerArc::releaseButton(), SketcherGui::DrawSketchHandler3PointArc::releaseButton(), SketcherGui::DrawSketchHandlerArcOfEllipse::releaseButton(), SketcherGui::DrawSketchHandlerCircle::releaseButton(), SketcherGui::DrawSketchHandler3PointCircle::releaseButton(), SketcherGui::DrawSketchHandlerExtend::releaseButton(), SketcherGui::DrawSketchHandlerFillet::releaseButton(), SketcherGui::DrawSketchHandlerLine::releaseButton(), SketcherGui::DrawSketchHandlerLineSet::releaseButton(), SketcherGui::DrawSketchHandlerPoint::releaseButton(), SketcherGui::DrawSketchHandlerRegularPolygon::releaseButton(), SketcherGui::DrawSketchHandlerBox::releaseButton(), SketcherGui::DrawSketchHandlerOblong::releaseButton(), SketcherGui::DrawSketchHandlerSlot::releaseButton(), SketcherGui::DrawSketchHandlerSplitting::releaseButton(), SketcherGui::DrawSketchHandlerTrimming::releaseButton(), SketcherGui::DrawSketchHandlerArcOfHyperbola::releaseButton(), SketcherGui::DrawSketchHandlerArcOfParabola::releaseButton(), and SketcherGui::ReleaseHandler().

◆ setEdit()

bool ViewProviderSketch::setEdit ( int  ModNum)
overrideprotectedvirtual

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

Reimplemented from PartGui::ViewProvider2DObjectGrid.

References Gui::ControlSingleton::activeDialog(), Gui::Command::addModule(), Gui::SelectionObserver::attachSelection(), draftgeoutils.faces::bind(), Gui::SelectionSingleton::clearSelection(), Base::Console(), Gui::Control(), Gui::Application::editDocument(), Base::ConsoleSingleton::Error(), Sketcher::SketchObject::evaluateConstraints(), Gui::ViewProviderDocumentObject::getDocument(), Gui::getMainWindow(), Gui::Command::getObjectCmd(), getSketchObject(), SketcherGui::TaskDlgEditSketch::getSketchView(), Gui::Command::Gui, Gui::Application::Instance, Gui::ControlSingleton::reject(), Gui::SelectionSingleton::rmvPreselect(), Gui::Selection(), Sketcher::SketchObject::setRecalculateInitialSolutionWhileMovingPoint(), App::PropertyBool::setValue(), Gui::ControlSingleton::showDialog(), Gui::Document::signalRedoDocument, Gui::Document::signalUndoDocument, slotRedoDocument(), slotUndoDocument(), Sketcher::SketchObject::solve(), PartGui::ViewProvider2DObjectGrid::TightGrid, Sketcher::SketchObject::validateExternalLinks(), Gui::ViewProviderDocumentObject::ViewProviderDocumentObject(), and Base::ConsoleSingleton::Warning().

Referenced by ArchGrid.ViewProviderArchGrid::doubleClicked(), ArchReference.ViewProviderArchReference::doubleClicked(), draftviewproviders.view_dimension.ViewProviderDimensionBase::doubleClicked(), draftviewproviders.view_hatch.ViewProviderDraftHatch::doubleClicked(), draftviewproviders.view_text.ViewProviderText::doubleClicked(), PathScripts.PathPropertyBagGui.ViewProvider::doubleClicked(), PathScripts.PathSetupSheetGui.ViewProvider::doubleClicked(), PathScripts.PathToolBitGui.ViewProvider::doubleClicked(), Spreadsheet_legacy.ViewProviderSpreadsheet::doubleClicked(), ArchSchedule.CommandArchSchedule::IsActive(), PathScripts.PathIconViewProvider.ViewProvider::setupContextMenu(), PathScripts.PathJobGui.ViewProvider::setupContextMenu(), PathScripts.PathOpGui.ViewProvider::setupContextMenu(), and PathScripts.PathToolControllerGui.ViewProvider::setupContextMenu().

◆ setEditViewer()

◆ setIsShownVirtualSpace()

void ViewProviderSketch::setIsShownVirtualSpace ( bool  isshownvirtualspace)

determines whether the constraints in the normal space or the ones in the virtual are to be shown

References signalConstraintsChanged.

◆ setSketchMode()

void SketcherGui::ViewProviderSketch::setSketchMode ( SketchMode  mode)

is called by GuiCommands to set the drawing mode

◆ setupContextMenu()

void ViewProviderSketch::setupContextMenu ( QMenu menu,
QObject receiver,
const char *  method 
)
overridevirtual

set up the context-menu with the supported edit modes

Reimplemented from PartGui::ViewProviderPartExt.

References Gui::ViewProvider::setupContextMenu().

◆ slotRedoDocument()

void ViewProviderSketch::slotRedoDocument ( const Gui::Document )
protected

References forceUpdateData().

Referenced by setEdit().

◆ slotUndoDocument()

void ViewProviderSketch::slotUndoDocument ( const Gui::Document )
protected

References forceUpdateData().

Referenced by setEdit().

◆ unsetEdit()

◆ unsetEditViewer()

void ViewProviderSketch::unsetEditViewer ( Gui::View3DInventorViewer )
overrideprotectedvirtual

restores viewer settings when leaving editing mode

Reimplemented from Gui::ViewProviderDragger.

References OfflineRenderingUtils::viewer().

◆ updateColor()

void ViewProviderSketch::updateColor ( void  )

helper change the color of the sketch according to selection and solver status

Referenced by mouseMove(), onDelete(), SketcherGui::TaskSketcherGeneral::onRenderOrderChanged(), and onSelectionChanged().

◆ updateData()

◆ UpdateSolverInformation()

◆ updateVirtualSpace()

void SketcherGui::ViewProviderSketch::updateVirtualSpace ( void  )

updates the visibility of the virtual space of constraints

Friends And Related Function Documentation

◆ ViewProviderSketchCoinAttorney

◆ ViewProviderSketchDrawSketchHandlerAttorney

◆ ViewProviderSketchShortcutListenerAttorney

Member Data Documentation

◆ Autoconstraints

◆ AvoidRedundant

◆ EditingWorkbench

App::PropertyString SketcherGui::ViewProviderSketch::EditingWorkbench

◆ ForceOrtho

App::PropertyBool SketcherGui::ViewProviderSketch::ForceOrtho

◆ HideDependent

App::PropertyBool SketcherGui::ViewProviderSketch::HideDependent

◆ RestoreCamera

App::PropertyBool SketcherGui::ViewProviderSketch::RestoreCamera

◆ SectionView

App::PropertyBool SketcherGui::ViewProviderSketch::SectionView

◆ ShowLinks

App::PropertyBool SketcherGui::ViewProviderSketch::ShowLinks

◆ ShowSupport

App::PropertyBool SketcherGui::ViewProviderSketch::ShowSupport

◆ signalConstraintsChanged

boost::signals2::signal<void ()> SketcherGui::ViewProviderSketch::signalConstraintsChanged

◆ signalElementsChanged

boost::signals2::signal<void ()> SketcherGui::ViewProviderSketch::signalElementsChanged

signals if the elements list has changed

Referenced by onDelete(), SketcherGui::TaskSketcherElements::TaskSketcherElements(), and updateData().

◆ signalSetUp

boost::signals2::signal<void (const QString &state, const QString &msg, const QString &url, const QString &linkText)> SketcherGui::ViewProviderSketch::signalSetUp

signals if the sketch has been set up

Referenced by SketcherGui::TaskSketcherMessages::TaskSketcherMessages(), and UpdateSolverInformation().

◆ TempoVis

App::PropertyPythonObject SketcherGui::ViewProviderSketch::TempoVis

Referenced by setEditViewer().


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