Skip to content
Snippets Groups Projects
Commit 0743e8bb authored by Yohann Bearzi (Kitware)'s avatar Yohann Bearzi (Kitware)
Browse files

Little hack for htg supercursors

Super cursors in htg fail when reaching a neighbor
outside extent. This commit adds a new invalid id in vtkHyperTreeGrid
which is use to notify this case. This might need to be done better
later

(cherry picked from commit 2878eda0)
parent fed31c7c
No related branches found
No related tags found
No related merge requests found
......@@ -105,6 +105,12 @@ public:
vtkTypeMacro(vtkHyperTreeGrid, vtkDataObject);
void PrintSelf(ostream& os, vtkIndent indent) override;
/**
* Invalid index that is returned for undefined nodes, for example for nodes that are out of
* bounds (they can exist with the super cursors).
*/
static constexpr vtkIdType InvalidIndex = ~0;
/**
* Set/Get mode squeeze
*/
......
......@@ -21,6 +21,16 @@ PURPOSE. See the above copyright notice for more information.
#include <cassert>
//-----------------------------------------------------------------------------
vtkHyperTreeGridGeometryEntry::vtkHyperTreeGridGeometryEntry()
{
this->Index = 0;
for (unsigned int d = 0; d < 3; ++d)
{
this->Origin[d] = 0.;
}
}
//-----------------------------------------------------------------------------
void vtkHyperTreeGridGeometryEntry::PrintSelf(ostream& os, vtkIndent indent)
{
......
......@@ -56,14 +56,7 @@ public:
/**
* Constructor
*/
vtkHyperTreeGridGeometryEntry()
{
this->Index = 0;
for (unsigned int d = 0; d < 3; ++d)
{
this->Origin[d] = 0.;
}
}
vtkHyperTreeGridGeometryEntry();
/**
* Constructor
......
......@@ -56,8 +56,8 @@ vtkHyperTree* vtkHyperTreeGridGeometryLevelEntry::Initialize(
//-----------------------------------------------------------------------------
vtkIdType vtkHyperTreeGridGeometryLevelEntry::GetGlobalNodeIndex() const
{
assert("pre: not_tree" && this->Tree);
return this->Tree->GetGlobalIndexFromLocal(this->Index);
return this->Tree ? this->Tree->GetGlobalIndexFromLocal(this->Index)
: vtkHyperTreeGrid::InvalidIndex;
}
//-----------------------------------------------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment