13 #ifndef OGLPLUS_SHAPES_WICKER_TORUS_1201021336_HPP
14 #define OGLPLUS_SHAPES_WICKER_TORUS_1201021336_HPP
29 :
public DrawingInstructionWriter
33 const GLdouble _radius_out, _radius_in, _thickness;
34 const GLdouble _r_slip_coef, _s_slip_coef;
35 const unsigned _sections, _rings;
55 ): _radius_out(rad_out)
57 , _thickness(thickness)
63 assert(_sections % 2 == 0);
64 assert(_rings % 2 == 0);
65 assert(_thickness > 0.0);
66 assert(_thickness < _radius_in);
67 assert(_radius_in < _radius_out);
76 std::vector<GLfloat> _positions(
void)
const;
78 GLuint Positions(std::vector<GLfloat>& dest)
const
88 auto v = _positions();
89 dest.assign(v.begin(), v.end());
93 std::vector<GLfloat> _normals(
void)
const;
95 GLuint Normals(std::vector<GLfloat>& dest)
const
102 template <
typename T>
106 dest.assign(v.begin(), v.end());
110 std::vector<GLfloat> _tangents(
void)
const;
112 GLuint Tangents(std::vector<GLfloat>& dest)
const
119 template <
typename T>
122 auto v = _tangents();
123 dest.assign(v.begin(), v.end());
127 std::vector<GLfloat> _bitangents(
void)
const;
129 GLuint Bitangents(std::vector<GLfloat>& dest)
const
131 dest = _bitangents();
136 template <
typename T>
139 auto v = _bitangents();
140 dest.assign(v.begin(), v.end());
144 std::vector<GLfloat> _tex_coords(
void)
const;
146 GLuint TexCoordinates(std::vector<GLfloat>& dest)
const
148 dest = _tex_coords();
153 template <
typename T>
156 auto v = _tex_coords();
157 dest.assign(v.begin(), v.end());
161 #if OGLPLUS_DOCUMENTATION_ONLY
173 typedef VertexAttribsInfo<
180 VertexTexCoordinatesTag
186 template <
typename T>
193 T(_radius_out + _thickness)
219 #if !OGLPLUS_LINK_LIBRARY || defined(OGLPLUS_IMPLEMENTING_LIBRARY)
220 #include <oglplus/shapes/wicker_torus.ipp>
221 #endif // OGLPLUS_LINK_LIBRARY
223 #endif // include guard
Implementation of shape draw instructions.
IndexArray Indices(Default=Default()) const
Returns element indices that are used with the drawing instructions.
Definition: wicker_torus.hpp:201
std::vector< GLuint > IndexArray
The type of index container returned by Indices()
Definition: wicker_torus.hpp:198
WickerTorus(GLdouble rad_out, GLdouble rad_in, GLdouble thickness, unsigned sects, unsigned rings)
Creates a torus with unit radius centered at the origin.
Definition: wicker_torus.hpp:49
DrawingInstructions Instructions(Default=Default()) const
Returns the instructions for rendering.
FaceOrientation FaceWinding(void) const
Returns the winding direction of faces.
Definition: wicker_torus.hpp:71
Class providing vertex attributes and instructions for rendering of a Torus.
Definition: wicker_torus.hpp:28
VertexAttribsInfo< WickerTorus > VertexAttribs
Vertex attribute information for this shape builder.
Definition: wicker_torus.hpp:171
void BoundingSphere(oglplus::Sphere< T > &bounding_sphere) const
Queries the bounding sphere coordinates and dimensions.
Definition: wicker_torus.hpp:187
FaceOrientation
Face orientation enumeration.
Definition: face_mode.hpp:62
OpenGL face type-related enumeration.
GLuint TexCoordinates(std::vector< T > &dest) const
Makes texture coorinates and returns number of values per vertex.
Definition: wicker_torus.hpp:154
WickerTorus(void)
Creates a torus with unit radius centered at the origin.
Definition: wicker_torus.hpp:38
GLuint Bitangents(std::vector< T > &dest) const
Makes vertex bi-tangents and returns number of values per vertex.
Definition: wicker_torus.hpp:137
GLuint Tangents(std::vector< T > &dest) const
Makes vertex tangents and returns number of values per vertex.
Definition: wicker_torus.hpp:120
Classes providing additional information about the shape builders.
Class encapsulating the instructions for drawing of a shape.
Definition: draw.hpp:219
Class implementing sphere-related functionality.
Definition: sphere.hpp:29
GLuint Positions(std::vector< T > &dest) const
Makes vertex coordinates and returns number of values per vertex.
Definition: wicker_torus.hpp:86
GLuint Normals(std::vector< T > &dest) const
Makes vertex normals and returns number of values per vertex.
Definition: wicker_torus.hpp:103