anatomist  5.1.2
3D neuroimaging data viewer
anatomist::SelectFactory Class Reference

Central selection center. More...

#include <anatomist/selection/selectFactory.h>

Inheritance diagram for anatomist::SelectFactory:

Classes

struct  HColor
 

Public Types

enum  SelectMode { Normal = 0 , Add = 1 , Toggle = 2 }
 

Public Member Functions

 SelectFactory ()
 
virtual ~SelectFactory ()
 
virtual WSelectChoosercreateSelectChooser (unsigned group, const std::set< AObject * > &objects) const
 Creates a selection choice window. More...
 
const std::map< unsigned, std::set< AObject * > > & selected () const
 
virtual void select (unsigned group, const std::set< AObject * > &obj, const HColor *col=0) const
 
virtual void unselect (unsigned group, const std::set< AObject * > &obj) const
 
virtual void unselectAll (unsigned group) const
 
virtual void selectAll (AWindow *win, const HColor *col=0) const
 Selects all selectable objects in a given window. More...
 
virtual void flip (unsigned group, const std::set< AObject * > &obj, const HColor *col=0) const
 Inverts state of given objects. More...
 
virtual void select (SelectMode mode, unsigned group, const std::set< AObject * > &obj, const HColor *col=0) const
 
virtual bool isSelected (unsigned group, AObject *obj) const
 
virtual HColor highlightColor (AObject *obj) const
 
virtual void setHighlightColor (AObject *obj, const HColor *col=0) const
 
virtual void refresh () const
 Redraws objects in involved windows. More...
 
virtual void refreshSelectionRendering () const
 Redraws all windows containing selected objects (called after selection rendering mode has changed) More...
 
virtual void handleSelectionMenu (AWindow *win, int x, int y, const Tree *specific=0)
 draws / handles the selection menu (right click) More...
 
virtual void propagateSelection (unsigned group) const
 
virtual void remove (anatomist::AWindow *win)
 
virtual void removeFromThisWindow (anatomist::AWindow *win)
 

Static Public Member Functions

static void setFactory (SelectFactory *fac)
 
static SelectFactoryfactory ()
 
static bool hasAncestor (const AWindow *win, AObject *obj)
 tells if win sees obj or one of its ancestors More...
 
static AObjectobjectAt (AObject *o, const std::vector< float > &pos, float tolerence, const Referential *wref, const Point3df &wgeom, const std::string &selector="default")
 
static void select (AWindow *w, const std::vector< float > &pos, float tolerence, int modifier, const std::string &selector="default")
 
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 registerSelector (const std::string &key, Selector *s)
 
static void registerPostSelector (const std::string &key, PostSelector *s)
 Registers possible actions to be taken after object selection. More...
 
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 priority. More...
 
static void deactivatePostSelector (const std::string &psel)
 Dectivates a post-selector: won't be called anymore. More...
 
static void setSelectColor (const HColor &col)
 
static HColorselectColor ()
 
static bool & selectColorInverse ()
 

Detailed Description

Central selection center.

\ usage : a default factory is given as a static member (see factory() and setFactory()). Any instance creation of an overloaded subclass of factory replaces this default factory by itself.

Definition at line 64 of file selectFactory.h.

Member Enumeration Documentation

◆ SelectMode

Enumerator
Normal 
Add 
Toggle 

Definition at line 67 of file selectFactory.h.

Constructor & Destructor Documentation

◆ SelectFactory()

anatomist::SelectFactory::SelectFactory ( )

◆ ~SelectFactory()

virtual anatomist::SelectFactory::~SelectFactory ( )
virtual

Member Function Documentation

◆ activatePostSelector()

static void anatomist::SelectFactory::activatePostSelector ( int  priority,
const std::string &  psel 
)
static

Activates a registered post-selector, it will be used after every object selection with a given priority.

◆ createSelectChooser()

virtual WSelectChooser* anatomist::SelectFactory::createSelectChooser ( unsigned  group,
const std::set< AObject * > &  objects 
) const
virtual

Creates a selection choice window.

The default factory returns a base object which is not really a window (see SelectChooser). This mechanism enables to switch between Motif windows and Qt windows (see QSelectFactory) implementations

Reimplemented in QSelectFactory.

◆ deactivatePostSelector()

static void anatomist::SelectFactory::deactivatePostSelector ( const std::string &  psel)
static

Dectivates a post-selector: won't be called anymore.

◆ factory()

static SelectFactory* anatomist::SelectFactory::factory ( )
static

