Image Component Library (ICL)
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
icl::geom::Primitive Struct Referenceabstract

Abastract base type for geoemtric primitives. More...

#include <Primitive.h>

Inheritance diagram for icl::geom::Primitive:
icl::geom::GenericTexturePrimitive icl::geom::LinePrimitive icl::geom::PolygonPrimitive icl::geom::QuadPrimitive icl::geom::TextureGridPrimitive icl::geom::TrianglePrimitive icl::geom::TwoSidedGridPrimitive icl::geom::SharedTexturePrimitive icl::geom::TexturePrimitive icl::geom::TwoSidedTextureGridPrimitive icl::geom::TextPrimitive

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 Primitivecopy () 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...
 

Detailed Description

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

See also
Primitive::copy

Member Enumeration Documentation

◆ Type

primitive type for dynamic handling of different primitives

Enumerator
vertex 
line 
triangle 
quad 
polygon 
texture 
text 
nothing 
custom 
PRIMITIVE_TYPE_COUNT 
all 
faces 

Constructor & Destructor Documentation

◆ Primitive()

icl::geom::Primitive::Primitive ( Type  type = nothing,
const GeomColor color = GeomColor(255,255,255,255) 
)
inline

Default constructor.

◆ ~Primitive()

virtual icl::geom::Primitive::~Primitive ( )
inlinevirtual

virtual, but empty destructor

Member Function Documentation

◆ copy()

virtual Primitive* icl::geom::Primitive::copy ( ) const
pure virtual

◆ render()

virtual void icl::geom::Primitive::render ( const Primitive::RenderContext ctx)
pure virtual

Member Data Documentation

◆ color

GeomColor icl::geom::Primitive::color

the color of this primitive

◆ type

Type icl::geom::Primitive::type

the primitive type


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