Open CASCADE Technology  6.9.1
Public Member Functions | Protected Member Functions | Protected Attributes
OpenGl_Sphere Class Reference

Tool class for generating sphere tessellation. More...

#include <OpenGl_Sphere.hxx>

Inheritance diagram for OpenGl_Sphere:
Inheritance graph
[legend]

Public Member Functions

 OpenGl_Sphere ()
 Creates undefined sphere primitive. More...
 
Standard_Boolean Init (const Standard_ShortReal theRadius, const Standard_Integer theNbSlices=10, const Standard_Integer theNbStacks=10)
 Initialize sphere primitive. More...
 
- Public Member Functions inherited from OpenGl_Quadric
 OpenGl_Quadric ()
 Creates undefined abstract quadric surface. More...
 
Standard_Boolean IsDefined () const
 Returns true if quadric has been defined. More...
 
Standard_Integer NbSlices () const
 Returns number of slices. More...
 
Standard_Integer NbStacks () const
 Returns number of stacks. More...
 
Standard_Integer NbVertices () const
 Returns total number of vertices. More...
 
Standard_Integer NbTriangles () const
 Returns total number of triangles. More...
 
virtual void Release (OpenGl_Context *theContext) Standard_OVERRIDE
 Release GL resources. More...
 
- Public Member Functions inherited from OpenGl_PrimitiveArray
 OpenGl_PrimitiveArray (const OpenGl_GraphicDriver *theDriver)
 Empty constructor. More...
 
 OpenGl_PrimitiveArray (const OpenGl_GraphicDriver *theDriver, const Graphic3d_TypeOfPrimitiveArray theType, const Handle< Graphic3d_IndexBuffer > &theIndices, const Handle< Graphic3d_Buffer > &theAttribs, const Handle< Graphic3d_BoundBuffer > &theBounds)
 Default constructor. More...
 
virtual ~OpenGl_PrimitiveArray ()
 Destructor. More...
 
virtual void Render (const Handle< OpenGl_Workspace > &theWorkspace) const
 Render primitives to the window. More...
 
Standard_Boolean IsInitialized () const
 Return true if VBOs initialization has been performed. VBO initialization is performed during first Render() call. Notice that this flag does not indicate VBOs validity. More...
 
void Invalidate () const
 Invalidate VBO content without destruction. More...
 
GLint DrawMode () const
 
const Handle< Graphic3d_IndexBuffer > & Indices () const
 
const Handle< Graphic3d_Buffer > & Attributes () const
 
const Handle< Graphic3d_BoundBuffer > & Bounds () const
 
const Standard_Size GetUID () const
 Returns unique ID of primitive array. More...
 
void InitBuffers (const Handle< OpenGl_Context > &theContext, const Graphic3d_TypeOfPrimitiveArray theType, const Handle< Graphic3d_IndexBuffer > &theIndices, const Handle< Graphic3d_Buffer > &theAttribs, const Handle< Graphic3d_BoundBuffer > &theBounds)
 Initialize indices, attributes and bounds with new data. More...
 
- Public Member Functions inherited from OpenGl_Element
 OpenGl_Element ()
 
Standard_Boolean RenderFiltered (const Handle< OpenGl_Workspace > &theWorkspace, const Handle< OpenGl_RenderFilter > &theFilter) const
 Render element if it passes the filtering procedure. This method should be used for elements which can be used in scope of rendering algorithms. E.g. elements of groups during recursive rendering. If render filter is null, pure rendering is performed. More...
 

Protected Member Functions

virtual OpenGl_Vec3 evalVertex (const Standard_ShortReal theU, const Standard_ShortReal theV) const Standard_OVERRIDE
 Returns surface point for the given parameters. More...
 
virtual OpenGl_Vec3 evalNormal (const Standard_ShortReal theU, const Standard_ShortReal theV) const Standard_OVERRIDE
 Returns surface normal for the given parameters. More...
 
- Protected Member Functions inherited from OpenGl_Quadric
Standard_Boolean init (const Standard_Integer theNbSlices, const Standard_Integer theNbStacks)
 Initialize primitive. More...
 
- Protected Member Functions inherited from OpenGl_PrimitiveArray
Standard_Boolean buildVBO (const Handle< OpenGl_Context > &theCtx, const Standard_Boolean theToKeepData) const
 VBO initialization procedures. More...
 
void clearMemoryGL (const Handle< OpenGl_Context > &theGlCtx) const
 
- Protected Member Functions inherited from OpenGl_Element
virtual ~OpenGl_Element ()
 

Protected Attributes

Standard_ShortReal myRadius
 Sphere radius. More...
 
- Protected Attributes inherited from OpenGl_PrimitiveArray
Handle< OpenGl_VertexBuffermyVboIndices
 
Handle< OpenGl_VertexBuffermyVboAttribs
 
Handle< Graphic3d_IndexBuffermyIndices
 
Handle< Graphic3d_BuffermyAttribs
 
Handle< Graphic3d_BoundBuffermyBounds
 
GLint myDrawMode
 
Standard_Boolean myIsVboInit
 
Standard_Size myUID
 Unique ID of primitive array. More...
 

Additional Inherited Members

- Public Types inherited from OpenGl_PrimitiveArray
enum  { DRAW_MODE_NONE = -1 }
 
- Static Public Member Functions inherited from OpenGl_Element
template<typename theResource_t >
static void Destroy (OpenGl_Context *theContext, theResource_t *&theElement)
 Pointer to the context is used because this method might be called when the context is already being destroyed and usage of a handle would be unsafe. More...
 

Detailed Description

Tool class for generating sphere tessellation.

Constructor & Destructor Documentation

OpenGl_Sphere::OpenGl_Sphere ( )

Creates undefined sphere primitive.

Member Function Documentation

virtual OpenGl_Vec3 OpenGl_Sphere::evalNormal ( const Standard_ShortReal  theU,
const Standard_ShortReal  theV 
) const
protectedvirtual

Returns surface normal for the given parameters.

Implements OpenGl_Quadric.

virtual OpenGl_Vec3 OpenGl_Sphere::evalVertex ( const Standard_ShortReal  theU,
const Standard_ShortReal  theV 
) const
protectedvirtual

Returns surface point for the given parameters.

Implements OpenGl_Quadric.

Standard_Boolean OpenGl_Sphere::Init ( const Standard_ShortReal  theRadius,
const Standard_Integer  theNbSlices = 10,
const Standard_Integer  theNbStacks = 10 
)

Initialize sphere primitive.

Field Documentation

Standard_ShortReal OpenGl_Sphere::myRadius
protected

Sphere radius.


The documentation for this class was generated from the following file: