Gui::SelectionFilter Class Reference

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. More...

#include <SelectionFilter.h>

Inheritance diagram for Gui::SelectionFilter:
Gui::TaskView::TaskWatcher Gui::TaskView::TaskWatcherCommands Gui::TaskView::TaskWatcherPython RobotGui::TaskWatcherRobot Gui::TaskView::TaskWatcherCommandsEmptyDoc

List of all members.

Public Member Functions

void addError (const char *e)
bool isValid (void) const
 true if a valid filter is set
bool 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.
 SelectionFilter (const std::string &filter)
 SelectionFilter (const char *filter)
 Constructs a SelectionFilter object.
void setFilter (const char *filter)
 Set a new filter string.
bool test (App::DocumentObject *pObj, const char *sSubName)
 Test objects This method tests if a given object is described in the filter.
virtual ~SelectionFilter ()

Public Attributes

std::vector< std::vector
< SelectionObject > > 
Result

Protected Member Functions

bool parse (void)

Protected Attributes

Node_BlockAst
std::string Errors
std::string Filter

Friends

class SelectionSingleton

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"

Definition at line 49 of file SelectionFilter.h.


Constructor & Destructor Documentation

SelectionFilter::SelectionFilter ( const char *  filter  ) 

Constructs a SelectionFilter object.

Definition at line 76 of file SelectionFilter.cpp.

References setFilter().

SelectionFilter::SelectionFilter ( const std::string &  filter  ) 

Definition at line 82 of file SelectionFilter.cpp.

References setFilter().

SelectionFilter::~SelectionFilter (  )  [virtual]

Definition at line 101 of file SelectionFilter.cpp.


Member Function Documentation

void SelectionFilter::addError ( const char *  e  ) 

Definition at line 168 of file SelectionFilter.cpp.

References Errors.

Referenced by yyerror().

bool Gui::SelectionFilter::isValid ( void   )  const [inline]

true if a valid filter is set

Definition at line 80 of file SelectionFilter.h.

bool SelectionFilter::match ( void   ) 
bool SelectionFilter::parse ( void   )  [protected]

Definition at line 293 of file SelectionFilter.cpp.

References Ast, Errors, Filter, and yyparse.

Referenced by setFilter().

void SelectionFilter::setFilter ( const char *  filter  ) 

Set a new filter string.

Definition at line 88 of file SelectionFilter.cpp.

References Ast, Errors, Filter, and parse().

Referenced by SelectionFilter(), and Gui::TaskView::TaskWatcherPython::TaskWatcherPython().

bool 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.

Definition at line 148 of file SelectionFilter.cpp.

References Ast, App::PropertyContainer::getTypeId(), Base::Type::isDerivedFrom(), and Gui::Node_Block::Objects.

Referenced by Gui::SelectionFilterGate::allow(), and Gui::SelectionFilterPy::test().


Friends And Related Function Documentation

friend class SelectionSingleton [friend]

Definition at line 75 of file SelectionFilter.h.


Member Data Documentation

Definition at line 87 of file SelectionFilter.h.

Referenced by match(), parse(), setFilter(), and test().

std::string Gui::SelectionFilter::Errors [protected]

Definition at line 84 of file SelectionFilter.h.

Referenced by addError(), parse(), and setFilter().

std::string Gui::SelectionFilter::Filter [protected]
std::vector<std::vector<SelectionObject> > Gui::SelectionFilter::Result

The documentation for this class was generated from the following files:

Generated on Wed Nov 23 19:02:02 2011 for FreeCAD by  doxygen 1.6.1