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
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Uwe Siems
VTK
Commits
743efb2d
Commit
743efb2d
authored
1 year ago
by
Spiros Tsalikis
Browse files
Options
Downloads
Patches
Plain Diff
vtkPeriodicDataArray: Support GetVoidPointer
This is needed by vtkWriter subclasses.
parent
c84dc8aa
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Common/DataModel/vtkPeriodicDataArray.h
+11
-4
11 additions, 4 deletions
Common/DataModel/vtkPeriodicDataArray.h
Common/DataModel/vtkPeriodicDataArray.txx
+18
-0
18 additions, 0 deletions
Common/DataModel/vtkPeriodicDataArray.txx
with
29 additions
and
4 deletions
Common/DataModel/vtkPeriodicDataArray.h
+
11
−
4
View file @
743efb2d
...
...
@@ -301,6 +301,12 @@ public:
vtkGetMacro
(
Normalize
,
bool
);
///@}
/**
* Use of this method is discouraged, it creates a memory copy of the data into
* a contiguous AoS-ordered buffer internally.
*/
void
*
GetVoidPointer
(
vtkIdType
valueIdx
)
override
;
protected:
vtkPeriodicDataArray
();
~
vtkPeriodicDataArray
()
override
;
...
...
@@ -361,10 +367,11 @@ private:
friend
class
vtkGenericDataArray
<
vtkPeriodicDataArray
<
Scalar
>
,
Scalar
>
;
Scalar
*
TempScalarArray
;
// Temporary array used by GetTypedTuple methods
double
*
TempDoubleArray
;
// Temporary array used by GetTuple vethods
vtkIdType
TempTupleIdx
;
// Location of currently stored Temp Tuple to use as cache
vtkAOSDataArrayTemplate
<
Scalar
>*
Data
;
// Original data
Scalar
*
TempScalarArray
;
// Temporary array used by GetTypedTuple methods
double
*
TempDoubleArray
;
// Temporary array used by GetTuple vethods
vtkIdType
TempTupleIdx
;
// Location of currently stored Temp Tuple to use as cache
vtkAOSDataArrayTemplate
<
Scalar
>*
Data
;
// Original data
vtkAOSDataArrayTemplate
<
Scalar
>*
Cache
;
// Only used by void pointer
bool
InvalidRange
=
true
;
double
PeriodicRange
[
6
];
// Transformed periodic range
...
...
This diff is collapsed.
Click to expand it.
Common/DataModel/vtkPeriodicDataArray.txx
+
18
−
0
View file @
743efb2d
...
...
@@ -683,6 +683,18 @@ void vtkPeriodicDataArray<Scalar>::InvalidateRange()
this->InvalidRange = true;
}
//------------------------------------------------------------------------------
template <class Scalar>
void* vtkPeriodicDataArray<Scalar>::GetVoidPointer(vtkIdType valueIdx)
{
if (!this->Cache)
{
this->Cache = vtkAOSDataArrayTemplate<Scalar>::New();
this->Cache->DeepCopy(this);
}
return this->Cache->GetVoidPointer(valueIdx);
}
//------------------------------------------------------------------------------
template <class Scalar>
vtkPeriodicDataArray<Scalar>::vtkPeriodicDataArray()
...
...
@@ -692,6 +704,7 @@ vtkPeriodicDataArray<Scalar>::vtkPeriodicDataArray()
this->TempDoubleArray = nullptr;
this->TempTupleIdx = -1;
this->Data = nullptr;
this->Cache = nullptr;
this->MaxId = -1;
this->Size = 0;
...
...
@@ -706,5 +719,10 @@ template <class Scalar>
vtkPeriodicDataArray<Scalar>::~vtkPeriodicDataArray()
{
this->Initialize();
if (this->Cache)
{
this->Cache->Delete();
this->Cache = nullptr;
}
}
VTK_ABI_NAMESPACE_END
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