Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Aron Helser
VTK
Commits
a279244d
Commit
a279244d
authored
Oct 07, 2016
by
David C. Lonie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a display-coordinate offset to billboard text.
parent
7d78fea8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletion
+20
-1
Rendering/Core/vtkBillboardTextActor3D.cxx
Rendering/Core/vtkBillboardTextActor3D.cxx
+8
-1
Rendering/Core/vtkBillboardTextActor3D.h
Rendering/Core/vtkBillboardTextActor3D.h
+12
-0
No files found.
Rendering/Core/vtkBillboardTextActor3D.cxx
View file @
a279244d
...
...
@@ -210,7 +210,9 @@ void vtkBillboardTextActor3D::PrintSelf(std::ostream &os, vtkIndent indent)
<<
indent
<<
"InputMTime: "
<<
this
->
InputMTime
<<
"
\n
"
<<
indent
<<
"TextRenderer: "
<<
this
->
TextRenderer
.
Get
()
<<
"
\n
"
<<
indent
<<
"AnchorDC: "
<<
this
->
AnchorDC
[
0
]
<<
" "
<<
this
->
AnchorDC
[
1
]
<<
" "
<<
this
->
AnchorDC
[
2
]
<<
"
\n
"
;
<<
" "
<<
this
->
AnchorDC
[
2
]
<<
"
\n
"
<<
indent
<<
"DisplayOffset: "
<<
this
->
DisplayOffset
[
0
]
<<
" "
<<
this
->
DisplayOffset
[
1
]
<<
"
\n
"
;
os
<<
indent
<<
"Image:
\n
"
;
this
->
Image
->
PrintSelf
(
os
,
indent
.
GetNextIndent
());
...
...
@@ -337,6 +339,7 @@ vtkBillboardTextActor3D::vtkBillboardTextActor3D()
RenderedDPI
(
-
1
)
{
std
::
fill
(
this
->
AnchorDC
,
this
->
AnchorDC
+
3
,
0.
);
std
::
fill
(
this
->
DisplayOffset
,
this
->
DisplayOffset
+
2
,
0
);
// Connect internal rendering pipeline:
this
->
Texture
->
InterpolateOff
();
...
...
@@ -481,6 +484,10 @@ void vtkBillboardTextActor3D::GenerateQuad(vtkRenderer *ren)
anchorDC
[
0
]
=
std
::
floor
(
anchorDC
[
0
]);
anchorDC
[
1
]
=
std
::
floor
(
anchorDC
[
1
]);
// Apply the requested offset:
anchorDC
[
0
]
+=
static_cast
<
double
>
(
this
->
DisplayOffset
[
0
]);
anchorDC
[
1
]
+=
static_cast
<
double
>
(
this
->
DisplayOffset
[
1
]);
// Cached for OpenGL2 GL2PS exports:
this
->
AnchorDC
[
0
]
=
anchorDC
[
0
];
this
->
AnchorDC
[
1
]
=
anchorDC
[
1
];
...
...
Rendering/Core/vtkBillboardTextActor3D.h
View file @
a279244d
...
...
@@ -48,6 +48,15 @@ public:
vtkGetStringMacro
(
Input
)
/** @} */
/**
* Can be used to set a fixed offset from the anchor point.
* Use display coordinates.
* @{
*/
vtkGetVector2Macro
(
DisplayOffset
,
int
)
vtkSetVector2Macro
(
DisplayOffset
,
int
)
/** @} */
/**
* The vtkTextProperty object that controls the rendered text.
* @{
...
...
@@ -105,6 +114,9 @@ protected:
char
*
Input
;
vtkTextProperty
*
TextProperty
;
// Offset in display coordinates.
int
DisplayOffset
[
2
];
// Cached metadata to determine if things need rebuildin'
int
RenderedDPI
;
vtkTimeStamp
InputMTime
;
...
...
Write
Preview
Markdown
is supported
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