Stellarium 0.12.4
List of all members | Public Member Functions
TriangleIterator< V > Class Template Reference

Allows iteration over triangles in QVectors of vertices. More...

#include <TriangleIterator.hpp>

Public Member Functions

 TriangleIterator (const QVector< V > &vertices, const PrimitiveType primitiveType)
 Construct a TriangleIterator iterating over specified vertex array. More...
 
bool next (V &a, V &b, V &c)
 Get the next triangle, if any. More...
 

Detailed Description

template<class V>
class TriangleIterator< V >

Allows iteration over triangles in QVectors of vertices.

How the vertices are iterated depends on specified primitive type. Triangles iterated will match triangles that would be drawn if the vertices were drawn with specified primitive type.

Used by StelSphereGeometry classes.

Definition at line 37 of file TriangleIterator.hpp.

Constructor & Destructor Documentation

template<class V >
TriangleIterator< V >::TriangleIterator ( const QVector< V > &  vertices,
const PrimitiveType  primitiveType 
)
inline

Construct a TriangleIterator iterating over specified vertex array.

Parameters
verticesVertices to iterate over.
primitiveTypePrimitive type to determine how the vertices form triangles. Must be PrimitiveType_Triangles, PrimitiveType_TriangleStrip or PrimitiveType_TriangleFan.

Vertex count can be 0, but can't be 1 or 2. If primitiveType is PrimitiveType_Triangles, vertex count must be divisible by 3.

Definition at line 49 of file TriangleIterator.hpp.

Member Function Documentation

template<class V >
bool TriangleIterator< V >::next ( V &  a,
V &  b,
V &  c 
)
inline

Get the next triangle, if any.

Parameters
aThe first vertex of the triangle will be written here.
bThe second vertex of the triangle will be written here.
cThe third vertex of the triangle will be written here.
Returns
true if we've got the triangle, false if there are no more triangles (in this case a, b and c are unchanged);

Definition at line 83 of file TriangleIterator.hpp.


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