anatomist  5.1.2
3D neuroimaging data viewer
anatomist::Sliceable Class Referenceabstract

Sliceable objects can draw themselves in a 2D texture. More...

#include <anatomist/object/sliceable.h>

Inheritance diagram for anatomist::Sliceable:
Collaboration diagram for anatomist::Sliceable:

Public Member Functions

 Sliceable ()
 
virtual ~Sliceable ()
 
virtual const SliceablesliceableAPI () const
 
virtual SliceablesliceableAPI ()
 
virtual unsigned glNumVertex (const ViewState &) const
 
virtual const GLfloat * glVertexArray (const ViewState &) const
 
virtual const GLfloat * glNormalArray (const ViewState &state) const
 normals array (optional), default=0 (no normals, flat shaded faces) More...
 
virtual unsigned glPolygonSize (const ViewState &) const
 number of vertices per polygon (default = 3: triangles) More...
 
virtual unsigned glNumPolygon (const ViewState &) const
 
virtual const GLuint * glPolygonArray (const ViewState &) const
 
virtual unsigned glDimTex (const ViewState &, unsigned tex=0) const
 texture dimension (1, 2 [or 3]) More...
 
virtual unsigned glTexCoordSize (const ViewState &, unsigned tex=0) const
 texture array size (must be >= numVertex to work), defalut=0 More...
 
virtual const GLfloat * glTexCoordArray (const ViewState &, unsigned tex=0) const
 
virtual carto::VolumeRef< AimsRGBAglBuildTexImage (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. More...
 
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. More...
 
virtual bool update2DTexture (AImage &, const Point3df &posbase, const SliceViewState &, unsigned tex=0) const
 this function must be overloaded to actually fill the slice image More...
 
virtual carto::VolumeRef< AimsRGBArgbaVolume (const SliceViewState *=0, int tex=0) const
 fills a resampled RGBA volume More...
 
virtual void rgbaVolume (carto::Volume< AimsRGBA > &, const SliceViewState *=0, int tex=0) const
 same as the other rgbaVolume() but fills an already allocated volume More...
 
virtual std::vector< float > glVoxelSize () const
 
virtual std::vector< float > glMin2D () const =0
 
virtual std::vector< float > glMax2D () const =0
 
virtual bool glAllowedTexRGBInterpolation (unsigned tex=0) const
 
virtual const ReferentialgetReferential () const =0
 
virtual std::string viewStateID (glPart part, const ViewState &) const
 Makes a unique ID from a viewstate. More...
 
- Public Member Functions inherited from anatomist::GLComponent
 GLComponent ()
 
virtual ~GLComponent ()
 
void clearLists ()
 
virtual const GLComponentglAPI () const
 
virtual GLComponentglAPI ()
 
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 More...
 
const ShadergetShader () const
 
ShadergetShader ()
 
virtual void setShaderParameters (const Shader &shader, const ViewState &state) const
 
virtual const MaterialglMaterial () const
 
virtual const AObjectPaletteglPalette (unsigned tex=0) const
 
virtual unsigned long glMaxNumDisplayedPolygons () const
 Limit to the number of displayed polygons (default: 0, unlimited or ) global default value) More...
 
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 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
 
virtual void glSetTexRGBInterpolation (bool x, unsigned tex=0)
 
virtual bool glTexRGBInterpolation (unsigned tex=0) const
 
virtual const TexExtremaglTexExtrema (unsigned tex=0) const
 
virtual TexExtremaglTexExtrema (unsigned tex=0)
 
virtual GLPrimitives glMainGLL (const ViewState &)
 
virtual void glGarbageCollector (int nkept=-1)
 Frees unused display lists. More...
 
unsigned glStateMemory () const
 Number of unused display lists in different states kept in memory (default: 4) More...
 
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. More...
 
virtual void glBeforeBodyGLL (const ViewState &state, GLPrimitives &pl) const
 GL list to execute before the body is rendered. More...
 
virtual void glAfterBodyGLL (const ViewState &state, GLPrimitives &pl) const
 GL list to execute after the body is rendered. More...
 
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< glTextureModeglAllowedTexModes (unsigned tex=0) const
 List of actually allowed texturing modes for this particular object. More...
 
virtual std::set< glTextureFilteringglAllowedTexFilterings (unsigned tex=0) const
 
virtual std::set< glAutoTexturingModeglAllowedAutoTexModes (unsigned tex=0) const
 
virtual bool glAllowedTexRate (unsigned tex=0) const
 
virtual carto::Object debugInfo () const
 
int glObjectID () const
 
virtual TexInfoglTexInfo (unsigned tex=0) const
 

Additional Inherited Members

- Public Types inherited from anatomist::GLComponent
enum  glTextureMode {
  glGEOMETRIC , glLINEAR , glREPLACE , glDECAL ,
  glBLEND , glADD , glCOMBINE , glLINEAR_A_IF_A ,
  glLINEAR_ON_DEFINED , glLINEAR_A_IF_B = glLINEAR_ON_DEFINED , glLINEAR_A_IF_NOT_A , glLINEAR_A_IF_NOT_B ,
  glLINEAR_B_IF_A , glLINEAR_B_IF_B , glLINEAR_B_IF_NOT_A , glLINEAR_B_IF_NOT_B ,
  glLINEAR_A_IF_A_ALPHA , glLINEAR_A_IF_NOT_B_ALPHA , glLINEAR_B_IF_B_ALPHA , glLINEAR_B_IF_NOT_A_ALPHA ,
  glMAX_CHANNEL , glMIN_CHANNEL , glMAX_ALPHA , glMIN_ALPHA ,
  glGEOMETRIC_SQRT , glGEOMETRIC_LIGHTEN
}
 
enum  glTextureFiltering { glFILT_NEAREST , glFILT_LINEAR }
 
enum  glPart {
  glGENERAL , glBODY , glMATERIAL , glGEOMETRY ,
  glPALETTE , glREFERENTIAL , glTEXIMAGE , glTEXENV ,
  glNOPART , glTEXIMAGE_NUM , glTEXENV_NUM
}
 GL object parts, each driving a GL list. More...
 
enum  glAutoTexturingMode {
  glTEX_MANUAL , glTEX_OBJECT_LINEAR , glTEX_EYE_LINEAR , glTEX_SPHERE_MAP ,
  glTEX_REFLECTION_MAP , glTEX_NORMAL_MAP
}
 
typedef ViewState::glSelectRenderMode glSelectRenderMode
 
- Static Public Member Functions inherited from anatomist::GLComponent
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() More...
 
static GLPrimitives glPopTransformation (const ViewState &vs, const Referential *myref)
 called after glHandleTransformation() and glMainGLL() to pop the transformation matrix More...
 
- Protected Member Functions inherited from anatomist::GLComponent
void glAddTextures (unsigned ntex=1)
 

Detailed Description

Sliceable objects can draw themselves in a 2D texture.

The slice information is provided on demand as a ViewState information.

Definition at line 58 of file sliceable.h.

Constructor & Destructor Documentation

◆ Sliceable()

anatomist::Sliceable::Sliceable ( )

◆ ~Sliceable()

virtual anatomist::Sliceable::~Sliceable ( )
virtual

Member Function Documentation

◆ getReferential()

virtual const Referential* anatomist::Sliceable::getReferential ( ) const
pure virtual

◆ glAllowedTexRGBInterpolation()

virtual bool anatomist::Sliceable::glAllowedTexRGBInterpolation ( unsigned  tex = 0) const
virtual

Reimplemented from anatomist::GLComponent.

◆ glBuildTexImage()

virtual carto::VolumeRef<AimsRGBA> anatomist::Sliceable::glBuildTexImage ( const ViewState state,
unsigned  tex,
int  dimx = -1,
int  dimy = -1,
bool  useTexScale = true 
) const
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.

Parameters
dimxand dimy are target texture sizes. If left to -1 (default), the size is calculated internally.
useTexScaleif true (default), allow using OpenGL scaling in texture space. Otherwise the palette image will be adapted to fit the scale.

Reimplemented from anatomist::GLComponent.

◆ glDimTex()

virtual unsigned anatomist::Sliceable::glDimTex ( const ViewState ,
unsigned  tex = 0 
) const
virtual