◆ findObjectsAt()

static void anatomist::SelectFactory::findObjectsAt ( AWindow w,
const std::vector< float > &  pos,
float  tolerence,
std::set< AObject * > &  shown,
std::set< AObject * > &  hidden,
const std::string &  selector 
)
static

◆ flip()

virtual void anatomist::SelectFactory::flip ( unsigned  group,
const std::set< AObject * > &  obj,
const HColor col = 0 
) const
virtual

Inverts state of given objects.

◆ handleSelectionMenu()

void anatomist::SelectFactory::handleSelectionMenu ( AWindow win,
int  x,
int  y,
const Tree specific = 0 
)
inlinevirtual

draws / handles the selection menu (right click)

Parameters
specificif given, describes the menu tree for window-specific actions. The callbacks must be in the tree, like in AObject's option trees. Callbacks type is void (*func)( void * ), with an optional "client_data" attribute passed to the function

Reimplemented in QSelectFactory.

Definition at line 182 of file selectFactory.h.

◆ hasAncestor()

static bool anatomist::SelectFactory::hasAncestor ( const AWindow win,
AObject obj 
)
static

tells if win sees obj or one of its ancestors

◆ highlightColor()

virtual HColor anatomist::SelectFactory::highlightColor ( AObject obj) const
virtual

◆ isSelected()

virtual bool anatomist::SelectFactory::isSelected ( unsigned  group,
AObject obj 
) const
virtual

◆ objectAt()

static AObject* anatomist::SelectFactory::objectAt ( AObject o,
const std::vector< float > &  pos,
float  tolerence,
const Referential wref,
const Point3df wgeom,
const std::string &  selector = "default" 
)
static

◆ propagateSelection()

virtual void anatomist::SelectFactory::propagateSelection ( unsigned  group) const
virtual

◆ refresh()

virtual void anatomist::SelectFactory::refresh ( ) const
virtual

Redraws objects in involved windows.

◆ refreshSelectionRendering()

virtual void anatomist::SelectFactory::refreshSelectionRendering ( ) const
virtual

Redraws all windows containing selected objects (called after selection rendering mode has changed)

◆ registerPostSelector()

static void anatomist::SelectFactory::registerPostSelector ( const std::string &  key,
PostSelector s 
)
static

Registers possible actions to be taken after object selection.

◆ registerSelector()

static void anatomist::SelectFactory::registerSelector ( const std::string &  key,
Selector s 
)
static

◆ remove()

virtual void anatomist::SelectFactory::remove ( anatomist::AWindow win)
virtual

◆ removeFromThisWindow()

virtual void anatomist::SelectFactory::removeFromThisWindow ( anatomist::AWindow win)
virtual

◆ select() [1/3]

static void anatomist::SelectFactory::select ( AWindow w,
const std::vector< float > &  pos,
float  tolerence,
int  modifier,
const std::string &  selector = "default" 
)
static

◆ select() [2/3]

virtual void anatomist::SelectFactory::select ( SelectMode  mode,
unsigned  group,
const std::set< AObject * > &  obj,
const HColor col = 0 
) const
virtual

◆ select() [3/3]

virtual void anatomist::SelectFactory::select ( unsigned  group,
const std::set< AObject * > &  obj,
const HColor col = 0 
) const
virtual

◆ selectAll()

virtual void anatomist::SelectFactory::selectAll ( AWindow win,
const HColor col = 0 
) const
virtual

Selects all selectable objects in a given window.

◆ selectColor()

static HColor& anatomist::SelectFactory::selectColor ( )
static

◆ selectColorInverse()

static bool& anatomist::SelectFactory::selectColorInverse ( )
static

◆ selected()

const std::map<unsigned, std::set<AObject *> >& anatomist::SelectFactory::selected ( ) const
inline

Definition at line 102 of file selectFactory.h.

◆ setFactory()

static void anatomist::SelectFactory::setFactory ( SelectFactory fac)
static

◆ setHighlightColor()

virtual void anatomist::SelectFactory::setHighlightColor ( AObject obj,
const HColor col = 0 
) const
virtual

◆ setSelectColor()

static void anatomist::SelectFactory::setSelectColor ( const HColor col)
static

◆ unselect()

virtual void anatomist::SelectFactory::unselect ( unsigned  group,
const std::set< AObject * > &  obj 
) const
virtual

◆ unselectAll()

virtual void anatomist::SelectFactory::unselectAll ( unsigned  group) const
virtual

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