Image Component Library (ICL)
|
Abastract base type for geoemtric primitives. More...
#include <Primitive.h>
Classes | |
struct | RenderContext |
accumulated context information for rendering primitives More... | |
Public Types | |
enum | Type { vertex = 1<<0, line = 1<<1, triangle = 1<<2, quad = 1<<3, polygon = 1<<4, texture = 1<<5, text = 1<<6, nothing = 1<<7, custom = 1<<20, PRIMITIVE_TYPE_COUNT = 8, all = (1<<PRIMITIVE_TYPE_COUNT)-1, faces = triangle | quad | polygon | texture | text } |
primitive type for dynamic handling of different primitives More... | |
Public Member Functions | |
Primitive (Type type=nothing, const GeomColor &color=GeomColor(255, 255, 255, 255)) | |
Default constructor. More... | |
virtual | ~Primitive () |
virtual, but empty destructor More... | |
virtual void | render (const Primitive::RenderContext &ctx)=0 |
virtual render method, which is called by the parent scene object More... | |
virtual Primitive * | copy () const =0 |
must be implemented in order to obtain a deep and independent copy More... | |
Public Attributes | |
Type | type |
the primitive type More... | |
GeomColor | color |
the color of this primitive More... | |
Abastract base type for geoemtric primitives.
Primitives are atomar geometric entities, that are used to build SceneObjects. Primitives must only* define, how they are rendered in OpenGL. For rendering, the primitives can access the parent objects data such as vertices and normals. By these means, several primitives can share resources such as vertices, normals or even textures. Usually primitives will just define vertex indices that are then used to pick the correct vertices from the parent SceneObject's vertex list.
) only is not completely correct, they also have to implement a deep copy interface
|
inline |
Default constructor.
|
inlinevirtual |
virtual, but empty destructor
|
pure virtual |
must be implemented in order to obtain a deep and independent copy
Implemented in icl::geom::TextPrimitive, icl::geom::GenericTexturePrimitive, icl::geom::SharedTexturePrimitive, icl::geom::TwoSidedGridPrimitive, icl::geom::TextureGridPrimitive, icl::geom::TexturePrimitive, icl::geom::PolygonPrimitive, icl::geom::QuadPrimitive, icl::geom::TrianglePrimitive, and icl::geom::LinePrimitive.
|
pure virtual |
virtual render method, which is called by the parent scene object
Implemented in icl::geom::TextPrimitive, icl::geom::GenericTexturePrimitive, icl::geom::SharedTexturePrimitive, icl::geom::TwoSidedGridPrimitive, icl::geom::TwoSidedTextureGridPrimitive, icl::geom::TextureGridPrimitive, icl::geom::TexturePrimitive, icl::geom::PolygonPrimitive, icl::geom::QuadPrimitive, icl::geom::TrianglePrimitive, and icl::geom::LinePrimitive.
GeomColor icl::geom::Primitive::color |
the color of this primitive
Type icl::geom::Primitive::type |
the primitive type