anatomist  5.0.5
3D neuroimaging data viewer
mtexture.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_SURFACE_MTEXTURE_H
36 #define ANA_SURFACE_MTEXTURE_H
37 
40 #include <graph/tree/tree.h>
41 
42 namespace anatomist
43 {
44 
52  class AMTexture : public GLObjectVector
53  {
54  public:
55  AMTexture( const std::vector<AObject *> & obj );
56  virtual ~AMTexture();
57 
58  virtual int MType() const { return type(); }
59  static int classType();
60 
61  virtual const GLComponent* glAPI() const { return this; }
62  virtual GLComponent* glAPI() { return this; }
63 
64  virtual const AObjectPalette* glPalette( unsigned tex = 0 ) const;
65  virtual unsigned glNumTextures() const;
66  virtual unsigned glNumTextures( const ViewState & ) const;
67  virtual unsigned glDimTex( const ViewState &, unsigned tex = 0 ) const;
68  virtual unsigned glTexCoordSize( const ViewState &,
69  unsigned tex = 0 ) const;
70  virtual const float* glTexCoordArray( const ViewState &,
71  unsigned tex = 0 ) const;
72 
73  virtual void glSetTexMode( glTextureMode mode, unsigned tex = 0 );
74  virtual glTextureMode glTexMode( unsigned tex = 0 ) const;
75  virtual glAutoTexturingMode glAutoTexMode( unsigned tex = 0 ) const;
76  virtual void glSetAutoTexMode( glAutoTexturingMode mode,
77  unsigned tex = 0 );
78  virtual const float *glAutoTexParams( unsigned coord = 0,
79  unsigned tex = 0 ) const;
80  virtual void glSetAutoTexParams( const float* params, unsigned coord = 0,
81  unsigned tex = 0 );
82  virtual void glSetTexRate( float rate, unsigned tex = 0 );
83  virtual float glTexRate( unsigned tex = 0 ) const;
84  virtual glTextureFiltering glTexFiltering( unsigned tex = 0 ) const;
85  virtual void glSetTexFiltering( glTextureFiltering x, unsigned tex = 0 );
86  virtual void glSetTexRGBInterpolation( bool x, unsigned tex = 0 );
87  virtual bool glTexRGBInterpolation( unsigned tex = 0 ) const;
88 
89  virtual GLPrimitives glTexNameGLL( const ViewState &,
90  unsigned tex = 0 ) const;
91  virtual void glGarbageCollector( int nkept = -1 );
92 
93  virtual bool Is2DObject() { return false; }
94  virtual bool Is3DObject() { return false; }
95  virtual bool CanRemove( AObject* obj );
96  virtual void update( const Observable*, void* );
97  virtual Tree* optionTree() const;
98  virtual GLComponent* glTexture( unsigned n = 0 );
99  virtual const GLComponent* glTexture( unsigned n = 0 ) const;
100  virtual TexInfo & glTexInfo( unsigned tex = 0 ) const;
101  virtual std::string viewStateID( glPart part, const ViewState & ) const;
102 
103  private:
104  static int registerClass();
105  };
106 
107 }
108 
109 #endif
110 
virtual void glSetTexRGBInterpolation(bool x, unsigned tex=0)
AMTexture(const std::vector< AObject *> &obj)
ViewState holds information about how a view wants to see an object.
Definition: viewstate.h:66
virtual void glSetAutoTexParams(const float *params, unsigned coord=0, unsigned tex=0)
virtual float glTexRate(unsigned tex=0) const
Base Anatomist object (abstract)
Definition: Object.h:95
virtual unsigned glDimTex(const ViewState &, unsigned tex=0) const
texture dimension (1, 2 [or 3])
virtual std::string viewStateID(glPart part, const ViewState &) const
Makes a unique ID from a viewstate.
virtual glTextureFiltering glTexFiltering(unsigned tex=0) const
This class can be subclassed to represent an object that the programmer wants to have observed...
Definition: Observable.h:67
virtual void glSetTexMode(glTextureMode mode, unsigned tex=0)
virtual const float * glAutoTexParams(unsigned coord=0, unsigned tex=0) const
virtual bool glTexRGBInterpolation(unsigned tex=0) const
virtual void update(const Observable *, void *)
This class is an Observer of each of the AObject it groups.
virtual void glSetTexRate(float rate, unsigned tex=0)
virtual void glSetAutoTexMode(glAutoTexturingMode mode, unsigned tex=0)
virtual const GLComponent * glAPI() const
Definition: mtexture.h:61
virtual glAutoTexturingMode glAutoTexMode(unsigned tex=0) const
virtual GLComponent * glAPI()
Definition: mtexture.h:62
virtual bool Is3DObject()
Can be display in 3D windows.
Definition: mtexture.h:94
virtual TexInfo & glTexInfo(unsigned tex=0) const
static int classType()
virtual unsigned glTexCoordSize(const ViewState &, unsigned tex=0) const
texture array size (must be >= numVertex to work), defalut=0
virtual unsigned glNumTextures() const
virtual GLComponent * glTexture(unsigned n=0)
virtual int MType() const
Precise type of multi-object.
Definition: mtexture.h:58
virtual void glGarbageCollector(int nkept=-1)
Frees unused display lists.
virtual const float * glTexCoordArray(const ViewState &, unsigned tex=0) const
virtual Tree * optionTree() const
Menu tree for new options, see object/optionMatcher.h.
std::list< RefGLItem > GLPrimitives
Definition: primitive.h:156
Base class for all OpenGL objects in Anatomist (with OpenGL display lists)
Definition: glcomponent.h:66
virtual void glSetTexFiltering(glTextureFiltering x, unsigned tex=0)
virtual bool Is2DObject()
Can be display in 2D windows.
Definition: mtexture.h:93
Multi-texture.
Definition: mtexture.h:52
virtual GLPrimitives glTexNameGLL(const ViewState &, unsigned tex=0) const
glPart
GL object parts, each driving a GL list.
Definition: glcomponent.h:113
virtual const AObjectPalette * glPalette(unsigned tex=0) const
int type() const
Object type identifier.
Definition: Object.h:158
virtual glTextureMode glTexMode(unsigned tex=0) const
virtual bool CanRemove(AObject *obj)