35 #ifndef COLORVERTEX_H_ 36 #define COLORVERTEX_H_ 49 template<
typename T,
typename ColorT>
61 this->
x = this->
y = this->
z = 0;
62 this->
r = this->
g = this->
b = 0;
84 const unsigned char _r,
const unsigned char _g,
const unsigned char _b, ...)
128 case 0:
return this->
x;
129 case 1:
return this->
y;
130 case 2:
return this->
z;
136 throw std::overflow_error(
"Access index out of range." );
145 case 0:
return this->
x;
146 case 1:
return this->
y;
147 case 2:
return this->
z;
153 throw std::overflow_error(
"Access index out of range.");
169 template<
typename CoordType,
typename ColorT>
170 inline std::ostream& operator<<(std::ostream& os, const ColorVertex<CoordType, ColorT> v){
171 os <<
"ColorVertex: " << v.
x <<
" " << v.y <<
" " << v.z <<
" " << (int)v.r <<
" " << (
int)v.g <<
" " << (int)v.b << std::endl;
ColorVertex(const CoordType &_x, const CoordType &_y, const CoordType &_z)
Builds a ColorVertex with the given coordinates.
ColorVertex()
Default constructor. All coordinates and the color are initialized with zeros.
CoordType operator[](const int &index) const
ColorVertex(const T &o)
Copy Ctor.
ColorVertex(const CoordType &_x, const CoordType &_y, const CoordType &_z, const unsigned char _r, const unsigned char _g, const unsigned char _b,...)
Builds a Vertex with the given coordinates.
ColorVertex(const ColorVertex &o)
Copy Ctor.
A generic, weakly-typed vector.
CoordType & operator[](const int &index)