FreeCAD C++
|
#include <Gui/SelectionFilter.h>
Selection filter definition This class builds up a type/count tree out of a string to test very fast a selection or object/subelement type against it.
Example strings are: "SELECT Part::Feature SUBELEMENT Edge", "SELECT Robot::RobotObject", "SELECT Robot::RobotObject COUNT 1..5"
Public Member Functions | |
SelectionFilter (const char *filter) | |
void | setFilter (const char *filter) |
Set a new filter string. | |
bool | match (void) |
bool | test (App::DocumentObject *pObj, const char *sSubName) |
bool | isValid (void) const |
true if a valid filter is set | |
Gui::SelectionFilter::SelectionFilter | ( | const char * | filter | ) |
Constructs a SelectionFilter object.
bool Gui::SelectionFilter::match | ( | void | ) |
Test to current selection This method tests the current selection set against the filter and returns true if the described object(s) are selected.
bool Gui::SelectionFilter::test | ( | App::DocumentObject * | pObj, |
const char * | sSubName | ||
) |
Test objects This method tests if a given object is described in the filter. If SubName is not NULL the Subelement gets also tested.