#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 () |
|
protected |
Construction.
References draftgeoutils.faces::bind(), Gui::Application::Instance, Gui::ManualAlignment::Private::sensorCam1, Gui::ManualAlignment::Private::sensorCam2, Gui::Application::signalDeleteDocument, slotDeletedDocument(), and Gui::ManualAlignment::Private::syncCameraCB().
Referenced by instance().
|
protected |
Destruction.
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(), draftutils.translate::QT_TRANSLATE_NOOP, Gui::AlignmentGroup::removeFromViewer(), Gui::AlignmentGroup::setAlignable(), and Gui::MainWindow::showMessage().
Referenced by onAlign().
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().
|
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, Gui::PickedPoint::point, and draftgeoutils.general::vec().
Referenced by probePickedCallback().
bool ManualAlignment::canAlign | ( | ) | const |
References Gui::MovableGroupModel::activeGroup(), and Gui::AlignmentGroup::countPoints().
Referenced by probePickedCallback().
void ManualAlignment::cancel | ( | void | ) |
Cancels the process and closes the windows without performing an alignment.
References emitCanceled(), Gui::getMainWindow(), reset(), and Gui::MainWindow::showMessage().
Referenced by DraftGui.DraftToolBar::finish(), DraftGui.DraftToolBar::offUi(), onCancel(), DraftGui.DraftToolBar::pointUi(), and slotDeletedObject().
void ManualAlignment::clearAll | ( | ) |
References Gui::AlignmentGroup::clear(), and Gui::MovableGroupModel::clear().
|
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().
|
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::clearPoints(), Gui::coinRemoveAllChildren(), finish(), Gui::getMainWindow(), Gui::MovableGroupModel::isEmpty(), Gui::ManualAlignment::Private::picksepLeft, Gui::ManualAlignment::Private::picksepRight, and Gui::MainWindow::showMessage().
Referenced by align(), and startAlignment().
|
static |
Destructs the one and only instance of this class.
|
signal |
Referenced by cancel().
|
signal |
Referenced by 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_circulararray.TaskPanelCircularArray::accept(), drafttaskpanels.task_orthoarray.TaskPanelOrthoArray::accept(), drafttaskpanels.task_polararray.TaskPanelPolarArray::accept(), draftguitools.gui_arcs.Arc::action(), draftguitools.gui_beziers.BezCurve::action(), draftguitools.gui_beziers.CubicBezCurve::action(), draftguitools.gui_dimensions.Dimension::action(), draftguitools.gui_ellipses.Ellipse::action(), draftguitools.gui_fillets.Fillet::action(), draftguitools.gui_labels.Label::action(), draftguitools.gui_lines.Line::action(), draftguitools.gui_mirror.Mirror::action(), draftguitools.gui_move.Move::action(), draftguitools.gui_offset.Offset::action(), draftguitools.gui_polygons.Polygon::action(), draftguitools.gui_rectangles.Rectangle::action(), draftguitools.gui_rotate.Rotate::action(), draftguitools.gui_scale.Scale::action(), draftguitools.gui_selectplane.Draft_SelectPlane::action(), draftguitools.gui_shapestrings.ShapeString::action(), draftguitools.gui_splines.BSpline::action(), draftguitools.gui_split.Split::action(), draftguitools.gui_stretch.Stretch::action(), draftguitools.gui_texts.Text::action(), draftguitools.gui_trimex.Trimex::action(), draftguitools.gui_subelements.SubelementHighlight::action(), draftguitools.gui_clone.Clone::Activated(), draftguitools.gui_dimensions.Dimension::Activated(), draftguitools.gui_downgrade.Downgrade::Activated(), draftguitools.gui_draft2sketch.Draft2Sketch::Activated(), draftguitools.gui_edit.Edit::Activated(), draftguitools.gui_facebinders.Facebinder::Activated(), draftguitools.gui_join.Join::Activated(), draftguitools.gui_shape2dview.Shape2DView::Activated(), draftguitools.gui_subelements.SubelementHighlight::Activated(), draftguitools.gui_upgrade.Upgrade::Activated(), draftguitools.gui_wire2spline.WireToBSpline::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_shapestrings.ShapeString::createObject(), draftguitools.gui_texts.Text::createObject(), draftviewproviders.view_text.ViewProviderText::createObject(), draftguitools.gui_stretch.Stretch::doStretch(), draftguitools.gui_arcs.Arc::drawArc(), draftguitools.gui_polygons.Polygon::drawPolygon(), DraftGui.DraftToolBar::escape(), draftguitools.gui_move.Move::get_object_selection(), draftguitools.gui_rotate.Rotate::get_object_selection(), draftguitools.gui_scale.Scale::get_object_selection(), draftguitools.gui_arcs.Arc_3Points::getPoint(), draftguitools.gui_edit.Edit::keyPressed(), draftguitools.gui_dimensions.Dimension::numericInput(), draftguitools.gui_trimex.Trimex::numericRadius(), draftguitools.gui_fillets.Fillet::numericRadius(), draftguitools.gui_offset.Offset::numericRadius(), draftguitools.gui_rotate.Rotate::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_array_simple.Array::proceed(), draftguitools.gui_clone.Clone::proceed(), draftguitools.gui_downgrade.Downgrade::proceed(), draftguitools.gui_draft2sketch.Draft2Sketch::proceed(), draftguitools.gui_edit.Edit::proceed(), draftguitools.gui_facebinders.Facebinder::proceed(), draftguitools.gui_join.Join::proceed(), draftguitools.gui_patharray.PathArray::proceed(), draftguitools.gui_pathtwistedarray.PathTwistedArray::proceed(), draftguitools.gui_pointarray.PointArray::proceed(), draftguitools.gui_shape2dview.Shape2DView::proceed(), draftguitools.gui_subelements.SubelementHighlight::proceed(), draftguitools.gui_trimex.Trimex::proceed(), draftguitools.gui_upgrade.Upgrade::proceed(), draftguitools.gui_split.Split::proceed(), draftguitools.gui_selectplane.Draft_SelectPlane::reject(), drafttaskpanels.task_circulararray.TaskPanelCircularArray::reject(), drafttaskpanels.task_orthoarray.TaskPanelOrthoArray::reject(), drafttaskpanels.task_polararray.TaskPanelPolarArray::reject(), and draftguitools.gui_edit.Edit::setTrackers().
const Base::Placement & Gui::ManualAlignment::getTransform | ( | void | ) | const |
|
static |
Checks whether the one instance exists.
|
static |
Creates the one and only instance of this class.
References ManualAlignment().
Referenced by probePickedCallback().
|
protectedslot |
References align().
Referenced by probePickedCallback().
|
protectedslot |
References cancel().
Referenced by probePickedCallback().
|
protectedslot |
|
protectedslot |
References Gui::AlignmentGroup::countPoints(), Gui::ManualAlignment::Private::picksepRight, and Gui::AlignmentGroup::removeLastPoint().
Referenced by probePickedCallback().
|
protectedslot |
|
staticprotected |
References Gui::MovableGroupModel::activeGroup(), applyPickedProbe(), canAlign(), Gui::AlignmentGroup::countPoints(), Base::Persistence::getClassTypeId(), Gui::getMainWindow(), Base::Persistence::getTypeId(), instance(), Base::Type::isDerivedFrom(), Gui::AlignmentGroup::isEmpty(), Gui::MovableGroupModel::isEmpty(), onAlign(), onCancel(), onRemoveLastPointFixed(), onRemoveLastPointMoveable(), Gui::ManualAlignment::Private::pos_cam1, Gui::ManualAlignment::Private::pos_cam2, Gui::ManualAlignment::Private::rot_cam1, Gui::ManualAlignment::Private::rot_cam2, Gui::ManualAlignment::Private::sensorCam1, Gui::ManualAlignment::Private::sensorCam2, showInstructions(), Gui::MainWindow::showMessage(), and draftgeoutils.general::vec().
Referenced by startAlignment().
|
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().
void ManualAlignment::setFixedGroup | ( | const FixedGroup & | fixed | ) |
References Gui::AlignmentGroup::getDocument().
Referenced by StdCmdAlignment::activated().
void ManualAlignment::setMinPoints | ( | int | minPoints | ) |
Referenced by StdCmdAlignment::activated().
void ManualAlignment::setModel | ( | const MovableGroupModel & | model | ) |
Referenced by StdCmdAlignment::activated().
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().
|
protected |
References Gui::MovableGroupModel::activeGroup(), Gui::AlignmentGroup::countPoints(), Gui::getMainWindow(), and Gui::MainWindow::showMessage().
Referenced by probePickedCallback().
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().
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().
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(), draftgeoutils.faces::bind(), draftgeoutils.intersections::connect(), 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().