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
Kevin Griffin
VTK
Commits
7dd7ccd1
Commit
7dd7ccd1
authored
14 years ago
by
David Gobbi
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Prefer VTK 5 coding style.
parent
78aa6683
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
Hybrid/vtkMNITagPointWriter.cxx
+20
-27
20 additions, 27 deletions
Hybrid/vtkMNITagPointWriter.cxx
Hybrid/vtkMNITagPointWriter.h
+3
-1
3 additions, 1 deletion
Hybrid/vtkMNITagPointWriter.h
with
23 additions
and
28 deletions
Hybrid/vtkMNITagPointWriter.cxx
+
20
−
27
View file @
7dd7ccd1
...
...
@@ -50,6 +50,7 @@ POSSIBILITY OF SUCH DAMAGES.
#include
"vtkObjectFactory.h"
#include
"vtkInformationVector.h"
#include
"vtkInformation.h"
#include
"vtkPointSet.h"
#include
"vtkPointData.h"
...
...
@@ -207,7 +208,7 @@ vtkPoints *vtkMNITagPointWriter::GetPoints(int port)
}
//-------------------------------------------------------------------------
void
vtkMNITagPointWriter
::
WriteData
()
void
vtkMNITagPointWriter
::
WriteData
(
vtkPointSet
*
inputs
[
2
]
)
{
static
const
char
*
arrayNames
[
3
]
=
{
"Weights"
,
...
...
@@ -215,7 +216,6 @@ void vtkMNITagPointWriter::WriteData()
"PatientIds"
};
vtkPointSet
*
inputs
[
2
];
vtkPoints
*
points
[
2
];
vtkStringArray
*
labels
=
0
;
...
...
@@ -232,7 +232,6 @@ void vtkMNITagPointWriter::WriteData()
for
(
int
ii
=
1
;
ii
>=
0
;
--
ii
)
{
points
[
ii
]
=
0
;
inputs
[
ii
]
=
vtkPointSet
::
SafeDownCast
(
this
->
GetInput
(
ii
));
if
(
inputs
[
ii
])
{
points
[
ii
]
=
inputs
[
ii
]
->
GetPoints
();
...
...
@@ -480,30 +479,33 @@ int vtkMNITagPointWriter::Write()
//-------------------------------------------------------------------------
int
vtkMNITagPointWriter
::
RequestData
(
vtkInformation
*
,
vtkInformationVector
**
,
vtkInformation
*
,
vtkInformationVector
**
inputVector
,
vtkInformationVector
*
)
{
this
->
SetErrorCode
(
vtkErrorCode
::
NoError
);
int
idx
;
vtkInformation
*
inInfo
[
2
];
inInfo
[
0
]
=
inputVector
[
0
]
->
GetInformationObject
(
0
);
inInfo
[
1
]
=
inputVector
[
1
]
->
GetInformationObject
(
0
);
for
(
idx
=
0
;
idx
<
this
->
GetNumberOfInputPorts
();
++
idx
)
{
if
(
this
->
GetInput
(
idx
)
!=
NULL
)
{
this
->
GetInput
(
idx
)
->
Update
();
}
}
vtkPointSet
*
input
[
2
];
input
[
0
]
=
0
;
input
[
1
]
=
0
;
unsigned
long
lastUpdateTime
=
0
;
for
(
idx
=
0
;
idx
<
this
->
GetNumberOfInputPorts
()
;
++
idx
)
for
(
int
idx
=
0
;
idx
<
2
;
++
idx
)
{
if
(
this
->
GetInput
(
idx
)
)
if
(
inInfo
[
idx
]
)
{
unsigned
long
updateTime
=
this
->
GetInput
(
idx
)
->
GetUpdateTime
();
if
(
updateTime
>
lastUpdateTime
)
input
[
idx
]
=
vtkPointSet
::
SafeDownCast
(
inInfo
[
idx
]
->
Get
(
vtkDataObject
::
DATA_OBJECT
()));
if
(
input
[
idx
])
{
lastUpdateTime
=
updateTime
;
unsigned
long
updateTime
=
input
[
idx
]
->
GetUpdateTime
();
if
(
updateTime
>
lastUpdateTime
)
{
lastUpdateTime
=
updateTime
;
}
}
}
}
...
...
@@ -515,18 +517,9 @@ int vtkMNITagPointWriter::RequestData(
}
this
->
InvokeEvent
(
vtkCommand
::
StartEvent
,
NULL
);
this
->
WriteData
();
this
->
WriteData
(
input
);
this
->
InvokeEvent
(
vtkCommand
::
EndEvent
,
NULL
);
// Release any inputs if marked for release
for
(
idx
=
0
;
idx
<
this
->
GetNumberOfInputPorts
();
++
idx
)
{
if
(
this
->
GetInput
(
idx
)
&&
this
->
GetInput
(
idx
)
->
ShouldIReleaseData
())
{
this
->
GetInput
(
idx
)
->
ReleaseData
();
}
}
this
->
WriteTime
.
Modified
();
return
1
;
...
...
This diff is collapsed.
Click to expand it.
Hybrid/vtkMNITagPointWriter.h
+
3
−
1
View file @
7dd7ccd1
...
...
@@ -65,6 +65,7 @@ POSSIBILITY OF SUCH DAMAGES.
#include
"vtkDataSetWriter.h"
class
vtkDataSet
;
class
vtkPointSet
;
class
vtkStringArray
;
class
vtkDoubleArray
;
class
vtkIntArray
;
...
...
@@ -145,7 +146,8 @@ protected:
vtkIntArray
*
PatientIds
;
char
*
Comments
;
void
WriteData
();
virtual
void
WriteData
()
{};
virtual
void
WriteData
(
vtkPointSet
*
inputs
[
2
]);
int
FillInputPortInformation
(
int
port
,
vtkInformation
*
info
);
...
...
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