SketcherGui::DrawSketchHandler Class Referenceabstract

Handler to create new sketch geometry This class has to be reimplemented to create geometry in the sketcher while its in editing. More...

#include <DrawSketchHandler.h>

Public Member Functions

virtual void activated (ViewProviderSketch *)
 
void createAutoConstraints (const std::vector< AutoConstraint > &autoConstrs, int geoId, Sketcher::PointPos pointPos=Sketcher::none, bool createowncommand=true)
 
virtual void deactivated (ViewProviderSketch *)
 
 DrawSketchHandler ()
 
int getHighestCurveIndex (void)
 
int getHighestVertexIndex (void)
 
virtual void mouseMove (Base::Vector2d onSketchPos)=0
 
virtual bool onSelectionChanged (const Gui::SelectionChanges &)
 
virtual bool pressButton (Base::Vector2d onSketchPos)=0
 
virtual void quit (void)
 
virtual void registerPressedKey (bool, int)
 
virtual bool releaseButton (Base::Vector2d onSketchPos)=0
 
void renderSuggestConstraintsCursor (std::vector< AutoConstraint > &suggestedConstraints)
 
void resetPositionText (void)
 
int seekAutoConstraint (std::vector< AutoConstraint > &suggestedConstraints, const Base::Vector2d &Pos, const Base::Vector2d &Dir, AutoConstraint::TargetType type=AutoConstraint::VERTEX)
 
void setPositionText (const Base::Vector2d &Pos)
 
void setPositionText (const Base::Vector2d &Pos, const SbString &text)
 
virtual ~DrawSketchHandler ()
 

Protected Member Functions

void addCursorTail (std::vector< QPixmap > &pixmaps)
 
void applyCursor (QCursor &newCursor)
 
void applyCursor (void)
 
qreal devicePixelRatio ()
 
unsigned long getCrosshairColor ()
 
void setCrosshairColor ()
 
void setCrosshairCursor (const char *svgName)
 
void setCursor (const QPixmap &pixmap, int x, int y, bool autoScale=true)
 Sets a cursor for 3D inventor view. More...
 
void setSvgCursor (const QString &svgName, int x, int y, const std::map< unsigned long, unsigned long > &colorMapping=std::map< unsigned long, unsigned long >())
 
std::vector< QPixmap > suggestedConstraintsPixmaps (std::vector< AutoConstraint > &suggestedConstraints)
 Returns constraints icons scaled to width. More...
 
void unsetCursor (void)
 

Protected Attributes

QCursor actCursor
 
QPixmap actCursorPixmap
 
QCursor oldCursor
 
ViewProviderSketchsketchgui
 

Friends

class ViewProviderSketch
 

Detailed Description

Handler to create new sketch geometry This class has to be reimplemented to create geometry in the sketcher while its in editing.

Constructor & Destructor Documentation

◆ DrawSketchHandler()

DrawSketchHandler::DrawSketchHandler ( )

◆ ~DrawSketchHandler()

DrawSketchHandler::~DrawSketchHandler ( )
virtual

Member Function Documentation

◆ activated()

◆ addCursorTail()

void DrawSketchHandler::addCursorTail ( std::vector< QPixmap > &  pixmaps)
protected

◆ applyCursor() [1/2]

void DrawSketchHandler::applyCursor ( QCursor &  newCursor)
protected

◆ applyCursor() [2/2]

void DrawSketchHandler::applyCursor ( void  )
protected

References actCursor.

Referenced by addCursorTail(), DrawSketchHandlerBox::mouseMove(), DrawSketchHandlerLineSet::mouseMove(), DrawSketchHandlerArc::mouseMove(), DrawSketchHandler3PointArc::mouseMove(), DrawSketchHandlerCircle::mouseMove(), DrawSketchHandlerEllipse::mouseMove(), DrawSketchHandlerArcOfEllipse::mouseMove(), DrawSketchHandlerArcOfHyperbola::mouseMove(), DrawSketchHandlerArcOfParabola::mouseMove(), DrawSketchHandlerBSpline::mouseMove(), DrawSketchHandler3PointCircle::mouseMove(), DrawSketchHandlerPoint::mouseMove(), DrawSketchHandlerExternal::mouseMove(), DrawSketchHandlerCarbonCopy::mouseMove(), DrawSketchHandlerSlot::mouseMove(), DrawSketchHandlerRegularPolygon::mouseMove(), DrawSketchHandlerCopy::mouseMove(), DrawSketchHandlerRectangularArray::mouseMove(), DrawSketchHandlerLineSet::pressButton(), DrawSketchHandlerArc::pressButton(), DrawSketchHandler3PointArc::pressButton(), DrawSketchHandler3PointCircle::pressButton(), DrawSketchHandlerLineSet::quit(), DrawSketchHandlerBSpline::quit(), DrawSketchHandlerBox::releaseButton(), DrawSketchHandlerLineSet::releaseButton(), DrawSketchHandlerArc::releaseButton(), DrawSketchHandler3PointArc::releaseButton(), DrawSketchHandlerCircle::releaseButton(), DrawSketchHandlerArcOfEllipse::releaseButton(), DrawSketchHandler3PointCircle::releaseButton(), DrawSketchHandlerPoint::releaseButton(), DrawSketchHandlerExtend::releaseButton(), DrawSketchHandlerSlot::releaseButton(), DrawSketchHandlerRegularPolygon::releaseButton(), DrawSketchHandlerArcOfHyperbola::releaseButton(), DrawSketchHandlerArcOfParabola::releaseButton(), and DrawSketchHandlerBSpline::releaseButton().

