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
8b50d474
Commit
8b50d474
authored
Dec 03, 2011
by
Philippe Pébay
Browse files
Changed execution flow to allow subtle change in polar axis behavior
Change-Id: I06723e1bbbb6a089ad6dac9462daa74d87537a5c
parent
53d1549d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Examples/Hybrid/Python/CylinderAndPolarAxes.py
View file @
8b50d474
...
...
@@ -45,8 +45,8 @@ polaxes.SetMaximumRadius( 4.5 )
polaxes
.
SetMinimumAngle
(
-
60.
)
polaxes
.
SetMaximumAngle
(
210.
)
polaxes
.
SetNumberOfRadialAxes
(
10
)
polaxes
.
SetNumberOfPolarAxisTicks
(
9
)
polaxes
.
AutoSubdividePolarAxisOff
()
polaxes
.
SetNumberOfPolarAxisTicks
(
8
)
polaxes
.
SetCamera
(
renderer
.
GetActiveCamera
()
)
polaxes
.
SetPolarLabelFormat
(
"%6.1f"
)
polaxes
.
GetRadialAxesProperty
().
SetColor
(
.
0
,
.
0
,
1.
)
...
...
@@ -73,6 +73,7 @@ interactor.SetRenderWindow( window )
# Start interaction
window
.
Render
()
polaxes
.
AutoSubdividePolarAxisOn
()
polaxes
.
SetMinimumAngle
(
60.
)
polaxes
.
SetNumberOfPolarAxisTicks
(
12
)
interactor
.
Start
()
Hybrid/vtkAxisActor.cxx
View file @
8b50d474
...
...
@@ -607,18 +607,18 @@ vtkAxisActor::BuildLabels(vtkViewport *viewport, bool force)
{
return
;
}
for
(
int
i
=
0
;
i
<
this
->
NumberOfLabelsBuilt
;
i
++
)
{
this
->
LabelActors
[
i
]
->
SetCamera
(
this
->
Camera
);
this
->
LabelActors
[
i
]
->
GetProperty
()
->
SetColor
(
this
->
LabelTextProperty
->
GetColor
());
if
(
!
this
->
GetCalculateLabelOffset
())
{
this
->
LabelActors
[
i
]
->
SetAutoCenter
(
1
);
}
}
if
(
force
||
this
->
BuildTime
.
GetMTime
()
<
this
->
BoundsTime
.
GetMTime
()
||
this
->
AxisPosition
!=
this
->
LastAxisPosition
||
this
->
LastRange
[
0
]
!=
this
->
Range
[
0
]
||
...
...
Hybrid/vtkPolarAxesActor.cxx
View file @
8b50d474
...
...
@@ -324,29 +324,16 @@ vtkPolarAxesActor::~vtkPolarAxesActor()
int
vtkPolarAxesActor
::
RenderOpaqueGeometry
(
vtkViewport
*
viewport
)
{
// Initialization
static
bool
initialRender
=
true
;
int
renderedSomething
=
0
;
if
(
!
this
->
Camera
)
{
vtkErrorMacro
(
<<
"No camera!"
);
this
->
RenderSomething
=
0
;
return
0
;
return
renderedSomething
;
}
this
->
BuildAxes
(
viewport
);
if
(
initialRender
)
{
this
->
PolarAxis
->
BuildAxis
(
viewport
,
true
);
for
(
int
i
=
0
;
i
<
this
->
NumberOfRadialAxes
;
++
i
)
{
this
->
RadialAxes
[
i
]
->
BuildAxis
(
viewport
,
true
);
}
}
initialRender
=
false
;
int
renderedSomething
=
0
;
// Render the polar axis
if
(
this
->
PolarAxisVisibility
)
{
...
...
@@ -608,6 +595,9 @@ void vtkPolarAxesActor::BuildAxes( vtkViewport *viewport )
// Build polar axis labels
this
->
BuildPolarAxisLabelsArcs
();
// Build polar axis
this
->
PolarAxis
->
BuildAxis
(
viewport
,
true
);
// Scale appropriately
this
->
AutoScale
(
viewport
);
...
...
@@ -842,9 +832,10 @@ void vtkPolarAxesActor::BuildPolarAxisLabelsArcs()
sprintf
(
label
,
format
,
value
);
labels
->
SetValue
(
i
,
label
);
// Build polar arcs for non-zero values
if
(
value
>
0.
)
{
//
Build corresponding polar arc for non-zero value
s
//
Compute and set polar arc parameter
s
double
x1
=
value
*
cosThetaMin
;
double
y1
=
value
*
sinThetaMin
;
double
x2
=
value
*
cosThetaMax
;
...
...
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