Point Cloud Viewer
1.00
A Viewer to display point clouds with phong shading by converting them to splats.
|
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... | |
Light * | getSelectedLight (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... | |
Provides access to all functionality of the program.
void ProgramLogic::changeFov | ( | float | fov | ) |
Changes the vertical field of view.
fov | The new vertical field of view. |
void ProgramLogic::changeResolution | ( | unsigned int | xRes, |
unsigned int | yRes | ||
) |
Notifies about a change of the resolution of the viewport.
xRes | The new horizontal resolution. |
yRes | The new vertical resolution. |
float ProgramLogic::changeSplatScale | ( | float | newSplatScale | ) |
Changes the overall splat scale to the given coefficient.
newSplatScale | The new scaling. 1.0 results in the default scaling. |
bool ProgramLogic::closeObject | ( | unsigned char | id | ) |
Closes the scene object with the given id.
id | The object id. The object ids range from 0 to numberOfObjects() - 1. |
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.
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.
bool ProgramLogic::drawShadingPass | ( | ) |
Defines that the result of the shading pass shall be shown on the screen.
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.
unsigned char ProgramLogic::getLights | ( | Light ** | light10 | ) |
Stores the first ten lights into the given array of light pointers.
light10 | An array of pointers to lights. The length has to be at least 10. |
QVector3D ProgramLogic::getNpData | ( | ) |
Returns some data about the near plane that is needed by the visibility and the attribute pass.
Light * ProgramLogic::getSelectedLight | ( | int | id | ) |
QString ProgramLogic::getSelectedObjectName | ( | int | index | ) |
returns Name of scene object at index
index | of current selection |
bool ProgramLogic::initRenderPasses | ( | ) |
Initializes the render passes.
float ProgramLogic::lightGetIntensity | ( | unsigned int | index | ) |
returns intensity of light at index, index should be checked with objectIsLight(index) before calling this method
index |
bool ProgramLogic::loadCloud | ( | QString & | s, |
unsigned char | k = 20 , |
||
float | epsilon = 0.0005 |
||
) |
Loads a point cloud and converts it to a splat cloud.
s | The file name. |
k | The parameter for kNN in splat conversion. |
epsilon | The maximum deviation parameter in splat conversion. |
unsigned char ProgramLogic::numberOfObjects | ( | ) |
The number of currently open clouds.
bool ProgramLogic::objectIsLight | ( | unsigned int | index | ) |
return if object at position index is a light
index |
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.
mouseVec | The 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.
index | The 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.
mouseVec | The 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.
mouseVec | The mouse movement that shall result in scaling. |
QString & ProgramLogic::objectTitle | ( | unsigned char | id | ) |
Retrieves the title of the object with the given id.
id | The object's id. |
bool ProgramLogic::objectVisible | ( | unsigned char | id | ) |
Returns if the object with the given id is selected.
id | The object's id. |
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.
id | The object's id. |
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.
id | The object's id. |
void ProgramLogic::updateSelectedObjectName | ( | int | index, |
QString | newName | ||
) |
Change name of object with at index.
index | |
newName |