Logo Search packages:      
Sourcecode: freecad version File versions  Download package

SketcherGui::ViewProviderSketch Class Reference

#include <ViewProviderSketch.h>

Inheritance diagram for SketcherGui::ViewProviderSketch:

Gui::ViewProviderGeometryObject App::PropertyContainer Base::Persistence Base::BaseClass

List of all members.

Detailed Description

The Sketch ViewProvider This class handles mainly the drawing and edeting of the sketch. It draws the geometry and the constraints applied to the sketch. It uses the class DrawSketchHandler to facilitade the creation of new geometry while editing.

Definition at line 60 of file ViewProviderSketch.h.

modus handling

enum  SketchMode {
 mode table More...
SketchMode getSketchMode (void)
 get the sketch mode
void setSketchMode (SketchMode mode)
 is called by GuiCommands to set the drawing mode

Public Member Functions

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)
SoSeparator * createGrid (void)
 creats the grid
virtual void deselect (SoPath *)
void draw (bool temp=false)
 draw the sketch in the inventor nodes
void drawEdit (const std::vector< Base::Vector2D > &EditCurve)
 draw the edit curve
SoSeparator * getAnnotation (void)
virtual SoSeparator * getBackRoot (void) const
virtual const char * getDefaultDisplayMode () const
 Get the default display mode.
virtual std::vector< std::string > getDisplayModes (void) const
 returns a list of all possible modes
virtual App::PropertygetDynamicPropertyByName (const char *name) const
virtual std::vector< std::string > getDynamicPropertyNames () const
virtual SoSeparator * getFrontRoot (void) const
SoFCSelection * getHighlightNode () const
virtual unsigned int getMemSize (void) const
virtual const char * getName (const Property *prop) const
 get the name of a property
App::DocumentObjectgetObject (void) const
 Get the object of this ViewProvider object.
std::vector< DocumentObject * > getOutList (void) const
 returns a list of objects this object is pointing to by Links
SoPickedPoint * getPickedPoint (const SbVec2s &pos, const View3DInventorViewer &viewer) const
SoPickedPointList getPickedPoints (const SbVec2s &pos, const View3DInventorViewer &viewer, bool pickAll=false) const
virtual PropertygetPropertyByName (const char *name) const
 find a property by its name
virtual const char * getPropertyDocumentation (const char *name) const
 get the Group of a named Property
virtual const char * getPropertyDocumentation (const Property *prop) const
 get the Group of a Property
virtual const char * getPropertyGroup (const char *name) const
 get the Group of a named Property
virtual const char * getPropertyGroup (const Property *prop) const
 get the Group of a Property
virtual void getPropertyList (std::vector< Property * > &List) const
 get all properties of the class (including properies of the parent)
virtual void getPropertyMap (std::map< std::string, Property * > &Map) const
 get all properties of the class (including properies of the parent)
virtual short getPropertyType (const char *name) const
 get the Type of a named Property
virtual short getPropertyType (const Property *prop) const
 get the Type of a Property
PyObject * getPyObject ()
 Get the python wrapper for that ViewProvider.
virtual SoSeparator * getRoot (void)
TopoDS_Shape getShape (const SoPickedPoint *) const
virtual void getTaskViewContent (std::vector< Gui::TaskView::TaskContent * > &) const
 Get a list of TaskBoxes associated with this object.
virtual Type getTypeId (void) const
std::vector< DocumentObject * > getWeakOutList (void) const
virtual void hide (void)
 Hide the object in the view.
bool isDerivedFrom (const Type type) const
virtual bool isHidden (const char *name) const
 check if the named property is hidden
virtual bool isHidden (const Property *prop) const
 check if the property is hidden
virtual bool isReadOnly (const char *name) const
 check if the nameed property is read-only
virtual bool isReadOnly (const Property *prop) const
 check if the property is read-only
bool isUpdatesEnabled () const
void reload ()
 Update the view representation.
virtual void Restore (Base::XMLReader &reader)
virtual void RestoreDocFile (Reader &)
virtual void Save (Base::Writer &writer) const
virtual void SaveDocFile (Writer &) const
virtual void select (SoPath *)
void setActiveMode ()
 Set the active mode, i.e. the first item of the 'Display' property.
virtual void setDisplayMode (const char *ModeName)
virtual void setEdit (void)
void setPropertyStatus (unsigned char bit, bool value)
 set the Status bit of all properties at once
virtual void setPyObject (PyObject *)
void setUpdatesEnabled (bool enable)
virtual void show (void)
 Show the object in the view.
void solve (void)
 solve the sketch
std::string toString () const
void update (const App::Property *)
void updateView ()
 Run a redraw.
 ViewProviderSketch ()
virtual ~ViewProviderSketch ()
handler control

void activateHandler (DrawSketchHandler *newHandler)
 sets an DrawSketchHandler in control
void purgeHandler (void)
 removes the active handler
base class implementer

virtual void attach (App::DocumentObject *)
virtual bool doubleClicked (void)
 Is called by the tree if the user double click on the object.
virtual bool keyPressed (int key)
 is called when the Provider is in edit and a key event ocours. Only ESC ends edit.
virtual bool mouseButtonPressed (int Button, bool pressed, const SbVec3f &point, const SbVec3f &normal, const SoPickedPoint *pp)
 is called when the Provider is in edit and the mouse is clicked
virtual bool mouseMove (const SbVec3f &pNear, const SbVec3f &pFar, const SoPickedPoint *pp)
 is called when the Provider is in edit and the mouse is moved
virtual bool setEdit (int ModNum)
virtual void unsetEdit (void)
virtual void updateData (const App::Property *)
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!

SbMatrix convert (const Base::Matrix4D &rcMatrix) const
virtual void setTransformation (const SbMatrix &rcMatrix)
virtual void setTransformation (const Base::Matrix4D &rcMatrix)
 set the viewing transformation of the provider
