FreeCAD C++
Public Member Functions | List of all members
Gui::SelectionFilter Class Reference

#include <Gui/SelectionFilter.h>

Detailed Description

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
 

Constructor & Destructor Documentation

◆ SelectionFilter()

Gui::SelectionFilter::SelectionFilter ( const char *  filter)

Constructs a SelectionFilter object.

Member Function Documentation

◆ match()

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.

◆ test()

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.