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
phcerdan
VTK-m
Commits
7906e89e
Commit
7906e89e
authored
Apr 03, 2018
by
James Kress
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updating leak fix to use uniq_ptr.
parent
70c50f72
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
20 additions
and
29 deletions
+20
-29
vtkm/rendering/AxisAnnotation2D.cxx
vtkm/rendering/AxisAnnotation2D.cxx
+6
-8
vtkm/rendering/AxisAnnotation2D.h
vtkm/rendering/AxisAnnotation2D.h
+2
-1
vtkm/rendering/AxisAnnotation3D.cxx
vtkm/rendering/AxisAnnotation3D.cxx
+6
-10
vtkm/rendering/AxisAnnotation3D.h
vtkm/rendering/AxisAnnotation3D.h
+1
-1
vtkm/rendering/ColorLegendAnnotation.cxx
vtkm/rendering/ColorLegendAnnotation.cxx
+4
-8
vtkm/rendering/ColorLegendAnnotation.h
vtkm/rendering/ColorLegendAnnotation.h
+1
-1
No files found.
vtkm/rendering/AxisAnnotation2D.cxx
View file @
7906e89e
...
...
@@ -43,11 +43,6 @@ AxisAnnotation2D::AxisAnnotation2D()
AxisAnnotation2D
::~
AxisAnnotation2D
()
{
for
(
int
i
=
0
;
i
<
Labels
.
size
();
i
++
)
{
delete
Labels
[
i
];
}
Labels
.
clear
();
}
void
AxisAnnotation2D
::
SetRangeForAutoTicks
(
const
Range
&
range
)
...
...
@@ -104,8 +99,9 @@ void AxisAnnotation2D::Render(const vtkm::rendering::Camera& camera,
unsigned
int
nmajor
=
(
unsigned
int
)
this
->
ProportionsMajor
.
size
();
while
(
this
->
Labels
.
size
()
<
nmajor
)
{
this
->
Labels
.
push_back
(
new
vtkm
::
rendering
::
TextAnnotationScreen
(
"test"
,
this
->
Color
,
this
->
FontScale
,
vtkm
::
Vec
<
vtkm
::
Float32
,
2
>
(
0
,
0
),
0
));
this
->
Labels
.
push_back
(
std
::
move
(
std
::
unique_ptr
<
TextAnnotation
>
(
new
vtkm
::
rendering
::
TextAnnotationScreen
(
"test"
,
this
->
Color
,
this
->
FontScale
,
vtkm
::
Vec
<
vtkm
::
Float32
,
2
>
(
0
,
0
),
0
))));
}
std
::
stringstream
numberToString
;
...
...
@@ -132,7 +128,9 @@ void AxisAnnotation2D::Render(const vtkm::rendering::Camera& camera,
this
->
Labels
[
i
]
->
SetText
(
numberToString
.
str
());
//if (fabs(this->PositionsMajor[i]) < 1e-10)
// this->Labels[i]->SetText("0");
((
TextAnnotationScreen
*
)(
this
->
Labels
[
i
]))
->
SetPosition
(
vtkm
::
Float32
(
xs
),
vtkm
::
Float32
(
ys
));
TextAnnotation
*
tempBase
=
this
->
Labels
[
i
].
get
();
TextAnnotationScreen
*
tempDerived
=
static_cast
<
TextAnnotationScreen
*>
(
tempBase
);
tempDerived
->
SetPosition
(
vtkm
::
Float32
(
xs
),
vtkm
::
Float32
(
ys
));
this
->
Labels
[
i
]
->
SetAlignment
(
this
->
AlignH
,
this
->
AlignV
);
}
...
...
vtkm/rendering/AxisAnnotation2D.h
View file @
7906e89e
...
...
@@ -50,7 +50,8 @@ protected:
TextAnnotation
::
HorizontalAlignment
AlignH
;
TextAnnotation
::
VerticalAlignment
AlignV
;
std
::
vector
<
TextAnnotation
*>
Labels
;
std
::
vector
<
std
::
unique_ptr
<
TextAnnotation
>>
Labels
;
// std::vector<TextAnnotation*> Labels;
std
::
vector
<
vtkm
::
Float64
>
PositionsMajor
;
std
::
vector
<
vtkm
::
Float64
>
ProportionsMajor
;
...
...
vtkm/rendering/AxisAnnotation3D.cxx
View file @
7906e89e
...
...
@@ -48,11 +48,6 @@ AxisAnnotation3D::AxisAnnotation3D()
AxisAnnotation3D
::~
AxisAnnotation3D
()
{
for
(
int
i
=
0
;
i
<
Labels
.
size
();
i
++
)
{
delete
Labels
[
i
];
}
Labels
.
clear
();
}
void
AxisAnnotation3D
::
SetTickInvert
(
bool
x
,
bool
y
,
bool
z
)
...
...
@@ -85,11 +80,12 @@ void AxisAnnotation3D::Render(const Camera& camera,
unsigned
int
nmajor
=
(
unsigned
int
)
proportions
.
size
();
while
(
this
->
Labels
.
size
()
<
nmajor
)
{
this
->
Labels
.
push_back
(
new
TextAnnotationBillboard
(
"test"
,
this
->
Color
,
vtkm
::
Float32
(
this
->
FontScale
),
vtkm
::
Vec
<
vtkm
::
Float32
,
3
>
(
0
,
0
,
0
),
0
));
this
->
Labels
.
push_back
(
std
::
move
(
std
::
unique_ptr
<
TextAnnotationBillboard
>
(
new
vtkm
::
rendering
::
TextAnnotationBillboard
(
"test"
,
this
->
Color
,
vtkm
::
Float32
(
this
->
FontScale
),
vtkm
::
Vec
<
vtkm
::
Float32
,
3
>
(
0
,
0
,
0
),
0
))));
}
std
::
stringstream
numberToString
;
...
...
vtkm/rendering/AxisAnnotation3D.h
View file @
7906e89e
...
...
@@ -53,7 +53,7 @@ protected:
vtkm
::
Float32
FontOffset
;
vtkm
::
Float32
LineWidth
;
vtkm
::
rendering
::
Color
Color
;
std
::
vector
<
TextAnnotationBillboard
*
>
Labels
;
std
::
vector
<
std
::
unique_ptr
<
TextAnnotationBillboard
>
>
Labels
;
int
MoreOrLessTickAdjustment
;
public:
...
...
vtkm/rendering/ColorLegendAnnotation.cxx
View file @
7906e89e
...
...
@@ -33,11 +33,6 @@ ColorLegendAnnotation::ColorLegendAnnotation()
ColorLegendAnnotation
::~
ColorLegendAnnotation
()
{
for
(
int
i
=
0
;
i
<
Annot
.
size
();
i
++
)
{
delete
Annot
[
i
];
}
Annot
.
clear
();
}
void
ColorLegendAnnotation
::
Clear
()
...
...
@@ -74,13 +69,14 @@ void ColorLegendAnnotation::Render(const vtkm::rendering::Camera& camera,
while
(
this
->
Annot
.
size
()
<
this
->
Labels
.
size
())
{
this
->
Annot
.
push_back
(
new
vtkm
::
rendering
::
TextAnnotationScreen
(
"test"
,
this
->
LabelColor
,
this
->
FontScale
,
vtkm
::
Vec
<
vtkm
::
Float32
,
2
>
(
0
,
0
),
0
));
this
->
Annot
.
push_back
(
std
::
move
(
std
::
unique_ptr
<
TextAnnotationScreen
>
(
new
vtkm
::
rendering
::
TextAnnotationScreen
(
"test"
,
this
->
LabelColor
,
this
->
FontScale
,
vtkm
::
Vec
<
vtkm
::
Float32
,
2
>
(
0
,
0
),
0
))));
}
for
(
unsigned
int
i
=
0
;
i
<
this
->
Annot
.
size
();
++
i
)
{
TextAnnotationScreen
*
txt
=
Annot
[
i
];
TextAnnotationScreen
*
txt
=
Annot
[
i
]
.
get
()
;
txt
->
SetText
(
Labels
[
i
]);
txt
->
SetPosition
(
r
+
.02
f
,
(
b
+
t
)
/
2.
f
);
txt
->
SetAlignment
(
TextAnnotationScreen
::
Left
,
TextAnnotationScreen
::
VCenter
);
...
...
vtkm/rendering/ColorLegendAnnotation.h
View file @
7906e89e
...
...
@@ -39,7 +39,7 @@ private:
vtkm
::
Float32
FontScale
;
vtkm
::
rendering
::
Color
LabelColor
;
std
::
vector
<
std
::
string
>
Labels
;
std
::
vector
<
TextAnnotationScreen
*
>
Annot
;
std
::
vector
<
std
::
unique_ptr
<
TextAnnotationScreen
>
>
Annot
;
std
::
vector
<
vtkm
::
rendering
::
Color
>
ColorSwatchList
;
public:
...
...
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