Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Christian Butz
VTK
Commits
d4aedeca
Commit
d4aedeca
authored
Dec 03, 2011
by
Philippe Pébay
Browse files
Factorized radial axis creation (not build)
Change-Id: I45b8c59653cb097a1285c832a3554d717e15b19b
parent
1fb5f574
Changes
2
Hide whitespace changes
Inline
Side-by-side
Hybrid/vtkPolarAxesActor.cxx
View file @
d4aedeca
...
...
@@ -203,25 +203,7 @@ vtkPolarAxesActor::vtkPolarAxesActor() : vtkActor()
this
->
RadialAxesProperty
->
SetColor
(
0.
,
0.
,
0.
);
// Create and set radial axes of type X
this
->
RadialAxes
=
new
vtkAxisActor
*
[
this
->
NumberOfRadialAxes
];
for
(
int
i
=
0
;
i
<
this
->
NumberOfRadialAxes
;
++
i
)
{
// Create axis of type X
this
->
RadialAxes
[
i
]
=
vtkAxisActor
::
New
();
vtkAxisActor
*
axis
=
this
->
RadialAxes
[
i
];
axis
->
SetAxisTypeToX
();
axis
->
SetAxisPositionToMinMax
();
axis
->
SetCalculateTitleOffset
(
0
);
axis
->
SetCalculateLabelOffset
(
0
);
// Set radial axis title follower
axis
->
GetTitleActor
()
->
SetAxis
(
axis
);
axis
->
GetTitleActor
()
->
SetScreenOffset
(
.67
*
offset
);
axis
->
GetTitleActor
()
->
SetEnableDistanceLOD
(
this
->
EnableDistanceLOD
);
axis
->
GetTitleActor
()
->
SetDistanceLODThreshold
(
this
->
DistanceLODThreshold
);
axis
->
GetTitleActor
()
->
SetEnableViewAngleLOD
(
this
->
EnableViewAngleLOD
);
axis
->
GetTitleActor
()
->
SetViewAngleLODThreshold
(
this
->
ViewAngleLODThreshold
);
}
// for ( int i = 0; i < this->NumberOfRadialAxes; ++ i )
this
->
CreateRadialAxes
(
offset
);
// Create and set polar arcs and ancillary objects, with default color white
this
->
PolarArcs
=
vtkPolyData
::
New
();
...
...
@@ -668,6 +650,30 @@ inline double vtkPolarAxesActor::FSign( double value, double sign )
return
value
;
}
//-----------------------------------------------------------------------------
void
vtkPolarAxesActor
::
CreateRadialAxes
(
double
offset
)
{
this
->
RadialAxes
=
new
vtkAxisActor
*
[
this
->
NumberOfRadialAxes
];
for
(
int
i
=
0
;
i
<
this
->
NumberOfRadialAxes
;
++
i
)
{
// Create axis of type X
this
->
RadialAxes
[
i
]
=
vtkAxisActor
::
New
();
vtkAxisActor
*
axis
=
this
->
RadialAxes
[
i
];
axis
->
SetAxisTypeToX
();
axis
->
SetAxisPositionToMinMax
();
axis
->
SetCalculateTitleOffset
(
0
);
axis
->
SetCalculateLabelOffset
(
0
);
// Set radial axis title follower
axis
->
GetTitleActor
()
->
SetAxis
(
axis
);
axis
->
GetTitleActor
()
->
SetScreenOffset
(
.67
*
offset
);
axis
->
GetTitleActor
()
->
SetEnableDistanceLOD
(
this
->
EnableDistanceLOD
);
axis
->
GetTitleActor
()
->
SetDistanceLODThreshold
(
this
->
DistanceLODThreshold
);
axis
->
GetTitleActor
()
->
SetEnableViewAngleLOD
(
this
->
EnableViewAngleLOD
);
axis
->
GetTitleActor
()
->
SetViewAngleLODThreshold
(
this
->
ViewAngleLODThreshold
);
}
// for ( int i = 0; i < this->NumberOfRadialAxes; ++ i )
}
//-----------------------------------------------------------------------------
void
vtkPolarAxesActor
::
BuildRadialAxes
()
{
...
...
@@ -985,25 +991,8 @@ void vtkPolarAxesActor::SetNumberOfRadialAxes( vtkIdType n )
// Create and set n radial axes of type X
this
->
NumberOfRadialAxes
=
n
;
this
->
RadialAxes
=
new
vtkAxisActor
*
[
this
->
NumberOfRadialAxes
];
for
(
int
i
=
0
;
i
<
this
->
NumberOfRadialAxes
;
++
i
)
{
// Create axis of type X
this
->
RadialAxes
[
i
]
=
vtkAxisActor
::
New
();
vtkAxisActor
*
axis
=
this
->
RadialAxes
[
i
];
axis
->
SetAxisTypeToX
();
axis
->
SetAxisPositionToMinMax
();
axis
->
SetCalculateTitleOffset
(
0
);
axis
->
SetCalculateLabelOffset
(
0
);
// Set radial axis title follower
axis
->
GetTitleActor
()
->
SetAxis
(
axis
);
axis
->
GetTitleActor
()
->
SetScreenOffset
(
.67
*
this
->
LabelScreenOffset
+
this
->
ScreenSize
*
0.5
);
axis
->
GetTitleActor
()
->
SetEnableDistanceLOD
(
this
->
EnableDistanceLOD
);
axis
->
GetTitleActor
()
->
SetDistanceLODThreshold
(
this
->
DistanceLODThreshold
);
axis
->
GetTitleActor
()
->
SetEnableViewAngleLOD
(
this
->
EnableViewAngleLOD
);
axis
->
GetTitleActor
()
->
SetViewAngleLODThreshold
(
this
->
ViewAngleLODThreshold
);
}
// for ( int i = 0; i < this->NumberOfRadialAxes; ++ i )
double
offset
=
this
->
LabelScreenOffset
+
this
->
ScreenSize
*
0.5
;
this
->
CreateRadialAxes
(
offset
);
this
->
Modified
();
}
...
...
Hybrid/vtkPolarAxesActor.h
View file @
d4aedeca
...
...
@@ -263,6 +263,10 @@ protected:
// Send attributes which are common to all axes, both polar and radial
void
SetCommonAxisAttributes
(
vtkAxisActor
*
);
// Description:
// Create requested number of type X axes and set followers
void
CreateRadialAxes
(
double
);
// Description:
// Build requested number of radial axes with respect to specified pole.
void
BuildRadialAxes
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment