StelVertexArray.hpp   StelVertexArray.hpp 
skipping to change at line 70 skipping to change at line 70
//! call a function for each triangle of the array. //! call a function for each triangle of the array.
//! func should define the following method : //! func should define the following method :
//! void operator() (const Vec3d* vertex[3], const Vec2f* tex[3] , unsigned int indices[3]) //! void operator() (const Vec3d* vertex[3], const Vec2f* tex[3] , unsigned int indices[3])
//! The method takes arrays of *pointers* as arguments because we ca n't assume the values are contiguous //! The method takes arrays of *pointers* as arguments because we ca n't assume the values are contiguous
template<class Func> template<class Func>
inline Func foreachTriangle(Func func) const; inline Func foreachTriangle(Func func) const;
//! Create a copy of the array with all the triangles intersecting t he projector discontinuty removed. //! Create a copy of the array with all the triangles intersecting t he projector discontinuty removed.
StelVertexArray removeDiscontinuousTriangles(const class StelProject or* prj) const; StelVertexArray removeDiscontinuousTriangles(const class StelProject or* prj) const;
void draw(class StelPainter* painter) const;
private: private:
// Below we define a few methods that are templated to be optimized according to different types of VertexArray : // Below we define a few methods that are templated to be optimized according to different types of VertexArray :
// The template parameter <bool T> defines whether the array has a t exture. // The template parameter <bool T> defines whether the array has a t exture.
// The template parameter <bool I> defines whether the array is inde xed. // The template parameter <bool I> defines whether the array is inde xed.
template <bool I> template <bool I>
const Vec3d* specVertexAt(int i) const { const Vec3d* specVertexAt(int i) const {
return &vertex.at(specIndiceAt<I>(i)); return &vertex.at(specIndiceAt<I>(i));
} }
template <bool T, bool I> template <bool T, bool I>
skipping to change at line 96 skipping to change at line 94
template<bool I> template<bool I>
unsigned int specIndiceAt(unsigned int i) const { unsigned int specIndiceAt(unsigned int i) const {
return I ? indices.at(i) : i; return I ? indices.at(i) : i;
} }
template<bool T, bool I, class Func> template<bool T, bool I, class Func>
inline Func specForeachTriangle(Func func) const; inline Func specForeachTriangle(Func func) const;
}; };
// Serialization routines
QDataStream& operator<<(QDataStream& out, const StelVertexArray&);
QDataStream& operator>>(QDataStream& in, StelVertexArray&);
template<class Func> template<class Func>
Func StelVertexArray::foreachTriangle(Func func) const Func StelVertexArray::foreachTriangle(Func func) const
{ {
// Here we just dispach the method into one of the 4 possible cases // Here we just dispach the method into one of the 4 possible cases
bool textured = isTextured(); bool textured = isTextured();
bool useIndice = isIndexed(); bool useIndice = isIndexed();
if (textured) if (textured)
if (useIndice) if (useIndice)
return specForeachTriangle<true, true, Func>(func); return specForeachTriangle<true, true, Func>(func);
 End of changes. 2 change blocks. 
2 lines changed or deleted 4 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/