Stellarium 0.12.0
Home · All Namespaces · All Classes · Functions · Coding Style · Scripting · Plugins · Renderer · File Structure

TriangleIterator< V > Class Template Reference

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

#include <TriangleIterator.hpp>

List of all members.

Public Member Functions

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

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:
vertices Vertices to iterate over.
primitiveType Primitive 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:
a The first vertex of the triangle will be written here.
b The second vertex of the triangle will be written here.
c The 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:
Generated on Thu Jan 31 14:05:47 2013 for Stellarium by  doxygen 1.6.3