Point Cloud Viewer  1.00
A Viewer to display point clouds with phong shading by converting them to splats.
ProgramLogic Class Reference

Provides access to all functionality of the program. More...

#include <programlogic.h>

Public Member Functions

 ProgramLogic ()
 Creates a new program logic. No OpenGL calls.
 
bool loadCloud (QString &s, unsigned char k=20, float epsilon=0.0005)
 Loads a point cloud and converts it to a splat cloud. More...
 
void createLight (Light *light=new Light(), QString &title=QString("Light"))
 Creates a new light.
 
bool closeObject (unsigned char id)
 Closes the scene object with the given id. More...
 
void closeAllObjects ()
 Closes all scene objects and removes them from storage.
 
void showAllObjects ()
 Makes all scene objects visible.
 
bool showObject (unsigned char id)
 Shows the object with the given id. More...
 
bool toggleObjectVisibility (unsigned char id)
 Toggles the visibility status of the object with the given id. More...
 
unsigned char numberOfObjects ()
 The number of currently open clouds. More...
 
QString & objectTitle (unsigned char id)
 Retrieves the title of the object with the given id. More...
 
bool objectVisible (unsigned char id)
 Returns if the object with the given id is selected. More...
 
void objectRotate (QPoint mouseVec)
 Rotates the currently in the UI selected object. More...
 
void objectMove (QPoint mouseVec)
 Moves the currently in the UI selected object. More...
 
void objectScale (int delta)
 Scales the currently in the UI selected object. More...
 
void cameraReset ()
 Resets the camera position and orientation.
 
void objectReset (int index)
 Resets the location, rotation and scale of the cloud with the given id. More...
 
float changeSplatScale (float newSplatScale)
 Changes the overall splat scale to the given coefficient. More...
 
bool drawVisibilityPass ()
 Defines that the result of the visibility pass shall be shown on the screen. More...
 
bool drawAttributePass_color ()
 Defines that the color map created by the attribute pass shall be shown on the screen. More...
 
bool drawAttributePass_normal ()
 Defines that the normal map created by the attribute pass shall be shown on the screen. More...
 
bool drawShadingPass ()
 Defines that the result of the shading pass shall be shown on the screen. More...
 
bool initRenderPasses ()
 Initializes the render passes. More...
 
void render ()
 Executes all Render Passes. More...
 
void changeResolution (unsigned int xRes, unsigned int yRes)
 Notifies about a change of the resolution of the viewport. More...
 
void changeFov (float fov)
 Changes the vertical field of view. More...
 
QVector3D getNpData ()
 Returns some data about the near plane that is needed by the visibility and the attribute pass. More...
 
unsigned char getLights (Light **light10)
 Stores the first ten lights into the given array of light pointers. More...
 
LightgetSelectedLight (int id)
 Return the Light object at index or null if it's no light. More...
 
QString getSelectedObjectName (int index)
 returns Name of scene object at index More...
 
void updateSelectedObjectName (int index, QString newName)
 Change name of object with at index. More...
 
void updateVisibility ()
 update visibility of objects, needs to be called when something new should be rendered.
 
bool objectIsLight (unsigned int index)
 return if object at position index is a light More...
 
float lightGetIntensity (unsigned int index)
 returns intensity of light at index, index should be checked with objectIsLight(index) before calling this method More...
 

Detailed Description

Provides access to all functionality of the program.

Member Function Documentation

void ProgramLogic::changeFov ( float  fov)

Changes the vertical field of view.

Parameters
fovThe new vertical field of view.
void ProgramLogic::changeResolution ( unsigned int  xRes,
unsigned int  yRes 
)

Notifies about a change of the resolution of the viewport.

Parameters
xResThe new horizontal resolution.
yResThe new vertical resolution.
float ProgramLogic::changeSplatScale ( float  newSplatScale)

Changes the overall splat scale to the given coefficient.

Parameters
newSplatScaleThe new scaling. 1.0 results in the default scaling.
Returns
The new splat scale. Might differ from the passed value due to restrictions.
bool ProgramLogic::closeObject ( unsigned char  id)

Closes the scene object with the given id.

Parameters
idThe object id. The object ids range from 0 to numberOfObjects() - 1.
Returns
true if the id was valid and the object was deleted.
bool ProgramLogic::drawAttributePass_color ( )