◆ createAutoConstraints()

void DrawSketchHandler::createAutoConstraints ( const std::vector< AutoConstraint > &  autoConstrs,
int  geoId,
Sketcher::PointPos  pointPos = Sketcher::none,
bool  createowncommand = true 
)

◆ deactivated()

virtual void SketcherGui::DrawSketchHandler::deactivated ( ViewProviderSketch )
virtual

◆ devicePixelRatio()

qreal DrawSketchHandler::devicePixelRatio ( void  )
protected

◆ getCrosshairColor()

unsigned long DrawSketchHandler::getCrosshairColor ( )
protected

◆ getHighestCurveIndex()

◆ getHighestVertexIndex()

int DrawSketchHandler::getHighestVertexIndex ( void  )

◆ mouseMove()

◆ onSelectionChanged()

virtual bool SketcherGui::DrawSketchHandler::onSelectionChanged ( const Gui::SelectionChanges )
virtual

◆ pressButton()

◆ quit()

◆ registerPressedKey()

virtual void SketcherGui::DrawSketchHandler::registerPressedKey ( bool  ,
int   
)
virtual

Reimplemented in DrawSketchHandlerLineSet.

◆ releaseButton()

◆ renderSuggestConstraintsCursor()

◆ resetPositionText()

◆ seekAutoConstraint()

int DrawSketchHandler::seekAutoConstraint ( std::vector< AutoConstraint > &  suggestedConstraints,
const Base::Vector2d Pos,
const Base::Vector2d Dir,
AutoConstraint::TargetType  type = AutoConstraint::VERTEX 
)

References SketcherGui::ViewProviderSketch::Autoconstraints, Sketcher::Coincident, SketcherGui::AutoConstraint::CURVE, Base::fmod(), SketcherGui::AutoConstraint::GeoId, Part::GeomArcOfConic::getCenter(), Base::Persistence::getClassTypeId(), Sketcher::SketchObject::getCompleteGeometry(), Part::GeomLineSegment::getEndPoint(), Sketcher::SketchObject::getGeometry(), Sketcher::SketchObject::getGeoVertexIndex(), getHighestCurveIndex(), Part::GeomArcOfEllipse::getMajorAxisDir(), Part::GeomArcOfEllipse::getMajorRadius(), Part::GeomArcOfEllipse::getMinorRadius(), SketcherGui::ViewProviderSketch::getPreselectCross(), SketcherGui::ViewProviderSketch::getPreselectCurve(), SketcherGui::ViewProviderSketch::getPreselectPoint(), Part::GeomArcOfEllipse::getRange(), SketcherGui::ViewProviderSketch::getScaleFactor(), SketcherGui::ViewProviderSketch::getSketchObject(), Part::GeomLineSegment::getStartPoint(), Base::Persistence::getTypeId(), App::PropertyBool::getValue(), Sketcher::GeoEnum::HAxis, Sketcher::Horizontal, Base::Vector2d::Length(), Base::Vector3< _Precision >::Length(), Sketcher::none, Base::Vector3< _Precision >::Normalize(), Sketcher::PointOnObject, SketcherGui::AutoConstraint::PosId, Base::Vector3< _Precision >::ProjectToLine(), Sketcher::GeoEnum::RtPnt, sketchgui, Sketcher::start, Sketcher::Tangent, SketcherGui::AutoConstraint::Type, Sketcher::GeoEnum::VAxis, SketcherGui::AutoConstraint::VERTEX, Sketcher::Vertical, Base::Vector2d::x, Base::Vector3< _Precision >::x, Base::Vector2d::y, and Base::Vector3< _Precision >::y.

Referenced by DrawSketchHandlerBox::mouseMove(), DrawSketchHandlerLineSet::mouseMove(), DrawSketchHandlerArc::mouseMove(), DrawSketchHandler3PointArc::mouseMove(), DrawSketchHandlerCircle::mouseMove(), DrawSketchHandlerEllipse::mouseMove(), DrawSketchHandlerArcOfEllipse::mouseMove(), DrawSketchHandlerArcOfHyperbola::mouseMove(), DrawSketchHandlerArcOfParabola::mouseMove(), DrawSketchHandlerBSpline::mouseMove(), DrawSketchHandler3PointCircle::mouseMove(), DrawSketchHandlerPoint::mouseMove(), DrawSketchHandlerExtend::mouseMove(), DrawSketchHandlerSlot::mouseMove(), DrawSketchHandlerRegularPolygon::mouseMove(), DrawSketchHandlerCopy::mouseMove(), and DrawSketchHandlerRectangularArray::mouseMove().

