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
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
Mathieu Westphal (Kitware)
VTK
Commits
aaaf38ff
Commit
aaaf38ff
authored
15 years ago
by
Eric Stanton
Browse files
Options
Downloads
Patches
Plain Diff
BUG: Fix failing DelimitedTextReader test. Make pedigree id assignment optional.
parent
7f4a4b52
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Infovis/vtkDelimitedTextReader.cxx
+26
-22
26 additions, 22 deletions
Infovis/vtkDelimitedTextReader.cxx
Infovis/vtkDelimitedTextReader.h
+7
-0
7 additions, 0 deletions
Infovis/vtkDelimitedTextReader.h
with
33 additions
and
22 deletions
Infovis/vtkDelimitedTextReader.cxx
+
26
−
22
View file @
aaaf38ff
...
...
@@ -41,7 +41,7 @@
#include
<ctype.h>
vtkCxxRevisionMacro
(
vtkDelimitedTextReader
,
"1.2
7
"
);
vtkCxxRevisionMacro
(
vtkDelimitedTextReader
,
"1.2
8
"
);
vtkStandardNewMacro
(
vtkDelimitedTextReader
);
struct
vtkDelimitedTextReaderInternals
...
...
@@ -101,6 +101,7 @@ vtkDelimitedTextReader::vtkDelimitedTextReader()
this
->
PedigreeIdArrayName
=
NULL
;
this
->
SetPedigreeIdArrayName
(
"id"
);
this
->
GeneratePedigreeIds
=
true
;
this
->
OutputPedigreeIds
=
false
;
}
...
...
@@ -357,32 +358,35 @@ int vtkDelimitedTextReader::RequestData(
dataArray
->
Delete
();
}
if
(
this
->
Generate
PedigreeIds
)
if
(
this
->
Output
PedigreeIds
)
{
vtkSmartPointer
<
vtkIdTypeArray
>
pedigreeIds
=
vtkSmartPointer
<
vtkIdTypeArray
>::
New
();
vtkIdType
numRows
=
table
->
GetNumberOfRows
();
pedigreeIds
->
SetNumberOfTuples
(
numRows
);
pedigreeIds
->
SetName
(
this
->
PedigreeIdArrayName
);
for
(
vtkIdType
i
=
0
;
i
<
numRows
;
++
i
)
if
(
this
->
GeneratePedigreeIds
)
{
pedigreeIds
->
InsertValue
(
i
,
i
);
}
table
->
GetRowData
()
->
SetPedigreeIds
(
pedigreeIds
);
}
else
{
vtkAbstractArray
*
arr
=
table
->
GetColumnByName
(
this
->
PedigreeIdArrayName
);
if
(
arr
)
{
table
->
GetRowData
()
->
SetPedigreeIds
(
arr
);
vtkSmartPointer
<
vtkIdTypeArray
>
pedigreeIds
=
vtkSmartPointer
<
vtkIdTypeArray
>::
New
();
vtkIdType
numRows
=
table
->
GetNumberOfRows
();
pedigreeIds
->
SetNumberOfTuples
(
numRows
);
pedigreeIds
->
SetName
(
this
->
PedigreeIdArrayName
);
for
(
vtkIdType
i
=
0
;
i
<
numRows
;
++
i
)
{
pedigreeIds
->
InsertValue
(
i
,
i
);
}
table
->
GetRowData
()
->
SetPedigreeIds
(
pedigreeIds
);
}
else
{
vtkErrorMacro
(
<<
"Could find pedigree id array: "
<<
this
->
PedigreeIdArrayName
);
return
0
;
vtkAbstractArray
*
arr
=
table
->
GetColumnByName
(
this
->
PedigreeIdArrayName
);
if
(
arr
)
{
table
->
GetRowData
()
->
SetPedigreeIds
(
arr
);
}
else
{
vtkErrorMacro
(
<<
"Could find pedigree id array: "
<<
this
->
PedigreeIdArrayName
);
return
0
;
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Infovis/vtkDelimitedTextReader.h
+
7
−
0
View file @
aaaf38ff
...
...
@@ -121,6 +121,12 @@ public:
vtkGetMacro
(
GeneratePedigreeIds
,
bool
);
vtkBooleanMacro
(
GeneratePedigreeIds
,
bool
);
// Description:
// If on, assigns pedigree ids to output. Defaults to off.
vtkSetMacro
(
OutputPedigreeIds
,
bool
);
vtkGetMacro
(
OutputPedigreeIds
,
bool
);
vtkBooleanMacro
(
OutputPedigreeIds
,
bool
);
protected:
vtkDelimitedTextReader
();
~
vtkDelimitedTextReader
();
...
...
@@ -145,6 +151,7 @@ public:
bool
DetectNumericColumns
;
char
*
PedigreeIdArrayName
;
bool
GeneratePedigreeIds
;
bool
OutputPedigreeIds
;
private:
vtkDelimitedTextReader
(
const
vtkDelimitedTextReader
&
);
// Not implemented
...
...
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