1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615
|
/*=========================================================================
Program: Visualization Toolkit
Module: vtkHyperTreeGridNonOrientedUnlimitedSuperCursor.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright Nonice for more information.
=========================================================================*/
#include "vtkHyperTreeGridNonOrientedUnlimitedSuperCursor.h"
#include "vtkBitArray.h"
#include "vtkHyperTree.h"
#include "vtkHyperTreeGrid.h"
#include "vtkHyperTreeGridNonOrientedGeometryCursor.h"
#include "vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor.h"
#include "vtkObjectFactory.h"
#include "vtkSmartPointer.h"
#include "vtkHyperTreeGridTools.h"
#include <cassert>
#include <cmath>
#include <limits>
#include <ostream>
#include <vector>
VTK_ABI_NAMESPACE_BEGIN
//------------------------------------------------------------------------------
vtkHyperTreeGridNonOrientedUnlimitedSuperCursor*
vtkHyperTreeGridNonOrientedUnlimitedSuperCursor::Clone()
{
vtkHyperTreeGridNonOrientedUnlimitedSuperCursor* clone = this->NewInstance();
assert("post: clone_exists" && clone != nullptr);
// Copy
clone->Grid = this->Grid;
clone->CentralCursor->Initialize(this->CentralCursor.Get());
clone->CurrentFirstNonValidEntryByLevel = this->CurrentFirstNonValidEntryByLevel;
{
clone->FirstNonValidEntryByLevel.resize(this->FirstNonValidEntryByLevel.size());
std::vector<unsigned int>::iterator in = this->FirstNonValidEntryByLevel.begin();
std::vector<unsigned int>::iterator out = clone->FirstNonValidEntryByLevel.begin();
for (; in != this->FirstNonValidEntryByLevel.end(); ++in, ++out)
{
(*out) = (*in);
}
}
{
clone->Entries.resize(this->Entries.size());
auto in = this->Entries.begin();
auto out = clone->Entries.begin();
for (; in != this->Entries.end(); ++in, ++out)
{
(*out).Copy(&(*in));
}
}
clone->FirstCurrentNeighboorReferenceEntry = this->FirstCurrentNeighboorReferenceEntry;
{
clone->ReferenceEntries.resize(this->ReferenceEntries.size());
std::vector<unsigned int>::iterator in = this->ReferenceEntries.begin();
std::vector<unsigned int>::iterator out = clone->ReferenceEntries.begin();
for (; in != this->ReferenceEntries.end(); ++in, ++out)
{
(*out) = (*in);
}
}
clone->IndiceCentralCursor = this->IndiceCentralCursor;
clone->NumberOfCursors = this->NumberOfCursors;
clone->ChildCursorToParentCursorTable = this->ChildCursorToParentCursorTable;
clone->ChildCursorToChildTable = this->ChildCursorToChildTable;
return clone;
}
//------------------------------------------------------------------------------
vtkHyperTreeGrid* vtkHyperTreeGridNonOrientedUnlimitedSuperCursor::GetGrid()
{
return this->Grid;
}
//------------------------------------------------------------------------------
bool vtkHyperTreeGridNonOrientedUnlimitedSuperCursor::HasTree()
{
return this->CentralCursor->HasTree();
}
//------------------------------------------------------------------------------
bool vtkHyperTreeGridNonOrientedUnlimitedSuperCursor::HasTree(unsigned int icursor)
{
if (icursor == this->IndiceCentralCursor)
{
return this->CentralCursor->HasTree();
}
return vtk::hypertreegrid::HasTree(this->Entries[this->GetIndiceEntry(icursor)]);
}
//------------------------------------------------------------------------------
vtkHyperTree* vtkHyperTreeGridNonOrientedUnlimitedSuperCursor::GetTree()
{
return this->CentralCursor->GetTree();
}
//------------------------------------------------------------------------------
vtkHyperTree* vtkHyperTreeGridNonOrientedUnlimitedSuperCursor::GetTree(unsigned int icursor)
{
if (icursor == this->IndiceCentralCursor)
{
return this->CentralCursor->GetTree();
}
return this->Entries[this->GetIndiceEntry(icursor)].GetTree();
}
//------------------------------------------------------------------------------
vtkIdType vtkHyperTreeGridNonOrientedUnlimitedSuperCursor::GetVertexId()
{
return this->CentralCursor->GetVertexId();
}
//------------------------------------------------------------------------------
vtkIdType vtkHyperTreeGridNonOrientedUnlimitedSuperCursor::GetVertexId(unsigned int icursor)
{
if (icursor == this->IndiceCentralCursor)
{
return this->CentralCursor->GetVertexId();
}
return this->Entries[this->GetIndiceEntry(icursor)].GetVertexId();
}
//------------------------------------------------------------------------------
vtkIdType vtkHyperTreeGridNonOrientedUnlimitedSuperCursor::GetGlobalNodeIndex()
{
return this->CentralCursor->GetGlobalNodeIndex();
}
//------------------------------------------------------------------------------
vtkIdType vtkHyperTreeGridNonOrientedUnlimitedSuperCursor::GetGlobalNodeIndex(unsigned int icursor)
{
if (icursor == this->IndiceCentralCursor)
{
return this->CentralCursor->GetGlobalNodeIndex();
}
return this->Entries[this->GetIndiceEntry(icursor)].GetGlobalNodeIndex();
}
//------------------------------------------------------------------------------
vtkHyperTree* vtkHyperTreeGridNonOrientedUnlimitedSuperCursor::GetInformation(
unsigned int icursor, unsigned int& level, bool& leaf, vtkIdType& id)
{
if (icursor == this->IndiceCentralCursor)
{
level = this->CentralCursor->GetLevel();
leaf = this->CentralCursor->IsLeaf();
id = this->CentralCursor->GetGlobalNodeIndex();
return this->CentralCursor->GetTree();
}
auto& entry = this->Entries[this->GetIndiceEntry(icursor)];
vtkHyperTree* tree = entry.GetTree();
if (tree)
{
level = entry.GetLevel();
leaf = entry.IsLeaf(this->Grid);
id = entry.GetGlobalNodeIndex();
}
else
{
level = std::numeric_limits<unsigned int>::max();
}
return tree;
}
//------------------------------------------------------------------------------
unsigned char vtkHyperTreeGridNonOrientedUnlimitedSuperCursor::GetDimension()
{
return this->Grid->GetDimension();
}
//------------------------------------------------------------------------------
unsigned char vtkHyperTreeGridNonOrientedUnlimitedSuperCursor::GetNumberOfChildren()
{
return this->CentralCursor->GetTree()->GetNumberOfChildren();
}
//------------------------------------------------------------------------------
void vtkHyperTreeGridNonOrientedUnlimitedSuperCursor::SetGlobalIndexStart(vtkIdType index)
{
this->CentralCursor->SetGlobalIndexStart(index);
}
//------------------------------------------------------------------------------
void vtkHyperTreeGridNonOrientedUnlimitedSuperCursor::SetGlobalIndexFromLocal(vtkIdType index)
{
this->CentralCursor->SetGlobalIndexFromLocal(index);
}
//------------------------------------------------------------------------------
double* vtkHyperTreeGridNonOrientedUnlimitedSuperCursor::GetOrigin()
{
return this->CentralCursor->GetOrigin();
}
//------------------------------------------------------------------------------
double* vtkHyperTreeGridNonOrientedUnlimitedSuperCursor::GetSize()
{
return this->CentralCursor->GetSize();
}
//------------------------------------------------------------------------------
void vtkHyperTreeGridNonOrientedUnlimitedSuperCursor::GetBounds(double bounds[6])
{
this->CentralCursor->GetBounds(bounds);
}
//------------------------------------------------------------------------------
void vtkHyperTreeGridNonOrientedUnlimitedSuperCursor::GetBounds(
unsigned int icursor, double bounds[6])
{
if (icursor == this->IndiceCentralCursor)
{
return this->CentralCursor->GetBounds(bounds);
}
return this->Entries[this->GetIndiceEntry(icursor)].GetBounds(bounds);
}
//------------------------------------------------------------------------------
void vtkHyperTreeGridNonOrientedUnlimitedSuperCursor::GetPoint(double point[3])
{
this->CentralCursor->GetPoint(point);
}
//------------------------------------------------------------------------------
void vtkHyperTreeGridNonOrientedUnlimitedSuperCursor::GetPoint(
unsigned int icursor, double point[3])
{
if (icursor == this->IndiceCentralCursor)
{
return this->CentralCursor->GetPoint(point);
}
return this->Entries[this->GetIndiceEntry(icursor)].GetPoint(point);
}
//------------------------------------------------------------------------------
void vtkHyperTreeGridNonOrientedUnlimitedSuperCursor::SetMask(bool state)
{
assert("pre: not_tree" && this->CentralCursor->GetTree());
this->CentralCursor->SetMask(state);
}
//------------------------------------------------------------------------------
void vtkHyperTreeGridNonOrientedUnlimitedSuperCursor::SetMask(unsigned int icursor, bool state)
{
if (icursor == this->IndiceCentralCursor)
{
this->SetMask(state);
}
else
{
auto& entry = this->Entries[this->GetIndiceEntry(icursor)];
assert("pre: not_tree" && entry.GetTree());
entry.SetMask(this->Grid, state);
}
}
//------------------------------------------------------------------------------
bool vtkHyperTreeGridNonOrientedUnlimitedSuperCursor::IsMasked()
{
return this->CentralCursor->IsMasked();
}
//------------------------------------------------------------------------------
bool vtkHyperTreeGridNonOrientedUnlimitedSuperCursor::IsMasked(unsigned int icursor)
{
if (icursor == this->IndiceCentralCursor)
{
return this->IsMasked();
}
auto& entry = this->Entries[this->GetIndiceEntry(icursor)];
return entry.IsMasked(this->Grid);
}
//------------------------------------------------------------------------------
bool vtkHyperTreeGridNonOrientedUnlimitedSuperCursor::IsLeaf()
{
return this->CentralCursor->IsLeaf();
}
//------------------------------------------------------------------------------
bool vtkHyperTreeGridNonOrientedUnlimitedSuperCursor::IsLeaf(unsigned int icursor)
{
if (icursor == this->IndiceCentralCursor)
{
return this->IsLeaf();
}
auto& entry = this->Entries[this->GetIndiceEntry(icursor)];
return entry.IsLeaf(this->Grid);
}
//------------------------------------------------------------------------------
bool vtkHyperTreeGridNonOrientedUnlimitedSuperCursor::IsRealLeaf()
{
return this->CentralCursor->IsRealLeaf();
}
//------------------------------------------------------------------------------
bool vtkHyperTreeGridNonOrientedUnlimitedSuperCursor::IsRealLeaf(unsigned int icursor)
{
if (icursor == this->IndiceCentralCursor)
{
return this->IsRealLeaf();
}
auto& entry = this->Entries[this->GetIndiceEntry(icursor)];
return entry.IsRealLeaf(this->Grid);
}
//------------------------------------------------------------------------------
bool vtkHyperTreeGridNonOrientedUnlimitedSuperCursor::IsVirtualLeaf()
{
return this->CentralCursor->IsVirtualLeaf();
}
//------------------------------------------------------------------------------
bool vtkHyperTreeGridNonOrientedUnlimitedSuperCursor::IsVirtualLeaf(unsigned int icursor)
{
if (icursor == this->IndiceCentralCursor)
{
return this->IsVirtualLeaf();
}
auto& entry = this->Entries[this->GetIndiceEntry(icursor)];
return entry.IsVirtualLeaf(this->Grid);
}
//------------------------------------------------------------------------------
double vtkHyperTreeGridNonOrientedUnlimitedSuperCursor::GetExtensivePropertyRatio()
{
return this->GetExtensivePropertyRatio(this->IndiceCentralCursor);
}
//------------------------------------------------------------------------------
double vtkHyperTreeGridNonOrientedUnlimitedSuperCursor::GetExtensivePropertyRatio(vtkIdType index)
{
const auto nbVirtual = this->GetLevel(index) - this->GetLastRealLevel(index);
const auto nbDiv = std::pow(this->GetTree()->GetBranchFactor(), nbVirtual * this->GetDimension());
return 1.0 / nbDiv;
}
//------------------------------------------------------------------------------
bool vtkHyperTreeGridNonOrientedUnlimitedSuperCursor::IsRoot()
{
return this->CentralCursor->IsRoot();
}
//------------------------------------------------------------------------------
unsigned int vtkHyperTreeGridNonOrientedUnlimitedSuperCursor::GetLevel()
{
return this->CentralCursor->GetLevel();
}
//------------------------------------------------------------------------------
unsigned int vtkHyperTreeGridNonOrientedUnlimitedSuperCursor::GetLevel(unsigned int icursor)
{
if (icursor == this->IndiceCentralCursor)
{
return this->CentralCursor->GetLevel();
}
return this->Entries[this->GetIndiceEntry(icursor)].GetLevel();
}
//------------------------------------------------------------------------------
unsigned int vtkHyperTreeGridNonOrientedUnlimitedSuperCursor::GetLastRealLevel()
{
return this->CentralCursor->GetLastRealLevel();
}
//------------------------------------------------------------------------------
unsigned int vtkHyperTreeGridNonOrientedUnlimitedSuperCursor::GetLastRealLevel(unsigned int icursor)
{
if (icursor == this->IndiceCentralCursor)
{
return this->CentralCursor->GetLastRealLevel();
}
return this->Entries[this->GetIndiceEntry(icursor)].GetLastRealLevel();
}
//------------------------------------------------------------------------------
void vtkHyperTreeGridNonOrientedUnlimitedSuperCursor::ToChild(unsigned char ichild)
{
++this->CurrentFirstNonValidEntryByLevel;
if (this->FirstNonValidEntryByLevel.size() == this->CurrentFirstNonValidEntryByLevel)
{
this->FirstNonValidEntryByLevel.emplace_back();
}
this->FirstNonValidEntryByLevel[this->CurrentFirstNonValidEntryByLevel] =
this->FirstNonValidEntryByLevel[this->CurrentFirstNonValidEntryByLevel - 1];
this->FirstCurrentNeighboorReferenceEntry += (this->NumberOfCursors - 1);
if (this->ReferenceEntries.size() == this->FirstCurrentNeighboorReferenceEntry)
{
this->ReferenceEntries.resize(
this->FirstCurrentNeighboorReferenceEntry + (this->NumberOfCursors - 1));
}
// Point into traversal tables at child location
int offset = ichild * this->NumberOfCursors;
const unsigned int* pTab = this->ChildCursorToParentCursorTable + offset;
const unsigned int* cTab = this->ChildCursorToChildTable + offset;
// Move each cursor in the supercursor down to a child
for (unsigned int i = 0; i < this->NumberOfCursors; ++i)
{
if (i != this->IndiceCentralCursor)
{
// Make relevant cursor in parent cell point towards current child cursor
unsigned int j = pTab[i];
// If neighboring cell is further subdivided, then descend into it
unsigned int reference = std::numeric_limits<unsigned int>::max();
if (j == this->IndiceCentralCursor)
{
reference = this->FirstNonValidEntryByLevel[this->CurrentFirstNonValidEntryByLevel];
++this->FirstNonValidEntryByLevel[this->CurrentFirstNonValidEntryByLevel];
if (this->Entries.size() <= reference)
{
this->Entries.resize(reference + 1);
}
//
if (i > this->IndiceCentralCursor)
{
this->ReferenceEntries[this->FirstCurrentNeighboorReferenceEntry + i - 1] = reference;
}
else
{
this->ReferenceEntries[this->FirstCurrentNeighboorReferenceEntry + i] = reference;
}
//
auto& current = this->Entries[reference];
current.Initialize(this->CentralCursor->GetTree(), this->CentralCursor->GetLevel(),
this->CentralCursor->GetVertexId(), this->CentralCursor->GetOrigin());
//
// JB1901 ne pas descendre si masque
if (!this->IsMasked()) // JB1901 new code
{ // JB1901 new code
//
if (current.GetTree() && !current.IsLeaf(this->Grid))
{
// Move to child
current.ToChild(this->Grid, cTab[i]);
}
//
}
}
else
{
unsigned int previous = this->GetIndicePreviousEntry(j);
//
if (this->Entries[previous].GetTree() && !this->Entries[previous].IsLeaf(this->Grid) &&
!(this->GetGrid()->HasMask()
? this->GetGrid()->GetMask()->GetValue(this->Entries[previous].GetGlobalNodeIndex())
: 0))
{
reference = this->FirstNonValidEntryByLevel[this->CurrentFirstNonValidEntryByLevel];
++this->FirstNonValidEntryByLevel[this->CurrentFirstNonValidEntryByLevel];
if (this->Entries.size() <= reference)
{
this->Entries.resize(reference + 1);
}
if (i > this->IndiceCentralCursor)
{
this->ReferenceEntries[this->FirstCurrentNeighboorReferenceEntry + i - 1] = reference;
}
else
{
this->ReferenceEntries[this->FirstCurrentNeighboorReferenceEntry + i] = reference;
}
//
auto& current = this->Entries[reference];
current.Copy(&(this->Entries[previous]));
current.ToChild(this->Grid, cTab[i]);
}
else
{
if (j > this->IndiceCentralCursor)
{
reference = this->ReferenceEntries[this->FirstCurrentNeighboorReferenceEntry -
(this->NumberOfCursors - 1) + j - 1];
}
else
{
reference = this->ReferenceEntries[this->FirstCurrentNeighboorReferenceEntry -
(this->NumberOfCursors - 1) + j];
}
if (i > this->IndiceCentralCursor)
{
this->ReferenceEntries[this->FirstCurrentNeighboorReferenceEntry + i - 1] = reference;
}
else
{
this->ReferenceEntries[this->FirstCurrentNeighboorReferenceEntry + i] = reference;
}
}
}
}
} // i
this->CentralCursor->ToChild(cTab[this->IndiceCentralCursor]);
}
//------------------------------------------------------------------------------
void vtkHyperTreeGridNonOrientedUnlimitedSuperCursor::ToRoot()
{
assert("pre: hypertree_exist" && !this->Entries.empty());
this->CentralCursor->ToRoot();
this->CurrentFirstNonValidEntryByLevel = 0;
this->FirstCurrentNeighboorReferenceEntry = 0;
}
//------------------------------------------------------------------------------
void vtkHyperTreeGridNonOrientedUnlimitedSuperCursor::ToParent()
{
assert("pre: Non_root" && !this->IsRoot());
assert("has: Valid entry" && this->CurrentFirstNonValidEntryByLevel > 0);
this->CentralCursor->ToParent();
this->CurrentFirstNonValidEntryByLevel--;
this->FirstCurrentNeighboorReferenceEntry -= (this->NumberOfCursors - 1);
}
//------------------------------------------------------------------------------
void vtkHyperTreeGridNonOrientedUnlimitedSuperCursor::PrintSelf(ostream& os, vtkIndent indent)
{
os << indent << "--vtkHyperTreeGridNonOrientedUnlimitedSuperCursor--" << endl;
this->CentralCursor->PrintSelf(os, indent);
os << indent << "IndiceCentralCursor: " << this->IndiceCentralCursor << endl;
os << indent << "NumberOfCursors: " << this->NumberOfCursors << endl;
}
//------------------------------------------------------------------------------
vtkHyperTreeGridNonOrientedUnlimitedSuperCursor::vtkHyperTreeGridNonOrientedUnlimitedSuperCursor()
{
this->CentralCursor = vtkSmartPointer<vtkHyperTreeGridNonOrientedUnlimitedGeometryCursor>::New();
}
//------------------------------------------------------------------------------
vtkHyperTreeGridNonOrientedUnlimitedSuperCursor::
~vtkHyperTreeGridNonOrientedUnlimitedSuperCursor() = default;
//------------------------------------------------------------------------------
vtkSmartPointer<vtkHyperTreeGridOrientedGeometryCursor>
vtkHyperTreeGridNonOrientedUnlimitedSuperCursor::GetOrientedGeometryCursor(unsigned int icursor)
{
if (icursor == this->IndiceCentralCursor)
{
return this->CentralCursor->GetHyperTreeGridOrientedGeometryCursor(this->Grid);
}
return this->Entries[this->GetIndiceEntry(icursor)].GetHyperTreeGridOrientedGeometryCursor(
this->Grid);
}
//------------------------------------------------------------------------------
vtkSmartPointer<vtkHyperTreeGridNonOrientedGeometryCursor>
vtkHyperTreeGridNonOrientedUnlimitedSuperCursor::GetNonOrientedGeometryCursor(unsigned int icursor)
{
if (icursor == this->IndiceCentralCursor)
{
return this->CentralCursor->GetHyperTreeGridNonOrientedGeometryCursor(this->Grid);
}
assert(false);
// JB ou faire le boulot pour le construire
// JB On ne peut pas construire ce cursor car this->Level n'est pas forcement 0
// JB oeut etre le fournir telle quelle ? Tant que l'on ne remonte pas au dessus du niveau
// d'origine de creation du cursor ? ou alors creer le cursor avec son heritage.. cout plus eleve
// ?!?
return this->Entries[this->GetIndiceEntry(icursor)].GetHyperTreeGridNonOrientedGeometryCursor(
this->Grid);
}
//------------------------------------------------------------------------------
unsigned int vtkHyperTreeGridNonOrientedUnlimitedSuperCursor::GetIndiceEntry(unsigned int icursor)
{
assert("pre: icursor != IndiceCentralCursor" && icursor != this->IndiceCentralCursor);
assert("pre: valid_icursor" && icursor < this->NumberOfCursors);
const long refId = icursor > this->IndiceCentralCursor
? this->FirstCurrentNeighboorReferenceEntry + icursor - 1
: this->FirstCurrentNeighboorReferenceEntry + icursor;
assert("pre: valid_icursor" && 0 <= refId && refId < long(this->ReferenceEntries.size()));
assert("pre: valid_icursor" && this->ReferenceEntries[refId] < this->Entries.size());
return this->ReferenceEntries[refId];
}
//------------------------------------------------------------------------------
unsigned int vtkHyperTreeGridNonOrientedUnlimitedSuperCursor::GetIndicePreviousEntry(
unsigned int icursor)
{
assert("pre: icursor != IndiceCentralCursor" && icursor != this->IndiceCentralCursor);
assert("pre: valid_icursor" && icursor < this->NumberOfCursors);
const long refId = icursor > this->IndiceCentralCursor
? this->FirstCurrentNeighboorReferenceEntry - (this->NumberOfCursors - 1) + icursor - 1
: this->FirstCurrentNeighboorReferenceEntry - (this->NumberOfCursors - 1) + icursor;
assert("pre: valid_icursor" && 0 <= refId && refId < long(this->ReferenceEntries.size()));
assert("pre: valid_icursor" && this->ReferenceEntries[refId] < this->Entries.size());
return this->ReferenceEntries[refId];
}
VTK_ABI_NAMESPACE_END
|