Assimp  v4.1. (December 2018)
CGLView Class Reference

Class which hold and render scene. More...

Inherits QGLWidget.

Classes

struct  SLightParameters
 Parameters of light source. More...
 

Public Types

enum  ELightType { ELightType::Directional, ELightType::Point, ELightType::Spot }
 Type of light source. More...
 

Signals

void Paint_Finished (const size_t pPaintTime_ms, const GLfloat pDistance)
 Signal. More...
 
void SceneObject_Camera (const QString &pName)
 Signal. More...
 
void SceneObject_LightSource (const QString &pName)
 Signal. More...
 

Public Member Functions

void Camera_Rotate (const GLfloat pAngle_X, const GLfloat pAngle_Y, const GLfloat pAngle_Z)
 Rotate camera around axisees. More...
 
void Camera_RotateScene (const GLfloat pAngle_X, const GLfloat pAngle_Y, const GLfloat pAngle_Z)
 Rotate scene around axisees. More...
 
void Camera_Set (const size_t pCameraNumber)
 Set view from pointed camera. More...
 
void Camera_Translate (const GLfloat pTranslate_X, const GLfloat pTranslate_Y, const GLfloat pTranslate_Z)
 Translate camera along axises. More...
 
 CGLView (QWidget *pParent)
 Constructor. More...
 
void Enable_SceneBBox (const bool pEnable)
 Enable drawing scene bounding box. More...
 
void Enable_Textures (const bool pEnable)
 Control textures drawing. More...
 
void FreeScene ()
 Free all helper objects data. More...
 
void Lighting_Disable ()
 Disable OpenGL lighting. More...
 
void Lighting_DisableSource (const size_t pLightNumber)
 void Lighting_DisableSource(const size_t pLightNumber) Disable light source, More...
 
void Lighting_EditSource (const size_t pLightNumber, const SLightParameters &pLightParameters)
 Edit light source properties. More...
 
void Lighting_Enable ()
 Enable OpenGL lighting. More...
 
void Lighting_EnableSource (const size_t pLightNumber)
 TODO: function set. More...
 
void SetScene (const aiScene *pScene, const QString &pScenePath)
 Set scene for rendering. More...
 
virtual ~CGLView ()
 Destructor. More...
 

Protected Member Functions

void drawCoordSystem ()
 
void initializeGL () override
 Override function to initialise OpenGL. More...
 
void paintGL () override
 Override function for rendering. More...
 
void resizeGL (int pWidth, int pHeight) override
 

Detailed Description

Class which hold and render scene.

Member Enumeration Documentation

◆ ELightType

enum CGLView::ELightType
strong

Type of light source.

Enumerator
Directional 
Point 
Spot 

Constructor & Destructor Documentation

◆ CGLView()

CGLView::CGLView ( QWidget *  pParent)
explicit

Constructor.

Parameters
[in]pParent- parent widget.

TODO: may be templates can be used.

◆ ~CGLView()

CGLView::~CGLView ( )
virtual

Destructor.

Member Function Documentation

◆ Camera_Rotate()

void CGLView::Camera_Rotate ( const GLfloat  pAngle_X,
const GLfloat  pAngle_Y,
const GLfloat  pAngle_Z 
)

Rotate camera around axisees.

Parameters
[in]pAngle_X- specifies the angle of rotation around axis oX, in degrees.
[in]pAngle_Y- specifies the angle of rotation around axis oY, in degrees.
[in]pAngle_Z- specifies the angle of rotation around axis oZ, in degrees.

◆ Camera_RotateScene()

void CGLView::Camera_RotateScene ( const GLfloat  pAngle_X,
const GLfloat  pAngle_Y,
const GLfloat  pAngle_Z 
)

Rotate scene around axisees.

Parameters
[in]pAngle_X- specifies the angle of rotation around axis oX, in degrees.
[in]pAngle_Y- specifies the angle of rotation around axis oY, in degrees.
[in]pAngle_Z- specifies the angle of rotation around axis oZ, in degrees.

