Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VTK
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
debian
VTK
Commits
c7ebe5bc
Commit
c7ebe5bc
authored
9 years ago
by
T.J. Corona
Browse files
Options
Downloads
Patches
Plain Diff
vtkDataArrayTemplate: Add a safe method to change an element with vtkVariant.
This fix is in reference to bug report 0013143.
parent
2e0acc8d
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Common/Core/vtkDataArrayTemplate.h
+4
-0
4 additions, 0 deletions
Common/Core/vtkDataArrayTemplate.h
Common/Core/vtkDataArrayTemplate.txx
+16
-0
16 additions, 0 deletions
Common/Core/vtkDataArrayTemplate.txx
with
20 additions
and
0 deletions
Common/Core/vtkDataArrayTemplate.h
+
4
−
0
View file @
c7ebe5bc
...
...
@@ -212,6 +212,10 @@ public:
// Set a value in the array from a vtkVariant.
void
SetVariantValue
(
vtkIdType
id
,
vtkVariant
value
);
// Description:
// Insert a value in the array from a vtkVariant.
void
InsertVariantValue
(
vtkIdType
id
,
vtkVariant
value
);
// Description:
// Insert data at the end of the array. Return its location in the array.
vtkIdType
InsertNextValue
(
T
f
);
...
...
This diff is collapsed.
Click to expand it.
Common/Core/vtkDataArrayTemplate.txx
+
16
−
0
View file @
c7ebe5bc
...
...
@@ -979,6 +979,22 @@ void vtkDataArrayTemplate<T>::SetVariantValue(vtkIdType id, vtkVariant value)
}
}
//----------------------------------------------------------------------------
template <class T>
void vtkDataArrayTemplate<T>::InsertVariantValue(vtkIdType id, vtkVariant value)
{
bool valid;
T toInsert = vtkVariantCast<T>(value, &valid);
if (valid)
{
this->InsertValue(id, toInsert);
}
else
{
vtkErrorMacro("unable to set value of type " << value.GetType());
}
}
//----------------------------------------------------------------------------
template <class T>
vtkIdType vtkDataArrayTemplate<T>::InsertNextValue(T f)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment