34#ifndef ANA_SURFACE_GLCOMPONENT_H
35#define ANA_SURFACE_GLCOMPONENT_H
41#include <aims/rgb/rgb.h>
42#include <cartobase/object/object.h>
43#include <cartodata/volume/volume.h>
238 unsigned tex = 0 )
const ;
250 unsigned tex = 0 )
const;
256 unsigned tex = 0 )
const;
270 unsigned tex = 0 )
const;
272 unsigned tex = 0 )
const;
304 const GLList & gllist )
const;
325 const ViewState & state,
unsigned tex,
int dimx = -1,
326 int dimy = -1,
bool useTexScale =
true )
const;
336 const GLTexture & gltex,
unsigned tex )
const;
338 const GLList & gllist,
unsigned tex )
const;
343 unsigned tex = 0 )
const;
345 unsigned tex = 0 )
const;
352 virtual std::set<glTextureMode>
354 virtual std::set<glTextureFiltering>
356 virtual std::set<glAutoTexturingMode>
396 if (_shader)
delete _shader;
397 _shader =
new Shader(shader);
virtual void glSetBodyGLL(const std::string &state, RefGLItem x)
virtual void glBeforeBodyGLL(const ViewState &state, GLPrimitives &pl) const
GL list to execute before the body is rendered.
virtual void glSetTexWrapMode(glTextureWrapMode x, unsigned coord=0, unsigned tex=0)
virtual bool glTexEnvChanged(unsigned tex=0) const
void setupShader()
create, setup, or remove the shader
glPart
GL object parts, each driving a GL list.
@ glGENERAL
General list, this one calls the others, so should be rebuilt when any other part changes.
@ glTEXENV_NUM
glTEXENV_NUM + 2* texnum flags texture #texnum, reserved for Observable pattern
@ glPALETTE
Palette settings.
@ glGEOMETRY
Geometry is the polygons, normals arrays.
@ glTEXENV
Texture environment part: activate texture units, bind textures, setup their properties.
@ glBODY
Body part: gathers vertices, polygons, normals, textures alltogether.
@ glMATERIAL
Material / coloring list.
@ glTEXIMAGE
Texture image part.
@ glREFERENTIAL
Coordinates transformations list.
@ glTEXIMAGE_NUM
glTEXIMAGE_NUM + 2* texnum flags texture #texnum, reserved for Observable pattern
GLint glGLTexWrapMode(unsigned coord=0, unsigned tex=0) const
virtual const AObjectPalette * glPalette(unsigned tex=0) const
virtual void glSetTexRGBInterpolation(bool x, unsigned tex=0)
virtual std::set< glAutoTexturingMode > glAllowedAutoTexModes(unsigned tex=0) const
virtual std::set< glTextureMode > glAllowedTexModes(unsigned tex=0) const
List of actually allowed texturing modes for this particular object.
virtual void glSetAutoTexParams(const float *params, unsigned coord=0, unsigned tex=0)
@ glTEXWRAP_MIRROR_CLAMP_TO_EDGE
@ glTEXWRAP_CLAMP_TO_EDGE
@ glTEXWRAP_MIRRORED_REPEAT
@ glTEXWRAP_CLAMP_TO_BORDER
virtual const GLfloat * glTexCoordArray(const ViewState &, unsigned tex=0) const
void setShader(const Shader &shader)
virtual bool glAllowedTexRate(unsigned tex=0) const
virtual unsigned glDimTex(const ViewState &, unsigned tex=0) const
texture dimension (1, 2 [or 3])
virtual GLPrimitives glMainGLL(const ViewState &)
unsigned glStateMemory() const
Number of unused display lists in different states kept in memory (default: 4)
virtual const GLComponent * glAPI() const
virtual bool glHasChanged(glPart) const
virtual unsigned glPolygonSize(const ViewState &) const
number of vertices per polygon (default = 3: triangles)
virtual bool glTexImageChanged(unsigned tex=0) const
virtual TexExtrema & glTexExtrema(unsigned tex=0)
virtual void glSetMaxNumDisplayedPolygons(unsigned long n)
virtual void setShaderParameters(const Shader &shader, const ViewState &state) const
virtual std::string viewStateID(glPart part, const ViewState &) const
Makes a unique ID from a viewstate.
virtual void glSetAutoTexMode(glAutoTexturingMode mode, unsigned tex=0)
virtual void glSetTexMode(glTextureMode mode, unsigned tex=0)
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 f...
virtual void glSetMainGLL(const std::string &state, GLPrimitives x)
virtual const Material * glMaterial() const
static void glSetGlobalMaxNumDisplayedPolygons(unsigned long n)
virtual TexInfo & glTexInfo(unsigned tex=0) const
@ glLINEAR_B_IF_NOT_A_ALPHA
@ glLINEAR_A_IF_NOT_B_ALPHA
virtual glAutoTexturingMode glAutoTexMode(unsigned tex=0) const
virtual glTextureWrapMode glTexWrapMode(unsigned coord=0, unsigned tex=0) const
virtual void glClearHasChangedFlags() const
virtual const TexExtrema & glTexExtrema(unsigned tex=0) const
virtual const GLfloat * glNormalArray(const ViewState &) const
normals array (optional), default=0 (no normals, flat shaded faces)
virtual Sliceable * sliceableAPI()
void glAddTextures(unsigned ntex=1)
virtual glTextureMode glTexMode(unsigned tex=0) const
virtual GLint glGLTexFiltering(unsigned tex=0) const
virtual const Sliceable * sliceableAPI() const
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 glTexRGBInterpolation(unsigned tex=0) const
static unsigned long glGlobalMaxNumDisplayedPolygons()
virtual GLint glGLTexMode(unsigned tex=0) const
virtual void glSetTexEnvChanged(bool x=true, unsigned tex=0) const
static GLPrimitives glPopTransformation(const ViewState &vs, const Referential *myref)
called after glHandleTransformation() and glMainGLL() to pop the transformation matrix
virtual carto::Object debugInfo() const
virtual GLPrimitives glTexNameGLL(const ViewState &, unsigned tex=0) const
virtual GLPrimitives glBodyGLL(const ViewState &state) const
virtual std::set< glTextureFiltering > glAllowedTexFilterings(unsigned tex=0) const
virtual void glSetStateMemory(unsigned n)
virtual bool glAllowedTexRGBInterpolation(unsigned tex=0) const
virtual void glSetMaterialGLL(const std::string &state, RefGLItem x)
virtual void glSetTexImageChanged(bool x=true, unsigned tex=0) const
virtual GLPrimitives glMaterialGLL(const ViewState &state) const
virtual unsigned glNumPolygon(const ViewState &) const
virtual unsigned glNumTextures(const ViewState &) const
virtual void glAfterBodyGLL(const ViewState &state, GLPrimitives &pl) const
GL list to execute after the body is rendered.
virtual GLPrimitives glTexEnvGLL(const ViewState &, unsigned tex=0) const
virtual glTextureFiltering glTexFiltering(unsigned tex=0) const
ViewState::glSelectRenderMode glSelectRenderMode
virtual unsigned long glMaxNumDisplayedPolygons() const
Limit to the number of displayed polygons (default: 0, unlimited or ) global default value)
virtual bool glMakeTexEnvGLL(const ViewState &state, const GLList &gllist, unsigned tex) const
virtual void glSetTexFiltering(glTextureFiltering x, unsigned tex=0)
virtual float glTexRate(unsigned tex=0) const
virtual void glSetTexNameGLL(const std::string &state, RefGLItem x, unsigned tex=0)
virtual void glGarbageCollector(int nkept=-1)
Frees unused display lists.
virtual const GLuint * glPolygonArray(const ViewState &) const
static GLPrimitives glHandleTransformation(const ViewState &vs, const Referential *myref)
helper function used in AObject::render()
virtual const GLfloat * glVertexArray(const ViewState &) const
virtual void glSetTexRate(float rate, unsigned tex=0)
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 const float * glAutoTexParams(unsigned coord=0, unsigned tex=0) const
virtual GLComponent * glAPI()
const Shader * getShader() const
virtual unsigned glNumTextures() const
virtual unsigned glTexCoordSize(const ViewState &, unsigned tex=0) const
texture array size (must be >= numVertex to work), defalut=0
virtual unsigned glNumVertex(const ViewState &) const
virtual void glSetChanged(glPart, bool=true) const
This class has to be rewritten, it's really really a shame.......
Referential: marker for transformations, with an associated color.
void setShaderParameters(const GLComponent &obj, const ViewState &state) const
Sliceable objects can draw themselves in a 2D texture.
carto::rc_ptr< GLItem > RefGLItem
std::list< RefGLItem > GLPrimitives
std::vector< float > minquant
std::vector< float > maxquant
ViewState holds information about how a view wants to see an object.