anatomist  5.1.2
3D neuroimaging data viewer
vectorfield.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 #ifndef ANA_SURFACE_VECTORFIELD_H
35 #define ANA_SURFACE_VECTORFIELD_H
36 
37 
41 
42 
43 namespace anatomist
44 {
45 
46  class VectorField : public ObjectVector, public Sliceable
47  {
48  public:
49  VectorField( const std::vector<AObject *> & obj );
50  virtual ~VectorField();
51 
52  virtual const GLComponent* glAPI() const;
53  virtual GLComponent* glAPI();
54  virtual const Sliceable* sliceableAPI() const
55  {
56  return this;
57  }
59  {
60  return this;
61  }
62 
63  virtual bool Is2DObject()
64  {
65  return true;
66  }
67  virtual bool Is3DObject()
68  {
69  return true;
70  }
71 
72  virtual bool render( PrimList &, const ViewState & );
73  virtual void update( const Observable *, void * );
74 
75  virtual std::vector<float> glMin2D() const;
76  virtual std::vector<float> glMax2D() const;
77  virtual const Referential * getReferential() const;
78  virtual void SetMaterial( const Material & );
79  virtual Material & GetMaterial();
80  virtual void setVoxelSize( const std::vector<float> & );
81  virtual std::vector<float> voxelSize() const;
82  virtual std::vector<float> glVoxelSize() const;
83  virtual const AObjectPalette* glPalette( unsigned tex = 0 ) const;
84  virtual AObjectPalette* palette();
85  virtual const AObjectPalette* palette() const;
86  virtual void setPalette( const AObjectPalette & palette );
87  virtual void createDefaultPalette( const std::string & name = "" );
88 
90  Point4df getPlane( const ViewState & ) const;
91  virtual ObjectMenu* optionMenu() const;
92  virtual Tree* optionTree() const;
93 
94  virtual void glBeforeBodyGLL( const ViewState &, GLPrimitives & ) const;
95  virtual void glAfterBodyGLL( const ViewState &, GLPrimitives & ) const;
96 
97  AObject *volume( int channel ) const;
98  void setVolume( int channel, AObject* obj );
99  Point3di spaceCoordsDimensions( int channel ) const;
100  void setSpaceCoordsDimensions( int channel, const Point3di & dims );
101  std::vector<int> vectorChannelPosition( int channel ) const;
102  void setVectorChannelPosition( int channel, const std::vector<int> & pos );
103  float scaling() const;
104  void setScaling( float scaling );
105  std::vector<int> volumeSize( int channel ) const;
106 
107  static int canFusion( const std::set<AObject *> & obj );
108  static void editVectorFieldProperties( const std::set<AObject *> & obj );
109 
110  protected:
111  void buildMesh( const ViewState & );
112 
113  private:
114  struct Private;
115  Private *d;
116  };
117 
118 }
119 
120 #endif
121 
Base Anatomist object (abstract)
Definition: Object.h:96
std::string name() const
Name shown in control window.
Definition: Object.h:165
Base class for all OpenGL objects in Anatomist (with OpenGL display lists)
Definition: glcomponent.h:67
This class has to be rewritten, it's really really a shame.......
Definition: Material.h:48
it's a list, in fact...
Definition: objectVector.h:212
This class can be subclassed to represent an object that the programmer wants to have observed.
Definition: Observable.h:68
Referential: marker for transformations, with an associated color.
Definition: Referential.h:55
Sliceable objects can draw themselves in a 2D texture.
Definition: sliceable.h:59
void setScaling(float scaling)
virtual const Sliceable * sliceableAPI() const
Definition: vectorfield.h:54
virtual std::vector< float > glMax2D() const
float scaling() const
virtual void glBeforeBodyGLL(const ViewState &, GLPrimitives &) const
GL list to execute before the body is rendered.
virtual const AObjectPalette * glPalette(unsigned tex=0) const
std::vector< int > volumeSize(int channel) const
virtual const GLComponent * glAPI() const
virtual void glAfterBodyGLL(const ViewState &, GLPrimitives &) const
GL list to execute after the body is rendered.
virtual GLComponent * glAPI()
virtual void SetMaterial(const Material &)
virtual AObjectPalette * palette()
Normally, getOrCreatePalette() should be used instead of this function in most cases.
virtual std::vector< float > glMin2D() const
virtual const AObjectPalette * palette() const
void buildMesh(const ViewState &)
virtual std::vector< float > voxelSize() const
Returns at least 4 sizes. For 3D objects, returns (1, 1, 1, 1)
static int canFusion(const std::set< AObject * > &obj)
virtual bool Is2DObject()
Can be display in 2D windows.
Definition: vectorfield.h:63
std::vector< int > vectorChannelPosition(int channel) const
void setVectorChannelPosition(int channel, const std::vector< int > &pos)
virtual std::vector< float > glVoxelSize() const
virtual void update(const Observable *, void *)
This class is an Observer of each of the AObject it groups.
virtual void setPalette(const AObjectPalette &palette)
virtual Sliceable * sliceableAPI()
Definition: vectorfield.h:58
virtual const Referential * getReferential() const
VectorField(const std::vector< AObject * > &obj)
Point3di spaceCoordsDimensions(int channel) const
Point4df getPlane(const ViewState &) const
Gets the current slice plane.
virtual Tree * optionTree() const
Menu tree for new options, see object/optionMatcher.h.
virtual void createDefaultPalette(const std::string &name="")
function called by getOrCreatePalette() - overloadable, need not be called directly
void setVolume(int channel, AObject *obj)
virtual ObjectMenu * optionMenu() const
virtual bool Is3DObject()
Can be display in 3D windows.
Definition: vectorfield.h:67
virtual void setVoxelSize(const std::vector< float > &)
AObject * volume(int channel) const
static void editVectorFieldProperties(const std::set< AObject * > &obj)
virtual bool render(PrimList &, const ViewState &)
rendering (generally 2D or 3D using OpenGL).
void setSpaceCoordsDimensions(int channel, const Point3di &dims)
virtual Material & GetMaterial()
std::list< carto::rc_ptr< GLItem > > PrimList
Definition: Object.h:72
std::list< RefGLItem > GLPrimitives
Definition: primitive.h:156
ViewState holds information about how a view wants to see an object.
Definition: viewstate.h:67