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
Moritz Schmid
VTK
Commits
192daf2b
Commit
192daf2b
authored
1 year ago
by
Julien Fausty
Browse files
Options
Downloads
Patches
Plain Diff
HTGGeometry: add PassThroughCellIds option for hardware picking
parent
fb090077
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Filters/HyperTree/vtkHyperTreeGridGeometry.cxx
+45
-0
45 additions, 0 deletions
Filters/HyperTree/vtkHyperTreeGridGeometry.cxx
Filters/HyperTree/vtkHyperTreeGridGeometry.h
+38
-0
38 additions, 0 deletions
Filters/HyperTree/vtkHyperTreeGridGeometry.h
with
83 additions
and
0 deletions
Filters/HyperTree/vtkHyperTreeGridGeometry.cxx
+
45
−
0
View file @
192daf2b
...
...
@@ -43,6 +43,23 @@
#include
<set>
#include
<vector>
namespace
{
bool
PassCellId
(
vtkDataArray
*
cellIds
,
vtkIdType
inId
,
vtkIdType
outId
)
{
auto
typedCellIds
=
vtkIdTypeArray
::
SafeDownCast
(
cellIds
);
if
(
!
typedCellIds
)
{
vtkErrorWithObjectMacro
(
nullptr
,
"Pass cell ids array has wrong type."
);
return
false
;
}
typedCellIds
->
InsertValue
(
outId
,
inId
);
return
true
;
}
}
VTK_ABI_NAMESPACE_BEGIN
static
constexpr
unsigned
int
VonNeumannCursors3D
[]
=
{
0
,
1
,
2
,
4
,
5
,
6
};
static
constexpr
unsigned
int
VonNeumannOrientations3D
[]
=
{
2
,
1
,
0
,
0
,
1
,
2
};
...
...
@@ -292,6 +309,14 @@ int vtkHyperTreeGridGeometry::ProcessTrees(vtkHyperTreeGrid* input, vtkDataObjec
this
->
OutData
=
output
->
GetCellData
();
this
->
OutData
->
CopyAllocate
(
this
->
InData
);
if
(
this
->
PassThroughCellIds
)
{
vtkNew
<
vtkIdTypeArray
>
originalCellIds
;
originalCellIds
->
SetName
(
this
->
OriginalCellIdArrayName
.
c_str
());
originalCellIds
->
SetNumberOfComponents
(
1
);
this
->
OutData
->
AddArray
(
originalCellIds
);
}
// Retrieve material mask
this
->
Mask
=
input
->
HasMask
()
?
input
->
GetMask
()
:
nullptr
;
...
...
@@ -495,6 +520,10 @@ void vtkHyperTreeGridGeometry::ProcessLeaf1D(vtkHyperTreeGridNonOrientedGeometry
// Copy edge data from that of the cell from which it comes
this
->
OutData
->
CopyData
(
this
->
InData
,
inId
,
outId
);
if
(
this
->
PassThroughCellIds
)
{
::
PassCellId
(
this
->
OutData
->
GetArray
(
this
->
OriginalCellIdArrayName
.
c_str
()),
inId
,
outId
);
}
}
//------------------------------------------------------------------------------
...
...
@@ -797,6 +826,10 @@ void vtkHyperTreeGridGeometry::ProcessLeaf3D(
// Copy face data from that of the cell from which it comes
this
->
OutData
->
CopyData
(
this
->
InData
,
inId
,
outId
);
if
(
this
->
PassThroughCellIds
)
{
::
PassCellId
(
this
->
OutData
->
GetArray
(
this
->
OriginalCellIdArrayName
.
c_str
()),
inId
,
outId
);
}
}
// if ( nA > 0 )
// Create face B when its vertices are present
...
...
@@ -840,6 +873,10 @@ void vtkHyperTreeGridGeometry::ProcessLeaf3D(
// Copy face data from that of the cell from which it comes
this
->
OutData
->
CopyData
(
this
->
InData
,
inId
,
outId
);
if
(
this
->
PassThroughCellIds
)
{
::
PassCellId
(
this
->
OutData
->
GetArray
(
this
->
OriginalCellIdArrayName
.
c_str
()),
inId
,
outId
);
}
}
// if ( nB > 0 )
}
// if ( this->HasInterface )
}
...
...
@@ -942,6 +979,10 @@ void vtkHyperTreeGridGeometry::AddFace(vtkIdType useId, const double* origin, co
// Copy face data from that of the cell from which it comes
this
->
OutData
->
CopyData
(
this
->
InData
,
useId
,
outId
);
if
(
this
->
PassThroughCellIds
)
{
::
PassCellId
(
this
->
OutData
->
GetArray
(
this
->
OriginalCellIdArrayName
.
c_str
()),
useId
,
outId
);
}
}
//------------------------------------------------------------------------------
void
vtkHyperTreeGridGeometry
::
AddFace2
(
vtkIdType
inId
,
vtkIdType
useId
,
const
double
*
origin
,
...
...
@@ -1273,6 +1314,10 @@ void vtkHyperTreeGridGeometry::AddFace2(vtkIdType inId, vtkIdType useId, const d
// Copy face data from that of the cell from which it comes
this
->
OutData
->
CopyData
(
this
->
InData
,
useId
,
outId
);
if
(
this
->
PassThroughCellIds
)
{
::
PassCellId
(
this
->
OutData
->
GetArray
(
this
->
OriginalCellIdArrayName
.
c_str
()),
inId
,
outId
);
}
}
// if ( create )
}
VTK_ABI_NAMESPACE_END
This diff is collapsed.
Click to expand it.
Filters/HyperTree/vtkHyperTreeGridGeometry.h
+
38
−
0
View file @
192daf2b
...
...
@@ -64,6 +64,32 @@ public:
vtkGetMacro
(
Merging
,
bool
);
///@}
//@{
/**
* Set/Get for the PassThroughCellIds boolean.
*
* When set to true this boolean ensures an array named with whatever is
* in `OriginalCellIdArrayName` gets created in the output holding the
* original cell ids
*
* default is false
*/
vtkSetMacro
(
PassThroughCellIds
,
bool
);
vtkGetMacro
(
PassThroughCellIds
,
bool
);
vtkBooleanMacro
(
PassThroughCellIds
,
bool
);
/**
* Set/Get the OriginalCellIdArrayName string.
*
* When PassThroughCellIds is set to true, the name of the generated
* array is whatever is set in this variable.
*
* default to vtkOriginalCellIds
*/
vtkSetMacro
(
OriginalCellIdArrayName
,
std
::
string
);
vtkGetMacro
(
OriginalCellIdArrayName
,
std
::
string
);
//@}
protected:
vtkHyperTreeGridGeometry
();
~
vtkHyperTreeGridGeometry
()
override
;
...
...
@@ -143,6 +169,18 @@ protected:
*/
vtkCellArray
*
Cells
;
/**
* Boolean for passing cell ids to poly data
*
* default is false
*/
bool
PassThroughCellIds
=
false
;
/**
* Name of the array holding original cell ids in output if PassThroughCellIds is true
*/
std
::
string
OriginalCellIdArrayName
=
"vtkOriginalCellIds"
;
/**
*JB Un locator est utilise afin de produire un maillage avec moins
*JB de points. Le gain en 3D est de l'ordre d'un facteur 4 !
...
...
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