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;
106 virtual void unselect(
unsigned group,
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" );
146 static void select(
AWindow* w,
const std::vector<float> & pos,
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();
static bool hasAncestor(const AWindow *win, AObject *obj)
tells if win sees obj or one of its ancestors
Base class for selection chooser windows.
virtual void removeFromThisWindow(anatomist::AWindow *win)
static void registerSelector(const std::string &key, Selector *s)
Base Anatomist object (abstract)
Performs an action after an object has been selected (fiber tracking, ...)
static HColor & selectColor()
virtual bool isSelected(unsigned group, AObject *obj) const
Abstract base class Anatomist window.
static void registerPostSelector(const std::string &key, PostSelector *s)
Registers possible actions to be taken after object selection.
static bool & selectColorInverse()
bool operator==(const HColor &) const
virtual void setHighlightColor(AObject *obj, const HColor *col=0) const
static void setFactory(SelectFactory *fac)
virtual void propagateSelection(unsigned group) const
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...
static SelectFactory * factory()
virtual void refresh() const
Redraws objects in involved windows.
virtual void handleSelectionMenu(AWindow *win, int x, int y, const Tree *specific=0)
draws / handles the selection menu (right click)
static void setSelectColor(const HColor &col)
static void findObjectsAt(AWindow *w, const std::vector< float > &pos, float tolerence, std::set< AObject *> &shown, std::set< AObject *> &hidden, const std::string &selector)
HColor(float red, float grn, float blu, float al=1., bool ntalp=false)
virtual void refreshSelectionRendering() const
Redraws all windows containing selected objects (called after selection rendering mode has changed) ...
virtual void unselectAll(unsigned group) const
static void deactivatePostSelector(const std::string &psel)
Dectivates a post-selector: won't be called anymore.
const std::map< unsigned, std::set< AObject * > > & selected() const
virtual void unselect(unsigned group, const std::set< AObject *> &obj) const
Central selection center.
bool operator!=(const HColor &) const
virtual HColor highlightColor(AObject *obj) const
virtual WSelectChooser * createSelectChooser(unsigned group, const std::set< AObject *> &objects) const
Creates a selection choice window.
virtual void flip(unsigned group, const std::set< AObject *> &obj, const HColor *col=0) const
Inverts state of given objects.
Referential: marker for transformations, with an associated color.
virtual void selectAll(AWindow *win, const HColor *col=0) const
Selects all selectable objects in a given window.
virtual void select(unsigned group, const std::set< AObject *> &obj, const HColor *col=0) const
static AObject * objectAt(AObject *o, const std::vector< float > &pos, float tolerence, const Referential *wref, const Point3df &wgeom, const std::string &selector="default")