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
Christian Butz
VTK
Commits
7a065b50
Commit
7a065b50
authored
Mar 16, 2005
by
Berk Geveci
Browse files
ENH: Better computation of blanking
parent
059c4e8d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Filtering/vtkHierarchicalBoxDataSet.cxx
View file @
7a065b50
...
...
@@ -24,7 +24,7 @@
#include "vtkUniformGrid.h"
#include "vtkUnsignedCharArray.h"
vtkCxxRevisionMacro
(
vtkHierarchicalBoxDataSet
,
"1.
6
"
);
vtkCxxRevisionMacro
(
vtkHierarchicalBoxDataSet
,
"1.
7
"
);
vtkStandardNewMacro
(
vtkHierarchicalBoxDataSet
);
vtkInformationKeyMacro
(
vtkHierarchicalBoxDataSet
,
BOX
,
IntegerVector
);
...
...
@@ -104,6 +104,16 @@ void vtkHierarchicalBoxDataSet::SetRefinementRatio(unsigned int level,
this
->
BoxInternal
->
RefinementRatios
[
level
]
=
ratio
;
}
//----------------------------------------------------------------------------
int
vtkHierarchicalBoxDataSet
::
GetRefinementRatio
(
unsigned
int
level
)
{
if
(
level
>=
this
->
BoxInternal
->
RefinementRatios
.
size
())
{
return
0
;
}
return
this
->
BoxInternal
->
RefinementRatios
[
level
];
}
//----------------------------------------------------------------------------
int
vtkHierarchicalBoxDataSetIsInBoxes
(
vtkstd
::
vector
<
vtkAMRBox
>&
boxes
,
int
i
,
int
j
,
int
k
)
...
...
@@ -124,25 +134,28 @@ void vtkHierarchicalBoxDataSet::GenerateVisibilityArrays()
{
unsigned
int
numLevels
=
this
->
GetNumberOfLevels
();
for
(
unsigned
int
levelIdx
=
0
;
levelIdx
<
numLevels
-
1
;
levelIdx
++
)
for
(
unsigned
int
levelIdx
=
0
;
levelIdx
<
numLevels
;
levelIdx
++
)
{
// Copy boxes of higher level and coarsen to this level
vtkstd
::
vector
<
vtkAMRBox
>
boxes
;
unsigned
int
numDataSets
=
this
->
GetNumberOfDataSets
(
levelIdx
+
1
);
unsigned
int
dataSetIdx
;
for
(
dataSetIdx
=
0
;
dataSetIdx
<
numDataSets
;
dataSetIdx
++
)
if
(
levelIdx
<
numLevels
-
1
)
{
vtkInformation
*
info
=
this
->
HierarchicalDataInformation
->
GetInformation
(
levelIdx
+
1
,
dataSetIdx
);
int
*
boxVec
=
info
->
Get
(
BOX
());
vtkAMRBox
coarsebox
(
3
,
boxVec
,
boxVec
+
3
);
if
(
this
->
BoxInternal
->
RefinementRatios
.
size
()
<=
levelIdx
)
for
(
dataSetIdx
=
0
;
dataSetIdx
<
numDataSets
;
dataSetIdx
++
)
{
continue
;
vtkInformation
*
info
=
this
->
HierarchicalDataInformation
->
GetInformation
(
levelIdx
+
1
,
dataSetIdx
);
int
*
boxVec
=
info
->
Get
(
BOX
());
vtkAMRBox
coarsebox
(
3
,
boxVec
,
boxVec
+
3
);
if
(
this
->
BoxInternal
->
RefinementRatios
.
size
()
<=
levelIdx
)
{
continue
;
}
coarsebox
.
Coarsen
(
this
->
BoxInternal
->
RefinementRatios
[
levelIdx
]);
boxes
.
push_back
(
coarsebox
);
}
coarsebox
.
Coarsen
(
this
->
BoxInternal
->
RefinementRatios
[
levelIdx
]);
boxes
.
push_back
(
coarsebox
);
}
numDataSets
=
this
->
GetNumberOfDataSets
(
levelIdx
);
...
...
Filtering/vtkHierarchicalBoxDataSet.h
View file @
7a065b50
...
...
@@ -74,6 +74,10 @@ public:
// Sets the refinement of a given level.
void
SetRefinementRatio
(
unsigned
int
level
,
int
refRatio
);
// Description:
// Returns the refinement of a given level.
int
GetRefinementRatio
(
unsigned
int
level
);
// Description:
// Blank lower level cells if they are overlapped by higher
// level ones.
...
...
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