Fraxinus  18.10
An IGT application
cxGraphicalTorus3D.cpp
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 
12 #include "cxGraphicalTorus3D.h"
13 
14 #include <QColor>
15 #include "cxVtkHelperClasses.h"
16 #include "vtkSuperquadricSource.h"
17 
18 #include <vtkProperty.h>
19 #include <vtkActor.h>
20 
21 namespace cx
22 {
23 
26 {
27  mSource->SetToroidal(true);
28  mSource->SetSize(10);
29  mSource->SetThickness(0.5);
30  mSource->SetThetaResolution(mSource->GetThetaResolution()*2);
31 }
32 
34 {
35 }
36 
37 void GraphicalTorus3D::setRadius(double value)
38 {
39  mSource->SetSize(value);
40 }
41 
43 {
44  mSource->SetThickness(value);
45 }
46 
47 void GraphicalTorus3D::setColor(QColor color)
48 {
49  setColorAndOpacity(mActor->GetProperty(), color);
50 }
51 
52 } // namespace cx
53 
Base helper class for rendering objects with a specific direction in 3D.
void setThickness(double radius)
vtkSmartPointer< class vtkRenderer > vtkRendererPtr
GraphicalTorus3D(vtkRendererPtr renderer=vtkRendererPtr())
void setRadius(double value)
void setColor(QColor color)
void setColorAndOpacity(vtkPropertyOrProperty2DPtr property, QColor color)
Namespace for all CustusX production code.