anatomist  5.1.2
3D neuroimaging data viewer
interpoler.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 ANATOMIST_INTERPOLER_INTERPOLER_H
36 #define ANATOMIST_INTERPOLER_INTERPOLER_H
37 
38 
40 
41 
42 namespace anatomist
43 {
44 
45  template<int D> class ASurface;
46  typedef ASurface<3> ATriangulated;
47  //class ATriangulated;
48  class ATexture;
49  class ATexSurface;
50 
51 
57  class AInterpoler : public GLObjectVector
58  {
59  public:
60  AInterpoler( AObject* texsurf, AObject* surf );
61  virtual ~AInterpoler();
62 
63  virtual bool CanRemove( AObject* ) { return( false ); }
64 
65  virtual GLComponent* glGeometry( const ViewState & vs );
66  virtual const GLComponent* glGeometry( const ViewState & vs ) const;
67  virtual GLComponent* glTexture(const ViewState & vs, unsigned n = 0 );
68  virtual const GLComponent* glTexture( const ViewState & vs,
69  unsigned n = 0 ) const;
70  virtual GLComponent* orgGeom();
71  virtual const GLComponent* orgGeom() const;
72  virtual GLComponent* texSurf();
73  virtual const GLComponent* texSurf() const;
74  virtual const AObjectPalette* glPalette( unsigned tex = 0 ) const;
75  virtual const TexExtrema & glTexExtrema( unsigned tex = 0 ) const;
76  virtual TexExtrema & glTexExtrema( unsigned tex = 0 );
77  virtual std::string viewStateID( glPart part, const ViewState & ) const;
78 
79  virtual bool Is2DObject() { return false; }
80  virtual bool Is3DObject() { return true; }
81 
82  virtual unsigned glTexCoordSize( const ViewState &,
83  unsigned tex = 0 ) const;
84  virtual const GLfloat* glTexCoordArray( const ViewState & s,
85  unsigned tex = 0 ) const;
86 
87  virtual void update( const Observable* observable, void* arg );
90  bool hasNeighboursChanged() const;
91 
92  static int classType() { return( _classType ); }
93  virtual Tree* optionTree() const;
94 
95  static Tree* _optionTree;
96 
97  protected:
98  virtual void computeNeighbours( const ViewState & state );
99  void refreshTexCoordArray( const ViewState & state );
100 
101  private:
102  struct Private;
103  Private *d;
104 
106  static int registerClass();
107 
108  static int _classType;
109  };
110 
111 }
112 
113 
114 #endif
Interpoler object: associates a ATexSurface and a Triangulated to map the TexSurface's texture onto t...
Definition: interpoler.h:58
virtual GLComponent * glGeometry(const ViewState &vs)
AInterpoler(AObject *texsurf, AObject *surf)
virtual const GLComponent * texSurf() const
virtual GLComponent * orgGeom()
virtual unsigned glTexCoordSize(const ViewState &, unsigned tex=0) const
texture array size (must be >= numVertex to work), defalut=0
virtual void update(const Observable *observable, void *arg)
This class is an Observer of each of the AObject it groups.
virtual GLComponent * glTexture(const ViewState &vs, unsigned n=0)
virtual GLComponent * texSurf()
bool hasNeighboursChanged() const
virtual const TexExtrema & glTexExtrema(unsigned tex=0) const
virtual const GLComponent * orgGeom() const
static int classType()
Definition: interpoler.h:92
void refreshTexCoordArray(const ViewState &state)
virtual bool CanRemove(AObject *)
Definition: interpoler.h:63
virtual Tree * optionTree() const
Menu tree for new options, see object/optionMatcher.h.
virtual void computeNeighbours(const ViewState &state)
static Tree * _optionTree
Definition: interpoler.h:95
virtual bool Is3DObject()
Can be display in 3D windows.
Definition: interpoler.h:80
virtual bool Is2DObject()
Can be display in 2D windows.
Definition: interpoler.h:79
virtual const GLComponent * glTexture(const ViewState &vs, unsigned n=0) const
virtual const GLfloat * glTexCoordArray(const ViewState &s, unsigned tex=0) const
virtual std::string viewStateID(glPart part, const ViewState &) const
Makes a unique ID from a viewstate.
virtual const AObjectPalette * glPalette(unsigned tex=0) const
virtual TexExtrema & glTexExtrema(unsigned tex=0)
virtual const GLComponent * glGeometry(const ViewState &vs) const
Base Anatomist object (abstract)
Definition: Object.h:96
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
ASurface< 3 > ATriangulated
Definition: triangulated.h:42
ViewState holds information about how a view wants to see an object.
Definition: viewstate.h:67