anatomist  5.0.5
3D neuroimaging data viewer
GraphObject.h
Go to the documentation of this file.
1 /* This software and supporting documentation are distributed by
2  * Institut Federatif de Recherche 49
3  * CEA/NeuroSpin, Batiment 145,
4  * 91191 Gif-sur-Yvette cedex
5  * France
6  *
7  * This software is governed by the CeCILL-B license under
8  * French law and abiding by the rules of distribution of free software.
9  * You can use, modify and/or redistribute the software under the
10  * terms of the CeCILL-B license as circulated by CEA, CNRS
11  * and INRIA at the following URL "http://www.cecill.info".
12  *
13  * As a counterpart to the access to the source code and rights to copy,
14  * modify and redistribute granted by the license, users are provided only
15  * with a limited warranty and the software's author, the holder of the
16  * economic rights, and the successive licensors have only limited
17  * liability.
18  *
19  * In this respect, the user's attention is drawn to the risks associated
20  * with loading, using, modifying and/or developing or reproducing the
21  * software by the user in light of its specific status of free software,
22  * that may mean that it is complicated to manipulate, and that also
23  * therefore means that it is reserved for developers and experienced
24  * professionals having in-depth computer knowledge. Users are therefore
25  * encouraged to load and test the software's suitability as regards their
26  * requirements in conditions enabling the security of their systems and/or
27  * data to be ensured and, more generally, to use and operate it in the
28  * same conditions as regards security.
29  *
30  * The fact that you are presently reading this means that you have had
31  * knowledge of the CeCILL-B license and that you accept its terms.
32  */
33 
34 
35 #ifndef ANA_GRAPH_GRAPHOBJECT_H
36 #define ANA_GRAPH_GRAPHOBJECT_H
37 
38 
41 
42 
43 namespace anatomist
44 {
45 
46  class AGraph;
47 
48 
53  {
54  public:
56  enum ShowType
57  {
63  ALL,
66  };
67 
69  virtual ~AGraphObject();
70 
73  virtual int MType() const { return AObject::GRAPHOBJECT; }
75 
78  virtual GLPrimitives glMainGLL( const ViewState & );
80  static ShowType showType() { return( _showType ); }
82  static void setShowType( ShowType type ) { _showType = type; }
84 
85  virtual const Material & material() const;
86  virtual Material & GetMaterial();
87  virtual void SetMaterial( const Material & mat );
88  virtual void SetMaterialOrDefault( const AGraph* agr,
89  const Material & mat );
90 
91  virtual carto::GenericObject* attributed() { return( _gobject.get() ); }
92  virtual const carto::GenericObject* attributed() const
93  { return( _gobject.get() ); }
94  virtual void internalUpdate();
95  virtual const AObjectPalette* palette() const { return 0; }
96  virtual AObjectPalette* palette() { return 0; }
97 
98  protected:
100 
101  private:
103  static ShowType _showType;
104  };
105 
106 }
107 
108 
109 namespace carto
110 {
111 #define _TMP_ std::map<anatomist::AObject *, std::string>
113 #undef _TMP_
114 }
115 
116 #endif
#define DECLARE_GENERIC_OBJECT_TYPE(T)
virtual void SetMaterialOrDefault(const AGraph *agr, const Material &mat)
ViewState holds information about how a view wants to see an object.
Definition: viewstate.h:66
Anatomist graph object: a list that manages destruction of its sub-elements.
Definition: GraphObject.h:52
Affiche les buckets seulement.
Definition: GraphObject.h:61
virtual carto::GenericObject * attributed()
Definition: GraphObject.h:91
virtual const carto::GenericObject * attributed() const
Definition: GraphObject.h:92
static void setShowType(ShowType type)
Control the visualization mode.
Definition: GraphObject.h:82
AGraph object class.
Definition: Graph.h:56
virtual Material & GetMaterial()
ShowType
Modes d&#39;affichage des sous-objets.
Definition: GraphObject.h:56
Attributed objects wrapper.
Definition: pythonAObject.h:45
#define _TMP_
Definition: GraphObject.h:111
This class has to be rewritten, it&#39;s really really a shame.......
Definition: Material.h:47
static ShowType showType()
Visu mode (default is TRIANG)
Definition: GraphObject.h:80
virtual void SetMaterial(const Material &mat)
virtual int MType() const
Precise type of multi-object.
Definition: GraphObject.h:73
virtual const Material & material() const
virtual const AObjectPalette * palette() const
Definition: GraphObject.h:95
carto::rc_ptr< carto::GenericObject > _gobject
Definition: GraphObject.h:99
virtual void internalUpdate()
Updates the state of the object.
std::list< RefGLItem > GLPrimitives
Definition: primitive.h:156
virtual GLPrimitives glMainGLL(const ViewState &)
T * get() const
Affiche les triangulations seulement.
Definition: GraphObject.h:59
virtual AObjectPalette * palette()
Normally, getOrCreatePalette() should be used instead of this function in most cases.
Definition: GraphObject.h:96
int type() const
Object type identifier.
Definition: Object.h:158
Affiche seulement le 1er objet 3D de la liste.
Definition: GraphObject.h:65
AGraphObject(carto::GenericObject *go)
Affiche tous les objets 3D.
Definition: GraphObject.h:63