34 #ifndef ANA_SURFACE_GLCOMPONENT_H
35 #define ANA_SURFACE_GLCOMPONENT_H
229 unsigned tex = 0 )
const ;
243 unsigned tex = 0 )
const;
256 unsigned tex = 0 )
const;
258 unsigned tex = 0 )
const;
290 const GLList & gllist )
const;
311 const ViewState & state,
unsigned tex,
int dimx = -1,
312 int dimy = -1,
bool useTexScale =
true )
const;
322 const GLTexture & gltex,
unsigned tex )
const;
324 const GLList & gllist,
unsigned tex )
const;
329 unsigned tex = 0 )
const;
331 unsigned tex = 0 )
const;
338 virtual std::set<glTextureMode>
340 virtual std::set<glTextureFiltering>
342 virtual std::set<glAutoTexturingMode>
382 if (_shader)
delete _shader;
383 _shader =
new Shader(shader);
Base class for all OpenGL objects in Anatomist (with OpenGL display lists)
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 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
virtual const AObjectPalette * glPalette(unsigned tex=0) const
virtual TexInfo & glTexInfo(unsigned tex=0) const
virtual void glSetTexRGBInterpolation(bool x, unsigned tex=0)
virtual void glSetAutoTexParams(const float *params, unsigned coord=0, unsigned tex=0)
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 std::set< glTextureFiltering > glAllowedTexFilterings(unsigned tex=0) const
virtual GLPrimitives glMainGLL(const ViewState &)
unsigned glStateMemory() const
Number of unused display lists in different states kept in memory (default: 4)
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 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 GLComponent * glAPI()
virtual void glSetMainGLL(const std::string &state, GLPrimitives x)
virtual const Material * glMaterial() const
static void glSetGlobalMaxNumDisplayedPolygons(unsigned long n)
@ glLINEAR_B_IF_NOT_A_ALPHA
@ glLINEAR_A_IF_NOT_B_ALPHA
virtual glAutoTexturingMode glAutoTexMode(unsigned tex=0) const
virtual void glClearHasChangedFlags() 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 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 void glSetStateMemory(unsigned n)
virtual bool glAllowedTexRGBInterpolation(unsigned tex=0) const
virtual const TexExtrema & glTexExtrema(unsigned tex=0) const
virtual void glSetMaterialGLL(const std::string &state, RefGLItem x)
virtual void glSetTexImageChanged(bool x=true, unsigned tex=0) const
virtual std::set< glAutoTexturingMode > glAllowedAutoTexModes(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 const float * glAutoTexParams(unsigned coord=0, unsigned tex=0) const
virtual GLPrimitives glTexEnvGLL(const ViewState &, unsigned tex=0) const
virtual const Sliceable * sliceableAPI() const
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 glTextureFiltering glTexFiltering(unsigned tex=0) const
virtual std::set< glTextureMode > glAllowedTexModes(unsigned tex=0) const
List of actually allowed texturing modes for this particular object.
virtual const GLComponent * glAPI() 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
virtual TexExtrema & glTexExtrema(unsigned tex=0)
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)
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.
std::list< RefGLItem > GLPrimitives
std::vector< float > minquant
std::vector< float > maxquant
ViewState holds information about how a view wants to see an object.