Maya 1.0
Public Member Functions | Protected Attributes | List of all members
MayaGpuSet Class Reference

This class implements a geometric instance linked to a set of frames. More...

#include <maya.h>

Inheritance diagram for MayaGpuSet:
MayaGpu

Public Member Functions

 MayaGpuSet ()
 Empty.
 
 MayaGpuSet (const MayaGeometrySet &)
 Create a set of geometric instances on the GPU. More...
 
void InitInstances ()
 Initialize the instances.
 
void InitVAO (GpuParameter &)
 Initialize vertex array object. More...
 
void RefreshFrames ()
 Refresh frames Instances.
 
bool isWireframe () const
 Check if the set should be rendered as wireframe.
 
void Render (GpuParameter &)
 Render all instances of an object (Shaders are used). More...
 
void RenderBBox ()
 Render the bounding box.
 
void SetSubroutine (GpuParameter &) const
 Define the shading program. More...
 
void Append (const FrameScaled &)
 Add an instance to the set. More...
 
void ClearFrames ()
 Clear all frames.
 
int count () const
 Get the number of frames in the set.
 
FrameScaled GetFrameScaled (int) const
 Get the number i-th frame in the set. More...
 
MayaStatistics GetStatistics () const
 Compute statistics.
 
void DeleteBuffers ()
 Delete buffers on the GPU.
 
- Public Member Functions inherited from MayaGpu
 MayaGpu ()
 Empty. More...
 
 MayaGpu (const MayaGeometry &)
 Creates an instance. More...
 
 ~MayaGpu ()
 Destry a Maya Gpu instance.
 
void RenderBBox ()
 Renders the bounding box of the instance.
 
void SetName (const QString &)
 Set the name of the object. More...
 
void SetMaterial (const MayaMaterial &)
 Set material. More...
 
void InitMaterial ()
 Initialize the material of the object.
 
void InitTexture ()
 Initialize the texture.
 
QString GetName () const
 Get the name of the object.
 
Box getBox ()
 Get the bounding box of the object.
 
MayaStatistics GetStatistics () const
 Compute statistics.
 

Protected Attributes

QVector< FrameScaledframes
 Array of frames.
 
GLuint buffer_instances_position = 0
 Buffer of array of positions.
 
GLuint buffer_instances_rotation = 0
 Buffer of array of rotations.
 
GLuint buffer_instances_scale = 0
 Buffer of array of scales.
 
- Protected Attributes inherited from MayaGpu
QString name
 Signature of the object, implemented as the name of the corresponding mesh file.
 
MayaStatistics statistics
 Statistics of the object, which are derived from the arguments of the constructor.
 
MayaMaterial mat
 Material structure of the Object.
 
GLuint buffer_vertex
 Buffer of vertex.
 
GLuint buffer_normal
 Buffer of normal.
 
GLuint buffer_color
 Buffer of color.
 
GLuint buffer_UVmap
 Buffer of UVMaps.
 
GLuint buffer_index
 Buffer of indexes.
 
MayaGpuMaterial material
 Material data.
 
GLuint buffer_material
 Uniform material buffer.
 
GLuint buffer_texture
 Buffer of texture.
 
int nv
 Number of vertices.
 
int nt
 Number of triangles.
 
Box bbox
 Bounding box.
 
MayaSimpleRenderer * boxRenderer
 Renderer used to draw the bounding box.
 

Additional Inherited Members

- Protected Member Functions inherited from MayaGpu
void InitRenderer ()
 initialize the renderer
 
void CreateGpu (const MayaGeometry &)
 Create a MayaGpu from the MayaGeometry. More...
 
void DeleteBuffers ()
 Delete all buffers.
 

Detailed Description

This class implements a geometric instance linked to a set of frames.

Constructor & Destructor Documentation

◆ MayaGpuSet()

MayaGpuSet::MayaGpuSet ( const MayaGeometrySet mis)

Create a set of geometric instances on the GPU.

Parameters
misSet of geometric objects.

References buffer_instances_position, buffer_instances_rotation, buffer_instances_scale, frames, MayaGeometrySet::GetFrames(), MayaGeometrySet::GetStatistics(), InitInstances(), and MayaGpu::statistics.

Member Function Documentation

◆ Append()

void MayaGpuSet::Append ( const FrameScaled frame)
inline

Add an instance to the set.

Parameters
frameThe frame of the instance.

References frames, and MayaGpu::statistics.

Referenced by MayaWidget::RenderAnchor().

◆ GetFrameScaled()

FrameScaled MayaGpuSet::GetFrameScaled ( int  i) const
inline

Get the number i-th frame in the set.

Parameters
iIndex.

References frames.

◆ InitVAO()

void MayaGpuSet::InitVAO ( GpuParameter &  GP)

◆ Render()

void MayaGpuSet::Render ( GpuParameter &  GP)

Render all instances of an object (Shaders are used).

Parameters
GPParameters for the GPU.

References MayaGpu::buffer_material, MayaGpu::buffer_texture, frames, InitVAO(), MayaGpu::mat, MayaGpu::material, MayaGpu::nt, and SetSubroutine().

Referenced by MayaWidget::RenderAnchor(), and MayaWidget::RenderLight().

◆ SetSubroutine()

void MayaGpuSet::SetSubroutine ( GpuParameter &  GP) const

Define the shading program.

Parameters
GPParameters for the GPU.

References isWireframe(), and MayaGpu::mat.

Referenced by Render().