Image Component Library (ICL)
Public Member Functions | Public Attributes | List of all members
icl::geom::PolygonPrimitive Struct Reference

polygon primitive More...

#include <Primitive.h>

Inheritance diagram for icl::geom::PolygonPrimitive:
icl::geom::Primitive

Public Member Functions

 PolygonPrimitive (int n, const int *vidx, const GeomColor &color, const int *nidx=0)
 constructor More...
 
virtual ICLGeom_API void render (const Primitive::RenderContext &ctx)
 render method More...
 
virtual Primitivecopy () const
 deep copy method More...
 
int getNumPoints () const
 direct access to number of vertices More...
 
int getVertexIndex (int i) const
 direct access to i-th vertex index More...
 
int getNormalIndex (int i) const
 direct access to i-th normal index More...
 
bool hasNormals () const
 utility method to ask whether normal indices are available More...
 
- Public Member Functions inherited from icl::geom::Primitive
 Primitive (Type type=nothing, const GeomColor &color=GeomColor(255, 255, 255, 255))
 Default constructor. More...
 
virtual ~Primitive ()
 virtual, but empty destructor More...
 

Public Attributes

utils::Array2D< int > idx
 vertex and texture primitives More...
 
- Public Attributes inherited from icl::geom::Primitive
Type type
 the primitive type More...
 
GeomColor color
 the color of this primitive More...
 

Additional Inherited Members

- Public Types inherited from icl::geom::Primitive
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...
 

Detailed Description

polygon primitive

The Array2D's first row contains the

Constructor & Destructor Documentation

◆ PolygonPrimitive()

icl::geom::PolygonPrimitive::PolygonPrimitive ( int  n,
const int *  vidx,
const GeomColor color,
const int *  nidx = 0 
)
inline

constructor

Member Function Documentation

◆ copy()

virtual Primitive* icl::geom::PolygonPrimitive::copy ( ) const
inlinevirtual

deep copy method

Implements icl::geom::Primitive.

◆ getNormalIndex()

int icl::geom::PolygonPrimitive::getNormalIndex ( int  i) const
inline

direct access to i-th normal index

This will crash, if there are no normals

◆ getNumPoints()

int icl::geom::PolygonPrimitive::getNumPoints ( ) const
inline

direct access to number of vertices

◆ getVertexIndex()

int icl::geom::PolygonPrimitive::getVertexIndex ( int  i) const
inline

direct access to i-th vertex index

◆ hasNormals()

bool icl::geom::PolygonPrimitive::hasNormals ( ) const
inline

utility method to ask whether normal indices are available

◆ render()

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

render method

Implements icl::geom::Primitive.

Member Data Documentation

◆ idx

utils::Array2D<int> icl::geom::PolygonPrimitive::idx

vertex and texture primitives

Layout:

  • first row: column i -> vertex index i
  • 2nd row: (optional) column i -> normal index i

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