This class handles user interaction to draw and save the ellipse. More...
Public Types | |
enum ConstructionMethod { CENTER_PERIAPSIS_B, PERIAPSIS_APOAPSIS_B } | |
Construction methods, describes the method used to construct the ellipse. More... | |
enum SelectMode { STATUS_SEEK_PERIAPSIS, STATUS_SEEK_APOAPSIS, STATUS_SEEK_CENTROID, STATUS_SEEK_A, STATUS_SEEK_B, STATUS_Close } | |
Mode table, describes what step of the process we are in. More... | |
Public Member Functions | |
virtual void activated (ViewProviderSketch *) | |
Slot called when the create ellipse command is activated. More... | |
DrawSketchHandlerEllipse (int constructionMethod) | |
virtual void mouseMove (Base::Vector2d onSketchPos) | |
Updates the ellipse when the cursor moves. More... | |
virtual bool pressButton (Base::Vector2d onSketchPos) | |
Changes drawing mode on user-click. More... | |
virtual bool releaseButton (Base::Vector2d onSketchPos) | |
Calls saveEllipse() after last user input. More... | |
virtual ~DrawSketchHandlerEllipse () | |
![]() | |
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 bool onSelectionChanged (const Gui::SelectionChanges &) | |
virtual void quit (void) | |
virtual void registerPressedKey (bool, int) | |
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 Attributes | |
std::vector< AutoConstraint > sugConstr1 | |
std::vector< AutoConstraint > sugConstr2 | |
std::vector< AutoConstraint > sugConstr3 | |
![]() | |
QCursor actCursor | |
QCursor oldCursor | |
ViewProviderSketch * sketchgui | |
Additional Inherited Members | |
![]() | |
void applyCursor (QCursor &newCursor) | |
void applyCursor (void) | |
void setCrosshairColor () | |
void setCursor (const QPixmap &p, int x, int y) | |
void unsetCursor (void) | |
Detailed Description
This class handles user interaction to draw and save the ellipse.
Two construction methods are implemented: -Periapsis, apoapsis, and b; and -Center, periapsis, and b.
The first method limits the ellipse to a circle, while the second method allows for swapping of the semi-major and semi-minor axes.
We use three reference frames in this class. The first (and primary), is the cartesian frame of the sketcher; all our work begins and ends in this frame. The second is the perifocal frame of the ellipse using polar coordinates. We use this frame for naming conventions and working with the ellipse. The last is a rotated right-handed cartesian frame centered at the ellipse center with the +X direction towards periapsis, +Z out of screen.
When working with an ellipse in the perifocal frame, the following equations are useful:
Member Enumeration Documentation
◆ ConstructionMethod
◆ SelectMode
Mode table, describes what step of the process we are in.
Constructor & Destructor Documentation
◆ DrawSketchHandlerEllipse()
DrawSketchHandlerEllipse::DrawSketchHandlerEllipse | ( | int | constructionMethod | ) |
◆ ~DrawSketchHandlerEllipse()
|
virtual |
Member Function Documentation
◆ activated()
|
virtual |
Slot called when the create ellipse command is activated.
- Parameters
-
sketchgui A pointer to the active sketch
Reimplemented from SketcherGui::DrawSketchHandler.
References CENTER_PERIAPSIS_B, PERIAPSIS_APOAPSIS_B, SketcherGui::DrawSketchHandler::setCrosshairColor(), SketcherGui::DrawSketchHandler::setCursor(), STATUS_SEEK_CENTROID, and STATUS_SEEK_PERIAPSIS.
◆ mouseMove()
|
virtual |
Updates the ellipse when the cursor moves.
- Parameters
-
onSketchPos the position of the cursor on the sketch
Implements SketcherGui::DrawSketchHandler.
References SketcherGui::DrawSketchHandler::applyCursor(), SketcherGui::ViewProviderSketch::drawEdit(), PERIAPSIS_APOAPSIS_B, SketcherGui::DrawSketchHandler::renderSuggestConstraintsCursor(), SketcherGui::DrawSketchHandler::seekAutoConstraint(), SketcherGui::DrawSketchHandler::setPositionText(), SketcherGui::DrawSketchHandler::sketchgui, STATUS_SEEK_A, STATUS_SEEK_APOAPSIS, STATUS_SEEK_B, STATUS_SEEK_CENTROID, STATUS_SEEK_PERIAPSIS, sugConstr1, sugConstr2, and sugConstr3.
◆ pressButton()
|
virtual |
Changes drawing mode on user-click.
- Parameters
-
onSketchPos the position of the cursor on the sketch
- Returns
Implements SketcherGui::DrawSketchHandler.
References PERIAPSIS_APOAPSIS_B, STATUS_Close, STATUS_SEEK_APOAPSIS, STATUS_SEEK_B, STATUS_SEEK_CENTROID, and STATUS_SEEK_PERIAPSIS.
◆ releaseButton()
|
virtual |
Calls saveEllipse()
after last user input.
- Parameters
-
onSketchPos the position of the cursor on the sketch
- Returns
Implements SketcherGui::DrawSketchHandler.
References CENTER_PERIAPSIS_B, App::GetApplication(), ParameterGrp::GetBool(), App::Application::GetParameterGroupByPath(), PERIAPSIS_APOAPSIS_B, STATUS_Close, STATUS_SEEK_CENTROID, and STATUS_SEEK_PERIAPSIS.
Member Data Documentation
◆ sugConstr1
|
protected |
Referenced by mouseMove().
◆ sugConstr2
|
protected |
Referenced by mouseMove().
◆ sugConstr3
|
protected |
Referenced by mouseMove().
The documentation for this class was generated from the following file:
- src/Mod/Sketcher/Gui/CommandCreateGeo.cpp