![]() |
anatomist 6.0.4
3D neuroimaging data viewer
|
Base class for all OpenGL objects in Anatomist (with OpenGL display lists) More...
#include <anatomist/surface/glcomponent.h>

Classes | |
| struct | TexExtrema |
| struct | TexInfo |
| Semi-private structure. More... | |
Public Member Functions | |
| GLComponent () | |
| virtual | ~GLComponent () |
| void | clearLists () |
| virtual const GLComponent * | glAPI () const |
| virtual GLComponent * | glAPI () |
| virtual const Sliceable * | sliceableAPI () const |
| virtual Sliceable * | sliceableAPI () |
| virtual void | glClearHasChangedFlags () const |
| virtual void | glSetChanged (glPart, bool=true) const |
| virtual bool | glHasChanged (glPart) const |
| void | setShader (const Shader &shader) |
| void | removeShader () |
| void | setupShader () |
| create, setup, or remove the shader | |
| const Shader * | getShader () const |
| Shader * | getShader () |
| virtual void | setShaderParameters (const Shader &shader, const ViewState &state) const |
| virtual const Material * | glMaterial () const |
| virtual const AObjectPalette * | glPalette (unsigned tex=0) const |
| virtual unsigned | glNumVertex (const ViewState &) const |
| virtual const GLfloat * | glVertexArray (const ViewState &) const |
| virtual const GLfloat * | glNormalArray (const ViewState &) const |
| normals array (optional), default=0 (no normals, flat shaded faces) | |
| virtual unsigned | glPolygonSize (const ViewState &) const |
| number of vertices per polygon (default = 3: triangles) | |
| virtual unsigned | glNumPolygon (const ViewState &) const |
| virtual const GLuint * | glPolygonArray (const ViewState &) const |
| virtual unsigned long | glMaxNumDisplayedPolygons () const |
| Limit to the number of displayed polygons (default: 0, unlimited or ) global default value) | |
| virtual void | glSetMaxNumDisplayedPolygons (unsigned long n) |
| virtual void | glSetTexImageChanged (bool x=true, unsigned tex=0) const |
| virtual void | glSetTexEnvChanged (bool x=true, unsigned tex=0) const |
| virtual unsigned | glNumTextures () const |
| virtual unsigned | glNumTextures (const ViewState &) const |
| virtual glTextureMode | glTexMode (unsigned tex=0) const |
| virtual void | glSetTexMode (glTextureMode mode, unsigned tex=0) |
| virtual float | glTexRate (unsigned tex=0) const |
| virtual void | glSetTexRate (float rate, unsigned tex=0) |
| virtual glTextureFiltering | glTexFiltering (unsigned tex=0) const |
| virtual void | glSetTexFiltering (glTextureFiltering x, unsigned tex=0) |
| virtual glAutoTexturingMode | glAutoTexMode (unsigned tex=0) const |
| virtual glTextureWrapMode | glTexWrapMode (unsigned coord=0, unsigned tex=0) const |
| virtual void | glSetTexWrapMode (glTextureWrapMode x, unsigned coord=0, unsigned tex=0) |
| virtual void | glSetAutoTexMode (glAutoTexturingMode mode, unsigned tex=0) |
| virtual const float * | glAutoTexParams (unsigned coord=0, unsigned tex=0) const |
| virtual void | glSetAutoTexParams (const float *params, unsigned coord=0, unsigned tex=0) |
| virtual bool | glTexImageChanged (unsigned tex=0) const |
| virtual bool | glTexEnvChanged (unsigned tex=0) const |
| virtual GLint | glGLTexMode (unsigned tex=0) const |
| virtual GLint | glGLTexFiltering (unsigned tex=0) const |
| GLint | glGLTexWrapMode (unsigned coord=0, unsigned tex=0) const |
| virtual void | glSetTexRGBInterpolation (bool x, unsigned tex=0) |
| virtual bool | glTexRGBInterpolation (unsigned tex=0) const |
| virtual unsigned | glDimTex (const ViewState &, unsigned tex=0) const |
| texture dimension (1, 2 [or 3]) | |
| 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 &, unsigned tex=0) const |
| virtual const TexExtrema & | glTexExtrema (unsigned tex=0) const |
| virtual TexExtrema & | glTexExtrema (unsigned tex=0) |
| virtual GLPrimitives | glMainGLL (const ViewState &) |
| virtual void | glGarbageCollector (int nkept=-1) |
| Frees unused display lists. | |
| unsigned | glStateMemory () const |
| Number of unused display lists in different states kept in memory (default: 4) | |
| virtual void | glSetStateMemory (unsigned n) |
| virtual bool | glMakeBodyGLL (const ViewState &state, const GLList &gllist) const |
If you want to make a non-standard GL display list for the body geometry, overload this function to fill gllist. | |
| virtual void | glBeforeBodyGLL (const ViewState &state, GLPrimitives &pl) const |
| GL list to execute before the body is rendered. | |
| virtual void | glAfterBodyGLL (const ViewState &state, GLPrimitives &pl) const |
| GL list to execute after the body is rendered. | |
| 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 | 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 bool | glMakeTexEnvGLL (const ViewState &state, const GLList &gllist, unsigned tex) const |
| virtual GLPrimitives | glBodyGLL (const ViewState &state) const |
| virtual GLPrimitives | glMaterialGLL (const ViewState &state) const |
| virtual GLPrimitives | glTexNameGLL (const ViewState &, unsigned tex=0) const |
| virtual GLPrimitives | glTexEnvGLL (const ViewState &, unsigned tex=0) const |
| virtual void | glSetMainGLL (const std::string &state, GLPrimitives x) |
| virtual void | glSetBodyGLL (const std::string &state, RefGLItem x) |
| virtual void | glSetMaterialGLL (const std::string &state, RefGLItem x) |
| virtual void | glSetTexNameGLL (const std::string &state, RefGLItem x, unsigned tex=0) |
| virtual std::set< glTextureMode > | glAllowedTexModes (unsigned tex=0) const |
| List of actually allowed texturing modes for this particular object. | |
| virtual std::set< glTextureFiltering > | glAllowedTexFilterings (unsigned tex=0) const |
| virtual std::set< glAutoTexturingMode > | glAllowedAutoTexModes (unsigned tex=0) const |
| virtual bool | glAllowedTexRGBInterpolation (unsigned tex=0) const |
| virtual bool | glAllowedTexRate (unsigned tex=0) const |
| virtual std::string | viewStateID (glPart part, const ViewState &) const |
| Makes a unique ID from a viewstate. | |
| virtual carto::Object | debugInfo () const |
| int | glObjectID () const |
| virtual TexInfo & | glTexInfo (unsigned tex=0) const |
Static Public Member Functions | |
| static unsigned long | glGlobalMaxNumDisplayedPolygons () |
| static void | glSetGlobalMaxNumDisplayedPolygons (unsigned long n) |
| static GLPrimitives | glHandleTransformation (const ViewState &vs, const Referential *myref) |
| helper function used in AObject::render() | |
| static GLPrimitives | glPopTransformation (const ViewState &vs, const Referential *myref) |
| called after glHandleTransformation() and glMainGLL() to pop the transformation matrix | |
Protected Member Functions | |
| void | glAddTextures (unsigned ntex=1) |
Base class for all OpenGL objects in Anatomist (with OpenGL display lists)
This object represents the virtual API which allows Anatomist to use objects geometric properties, and to render in 3D OpenGL views.
For a general explanation on how it is organized and works, see the Anatomist Objects and OpenGL rendering page.
Definition at line 66 of file glcomponent.h.
Definition at line 176 of file glcomponent.h.
| Enumerator | |
|---|---|
| glTEX_MANUAL | |
| glTEX_OBJECT_LINEAR | |
| glTEX_EYE_LINEAR | |
| glTEX_SPHERE_MAP | |
| glTEX_REFLECTION_MAP | |
| glTEX_NORMAL_MAP | |
Definition at line 157 of file glcomponent.h.
GL object parts, each driving a GL list.
Each may be updated / rebuilt at different times.
GL lists of parts are rebuilt when the object has changed for the selected part, or when a different view on the same objet is asked. Anatomist holds internal caches for such lists, which are identified using the viewStateID() method.
| Enumerator | |
|---|---|
| glGENERAL | General list, this one calls the others, so should be rebuilt when any other part changes. This is ensured by the internal mechanisms of GLComponent (in glMainGLL() method). |
| glBODY | Body part: gathers vertices, polygons, normals, textures alltogether. |
| glMATERIAL | Material / coloring list. Also handles rendering properties. |
| glGEOMETRY | Geometry is the polygons, normals arrays. The geometry is not really handled by the GLComponent now, it is rather reserved for future use. The glBODY part is the one used currently. However, changing glGEOMETRY involves also changing glBODY. |
| glPALETTE | Palette settings. The colormap itself (when used) is generally in a texture image. |
| glREFERENTIAL | Coordinates transformations list. |
| glTEXIMAGE | Texture image part. This is stored in a GL texture object, which is used by the glTEXENV part, so rebuilding a glTEXIMAGE (either because of a change or a different view) generally also requires rebuilding the glTEXENV part, but this implication is not hard-coded. |
| glTEXENV | Texture environment part: activate texture units, bind textures, setup their properties. |
| glNOPART | |
| glTEXIMAGE_NUM | glTEXIMAGE_NUM + 2* texnum flags texture #texnum, reserved for Observable pattern |
| glTEXENV_NUM | glTEXENV_NUM + 2* texnum flags texture #texnum, reserved for Observable pattern |
Definition at line 113 of file glcomponent.h.
| Enumerator | |
|---|---|
| glFILT_NEAREST | |
| glFILT_LINEAR | |
Definition at line 99 of file glcomponent.h.
Definition at line 69 of file glcomponent.h.
| Enumerator | |
|---|---|
| glTEXWRAP_REPEAT | |
| glTEXWRAP_MIRRORED_REPEAT | |
| glTEXWRAP_CLAMP_TO_EDGE | |
| glTEXWRAP_CLAMP_TO_BORDER | |
| glTEXWRAP_MIRROR_CLAMP_TO_EDGE | |
Definition at line 167 of file glcomponent.h.
| anatomist::GLComponent::GLComponent | ( | ) |
Referenced by anatomist::AGLObject::glAPI(), anatomist::AGLObject::glAPI(), anatomist::AGraph::glAPI(), anatomist::AGraph::glAPI(), glAPI(), glAPI(), anatomist::GLMObject::glAPI(), anatomist::GLMObject::glAPI(), anatomist::TransformedObject::glAPI(), anatomist::TransformedObject::glAPI(), anatomist::VolRender::glAPI(), anatomist::VolRender::glAPI(), anatomist::VolRenderShader::glAPI(), anatomist::VolRenderShader::glAPI(), anatomist::GLMObject::glGeometry(), anatomist::GLMObject::glGeometry(), anatomist::GLMObject::glTexture(), and anatomist::GLMObject::glTexture().
|
virtual |
| void anatomist::GLComponent::clearLists | ( | ) |
|
virtual |
|
inline |
Definition at line 411 of file glcomponent.h.
|
inline |
Definition at line 410 of file glcomponent.h.
|
protected |
|
virtual |
GL list to execute after the body is rendered.
Reimplemented in anatomist::Fusion2DMesh, and anatomist::VectorField.
|
virtual |
|
virtual |
|
virtual |
List of actually allowed texturing modes for this particular object.
Reimplemented in anatomist::Fusion2D.
|
virtual |
|
virtual |
Reimplemented in anatomist::Sliceable.
|
inlinevirtual |
Reimplemented in anatomist::AGLObject, anatomist::AGraph, anatomist::AMTexture, anatomist::Fusion2D, anatomist::Fusion2DMesh, anatomist::GLMObject, anatomist::SliceableObject, anatomist::TransformedObject, anatomist::VectorField, anatomist::VolRender, and anatomist::VolRenderShader.
Definition at line 201 of file glcomponent.h.
References GLComponent().
|
inlinevirtual |
Reimplemented in anatomist::AGLObject, anatomist::AGraph, anatomist::AMTexture, anatomist::Fusion2D, anatomist::Fusion2DMesh, anatomist::GLMObject, anatomist::SliceableObject, anatomist::TransformedObject, anatomist::VectorField, anatomist::VolRender, and anatomist::VolRenderShader.
Definition at line 200 of file glcomponent.h.
References GLComponent().
|
virtual |
Reimplemented in anatomist::AMTexture, anatomist::Fusion3D, anatomist::GLMObject, and anatomist::PlanarFusion3D.
|
virtual |
Reimplemented in anatomist::AMTexture, anatomist::Fusion3D, anatomist::GLMObject, and anatomist::PlanarFusion3D.
|
virtual |
GL list to execute before the body is rendered.
Reimplemented in anatomist::Fusion2DMesh, and anatomist::VectorField.
|
virtual |
|
virtual |
If you make non-standard textures (ie not from a palette), overload this function.
New in Anatomist 4.5, it is used by glMakeTexImage, and may also be used to save the texture data of an arbitrary object.
| dimx | and dimy are target texture sizes. If left to -1 (default), the size is calculated internally. |
| useTexScale | if true (default), allow using OpenGL scaling in texture space. Otherwise the palette image will be adapted to fit the scale. |
Reimplemented in anatomist::PlanarFusion3D, and anatomist::Sliceable.
|
virtual |
Reimplemented in anatomist::Fusion2D, anatomist::Fusion3D, anatomist::GLMObject, and anatomist::PlanarFusion3D.
|
inlinevirtual |
texture dimension (1, 2 [or 3])
Reimplemented in anatomist::AMTexture, anatomist::ATexture, anatomist::Fusion3D, anatomist::GLMObject, anatomist::PlanarFusion3D, anatomist::Sliceable, anatomist::TextObject, anatomist::VectorField, anatomist::VolRender, and anatomist::VolRenderShader.
Definition at line 428 of file glcomponent.h.
|
virtual |
Frees unused display lists.
Display lists are created when requested by views, according to a view state, and are stored in the object. As several view states will probably be needed by different views, they are all kept internally (by a reference counter). When a display list is no longer used by views, it is still not destroyed because it could be costy to re-crete it for another view later.
To avoid objects to grow and eat all memory, this function will be called from time to time (when creating new lists) to free some lists which are not currently used by any view.
| nkept | if negative, glStateMemory() unused items are kept in the object, otherwise the specified number are kept |
Reimplemented in anatomist::AMTexture, anatomist::Fusion3D, and anatomist::GLMObject.
|
static |
|
virtual |
|
virtual |
| GLint anatomist::GLComponent::glGLTexWrapMode | ( | unsigned | coord = 0, |
| unsigned | tex = 0 ) const |
|
static |
helper function used in AObject::render()
|
virtual |
|
virtual |
|
virtual |
If you want to make a non-standard GL display list for the body geometry, overload this function to fill gllist.
Reimplemented in anatomist::ASurface< D >, anatomist::ASurface< 2 >, anatomist::ASurface< 3 >, anatomist::ASurface< 3 >, anatomist::VolRender, and anatomist::VolRenderShader.
Referenced by anatomist::ASurface< 3 >::surfaceOfTime().
|
virtual |
Reimplemented in anatomist::GLMObject.
|
virtual |
If you make non-standard textures (ie not from a palette), overload this function to fill gltex.
Since Anatomist 4.5, glMakeTexImage calls glBuildTexImage, which is actually the method to be overloaded by subclasses.
Reimplemented in anatomist::GLMObject, anatomist::PlanarFusion3D, anatomist::Sliceable, anatomist::TextObject, anatomist::VolRender, and anatomist::VolRenderShader.
|
inlinevirtual |
Reimplemented in anatomist::AGLObject, anatomist::Fusion2D, anatomist::Fusion2DMesh, anatomist::GLMObject, anatomist::SliceableObject, anatomist::TesselatedMesh, anatomist::VolRender, and anatomist::VolRenderShader.
Definition at line 409 of file glcomponent.h.
|
virtual |
Reimplemented in anatomist::GLMObject.
|
virtual |
Limit to the number of displayed polygons (default: 0, unlimited or ) global default value)
|
inlinevirtual |
normals array (optional), default=0 (no normals, flat shaded faces)
Reimplemented in anatomist::ASurface< D >, anatomist::ASurface< 2 >, anatomist::ASurface< 3 >, anatomist::ASurface< 3 >, anatomist::Bucket, anatomist::Fusion2DMesh, anatomist::GLMObject, anatomist::Sliceable, and anatomist::TesselatedMesh.
Definition at line 419 of file glcomponent.h.
|
inlinevirtual |
Reimplemented in anatomist::ASurface< D >, anatomist::ASurface< 2 >, anatomist::ASurface< 3 >, anatomist::ASurface< 3 >, anatomist::Bucket, anatomist::Fusion2DMesh, anatomist::GLMObject, anatomist::Sliceable, and anatomist::TesselatedMesh.
Definition at line 423 of file glcomponent.h.
|
virtual |
Reimplemented in anatomist::AMTexture, anatomist::ATexture, anatomist::Fusion3D, anatomist::GLMObject, anatomist::PlanarFusion3D, and anatomist::VectorField.
|
virtual |
|
inlinevirtual |
Reimplemented in anatomist::ASurface< D >, anatomist::ASurface< 2 >, anatomist::ASurface< 3 >, anatomist::ASurface< 3 >, anatomist::Bucket, anatomist::Fusion2DMesh, anatomist::GLMObject, anatomist::Sliceable, and anatomist::TesselatedMesh.
Definition at line 415 of file glcomponent.h.
| int anatomist::GLComponent::glObjectID | ( | ) | const |
|
inlinevirtual |
Reimplemented in anatomist::AGLObject, anatomist::AGraph, anatomist::AInterpoler, anatomist::AMTexture, anatomist::Fusion2D, anatomist::Fusion3D, anatomist::GLMObject, anatomist::PlanarFusion3D, anatomist::SliceableObject, anatomist::VectorField, anatomist::VolRender, and anatomist::VolRenderShader.
Definition at line 413 of file glcomponent.h.
|
inlinevirtual |
Reimplemented in anatomist::ASurface< D >, anatomist::ASurface< 2 >, anatomist::ASurface< 3 >, anatomist::ASurface< 3 >, anatomist::Bucket, anatomist::Fusion2DMesh, anatomist::GLMObject, anatomist::Sliceable, and anatomist::TesselatedMesh.
Definition at line 425 of file glcomponent.h.
|
inlinevirtual |
number of vertices per polygon (default = 3: triangles)
Reimplemented in anatomist::ASurface< D >, anatomist::ASurface< 2 >, anatomist::ASurface< 3 >, anatomist::ASurface< 3 >, anatomist::Bucket, anatomist::Fusion2DMesh, anatomist::GLMObject, anatomist::Sliceable, and anatomist::TesselatedMesh.
Definition at line 421 of file glcomponent.h.
|
static |
called after glHandleTransformation() and glMainGLL() to pop the transformation matrix
|
virtual |
Reimplemented in anatomist::AMTexture, anatomist::Fusion3D, and anatomist::GLMObject.
|
virtual |
Reimplemented in anatomist::AMTexture, anatomist::Fusion3D, anatomist::GLMObject, and anatomist::PlanarFusion3D.
|
virtual |
|
virtual |
Reimplemented in anatomist::AGLObject, anatomist::Fusion2D, anatomist::GLMObject, anatomist::SliceableObject, anatomist::TextObject, anatomist::VolRender, and anatomist::VolRenderShader.
Referenced by removeShader(), and setShader().
|
static |
|
virtual |
|
virtual |
Reimplemented in anatomist::GLMObject.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Reimplemented in anatomist::AMTexture, anatomist::Fusion3D, and anatomist::GLMObject.
|
virtual |
|
virtual |
Reimplemented in anatomist::AMTexture, anatomist::Fusion2D, anatomist::Fusion3D, and anatomist::GLMObject.
|
virtual |
Reimplemented in anatomist::GLMObject.
|
virtual |
Reimplemented in anatomist::AMTexture, anatomist::Fusion3D, and anatomist::GLMObject.
|
virtual |
Reimplemented in anatomist::AMTexture, and anatomist::GLMObject.
|
virtual |
Reimplemented in anatomist::AMTexture, and anatomist::GLMObject.
| unsigned anatomist::GLComponent::glStateMemory | ( | ) | const |
Number of unused display lists in different states kept in memory (default: 4)
|
inlinevirtual |
Reimplemented in anatomist::AInterpoler, anatomist::AMTexture, anatomist::ATexture, anatomist::Fusion3D, anatomist::GLMObject, anatomist::PlanarFusion3D, anatomist::Sliceable, anatomist::TextObject, and anatomist::VectorField.
Definition at line 433 of file glcomponent.h.
|
inlinevirtual |
texture array size (must be >= numVertex to work), defalut=0
Reimplemented in anatomist::AInterpoler, anatomist::AMTexture, anatomist::ATexture, anatomist::Fusion3D, anatomist::GLMObject, anatomist::PlanarFusion3D, anatomist::Sliceable, anatomist::TextObject, and anatomist::VectorField.
Definition at line 430 of file glcomponent.h.
|
virtual |
Reimplemented in anatomist::GLMObject.
|
virtual |
Reimplemented in anatomist::Fusion3D, and anatomist::GLMObject.
|
virtual |
|
virtual |
|
virtual |
Reimplemented in anatomist::AMTexture, anatomist::Fusion3D, anatomist::GLMObject, and anatomist::PlanarFusion3D.
|
virtual |
Reimplemented in anatomist::GLMObject.
|
virtual |
Reimplemented in anatomist::AMTexture, and anatomist::GLMObject.
|
virtual |
Reimplemented in anatomist::AMTexture, anatomist::Fusion3D, anatomist::GLMObject, and anatomist::PlanarFusion3D.
|
virtual |
Reimplemented in anatomist::AMTexture, anatomist::Fusion3D, and anatomist::GLMObject.
|
virtual |
Reimplemented in anatomist::AMTexture, anatomist::Fusion3D, anatomist::GLMObject, and anatomist::PlanarFusion3D.
|
virtual |
Reimplemented in anatomist::AMTexture, and anatomist::GLMObject.
|
virtual |
Reimplemented in anatomist::AMTexture, and anatomist::GLMObject.
|
inlinevirtual |
Reimplemented in anatomist::ASurface< D >, anatomist::ASurface< 2 >, anatomist::ASurface< 3 >, anatomist::ASurface< 3 >, anatomist::Bucket, anatomist::Fusion2DMesh, anatomist::GLMObject, anatomist::Sliceable, and anatomist::TesselatedMesh.
Definition at line 417 of file glcomponent.h.
|
inline |
Definition at line 400 of file glcomponent.h.
References glBODY, and glSetChanged().
|
inline |
Definition at line 394 of file glcomponent.h.
References glBODY, and glSetChanged().
|
inlinevirtual |
Reimplemented in anatomist::ATexSurface, anatomist::AVolumeBase, and anatomist::GLMObject.
Definition at line 412 of file glcomponent.h.
References anatomist::Shader::setShaderParameters().
| void anatomist::GLComponent::setupShader | ( | ) |
create, setup, or remove the shader
Referenced by anatomist::ASurface< D >::setSurface(), and anatomist::ASurface< D >::setSurface().
|
inlinevirtual |
Reimplemented in anatomist::Fusion2D, anatomist::Fusion2DMesh, anatomist::Sliceable, anatomist::SliceableObject, and anatomist::VectorField.
Definition at line 203 of file glcomponent.h.
|
inlinevirtual |
Reimplemented in anatomist::Fusion2D, anatomist::Fusion2DMesh, anatomist::Sliceable, anatomist::SliceableObject, and anatomist::VectorField.
Definition at line 202 of file glcomponent.h.
|
virtual |
Makes a unique ID from a viewstate.
The ID must be unique within the GLComponent instance and for the part part. Depending on the aspects of the viewstate to take into account, subclasses may have to overload it.
For instance, a mesh may build an ID only taking time into account, whereas a volume slice must also code the slice position and orientation into the ID.
Reimplemented in anatomist::AGLObject, anatomist::AInterpoler, anatomist::AMTexture, anatomist::Bucket, anatomist::Fusion3D, anatomist::GLMObject, anatomist::PlanarFusion3D, anatomist::Sliceable, anatomist::VolRender, and anatomist::VolRenderShader.