16 #ifndef VIEWER_MODELPART_H
17 #define VIEWER_MODELPART_H
23 #include <vtkSmartPointer.h>
24 #include <vtkMapper.h>
26 #include <vtkSTLReader.h>
28 #include <vtkPolyDataMapper.h>
30 #include <vtkNamedColors.h>
31 #include <vtkProperty.h>
32 #include <vtkImageGaussianSmooth.h>
33 #include <vtkTransform.h>
35 #include <vtkClipDataSet.h>
37 #include <vtkShrinkFilter.h>
38 #include <vtkClipDataSet.h>
39 #include <vtkDataSetMapper.h>
84 QVariant
data(
int column)
const;
89 void set(
int column,
const QVariant &value);
103 void setColour(
const unsigned char R,
const unsigned char G,
const unsigned char B);
135 void loadSTL(QString fileName);
172 vtkSmartPointer<vtkSTLReader>
getReader();
176 vtkSmartPointer<vtkActor>
getActor();
192 void clipfilters(
bool state,
int clipVal,
int normalVal);
209 vtkSmartPointer<vtkSTLReader>
file;
Model Part class.
Definition: ModelPart.h:51
int row() const
Get row index of item, relative to parent item.
Definition: ModelPart.cpp:91
bool renderVisible
Definition: ModelPart.h:206
~ModelPart()
Destructor for model part.
Definition: ModelPart.cpp:33
QList< ModelPart * > m_childItems
Definition: ModelPart.h:201
void shrinkfilters(bool state)
Apply shrink filter to model.
Definition: ModelPart.cpp:357
void rotateActorY(double sliderValue)
Rotate actor in the Y axis by a given value.
Definition: ModelPart.cpp:335
QVariant data(int column) const
Return the data item at a particular column for this item. i.e. either part name of visibility....
Definition: ModelPart.cpp:67
vtkSmartPointer< vtkActor > newActor
Definition: ModelPart.h:215
vtkSmartPointer< vtkMapper > mapper
Definition: ModelPart.h:210
void rotateVRActorY(double sliderValue)
Rotate VR actor in the Y axis by a given value.
unsigned char getColourB()
Get Blue colour component of this part.
Definition: ModelPart.cpp:131
void set(int column, const QVariant &value)
Default function required by Qt to allow setting of part. properties within treeview.
Definition: ModelPart.cpp:76
void rotateActorX(double sliderValue)
Rotate actor in the X axis by a given value.
Definition: ModelPart.cpp:324
int b
Definition: ModelPart.h:207
vtkSmartPointer< vtkMapper > newMapper
Definition: ModelPart.h:214
void rotateVRActorX(double sliderValue)
Rotate VR actor in the X axis by a given value.
void refreshModel()
Refresh the model.
Definition: ModelPart.cpp:207
vtkSmartPointer< vtkActor > getActor()
Return the actor.
Definition: ModelPart.cpp:177
unsigned char getColourG()
Get Green colour component of this part.
Definition: ModelPart.cpp:125
ModelPart * m_parentItem
Definition: ModelPart.h:203
QString FileNameFullPath
Definition: ModelPart.h:224
ModelPart(const QList< QVariant > &data, ModelPart *parent=nullptr)
Constructor for model part.
Definition: ModelPart.cpp:22
vtkSmartPointer< vtkTransform > transform
Definition: ModelPart.h:220
void appendChild(ModelPart *item)
Append a child item to this item.
Definition: ModelPart.cpp:39
bool visible()
Get visible flag.
Definition: ModelPart.cpp:144
void clipfilters(bool state, int clipVal, int normalVal)
Apply clip filter to model.
Definition: ModelPart.cpp:370
void resetColoursOfModel()
Reset the colours of the model.
Definition: ModelPart.cpp:251
vtkSmartPointer< vtkTransform > newTransform
Definition: ModelPart.h:221
void setFileName(QString filename)
Set file name.
Definition: ModelPart.cpp:107
int g
Definition: ModelPart.h:207
vtkSmartPointer< vtkSTLReader > file
Definition: ModelPart.h:209
void loadSTL(QString fileName)
Load STL file.
Definition: ModelPart.cpp:150
int columnCount() const
Get number of data items (2 - part name and visibility string) in this case.
Definition: ModelPart.cpp:61
void setVisible(bool isVisible)
Set visible flag.
Definition: ModelPart.cpp:137
ModelPart * parentItem()
Definition: ModelPart.cpp:85
vtkSmartPointer< vtkActor > actor
Definition: ModelPart.h:211
vtkSmartPointer< vtkProperty > property
Definition: ModelPart.h:222
QList< QVariant > m_itemData
Definition: ModelPart.h:202
void refreshModelVR()
Refresh the VR model.
Definition: ModelPart.cpp:299
void setColour(const unsigned char R, const unsigned char G, const unsigned char B)
Set colour of this part.
Definition: ModelPart.cpp:99
void resetColoursOfVRModel()
Reset the colours of the VR model.
Definition: ModelPart.cpp:278
void rotateActorZ(double sliderValue)
Rotate actor in the Z axis by a given value.
Definition: ModelPart.cpp:346
void rotateVRActorZ(double sliderValue)
Rotate VR actor in the Z axis by a given value.
vtkSmartPointer< vtkSTLReader > getReader()
Return the reader to get the file source.
Definition: ModelPart.cpp:183
vtkActor * getNewActor()
Return new actor for use in VR.
Definition: ModelPart.cpp:195
int childCount() const
Get number of children of this item.
Definition: ModelPart.cpp:55
void setColoursOfModel(double r, double g, double b)
set colours of the model
Definition: ModelPart.cpp:232
vtkColor3< unsigned char > colour
Definition: ModelPart.h:212
vtkSmartPointer< vtkImageGaussianSmooth > gaussian_filter
Definition: ModelPart.h:218
vtkSmartPointer< vtkProperty > newProperty
Definition: ModelPart.h:216
vtkSmartPointer< vtkMapper > getMapper()
Return the mapper.
Definition: ModelPart.cpp:189
unsigned char getColourR()
Get Red colour component of this part.
Definition: ModelPart.cpp:119
ModelPart * child(int row)
child at position 'row' below this item
Definition: ModelPart.cpp:46
bool isVisible
Definition: ModelPart.h:205
QString getFileName()
Get file name.
Definition: ModelPart.cpp:113
int r
Definition: ModelPart.h:207