Defines that the color map created by the attribute pass shall be shown on the screen.

The shading pass will not be executed during this mode.

Returns
true if this setup was successful. If false there might be unexpected results.
bool ProgramLogic::drawAttributePass_normal ( )

Defines that the normal map created by the attribute pass shall be shown on the screen.

The shading pass will not be executed during this mode.

Returns
true if this setup was successful. If false there might be unexpected results.
bool ProgramLogic::drawShadingPass ( )

Defines that the result of the shading pass shall be shown on the screen.

Returns
true if this setup was successful. If false there might be unexpected results.
bool ProgramLogic::drawVisibilityPass ( )

Defines that the result of the visibility pass shall be shown on the screen.

The attribute pass and the shading pass will not be executed during this mode.

Returns
true if this setup was successful. If false there might be unexpected results.
unsigned char ProgramLogic::getLights ( Light **  light10)

Stores the first ten lights into the given array of light pointers.

Parameters
light10An array of pointers to lights. The length has to be at least 10.
Returns
The number of lights stored into the array.
QVector3D ProgramLogic::getNpData ( )

Returns some data about the near plane that is needed by the visibility and the attribute pass.

Returns
The near plane data.
Light * ProgramLogic::getSelectedLight ( int  id)

Return the Light object at index or null if it's no light.

Parameters
id
Returns
Light or null
QString ProgramLogic::getSelectedObjectName ( int  index)

returns Name of scene object at index

Parameters
indexof current selection
Returns
QString name
bool ProgramLogic::initRenderPasses ( )

Initializes the render passes.

Returns
true if the setup was successful. If false there might be unexpected results.
float ProgramLogic::lightGetIntensity ( unsigned int  index)

returns intensity of light at index, index should be checked with objectIsLight(index) before calling this method

Parameters
index
Returns
bool ProgramLogic::loadCloud ( QString &  s,
unsigned char  k = 20,
float  epsilon = 0.0005 
)

Loads a point cloud and converts it to a splat cloud.

Parameters
sThe file name.
kThe parameter for kNN in splat conversion.
epsilonThe maximum deviation parameter in splat conversion.
Returns
true if the cloud was successfully loaded.
unsigned char ProgramLogic::numberOfObjects ( )

The number of currently open clouds.

Returns
The number of clouds.
bool ProgramLogic::objectIsLight ( unsigned int  index)

return if object at position index is a light

Parameters
index
Returns
void ProgramLogic::objectMove ( QPoint  mouseVec)

Moves the currently in the UI selected object.

The object may be a point cloud, the camera or a light.

Parameters
mouseVecThe mouse movement that shall result in translation.
void ProgramLogic::objectReset ( int  index)

Resets the location, rotation and scale of the cloud with the given id.

Parameters
indexThe cloud's id.
void ProgramLogic::objectRotate ( QPoint  mouseVec)

Rotates the currently in the UI selected object.

The object may be a point cloud, the camera or a light.

Parameters
mouseVecThe mouse movement that shall result in rotation.
void ProgramLogic::objectScale ( int  delta)

Scales the currently in the UI selected object.

The object may be a point cloud, the camera or a light.

Parameters
mouseVecThe mouse movement that shall result in scaling.
QString & ProgramLogic::objectTitle ( unsigned char  id)

Retrieves the title of the object with the given id.

Parameters
idThe object's id.
Returns
The object's title.
bool ProgramLogic::objectVisible ( unsigned char  id)

Returns if the object with the given id is selected.

Parameters
idThe object's id.
Returns
true if the object currently is selected.
void ProgramLogic::render ( )

Executes all Render Passes.

Contains OpenGL calls. Some Render Passes might not be executed if they are not needed.

bool ProgramLogic::showObject ( unsigned char  id)

Shows the object with the given id.

The other objects are hidden.

Parameters
idThe object's id.
Returns
true if the id is valid.
bool ProgramLogic::toggleObjectVisibility ( unsigned char  id)

Toggles the visibility status of the object with the given id.

If the object currently is selected it will be deselected, and if it currently is not selected it will be selected. The other selected objects remain selected.

Parameters
idThe object's id.
Returns
true if the id was valid and the object is now selected.
void ProgramLogic::updateSelectedObjectName ( int  index,
QString  newName 
)

Change name of object with at index.

Parameters
index
newName

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