1 #ifndef KURUSVIEW_KVIEW_H 2 #define KURUSVIEW_KVIEW_H 11 #include <QVTKOpenGLWidget.h> 12 #include <vtkSmartPointer.h> 13 #include <vtkDataSetMapper.h> 14 #include <vtkClipDataSet.h> 15 #include <vtkShrinkFilter.h> 16 #include <vtkDistanceWidget.h> 17 #include <vtkAlgorithm.h> 18 #include <vtkSTLReader.h> 32 class KView final :
public QWidget {
36 QVBoxLayout *verticalLayout;
37 QVTKOpenGLWidget *qVTKWidget;
38 std::shared_ptr<MModel> model;
51 vtkSmartPointer<vtkDataSetMapper>
mapper;
54 std::vector<vtkSmartPointer<vtkAlgorithm>>
filters;
64 QString backgroundColour, modelColour, modelBackFaceColor;
65 bool isClipped, isShrunk, gridLinesEnabled, measurementEnabled;
66 double density, volume, weight;
69 vtkSmartPointer<vtkDistanceWidget> distanceWidget;
71 std::shared_ptr<QSettings> viewSettings;
81 explicit KView(
const QString &filePath, QWidget *parent =
nullptr);
94 void buildVTKModelFromMod();
114 bool toggleShrinkFilter(
bool enable,
double shrinkFactor = NULL);
121 void toggleClipFilter(
bool enable);
127 static
unsigned short int getCount();
133 void setModelColor(const QColor &color =
nullptr);
139 void setModelBackFaceColor(const QColor &color);
146 void setBackgroundColor(const QColor &color);
157 void setLightIntensity(
int value);
163 void setLightSpecularity(
int value);
169 void setModelOpacity(
int value);
174 void resetLighting();
180 void toggleGridLines(
bool enable);
186 void toggleMeasurement(
bool enable);
192 void setStructure(
int selectedStructure);
211 static
unsigned short int ViewInstanceCount;
218 QString borderColors[4] = {
"red",
"blue",
"cyan",
"magenta"};
223 void gridlinesInit();
228 void populateSettings();
233 #endif //KURUSVIEW_KVIEW_H int lightIntensity
model properties
Definition: KView.h:63
QString borderColor
reconsider member visibility, use accessors
Definition: KView.h:35
View class - abstracts all rendering duties. Has no effect on UI elements, which are handled by Model...
Definition: KView.h:32
vtkSmartPointer< vtkAlgorithm > vtkModel
vtkModel - Unstructured grid containing all the cells of the model.
Definition: KView.h:45
vtkSmartPointer< vtkClipDataSet > clipFilter
clipFilter - global instance of clipFilter
Definition: KView.h:57
vtkSmartPointer< vtkDataSetMapper > mapper
mapper - sole rendering mapper
Definition: KView.h:51
std::vector< vtkSmartPointer< vtkAlgorithm > > filters
filters - list or active filters.
Definition: KView.h:54
vtkSmartPointer< vtkSTLReader > STLModel
STLModel - STL model source.
Definition: KView.h:48
vtkSmartPointer< vtkShrinkFilter > shrinkFilter
shrinkFilter - global instance of shrinkFilter
Definition: KView.h:60