13 #ifndef OGLPLUS_SHAPES_CAGE_1107121519_HPP
14 #define OGLPLUS_SHAPES_CAGE_1107121519_HPP
28 :
public DrawingInstructionWriter
38 GLdouble _face_size(GLuint face, GLuint axis)
const
40 return std::fabs(Dot(_face_mat(face).Row(axis), _size));
43 GLdouble _face_barw(GLuint face, GLuint axis)
const
45 return std::fabs(Dot(_face_mat(face).Row(axis), _barw));
48 GLuint _face_divs(GLuint face, GLuint axis)
const
50 return GLuint(std::fabs(Dot(_face_mat(face).Row(axis), _divs)));
58 return _face_mat(face)*vec;
61 template <
typename Iter>
70 GLuint _vert_count(
void)
const;
73 GLuint _pri(
void)
const {
return _vert_count(); }
75 GLuint _index_count(
void)
const;
80 , _barw(0.15, 0.15, 0.15)
86 GLdouble xs, GLdouble ys, GLdouble zs,
87 GLdouble xb, GLdouble yb, GLdouble zb,
88 GLuint xd, GLuint yd, GLuint zd
101 assert(xs > xb*(xd-1));
102 assert(ys > yb*(yd-1));
103 assert(zs > zb*(zd-1));
112 typedef GLuint (
Cage::*VertexAttribFunc)(std::vector<GLfloat>&)
const;
114 std::vector<GLfloat> _positions(
void)
const;
116 GLuint Positions(std::vector<GLfloat>& dest)
const
123 template <
typename T>
126 auto p = _positions();
127 dest.assign(p.begin(), p.end());
131 std::vector<GLfloat> _normals(
void)
const;
133 GLuint Normals(std::vector<GLfloat>& dest)
const
140 template <
typename T>
144 dest.assign(n.begin(), n.end());
148 std::vector<GLfloat> _tangents(
void)
const;
150 GLuint Tangents(std::vector<GLfloat>& dest)
const
157 template <
typename T>
160 auto t = _tangents();
161 dest.assign(t.begin(), t.end());
165 std::vector<GLfloat> _tex_coords(
void)
const;
167 GLuint TexCoordinates(std::vector<GLfloat>& dest)
const
169 dest = _tex_coords();
174 template <
typename T>
177 auto t = _tex_coords();
178 dest.assign(t.begin(), t.end());
182 #if OGLPLUS_DOCUMENTATION_ONLY
193 typedef VertexAttribsInfo<
199 VertexTexCoordinatesTag
205 template <
typename T>
229 #if !OGLPLUS_LINK_LIBRARY || defined(OGLPLUS_IMPLEMENTING_LIBRARY)
230 #include <oglplus/shapes/cage.ipp>
233 #endif // include guard
Implementation of shape draw instructions.
Class providing vertex attributes and instructions for rendering of a cage.
Definition: cage.hpp:27
GLuint TexCoordinates(std::vector< T > &dest) const
Makes the texture coordinates and returns the number of values per vertex.
Definition: cage.hpp:175
DrawingInstructions Instructions(Default=Default()) const
Returns the instructions for rendering of faces.
IndexArray Indices(Default=Default()) const
Returns element indices that are used with the drawing instructions.
FaceOrientation
Face orientation enumeration.
Definition: face_mode.hpp:62
OpenGL face type-related enumeration.
T z(void) const
Returns the 2-nd component.
Definition: vector.hpp:237
FaceOrientation FaceWinding(void) const
Returns the winding direction of faces.
Definition: cage.hpp:107
void BoundingSphere(oglplus::Sphere< T > &bounding_sphere) const
Queries the bounding sphere coordinates and dimensions.
Definition: cage.hpp:206
T y(void) const
Returns the 1-st component.
Definition: vector.hpp:231
GLuint Normals(std::vector< T > &dest) const
Makes the normals and returns the number of values per vertex.
Definition: cage.hpp:141
GLuint Positions(std::vector< T > &dest) const
Makes the vertices and returns the number of values per vertex.
Definition: cage.hpp:124
VertexAttribsInfo< Cage > VertexAttribs
Vertex attribute information for this shape builder.
Definition: cage.hpp:191
std::vector< GLuint > IndexArray
The type of the index container returned by Indices()
Definition: cage.hpp:217
Base template for Matrix.
Definition: fwd.hpp:63
Classes providing additional information about the shape builders.
Cage(void)
Constructs a unit cage centered at the origin.
Definition: cage.hpp:78
Class encapsulating the instructions for drawing of a shape.
Definition: draw.hpp:219
Class implementing sphere-related functionality.
Definition: sphere.hpp:29
GLuint Tangents(std::vector< T > &dest) const
Makes the tangents and returns the number of values per vertex.
Definition: cage.hpp:158
Cage(GLdouble xs, GLdouble ys, GLdouble zs, GLdouble xb, GLdouble yb, GLdouble zb, GLuint xd, GLuint yd, GLuint zd)
Constructs a cage with width, height, depth.
Definition: cage.hpp:85