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
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container 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
Spiros Tsalikis
VTK
Commits
63bb2f1a
Commit
63bb2f1a
authored
9 months ago
by
Spiros Tsalikis
Browse files
Options
Downloads
Patches
Plain Diff
vtkCompositeData(Reader/Writer): Fix assembly processing
parent
7c9c4af3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
IO/Legacy/vtkCompositeDataReader.cxx
+8
-8
8 additions, 8 deletions
IO/Legacy/vtkCompositeDataReader.cxx
IO/Legacy/vtkCompositeDataWriter.cxx
+5
-7
5 additions, 7 deletions
IO/Legacy/vtkCompositeDataWriter.cxx
with
13 additions
and
15 deletions
IO/Legacy/vtkCompositeDataReader.cxx
+
8
−
8
View file @
63bb2f1a
...
...
@@ -4,7 +4,6 @@
#include
"vtkAMRBox.h"
#include
"vtkAMRInformation.h"
#include
"vtkCharArray.h"
#include
"vtkDataAssembly.h"
#include
"vtkDataObjectTypes.h"
#include
"vtkDoubleArray.h"
...
...
@@ -22,6 +21,7 @@
#include
"vtkPartitionedDataSet.h"
#include
"vtkPartitionedDataSetCollection.h"
#include
"vtkStreamingDemandDrivenPipeline.h"
#include
"vtkStringArray.h"
#include
"vtkUniformGrid.h"
#include
<sstream>
...
...
@@ -685,23 +685,23 @@ bool vtkCompositeDataReader::ReadCompositeData(vtkPartitionedDataSetCollection*
return
false
;
}
unsigned
int
d
ataAssembly
Size
=
0
;
if
(
!
this
->
Read
(
&
d
ataAssembly
Size
))
unsigned
int
hasD
ataAssembly
=
0
;
if
(
!
this
->
Read
(
&
hasD
ataAssembly
))
{
vtkErrorMacro
(
"Failed to read
the
DATAASSEMBLY
size
."
);
vtkErrorMacro
(
"Failed to read
if it has
DATAASSEMBLY."
);
return
false
;
}
if
(
d
ataAssembly
Size
>
0
)
if
(
hasD
ataAssembly
>
0
)
{
auto
dataAssemblyArray
=
vtk
::
TakeSmartPointer
(
vtk
Char
Array
::
SafeDownCast
(
this
->
ReadArray
(
"
char"
,
dataAssemblySize
,
1
)));
auto
dataAssemblyArray
=
vtk
::
TakeSmartPointer
(
vtkString
Array
::
SafeDownCast
(
this
->
ReadArray
(
"
string"
,
1
,
1
)));
if
(
!
dataAssemblyArray
)
{
vtkErrorMacro
(
"Failed to read the DATAASSEMBLY."
);
return
false
;
}
vtkNew
<
vtkDataAssembly
>
dataAssembly
;
dataAssembly
->
InitializeFromXML
(
dataAssemblyArray
->
Get
Pointe
r
(
0
));
dataAssembly
->
InitializeFromXML
(
dataAssemblyArray
->
Get
Value
(
0
).
c_st
r
());
mp
->
SetDataAssembly
(
dataAssembly
);
}
...
...
This diff is collapsed.
Click to expand it.
IO/Legacy/vtkCompositeDataWriter.cxx
+
5
−
7
View file @
63bb2f1a
...
...
@@ -5,7 +5,6 @@
#include
"vtkAMRBox.h"
#include
"vtkAMRInformation.h"
#include
"vtkCharArray.h"
#include
"vtkDataAssembly.h"
#include
"vtkDoubleArray.h"
#include
"vtkGenericDataObjectWriter.h"
...
...
@@ -268,13 +267,12 @@ bool vtkCompositeDataWriter::WriteCompositeData(ostream* fp, vtkPartitionedDataS
if
(
pd
->
GetDataAssembly
())
{
const
auto
dataAssemblyStr
=
pd
->
GetDataAssembly
()
->
SerializeToXML
(
vtkIndent
());
*
fp
<<
"DATAASSEMBLY
"
<<
dataAssemblyStr
.
size
()
<<
"
\n
"
;
vtkNew
<
vtk
Char
Array
>
dataAssemblyArray
;
*
fp
<<
"DATAASSEMBLY
1
\n
"
;
vtkNew
<
vtk
String
Array
>
dataAssemblyArray
;
dataAssemblyArray
->
SetName
(
"DataAssembly"
);
dataAssemblyArray
->
SetNumberOfValues
(
dataAssemblyStr
.
size
());
std
::
copy
(
dataAssemblyStr
.
begin
(),
dataAssemblyStr
.
end
(),
dataAssemblyArray
->
GetPointer
(
0
));
this
->
WriteArray
(
fp
,
VTK_CHAR
,
dataAssemblyArray
,
""
,
dataAssemblyArray
->
GetNumberOfTuples
(),
dataAssemblyArray
->
GetNumberOfComponents
());
dataAssemblyArray
->
InsertNextValue
(
dataAssemblyStr
);
this
->
WriteArray
(
fp
,
dataAssemblyArray
->
GetDataType
(),
dataAssemblyArray
,
""
,
dataAssemblyArray
->
GetNumberOfTuples
(),
dataAssemblyArray
->
GetNumberOfComponents
());
}
else
{
...
...
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