The Selection class The selection singleton keeps track of the selection state of the whole application. More...
#include <Selection.h>
Classes | |
struct | SelObj |
Public Types | |
enum | VisibleState { VisHide = 0, VisShow = 1, VisToggle = -1 } |
Visible state used by setVisible() More... | |
Public Types inherited from Base::Subject< const SelectionChanges & > | |
typedef const SelectionChanges & | MessageType |
typedef Observer< const SelectionChanges & > | ObserverType |
typedef Subject< const SelectionChanges & > | SubjectType |
Public Member Functions | |
bool | addSelection (const char *pDocName, const char *pObjectName=0, const char *pSubName=0, float x=0, float y=0, float z=0, const std::vector< SelObj > *pickedList=0, bool clearPreSelect=true) |
Add to selection. More... | |
bool | addSelection (const SelectionObject &, bool clearPreSelect=true) |
Add to selection. More... | |
bool | addSelection2 (const char *pDocName, const char *pObjectName=0, const char *pSubName=0, float x=0, float y=0, float z=0, const std::vector< SelObj > *pickedList=0) |
void | addSelectionGate (Gui::SelectionGate *gate, int resolve=1) |
add a SelectionGate to control what is selectable More... | |
bool | addSelections (const char *pDocName, const char *pObjectName, const std::vector< std::string > &pSubNames) |
Add to selection with several sub-elements. More... | |
void | clearCompleteSelection (bool clearPreSelect=true) |
Clear the selection of all documents. More... | |
void | clearSelection (const char *pDocName=0, bool clearPreSelect=true) |
Clear the selection of document pDocName. If the document name is not given the selection of the active document is cleared. More... | |
unsigned int | countObjectsOfType (const Base::Type &typeId=App::DocumentObject::getClassTypeId(), const char *pDocName=0, int resolve=1) const |
Returns the number of selected objects with a special object type It's the convenient way to check if the right objects are selected to perform an operation (GuiCommand). More... | |
unsigned int | countObjectsOfType (const char *typeName, const char *pDocName=0, int resolve=1) const |
Does basically the same as the method above unless that it accepts a string literal as first argument. More... | |
int | disableCommandLog () |
int | enableCommandLog (bool silent=false) |
int | getAsPropertyLinkSubList (App::PropertyLinkSubList &prop) const |
getAsPropertyLinkSubList fills PropertyLinkSubList with current selection. More... | |
std::vector< SelObj > | getCompleteSelection (int resolve=1) const |
Returns a vector of all selection objects of all documents. More... | |
std::vector< App::DocumentObject * > | getObjectsOfType (const Base::Type &typeId, const char *pDocName=0, int resolve=1) const |
Returns a vector of objects of type TypeName selected for the given document name pDocName. More... | |
template<typename T > | |
std::vector< T * > | getObjectsOfType (const char *pDocName=0, int resolve=1) const |
A convenience template-based method that returns an array with the correct types already. More... | |
std::vector< App::DocumentObject * > | getObjectsOfType (const char *typeName, const char *pDocName=0, int resolve=1) const |
Does basically the same as the method above unless that it accepts a string literal as first argument. More... | |
const SelectionChanges & | getPreselection (void) const |
returns the present preselection More... | |
const char * | getSelectedElement (App::DocumentObject *, const char *pSubName) const |
std::vector< SelObj > | getSelection (const char *pDocName=0, int resolve=1, bool single=false) const |
Returns a vector of selection objects. More... | |
std::vector< Gui::SelectionObject > | getSelectionEx (const char *pDocName=0, Base::Type typeId=App::DocumentObject::getClassTypeId(), int resolve=1, bool single=false) const |
Returns a vector of selection objects. More... | |
bool | hasPreselection () const |
Check if there is any pre-selection. More... | |
bool | hasSelection () const |
Check if there is any selection. More... | |
bool | hasSelection (const char *doc, bool resolve=true) const |
Check if there is any selection within a given document. More... | |
bool | hasSubSelection (const char *doc=0, bool subElement=false) const |
Check if there is any sub-element selection. More... | |
bool | isSelected (App::DocumentObject *, const char *pSubName=0, int resolve=1) const |
Check if selected. More... | |
bool | isSelected (const char *pDocName, const char *pObjectName=0, const char *pSubName=0, int resolve=1) const |
Check if selected. More... | |
void | rmvPreselect (bool signal=false) |
remove the present preselection More... | |
void | rmvSelection (const char *pDocName, const char *pObjectName=0, const char *pSubName=0, const std::vector< SelObj > *pickedList=0) |
Remove from selection (for internal use) More... | |
void | rmvSelectionGate (void) |
remove the active SelectionGate More... | |
int | setPreselect (const char *pDocName, const char *pObjectName, const char *pSubName, float x=0, float y=0, float z=0, int signal=0) |
set the preselected object (mostly by the 3D view) More... | |
void | setPreselectCoord (float x, float y, float z) |
sets different coords for the preselection More... | |
void | setSelection (const char *pDocName, const std::vector< App::DocumentObject * > &) |
Set the selection for a document. More... | |
void | setVisible (VisibleState visible) |
Set selection object visibility. More... | |
unsigned int | size (void) const |
Size of selected entities for all documents. More... | |
bool | updateSelection (bool show, const char *pDocName, const char *pObjectName=0, const char *pSubName=0) |
Update a selection. More... | |
Selection stack functions | |
Selection stack is for storing selection history so that the user can go back and forward to previous selections. | |
int | selStackBackSize () const |
Return the current selection stack size. More... | |
int | selStackForwardSize () const |
Return the current forward selection stack size. More... | |
std::vector< Gui::SelectionObject > | selStackGet (const char *pDocName=0, int resolve=1, int index=0) const |
Obtain selected objects from stack. More... | |
void | selStackGoBack (int count=1) |
Go back selection history. More... | |
void | selStackGoForward (int count=1) |
Go forward selection history. More... | |
void | selStackPush (bool clearForward=true, bool overwrite=false) |
Save the current selection on to the stack. More... | |
Public Member Functions inherited from Base::Subject< const SelectionChanges & > | |
void | Attach (Observer< const SelectionChanges & > *ToObserv) |
Attach an Observer Attach an Observer to the list of Observers which get called when Notify is called. More... | |
void | ClearObserver () |
Clears the list of all registered observers. More... | |
void | Detach (Observer< const SelectionChanges & > *ToObserv) |
Detach an Observer Detach an Observer from the list of Observers which get called when Notify is called. More... | |
Observer< const SelectionChanges & > * | Get (const char *Name) |
Get an Observer by name Get a observer by name if the observer reimplements the Name() mthode. More... | |
void | Notify (const SelectionChanges & rcReason) |
Notify all Observers Send a message to all Observers attached to this subject. More... | |
Subject () | |
A constructor. More... | |
virtual | ~Subject () |
A destructor. More... | |
Public Attributes | |
boost::signals2::signal< void(const SelectionChanges &msg)> | signalSelectionChanged |
signal on new object More... | |
boost::signals2::signal< void(const SelectionChanges &msg)> | signalSelectionChanged2 |
signal on selection change with resolved object More... | |
boost::signals2::signal< void(const SelectionChanges &msg)> | signalSelectionChanged3 |
signal on selection change with resolved object and sub element map More... | |
Picked list functions | |
Picked list stores all selected geometry elements that intersects the 3D pick point. The list population is done by SoFCUnifiedSelection through addSelection() with the pickedList argument. | |
typedef std::set< App::SubObjectT > | SelStackItem |
class | SelectionFilter |
static PyMethodDef | Methods [] |
SelectionChanges | CurrentPreselection |
std::deque< SelectionChanges > | NotificationQueue |
bool | Notifying = false |
std::string | DocName |
std::string | FeatName |
std::string | SubName |
float | hx |
float | hy |
float | hz |
Gui::SelectionGate * | ActiveGate |
int | gateResolve |
int | logDisabled = 0 |
bool | logHasSelection = false |
bool | needPickedList () const |
Check whether picked list is enabled. More... | |
void | enablePickedList (bool) |
Turn on or off picked list. More... | |
bool | hasPickedList () const |
Check if there is any selection inside picked list. More... | |
std::vector< SelectionSingleton::SelObj > | getPickedList (const char *pDocName) const |
Return select objects inside picked list. More... | |
std::vector< Gui::SelectionObject > | getPickedListEx (const char *pDocName=0, Base::Type typeId=App::DocumentObject::getClassTypeId()) const |
Return selected object inside picked list grouped by top level parents. More... | |
static SelectionSingleton & | instance (void) |
static void | destruct (void) |
static PyObject * | sAddSelection (PyObject *self, PyObject *args) |
static PyObject * | sUpdateSelection (PyObject *self, PyObject *args) |
static PyObject * | sRemoveSelection (PyObject *self, PyObject *args) |
static PyObject * | sClearSelection (PyObject *self, PyObject *args) |
static PyObject * | sIsSelected (PyObject *self, PyObject *args) |
static PyObject * | sCountObjectsOfType (PyObject *self, PyObject *args) |
static PyObject * | sGetSelection (PyObject *self, PyObject *args) |
static PyObject * | sSetPreselection (PyObject *self, PyObject *args, PyObject *kwd) |
static PyObject * | sGetPreselection (PyObject *self, PyObject *args) |
static PyObject * | sRemPreselection (PyObject *self, PyObject *args) |
static PyObject * | sGetCompleteSelection (PyObject *self, PyObject *args) |
static PyObject * | sGetSelectionEx (PyObject *self, PyObject *args) |
static PyObject * | sGetSelectionObject (PyObject *self, PyObject *args) |
static PyObject * | sAddSelObserver (PyObject *self, PyObject *args) |
static PyObject * | sRemSelObserver (PyObject *self, PyObject *args) |
static PyObject * | sAddSelectionGate (PyObject *self, PyObject *args) |
static PyObject * | sRemoveSelectionGate (PyObject *self, PyObject *args) |
static PyObject * | sGetPickedList (PyObject *self, PyObject *args) |
static PyObject * | sEnablePickedList (PyObject *self, PyObject *args) |
static PyObject * | sPreselect (PyObject *self, PyObject *args) |
static PyObject * | sSetVisible (PyObject *self, PyObject *args) |
static PyObject * | sPushSelStack (PyObject *self, PyObject *args) |
static PyObject * | sHasSelection (PyObject *self, PyObject *args) |
static PyObject * | sHasSubSelection (PyObject *self, PyObject *args) |
static PyObject * | sGetSelectionFromStack (PyObject *self, PyObject *args) |
static App::DocumentObject * | getObjectOfType (_SelObj &sel, Base::Type type, int resolve, const char **subelement=0) |
SelectionSingleton () | |
Construction. More... | |
virtual | ~SelectionSingleton () |
Destruction. More... | |
void | slotDeletedObject (const App::DocumentObject &) |
Observer message from the App doc. More... | |
App::Document * | getDocument (const char *pDocName=0) const |
helper to retrieve document by name More... | |
void | slotSelectionChanged (const SelectionChanges &msg) |
void | notify (SelectionChanges &&Chng) |
void | notify (const SelectionChanges &Chng) |
int | checkSelection (const char *pDocName, const char *pObjectName, const char *pSubName, int resolve, _SelObj &sel, const std::list< _SelObj > *selList=0) const |
std::vector< Gui::SelectionObject > | getObjectList (const char *pDocName, Base::Type typeId, std::list< _SelObj > &objs, int resolve, bool single=false) const |
Detailed Description
The Selection class The selection singleton keeps track of the selection state of the whole application.
It gets messages from all entities which can alter the selection (e.g. tree view and 3D-view) and sends messages to entities which need to keep track on the selection state.
The selection consists mainly out of following information per selected object:
- document (pointer)
- Object (pointer)
- list of subelements (list of strings)
- 3D coordinates where the user clicks to select (Vector3d)
Also the preselection is managed. That means you can add a filter to prevent selection of unwanted objects or subelements.
Member Typedef Documentation
◆ SelStackItem
|
protected |
Member Enumeration Documentation
◆ VisibleState
Visible state used by setVisible()
Enumerator | |
---|---|
VisHide | Hide the selection. |
VisShow | Show the selection. |
VisToggle | Toggle visibility of the selection. |
Constructor & Destructor Documentation
◆ SelectionSingleton()
|
protected |
Construction.
A constructor.
A more elaborate description of the constructor.
References ActiveGate, gateResolve, App::GetApplication(), hx, hy, hz, App::Application::signalDeletedObject, signalSelectionChanged, slotDeletedObject(), and slotSelectionChanged().
Referenced by instance().
◆ ~SelectionSingleton()
|
protectedvirtual |
Destruction.
A destructor.
A more elaborate description of the destructor.
Member Function Documentation
◆ addSelection() [1/2]
bool SelectionSingleton::addSelection | ( | const char * | pDocName, |
const char * | pObjectName = 0 , |
||
const char * | pSubName = 0 , |
||
float | x = 0 , |
||
float | y = 0 , |
||
float | z = 0 , |
||
const std::vector< SelObj > * | pickedList = 0 , |
||
bool | clearPreSelect = true |
||
) |
Add to selection.
References Gui::Application::activeDocument(), ActiveGate, Gui::SelectionChanges::AddSelection, Gui::SelectionGate::allow(), checkSelection(), gateResolve, Gui::Document::getActiveView(), Base::Persistence::getClassTypeId(), Gui::getMainWindow(), getObjectOfType(), Gui::Application::Instance, isSelected(), logDisabled, Gui::SelectionGate::notAllowedReason, notify(), Gui::SelectionChanges::pDocName, Gui::SelectionChanges::PickedListChanged, Gui::SelectionChanges::pObjectName, Gui::SelectionChanges::pSubName, rmvPreselect(), Gui::MDIView::setOverrideCursor(), Gui::MainWindow::showMessage(), and Gui::MainWindow::updateActions().
Referenced by StdCmdLinkMakeGroup::activated(), StdCmdLinkMake::activated(), StdCmdLinkMakeRelative::activated(), StdCmdLinkSelectLinked::activated(), PartGui::FaceColors::Private::addFacesToSelection(), addSelection(), Gui::DAG::Model::contextMenuEvent(), Gui::Dialog::DlgPropertyLink::detachObserver(), Gui::TreeWidget::dropEvent(), Gui::SoFCSelection::handleEvent(), Gui::TreeWidget::itemSearch(), Gui::DAG::Model::mousePressEvent(), SketcherGui::TaskSketcherConstrains::on_listWidgetConstraints_itemSelectionChanged(), SketcherGui::TaskSketcherElements::on_listWidgetElements_itemSelectionChanged(), PartDesignGui::TaskFeaturePick::onItemSelectionChanged(), Gui::ElementColors::Private::onSelectionChanged(), DrawSketchHandlerGenConstraint::releaseButton(), DrawSketchHandlerCoincident::releaseButton(), DrawSketchHandlerFillet::releaseButton(), sAddSelection(), Gui::PropertyEditor::LinkSelection::select(), PartGui::TaskMeasureLinear::selection1Slot(), PartGui::TaskMeasureAngular::selection1Slot(), PartGui::TaskMeasureLinear::selection2Slot(), PartGui::TaskMeasureAngular::selection2Slot(), selStackGoBack(), selStackGoForward(), PartDesignGui::ViewProviderSubShapeBinder::setEdit(), TechDrawGui::ViewProviderViewPart::setEdit(), FemGui::TaskFemConstraint::setSelection(), PartDesignGui::TaskDressUpParameters::setSelection(), TechDrawGui::MDIViewPage::setTreeToSceneSelect(), PartDesignGui::ViewProvider::unsetEdit(), and SketcherGui::ViewProviderSketch::unsetEdit().
◆ addSelection() [2/2]
bool SelectionSingleton::addSelection | ( | const SelectionObject & | obj, |
bool | clearPreSelect = true |
||
) |
Add to selection.
References addSelection(), Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.
◆ addSelection2()
◆ addSelectionGate()
void SelectionSingleton::addSelectionGate | ( | Gui::SelectionGate * | gate, |
int | resolve = 1 |
||
) |
add a SelectionGate to control what is selectable
References ActiveGate, gateResolve, and rmvSelectionGate().
Referenced by DrawSketchHandlerGenConstraint::activated(), DrawSketchHandlerCoincident::activated(), DrawSketchHandlerFillet::activated(), DrawSketchHandlerTrimming::activated(), DrawSketchHandlerExtend::activated(), DrawSketchHandlerExternal::activated(), DrawSketchHandlerCarbonCopy::activated(), PartDesignGui::TaskTransformedParameters::addReferenceSelectionGate(), Gui::SelectionObserver::attachSelection(), PartGui::DlgFilletEdges::DlgFilletEdges(), Gui::ElementColors::ElementColors(), PartGui::FaceColors::FaceColors(), PartDesignGui::TaskDressUpParameters::onButtonRefAdd(), PartDesignGui::TaskDressUpParameters::onButtonRefRemove(), PartDesignGui::TaskSketchBasedParameters::onSelectReference(), sAddSelectionGate(), PartGui::ShapeBuilderWidget::ShapeBuilderWidget(), PartGui::BoxSelection::start(), and PartDesignGui::TaskDatumParameters::TaskDatumParameters().
◆ addSelections()
bool SelectionSingleton::addSelections | ( | const char * | pDocName, |
const char * | pObjectName, | ||
const std::vector< std::string > & | pSubNames | ||
) |
Add to selection with several sub-elements.
References Gui::SelectionChanges::AddSelection, checkSelection(), Gui::getMainWindow(), notify(), Gui::SelectionChanges::pDocName, Gui::SelectionChanges::PickedListChanged, Gui::SelectionChanges::pObjectName, Gui::SelectionChanges::pSubName, and Gui::MainWindow::updateActions().
Referenced by PartDesignGui::ViewProviderSubShapeBinder::setEdit(), and PartGui::DlgFilletEdges::setupFillet().
◆ checkSelection()
|
protected |
◆ clearCompleteSelection()
void SelectionSingleton::clearCompleteSelection | ( | bool | clearPreSelect = true | ) |
Clear the selection of all documents.
References Gui::MacroManager::addLine(), Gui::SelectionChanges::ClrSelection, Gui::MacroManager::Cmt, Gui::getMainWindow(), Gui::Application::Instance, logDisabled, Gui::Application::macroManager(), notify(), Gui::SelectionChanges::PickedListChanged, rmvPreselect(), and Gui::MainWindow::updateActions().
Referenced by StdCmdLinkMakeGroup::activated(), StdCmdLinkMake::activated(), StdCmdLinkMakeRelative::activated(), StdCmdLinkSelectLinked::activated(), StdCmdLinkSelectLinkedFinal::activated(), StdCmdLinkSelectAllLinks::activated(), StdCmdTreeSelectAllInstances::activated(), clearSelection(), Gui::TreeWidget::dropEvent(), selStackGoBack(), selStackGoForward(), and Gui::Application::slotDeleteDocument().
◆ clearSelection()
void SelectionSingleton::clearSelection | ( | const char * | pDocName = 0 , |
bool | clearPreSelect = true |
||
) |
Clear the selection of document pDocName. If the document name is not given the selection of the active document is cleared.
References Gui::MacroManager::addLine(), clearCompleteSelection(), Gui::SelectionChanges::ClrSelection, Gui::MacroManager::Cmt, DocName, getDocument(), Gui::getMainWindow(), App::Document::getName(), Gui::Application::Instance, logDisabled, Gui::Application::macroManager(), notify(), Gui::SelectionChanges::PickedListChanged, rmvPreselect(), and Gui::MainWindow::updateActions().
Referenced by MeshGui::TaskDecimating::accept(), SketcherCopy::activate(), CmdSketcherConstrainHorizontal::activated(), CmdSketcherConstrainVertical::activated(), StdCmdAlignment::activated(), CmdSketcherConstrainLock::activated(), CmdSketcherConstrainBlock::activated(), CmdSketcherConstrainCoincident::activated(), CmdSketcherConstrainDistance::activated(), CmdSketcherConstrainPointOnObject::activated(), CmdSketcherConstrainDistanceX::activated(), CmdSketcherConstrainDistanceY::activated(), CmdSketcherConstrainParallel::activated(), CmdSketcherConstrainPerpendicular::activated(), CmdSketcherConstrainTangent::activated(), CmdSketcherConstrainRadius::activated(), CmdSketcherConstrainDiameter::activated(), CmdSketcherConstrainAngle::activated(), DrawSketchHandlerTrimming::activated(), DrawSketchHandlerExtend::activated(), CmdSketcherConstrainEqual::activated(), DrawSketchHandlerExternal::activated(), CmdSketcherConstrainSymmetric::activated(), DrawSketchHandlerCarbonCopy::activated(), Gui::ElementColors::Private::apply(), CmdSketcherConstrainPerpendicular::applyConstraint(), CmdSketcherConstrainTangent::applyConstraint(), CmdSketcherConstrainRadius::applyConstraint(), CmdSketcherConstrainDiameter::applyConstraint(), CmdSketcherConstrainSymmetric::applyConstraint(), Gui::DAG::Model::contextMenuEvent(), Gui::Dialog::DlgPropertyLink::detachObserver(), PartDesignGui::TaskDressUpParameters::doubleClicked(), PartDesignGui::TaskDressUpParameters::exitSelectionMode(), PartGui::goDimensionAngularRoot(), PartGui::goDimensionLinearRoot(), Gui::SoFCSelection::handleEvent(), Gui::TreeWidget::itemSearch(), SketcherGui::ViewProviderSketch::mouseButtonPressed(), Gui::DAG::Model::mousePressEvent(), SketcherGui::TaskSketcherConstrains::on_listWidgetConstraints_itemSelectionChanged(), SketcherGui::TaskSketcherElements::on_listWidgetElements_itemSelectionChanged(), PartDesignGui::TaskTransformedParameters::onButtonAddFeature(), PartDesignGui::TaskDressUpParameters::onButtonRefAdd(), FemGui::TaskFemConstraint::onButtonReference(), PartDesignGui::TaskDressUpParameters::onButtonRefRemove(), PartDesignGui::TaskTransformedParameters::onButtonRemoveFeature(), SketcherGui::ViewProviderSketch::onDelete(), PartDesignGui::TaskFeaturePick::onItemSelectionChanged(), PartDesignGui::TaskFilletParameters::onSelectionChanged(), PartDesignGui::TaskChamferParameters::onSelectionChanged(), PartDesignGui::TaskThicknessParameters::onSelectionChanged(), PartDesignGui::TaskDraftParameters::onSelectionChanged(), FemGui::TaskFemConstraintBearing::onSelectionChanged(), FemGui::TaskFemConstraintGear::onSelectionChanged(), DrawSketchHandlerExternal::onSelectionChanged(), DrawSketchHandlerCarbonCopy::onSelectionChanged(), PartDesignGui::TaskSketchBasedParameters::onSelectReference(), SurfaceGui::FillingVertexPanel::open(), SurfaceGui::FillingUnboundPanel::open(), SurfaceGui::GeomFillSurface::open(), SurfaceGui::FillingPanel::open(), MeshGui::ParametersDialog::ParametersDialog(), TechDrawGui::MDIViewPage::print(), Gui::NavigationStyle::processEvent(), SketcherGui::ViewProviderSketch::purgeHandler(), DrawSketchHandlerGenConstraint::releaseButton(), DrawSketchHandlerCoincident::releaseButton(), DrawSketchHandlerFillet::releaseButton(), MeshGui::RemoveComponents::RemoveComponents(), Gui::ElementColors::Private::reset(), PartGui::TaskMeasureLinear::resetDialogSlot(), PartGui::TaskMeasureAngular::resetDialogSlot(), DrawSketchHandlerGenConstraint::resetOngoingSequences(), TechDrawGui::QGVPage::saveSvg(), sClearSelection(), ReverseEngineeringGui::SegmentationManual::SegmentationManual(), Gui::PropertyEditor::LinkSelection::select(), Gui::TreeWidget::selectAll(), PartGui::TaskMeasureLinear::selection1Slot(), PartGui::TaskMeasureAngular::selection1Slot(), PartGui::TaskMeasureLinear::selection2Slot(), PartGui::TaskMeasureAngular::selection2Slot(), PartGui::TaskMeasureLinear::selectionClearDelayedSlot(), PartGui::TaskMeasureAngular::selectionClearDelayedSlot(), TechDrawGui::ViewProviderHatch::setEdit(), TechDrawGui::ViewProviderGeomHatch::setEdit(), TechDrawGui::ViewProviderRichAnno::setEdit(), TechDrawGui::ViewProviderLeader::setEdit(), FemGui::ViewProviderFemConstraintPressure::setEdit(), PartDesignGui::ViewProviderShapeBinder::setEdit(), FemGui::ViewProviderFemConstraintBearing::setEdit(), PartDesignGui::ViewProviderHole::setEdit(), FemGui::ViewProviderFemConstraintPulley::setEdit(), FemGui::ViewProviderFemConstraintFixed::setEdit(), FemGui::ViewProviderFemConstraintForce::setEdit(), FemGui::ViewProviderFemConstraintGear::setEdit(), FemGui::ViewProviderFemConstraintFluidBoundary::setEdit(), FemGui::ViewProviderFemMeshShapeNetgen::setEdit(), FemGui::ViewProviderFemConstraintPlaneRotation::setEdit(), FemGui::ViewProviderFemConstraintHeatflux::setEdit(), FemGui::ViewProviderFemConstraintTemperature::setEdit(), FemGui::ViewProviderFemConstraintContact::setEdit(), PartDesignGui::ViewProviderPrimitive::setEdit(), FemGui::ViewProviderFemConstraintInitialTemperature::setEdit(), FemGui::ViewProviderFemConstraintDisplacement::setEdit(), FemGui::ViewProviderFemConstraintTransform::setEdit(), PartDesignGui::ViewProviderSubShapeBinder::setEdit(), PartDesignGui::ViewProvider::setEdit(), PartDesignGui::ViewProviderBoolean::setEdit(), TechDrawGui::ViewProviderWeld::setEdit(), TechDrawGui::ViewProviderViewSection::setEdit(), TechDrawGui::ViewProviderBalloon::setEdit(), TechDrawGui::ViewProviderProjGroup::setEdit(), TechDrawGui::ViewProviderViewPart::setEdit(), PartDesignGui::ViewProviderDatum::setEdit(), PartGui::ViewProviderPartExt::setEdit(), PartGui::ViewProviderOffset::setEdit(), PartGui::ViewProviderThickness::setEdit(), SketcherGui::ViewProviderSketch::setEdit(), Gui::ViewProviderLink::setEdit(), FemGui::TaskFemConstraint::setSelection(), PartDesignGui::TaskDressUpParameters::setSelection(), TechDrawGui::MDIViewPage::setTreeToSceneSelect(), PartGui::DlgFilletEdges::setupFillet(), MeshGui::TaskSmoothing::TaskSmoothing(), FemGui::ViewProviderFemConstraint::unsetEdit(), PartDesignGui::ViewProvider::unsetEdit(), SketcherGui::ViewProviderSketch::unsetEdit(), PartDesignGui::TaskChamferParameters::~TaskChamferParameters(), PartGui::TaskCheckGeometryResults::~TaskCheckGeometryResults(), PartDesignGui::TaskDraftParameters::~TaskDraftParameters(), PartDesignGui::TaskFilletParameters::~TaskFilletParameters(), PartGui::TaskMeasureAngular::~TaskMeasureAngular(), PartGui::TaskMeasureLinear::~TaskMeasureLinear(), and PartDesignGui::TaskThicknessParameters::~TaskThicknessParameters().
◆ countObjectsOfType() [1/2]
unsigned int SelectionSingleton::countObjectsOfType | ( | const Base::Type & | typeId = App::DocumentObject::getClassTypeId() , |
const char * | pDocName = 0 , |
||
int | resolve = 1 |
||
) | const |
Returns the number of selected objects with a special object type It's the convenient way to check if the right objects are selected to perform an operation (GuiCommand).
The check also detects base types. E.g. "Part" also fits on "PartImport" or "PartTransform types. If no document name is given the active document is assumed.
Set 'resolve' to true to resolve any sub object inside selection SubName field
References getDocument(), and getObjectOfType().
Referenced by countObjectsOfType(), StdCmdTransformManip::isActive(), StdCmdAlignment::isActive(), sCountObjectsOfType(), and PartDesignGui::Workbench::setupContextMenu().
◆ countObjectsOfType() [2/2]
unsigned int SelectionSingleton::countObjectsOfType | ( | const char * | typeName, |
const char * | pDocName = 0 , |
||
int | resolve = 1 |
||
) | const |
Does basically the same as the method above unless that it accepts a string literal as first argument.
typeName must be a registered type, otherwise 0 is returned.
References Base::Type::badType(), countObjectsOfType(), and Base::Type::fromName().
◆ destruct()
|
static |
Referenced by Gui::Application::~Application().
◆ disableCommandLog()
int SelectionSingleton::disableCommandLog | ( | ) |
References hasSelection(), logDisabled, and logHasSelection.
Referenced by Gui::SelectionLogDisabler::SelectionLogDisabler().
◆ enableCommandLog()
int SelectionSingleton::enableCommandLog | ( | bool | silent = false | ) |
◆ enablePickedList()
void SelectionSingleton::enablePickedList | ( | bool | enable | ) |
Turn on or off picked list.
References notify(), and Gui::SelectionChanges::PickedListChanged.
Referenced by sEnablePickedList().
◆ getAsPropertyLinkSubList()
int SelectionSingleton::getAsPropertyLinkSubList | ( | App::PropertyLinkSubList & | prop | ) | const |
getAsPropertyLinkSubList fills PropertyLinkSubList with current selection.
- Parameters
-
prop (output). The property object to receive links
- Returns
- the number of items written to the link
References Gui::SelectionObject::getObject(), getSelectionEx(), Gui::SelectionObject::getSubNames(), and App::PropertyLinkSubList::setValues().
Referenced by SketcherGui::SuggestAutoMapMode().
◆ getCompleteSelection()
std::vector< SelectionSingleton::SelObj > SelectionSingleton::getCompleteSelection | ( | int | resolve = 1 | ) | const |
Returns a vector of all selection objects of all documents.
References getSelection().
Referenced by StdCmdEdit::activated(), StdCmdDelete::isActive(), Gui::Document::setEdit(), and sGetCompleteSelection().
◆ getDocument()
|
protected |
helper to retrieve document by name
References App::Application::getActiveDocument(), App::GetApplication(), and App::Application::getDocument().
Referenced by checkSelection(), clearSelection(), countObjectsOfType(), getObjectList(), getObjectsOfType(), getPickedList(), getSelection(), hasSelection(), hasSubSelection(), setPreselect(), setSelection(), and updateSelection().
◆ getObjectList()
|
protected |
References Base::Type::badType(), getDocument(), and getObjectOfType().
Referenced by getPickedListEx(), getSelectionEx(), and selStackGet().
◆ getObjectOfType()
|
staticprotected |
Referenced by addSelection(), countObjectsOfType(), getObjectList(), getObjectsOfType(), getSelection(), and hasSelection().
◆ getObjectsOfType() [1/3]
vector< App::DocumentObject * > SelectionSingleton::getObjectsOfType | ( | const Base::Type & | typeId, |
const char * | pDocName = 0 , |
||
int | resolve = 1 |
||
) | const |
Returns a vector of objects of type TypeName selected for the given document name pDocName.
If no document name is specified the objects from the active document are regarded. If no objects of this document are selected an empty vector is returned.
- Note
- The vector reflects the sequence of selection.
References getDocument(), and getObjectOfType().
Referenced by DrawingGui::TaskProjection::accept(), ReenGui::FitBSplineSurfaceWidget::accept(), MeshGui::TaskDecimating::accept(), StdCmdToggleSelectability::activated(), StdCmdPlacement::activated(), StdCmdTransformManip::activated(), StdCmdAlignment::activated(), Gui::Application::exportTo(), getObjectsOfType(), Gui::MainWindow::insertFromMimeData(), MeshInfoWatcher::onSelectionChanged(), MeshGui::TaskDecimating::TaskDecimating(), and DrawingGui::TaskOrthoViews::TaskOrthoViews().
◆ getObjectsOfType() [2/3]
std::vector< T * > Gui::SelectionSingleton::getObjectsOfType | ( | const char * | pDocName = 0 , |
int | resolve = 1 |
||
) | const |
A convenience template-based method that returns an array with the correct types already.
◆ getObjectsOfType() [3/3]
std::vector< App::DocumentObject * > SelectionSingleton::getObjectsOfType | ( | const char * | typeName, |
const char * | pDocName = 0 , |
||
int | resolve = 1 |
||
) | const |
Does basically the same as the method above unless that it accepts a string literal as first argument.
typeName must be a registered type otherwise an empty array is returned.
References Base::Type::badType(), Base::Type::fromName(), and getObjectsOfType().
◆ getPickedList()
std::vector< SelectionSingleton::SelObj > SelectionSingleton::getPickedList | ( | const char * | pDocName | ) | const |
Return select objects inside picked list.
References Gui::SelectionSingleton::SelObj::DocName, Gui::SelectionSingleton::SelObj::FeatName, getDocument(), Gui::SelectionSingleton::SelObj::pDoc, Gui::SelectionSingleton::SelObj::pObject, Gui::SelectionSingleton::SelObj::pResolvedObject, Gui::SelectionSingleton::SelObj::SubName, Gui::SelectionSingleton::SelObj::TypeName, Gui::SelectionSingleton::SelObj::x, Gui::SelectionSingleton::SelObj::y, and Gui::SelectionSingleton::SelObj::z.
◆ getPickedListEx()
std::vector< SelectionObject > SelectionSingleton::getPickedListEx | ( | const char * | pDocName = 0 , |
Base::Type | typeId = App::DocumentObject::getClassTypeId() |
||
) | const |
Return selected object inside picked list grouped by top level parents.
References getObjectList().
Referenced by sGetPickedList().
◆ getPreselection()
const SelectionChanges & SelectionSingleton::getPreselection | ( | void | ) | const |
◆ getSelectedElement()
const char * SelectionSingleton::getSelectedElement | ( | App::DocumentObject * | obj, |
const char * | pSubName | ||
) | const |
◆ getSelection()
std::vector< SelectionSingleton::SelObj > SelectionSingleton::getSelection | ( | const char * | pDocName = 0 , |
int | resolve = 1 , |
||
bool | single = false |
||
) | const |
Returns a vector of selection objects.
- Parameters
-
pDocName document name. If no document name is given the objects of the active are returned. If nothing for this Document is selected an empty vector is returned. If document name is "*", then all document is considered. resolve sub-object resolving mode 0 no resolve, 1 resolve sub-object with old style element name 2 resolve sub-object with new style element name single if set to true, then it will return an empty vector if there is more than one selections.
- Returns
- The returned vector reflects the sequence of selection.
References Gui::SelectionSingleton::SelObj::DocName, Gui::SelectionSingleton::SelObj::FeatName, Base::Persistence::getClassTypeId(), getDocument(), getObjectOfType(), Gui::SelectionSingleton::SelObj::pDoc, Gui::SelectionSingleton::SelObj::pObject, Gui::SelectionSingleton::SelObj::pResolvedObject, Gui::SelectionSingleton::SelObj::SubName, Gui::SelectionSingleton::SelObj::TypeName, Gui::SelectionSingleton::SelObj::x, Gui::SelectionSingleton::SelObj::y, and Gui::SelectionSingleton::SelObj::z.
Referenced by StdCmdLinkSelectAllLinks::activated(), PartGui::evaluateAngularPreSelection(), PartGui::evaluateLinearPreSelection(), getCompleteSelection(), StdCmdLinkSelectAllLinks::isActive(), TechDrawGui::MDIViewPage::onSelectionChanged(), Gui::DAG::Model::selectionChanged(), Gui::DocumentItem::selectItems(), Gui::View3DInventorViewer::setDocument(), femguiutils.selection_widgets._Selector::setHelpText(), PartDesignGui::Workbench::setupContextMenu(), and sGetSelection().
◆ getSelectionEx()
std::vector< SelectionObject > SelectionSingleton::getSelectionEx | ( | const char * | pDocName = 0 , |
Base::Type | typeId = App::DocumentObject::getClassTypeId() , |
||
int | resolve = 1 , |
||
bool | single = false |
||
) | const |
Returns a vector of selection objects.
- Parameters
-
pDocName document name. If no document name is given the objects of the active are returned. If nothing for this Document is selected an empty vector is returned. If document name is "*", then all document is considered. typeId specify the type of object to be returned. resolve sub-object resolving mode. 0 no resolve, 1 resolve sub-object with old style element name 2 resolve sub-object with new style element name single if set to true, then it will return an empty vector if there is more than one selections.
- Returns
- The returned vector reflects the sequence of selection.
References getObjectList().
Referenced by SketcherCopy::activate(), CmdSketcherConstrainHorizontal::activated(), StdCmdDelete::activated(), CmdSketcherConstrainVertical::activated(), CmdSketcherConstrainLock::activated(), CmdSketcherConstrainBlock::activated(), CmdSketcherConstrainCoincident::activated(), CmdSketcherConstrainDistance::activated(), CmdSketcherConstrainPointOnObject::activated(), StdCmdTreeSelectAllInstances::activated(), CmdSketcherConstrainDistanceX::activated(), CmdSketcherConstrainDistanceY::activated(), CmdSketcherConstrainParallel::activated(), CmdSketcherConstrainPerpendicular::activated(), CmdSketcherConstrainTangent::activated(), CmdSketcherConstrainRadius::activated(), CmdSketcherConstrainDiameter::activated(), CmdSketcherConstrainAngle::activated(), CmdSketcherConstrainEqual::activated(), CmdSketcherConstrainSymmetric::activated(), SketcherGui::ViewProviderSketch::deleteSelected(), SketcherGui::ElementView::deleteSelectedItems(), SketcherGui::ConstraintView::deleteSelectedItems(), getAsPropertyLinkSubList(), StdCmdTreeSelectAllInstances::isActive(), Gui::SelectionFilter::match(), SketcherGui::ViewProviderSketch::mouseButtonPressed(), Gui::PropertyView::onTimer(), Gui::Dialog::Placement::Placement(), TechDrawGui::MDIViewPage::sceneSelectionChanged(), SketcherGui::SketchSelection::setUp(), and sGetSelectionEx().
◆ hasPickedList()
bool SelectionSingleton::hasPickedList | ( | ) | const |
Check if there is any selection inside picked list.
◆ hasPreselection()
bool SelectionSingleton::hasPreselection | ( | ) | const |
Check if there is any pre-selection.
References CurrentPreselection, App::DocumentObjectT::getObjectName(), and Gui::SelectionChanges::Object.
◆ hasSelection() [1/2]
bool SelectionSingleton::hasSelection | ( | ) | const |
Check if there is any selection.
Referenced by disableCommandLog(), enableCommandLog(), StdCmdCopy::isActive(), StdCmdDuplicateSelection::isActive(), Gui::TreeWidget::scrollItemToTop(), and sHasSelection().
◆ hasSelection() [2/2]
Check if there is any selection within a given document.
- Parameters
-
doc specify the document to check for selection. If NULL, then check the current active document. resolve whether to resolve the selected sub-object
If resolve
is true, then the selection is first resolved before matching its owner document. So in case the selected sub-object is linked from an external document, it may not match the input doc
. If resolve
is false, then the match is only done with the top level parent object.
References Base::Persistence::getClassTypeId(), getDocument(), and getObjectOfType().
◆ hasSubSelection()
Check if there is any sub-element selection.
- Parameters
-
doc optional document to check for selection subElement whether to count sub-element only selection
Example sub selections are face, edge or vertex. If subElement
is false, then sub-object (i.e. a group child object) selection is also counted even if it selects the whole sub-object.
References getDocument().
Referenced by StdCmdLinkMakeRelative::isActive(), and sHasSubSelection().
◆ instance()
|
static |
References SelectionSingleton().
◆ isSelected() [1/2]
bool SelectionSingleton::isSelected | ( | App::DocumentObject * | pObject, |
const char * | pSubName = 0 , |
||
int | resolve = 1 |
||
) | const |
Check if selected.
References checkSelection(), App::DocumentObject::getDocument(), App::Document::getName(), and App::DocumentObject::getNameInDocument().
◆ isSelected() [2/2]
bool SelectionSingleton::isSelected | ( | const char * | pDocName, |
const char * | pObjectName = 0 , |
||
const char * | pSubName = 0 , |
||
int | resolve = 1 |
||
) | const |
Check if selected.
References checkSelection().
Referenced by addSelection(), Gui::SoFCUnifiedSelection::doAction(), Gui::SoFCSelection::doAction(), notify(), sIsSelected(), and updateSelection().
◆ needPickedList()
bool SelectionSingleton::needPickedList | ( | ) | const |
Check whether picked list is enabled.
Referenced by Gui::View3DInventorViewer::checkGroupOnTop().
◆ notify() [1/2]
|
protected |
◆ notify() [2/2]
|
protected |
References Gui::SelectionChanges::AddSelection, Gui::SelectionChanges::ClrSelection, CurrentPreselection, isSelected(), NotificationQueue, Base::Subject< const SelectionChanges & >::Notify(), Notifying, Gui::SelectionChanges::Object, Gui::SelectionChanges::RmvPreselect, Gui::SelectionChanges::RmvSelection, Gui::SelectionChanges::SetPreselect, signalSelectionChanged, and Gui::SelectionChanges::Type.
Referenced by addSelection(), addSelections(), clearCompleteSelection(), clearSelection(), enablePickedList(), rmvPreselect(), rmvSelection(), setPreselect(), setSelection(), slotDeletedObject(), and updateSelection().
◆ rmvPreselect()
void SelectionSingleton::rmvPreselect | ( | bool | signal = false | ) |
remove the present preselection
References Gui::Application::activeDocument(), ActiveGate, CurrentPreselection, DocName, FeatName, Gui::Document::getActiveView(), Gui::getMainWindow(), hx, hy, hz, Gui::Application::Instance, notify(), Gui::MDIView::restoreOverrideCursor(), Gui::SelectionChanges::RmvPreselect, Gui::SelectionChanges::RmvPreselectSignal, and SubName.
Referenced by addSelection(), clearCompleteSelection(), clearSelection(), Gui::SoFCSelection::handleEvent(), Gui::DockWnd::SelectionView::leaveEvent(), Gui::Dialog::DlgPropertyLink::leaveEvent(), Gui::ElementColors::leaveEvent(), SketcherGui::TaskSketcherElements::leaveEvent(), Gui::TreeWidget::leaveEvent(), SketcherGui::TaskSketcherElements::on_listWidgetElements_currentFilterChanged(), SketcherGui::TaskSketcherElements::on_listWidgetElements_filterShortcutPressed(), SketcherGui::TaskSketcherElements::on_listWidgetElements_itemEntered(), SketcherGui::DrawSketchHandler::quit(), SketcherGui::ViewProviderSketch::setEdit(), setPreselect(), slotDeletedObject(), sRemPreselection(), and updateSelection().
◆ rmvSelection()
void SelectionSingleton::rmvSelection | ( | const char * | pDocName, |
const char * | pObjectName = 0 , |
||
const char * | pSubName = 0 , |
||
const std::vector< SelObj > * | pickedList = 0 |
||
) |
Remove from selection (for internal use)
References checkSelection(), Gui::getMainWindow(), notify(), Gui::SelectionChanges::PickedListChanged, Gui::SelectionChanges::RmvSelection, and Gui::MainWindow::updateActions().
Referenced by Gui::SoFCSelection::handleEvent(), SketcherGui::ViewProviderSketch::mouseButtonPressed(), Gui::DAG::Model::mousePressEvent(), Gui::ElementColors::Private::onSelectionChanged(), Gui::SelectionObjectPy::remove(), sRemoveSelection(), and Gui::DocumentItem::updateItemSelection().
◆ rmvSelectionGate()
void SelectionSingleton::rmvSelectionGate | ( | void | ) |
remove the active SelectionGate
References Gui::Application::activeDocument(), ActiveGate, Gui::Application::Instance, and Gui::MDIView::restoreOverrideCursor().
Referenced by SurfaceGui::FillingUnboundPanel::accept(), SurfaceGui::GeomFillSurface::accept(), SurfaceGui::FillingPanel::accept(), DrawSketchHandlerGenConstraint::activated(), DrawSketchHandlerCoincident::activated(), DrawSketchHandlerFillet::activated(), DrawSketchHandlerTrimming::activated(), DrawSketchHandlerExtend::activated(), DrawSketchHandlerExternal::activated(), DrawSketchHandlerCarbonCopy::activated(), addSelectionGate(), Gui::SelectionObserver::detachSelection(), PartDesignGui::TaskDressUpParameters::exitSelectionMode(), PartDesignGui::TaskTransformedParameters::exitSelectionMode(), FemGui::TaskCreateNodeSet::onSelectionChanged(), SurfaceGui::FillingPanel::onSelectionChanged(), PartDesignGui::TaskSketchBasedParameters::onSelectReference(), SketcherGui::DrawSketchHandler::quit(), SurfaceGui::FillingUnboundPanel::reject(), SurfaceGui::GeomFillSurface::reject(), SurfaceGui::FillingPanel::reject(), sRemoveSelectionGate(), PartGui::DlgExtrusion::~DlgExtrusion(), PartGui::DlgFilletEdges::~DlgFilletEdges(), PartGui::DlgProjectionOnSurface::~DlgProjectionOnSurface(), PartGui::DlgRevolution::~DlgRevolution(), DrawSketchHandlerCarbonCopy::~DrawSketchHandlerCarbonCopy(), DrawSketchHandlerCoincident::~DrawSketchHandlerCoincident(), DrawSketchHandlerExtend::~DrawSketchHandlerExtend(), DrawSketchHandlerExternal::~DrawSketchHandlerExternal(), DrawSketchHandlerFillet::~DrawSketchHandlerFillet(), DrawSketchHandlerGenConstraint::~DrawSketchHandlerGenConstraint(), DrawSketchHandlerTrimming::~DrawSketchHandlerTrimming(), Gui::ElementColors::~ElementColors(), PartGui::FaceColors::~FaceColors(), SurfaceGui::FillingUnboundPanel::~FillingUnboundPanel(), SurfaceGui::FillingVertexPanel::~FillingVertexPanel(), PartGui::ShapeBuilderWidget::~ShapeBuilderWidget(), PartDesignGui::TaskChamferParameters::~TaskChamferParameters(), PartDesignGui::TaskDatumParameters::~TaskDatumParameters(), PartDesignGui::TaskDraftParameters::~TaskDraftParameters(), PartDesignGui::TaskDressUpParameters::~TaskDressUpParameters(), PartDesignGui::TaskFilletParameters::~TaskFilletParameters(), PartDesignGui::TaskThicknessParameters::~TaskThicknessParameters(), and PartDesignGui::TaskTransformedParameters::~TaskTransformedParameters().
◆ sAddSelection()
◆ sAddSelectionGate()
|
staticprotected |
References addSelectionGate(), and Gui::Selection().
◆ sAddSelObserver()
References Gui::SelectionObserverPython::addObserver().
◆ sClearSelection()
References clearSelection(), and Gui::Selection().
◆ sCountObjectsOfType()
|
staticprotected |
References countObjectsOfType(), and Gui::Selection().
◆ selStackBackSize()
int Gui::SelectionSingleton::selStackBackSize | ( | ) | const |
Return the current selection stack size.
Referenced by StdCmdSelBack::isActive().
◆ selStackForwardSize()
int Gui::SelectionSingleton::selStackForwardSize | ( | ) | const |
Return the current forward selection stack size.
Referenced by StdCmdSelForward::isActive().
◆ selStackGet()
std::vector< SelectionObject > SelectionSingleton::selStackGet | ( | const char * | pDocName = 0 , |
int | resolve = 1 , |
||
int | index = 0 |
||
) | const |
Obtain selected objects from stack.
- Parameters
-
pDocName optional filtering document, NULL for current active document resolve sub-object resolving mode. 0 no resolve, 1 resolve sub-object with old style element name 2 resolve sub-object with new style element name index optional position in the stack
References checkSelection(), Base::Persistence::getClassTypeId(), and getObjectList().
Referenced by sGetSelectionFromStack().
◆ selStackGoBack()
void SelectionSingleton::selStackGoBack | ( | int | count = 1 | ) |
Go back selection history.
- Parameters
-
count optional number of steps to go back
This function pops the selection stack, and populate the current selection with the content of the last pop'd entry
References addSelection(), clearCompleteSelection(), Gui::getMainWindow(), selStackPush(), and Gui::MainWindow::updateActions().
Referenced by StdCmdSelBack::activated().
◆ selStackGoForward()
void SelectionSingleton::selStackGoForward | ( | int | count = 1 | ) |
Go forward selection history.
- Parameters
-
count optional number of steps to go back
This function pops the selection stack, and populate the current selection with the content of the last pop'd entry
References addSelection(), clearCompleteSelection(), Gui::getMainWindow(), selStackPush(), and Gui::MainWindow::updateActions().
Referenced by StdCmdSelForward::activated().
◆ selStackPush()
Save the current selection on to the stack.
- Parameters
-
clearForward whether to clear forward selection stack overwrite whether to overwrite the current top entry of the stack instead of pushing a new entry.
References App::GetApplication(), ParameterGrp::GetInt(), and App::Application::GetParameterGroupByPath().
Referenced by StdCmdLinkMakeGroup::activated(), StdCmdLinkMake::activated(), StdCmdLinkMakeRelative::activated(), StdCmdLinkSelectLinked::activated(), StdCmdLinkSelectLinkedFinal::activated(), StdCmdLinkSelectAllLinks::activated(), StdCmdTreeSelectAllInstances::activated(), Gui::Dialog::DlgPropertyLink::attachObserver(), Gui::TreeWidget::dropEvent(), Gui::TreeWidget::itemSearch(), Gui::PropertyEditor::LinkSelection::select(), Gui::TreeWidget::selectAll(), selStackGoBack(), selStackGoForward(), PartDesignGui::ViewProviderSubShapeBinder::setEdit(), and sPushSelStack().
◆ sEnablePickedList()
|
staticprotected |
References enablePickedList(), and Gui::Selection().
◆ setPreselect()
int SelectionSingleton::setPreselect | ( | const char * | pDocName, |
const char * | pObjectName, | ||
const char * | pSubName, | ||
float | x = 0 , |
||
float | y = 0 , |
||
float | z = 0 , |
||
int | signal = 0 |
||
) |
set the preselected object (mostly by the 3D view)
References Gui::Application::activeDocument(), ActiveGate, Gui::SelectionGate::allow(), CurrentPreselection, DocName, FeatName, gateResolve, Gui::Document::getActiveView(), getDocument(), Gui::getMainWindow(), App::Document::getObject(), hx, hy, hz, Gui::Application::Instance, Gui::SelectionChanges::MovePreselect, Gui::SelectionGate::notAllowedReason, notify(), App::GeoFeature::resolveElement(), Gui::MDIView::restoreOverrideCursor(), rmvPreselect(), Gui::MDIView::setOverrideCursor(), Gui::SelectionChanges::SetPreselect, Gui::SelectionChanges::SetPreselectSignal, Gui::MainWindow::showMessage(), SubName, and Gui::SelectionChanges::Type.
Referenced by SketcherGui::ViewProviderSketch::detectPreselection(), Gui::SoFCSelection::handleEvent(), Gui::TreeWidget::itemSearch(), SketcherGui::TaskSketcherElements::on_listWidgetElements_itemEntered(), Gui::TreeWidget::onPreSelectTimer(), TechDrawGui::MDIViewPage::preSelectionChanged(), and sSetPreselection().
◆ setPreselectCoord()
void SelectionSingleton::setPreselectCoord | ( | float | x, |
float | y, | ||
float | z | ||
) |
sets different coords for the preselection
References CurrentPreselection, Gui::getMainWindow(), App::DocumentObjectT::getObjectName(), Gui::SelectionChanges::Object, Gui::SelectionChanges::pDocName, Gui::SelectionChanges::pObjectName, Gui::SelectionChanges::pSubName, Gui::schemaTranslatePoint(), Gui::MainWindow::showMessage(), Gui::SelectionChanges::x, Gui::SelectionChanges::y, and Gui::SelectionChanges::z.
Referenced by SketcherGui::ViewProviderSketch::detectPreselection(), and Gui::SoFCSelection::handleEvent().
◆ setSelection()
void SelectionSingleton::setSelection | ( | const char * | pDocName, |
const std::vector< App::DocumentObject * > & | sel | ||
) |
Set the selection for a document.
References checkSelection(), getDocument(), Gui::getMainWindow(), notify(), Gui::SelectionChanges::PickedListChanged, Gui::SelectionChanges::SetSelection, and Gui::MainWindow::updateActions().
Referenced by StdCmdSelectVisibleObjects::activated(), StdCmdSelectAll::activated(), Gui::TreeWidget::dropEvent(), Gui::TreeWidget::selectAll(), and Gui::View3DInventorViewer::selectAll().
◆ setVisible()
void SelectionSingleton::setVisible | ( | VisibleState | visible | ) |
Set selection object visibility.
- Parameters
-
visible see VisibleState
References App::GetApplication(), App::Application::getDocument(), App::DocumentObject::getNameInDocument(), Gui::Application::getViewProvider(), Gui::Application::Instance, App::DocumentObject::isElementVisible(), Gui::ViewProvider::isShow(), App::DocumentObject::resolve(), App::DocumentObject::setElementVisible(), updateSelection(), VisShow, and VisToggle.
Referenced by StdCmdToggleVisibility::activated(), StdCmdShowSelection::activated(), StdCmdHideSelection::activated(), and sSetVisible().
◆ sGetCompleteSelection()
|
staticprotected |
References getCompleteSelection(), and Gui::Selection().
◆ sGetPickedList()
References getPickedListEx(), and Gui::Selection().
◆ sGetPreselection()
|
staticprotected |
References getPreselection(), and Gui::Selection().
◆ sGetSelection()
References getSelection(), and Gui::Selection().
◆ sGetSelectionEx()
References Base::Persistence::getClassTypeId(), getSelectionEx(), and Gui::Selection().
◆ sGetSelectionFromStack()
|
staticprotected |
References Gui::Selection(), and selStackGet().
◆ sGetSelectionObject()
◆ sHasSelection()
References hasSelection(), and Gui::Selection().
◆ sHasSubSelection()
|
staticprotected |
References hasSubSelection(), and Gui::Selection().
◆ sIsSelected()
◆ size()
unsigned int Gui::SelectionSingleton::size | ( | void | ) | const |
Size of selected entities for all documents.
Referenced by PathScripts.PostUtils.GCodeEditorDialog::done(), and StdCmdSetAppearance::isActive().
◆ slotDeletedObject()
|
protected |
Observer message from the App doc.
References App::DocumentObject::getDocument(), Gui::getMainWindow(), App::Document::getName(), App::DocumentObject::getNameInDocument(), notify(), Gui::SelectionChanges::PickedListChanged, rmvPreselect(), Gui::SelectionChanges::RmvSelection, and Gui::MainWindow::updateActions().
Referenced by SelectionSingleton().
◆ slotSelectionChanged()
|
protected |
References App::SubObjectT::getSubName(), Gui::SelectionChanges::HideSelection, Gui::SelectionChanges::Object, Gui::SelectionChanges::pOriginalMsg, Gui::SelectionChanges::pSubName, App::GeoFeature::resolveElement(), Gui::SelectionChanges::SetPreselectSignal, App::SubObjectT::setSubName(), Gui::SelectionChanges::ShowSelection, signalSelectionChanged2, and signalSelectionChanged3.
Referenced by SelectionSingleton().
◆ sPreselect()
|
staticprotected |
◆ sPushSelStack()
References Gui::Selection(), and selStackPush().
◆ sRemoveSelection()
◆ sRemoveSelectionGate()
|
staticprotected |
References rmvSelectionGate(), and Gui::Selection().
◆ sRemPreselection()
|
staticprotected |
References rmvPreselect(), and Gui::Selection().
◆ sRemSelObserver()
References Gui::SelectionObserverPython::removeObserver().
◆ sSetPreselection()
◆ sSetVisible()
References Gui::Selection(), setVisible(), VisHide, VisShow, and VisToggle.
◆ sUpdateSelection()
◆ updateSelection()
bool SelectionSingleton::updateSelection | ( | bool | show, |
const char * | pDocName, | ||
const char * | pObjectName = 0 , |
||
const char * | pSubName = 0 |
||
) |
Update a selection.
References DocName, FeatName, getDocument(), Gui::SelectionChanges::HideSelection, isSelected(), notify(), Gui::SelectionChanges::pDocName, Gui::SelectionChanges::pObjectName, Gui::SelectionChanges::pSubName, rmvPreselect(), Gui::SelectionChanges::SetPreselectSignal, Gui::SelectionChanges::ShowSelection, and SubName.
Referenced by PathScripts.PathOpGui.TaskPanel::addSelection(), PathScripts.PathJobGui.TaskPanel::addSelection(), PathScripts.PathOpGui.TaskPanel::clearSelection(), PathScripts.PathJobGui.TaskPanel::clearSelection(), PathScripts.PathToolLibraryEditor.EditorPanel::duplicate(), PathScripts.PathToolLibraryEditor.EditorPanel::moveDown(), PathScripts.PathToolLibraryEditor.EditorPanel::moveUp(), PathScripts.PathOpGui.TaskPanel::removeSelection(), PathScripts.PathJobGui.TaskPanel::removeSelection(), PathScripts.PathOpGui.TaskPanelDepthsPage::setFields(), PathScripts.PathOpGui.TaskPanel::setSelection(), PathScripts.PathJobGui.TaskPanel::setSelection(), PathScripts.PathToolBitGui.ToolBitSelector::setupUI(), PathScripts.PathJobGui.TaskPanel::setupUi(), setVisible(), sUpdateSelection(), and PathScripts.PathToolBitGui.ToolBitSelector::updateTools().
Friends And Related Function Documentation
◆ SelectionFilter
|
friend |
Member Data Documentation
◆ ActiveGate
|
protected |
Referenced by addSelection(), addSelectionGate(), rmvPreselect(), rmvSelectionGate(), SelectionSingleton(), and setPreselect().
◆ CurrentPreselection
|
protected |
Referenced by getPreselection(), hasPreselection(), notify(), rmvPreselect(), setPreselect(), and setPreselectCoord().
◆ DocName
|
protected |
Referenced by clearSelection(), rmvPreselect(), setPreselect(), Mod.Test.Document.DocumentPlatformCases::testColorList(), Mod.Test.Document.DocumentPlatformCases::testFloatList(), Mod.Test.Document.DocumentPlatformCases::testPoints(), Mod.Test.Document.DocumentPlatformCases::testVectorList(), and updateSelection().
◆ FeatName
|
protected |
Referenced by rmvPreselect(), setPreselect(), and updateSelection().
◆ gateResolve
|
protected |
Referenced by addSelection(), addSelectionGate(), SelectionSingleton(), and setPreselect().
◆ hx
|
protected |
Referenced by rmvPreselect(), SelectionSingleton(), and setPreselect().
◆ hy
|
protected |
Referenced by rmvPreselect(), SelectionSingleton(), and setPreselect().
◆ hz
|
protected |
Referenced by rmvPreselect(), SelectionSingleton(), and setPreselect().
◆ logDisabled
|
protected |
Referenced by addSelection(), clearCompleteSelection(), clearSelection(), disableCommandLog(), and enableCommandLog().
◆ logHasSelection
|
protected |
Referenced by disableCommandLog(), and enableCommandLog().
◆ Methods
|
static |
Referenced by Gui::Application::Application().
◆ NotificationQueue
|
protected |
Referenced by notify().
◆ Notifying
◆ signalSelectionChanged
boost::signals2::signal<void (const SelectionChanges& msg)> Gui::SelectionSingleton::signalSelectionChanged |
signal on new object
Referenced by Gui::SelectionObserver::attachSelection(), notify(), and SelectionSingleton().
◆ signalSelectionChanged2
boost::signals2::signal<void (const SelectionChanges& msg)> Gui::SelectionSingleton::signalSelectionChanged2 |
signal on selection change with resolved object
Referenced by Gui::SelectionObserver::attachSelection(), and slotSelectionChanged().
◆ signalSelectionChanged3
boost::signals2::signal<void (const SelectionChanges& msg)> Gui::SelectionSingleton::signalSelectionChanged3 |
signal on selection change with resolved object and sub element map
Referenced by Gui::SelectionObserver::attachSelection(), and slotSelectionChanged().
◆ SubName
|
protected |
Referenced by rmvPreselect(), setPreselect(), and updateSelection().
The documentation for this class was generated from the following files:
- src/Gui/Selection.h
- src/Gui/Selection.cpp