anatomist  5.0.5
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();
66  virtual const GLComponent* glGeometry() const;
67  virtual GLComponent* glTexture();
68  virtual const GLComponent* glTexture() const;
69  virtual GLComponent* orgGeom();
70  virtual const GLComponent* orgGeom() const;
71  virtual GLComponent* texSurf();
72  virtual const GLComponent* texSurf() const;
73 
74  virtual bool Is2DObject() { return false; }
75  virtual bool Is3DObject() { return true; }
76 
77  virtual unsigned glTexCoordSize( const ViewState &,
78  unsigned tex = 0 ) const;
79  virtual const GLfloat* glTexCoordArray( const ViewState & s,
80  unsigned tex = 0 ) const;
81 
82  virtual void update( const Observable* observable, void* arg );
83  void setNeighboursChanged();
85  bool hasNeighboursChanged() const;
86 
87  static int classType() { return( _classType ); }
88  virtual Tree* optionTree() const;
89 
90  static Tree* _optionTree;
91 
92  protected:
93  virtual void computeNeighbours( const ViewState & state );
94  void refreshTexCoordArray( const ViewState & state );
95 
96  private:
97  struct Private;
98  Private *d;
99 
101  static int registerClass();
102 
103  static int _classType;
104  };
105 
106 }
107 
108 
109 #endif
ViewState holds information about how a view wants to see an object.
Definition: viewstate.h:66
static Tree * _optionTree
Definition: interpoler.h:90
virtual void computeNeighbours(const ViewState &state)
Base Anatomist object (abstract)
Definition: Object.h:95
AInterpoler(AObject *texsurf, AObject *surf)
virtual bool Is2DObject()
Can be display in 2D windows.
Definition: interpoler.h:74
This class can be subclassed to represent an object that the programmer wants to have observed...
Definition: Observable.h:67
ASurface< 3 > ATriangulated
Definition: triangulated.h:42
virtual GLComponent * orgGeom()
virtual GLComponent * texSurf()
bool hasNeighboursChanged() const
virtual bool Is3DObject()
Can be display in 3D windows.
Definition: interpoler.h:75
virtual GLComponent * glTexture()
virtual Tree * optionTree() const
Menu tree for new options, see object/optionMatcher.h.
virtual void update(const Observable *observable, void *arg)
This class is an Observer of each of the AObject it groups.
virtual GLComponent * glGeometry()
void refreshTexCoordArray(const ViewState &state)
Base class for all OpenGL objects in Anatomist (with OpenGL display lists)
Definition: glcomponent.h:66
static int classType()
Definition: interpoler.h:87
Interpoler object: associates a ATexSurface and a Triangulated to map the TexSurface&#39;s texture onto t...
Definition: interpoler.h:57
virtual unsigned glTexCoordSize(const ViewState &, unsigned tex=0) const
texture array size (must be >= numVertex to work), defalut=0
virtual const GLfloat * glTexCoordArray(const ViewState &s, unsigned tex=0) const
virtual bool CanRemove(AObject *)
Definition: interpoler.h:63