◆ Camera_Set()

void CGLView::Camera_Set ( const size_t  pCameraNumber)

Set view from pointed camera.

Parameters
[in]pCamera_Index- index of the camera (aiScene::mCameras).

◆ Camera_Translate()

void CGLView::Camera_Translate ( const GLfloat  pTranslate_X,
const GLfloat  pTranslate_Y,
const GLfloat  pTranslate_Z 
)

Translate camera along axises.

In local coordinates.

Parameters
[in]pTranslate_X- specifies the X coordinate of translation vector.
[in]pTranslate_Y- specifies the Y coordinate of translation vector.
[in]pTranslate_Z- specifies the Z coordinate of translation vector.

◆ drawCoordSystem()

void CGLView::drawCoordSystem ( )
protected

◆ Enable_SceneBBox()

void CGLView::Enable_SceneBBox ( const bool  pEnable)
inline

Enable drawing scene bounding box.

Parameters
[in]pEnable- if true then bbox will be drawing, if false - will not be drawing.

◆ Enable_Textures()

void CGLView::Enable_Textures ( const bool  pEnable)

Control textures drawing.

Parameters
[in]pEnable- if true then enable textures, false - disable textures.

◆ FreeScene()

void CGLView::FreeScene ( )

Free all helper objects data.

◆ initializeGL()

void CGLView::initializeGL ( )
overrideprotected

Override function to initialise OpenGL.

◆ Lighting_Disable()

void CGLView::Lighting_Disable ( )

Disable OpenGL lighting.

◆ Lighting_DisableSource()

void CGLView::Lighting_DisableSource ( const size_t  pLightNumber)

void Lighting_DisableSource(const size_t pLightNumber) Disable light source,

Parameters
[in]pLightNumber- light source number. aiScene::mLights.

TODO: return value;

◆ Lighting_EditSource()

void CGLView::Lighting_EditSource ( const size_t  pLightNumber,
const SLightParameters pLightParameters 
)

Edit light source properties.

Parameters
[in]pLightNumber- light source number. aiScene::mLights.
[in]pLightParameters- light source parameters.

TODO: return value;

◆ Lighting_Enable()

void CGLView::Lighting_Enable ( )

Enable OpenGL lighting.

◆ Lighting_EnableSource()

void CGLView::Lighting_EnableSource ( const size_t  pLightNumber)

TODO: function set.

Enable light source.

Parameters
[in]pLightNumber- light source number. aiScene::mLights.

TODO: return value;

◆ Paint_Finished

void CGLView::Paint_Finished ( const size_t  pPaintTime,
const GLfloat  pDistance 
)
signal

Signal.

Emits when execution of paintGL is end.

Parameters
[out]pPaintTime_ms- time spent for rendering, in milliseconds.
[out]pDistance- distance between current camera and center of the scene.
See also
SHelper_Camera::Translation_ToScene.

◆ paintGL()

void CGLView::paintGL ( )
overrideprotected

Override function for rendering.

TODO: display list

◆ resizeGL()

void CGLView::resizeGL ( int  pWidth,
int  pHeight 
)
overrideprotected
Parameters
[in]pWidth- new width of viewport.
[in]pHeight- new height of viewport.

TODO: znear/zfar depend on scene size.

◆ SceneObject_Camera

void CGLView::SceneObject_Camera ( const QString &  pName)
signal

Signal.

Emit for every camera found in scene. Also for default camera.

Parameters
[out]pName- name of the camera.

◆ SceneObject_LightSource

void CGLView::SceneObject_LightSource ( const QString &  pName)
signal

Signal.

Emit for every light source found in scene. Also for default light source.

Parameters
[out]pName- name of the light source.

◆ SetScene()

void CGLView::SetScene ( const aiScene pScene,
const QString &  pScenePath 
)

Set scene for rendering.

Parameters
[in]pScene- pointer to scene.
[in]pScenePath- path to the file of the scene.

TODO: find light source node and apply all transformations


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