![]() |
PelVis
|
#include <MyRenderer.h>
Public Member Functions | |
| MyRenderer (bool isSplitted, vtkRenderWindow *renderWindow=nullptr) | |
| ~MyRenderer () | |
| void | claculateDistanceToActor (int keyMainActor, int keyTumorActor, bool splittedMiddle=false, bool splittedBorder=false) |
| void | LoadPolydataFromFile (const char *filename, vtkMatrix4x4 *viewMatrix=NULL) |
| void | LoadShaders (QString path) |
| vtkSmartPointer< MyActor > | CopyActor (vtkSmartPointer< MyActor > actor, QString name) |
| void | SplitPolygons () |
| void | LinkLabelToShader (int label, QString name, vtkSmartPointer< MyShaderCallback > callback=0) |
| void | SetShadingProperties () |
| void | SetCameraProperties (double cameraPosition[3]=CAMERAPOSITION, double focalPoint[3]=FOCALPOINT, double viewUp[3]=CAMERAVIEWUP, double zoom=ZOOM) |
| void | Begin () |
| void | SetDefaults () |
| vtkSmartPointer< vtkPolyData > | FusePolygons (vtkSmartPointer< vtkPolyData > polyData1, vtkSmartPointer< vtkPolyData > polyData2) |
| vtkSmartPointer< vtkPolyData > | CloseOpenPolygons (vtkSmartPointer< vtkPolyData > polyData) |
| void | showTargetStructure (int keyTargetStructure, int keyRiskStructure) |
| vtkSmartPointer< vtkPolyData > | SplitPolygon (int actorID, bool safeToPolyDataMap=true) |
| vtkSmartPointer< vtkRenderWindow > | GetRenderWindow () const |
| void | ConnectInteractors () |
| vtkSmartPointer< vtkRenderer > | GetRenderer () const |
| void | copyData (MyRenderer *renderer) |
| double * | GetOriginOfClipping () |
| double * | GetNormalOfClipping () |
| vtkSmartPointer< vtkPlaneSource > | GetClippingPlane () |
| void | CreateClippingPlane (vtkSmartPointer< vtkPlaneSource > from) |
| void | CreateClippingPlane () |
| void | UpdateClippingPlane (double normal[3]) |
| void | UpdateClippingPlane (double step) |
Class which takes care of preparing the Data/Information for the shaders
Definition at line 53 of file MyRenderer.h.
| MyRenderer::MyRenderer | ( | bool | isSplitted, |
| vtkRenderWindow * | renderWindow = nullptr |
||
| ) |
Constructor of the RenderObject if the flag isSplitted is true the Renderer is used for the visualization of the clipped data
Definition at line 172 of file MyRenderer.cpp.
| MyRenderer::~MyRenderer | ( | ) |
Definition at line 190 of file MyRenderer.cpp.
| void MyRenderer::Begin | ( | ) |
starts the renderloop.
Definition at line 827 of file MyRenderer.cpp.
| void MyRenderer::claculateDistanceToActor | ( | int | keyMainActor, |
| int | keyTumorActor, | ||
| bool | splittedMiddle = false, |
||
| bool | splittedBorder = false |
||
| ) |
calculates the distance between two actors and stores the minimal distances as scalar value for each Point at the MainActor it also generates a colormap with which the distance values can be decoded as color(red near, white far away) furthermore it shows black isolines at specified distance values
Definition at line 207 of file MyRenderer.cpp.
| vtkSmartPointer< vtkPolyData > MyRenderer::CloseOpenPolygons | ( | vtkSmartPointer< vtkPolyData > | polyData | ) |
CloseOpenPolygongs extracts the edges of the polyData and uses the vtkStripper which connects the edges with lines and generate polygons out of the lines to generate a set of Polygons which can be used to close the input polygonData It returns the set of polygons
Definition at line 361 of file MyRenderer.cpp.
| void MyRenderer::ConnectInteractors | ( | ) |
adds all actors of actorMap to the renderer and connects iren.
Definition at line 736 of file MyRenderer.cpp.
returns a copy of the MyObject object with a given name. All information about the shaders is also copied
Definition at line 678 of file MyRenderer.cpp.
| void MyRenderer::copyData | ( | MyRenderer * | renderer | ) |
copy the actor - data from the renderer to the renderer of the current object
Definition at line 756 of file MyRenderer.cpp.
References CopyActor().
| void MyRenderer::CreateClippingPlane | ( | vtkSmartPointer< vtkPlaneSource > | from | ) |
generates a new clippingPlaneSource with the same values as from
Definition at line 778 of file MyRenderer.cpp.
| void MyRenderer::CreateClippingPlane | ( | ) |
generates the ClippingPlaneSource with the default values
Definition at line 787 of file MyRenderer.cpp.
| vtkSmartPointer< vtkPolyData > MyRenderer::FusePolygons | ( | vtkSmartPointer< vtkPolyData > | polyData1, |
| vtkSmartPointer< vtkPolyData > | polyData2 | ||
| ) |
This function is used to combine two different vtkPolyData object which each other. It returns a new vtkPolyData object which contains the information of both input objects
Definition at line 344 of file MyRenderer.cpp.
|
inline |
returns the clippingPlaneSource
Definition at line 189 of file MyRenderer.h.
|
inline |
returns the normal of the clippingPlaneSource
Definition at line 184 of file MyRenderer.h.
|
inline |
returns the Origin of the clippingPlaneSource
Definition at line 179 of file MyRenderer.h.
|
inline |
|
inline |
Definition at line 157 of file MyRenderer.h.
| void MyRenderer::LinkLabelToShader | ( | int | label, |
| QString | name, | ||
| vtkSmartPointer< MyShaderCallback > | callback = 0 |
||
| ) |
links the polydata in labeledPolydata with key label to the actor in actorMap of key name and sets a custom callback if callback is not null. if no callback is given, default callback will be set, which depends on class of actor.
Definition at line 704 of file MyRenderer.cpp.
| void MyRenderer::LoadPolydataFromFile | ( | const char * | filename, |
| vtkMatrix4x4 * | viewMatrix = NULL |
||
| ) |
loads the polydata from file and fills the labeledPolydata map
Definition at line 503 of file MyRenderer.cpp.
References SplitPolygon().
| void MyRenderer::LoadShaders | ( | QString | path | ) |
loads shaders from directory path and fills actorMap. if custom class exists for some shader name (i.e. "context", ...) custom actor class will be used. MyActor is used otherwise.
Definition at line 602 of file MyRenderer.cpp.
References filehandling::readFromFile().
| void MyRenderer::SetCameraProperties | ( | double | cameraPosition[3] = CAMERAPOSITION, |
| double | focalPoint[3] = FOCALPOINT, |
||
| double | viewUp[3] = CAMERAVIEWUP, |
||
| double | zoom = ZOOM |
||
| ) |
Sets the camera properties for the current window
Definition at line 727 of file MyRenderer.cpp.
| void MyRenderer::SetDefaults | ( | ) |
Sets the properties of the current renderer / windows (for example the size of the window or the background)
Definition at line 661 of file MyRenderer.cpp.
References SetCameraProperties().
| void MyRenderer::SetShadingProperties | ( | ) |
calls SetProperties for all actors and sets defaults also for renderer, i.e. camera stuff and light.
Definition at line 670 of file MyRenderer.cpp.
| void MyRenderer::showTargetStructure | ( | int | keyTargetStructure, |
| int | keyRiskStructure | ||
| ) |
This function is used to show the target-structure actors. If the current visualization is not clipped the target structure is colored from red to white, depending on the distance with additionally black lines at the distance 10, 20, 30mm.... If the view is clipped the target structure is shown two times. One time the unclipped target structure in grey, but with the distance lines And one time time clipped target structure colored from red to white.
Definition at line 194 of file MyRenderer.cpp.
References claculateDistanceToActor().
| vtkSmartPointer< vtkPolyData > MyRenderer::SplitPolygon | ( | int | actorID, |
| bool | safeToPolyDataMap = true |
||
| ) |
SplitPolygon splits the PolygonData according to the configured clippingPlaneSource. If the flag safeToPolyDataMap is set to true the splitted polyData is added to labeledPolydata map
Definition at line 398 of file MyRenderer.cpp.
References CloseOpenPolygons(), and FusePolygons().
| void MyRenderer::SplitPolygons | ( | ) |
makes a copy of the labeledPolydata - map which is needed in order to perform clipping properly and stores it in the labeledPolydataSplitted - map
Definition at line 692 of file MyRenderer.cpp.
References SplitPolygon().
| void MyRenderer::UpdateClippingPlane | ( | double | normal[3] | ) |
updates the normal of the ClippingPlaneSource
| void MyRenderer::UpdateClippingPlane | ( | double | step | ) |
moves the clipping plan by the value step in the direction of the normal vector
Definition at line 820 of file MyRenderer.cpp.
1.8.15