texture dimension (1, 2 [or 3])

Reimplemented from anatomist::GLComponent.

◆ glMakeTexImage()

virtual bool anatomist::Sliceable::glMakeTexImage ( const ViewState state,
const GLTexture gltex,
unsigned  tex 
) const
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.

Returns
true on success, false if a texture could not be created

Reimplemented from anatomist::GLComponent.

◆ glMax2D()

virtual std::vector<float> anatomist::Sliceable::glMax2D ( ) const
pure virtual

◆ glMin2D()

virtual std::vector<float> anatomist::Sliceable::glMin2D ( ) const
pure virtual

◆ glNormalArray()

virtual const GLfloat* anatomist::Sliceable::glNormalArray ( const ViewState ) const
virtual

normals array (optional), default=0 (no normals, flat shaded faces)

Reimplemented from anatomist::GLComponent.

Reimplemented in anatomist::Fusion2DMesh.

◆ glNumPolygon()

virtual unsigned anatomist::Sliceable::glNumPolygon ( const ViewState ) const
virtual

Reimplemented from anatomist::GLComponent.

Reimplemented in anatomist::Fusion2DMesh.

◆ glNumVertex()

virtual unsigned anatomist::Sliceable::glNumVertex ( const ViewState ) const
virtual

Reimplemented from anatomist::GLComponent.

Reimplemented in anatomist::Fusion2DMesh.

◆ glPolygonArray()

virtual const GLuint* anatomist::Sliceable::glPolygonArray ( const ViewState ) const
virtual

Reimplemented from anatomist::GLComponent.

Reimplemented in anatomist::Fusion2DMesh.

◆ glPolygonSize()

virtual unsigned anatomist::Sliceable::glPolygonSize ( const ViewState ) const
virtual

number of vertices per polygon (default = 3: triangles)

Reimplemented from anatomist::GLComponent.

Reimplemented in anatomist::Fusion2DMesh.

◆ glTexCoordArray()

virtual const GLfloat* anatomist::Sliceable::glTexCoordArray ( const ViewState ,
unsigned  tex = 0 
) const
virtual

Reimplemented from anatomist::GLComponent.

◆ glTexCoordSize()

virtual unsigned anatomist::Sliceable::glTexCoordSize ( const ViewState ,
unsigned  tex = 0 
) const
virtual

texture array size (must be >= numVertex to work), defalut=0

Reimplemented from anatomist::GLComponent.

◆ glVertexArray()

virtual const GLfloat* anatomist::Sliceable::glVertexArray ( const ViewState ) const
virtual

Reimplemented from anatomist::GLComponent.

Reimplemented in anatomist::Fusion2DMesh.

◆ glVoxelSize()

virtual std::vector<float> anatomist::Sliceable::glVoxelSize ( ) const
virtual

◆ rgbaVolume() [1/2]

virtual void anatomist::Sliceable::rgbaVolume ( carto::Volume< AimsRGBA > &  ,
const SliceViewState = 0,
int  tex = 0 
) const
virtual

same as the other rgbaVolume() but fills an already allocated volume

◆ rgbaVolume() [2/2]

virtual carto::VolumeRef<AimsRGBA> anatomist::Sliceable::rgbaVolume ( const SliceViewState = 0,
int  tex = 0 
) const
virtual

fills a resampled RGBA volume

◆ sliceableAPI() [1/2]

virtual Sliceable* anatomist::Sliceable::sliceableAPI ( )
inlinevirtual

◆ sliceableAPI() [2/2]

virtual const Sliceable* anatomist::Sliceable::sliceableAPI ( ) const
inlinevirtual

◆ update2DTexture()

virtual bool anatomist::Sliceable::update2DTexture ( AImage ,
const Point3df posbase,
const SliceViewState ,
unsigned  tex = 0 
) const
virtual

this function must be overloaded to actually fill the slice image

Reimplemented in anatomist::AVolume< T >, and anatomist::Fusion2D.

◆ viewStateID()

virtual std::string anatomist::Sliceable::viewStateID ( glPart  part,
const ViewState  
) const
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 from anatomist::GLComponent.


The documentation for this class was generated from the following file: