StelVertexArray.hpp   StelVertexArray.hpp 
skipping to change at line 80 skipping to change at line 80
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 discontinuity removed. //! Create a copy of the array with all the triangles intersecting t he projector discontinuity removed.
StelVertexArray removeDiscontinuousTriangles(const class StelProject or* prj) const; StelVertexArray removeDiscontinuousTriangles(const class StelProject or* prj) 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.
// The template parameter <bool C> defines whether the array is colo red. // NEW GZ // The template parameter <bool C> defines whether the array is colo red.
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>
const Vec2f* specTexCoordAt(int i) const { const Vec2f* specTexCoordAt(int i) const {
return T ? &texCoords.at(specIndiceAt<I>(i)) : NULL; return T ? &texCoords.at(specIndiceAt<I>(i)) : Q_NULLPTR;
} }
// NEW GZ
template <bool C, bool I> template <bool C, bool I>
const Vec3f* specColorAt(int i) const { const Vec3f* specColorAt(int i) const {
return C ? &colors.at(specIndiceAt<I>(i)) : NULL; return C ? &colors.at(specIndiceAt<I>(i)) : Q_NULLPTR;
} }
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, bool C, class Func> // GZ added bool C template<bool T, bool I, bool C, class Func>
inline Func specForeachTriangle(Func func) const; inline Func specForeachTriangle(Func func) const;
}; };
// Serialization routines // Serialization routines
QDataStream& operator<<(QDataStream& out, const StelVertexArray&); QDataStream& operator<<(QDataStream& out, const StelVertexArray&);
QDataStream& operator>>(QDataStream& in, 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 dispatch the method into one of the 8 possible cases // GZ NEW: 8, not 4, cases // Here we just dispatch the method into one of the 8 possible cases
bool textured = isTextured(); bool textured = isTextured();
bool colored = isColored(); bool colored = isColored();
bool useIndice = isIndexed(); bool useIndice = isIndexed();
if (textured) if (textured)
{ {
if (useIndice) if (useIndice)
{ {
if (colored) if (colored)
return specForeachTriangle<true, true, true, Func>(func); return specForeachTriangle<true, true, true, Func>(func);
 End of changes. 6 change blocks. 
6 lines changed or deleted 5 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/