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
VTK
VTK
Commits
666f5895
Commit
666f5895
authored
3 months ago
by
Louis Gombert
Browse files
Options
Downloads
Patches
Plain Diff
JSONDataSetWriter: support array selection
parent
b65eba29
No related branches found
Branches containing commit
No related tags found
1 merge request
!11713
JSONExporter: select arrays to be written for a collection of named actors
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
IO/Export/vtkJSONDataSetWriter.cxx
+19
-0
19 additions, 0 deletions
IO/Export/vtkJSONDataSetWriter.cxx
IO/Export/vtkJSONDataSetWriter.h
+16
-0
16 additions, 0 deletions
IO/Export/vtkJSONDataSetWriter.h
with
35 additions
and
0 deletions
IO/Export/vtkJSONDataSetWriter.cxx
+
19
−
0
View file @
666f5895
...
...
@@ -39,6 +39,8 @@ vtkJSONDataSetWriter::vtkJSONDataSetWriter()
{
this
->
Archiver
=
vtkArchiver
::
New
();
this
->
ValidStringCount
=
1
;
this
->
GetPointArraySelection
()
->
SetUnknownArraySetting
(
1
);
this
->
GetCellArraySelection
()
->
SetUnknownArraySetting
(
1
);
}
//------------------------------------------------------------------------------
...
...
@@ -94,6 +96,23 @@ std::string vtkJSONDataSetWriter::WriteDataSetAttributes(
continue
;
}
if
(
std
::
string
(
className
)
==
"pointData"
)
{
if
(
!
this
->
GetPointArraySelection
()
->
ArrayIsEnabled
(
field
->
GetName
()))
{
vtkDebugMacro
(
"Skipping writing point array "
<<
field
->
GetName
());
continue
;
}
}
else
if
(
std
::
string
(
className
)
==
"cellData"
)
{
if
(
!
this
->
GetCellArraySelection
()
->
ArrayIsEnabled
(
field
->
GetName
()))
{
vtkDebugMacro
(
"Skipping cell array "
<<
field
->
GetName
());
continue
;
}
}
if
(
nbArrayWritten
)
{
jsonSnippet
<<
",
\n
"
;
...
...
This diff is collapsed.
Click to expand it.
IO/Export/vtkJSONDataSetWriter.h
+
16
−
0
View file @
666f5895
...
...
@@ -32,6 +32,9 @@
#include
<string>
// std::string used as parameters in a few methods
#include
"vtkDataArraySelection.h"
// Instantiated
#include
"vtkNew.h"
// Used for DataArray selection
VTK_ABI_NAMESPACE_BEGIN
class
vtkDataSet
;
class
vtkDataArray
;
...
...
@@ -118,6 +121,16 @@ public:
vtkGetObjectMacro
(
Archiver
,
vtkArchiver
);
///@}
/**
* Specify which point arrays should be written.
*/
vtkGetObjectMacro
(
PointArraySelection
,
vtkDataArraySelection
);
/**
* Specify which cell arrays should be written.
*/
vtkGetObjectMacro
(
CellArraySelection
,
vtkDataArraySelection
);
void
Write
(
vtkDataSet
*
);
bool
IsDataSetValid
()
{
return
this
->
ValidDataSet
;
}
...
...
@@ -139,6 +152,9 @@ protected:
private
:
vtkJSONDataSetWriter
(
const
vtkJSONDataSetWriter
&
)
=
delete
;
void
operator
=
(
const
vtkJSONDataSetWriter
&
)
=
delete
;
vtkNew
<
vtkDataArraySelection
>
PointArraySelection
;
vtkNew
<
vtkDataArraySelection
>
CellArraySelection
;
};
VTK_ABI_NAMESPACE_END
...
...
This diff is collapsed.
Click to expand it.
Louis Gombert
@louis.gombert
mentioned in commit
dbd83173
·
3 months ago
mentioned in commit
dbd83173
mentioned in commit dbd8317369c17879bfb027d0c5da47a870ae8914
Toggle commit list
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