add example code to selection classes

This commit is contained in:
wmayer
2017-09-11 19:13:48 +02:00
parent 098ec55b58
commit 161c820939

View File

@@ -131,6 +131,10 @@ private:
/**
* Python binding for SelectionFilter class.
* \code
* filter=Gui.Selection.Filter("SELECT Part::Feature SUBELEMENT Edge")
* Gui.Selection.addSelectionGate(filter)
* \endcode
* @see SelectionFilter
* @author Werner Mayer
*/
@@ -157,6 +161,18 @@ private:
/**
* A Python wrapper around SelectionFilterPy to implement the SelectionGate interface
* \code
* class SelectionGate(object):
* def allow(self, doc, obj, sub):
* if not obj.isDerivedFrom("Part::Feature"):
* return False
* if not str(sub).startswith("Edge"):
* return False
* return True
*
* gate=SelectionGate()
* Gui.Selection.addSelectionGate(gate)
* \endcode
* @author Werner Mayer
*/
class SelectionFilterGatePython : public SelectionGate