Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Andrew Bauer
VTK
Commits
35cf6c00
Commit
35cf6c00
authored
Jul 09, 1994
by
Will Schroeder
Browse files
*** empty log message ***
parent
b43b1ce7
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/ShrinkF.cc
View file @
35cf6c00
...
...
@@ -40,6 +40,7 @@ void vlShrinkFilter::Execute()
return
;
}
this
->
Allocate
(
numCells
);
newPts
=
new
vlFloatPoints
(
numPts
*
8
,
numPts
);
pd
=
this
->
Input
->
GetPointData
();
this
->
PointData
.
CopyAllocate
(
pd
,
numPts
*
8
,
numPts
);
...
...
@@ -47,7 +48,7 @@ void vlShrinkFilter::Execute()
// Traverse all cells, obtaining node coordinates. Compute "center" of cell,
// then create new vertices shrunk towards center.
//
for
(
cellId
=
0
;
cellId
<
numCells
;
i
++
)
for
(
cellId
=
0
;
cellId
<
numCells
;
cellId
++
)
{
this
->
Input
->
GetCellPoints
(
cellId
,
ptIds
);
...
...
@@ -55,7 +56,7 @@ void vlShrinkFilter::Execute()
center
[
0
]
=
center
[
1
]
=
center
[
2
]
=
0.0
;
for
(
i
=
0
;
i
<
ptIds
.
GetNumberOfIds
();
i
++
)
{
p
=
this
->
Input
->
GetPoint
(
i
);
p
=
this
->
Input
->
GetPoint
(
ptIds
.
GetId
(
i
)
);
for
(
j
=
0
;
j
<
3
;
j
++
)
center
[
j
]
+=
p
[
j
];
}
for
(
j
=
0
;
j
<
3
;
j
++
)
center
[
j
]
/=
ptIds
.
GetNumberOfIds
();
...
...
@@ -71,19 +72,16 @@ void vlShrinkFilter::Execute()
newId
=
newPts
->
InsertNextPoint
(
pt
);
newPtIds
.
SetId
(
i
,
newId
);
this
->
InsertNextCell
(
this
->
Input
->
GetCellType
(
cellId
),
newPtIds
);
this
->
PointData
.
CopyData
(
pd
,
oldId
,
newId
);
}
this
->
InsertNextCell
(
this
->
Input
->
GetCellType
(
cellId
),
newPtIds
);
}
//
// Update ourselves
//
newPts
->
Squeeze
();
this
->
SetPoints
(
newPts
);
this
->
PointData
.
Squeeze
();
this
->
Squeeze
();
}
void
vlShrinkFilter
::
PrintSelf
(
ostream
&
os
,
vlIndent
indent
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment