anatomist 6.0.4
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
43namespace 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;
85 virtual const AObjectPalette* palette() const;
86 virtual void setPalette( const AObjectPalette & palette );
87 virtual void createDefaultPalette( const std::string & name = "" );
88
89 virtual unsigned glNumTextures() const;
90 virtual unsigned glNumTextures( const ViewState & ) const;
91 virtual unsigned glDimTex( const ViewState &, unsigned tex = 0 ) const;
92 virtual unsigned glTexCoordSize( const ViewState &,
93 unsigned tex = 0 ) const;
94 virtual const GLfloat* glTexCoordArray( const ViewState &,
95 unsigned tex = 0 ) const;
96 virtual const TexExtrema & glTexExtrema( unsigned tex = 0 ) const;
97 virtual TexExtrema & glTexExtrema( unsigned tex = 0 );
98
100 Point4df getPlane( const ViewState & ) const;
101 virtual ObjectMenu* optionMenu() const;
102 virtual Tree* optionTree() const;
103
104 virtual void glBeforeBodyGLL( const ViewState &, GLPrimitives & ) const;
105 virtual void glAfterBodyGLL( const ViewState &, GLPrimitives & ) const;
106
107 AObject *volume( int channel ) const;
108 void setVolume( int channel, AObject* obj );
109 Point3di spaceCoordsDimensions( int channel ) const;
110 void setSpaceCoordsDimensions( int channel, const Point3di & dims );
111 std::vector<int> vectorChannelPosition( int channel ) const;
112 void setVectorChannelPosition( int channel, const std::vector<int> & pos );
113 float scaling() const;
114 void setScaling( float scaling );
115 std::vector<int> volumeSize( int channel ) const;
116
117 static int canFusion( const std::set<AObject *> & obj );
118 static void editVectorFieldProperties( const std::set<AObject *> & obj );
119
120 protected:
121 void buildMesh( const ViewState & );
122
123 private:
124 struct Private;
125 Private *d;
126 };
127
128}
129
130#endif
131
Base Anatomist object (abstract)
Definition Object.h:97
std::string name() const
Name shown in control window.
Definition Object.h:166
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
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:56
void setScaling(float scaling)
float scaling() const
virtual const AObjectPalette * glPalette(unsigned tex=0) const
virtual std::vector< float > glMax2D() const
std::vector< int > vectorChannelPosition(int channel) const
virtual void glBeforeBodyGLL(const ViewState &, GLPrimitives &) const
GL list to execute before the body is rendered.
AObject * volume(int channel) const
virtual Tree * optionTree() const
Menu tree for new options, see object/optionMatcher.h.
virtual ObjectMenu * optionMenu() const
virtual void glAfterBodyGLL(const ViewState &, GLPrimitives &) const
GL list to execute after the body is rendered.
virtual const GLfloat * glTexCoordArray(const ViewState &, unsigned tex=0) const
virtual void SetMaterial(const Material &)
virtual Material & GetMaterial()
void buildMesh(const ViewState &)
virtual GLComponent * glAPI()
OpenGL objects API.
std::vector< int > volumeSize(int channel) const
virtual const TexExtrema & glTexExtrema(unsigned tex=0) const
static int canFusion(const std::set< AObject * > &obj)
virtual const GLComponent * glAPI() const
OpenGL objects const API.
virtual TexExtrema & glTexExtrema(unsigned tex=0)
virtual bool Is2DObject()
Can be display in 2D windows.
Definition vectorfield.h:63
virtual const Sliceable * sliceableAPI() const
Definition vectorfield.h:54
virtual std::vector< float > voxelSize() const
Returns at least 4 sizes. For 3D objects, returns (1, 1, 1, 1)
void setVectorChannelPosition(int channel, const std::vector< int > &pos)
virtual void update(const Observable *, void *)
This class is an Observer of each of the AObject it groups.
virtual void setPalette(const AObjectPalette &palette)
VectorField(const std::vector< AObject * > &obj)
Point3di spaceCoordsDimensions(int channel) const
virtual unsigned glNumTextures(const ViewState &) const
Point4df getPlane(const ViewState &) const
Gets the current slice plane.
virtual void createDefaultPalette(const std::string &name="")
function called by getOrCreatePalette() - overloadable, need not be called directly
virtual unsigned glTexCoordSize(const ViewState &, unsigned tex=0) const
texture array size (must be >= numVertex to work), defalut=0
virtual const AObjectPalette * palette() const
void setVolume(int channel, AObject *obj)
virtual unsigned glDimTex(const ViewState &, unsigned tex=0) const
texture dimension (1, 2 [or 3])
virtual Sliceable * sliceableAPI()
Definition vectorfield.h:58
virtual unsigned glNumTextures() const
virtual bool Is3DObject()
Can be display in 3D windows.
Definition vectorfield.h:67
virtual std::vector< float > glVoxelSize() const
virtual void setVoxelSize(const std::vector< float > &)
virtual const Referential * getReferential() const
static void editVectorFieldProperties(const std::set< AObject * > &obj)
virtual std::vector< float > glMin2D() const
virtual bool render(PrimList &, const ViewState &)
rendering (generally 2D or 3D using OpenGL).
void setSpaceCoordsDimensions(int channel, const Point3di &dims)
virtual AObjectPalette * palette()
Normally, getOrCreatePalette() should be used instead of this function in most cases.
std::list< carto::rc_ptr< GLItem > > PrimList
Definition Object.h:74
std::list< RefGLItem > GLPrimitives
Definition primitive.h:156
ViewState holds information about how a view wants to see an object.
Definition viewstate.h:67
AimsVector< int32_t, 3 > Point3di
AimsVector< float, 4 > Point4df