1#ifndef TestAxisActorInternal_h
2#define TestAxisActorInternal_h
19 labels->SetNumberOfTuples(6);
20 labels->SetValue(0,
"0");
21 labels->SetValue(1,
"2");
22 labels->SetValue(2,
"4");
23 labels->SetValue(3,
"6");
24 labels->SetValue(4,
"8");
25 labels->SetValue(5,
"10");
28 textProp1->SetColor(0., 0., 1.);
29 textProp1->SetOpacity(0.9);
32 textProp2->SetColor(1., 0., 0.);
33 textProp2->SetOpacity(0.6);
36 textProp3->SetColor(0., 1., 0.);
37 textProp3->SetOpacity(1);
40 prop1->SetColor(1., 0., 1.);
43 prop2->SetColor(1., 1., 0.);
46 prop3->SetColor(0., 1., 1.);
50 axisXActor->SetUse2DMode(use2dMode);
51 axisXActor->SetUseTextActor3D(use3dProp);
52 axisXActor->GetProperty()->SetAmbient(1);
53 axisXActor->GetProperty()->SetDiffuse(0);
54 axisXActor->SetPoint1(0, 0, 0);
55 axisXActor->SetPoint2(10, 0, 0);
56 axisXActor->SetTitle(
"X Axis");
57 axisXActor->SetBounds(0, 10, 0, 0, 0, 0);
58 axisXActor->SetTickLocationToBoth();
59 axisXActor->SetAxisTypeToX();
60 axisXActor->SetRange(0, 10);
61 axisXActor->SetLabels(labels);
62 axisXActor->SetDeltaRangeMajor(2);
63 axisXActor->SetDeltaRangeMinor(0.5);
64 axisXActor->SetExponent(
"+00");
65 axisXActor->SetExponentVisibility(
true);
66 axisXActor->SetTitleScale(0.8);
67 axisXActor->SetLabelScale(0.5);
68 axisXActor->SetTitleOffset(3);
69 axisXActor->SetExponentOffset(3);
70 axisXActor->SetLabelOffset(5);
71 axisXActor->SetTitleTextProperty(textProp1);
72 axisXActor->SetLabelTextProperty(textProp2);
73 axisXActor->SetAxisMainLineProperty(prop1);
74 axisXActor->SetAxisMajorTicksProperty(prop2);
75 axisXActor->SetAxisMinorTicksProperty(prop3);
79 axisYActor->SetUse2DMode(use2dMode);
80 axisYActor->SetUseTextActor3D(use3dProp);
81 axisYActor->GetProperty()->SetAmbient(1);
82 axisYActor->GetProperty()->SetDiffuse(0);
83 axisYActor->SetPoint1(0, 0, 0);
84 axisYActor->SetPoint2(0, 10, 0);
85 axisYActor->SetTitle(
"Y Axis");
86 axisYActor->SetBounds(0, 0, 0, 10, 0, 0);
87 axisYActor->SetTickLocationToInside();
88 axisYActor->SetAxisTypeToY();
89 axisYActor->SetRange(0.1, 500);
90 axisYActor->SetMajorRangeStart(0.1);
91 axisYActor->SetMinorRangeStart(0.1);
92 axisYActor->SetMinorTicksVisible(
true);
94 axisYActor->SetExponent(
"+00");
95 axisYActor->SetExponentVisibility(
true);
97 axisYActor->SetTitleScale(0.8);
98 axisYActor->SetLabelScale(0.5);
99 axisYActor->SetTitleOffset(3);
100 axisYActor->SetExponentOffset(5);
101 axisYActor->SetLabelOffset(5);
102 axisYActor->SetTitleTextProperty(textProp2);
103 axisYActor->SetLog(
true);
104 axisYActor->SetAxisLinesProperty(prop1);
108 axisZActor->SetUse2DMode(use2dMode);
109 axisZActor->SetUseTextActor3D(use3dProp);
110 axisZActor->GetProperty()->SetAmbient(1);
111 axisZActor->GetProperty()->SetDiffuse(0);
112 axisZActor->SetPoint1(0, 0, 0);
113 axisZActor->SetPoint2(0, 0, 10);
114 axisZActor->SetTitle(
"Z Axis");
115 axisZActor->SetBounds(0, 0, 0, 0, 0, 10);
116 axisZActor->SetTickLocationToOutside();
117 axisZActor->SetAxisTypeToZ();
118 axisZActor->SetRange(0, 10);
120 axisZActor->SetExponent(
"+00");
121 axisZActor->SetExponentVisibility(
true);
123 axisZActor->SetTitleScale(0.8);
124 axisZActor->SetLabelScale(0.5);
125 axisZActor->SetTitleOffset(3);
126 axisZActor->SetExponentOffset(3);
127 axisZActor->SetLabelOffset(5);
128 axisZActor->SetTitleTextProperty(textProp3);
129 axisZActor->SetMajorTickSize(3);
130 axisZActor->SetMinorTickSize(1);
131 axisZActor->SetDeltaRangeMajor(2);
132 axisZActor->SetDeltaRangeMinor(0.1);
136 renderWindow->AddRenderer(renderer);
138 renderWindowInteractor->SetRenderWindow(renderWindow);
139 renderer->AddActor(axisXActor);
140 renderer->AddActor(axisYActor);
141 renderer->AddActor(axisZActor);
142 renderer->SetBackground(.5, .5, .5);
144 vtkCamera* camera = renderer->GetActiveCamera();
145 axisXActor->SetCamera(camera);
146 axisYActor->SetCamera(camera);
147 axisZActor->SetCamera(camera);
148 renderWindow->SetSize(300, 300);
153 renderWindow->SetMultiSamples(0);
154 renderWindow->Render();
155 renderWindowInteractor->Start();
int TestAxisActorInternal(int use2dMode, int use3dProp)
a virtual camera for 3D rendering
void SetPosition(double x, double y, double z)
Set/Get the position of the camera in world coordinates.
void SetFocalPoint(double x, double y, double z)
Set/Get the focal of the camera in world coordinates.
Allocate and hold a VTK object.