OGLplus (0.52.0) a C++ wrapper for OpenGL

oglplus::shapes::Sphere Class Reference

Class providing vertex attributes and instructions for rendering of a Sphere. More...

#include </home/chochlik/devel/oglplus/include/oglplus/shapes/sphere.hpp>

Inherits oglplus::shapes::DrawingInstructionWriter, and oglplus::shapes::DrawMode.

Public Types

typedef VertexAttribsInfo< SphereVertexAttribs
 Vertex attribute information for this shape builder. More...
 
typedef std::vector< GLushort > IndexArray
 The type of index container returned by Indices()
 

Public Member Functions

 Sphere (void)
 Creates a sphere with unit radius centered at the origin.
 
 Sphere (double radius, unsigned sections, unsigned rings)
 Creates a sphere with specified radius centered at the origin. More...
 
double Radius (void) const
 Returns the radius of the sphere.
 
void Radius (double radius)
 Sets the radius of the sphere. More...
 
unsigned Sections (void) const
 Returns the number of sections of the sphere.
 
void Sections (unsigned sections)
 Sets the number of sections of the sphere. More...
 
unsigned Rings (void) const
 Returns the number of rings of the sphere.
 
void Rings (unsigned rings)
 Sets the number of rings of the sphere. More...
 
FaceOrientation FaceWinding (void) const
 Returns the winding direction of faces.
 
template<typename T >
GLuint Normals (std::vector< T > &dest) const
 Makes vertex normals and returns number of values per vertex.
 
template<typename T >
GLuint Tangents (std::vector< T > &dest) const
 Makes vertex tangents and returns number of values per vertex.
 
template<typename T >
GLuint Bitangents (std::vector< T > &dest) const
 Makes vertex bi-tangents and returns number of values per vertex.
 
template<typename T >
GLuint Positions (std::vector< T > &dest) const
 Makes vertex coordinates and returns number of values per vertex.
 
template<typename T >
GLuint TexCoordinates (std::vector< T > &dest) const
 Makes texture-coorinates and returns number of values per vertex.
 
template<typename T >
void BoundingSphere (oglplus::Sphere< T > &bounding_sphere) const
 Queries the bounding sphere coordinates and dimensions.
 
IndexArray Indices (Default=Default()) const
 Returns element indices that are used with the drawing instructions.
 
DrawingInstructions Instructions (Default=Default()) const
 Returns the instructions for rendering.
 

Detailed Description

Class providing vertex attributes and instructions for rendering of a Sphere.

Examples:
standalone/001_shape2dot.cpp, and standalone/020_oglplus_oalplus.cpp.

Member Typedef Documentation

typedef VertexAttribsInfo<Sphere> oglplus::shapes::Sphere::VertexAttribs

Vertex attribute information for this shape builder.

Sphere provides build functions for the following named vertex attributes:

  • "Position" the vertex positions (Positions)
  • "Normal" the vertex normal vectors (Normals)
  • "Tangent" the vertex tangent vector (Tangents)
  • "Bitangents" the vertex bi-tangent vector (Bitangents)
  • "TexCoord" the ST texture coordinates (TexCoordinates)

Constructor & Destructor Documentation

oglplus::shapes::Sphere::Sphere ( double  radius,
unsigned  sections,
unsigned  rings 
)

Creates a sphere with specified radius centered at the origin.

Precondition
(radius > 0) && (sections > 0) && (rings > 0)

Member Function Documentation

void oglplus::shapes::Sphere::Radius ( double  radius)

Sets the radius of the sphere.

Precondition
radius > 0
void oglplus::shapes::Sphere::Rings ( unsigned  rings)

Sets the number of rings of the sphere.

Precondition
rings > 0
void oglplus::shapes::Sphere::Sections ( unsigned  sections)

Sets the number of sections of the sphere.

Precondition
sections > 0

The documentation for this class was generated from the following file:
  • /home/chochlik/devel/oglplus/include/oglplus/shapes/sphere.hpp

Copyright © 2010-2014 Matúš Chochlík, University of Žilina, Žilina, Slovakia.
<matus.chochlik -at- fri.uniza.sk>
<chochlik -at -gmail.com>
Documentation generated on Mon Sep 22 2014 by Doxygen (version 1.8.6).