|
VR CAD Viewer 1.0
Qt and VTK application for loading and visualising CAD models with VR support
|
Represents one CAD model part in the application. More...
#include <ModelPart.h>
Public Member Functions | |
| ModelPart (const QList< QVariant > &data, ModelPart *parent=nullptr) | |
| Creates a new model part. | |
| ~ModelPart () | |
| Deletes the model part and its child items. | |
| void | appendChild (ModelPart *item) |
| Adds a child item to this model part. | |
| ModelPart * | child (int row) |
| Gets the child item at a given row. | |
| int | childCount () const |
| Gets the number of child items. | |
| int | columnCount () const |
| Gets the number of data columns. | |
| QVariant | data (int column) const |
| Gets the data stored in a given column. | |
| void | set (int column, const QVariant &value) |
| Sets the data stored in a given column. | |
| ModelPart * | parentItem () |
| Gets the parent item. | |
| int | row () const |
| Gets this item's row number relative to its parent. | |
| void | setColour (const unsigned char R, const unsigned char G, const unsigned char B) |
| Sets the RGB colour of the model part. | |
| unsigned char | getColourR () |
| Gets the red colour value. | |
| unsigned char | getColourG () |
| Gets the green colour value. | |
| unsigned char | getColourB () |
| Gets the green colour value. | |
| void | setVisible (bool isVisible) |
| Sets whether the model part is visible. | |
| bool | visible () |
| Gets whether the model part is visible. | |
| void | loadSTL (QString fileName) |
| Loads an STL file for this model part. | |
| vtkSmartPointer< vtkActor > | getActor () |
| Gets the actor used for normal GUI rendering. | |
| vtkSmartPointer< vtkActor > | getNewActor () |
| Creates a separate actor for VR rendering. | |
| bool | removeChild (int row) |
| Removes a child item at a given row. | |
| void | setShrinkFilter (bool enabled, double factor) |
| Sets the shrink filter used for rendering. | |
| bool | shrinkFilterEnabled () const |
| Checks whether the shrink filter is enabled. | |
| double | shrinkFactor () const |
| Gets the shrink filter factor. | |
| void | updatePipeline () |
| Updates the main VTK rendering pipeline after filter/property changes. | |
| void | updateVRPipeline () |
| Updates the VR rendering pipeline after filter/property changes. | |
| void | setClipFilter (bool enabled, int axis, double value, bool invert) |
| Sets the clip filter used for rendering. | |
| bool | clipFilterEnabled () const |
| Checks whether the clip filter is enabled. | |
| int | clipAxis () const |
| Gets the axis used by the clip filter. | |
| double | clipValue () const |
| Gets the clip filter value. | |
| bool | clipInvert () const |
| Checks whether the clip filter is inverted. | |
Represents one CAD model part in the application.
Stores tree hierarchy information, display properties such as colour and visibility, and the VTK objects needed to render an STL model.
Creates a new model part.
| data | Item data such as name and visibility. |
| parent | Parent item in the tree, or nullptr for the root item. |
Adds a child item to this model part.
| item | Pointer to the child item to add. |

Gets the child item at a given row.
| row | Row index of the child item. |


| int ModelPart::childCount | ( | ) | const |
Gets the number of child items.

| int ModelPart::clipAxis | ( | ) | const |
Gets the axis used by the clip filter.

| bool ModelPart::clipFilterEnabled | ( | ) | const |
Checks whether the clip filter is enabled.

| bool ModelPart::clipInvert | ( | ) | const |
Checks whether the clip filter is inverted.

| double ModelPart::clipValue | ( | ) | const |
Gets the clip filter value.

| int ModelPart::columnCount | ( | ) | const |
Gets the number of data columns.

Gets the data stored in a given column.
| column | Column index. |


| vtkSmartPointer< vtkActor > ModelPart::getActor | ( | ) |
Gets the actor used for normal GUI rendering.
Gets the green colour value.

Gets the green colour value.

Gets the red colour value.

| vtkSmartPointer< vtkActor > ModelPart::getNewActor | ( | ) |
Creates a separate actor for VR rendering.

Loads an STL file for this model part.
| fileName | Path to the STL file. |

| ModelPart * ModelPart::parentItem | ( | ) |
Gets the parent item.

Removes a child item at a given row.
| row | Row index of the child to remove. |


| int ModelPart::row | ( | ) | const |
Gets this item's row number relative to its parent.

Sets the data stored in a given column.
| column | Column index. |
| value | New value to store. |


Sets the clip filter used for rendering.
| enabled | True to enable the filter, false to disable it. |
| axis | Axis used for clipping. |
| value | Clip position along the selected axis. |
| invert | True to invert the clipped region. |


Sets the RGB colour of the model part.
| R | Red value from 0 to 255. |
| G | Green value from 0 to 255. |
| B | Blue value from 0 to 255. |


Sets the shrink filter used for rendering.
| enabled | True to enable the filter, false to disable it. |
| factor | Shrink factor applied to the model. |


Sets whether the model part is visible.
| isVisible | True to show the part, false to hide it. |


| double ModelPart::shrinkFactor | ( | ) | const |
Gets the shrink filter factor.

| bool ModelPart::shrinkFilterEnabled | ( | ) | const |
Checks whether the shrink filter is enabled.

| bool ModelPart::visible | ( | ) |
Gets whether the model part is visible.
