DrawSketchHandler.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef SKETCHERGUI_DrawSketchHandler_H
00025 #define SKETCHERGUI_DrawSketchHandler_H
00026
00027 #include <Base/Tools2D.h>
00028 #include <Mod/Sketcher/App/Constraint.h>
00029
00030 class QPixmap;
00031
00032 namespace Gui {
00033 class View3DInventorViewer;
00034 class SoFCSelection;
00035 }
00036
00037 namespace Sketcher {
00038 class Sketch;
00039 class SketchObject;
00040 }
00041
00042 namespace SketcherGui {
00043
00044 class ViewProviderSketch;
00045
00046
00047 struct AutoConstraint
00048 {
00049 Sketcher::ConstraintType Type;
00050 int Index;
00051 };
00052
00053 enum Type
00054 {
00055 VERTEX,
00056 CURVE
00057 };
00058
00063 class SketcherGuiExport DrawSketchHandler
00064 {
00065 public:
00066 DrawSketchHandler();
00067 virtual ~DrawSketchHandler();
00068
00069 virtual void activated(ViewProviderSketch *sketchgui){};
00070 virtual void mouseMove(Base::Vector2D onSketchPos)=0;
00071 virtual bool pressButton(Base::Vector2D onSketchPos)=0;
00072 virtual bool releaseButton(Base::Vector2D onSketchPos)=0;
00073
00074 virtual void quit(void);
00075
00076 friend class ViewProviderSketch;
00077
00078 Sketcher::SketchObject* getObject(void);
00079
00080 int getHighestVertexIndex(void);
00081
00082 int getHighestCurveIndex(void);
00083
00084 int seekAutoConstraint(std::vector<AutoConstraint> &suggestedConstraints,
00085 const Base::Vector2D &Pos, const Base::Vector2D &Dir, Type selType = VERTEX);
00086 void createAutoConstraints(const std::vector<AutoConstraint> &autoConstrs,
00087 int geoId, Sketcher::PointPos pointPos=Sketcher::none);
00088
00089 void setPositionText(const Base::Vector2D &Pos);
00090 void resetPositionText(void);
00091 void renderSuggestConstraintsCursor(std::vector<AutoConstraint> &suggestedConstraints);
00092
00093 protected:
00094
00095 void setCursor( const QPixmap &p,int x,int y );
00096 void unsetCursor(void);
00097 void applyCursor(void);
00098 void applyCursor(QCursor &newCursor);
00099
00100 ViewProviderSketch *sketchgui;
00101 QCursor oldCursor;
00102 QCursor actCursor;
00103 };
00104
00105
00106 }
00107
00108
00109 #endif // SKETCHERGUI_DrawSketchHandler_H
00110