anatomist  5.1.2
3D neuroimaging data viewer
planarfusion3d.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_PLANARFUSION3D_H
36 #define ANA_SURFACE_PLANARFUSION3D_H
37 
38 
40 #include <map>
41 #include <vector>
42 
43 
44 namespace anatomist
45 {
46 
47  class Referential;
48  class Geometry;
49 
50 
52  {
53  public:
54  PlanarFusion3D( const std::vector<AObject *> & obj );
55  virtual ~PlanarFusion3D();
56 
57  virtual int MType() const { return( type() ); }
58  static int classType();
59 
60  virtual bool CanRemove( AObject* obj );
61 
62  virtual bool Is2DObject() { return( false ); }
63  virtual bool Is3DObject() { return( true ); }
64 
65  virtual bool boundingBox( std::vector<float> & bmin,
66  std::vector<float> & bmax ) const;
67 
68  virtual bool refreshTexCoords( const ViewState & state ) const;
69 
70  virtual void update( const Observable* observable, void* arg );
71  virtual void glClearHasChangedFlags() const;
72 
73  virtual Tree* optionTree() const;
74 
75  virtual unsigned glNumTextures() const;
76  virtual unsigned glNumTextures( const ViewState & ) const;
77  virtual unsigned glDimTex( const ViewState & state,
78  unsigned tex = 0 ) const;
79  virtual unsigned glTexCoordSize( const ViewState & state,
80  unsigned tex = 0 ) const;
81  virtual const GLfloat* glTexCoordArray( const ViewState & state,
82  unsigned tex = 0 ) const;
83  virtual void glSetTexImageChanged( bool, unsigned tex = 0 ) const;
84  virtual glTextureMode glTexMode( unsigned tex = 0 ) const;
85  virtual float glTexRate( unsigned tex = 0 ) const;
86  virtual glTextureFiltering glTexFiltering( unsigned tex = 0 ) const;
87  virtual glAutoTexturingMode glAutoTexMode( unsigned tex = 0 ) const;
88  virtual const float *glAutoTexParams( unsigned coord = 0,
89  unsigned tex = 0 ) const;
90  virtual void glSetAutoTexParams( const float* params, unsigned coord = 0,
91  unsigned tex = 0 );
92  virtual std::string viewStateID( glPart part, const ViewState & ) const;
93 
94  const AObject* volume() const;
96  const AObject* mesh() const;
98  virtual const AObjectPalette* glPalette( unsigned ) const;
99  virtual const GLComponent* glTexture( const ViewState & vs,
100  unsigned ) const;
101  virtual GLComponent* glTexture( const ViewState & vs, unsigned );
102 
104  const ViewState & state, unsigned tex, int dimx = -1,
105  int dimy = -1, bool useTexScale = true ) const;
106  virtual bool glMakeTexImage( const ViewState & state,
107  const GLTexture & gltex, unsigned tex ) const;
109 
110  private:
111  struct Private;
113  static int registerClass();
114 
115  Private *d;
116  };
117 
118 
120  {
121  return(false);
122  }
123 
124 }
125 
126 
127 #endif
128 
129 
Base Anatomist object (abstract)
Definition: Object.h:96
int type() const
Object type identifier.
Definition: Object.h:158
Base class for all OpenGL objects in Anatomist (with OpenGL display lists)
Definition: glcomponent.h:67
glPart
GL object parts, each driving a GL list.
Definition: glcomponent.h:114
This class can be subclassed to represent an object that the programmer wants to have observed.
Definition: Observable.h:68
virtual std::string viewStateID(glPart part, const ViewState &) const
Makes a unique ID from a viewstate.
virtual unsigned glDimTex(const ViewState &state, unsigned tex=0) const
texture dimension (1, 2 [or 3])
virtual void glSetAutoTexParams(const float *params, unsigned coord=0, unsigned tex=0)
virtual unsigned glNumTextures() const
virtual Tree * optionTree() const
Menu tree for new options, see object/optionMatcher.h.
virtual bool refreshTexCoords(const ViewState &state) const
virtual int MType() const
Precise type of multi-object.
virtual void glClearHasChangedFlags() const
virtual bool Is2DObject()
Can be display in 2D windows.
virtual void update(const Observable *observable, void *arg)
This class is an Observer of each of the AObject it groups.
const AObject * mesh() const
virtual GLComponent * glTexture(const ViewState &vs, unsigned)
virtual bool CanRemove(AObject *obj)
PlanarFusion3D(const std::vector< AObject * > &obj)
const AObject * volume() const
virtual glAutoTexturingMode glAutoTexMode(unsigned tex=0) const
virtual const GLfloat * glTexCoordArray(const ViewState &state, unsigned tex=0) const
virtual bool glMakeTexImage(const ViewState &state, const GLTexture &gltex, unsigned tex) const
If you make non-standard textures (ie not from a palette), overload this function to fill gltex.
virtual const AObjectPalette * glPalette(unsigned) const
virtual unsigned glTexCoordSize(const ViewState &state, unsigned tex=0) const
texture array size (must be >= numVertex to work), defalut=0
virtual unsigned glNumTextures(const ViewState &) const
virtual const float * glAutoTexParams(unsigned coord=0, unsigned tex=0) const
virtual glTextureMode glTexMode(unsigned tex=0) const
virtual carto::VolumeRef< AimsRGBA > glBuildTexImage(const ViewState &state, unsigned tex, int dimx=-1, int dimy=-1, bool useTexScale=true) const
If you make non-standard textures (ie not from a palette), overload this function.
virtual bool Is3DObject()
Can be display in 3D windows.
virtual float glTexRate(unsigned tex=0) const
virtual bool boundingBox(std::vector< float > &bmin, std::vector< float > &bmax) const
Fills bmin and bmax with the N-D bounding box extrema in the object's referential coordinates.
virtual void glSetTexImageChanged(bool, unsigned tex=0) const
virtual AObject * fallbackReferentialInheritance() const
object to take referential from when no ref is assigned
virtual const GLComponent * glTexture(const ViewState &vs, unsigned) const
virtual glTextureFiltering glTexFiltering(unsigned tex=0) const
ViewState holds information about how a view wants to see an object.
Definition: viewstate.h:67