#include <ManualAlignment.h>
Classes | |
class | Private |
Public Member Functions | |
void | align () |
void | alignObject (App::DocumentObject *) |
This method performs the actual alignment of view pView. More... | |
bool | canAlign () const |
void | cancel () |
Cancels the process and closes the windows without performing an alignment. More... | |
void | clearAll () |
void | finish () |
Terminates the process and closes the windows. More... | |
const Base::Placement & | getTransform () const |
void | setFixedGroup (const FixedGroup &) |
void | setMinPoints (int minPoints) |
void | setModel (const MovableGroupModel &) |
void | setViewingDirections (const Base::Vector3d &view1, const Base::Vector3d &up1, const Base::Vector3d &view2, const Base::Vector3d &up2) |
void | slotDeletedDocument (const Gui::Document &Doc) |
Checks if the given object is about to be removed. More... | |
void | slotDeletedObject (const Gui::ViewProvider &Obj) |
Checks if the given document is about to be closed. More... | |
void | startAlignment (Base::Type mousemodel) |
Performs the alignment for the specified aligned and non-aligned views specified by setModel() and setFixedGroup(). More... | |
Static Public Member Functions | |
static void | destruct () |
Destructs the one and only instance of this class. More... | |
static bool | hasInstance () |
Checks whether the one instance exists. More... | |
static ManualAlignment * | instance () |
Creates the one and only instance of this class. More... | |
Protected Member Functions | |
bool | computeAlignment (const std::vector< PickedPoint > &movPts, const std::vector< PickedPoint > &fixPts) |
This method computes the alignment. More... | |
void | continueAlignment () |
If still one view needs to be aligned then it is shown in the first window. More... | |
ManualAlignment () | |
Construction. More... | |
void | showInstructions () |
~ManualAlignment () | |
Destruction. More... | |
Probe picking | |
bool | applyPickedProbe (Gui::ViewProviderDocumentObject *, const SoPickedPoint *pnt) |
This method stores the picked point pnt from the view provider prov. More... | |
static void | probePickedCallback (void *ud, SoEventCallback *n) |
void | reset () |
Make all views unpickable and resets internal data. More... | |
void | onAlign () |
void | onRemoveLastPointMoveable () |
void | onRemoveLastPointFixed () |
void | onClear () |
void | onCancel () |
void | emitCanceled () |
void | emitFinished () |
Detailed Description
Constructor & Destructor Documentation
◆ ManualAlignment()
|
protected |
Construction.
References Gui::Application::Instance, Gui::ManualAlignment::Private::sensorCam1, Gui::ManualAlignment::Private::sensorCam2, Gui::Application::signalDeleteDocument, slotDeletedDocument(), and Gui::ManualAlignment::Private::syncCameraCB().
Referenced by instance().
◆ ~ManualAlignment()
|
protected |
Destruction.
Member Function Documentation
◆ align()
void ManualAlignment::align | ( | ) |
References Gui::MovableGroupModel::activeGroup(), Gui::AlignmentGroup::addToViewer(), alignObject(), Gui::Document::commitCommand(), computeAlignment(), Gui::MovableGroupModel::continueAlignment(), continueAlignment(), Gui::AlignmentGroup::countPoints(), finish(), Gui::getMainWindow(), Gui::AlignmentGroup::getPoints(), Gui::AlignmentGroup::getViews(), Gui::AlignmentGroup::moveTo(), Gui::Document::openCommand(), Gui::AlignmentGroup::removeFromViewer(), Gui::AlignmentGroup::setAlignable(), and Gui::MainWindow::showMessage().
Referenced by onAlign().
◆ alignObject()
void ManualAlignment::alignObject | ( | App::DocumentObject * | obj | ) |
This method performs the actual alignment of view pView.
References Base::Persistence::getClassTypeId(), and App::GeoFeature::transformPlacement().
Referenced by align().
◆ applyPickedProbe()
|
protected |
This method stores the picked point pnt from the view provider prov.
If enough points in both windows have been picked the alignment gets invoked.
References Gui::MovableGroupModel::activeGroup(), Gui::AlignmentGroup::addPoint(), Gui::AlignmentGroup::countPoints(), Gui::ViewProvider::getModelPoints(), Gui::AlignmentGroup::hasView(), Gui::ManualAlignment::Private::picksepLeft, Gui::ManualAlignment::Private::picksepRight, and Gui::PickedPoint::point.
◆ canAlign()
bool ManualAlignment::canAlign | ( | ) | const |
References Gui::MovableGroupModel::activeGroup(), and Gui::AlignmentGroup::countPoints().
◆ cancel()
void ManualAlignment::cancel | ( | ) |
Cancels the process and closes the windows without performing an alignment.
References emitCanceled(), Gui::getMainWindow(), reset(), and Gui::MainWindow::showMessage().
Referenced by onCancel(), and slotDeletedObject().
◆ clearAll()
void ManualAlignment::clearAll | ( | ) |
References Gui::AlignmentGroup::clear(), and Gui::MovableGroupModel::clear().
◆ computeAlignment()
|
protected |
This method computes the alignment.
For the calculation of the alignment the picked points of both views are taken. If the alignment fails false is returned, true otherwise.
References Base::Vector3< _Precision >::Normalize(), Base::Placement::setPosition(), Gui::ManualAlignment::Private::transformation2x2(), and Gui::ManualAlignment::Private::transformation3x3().
Referenced by align().
◆ continueAlignment()
|
protected |
If still one view needs to be aligned then it is shown in the first window.
If all views are aligned the process will be terminated.
References Gui::MovableGroupModel::activeGroup(), Gui::AlignmentGroup::addToViewer(), Gui::AlignmentGroup::clearPoints(), Gui::coinRemoveAllChildren(), finish(), Gui::getMainWindow(), Gui::MovableGroupModel::isEmpty(), Gui::ManualAlignment::Private::picksepLeft, Gui::ManualAlignment::Private::picksepRight, Gui::AlignmentGroup::setAlignable(), and Gui::MainWindow::showMessage().
Referenced by align(), and startAlignment().
◆ destruct()
|
static |
Destructs the one and only instance of this class.
◆ emitCanceled
|
signal |
Referenced by cancel().
◆ emitFinished
|
signal |
Referenced by finish().
◆ finish()
void ManualAlignment::finish | ( | ) |
Terminates the process and closes the windows.
References emitFinished(), Gui::Document::getDocument(), Gui::getMainWindow(), App::Document::recompute(), reset(), and Gui::MainWindow::showMessage().
Referenced by drafttaskpanels.task_polararray.TaskPanelPolarArray::accept(), drafttaskpanels.task_orthoarray.TaskPanelOrthoArray::accept(), drafttaskpanels.task_circulararray.TaskPanelCircularArray::accept(), draftguitools.gui_split.Split::action(), draftguitools.gui_splines.BSpline::action(), draftguitools.gui_beziers.BezCurve::action(), draftguitools.gui_lines.Line::action(), draftguitools.gui_polygons.Polygon::action(), draftguitools.gui_subelements.SubelementHighlight::action(), draftguitools.gui_rotate.Rotate::action(), draftguitools.gui_fillets.Fillet::action(), draftguitools.gui_move.Move::action(), draftguitools.gui_texts.Text::action(), draftguitools.gui_mirror.Mirror::action(), draftguitools.gui_stretch.Stretch::action(), draftguitools.gui_scale.Scale::action(), draftguitools.gui_arcs.Arc::action(), draftguitools.gui_offset.Offset::action(), draftguitools.gui_ellipses.Ellipse::action(), draftguitools.gui_rectangles.Rectangle::action(), draftguitools.gui_shapestrings.ShapeString::action(), draftguitools.gui_labels.Label::action(), draftguitools.gui_selectplane.Draft_SelectPlane::action(), draftguitools.gui_trimex.Trimex::action(), draftguitools.gui_beziers.CubicBezCurve::action(), draftguitools.gui_dimensions.Dimension::action(), draftguitools.gui_wire2spline.WireToBSpline::Activated(), draftguitools.gui_subelements.SubelementHighlight::Activated(), draftguitools.gui_dimensions.Dimension::Activated(), draftguitools.gui_edit.Edit::Activated(), align(), draftguitools.gui_selectplane.Draft_SelectPlane::checkSelection(), DraftGui.DraftToolBar::checkSpecialChars(), draftguitools.gui_points.Point::click(), continueAlignment(), draftguitools.gui_labels.Label::create(), draftguitools.gui_ellipses.Ellipse::createObject(), draftguitools.gui_rectangles.Rectangle::createObject(), draftguitools.gui_texts.Text::createObject(), draftguitools.gui_shapestrings.ShapeString::createObject(), draftguitools.gui_stretch.Stretch::doStretch(), draftguitools.gui_arcs.Arc::drawArc(), draftguitools.gui_polygons.Polygon::drawPolygon(), DraftGui.DraftToolBar::escape(), draftguitools.gui_edit.Edit::keyPressed(), draftguitools.gui_dimensions.Dimension::numericInput(), draftguitools.gui_fillets.Fillet::numericRadius(), draftguitools.gui_offset.Offset::numericRadius(), draftguitools.gui_rotate.Rotate::numericRadius(), draftguitools.gui_trimex.Trimex::numericRadius(), draftguitools.gui_selectplane.Draft_SelectPlane::onClickAlign(), draftguitools.gui_selectplane.Draft_SelectPlane::onClickAuto(), draftguitools.gui_selectplane.Draft_SelectPlane::onClickCenter(), draftguitools.gui_selectplane.Draft_SelectPlane::onClickFront(), draftguitools.gui_selectplane.Draft_SelectPlane::onClickMove(), draftguitools.gui_selectplane.Draft_SelectPlane::onClickPrevious(), draftguitools.gui_selectplane.Draft_SelectPlane::onClickSide(), draftguitools.gui_selectplane.Draft_SelectPlane::onClickTop(), draftguitools.gui_subelements.SubelementHighlight::proceed(), draftguitools.gui_facebinders.Facebinder::proceed(), draftguitools.gui_downgrade.Downgrade::proceed(), draftguitools.gui_upgrade.Upgrade::proceed(), draftguitools.gui_draft2sketch.Draft2Sketch::proceed(), draftguitools.gui_shape2dview.Shape2DView::proceed(), draftguitools.gui_join.Join::proceed(), draftguitools.gui_array_simple.Array::proceed(), draftguitools.gui_clone.Clone::proceed(), draftguitools.gui_split.Split::proceed(), draftguitools.gui_trimex.Trimex::proceed(), draftguitools.gui_pointarray.PointArray::proceed(), draftguitools.gui_patharray.PathArray::proceed(), draftguitools.gui_edit.Edit::proceed(), draftguitools.gui_selectplane.Draft_SelectPlane::reject(), drafttaskpanels.task_orthoarray.TaskPanelOrthoArray::reject(), drafttaskpanels.task_polararray.TaskPanelPolarArray::reject(), drafttaskpanels.task_circulararray.TaskPanelCircularArray::reject(), and draftguitools.gui_edit.Edit::setTrackers().
◆ getTransform()
const Base::Placement& Gui::ManualAlignment::getTransform | ( | ) | const |
◆ hasInstance()
|
static |
Checks whether the one instance exists.
◆ instance()
|
static |
Creates the one and only instance of this class.
References ManualAlignment().
Referenced by probePickedCallback().
◆ onAlign
|
protectedslot |
References align().
Referenced by probePickedCallback().
◆ onCancel
|
protectedslot |
References cancel().
Referenced by probePickedCallback().
◆ onClear
|
protectedslot |
◆ onRemoveLastPointFixed
|
protectedslot |
References Gui::AlignmentGroup::countPoints(), Gui::ManualAlignment::Private::picksepRight, and Gui::AlignmentGroup::removeLastPoint().
Referenced by probePickedCallback().
◆ onRemoveLastPointMoveable
|
protectedslot |
◆ probePickedCallback()
|
staticprotected |
◆ reset
|
protectedslot |
Make all views unpickable and resets internal data.
References Gui::MovableGroupModel::activeGroup(), Gui::AlignmentGroup::clear(), Gui::MovableGroupModel::clear(), Gui::coinRemoveAllChildren(), Gui::MovableGroupModel::isEmpty(), Gui::ManualAlignment::Private::picksepLeft, Gui::ManualAlignment::Private::picksepRight, and Gui::AlignmentGroup::setAlignable().
Referenced by cancel(), finish(), draftguitools.gui_trackers.gridTracker::set(), slotDeletedDocument(), and startAlignment().
◆ setFixedGroup()
void ManualAlignment::setFixedGroup | ( | const FixedGroup & | fixed | ) |
References Gui::AlignmentGroup::getDocument().
Referenced by StdCmdAlignment::activated().
◆ setMinPoints()
void ManualAlignment::setMinPoints | ( | int | minPoints | ) |
Referenced by StdCmdAlignment::activated().
◆ setModel()
void ManualAlignment::setModel | ( | const MovableGroupModel & | model | ) |
Referenced by StdCmdAlignment::activated().
◆ setViewingDirections()
void ManualAlignment::setViewingDirections | ( | const Base::Vector3d & | view1, |
const Base::Vector3d & | up1, | ||
const Base::Vector3d & | view2, | ||
const Base::Vector3d & | up2 | ||
) |
References Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.
Referenced by StdCmdAlignment::activated().
◆ showInstructions()
|
protected |
◆ slotDeletedDocument()
void ManualAlignment::slotDeletedDocument | ( | const Gui::Document & | Doc | ) |
Checks if the given object is about to be removed.
Handle if the current document is about to being closed.
References reset().
Referenced by ManualAlignment().
◆ slotDeletedObject()
void ManualAlignment::slotDeletedObject | ( | const Gui::ViewProvider & | Obj | ) |
Checks if the given document is about to be closed.
Handle if the a view provider is about to being destroyed.
References Gui::MovableGroupModel::activeGroup(), cancel(), Base::Persistence::getClassTypeId(), Base::Persistence::getTypeId(), Gui::AlignmentGroup::hasView(), and Base::Type::isDerivedFrom().
Referenced by startAlignment().
◆ startAlignment()
void ManualAlignment::startAlignment | ( | Base::Type | mousemodel | ) |
Performs the alignment for the specified aligned and non-aligned views specified by setModel() and setFixedGroup().
References Gui::AlignmentGroup::addToViewer(), Gui::MainWindow::addWindow(), continueAlignment(), Gui::getMainWindow(), Gui::AlignmentGroup::isEmpty(), Gui::MovableGroupModel::isEmpty(), Gui::ManualAlignment::Private::picksepLeft, Gui::ManualAlignment::Private::picksepRight, probePickedCallback(), reset(), Gui::AlignmentGroup::setAlignable(), Gui::Document::signalDeletedObject, and slotDeletedObject().
Referenced by StdCmdAlignment::activated().
The documentation for this class was generated from the following files:
- src/Gui/ManualAlignment.h
- src/Gui/ManualAlignment.cpp