helper functions

bool detectPreselection (const SoPickedPoint *Point, int &PtIndex, int &CurvIndex)
 helper to detect preselection
void drawPreselection (void)
 helper to draw preselection
void getCoordsOnSketchPlane (double &u, double &v, const SbVec3f &point, const SbVec3f &normal)
 give the coordinates of a line on the sketch plane in sketcher (2D) coordinates
Sketcher::SketchObject * getSketchObject (void) const
 get the pointer to the sketch document object
Display mode methods
std::string getActiveDisplayMode (void) const
virtual bool isShow (void) const
 checks whether the view provider is visible or not
bool isVisible () const
void setVisible (bool)
Methods used by the Tree
virtual QIcon getIcon (void) const

Static Public Member Functions

static void * create (void)
static void eventCallback (void *ud, SoEventCallback *node)
static Type getClassTypeId (void)
static void init (void)
static void shapeInfoCallback (void *ud, SoEventCallback *n)

Public Attributes

App::PropertyBool BoundingBox
App::PropertyBool ControlPoints
App::PropertyEnumeration DisplayMode
App::PropertyDistance GridSize
App::PropertyEnumeration Lighting
App::PropertyColor LineColor
App::PropertyMaterial LineMaterial
App::PropertyFloatConstraint LineWidth
App::PropertyColor PointColor
App::PropertyMaterial PointMaterial
App::PropertyFloatConstraint PointSize
App::PropertyBool Selectable
App::PropertyColor ShapeColor
App::PropertyMaterial ShapeMaterial
App::PropertyBool ShowGrid
 Property to switch the grid on and off.
App::PropertyPercent Transparency
App::PropertyBool Visibility
Signals of the view provider

boost::signal< void()> signalChangeIcon
 signal on icon change
boost::signal< void(const
QString &)> 
 signal on status tip change
boost::signal< void(const
QString &)> 
 signal on tooltip change

Protected Member Functions

Standard_Boolean computeEdges (SoGroup *root, const TopoDS_Shape &myShape)
Standard_Boolean computeFaces (SoGroup *root, const TopoDS_Shape &myShape, double defl)
Standard_Boolean computeVertices (SoGroup *root, const TopoDS_Shape &myShape)
void createEditInventorNodes (void)
SoFCSelectioncreateFromSettings () const
SoSeparator * findFrontRootOfType (const SoType &type) const
SoPickedPoint * getPointOnRay (const SbVec3f &pos, const SbVec3f &dir, const View3DInventorViewer &viewer) const
 Helper method to get picked entities while editing.
virtual const PropertyData & getPropertyData (void) const
bool isPointOnSketch (const SoPickedPoint *pp) const
 helper to detect whether the picked point lies on the sketch
bool loadParameter ()
virtual void onBeforeChange (const Property *)
 get called before the value is changed
virtual void onChanged (const App::Property *prop)
 get called by the container whenever a property has been changed
void setSelectable (bool Selectable=true)
void showBoundingBox (bool)
void showControlPoints (bool, const App::Property *prop)
void showControlPointsOfEdge (const TopoDS_Edge &)
void showControlPointsOfFace (const TopoDS_Face &)
void showControlPointsOfWire (const TopoDS_Wire &)
void transferToArray (const TopoDS_Face &aFace, SbVec3f **vertices, SbVec3f **vertexnormals, int32_t **cons, int &nbNodesInFace, int &nbTriInFace)
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.
std::vector< std::string > getDisplayMaskModes () const
 Returns a list of added display mask modes.
void setDefaultMode (int)
void setDisplayMaskMode (const char *type)
 Activates the display mask mode type.

Static Protected Member Functions

static const PropertyData * getPropertyDataPtr (void)
static void initSubclass (Base::Type &toInit, const char *ClassName, const char *ParentName, Type::instantiationMethod method=0)

Protected Attributes

Sketcher::Sketch * ActSketch
SoCoordinate3 * CurvesCoordinate
SoLineSet * CurveSet
SoMaterial * CurvesMaterials
int DragPoint
SoGroup * EdgeRoot
SoCoordinate3 * EditCurvesCoordinate
SoLineSet * EditCurveSet
SoMaterial * EditCurvesMaterials
SoSeparator * EditRoot
SoGroup * FaceRoot
SoSeparator * GridRoot
SoCoordinate3 * LinesCoordinate
SoLineSet * LineSet
SoMaterial * LinesMaterials
float MaxX
float MaxY
float MinX
float MinY
SketchMode Mode
SoSeparator * pcAnnotation
 The root separator for annotations.
SoFCBoundingBox * pcBoundingBox
SoSwitch * pcBoundSwitch
SoSwitch * pcControlPoints
SoFCSelection * pcHighlight
SoMaterial * pcLineMaterial
SoDrawStyle * pcLineStyle
SoSwitch * pcModeSwitch
 this is the mode switch, all the different viewing modes are collected here
SoMaterial * pcPointMaterial
SoDrawStyle * pcPointStyle
SoSeparator * pcRoot
 The root Separator of the ViewProvider.
SoMaterial * pcShapeMaterial
SoTransform * pcTransform
 this is transformation for the provider
SoCoordinate3 * PointsCoordinate
SoPointSet * PointSet
SoMaterial * PointsMaterials
int PreselectCurve
SbColor PreselectOldColor
int PreselectPoint
SoShapeHints * pShapeHints
ViewProviderPy * pyViewObject
const char * sPixmap
SoGroup * VertexRoot

Private Member Functions

 PROPERTY_HEADER (PartGui::ViewProviderSketch)


class DrawSketchHandler
class Property

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

Generated by  Doxygen 1.6.0   Back to index