Skip to content
GitLab
Menu
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
a9dd3cda
Commit
a9dd3cda
authored
Nov 15, 2011
by
Philippe Pébay
Browse files
Now properly setting ambient and diffuse values for labels and titles
Change-Id: I65b0a6b749c8a83971f99434c0c2d26f6c619839
parent
573ec999
Changes
1
Hide whitespace changes
Inline
Side-by-side
Hybrid/vtkAxisActor.cxx
View file @
a9dd3cda
...
@@ -71,13 +71,12 @@ vtkAxisActor::vtkAxisActor()
...
@@ -71,13 +71,12 @@ vtkAxisActor::vtkAxisActor()
this
->
LabelFormat
=
new
char
[
8
];
this
->
LabelFormat
=
new
char
[
8
];
sprintf
(
this
->
LabelFormat
,
"%s"
,
"%-#6.3g"
);
sprintf
(
this
->
LabelFormat
,
"%s"
,
"%-#6.3g"
);
// stuff for 2D axis
this
->
Use2DMode
=
0
;
this
->
Use2DMode
=
0
;
this
->
SaveTitlePosition
=
0
;
this
->
SaveTitlePosition
=
0
;
this
->
TitleConstantPosition
[
0
]
=
this
->
TitleConstantPosition
[
1
]
=
0.0
;
this
->
TitleConstantPosition
[
0
]
=
this
->
TitleConstantPosition
[
1
]
=
0.0
;
this
->
TitleTextProperty
=
vtkTextProperty
::
New
();
this
->
TitleTextProperty
=
vtkTextProperty
::
New
();
this
->
TitleTextProperty
->
SetColor
(
1
.
,
1
.
,
1
.
);
this
->
TitleTextProperty
->
SetColor
(
0
.
,
0
.
,
0
.
);
this
->
TitleTextProperty
->
SetFontFamilyToArial
();
this
->
TitleTextProperty
->
SetFontFamilyToArial
();
this
->
TitleVector
=
vtkVectorText
::
New
();
this
->
TitleVector
=
vtkVectorText
::
New
();
...
@@ -86,10 +85,8 @@ vtkAxisActor::vtkAxisActor()
...
@@ -86,10 +85,8 @@ vtkAxisActor::vtkAxisActor()
this
->
TitleActor
=
vtkAxisFollower
::
New
();
this
->
TitleActor
=
vtkAxisFollower
::
New
();
this
->
TitleActor
->
SetMapper
(
this
->
TitleMapper
);
this
->
TitleActor
->
SetMapper
(
this
->
TitleMapper
);
this
->
TitleActor
->
SetEnableDistanceLOD
(
0
);
this
->
TitleActor
->
SetEnableDistanceLOD
(
0
);
this
->
TitleActor
->
GetProperty
()
->
SetColor
(
this
->
TitleTextProperty
->
GetColor
());
this
->
TitleActor2D
=
vtkTextActor
::
New
();
this
->
TitleActor2D
=
vtkTextActor
::
New
();
// to avoid deleting/rebuilding create once up front
this
->
NumberOfLabelsBuilt
=
0
;
this
->
NumberOfLabelsBuilt
=
0
;
this
->
LabelVectors
=
NULL
;
this
->
LabelVectors
=
NULL
;
this
->
LabelMappers
=
NULL
;
this
->
LabelMappers
=
NULL
;
...
@@ -97,7 +94,7 @@ vtkAxisActor::vtkAxisActor()
...
@@ -97,7 +94,7 @@ vtkAxisActor::vtkAxisActor()
this
->
LabelActors2D
=
NULL
;
this
->
LabelActors2D
=
NULL
;
this
->
LabelTextProperty
=
vtkTextProperty
::
New
();
this
->
LabelTextProperty
=
vtkTextProperty
::
New
();
this
->
LabelTextProperty
->
SetColor
(
1
.
,
1
.
,
1
.
);
this
->
LabelTextProperty
->
SetColor
(
0
.
,
0
.
,
0
.
);
this
->
LabelTextProperty
->
SetFontFamilyToArial
();
this
->
LabelTextProperty
->
SetFontFamilyToArial
();
this
->
AxisLines
=
vtkPolyData
::
New
();
this
->
AxisLines
=
vtkPolyData
::
New
();
...
@@ -575,6 +572,13 @@ void vtkAxisActor::BuildAxis(vtkViewport *viewport, bool force)
...
@@ -575,6 +572,13 @@ void vtkAxisActor::BuildAxis(vtkViewport *viewport, bool force)
vtkDebugMacro
(
<<
"Rebuilding axis"
);
vtkDebugMacro
(
<<
"Rebuilding axis"
);
if
(
force
||
this
->
GetProperty
()
->
GetMTime
()
>
this
->
BuildTime
.
GetMTime
())
{
//this->AxisLinesActor->SetProperty(this->GetProperty());
this
->
TitleActor
->
SetProperty
(
this
->
GetProperty
());
this
->
TitleActor
->
GetProperty
()
->
SetColor
(
this
->
TitleTextProperty
->
GetColor
());
}
//
//
// Generate the axis and tick marks.
// Generate the axis and tick marks.
//
//
...
@@ -1175,6 +1179,8 @@ void vtkAxisActor::SetLabels(vtkStringArray *labels)
...
@@ -1175,6 +1179,8 @@ void vtkAxisActor::SetLabels(vtkStringArray *labels)
this
->
LabelActors
[
i
]
=
vtkAxisFollower
::
New
();
this
->
LabelActors
[
i
]
=
vtkAxisFollower
::
New
();
this
->
LabelActors
[
i
]
->
SetMapper
(
this
->
LabelMappers
[
i
]);
this
->
LabelActors
[
i
]
->
SetMapper
(
this
->
LabelMappers
[
i
]);
this
->
LabelActors
[
i
]
->
SetEnableDistanceLOD
(
0
);
this
->
LabelActors
[
i
]
->
SetEnableDistanceLOD
(
0
);
this
->
LabelActors
[
i
]
->
GetProperty
()
->
SetAmbient
(
1.
);
this
->
LabelActors
[
i
]
->
GetProperty
()
->
SetDiffuse
(
0.
);
this
->
LabelActors
[
i
]
->
GetProperty
()
->
SetColor
(
this
->
LabelTextProperty
->
GetColor
());
this
->
LabelActors
[
i
]
->
GetProperty
()
->
SetColor
(
this
->
LabelTextProperty
->
GetColor
());
this
->
LabelActors2D
[
i
]
=
vtkTextActor
::
New
();
this
->
LabelActors2D
[
i
]
=
vtkTextActor
::
New
();
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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