3#ifndef TestAxisActorInternal_h
4#define TestAxisActorInternal_h
21 labels->SetNumberOfTuples(6);
22 labels->SetValue(0,
"0");
23 labels->SetValue(1,
"2");
24 labels->SetValue(2,
"4");
25 labels->SetValue(3,
"6");
26 labels->SetValue(4,
"8");
27 labels->SetValue(5,
"10");
30 textProp1->SetColor(0., 0., 1.);
31 textProp1->SetOpacity(0.9);
34 textProp2->SetColor(1., 0., 0.);
35 textProp2->SetOpacity(0.6);
38 textProp3->SetColor(0., 1., 0.);
39 textProp3->SetOpacity(1);
42 prop1->SetColor(1., 0., 1.);
45 prop2->SetColor(1., 1., 0.);
48 prop3->SetColor(0., 1., 1.);
52 axisXActor->SetUse2DMode(use2dMode);
53 axisXActor->SetUseTextActor3D(use3dProp);
54 axisXActor->GetProperty()->SetAmbient(1);
55 axisXActor->GetProperty()->SetDiffuse(0);
56 axisXActor->SetPoint1(0, 0, 0);
57 axisXActor->SetPoint2(10, 0, 0);
58 axisXActor->SetTitle(
"X Axis");
59 axisXActor->SetBounds(0, 10, 0, 0, 0, 0);
60 axisXActor->SetTickLocationToBoth();
61 axisXActor->SetAxisTypeToX();
62 axisXActor->SetRange(0, 10);
63 axisXActor->SetLabels(labels);
64 axisXActor->SetDeltaRangeMajor(2);
65 axisXActor->SetDeltaRangeMinor(0.5);
66 axisXActor->SetExponent(
"+00");
67 axisXActor->SetExponentVisibility(
true);
68 axisXActor->SetTitleScale(0.8);
69 axisXActor->SetLabelScale(0.5);
70 axisXActor->SetTitleOffset(0, 3);
71 axisXActor->SetExponentOffset(3);
72 axisXActor->SetLabelOffset(5);
73 axisXActor->SetTitleTextProperty(textProp1);
74 axisXActor->SetLabelTextProperty(textProp2);
75 axisXActor->SetAxisMainLineProperty(prop1);
76 axisXActor->SetAxisMajorTicksProperty(prop2);
77 axisXActor->SetAxisMinorTicksProperty(prop3);
81 axisYActor->SetUse2DMode(use2dMode);
82 axisYActor->SetUseTextActor3D(use3dProp);
83 axisYActor->GetProperty()->SetAmbient(1);
84 axisYActor->GetProperty()->SetDiffuse(0);
85 axisYActor->SetPoint1(0, 0, 0);
86 axisYActor->SetPoint2(0, 10, 0);
87 axisYActor->SetTitle(
"Y Axis");
88 axisYActor->SetBounds(0, 0, 0, 10, 0, 0);
89 axisYActor->SetTickLocationToInside();
90 axisYActor->SetAxisTypeToY();
91 axisYActor->SetRange(0.1, 500);
92 axisYActor->SetMajorRangeStart(0.1);
93 axisYActor->SetMinorRangeStart(0.1);
94 axisYActor->SetMinorTicksVisible(
true);
96 axisYActor->SetExponent(
"+00");
97 axisYActor->SetExponentVisibility(
true);
99 axisYActor->SetTitleScale(0.8);
100 axisYActor->SetLabelScale(0.5);
101 axisYActor->SetTitleOffset(0, 3);
102 axisYActor->SetExponentOffset(5);
103 axisYActor->SetLabelOffset(5);
104 axisYActor->SetTitleTextProperty(textProp2);
105 axisYActor->SetLog(
true);
106 axisYActor->SetAxisLinesProperty(prop1);
110 axisZActor->SetUse2DMode(use2dMode);
111 axisZActor->SetUseTextActor3D(use3dProp);
112 axisZActor->GetProperty()->SetAmbient(1);
113 axisZActor->GetProperty()->SetDiffuse(0);
114 axisZActor->SetPoint1(0, 0, 0);
115 axisZActor->SetPoint2(0, 0, 10);
116 axisZActor->SetTitle(
"Z Axis");
117 axisZActor->SetBounds(0, 0, 0, 0, 0, 10);
118 axisZActor->SetTickLocationToOutside();
119 axisZActor->SetAxisTypeToZ();
120 axisZActor->SetRange(0, 10);
122 axisZActor->SetExponent(
"+00");
123 axisZActor->SetExponentVisibility(
true);
125 axisZActor->SetTitleScale(0.8);
126 axisZActor->SetLabelScale(0.5);
127 axisZActor->SetTitleOffset(0, 3);
128 axisZActor->SetExponentOffset(3);
129 axisZActor->SetLabelOffset(5);
130 axisZActor->SetTitleTextProperty(textProp3);
131 axisZActor->SetMajorTickSize(3);
132 axisZActor->SetMinorTickSize(1);
133 axisZActor->SetDeltaRangeMajor(2);
134 axisZActor->SetDeltaRangeMinor(0.1);
138 renderWindow->AddRenderer(renderer);
140 renderWindowInteractor->SetRenderWindow(renderWindow);
141 renderer->AddActor(axisXActor);
142 renderer->AddActor(axisYActor);
143 renderer->AddActor(axisZActor);
144 renderer->SetBackground(.5, .5, .5);
146 vtkCamera* camera = renderer->GetActiveCamera();
147 axisXActor->SetCamera(camera);
148 axisYActor->SetCamera(camera);
149 axisZActor->SetCamera(camera);
150 renderWindow->SetSize(300, 300);
155 renderWindow->SetMultiSamples(0);
156 renderWindow->Render();
157 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.