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
Scott Wittenburg
VTK
Commits
0664ec35
Commit
0664ec35
authored
Dec 20, 2013
by
Berk Geveci
Committed by
Code Review
Dec 20, 2013
Browse files
Options
Browse Files
Download
Plain Diff
Merge topic 'dataset-surface-fix' into master
3978a87e
Fixed issue in filter leading to sanitizer errors.
parents
0dec660c
3978a87e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
3 deletions
+26
-3
Filters/Geometry/vtkDataSetSurfaceFilter.cxx
Filters/Geometry/vtkDataSetSurfaceFilter.cxx
+25
-2
Filters/Geometry/vtkDataSetSurfaceFilter.h
Filters/Geometry/vtkDataSetSurfaceFilter.h
+1
-1
No files found.
Filters/Geometry/vtkDataSetSurfaceFilter.cxx
View file @
0664ec35
...
...
@@ -52,8 +52,18 @@
static
inline
int
sizeofFastQuad
(
int
numPts
)
{
// account for size of ptArray
return
static_cast
<
int
>
(
sizeof
(
vtkFastGeomQuad
)
+
(
numPts
-
4
)
*
sizeof
(
vtkIdType
));
const
int
qsize
=
sizeof
(
vtkFastGeomQuad
);
const
int
sizeId
=
sizeof
(
vtkIdType
);
// If necessary, we create padding after vtkFastGeomQuad such that
// the beginning of ids aligns evenly with sizeof(vtkIdType).
if
(
qsize
%
sizeId
==
0
)
{
return
static_cast
<
int
>
(
qsize
+
numPts
*
sizeId
);
}
else
{
return
static_cast
<
int
>
((
qsize
/
sizeId
+
1
+
numPts
)
*
sizeId
);
}
}
class
vtkDataSetSurfaceFilter
::
vtkEdgeInterpolationMap
...
...
@@ -2315,6 +2325,19 @@ vtkFastGeomQuad* vtkDataSetSurfaceFilter::NewFastGeomQuad(int numPts)
(
this
->
FastGeomQuadArrays
[
this
->
NextArrayIndex
]
+
this
->
NextQuadIndex
);
q
->
numPts
=
numPts
;
const
int
qsize
=
sizeof
(
vtkFastGeomQuad
);
const
int
sizeId
=
sizeof
(
vtkIdType
);
// If necessary, we create padding after vtkFastGeomQuad such that
// the beginning of ids aligns evenly with sizeof(vtkIdType).
if
(
qsize
%
sizeId
==
0
)
{
q
->
ptArray
=
(
vtkIdType
*
)
q
+
qsize
/
sizeId
;
}
else
{
q
->
ptArray
=
(
vtkIdType
*
)
q
+
qsize
/
sizeId
+
1
;
}
this
->
NextQuadIndex
+=
polySize
;
return
q
;
...
...
Filters/Geometry/vtkDataSetSurfaceFilter.h
View file @
0664ec35
...
...
@@ -40,7 +40,7 @@ struct vtkFastGeomQuadStruct
struct
vtkFastGeomQuadStruct
*
Next
;
vtkIdType
SourceId
;
int
numPts
;
vtkIdType
ptArray
[
4
];
// actually a variable length array. MUST be last
vtkIdType
*
ptArray
;
};
typedef
struct
vtkFastGeomQuadStruct
vtkFastGeomQuad
;
//ETX
...
...
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