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 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697
|
/*=========================================================================
Program: Visualization Toolkit
Module: vtkCleanPolyData.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 notice for more information.
=========================================================================*/
#include "vtkCleanPolyData.h"
#include "vtkCellArray.h"
#include "vtkCellData.h"
#include "vtkMergePoints.h"
#include "vtkInformation.h"
#include "vtkInformationVector.h"
#include "vtkObjectFactory.h"
#include "vtkPointData.h"
#include "vtkPolyData.h"
#include "vtkStreamingDemandDrivenPipeline.h"
#include "vtkIncrementalPointLocator.h"
vtkStandardNewMacro(vtkCleanPolyData);
//---------------------------------------------------------------------------
// Specify a spatial locator for speeding the search process. By
// default an instance of vtkPointLocator is used.
vtkCxxSetObjectMacro(vtkCleanPolyData,Locator,vtkIncrementalPointLocator);
//---------------------------------------------------------------------------
// Construct object with initial Tolerance of 0.0
vtkCleanPolyData::vtkCleanPolyData()
{
this->PointMerging = 1;
this->ToleranceIsAbsolute = 0;
this->Tolerance = 0.0;
this->AbsoluteTolerance = 1.0;
this->ConvertPolysToLines = 1;
this->ConvertLinesToPoints = 1;
this->ConvertStripsToPolys = 1;
this->Locator = NULL;
this->PieceInvariant = 1;
}
//--------------------------------------------------------------------------
vtkCleanPolyData::~vtkCleanPolyData()
{
this->SetLocator(NULL);
}
//--------------------------------------------------------------------------
void vtkCleanPolyData::OperateOnPoint(double in[3], double out[3])
{
out[0] = in[0];
out[1] = in[1];
out[2] = in[2];
}
//--------------------------------------------------------------------------
void vtkCleanPolyData::OperateOnBounds(double in[6], double out[6])
{
out[0] = in[0];
out[1] = in[1];
out[2] = in[2];
out[3] = in[3];
out[4] = in[4];
out[5] = in[5];
}
//--------------------------------------------------------------------------
int vtkCleanPolyData::RequestInformation(
vtkInformation *vtkNotUsed(request),
vtkInformationVector **vtkNotUsed(inputVector),
vtkInformationVector *outputVector)
{
// get the info object
vtkInformation *outInfo = outputVector->GetInformationObject(0);
if (this->PieceInvariant)
{
outInfo->Set(vtkStreamingDemandDrivenPipeline::MAXIMUM_NUMBER_OF_PIECES(),
1);
}
else
{
outInfo->Set(vtkStreamingDemandDrivenPipeline::MAXIMUM_NUMBER_OF_PIECES(),
-1);
}
return 1;
}
//--------------------------------------------------------------------------
int vtkCleanPolyData::RequestUpdateExtent(
vtkInformation *vtkNotUsed(request),
vtkInformationVector **inputVector,
vtkInformationVector *outputVector)
{
// get the info objects
vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
vtkInformation *outInfo = outputVector->GetInformationObject(0);
if (this->PieceInvariant)
{
// Although piece > 1 is handled by superclass, we should be thorough.
if (outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_PIECE_NUMBER()) == 0)
{
inInfo->Set(vtkStreamingDemandDrivenPipeline::UPDATE_PIECE_NUMBER(), 0);
inInfo->Set(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_PIECES(),
1);
}
else
{
inInfo->Set(vtkStreamingDemandDrivenPipeline::UPDATE_PIECE_NUMBER(), 0);
inInfo->Set(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_PIECES(),
0);
}
}
else
{
inInfo->Set(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_PIECES(),
outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_PIECES()));
inInfo->Set(vtkStreamingDemandDrivenPipeline::UPDATE_PIECE_NUMBER(),
outInfo->Get(
vtkStreamingDemandDrivenPipeline::UPDATE_PIECE_NUMBER()));
inInfo->Set(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS(),
outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS()));
}
return 1;
}
//--------------------------------------------------------------------------
int vtkCleanPolyData::RequestData(
vtkInformation *vtkNotUsed(request),
vtkInformationVector **inputVector,
vtkInformationVector *outputVector)
{
// get the info objects
vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
vtkInformation *outInfo = outputVector->GetInformationObject(0);
// get the input and output
vtkPolyData *input = vtkPolyData::SafeDownCast(
inInfo->Get(vtkDataObject::DATA_OBJECT()));
vtkPolyData *output = vtkPolyData::SafeDownCast(
outInfo->Get(vtkDataObject::DATA_OBJECT()));
vtkPoints *inPts = input->GetPoints();
vtkIdType numPts = input->GetNumberOfPoints();
vtkDebugMacro(<<"Beginning PolyData clean");
if ( (numPts<1) || (inPts == NULL ) )
{
vtkDebugMacro(<<"No data to Operate On!");
return 1;
}
vtkIdType *updatedPts = new vtkIdType[input->GetMaxCellSize()];
vtkIdType numNewPts;
vtkIdType numUsedPts=0;
vtkPoints *newPts = input->GetPoints()->NewInstance();
newPts->SetDataType(input->GetPoints()->GetDataType());
newPts->Allocate(numPts);
// we'll be needing these
vtkIdType inCellID, newId;
int i;
vtkIdType ptId;
vtkIdType npts = 0;
vtkIdType *pts = 0;
double x[3];
double newx[3];
vtkIdType *pointMap=0; //used if no merging
vtkCellArray *inVerts = input->GetVerts(), *newVerts = NULL;
vtkCellArray *inLines = input->GetLines(), *newLines = NULL;
vtkCellArray *inPolys = input->GetPolys(), *newPolys = NULL;
vtkCellArray *inStrips = input->GetStrips(), *newStrips = NULL;
vtkPointData *inputPD = input->GetPointData();
vtkCellData *inputCD = input->GetCellData();
// We must be careful to 'operate' on the bounds of the locator so
// that all inserted points lie inside it
if ( this->PointMerging )
{
this->CreateDefaultLocator(input);
if (this->ToleranceIsAbsolute)
{
this->Locator->SetTolerance(this->AbsoluteTolerance);
}
else
{
this->Locator->SetTolerance(this->Tolerance*input->GetLength());
}
double originalbounds[6], mappedbounds[6];
input->GetBounds(originalbounds);
this->OperateOnBounds(originalbounds,mappedbounds);
this->Locator->InitPointInsertion(newPts, mappedbounds);
}
else
{
pointMap = new vtkIdType [numPts];
for (i=0; i < numPts; i++)
{
pointMap[i] = -1; //initialize unused
}
}
vtkPointData *outputPD = output->GetPointData();
vtkCellData *outputCD = output->GetCellData();
outputPD->CopyAllocate(inputPD);
outputCD->CopyAllocate(inputCD);
// Celldata needs to be copied correctly. If a poly is converted to
// a line, or a line to a point, then using a CellCounter will not
// do, as the cells should be ordered verts, lines, polys,
// strips. We need to maintain seperate cell data lists so we can
// copy them all correctly. Tedious but easy to implement. We can
// use outputCD for vertex cell data, then add the rest at the end.
vtkCellData *outLineData = NULL;
vtkCellData *outPolyData = NULL;
vtkCellData *outStrpData = NULL;
vtkIdType vertIDcounter = 0, lineIDcounter = 0;
vtkIdType polyIDcounter = 0, strpIDcounter = 0;
// Begin to adjust topology.
//
// Vertices are renumbered and we remove duplicates
inCellID = 0;
if ( !this->GetAbortExecute() && inVerts->GetNumberOfCells() > 0 )
{
newVerts = vtkCellArray::New();
newVerts->Allocate(inVerts->GetSize());
vtkDebugMacro(<<"Starting Verts "<<inCellID);
for (inVerts->InitTraversal(); inVerts->GetNextCell(npts,pts);
inCellID++)
{
for ( numNewPts=0, i=0; i < npts; i++ )
{
inPts->GetPoint(pts[i],x);
this->OperateOnPoint(x, newx);
if ( ! this->PointMerging )
{
if ( (ptId=pointMap[pts[i]]) == -1 )
{
pointMap[pts[i]] = ptId = numUsedPts++;
newPts->SetPoint(ptId,newx);
outputPD->CopyData(inputPD,pts[i],ptId);
}
}
else if ( this->Locator->InsertUniquePoint(newx, ptId) )
{
outputPD->CopyData(inputPD,pts[i],ptId);
}
updatedPts[numNewPts++] = ptId;
}//for all points of vertex cell
if ( numNewPts > 0 )
{
newId = newVerts->InsertNextCell(numNewPts,updatedPts);
outputCD->CopyData(inputCD, inCellID, newId);
if ( vertIDcounter != newId)
{
vtkErrorMacro(<<"Vertex ID fault in vertex test");
}
vertIDcounter++;
}
}
}
this->UpdateProgress(0.25);
// lines reduced to one point are eliminated or made into verts
if ( !this->GetAbortExecute() && inLines->GetNumberOfCells() > 0 )
{
newLines = vtkCellArray::New();
newLines->Allocate(inLines->GetSize());
outLineData = vtkCellData::New();
outLineData->CopyAllocate(inputCD);
//
vtkDebugMacro(<<"Starting Lines "<<inCellID);
for (inLines->InitTraversal(); inLines->GetNextCell(npts,pts); inCellID++)
{
for ( numNewPts=0, i=0; i<npts; i++ )
{
inPts->GetPoint(pts[i],x);
this->OperateOnPoint(x, newx);
if ( ! this->PointMerging )
{
if ( (ptId=pointMap[pts[i]]) == -1 )
{
pointMap[pts[i]] = ptId = numUsedPts++;
newPts->SetPoint(ptId,newx);
outputPD->CopyData(inputPD,pts[i],ptId);
}
}
else if ( this->Locator->InsertUniquePoint(newx, ptId) )
{
outputPD->CopyData(inputPD,pts[i],ptId);
}
if ( i == 0 || ptId != updatedPts[numNewPts-1] )
{
updatedPts[numNewPts++] = ptId;
}
}//for all cell points
if ( (numNewPts>1) || !this->ConvertLinesToPoints )
{
newId = newLines->InsertNextCell(numNewPts,updatedPts);
outLineData->CopyData(inputCD, inCellID, newId);
if (lineIDcounter!=newId)
{
vtkErrorMacro(<<"Line ID fault in line test");
}
lineIDcounter++;
}
else if ( numNewPts==1 )
{
if (!newVerts)
{
newVerts = vtkCellArray::New();
newVerts->Allocate(5);
}
newId = newVerts->InsertNextCell(numNewPts,updatedPts);
outputCD->CopyData(inputCD, inCellID, newId);
if (vertIDcounter!=newId)
{
vtkErrorMacro(<<"Vertex ID fault in line test");
}
vertIDcounter++;
}
}
vtkDebugMacro(<<"Removed "
<< inLines->GetNumberOfCells() - newLines->GetNumberOfCells()
<< " lines");
}
this->UpdateProgress(0.50);
// polygons reduced to two points or less are either eliminated
// or converted to lines or points if enabled
if ( !this->GetAbortExecute() && inPolys->GetNumberOfCells() > 0 )
{
newPolys = vtkCellArray::New();
newPolys->Allocate(inPolys->GetSize());
outPolyData = vtkCellData::New();
outPolyData->CopyAllocate(inputCD);
vtkDebugMacro(<<"Starting Polys "<<inCellID);
for (inPolys->InitTraversal(); inPolys->GetNextCell(npts,pts); inCellID++)
{
for ( numNewPts=0, i=0; i<npts; i++ )
{
inPts->GetPoint(pts[i],x);
this->OperateOnPoint(x, newx);
if ( ! this->PointMerging )
{
if ( (ptId=pointMap[pts[i]]) == -1 )
{
pointMap[pts[i]] = ptId = numUsedPts++;
newPts->SetPoint(ptId,newx);
outputPD->CopyData(inputPD,pts[i],ptId);
}
}
else if ( this->Locator->InsertUniquePoint(newx, ptId) )
{
outputPD->CopyData(inputPD,pts[i],ptId);
}
if ( i == 0 || ptId != updatedPts[numNewPts-1] )
{
updatedPts[numNewPts++] = ptId;
}
} //for points in cell
if ( numNewPts>2 && updatedPts[0] == updatedPts[numNewPts-1] )
{
numNewPts--;
}
if ( (numNewPts > 2) || !this->ConvertPolysToLines )
{
newId = newPolys->InsertNextCell(numNewPts,updatedPts);
outPolyData->CopyData(inputCD, inCellID, newId);
if (polyIDcounter!=newId)
{
vtkErrorMacro(<<"Poly ID fault in poly test");
}
polyIDcounter++;
}
else if ( (numNewPts==2) || !this->ConvertLinesToPoints )
{
if (!newLines)
{
newLines = vtkCellArray::New();
newLines->Allocate(5);
outLineData = vtkCellData::New();
outLineData->CopyAllocate(inputCD);
}
newId = newLines->InsertNextCell(numNewPts,updatedPts);
outLineData->CopyData(inputCD, inCellID, newId);
if (lineIDcounter!=newId)
{
vtkErrorMacro(<<"Line ID fault in poly test");
}
lineIDcounter++;
}
else if ( numNewPts==1 )
{
if (!newVerts)
{
newVerts = vtkCellArray::New();
newVerts->Allocate(5);
}
newId = newVerts->InsertNextCell(numNewPts,updatedPts);
outputCD->CopyData(inputCD, inCellID, newId);
if (vertIDcounter!=newId)
{
vtkErrorMacro(<<"Vertex ID fault in poly test");
}
vertIDcounter++;
}
}
vtkDebugMacro(<<"Removed "
<< inPolys->GetNumberOfCells() - newPolys->GetNumberOfCells()
<< " polys");
}
this->UpdateProgress(0.75);
// triangle strips can reduced to polys/lines/points etc
if ( !this->GetAbortExecute() && inStrips->GetNumberOfCells() > 0 )
{
newStrips = vtkCellArray::New();
newStrips->Allocate(inStrips->GetSize());
outStrpData = vtkCellData::New();
outStrpData->CopyAllocate(inputCD);
for (inStrips->InitTraversal(); inStrips->GetNextCell(npts,pts);
inCellID++)
{
for ( numNewPts=0, i=0; i < npts; i++ )
{
inPts->GetPoint(pts[i],x);
this->OperateOnPoint(x, newx);
if ( ! this->PointMerging )
{
if ( (ptId=pointMap[pts[i]]) == -1 )
{
pointMap[pts[i]] = ptId = numUsedPts++;
newPts->SetPoint(ptId,newx);
outputPD->CopyData(inputPD,pts[i],ptId);
}
}
else if ( this->Locator->InsertUniquePoint(newx, ptId) )
{
outputPD->CopyData(inputPD,pts[i],ptId);
}
if ( i == 0 || ptId != updatedPts[numNewPts-1] )
{
updatedPts[numNewPts++] = ptId;
}
}
if ( (numNewPts > 3) || !this->ConvertStripsToPolys )
{
newId = newStrips->InsertNextCell(numNewPts,updatedPts);
outStrpData->CopyData(inputCD, inCellID, newId);
if (strpIDcounter!=newId)
{
vtkErrorMacro(<<"Strip ID fault in strip test");
}
strpIDcounter++;
}
else if ( (numNewPts==3) || !this->ConvertPolysToLines )
{
if (!newPolys)
{
newPolys = vtkCellArray::New();
newPolys->Allocate(5);
outPolyData = vtkCellData::New();
outPolyData->CopyAllocate(inputCD);
}
newId = newPolys->InsertNextCell(numNewPts,updatedPts);
outPolyData->CopyData(inputCD, inCellID, newId);
if (polyIDcounter!=newId)
{
vtkErrorMacro(<<"Poly ID fault in strip test");
}
polyIDcounter++;
}
else if ( (numNewPts==2) || !this->ConvertLinesToPoints )
{
if (!newLines)
{
newLines = vtkCellArray::New();
newLines->Allocate(5);
outLineData = vtkCellData::New();
outLineData->CopyAllocate(inputCD);
}
newId = newLines->InsertNextCell(numNewPts,updatedPts);
outLineData->CopyData(inputCD, inCellID, newId);
if (lineIDcounter!=newId)
{
vtkErrorMacro(<<"Line ID fault in strip test");
}
lineIDcounter++;
}
else if ( numNewPts==1 )
{
if (!newVerts)
{
newVerts = vtkCellArray::New();
newVerts->Allocate(5);
}
newId = newVerts->InsertNextCell(numNewPts,updatedPts);
outputCD->CopyData(inputCD, inCellID, newId);
if (vertIDcounter!=newId)
{
vtkErrorMacro(<<"Vertex ID fault in strip test");
}
vertIDcounter++;
}
}
vtkDebugMacro(<<"Removed "
<< inStrips->GetNumberOfCells() - newStrips->GetNumberOfCells()
<< " strips");
}
vtkDebugMacro(<<"Removed "
<< numPts - newPts->GetNumberOfPoints() << " points");
// Update ourselves and release memory
//
delete [] updatedPts;
if ( this->PointMerging )
{
this->Locator->Initialize(); //release memory.
}
else
{
newPts->SetNumberOfPoints(numUsedPts);
delete [] pointMap;
}
// Now transfer all CellData from Lines/Polys/Strips into final
// Cell data output
int CombinedCellID = vertIDcounter;
if (newLines)
{
for (i=0; i<lineIDcounter; i++, CombinedCellID++)
{
outputCD->CopyData(outLineData, i, CombinedCellID);
}
outLineData->Delete();
}
if (newPolys)
{
for (i=0; i<polyIDcounter; i++, CombinedCellID++)
{
outputCD->CopyData(outPolyData, i, CombinedCellID);
}
outPolyData->Delete();
}
if (newStrips)
{
for (i=0; i<strpIDcounter; i++, CombinedCellID++)
{
outputCD->CopyData(outStrpData, i, CombinedCellID);
}
outStrpData->Delete();
}
output->SetPoints(newPts);
newPts->Squeeze();
newPts->Delete();
if (newVerts)
{
newVerts->Squeeze();
output->SetVerts(newVerts);
newVerts->Delete();
}
if (newLines)
{
newLines->Squeeze();
output->SetLines(newLines);
newLines->Delete();
}
if (newPolys)
{
newPolys->Squeeze();
output->SetPolys(newPolys);
newPolys->Delete();
}
if (newStrips)
{
newStrips->Squeeze();
output->SetStrips(newStrips);
newStrips->Delete();
}
return 1;
}
//--------------------------------------------------------------------------
// Method manages creation of locators. It takes into account the potential
// change of tolerance (zero to non-zero).
void vtkCleanPolyData::CreateDefaultLocator(vtkPolyData *input)
{
double tol;
if (this->ToleranceIsAbsolute)
{
tol = this->AbsoluteTolerance;
}
else
{
if (input)
{
tol = this->Tolerance*input->GetLength();
}
else
{
tol = this->Tolerance;
}
}
if ( this->Locator == NULL)
{
if (tol==0.0)
{
this->Locator = vtkMergePoints::New();
this->Locator->Register(this);
this->Locator->Delete();
}
else
{
this->Locator = vtkPointLocator::New();
this->Locator->Register(this);
this->Locator->Delete();
}
}
else
{
// check that the tolerance wasn't changed from zero to non-zero
if ((tol>0.0) && (this->GetLocator()->GetTolerance()==0.0))
{
this->SetLocator(NULL);
this->Locator = vtkPointLocator::New();
this->Locator->Register(this);
this->Locator->Delete();
}
}
}
//--------------------------------------------------------------------------
void vtkCleanPolyData::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os,indent);
os << indent << "Point Merging: "
<< (this->PointMerging ? "On\n" : "Off\n");
os << indent << "ToleranceIsAbsolute: "
<< (this->ToleranceIsAbsolute ? "On\n" : "Off\n");
os << indent << "Tolerance: "
<< (this->Tolerance ? "On\n" : "Off\n");
os << indent << "AbsoluteTolerance: "
<< (this->AbsoluteTolerance ? "On\n" : "Off\n");
os << indent << "ConvertPolysToLines: "
<< (this->ConvertPolysToLines ? "On\n" : "Off\n");
os << indent << "ConvertLinesToPoints: "
<< (this->ConvertLinesToPoints ? "On\n" : "Off\n");
os << indent << "ConvertStripsToPolys: "
<< (this->ConvertStripsToPolys ? "On\n" : "Off\n");
if ( this->Locator )
{
os << indent << "Locator: " << this->Locator << "\n";
}
else
{
os << indent << "Locator: (none)\n";
}
os << indent << "PieceInvariant: "
<< (this->PieceInvariant ? "On\n" : "Off\n");
}
//--------------------------------------------------------------------------
unsigned long int vtkCleanPolyData::GetMTime()
{
unsigned long mTime=this->vtkObject::GetMTime();
unsigned long time;
if ( this->Locator != NULL )
{
time = this->Locator->GetMTime();
mTime = ( time > mTime ? time : mTime );
}
return mTime;
}
|