◆ setCrosshairColor()

void DrawSketchHandler::setCrosshairColor ( )
protected

◆ setCrosshairCursor()

◆ setCursor()

◆ setPositionText() [1/2]

void DrawSketchHandler::setPositionText ( const Base::Vector2d Pos)

◆ setPositionText() [2/2]

◆ setSvgCursor()

void DrawSketchHandler::setSvgCursor ( const QString &  svgName,
int  x,
int  y,
const std::map< unsigned long, unsigned long > &  colorMapping = std::map<unsigned long, unsigned long>() 
)
protected

◆ suggestedConstraintsPixmaps()

std::vector< QPixmap > DrawSketchHandler::suggestedConstraintsPixmaps ( std::vector< AutoConstraint > &  suggestedConstraints)
protected

◆ unsetCursor()

Friends And Related Function Documentation

◆ ViewProviderSketch

friend class ViewProviderSketch
friend

Member Data Documentation

◆ actCursor

QCursor SketcherGui::DrawSketchHandler::actCursor
protected

◆ actCursorPixmap

QPixmap SketcherGui::DrawSketchHandler::actCursorPixmap
protected

Referenced by addCursorTail(), and setCursor().

◆ oldCursor

QCursor SketcherGui::DrawSketchHandler::oldCursor
protected

Referenced by setCursor(), and unsetCursor().

◆ sketchgui

ViewProviderSketch* SketcherGui::DrawSketchHandler::sketchgui
protected

Referenced by DrawSketchHandlerCoincident::activated(), DrawSketchHandlerFillet::activated(), DrawSketchHandlerTrimming::activated(), DrawSketchHandlerExtend::activated(), DrawSketchHandlerExternal::activated(), DrawSketchHandlerCarbonCopy::activated(), DrawSketchHandlerCopy::activated(), DrawSketchHandlerRectangularArray::activated(), SketcherGui::ViewProviderSketch::activateHandler(), createAutoConstraints(), DrawSketchHandlerExternal::deactivated(), DrawSketchHandlerCarbonCopy::deactivated(), getHighestCurveIndex(), getHighestVertexIndex(), DrawSketchHandlerBox::mouseMove(), DrawSketchHandlerLineSet::mouseMove(), DrawSketchHandlerArc::mouseMove(), DrawSketchHandler3PointArc::mouseMove(), DrawSketchHandlerCircle::mouseMove(), DrawSketchHandlerEllipse::mouseMove(), DrawSketchHandlerArcOfEllipse::mouseMove(), DrawSketchHandlerArcOfHyperbola::mouseMove(), DrawSketchHandlerArcOfParabola::mouseMove(), DrawSketchHandlerBSpline::mouseMove(), DrawSketchHandler3PointCircle::mouseMove(), DrawSketchHandlerExtend::mouseMove(), DrawSketchHandlerSlot::mouseMove(), DrawSketchHandlerRegularPolygon::mouseMove(), DrawSketchHandlerCopy::mouseMove(), DrawSketchHandlerRectangularArray::mouseMove(), DrawSketchHandlerExternal::onSelectionChanged(), DrawSketchHandlerCarbonCopy::onSelectionChanged(), DrawSketchHandlerBox::pressButton(), DrawSketchHandlerLineSet::pressButton(), DrawSketchHandlerArc::pressButton(), DrawSketchHandler3PointArc::pressButton(), DrawSketchHandlerBSpline::pressButton(), DrawSketchHandler3PointCircle::pressButton(), DrawSketchHandlerCopy::pressButton(), DrawSketchHandlerRectangularArray::pressButton(), DrawSketchHandlerLineSet::quit(), DrawSketchHandlerBSpline::quit(), quit(), DrawSketchHandlerLineSet::registerPressedKey(), DrawSketchHandlerCoincident::releaseButton(), DrawSketchHandlerBox::releaseButton(), DrawSketchHandlerLineSet::releaseButton(), DrawSketchHandlerArc::releaseButton(), DrawSketchHandler3PointArc::releaseButton(), DrawSketchHandlerCircle::releaseButton(), DrawSketchHandlerArcOfEllipse::releaseButton(), DrawSketchHandler3PointCircle::releaseButton(), DrawSketchHandlerPoint::releaseButton(), DrawSketchHandlerFillet::releaseButton(), DrawSketchHandlerTrimming::releaseButton(), DrawSketchHandlerExtend::releaseButton(), DrawSketchHandlerSlot::releaseButton(), DrawSketchHandlerRegularPolygon::releaseButton(), DrawSketchHandlerCopy::releaseButton(), DrawSketchHandlerRectangularArray::releaseButton(), DrawSketchHandlerArcOfHyperbola::releaseButton(), DrawSketchHandlerArcOfParabola::releaseButton(), DrawSketchHandlerBSpline::releaseButton(), resetPositionText(), seekAutoConstraint(), setPositionText(), and DrawSketchHandlerLineSet::updateTransitionData().


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