Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Sudhanshu Sane
VTK-m
Commits
f01fd68b
Commit
f01fd68b
authored
Mar 14, 2016
by
Robert Maynard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DataSetBuilderUniform now builds when the float default is double.
parent
5b6676d2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
10 deletions
+13
-10
vtkm/cont/DataSetBuilderUniform.h
vtkm/cont/DataSetBuilderUniform.h
+13
-10
No files found.
vtkm/cont/DataSetBuilderUniform.h
View file @
f01fd68b
...
...
@@ -42,10 +42,12 @@ public:
const
vtkm
::
Vec
<
vtkm
::
FloatDefault
,
2
>
&
spacing
=
vtkm
::
Vec
<
vtkm
::
FloatDefault
,
2
>
(
1.0
f
),
std
::
string
coordNm
=
"coords"
,
std
::
string
cellNm
=
"cells"
)
{
vtkm
::
Vec
<
vtkm
::
FloatDefault
,
3
>
origin3d
(
origin
[
0
],
origin
[
1
],
0.0
f
);
vtkm
::
Vec
<
vtkm
::
FloatDefault
,
3
>
spacing3d
(
spacing
[
0
],
spacing
[
1
],
1.0
f
);
return
DataSetBuilderUniform
::
CreateDS
(
2
,
dimensions
[
0
],
dimensions
[
1
],
1
,
origin
[
0
],
origin
[
1
],
0.0
f
,
spacing
[
0
],
spacing
[
1
],
1.0
f
,
origin
3d
,
spacing
3d
,
coordNm
,
cellNm
);
}
...
...
@@ -61,29 +63,30 @@ public:
return
DataSetBuilderUniform
::
CreateDS
(
3
,
dimensions
[
0
],
dimensions
[
1
],
dimensions
[
2
],
origin
[
0
],
origin
[
1
],
origin
[
2
]
,
spacing
[
0
],
spacing
[
1
],
spacing
[
2
]
,
origin
,
spacing
,
coordNm
,
cellNm
);
}
private:
template
<
typename
T
>
VTKM_CONT_EXPORT
static
vtkm
::
cont
::
DataSet
CreateDS
(
int
dim
,
vtkm
::
Id
nx
,
vtkm
::
Id
ny
,
vtkm
::
Id
nz
,
T
originX
,
T
originY
,
T
origin
Z
,
T
spacingX
,
T
spacingY
,
T
spacing
Z
,
const
vtkm
::
Vec
<
vtkm
::
FloatDefault
,
3
>
&
origin
,
const
vtkm
::
Vec
<
vtkm
::
FloatDefault
,
3
>
&
spacing
,
std
::
string
coordNm
,
std
::
string
cellNm
)
{
VTKM_ASSERT_CONT
(
nx
>
1
&&
ny
>
1
&&
((
dim
==
2
&&
nz
==
1
)
||
(
dim
==
3
&&
nz
>=
1
)));
VTKM_ASSERT_CONT
(
spacing
X
>
0
&&
spacing
Y
>
0
&&
spacing
Z
>
0
);
VTKM_ASSERT_CONT
(
spacing
[
0
]
>
0
&&
spacing
[
1
]
>
0
&&
spacing
[
2
]
>
0
);
vtkm
::
cont
::
DataSet
dataSet
;
vtkm
::
cont
::
ArrayHandleUniformPointCoordinates
coords
(
vtkm
::
Id3
(
nx
,
ny
,
nz
),
vtkm
::
Vec
<
T
,
3
>
(
originX
,
originY
,
originZ
),
vtkm
::
Vec
<
T
,
3
>
(
spacingX
,
spacingY
,
spacingZ
));
origin
,
spacing
);
vtkm
::
cont
::
CoordinateSystem
cs
(
coordNm
,
1
,
coords
);
dataSet
.
AddCoordinateSystem
(
cs
);
...
...
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