35 #ifndef ANA_SELECTION_SELECTFACTORY_H
36 #define ANA_SELECTION_SELECTFACTORY_H
77 HColor(
float red,
float grn,
float blu,
float al = 1.,
79 :
r( red),
g( grn ),
b( blu ),
a( al ),
na( ntalp ) {}
101 const std::set<AObject *> & objects )
const;
102 const std::map<unsigned, std::set<AObject *> > &
selected()
const
103 {
return( _selected() ); }
104 virtual void select(
unsigned group,
const std::set<AObject *> & obj,
105 const HColor* col = 0 )
const;
107 const std::set<AObject *> & obj )
const;
112 virtual void flip(
unsigned group,
const std::set<AObject *> & obj,
113 const HColor* col = 0 )
const;
115 const std::set<AObject *> & obj,
116 const HColor* col = 0 )
const;
120 const HColor* col = 0 )
const;
135 const Tree* specific = 0 );
145 const std::string & selector =
"default" );
147 float tolerence,
int modifier,
148 const std::string & selector =
"default" );
150 float tolerence, std::set<AObject *>& shown,
151 std::set<AObject *>& hidden,
152 const std::string & selector );
174 static std::map<AObject*, HColor> & _highlightColors();
176 static std::set<AWindow *> & _winToRefresh();
177 static std::map<unsigned, std::set<AObject *> > & _selected();
Base Anatomist object (abstract)
Abstract base class Anatomist window.
Performs an action after an object has been selected (fiber tracking, ...)
Referential: marker for transformations, with an associated color.
Central selection center.
static void activatePostSelector(int priority, const std::string &psel)
Activates a registered post-selector, it will be used after every object selection with a given prior...
virtual void flip(unsigned group, const std::set< AObject * > &obj, const HColor *col=0) const
Inverts state of given objects.
static void deactivatePostSelector(const std::string &psel)
Dectivates a post-selector: won't be called anymore.
virtual bool isSelected(unsigned group, AObject *obj) const
static void setFactory(SelectFactory *fac)
static HColor & selectColor()
virtual WSelectChooser * createSelectChooser(unsigned group, const std::set< AObject * > &objects) const
Creates a selection choice window.
static void setSelectColor(const HColor &col)
virtual void refresh() const
Redraws objects in involved windows.
virtual void refreshSelectionRendering() const
Redraws all windows containing selected objects (called after selection rendering mode has changed)
virtual void unselectAll(unsigned group) const
virtual void removeFromThisWindow(anatomist::AWindow *win)
virtual void select(unsigned group, const std::set< AObject * > &obj, const HColor *col=0) const
static void registerSelector(const std::string &key, Selector *s)
virtual void remove(anatomist::AWindow *win)
static void registerPostSelector(const std::string &key, PostSelector *s)
Registers possible actions to be taken after object selection.
static void findObjectsAt(AWindow *w, const std::vector< float > &pos, float tolerence, std::set< AObject * > &shown, std::set< AObject * > &hidden, const std::string &selector)
static void select(AWindow *w, const std::vector< float > &pos, float tolerence, int modifier, const std::string &selector="default")
static SelectFactory * factory()
virtual void unselect(unsigned group, const std::set< AObject * > &obj) const
static AObject * objectAt(AObject *o, const std::vector< float > &pos, float tolerence, const Referential *wref, const Point3df &wgeom, const std::string &selector="default")
const std::map< unsigned, std::set< AObject * > > & selected() const
static bool & selectColorInverse()
virtual void handleSelectionMenu(AWindow *win, int x, int y, const Tree *specific=0)
draws / handles the selection menu (right click)
virtual void selectAll(AWindow *win, const HColor *col=0) const
Selects all selectable objects in a given window.
virtual HColor highlightColor(AObject *obj) const
static bool hasAncestor(const AWindow *win, AObject *obj)
tells if win sees obj or one of its ancestors
virtual void select(SelectMode mode, unsigned group, const std::set< AObject * > &obj, const HColor *col=0) const
virtual void setHighlightColor(AObject *obj, const HColor *col=0) const
virtual void propagateSelection(unsigned group) const
Base class for selection chooser windows.
bool operator!=(const HColor &) const
HColor(float red, float grn, float blu, float al=1., bool ntalp=false)
bool operator==(const HColor &) const