View class - abstracts all rendering duties. Has no effect on UI elements, which are handled by ModelWindow.
More...
#include <KView.h>
|
| KView (const QString &filePath, QWidget *parent=nullptr) |
| View constructor - renders model provided by filePath. Internally calls ModelRenderer. More...
|
|
| ~KView () final |
| destructor - decrements instance count
|
|
void | buildVTKModelFromMod () |
| buildVTKModelFromMod - Builds model from cells and vectors loaded from a proprietary model file
|
|
void | loadSTLModel () |
| loadSTLModel - Loads an model with STL filetype More...
|
|
void | buildChain () |
| buildChain -
|
|
bool | toggleShrinkFilter (bool enable, double shrinkFactor=NULL) |
| toggleShrinkFilter - Adds the clip filter to the back of the filter list if enabled and removes it from the list of filters More...
|
|
void | toggleClipFilter (bool enable) |
| toggleClipFilter - Adds the clip filter to the back of the filter list if enabled and removes it from the list of filters More...
|
|
void | setModelColor (const QColor &color=nullptr) |
| setModelColor - Sets the colour of the model More...
|
|
void | setModelBackFaceColor (const QColor &color) |
| setModelBackFaceColor - Sets the colour of the face of the model that is but by the clip filter More...
|
|
void | setBackgroundColor (const QColor &color) |
| setBackgroundColor - Sets the background colour of the model More...
|
|
void | resetColour () |
| resetColour - Resets all colours of the model according to defaults.
|
|
void | setLightIntensity (int value) |
| setLightIntensity - Sets the light intensity of the model More...
|
|
void | setLightSpecularity (int value) |
| setLightSpecularity - Set the specularity of the model More...
|
|
void | setModelOpacity (int value) |
| setModelOpacity - Sets the opacity of the model More...
|
|
void | resetLighting () |
| resetLighting - Resets the light parameters
|
|
void | toggleGridLines (bool enable) |
| toggleGridLines - Toggles the appearence of gridlines on the model More...
|
|
void | toggleMeasurement (bool enable) |
| toggleMeasurements - Toggles the ability to measure the distance between point on the model More...
|
|
void | setStructure (int selectedStructure) |
| setStructure - More...
|
|
bool | save () |
|
void | saveAs () |
|
|
static unsigned short int | getCount () |
| get the count of existing View objects More...
|
|
|
QString | borderColor |
| reconsider member visibility, use accessors
|
|
QVBoxLayout * | verticalLayout |
|
QVTKOpenGLWidget * | qVTKWidget |
|
std::shared_ptr< MModel > | model |
|
vtkSmartPointer< vtkAlgorithm > | vtkModel |
| vtkModel - Unstructured grid containing all the cells of the model. More...
|
|
vtkSmartPointer< vtkSTLReader > | STLModel |
| STLModel - STL model source.
|
|
vtkSmartPointer< vtkDataSetMapper > | mapper |
| mapper - sole rendering mapper
|
|
std::vector< vtkSmartPointer< vtkAlgorithm > > | filters |
| filters - list or active filters.
|
|
vtkSmartPointer< vtkClipDataSet > | clipFilter |
| clipFilter - global instance of clipFilter
|
|
vtkSmartPointer< vtkShrinkFilter > | shrinkFilter |
| shrinkFilter - global instance of shrinkFilter
|
|
int | lightIntensity |
| model properties
|
|
int | lightSpecularity |
|
int | modelOpacity |
|
int | structure |
|
QString | backgroundColour |
|
QString | modelColour |
|
QString | modelBackFaceColor |
|
bool | isClipped |
|
bool | isShrunk |
|
bool | gridLinesEnabled |
|
bool | measurementEnabled |
|
double | density |
|
double | volume |
|
double | weight |
|
size_t | numOfCells |
|
MVector | centreOfGrav |
|
vtkSmartPointer< vtkDistanceWidget > | distanceWidget |
|
QString | filePath |
|
std::shared_ptr< QSettings > | viewSettings |
|
View class - abstracts all rendering duties. Has no effect on UI elements, which are handled by ModelWindow.
- Note
- should be used as a standalone class. Intentionally disables inheritance capability.
KView::KView |
( |
const QString & |
filePath, |
|
|
QWidget * |
parent = nullptr |
|
) |
| |
|
explicit |
View constructor - renders model provided by filePath. Internally calls ModelRenderer.
- Parameters
-
filePath | - path to the model to be rendered |
parent | |
unsigned short int KView::getCount |
( |
| ) |
|
|
static |
get the count of existing View objects
- Returns
- instance count
void KView::loadSTLModel |
( |
| ) |
|
loadSTLModel - Loads an model with STL filetype
- Parameters
-
filePath | - The path of the file that is selected |
save - Saves the model to the opened file
- Returns
- Success parameter
saveAs - Saves the current model to new file
void KView::setBackgroundColor |
( |
const QColor & |
color | ) |
|
setBackgroundColor - Sets the background colour of the model
- Parameters
-
color | - The colour the model is set to |
void KView::setLightIntensity |
( |
int |
value | ) |
|
setLightIntensity - Sets the light intensity of the model
- Parameters
-
value | - The value of light intensity depending on the position of the slider |
void KView::setLightSpecularity |
( |
int |
value | ) |
|
setLightSpecularity - Set the specularity of the model
- Parameters
-
value | - The value of the specularity depending on the position of the slider |
void KView::setModelBackFaceColor |
( |
const QColor & |
color | ) |
|
setModelBackFaceColor - Sets the colour of the face of the model that is but by the clip filter
- Parameters
-
color | - The colour the back face of the model is set to |
void KView::setModelColor |
( |
const QColor & |
color = nullptr | ) |
|
setModelColor - Sets the colour of the model
- Parameters
-
color | - The colour the model is set to |
void KView::setModelOpacity |
( |
int |
value | ) |
|
setModelOpacity - Sets the opacity of the model
- Parameters
-
value | - The value of opacity depending on the position of the slider |
void KView::setStructure |
( |
int |
selectedStructure | ) |
|
setStructure -
- Parameters
-
void KView::toggleClipFilter |
( |
bool |
enable | ) |
|
toggleClipFilter - Adds the clip filter to the back of the filter list if enabled and removes it from the list of filters
- Parameters
-
enable | - If the filter is activated by the user |
void KView::toggleGridLines |
( |
bool |
enable | ) |
|
toggleGridLines - Toggles the appearence of gridlines on the model
- Parameters
-
enable | - Whether the checkbox is enabled or disabled |
void KView::toggleMeasurement |
( |
bool |
enable | ) |
|
toggleMeasurements - Toggles the ability to measure the distance between point on the model
- Parameters
-
enable | - If the measurement has been toggled on or off |
bool KView::toggleShrinkFilter |
( |
bool |
enable, |
|
|
double |
shrinkFactor = NULL |
|
) |
| |
toggleShrinkFilter - Adds the clip filter to the back of the filter list if enabled and removes it from the list of filters
- Parameters
-
enable | - If the filter is activated by the user |
shrinkFactor | - If enable is true, and shrinkFactor is set, model will shrink to shrinkFactor, otherwise, shrinkFactor dialog will open |
vtkSmartPointer<vtkAlgorithm> KView::vtkModel |
vtkModel - Unstructured grid containing all the cells of the model.
- Note
- used to render custom .mod models.
The documentation for this class was generated from the following files:
- /home/travis/build/KurusView/2020_GROUP_21/include/ModelRenderer/KView.h
- /home/travis/build/KurusView/2020_GROUP_21/lib/ModelRenderer/KView.cpp