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.
|
bool | addSelection (const char *pDocName, const char *pObjectName=0, const char *pSubName=0, float x=0, float y=0, float z=0) |
| Add to selection.
|
|
bool | addSelection (const char *pDocName, const char *pObjectName, const std::vector< std::string > &pSubNames) |
| Add to selection with several sub-elements.
|
|
bool | addSelection (const SelectionObject &) |
| Add to selection.
|
|
void | rmvSelection (const char *pDocName, const char *pObjectName=0, const char *pSubName=0) |
| Remove from selection (for internal use)
|
|
void | setSelection (const char *pDocName, const std::vector< App::DocumentObject * > &) |
| Set the selection for a document.
|
|
void | clearSelection (const char *pDocName=0) |
| Clear the selection of document pDocName. If the document name is not given the selection of the active document is cleared.
|
|
void | clearCompleteSelection () |
| Clear the selection of all documents.
|
|
bool | isSelected (const char *pDocName, const char *pObjectName=0, const char *pSubName=0) const |
| Check if selected.
|
|
bool | isSelected (App::DocumentObject *, const char *pSubName=0) const |
| Check if selected.
|
|
bool | setPreselect (const char *pDocName, const char *pObjectName, const char *pSubName, float x=0, float y=0, float z=0) |
| set the preselected object (mostly by the 3D view)
|
|
void | rmvPreselect () |
| remove the present preselection
|
|
void | setPreselectCoord (float x, float y, float z) |
| sets different coords for the preselection
|
|
const SelectionChanges & | getPreselection (void) const |
| returns the present preselection
|
|
void | addSelectionGate (Gui::SelectionGate *gate) |
| add a SelectionGate to control what is selectable
|
|
void | rmvSelectionGate (void) |
| remove the active SelectionGate
|
|
unsigned int | countObjectsOfType (const Base::Type &typeId, const char *pDocName=0) const |
|
unsigned int | countObjectsOfType (const char *typeName, const char *pDocName=0) const |
|
std::vector< App::DocumentObject * > | getObjectsOfType (const Base::Type &typeId, const char *pDocName=0) const |
|
std::vector< App::DocumentObject * > | getObjectsOfType (const char *typeName, const char *pDocName=0) const |
|
template<typename T > |
std::vector< T * > | getObjectsOfType (const char *pDocName=0) const |
|
std::vector< SelObj > | getSelection (const char *pDocName=0) const |
|
std::vector< Gui::SelectionObject > | getSelectionEx (const char *pDocName=0, Base::Type typeId=App::DocumentObject::getClassTypeId()) const |
|
int | getAsPropertyLinkSubList (App::PropertyLinkSubList &prop) const |
| getAsPropertyLinkSubList fills PropertyLinkSubList with current selection. More...
|
|
std::vector< SelObj > | getCompleteSelection () const |
|
unsigned int | size (void) const |
| Size of selected entities for all documents.
|
|
| Subject () |
|
virtual | ~Subject () |
|
void | Attach (Observer< const SelectionChanges & > *ToObserv) |
|
void | Detach (Observer< const SelectionChanges & > *ToObserv) |
|
void | Notify (const SelectionChanges & rcReason) |
|
Observer< const SelectionChanges & > * | Get (const char *Name) |
|
void | ClearObserver () |
|