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. | |
virtual | ~Primitive () |
virtual, but empty destructor | |
virtual void | render (const Primitive::RenderContext &ctx)=0 |
virtual render method, which is called by the parent scene object | |
virtual Primitive * | copy () const =0 |
must be implemented in order to obtain a deep and independent copy | |
Public Attributes | |
Type | type |
the primitive type | |
GeomColor | color |
the color of this primitive |
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
icl::geom::Primitive::Primitive | ( | Type | type = nothing , |
const GeomColor & | color = GeomColor(255,255,255,255) |
||
) | [inline] |
Default constructor.
virtual icl::geom::Primitive::~Primitive | ( | ) | [inline, virtual] |
virtual, but empty destructor
virtual Primitive* icl::geom::Primitive::copy | ( | ) | const [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.
virtual void icl::geom::Primitive::render | ( | const Primitive::RenderContext & | ctx | ) | [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.
the color of this primitive
the primitive type