00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include <vector>
00018 #include <algorithm>
00019
00020 #include "vtkPointSetSlicer.h"
00021
00022 #include "vtkCellArray.h"
00023 #include "vtkCellData.h"
00024 #include "vtkDataSet.h"
00025 #include "vtkDoubleArray.h"
00026 #include "vtkFloatArray.h"
00027 #include "vtkGenericCell.h"
00028 #include "vtkMergePoints.h"
00029 #include "vtkObjectFactory.h"
00030 #include "vtkPointData.h"
00031 #include "vtkPolyData.h"
00032 #include "vtkPlane.h"
00033 #include "vtkCutter.h"
00034
00035 #include "vtkUnstructuredGrid.h"
00036
00037 #include "vtkInformation.h"
00038 #include "vtkInformationVector.h"
00039 #include "vtkStreamingDemandDrivenPipeline.h"
00040
00041 vtkStandardNewMacro(vtkPointSetSlicer);
00042
00043
00044
00045 vtkPointSetSlicer::vtkPointSetSlicer(vtkPlane *cf)
00046 {
00047 this->SlicePlane = cf;
00048 this->GenerateCutScalars = 0;
00049 this->Locator = 0;
00050
00051 this->Cutter = vtkCutter::New();
00052 this->Cutter->GenerateValues( 1, 0, 1 );
00053
00054 }
00055
00056 vtkPointSetSlicer::~vtkPointSetSlicer()
00057 {
00058 this->SetSlicePlane(0);
00059 if ( this->Locator )
00060 {
00061 this->Locator->UnRegister(this);
00062 this->Locator = NULL;
00063 }
00064
00065 this->Cutter->Delete();
00066 }
00067
00068 void vtkPointSetSlicer::SetSlicePlane(vtkPlane* plane)
00069 {
00070 if ( this->SlicePlane == plane )
00071 {
00072 return;
00073 }
00074 if ( this->SlicePlane )
00075 {
00076 this->SlicePlane->UnRegister(this);
00077 this->SlicePlane = 0;
00078 }
00079 if ( plane )
00080 {
00081 plane->Register(this);
00082 this->Cutter->SetCutFunction(plane);
00083 }
00084 this->SlicePlane = plane;
00085 this->Modified();
00086 }
00087
00088
00089
00090 unsigned long vtkPointSetSlicer::GetMTime()
00091 {
00092 unsigned long mTime=this->Superclass::GetMTime();
00093 unsigned long time;
00094
00095 if ( this->SlicePlane != 0 )
00096 {
00097 time = this->SlicePlane->GetMTime();
00098 mTime = ( time > mTime ? time : mTime );
00099 }
00100
00101 if ( this->Locator != 0 )
00102 {
00103 time = this->Locator->GetMTime();
00104 mTime = ( time > mTime ? time : mTime );
00105 }
00106
00107 return mTime;
00108 }
00109
00110 int vtkPointSetSlicer::RequestData(
00111 vtkInformation * ,
00112 vtkInformationVector **inputVector,
00113 vtkInformationVector *outputVector)
00114 {
00115
00116 vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
00117 vtkInformation *outInfo = outputVector->GetInformationObject(0);
00118
00119
00120 vtkDataSet *input = vtkDataSet::SafeDownCast(
00121 inInfo->Get(vtkDataObject::DATA_OBJECT()));
00122 vtkPolyData *output = vtkPolyData::SafeDownCast(
00123 outInfo->Get(vtkDataObject::DATA_OBJECT()));
00124
00125 vtkDebugMacro(<< "Executing cutter");
00126
00127 if (!this->SlicePlane)
00128 {
00129 vtkErrorMacro("No slice plane specified");
00130 return 0;
00131 }
00132
00133 if ( input->GetNumberOfPoints() < 1 )
00134 {
00135 return 1;
00136 }
00137
00138 if (input->GetDataObjectType() == VTK_STRUCTURED_POINTS ||
00139 input->GetDataObjectType() == VTK_IMAGE_DATA)
00140 {
00141 if ( input->GetCell(0) && input->GetCell(0)->GetCellDimension() >= 3 )
00142 {
00143
00144 return 1;
00145 }
00146 }
00147 if (input->GetDataObjectType() == VTK_STRUCTURED_GRID)
00148 {
00149 if (input->GetCell(0))
00150 {
00151 int dim = input->GetCell(0)->GetCellDimension();
00152
00153 if (dim >= 3)
00154 {
00155
00156 return 1;
00157 }
00158 }
00159 }
00160 if (input->GetDataObjectType() == VTK_RECTILINEAR_GRID)
00161 {
00162
00163
00164 return 1;
00165
00166 }
00167
00168 if (input->GetDataObjectType() == VTK_UNSTRUCTURED_GRID)
00169 {
00170 vtkDebugMacro(<< "Executing Unstructured Grid Cutter");
00171 this->UnstructuredGridCutter(input, output);
00172 }
00173 else
00174 {
00175 vtkDebugMacro(<< "Executing DataSet Cutter");
00176
00177 }
00178
00179 return 1;
00180 }
00181 int vtkPointSetSlicer::RequestUpdateExtent(
00182 vtkInformation *,
00183 vtkInformationVector **inputVector,
00184 vtkInformationVector *)
00185 {
00186 vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
00187 inInfo->Set(vtkStreamingDemandDrivenPipeline::EXACT_EXTENT(), 1);
00188 return 1;
00189 }
00190 int vtkPointSetSlicer::FillInputPortInformation(int, vtkInformation *info)
00191 {
00192 info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkDataSet");
00193 return 1;
00194 }
00195
00196 void vtkPointSetSlicer::GetCellTypeDimensions(unsigned char* cellTypeDimensions)
00197 {
00198
00199 memset(cellTypeDimensions, 3, VTK_NUMBER_OF_CELL_TYPES);
00200 cellTypeDimensions[VTK_EMPTY_CELL] = 0;
00201 cellTypeDimensions[VTK_VERTEX] = 0;
00202 cellTypeDimensions[VTK_POLY_VERTEX] = 0;
00203 cellTypeDimensions[VTK_LINE] = 1;
00204 cellTypeDimensions[VTK_POLY_LINE] = 1;
00205 cellTypeDimensions[VTK_QUADRATIC_EDGE] = 1;
00206 cellTypeDimensions[VTK_PARAMETRIC_CURVE] = 1;
00207 cellTypeDimensions[VTK_TRIANGLE] = 2;
00208 cellTypeDimensions[VTK_TRIANGLE_STRIP] = 2;
00209 cellTypeDimensions[VTK_POLYGON] = 2;
00210 cellTypeDimensions[VTK_PIXEL] = 2;
00211 cellTypeDimensions[VTK_QUAD] = 2;
00212 cellTypeDimensions[VTK_QUADRATIC_TRIANGLE] = 2;
00213 cellTypeDimensions[VTK_QUADRATIC_QUAD] = 2;
00214 cellTypeDimensions[VTK_PARAMETRIC_SURFACE] = 2;
00215 cellTypeDimensions[VTK_PARAMETRIC_TRI_SURFACE] = 2;
00216 cellTypeDimensions[VTK_PARAMETRIC_QUAD_SURFACE] = 2;
00217 cellTypeDimensions[VTK_HIGHER_ORDER_EDGE] = 1;
00218 cellTypeDimensions[VTK_HIGHER_ORDER_TRIANGLE] = 2;
00219 cellTypeDimensions[VTK_HIGHER_ORDER_QUAD] = 2;
00220 cellTypeDimensions[VTK_HIGHER_ORDER_POLYGON] = 2;
00221 }
00222
00223
00224 void vtkPointSetSlicer::UnstructuredGridCutter(vtkDataSet *input, vtkPolyData *output)
00225 {
00226 vtkIdType cellId, i;
00227 vtkDoubleArray *cellScalars;
00228 vtkCellArray *newVerts, *newLines, *newPolys;
00229 vtkPoints *newPoints;
00230 vtkDoubleArray *cutScalars;
00231 double s;
00232 vtkIdType estimatedSize, numCells=input->GetNumberOfCells();
00233 vtkIdType numPts=input->GetNumberOfPoints();
00234 vtkIdType cellArrayIt = 0;
00235 int numCellPts;
00236 vtkPointData *inPD, *outPD;
00237 vtkCellData *inCD=input->GetCellData(), *outCD=output->GetCellData();
00238 vtkIdList *cellIds;
00239 int abortExecute = 0;
00240
00241 double range[2];
00242
00243
00244
00245 estimatedSize = (vtkIdType) pow ((double) numCells, .75);
00246 estimatedSize = estimatedSize / 1024 * 1024;
00247 if (estimatedSize < 1024)
00248 {
00249 estimatedSize = 1024;
00250 }
00251
00252 newPoints = vtkPoints::New();
00253 newPoints->Allocate(estimatedSize,estimatedSize/2);
00254 newVerts = vtkCellArray::New();
00255 newVerts->Allocate(estimatedSize,estimatedSize/2);
00256 newLines = vtkCellArray::New();
00257 newLines->Allocate(estimatedSize,estimatedSize/2);
00258 newPolys = vtkCellArray::New();
00259 newPolys->Allocate(estimatedSize,estimatedSize/2);
00260 cutScalars = vtkDoubleArray::New();
00261 cutScalars->SetNumberOfTuples(numPts);
00262
00263
00264 if ( this->GenerateCutScalars )
00265 {
00266 inPD = vtkPointData::New();
00267 inPD->ShallowCopy(input->GetPointData());
00268 inPD->SetScalars(cutScalars);
00269 }
00270 else
00271 {
00272 inPD = input->GetPointData();
00273 }
00274 outPD = output->GetPointData();
00275 outPD->InterpolateAllocate(inPD,estimatedSize,estimatedSize/2);
00276 outCD->CopyAllocate(inCD,estimatedSize,estimatedSize/2);
00277
00278
00279 if ( this->Locator == NULL )
00280 {
00281 this->CreateDefaultLocator();
00282 }
00283 this->Locator->InitPointInsertion (newPoints, input->GetBounds());
00284
00285
00286
00287 for ( i=0; i < numPts; i++ )
00288 {
00289 s = this->SlicePlane->FunctionValue(input->GetPoint(i));
00290 cutScalars->SetComponent(i,0,s);
00291 }
00292
00293
00294
00295 vtkIdType numCuts = numCells;
00296 vtkIdType progressInterval = numCuts/20 + 1;
00297 int cut=0;
00298
00299 vtkUnstructuredGrid *grid = (vtkUnstructuredGrid *)input;
00300 vtkIdType *cellArrayPtr = grid->GetCells()->GetPointer();
00301 double *scalarArrayPtr = cutScalars->GetPointer(0);
00302 double tempScalar;
00303 cellScalars = cutScalars->NewInstance();
00304 cellScalars->SetNumberOfComponents(cutScalars->GetNumberOfComponents());
00305 cellScalars->Allocate(VTK_CELL_SIZE*cutScalars->GetNumberOfComponents());
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321 int cellType;
00322 unsigned char cellTypeDimensions[VTK_NUMBER_OF_CELL_TYPES];
00323 this->GetCellTypeDimensions(cellTypeDimensions);
00324 int dimensionality;
00325
00326 for (dimensionality = 1; dimensionality <= 3; ++dimensionality)
00327 {
00328
00329
00330
00331 cellArrayIt = 0;
00332 for (cellId=0; cellId < numCells && !abortExecute; cellId++)
00333 {
00334 numCellPts = cellArrayPtr[cellArrayIt];
00335
00336 cellType = input->GetCellType(cellId);
00337 if (cellType >= VTK_NUMBER_OF_CELL_TYPES)
00338 {
00339 vtkErrorMacro("Unknown cell type " << cellType);
00340 cellArrayIt += 1+numCellPts;
00341 continue;
00342 }
00343 if (cellTypeDimensions[cellType] != dimensionality)
00344 {
00345 cellArrayIt += 1+numCellPts;
00346 continue;
00347 }
00348 cellArrayIt++;
00349
00350
00351 range[0] = scalarArrayPtr[cellArrayPtr[cellArrayIt]];
00352 range[1] = scalarArrayPtr[cellArrayPtr[cellArrayIt]];
00353 cellArrayIt++;
00354
00355 for (i = 1; i < numCellPts; i++)
00356 {
00357 tempScalar = scalarArrayPtr[cellArrayPtr[cellArrayIt]];
00358 cellArrayIt++;
00359 if (tempScalar <= range[0])
00360 {
00361 range[0] = tempScalar;
00362 }
00363 if (tempScalar >= range[1])
00364 {
00365 range[1] = tempScalar;
00366 }
00367 }
00368
00369 int needCell = 0;
00370 if (0 >= range[0] && 0 <= range[1])
00371 {
00372 needCell = 1;
00373 }
00374
00375 if (needCell)
00376 {
00377 vtkCell *cell = input->GetCell(cellId);
00378 cellIds = cell->GetPointIds();
00379 cutScalars->GetTuples(cellIds,cellScalars);
00380
00381 if (dimensionality == 3 && !(++cut % progressInterval) )
00382 {
00383 vtkDebugMacro(<<"Cutting #" << cut);
00384 this->UpdateProgress ((double)cut/numCuts);
00385 abortExecute = this->GetAbortExecute();
00386 }
00387
00388 this->ContourUnstructuredGridCell(cell, cellScalars, this->Locator,
00389 newVerts, newLines, newPolys, inPD, outPD,
00390 inCD, cellId, outCD);
00391 }
00392 }
00393 }
00394
00395
00396
00397
00398 cellScalars->Delete();
00399 cutScalars->Delete();
00400
00401 if ( this->GenerateCutScalars )
00402 {
00403 inPD->Delete();
00404 }
00405
00406 output->SetPoints(newPoints);
00407 newPoints->Delete();
00408
00409 if (newVerts->GetNumberOfCells())
00410 {
00411 output->SetVerts(newVerts);
00412 }
00413 newVerts->Delete();
00414
00415 if (newLines->GetNumberOfCells())
00416 {
00417 output->SetLines(newLines);
00418 }
00419 newLines->Delete();
00420
00421 if (newPolys->GetNumberOfCells())
00422 {
00423 output->SetPolys(newPolys);
00424 }
00425 newPolys->Delete();
00426
00427 this->Locator->Initialize();
00428 output->Squeeze();
00429 }
00430
00431 void vtkPointSetSlicer::ContourUnstructuredGridCell(vtkCell* cell,
00432 vtkDataArray* cellScalars, vtkPointLocator* locator,
00433 vtkCellArray* verts, vtkCellArray* lines,
00434 vtkCellArray* polys, vtkPointData* inPd,
00435 vtkPointData* outPd, vtkCellData* inCd,
00436 vtkIdType cellId, vtkCellData* outCd)
00437 {
00438 if (cell->GetCellType() == VTK_HEXAHEDRON)
00439 {
00440 static int CASE_MASK[8] = {1,2,4,8,16,32,64,128};
00441 POLY_CASES *polyCase;
00442 EDGE_LIST *edge;
00443 int i, j, index, *vert;
00444 volatile int pnum;
00445 int v1, v2, newCellId;
00446 double t, x1[3], x2[3], x[3], deltaScalar;
00447 vtkIdType offset = verts->GetNumberOfCells() + lines->GetNumberOfCells();
00448
00449
00450 for ( i=0, index = 0; i < 8; i++)
00451 {
00452 if (cellScalars->GetComponent(i,0) >= 0)
00453 {
00454 index |= CASE_MASK[i];
00455 }
00456 }
00457
00458 polyCase = polyCases + index;
00459 edge = polyCase->edges;
00460
00461
00462 pnum = 0;
00463 for (i = 0; i < 8; i++)
00464 if (edge[i] > -1) pnum++;
00465 else break;
00466
00467 vtkIdType* pts = new vtkIdType[pnum];
00468 for (i=0; i<pnum; i++)
00469 {
00470 vert = edges[edge[i]];
00471
00472
00473 deltaScalar = (cellScalars->GetComponent(vert[1],0)
00474 - cellScalars->GetComponent(vert[0],0));
00475 if (deltaScalar > 0)
00476 {
00477 v1 = vert[0]; v2 = vert[1];
00478 }
00479 else
00480 {
00481 v1 = vert[1]; v2 = vert[0];
00482 deltaScalar = -deltaScalar;
00483 }
00484
00485
00486 t = ( deltaScalar == 0.0 ? 0.0 : (-cellScalars->GetComponent(v1,0)) / deltaScalar );
00487
00488 cell->GetPoints()->GetPoint(v1, x1);
00489 cell->GetPoints()->GetPoint(v2, x2);
00490
00491 for (j=0; j<3; j++)
00492 {
00493 x[j] = x1[j] + t * (x2[j] - x1[j]);
00494 }
00495 if ( locator->InsertUniquePoint(x, pts[i]) )
00496 {
00497 if ( outPd )
00498 {
00499 vtkIdType p1 = cell->GetPointIds()->GetId(v1);
00500 vtkIdType p2 = cell->GetPointIds()->GetId(v2);
00501 outPd->InterpolateEdge(inPd,pts[i],p1,p2,t);
00502 }
00503 }
00504 }
00505
00506
00507 std::vector<vtkIdType> pset;
00508 for (i=0; i<pnum; i++)
00509 {
00510 if (std::find(pset.begin(), pset.end(), pts[i]) == pset.end())
00511 pset.push_back(pts[i]);
00512 }
00513
00514 if (pset.size() > 2)
00515 {
00516 i = 0;
00517 for (std::vector<vtkIdType>::iterator iter = pset.begin(); iter != pset.end(); iter++)
00518 {
00519 pts[i] = *iter;
00520 i++;
00521 }
00522 newCellId = offset + polys->InsertNextCell(pset.size(),pts);
00523 outCd->CopyData(inCd,cellId,newCellId);
00524 }
00525 delete [] pts;
00526
00527 }
00528 else
00529 {
00530 cell->Contour(0, cellScalars, locator, verts, lines, polys,
00531 inPd, outPd, inCd, cellId, outCd);
00532 }
00533 }
00534
00535
00536
00537 void vtkPointSetSlicer::SetLocator(vtkPointLocator *locator)
00538 {
00539 if ( this->Locator == locator )
00540 {
00541 return;
00542 }
00543 if ( this->Locator )
00544 {
00545 this->Locator->UnRegister(this);
00546 this->Locator = 0;
00547 }
00548 if ( locator )
00549 {
00550 locator->Register(this);
00551 }
00552 this->Locator = locator;
00553 this->Modified();
00554 }
00555
00556 void vtkPointSetSlicer::CreateDefaultLocator()
00557 {
00558 if ( this->Locator == 0 )
00559 {
00560 this->Locator = vtkMergePoints::New();
00561 this->Locator->Register(this);
00562 this->Locator->Delete();
00563 }
00564 }
00565
00566
00567 void vtkPointSetSlicer::PrintSelf(std::ostream& os, vtkIndent indent)
00568 {
00569 this->Superclass::PrintSelf(os,indent);
00570
00571 os << indent << "Slice Plane: " << this->SlicePlane << "\n";
00572
00573 if ( this->Locator )
00574 {
00575 os << indent << "Locator: " << this->Locator << "\n";
00576 }
00577 else
00578 {
00579 os << indent << "Locator: (none)\n";
00580 }
00581
00582 os << indent << "Generate Cut Scalars: "
00583 << (this->GenerateCutScalars ? "On\n" : "Off\n");
00584 }
00585
00586 int vtkPointSetSlicer::edges[12][2] = { {0,1},{1,2},{3,2},{0,3},
00587 {4,5},{5,6},{7,6},{4,7},
00588 {0,4},{1,5},{2,6},{3,7} };
00589
00590 vtkPointSetSlicer::POLY_CASES
00591 vtkPointSetSlicer::polyCases[256] = {
00592 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00593 {{0, 3, 8, -1, -1, -1, -1, -1}},
00594 {{1, 0, 9, -1, -1, -1, -1, -1}},
00595 {{1, 3, 8, 9, -1, -1, -1, -1}},
00596 {{2, 1, 10, -1, -1, -1, -1, -1}},
00597 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00598 {{2, 0, 9, 10, -1, -1, -1, -1}},
00599 {{2, 10, 9, 8, 3, -1, -1, -1}},
00600 {{3, 2, 11, -1, -1, -1, -1, -1}},
00601 {{0, 2, 11, 8, -1, -1, -1, -1}},
00602 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00603 {{1, 9, 8, 11, 2, -1, -1, -1}},
00604 {{3, 1, 10, 11, -1, -1, -1, -1}},
00605 {{0, 8, 11, 10, 1, -1, -1, -1}},
00606 {{3, 11, 10, 9, 0, -1, -1, -1}},
00607 {{8, 9, 10, 11, -1, -1, -1, -1}},
00608 {{4, 7, 8, -1, -1, -1, -1, -1}},
00609 {{3, 7, 4, 0, -1, -1, -1, -1}},
00610 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00611 {{9, 1, 3, 7, 4, -1, -1, -1}},
00612 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00613 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00614 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00615 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00616 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00617 {{11, 2, 0, 4, 7, -1, -1, -1}},
00618 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00619 {{1, 2, 11, 7, 4, 9, -1, -1}},
00620 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00621 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00622 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00623 {{4, 7, 11, 10, 9, -1, -1, -1}},
00624 {{5, 4, 9, -1, -1, -1, -1, -1}},
00625 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00626 {{0, 4, 5, 1, -1, -1, -1, -1}},
00627 {{8, 3, 1, 5, 4, -1, -1, -1}},
00628 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00629 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00630 {{10, 2, 0, 4, 5, -1, -1, -1}},
00631 {{2, 3, 8, 4, 5, 10, -1, -1}},
00632 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00633 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00634 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00635 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00636 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00637 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00638 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00639 {{5, 4, 8, 11, 10, -1, -1, -1}},
00640 {{5, 7, 8, 9, -1, -1, -1, -1}},
00641 {{9, 5, 7, 3, 0, -1, -1, -1}},
00642 {{8, 7, 5, 1, 0, -1, -1, -1}},
00643 {{1, 3, 7, 5, -1, -1, -1, -1}},
00644 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00645 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00646 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00647 {{2, 10, 5, 7, 3, -1, -1, -1}},
00648 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00649 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00650 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00651 {{2, 11, 7, 5, 1, -1, -1, -1}},
00652 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00653 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00654 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00655 {{5, 7, 11, 10, -1, -1, -1, -1}},
00656 {{6, 5, 10, -1, -1, -1, -1, -1}},
00657 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00658 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00659 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00660 {{1, 5, 6, 2, -1, -1, -1, -1}},
00661 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00662 {{9, 0, 2, 6, 5, -1, -1, -1}},
00663 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00664 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00665 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00666 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00667 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00668 {{11, 3, 1, 5, 6, -1, -1, -1}},
00669 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00670 {{3, 0, 9, 5, 6, 11, -1, -1}},
00671 {{6, 5, 9, 8, 11, -1, -1, -1}},
00672 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00673 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00674 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00675 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00676 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00677 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00678 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00679 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00680 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00681 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00682 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00683 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00684 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00685 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00686 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00687 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00688 {{6, 4, 9, 10, -1, -1, -1, -1}},
00689 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00690 {{10, 6, 4, 0, 1, -1, -1, -1}},
00691 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00692 {{9, 4, 6, 2, 1, -1, -1, -1}},
00693 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00694 {{2, 0, 4, 6, -1, -1, -1, -1}},
00695 {{3, 8, 4, 6, 2, -1, -1, -1}},
00696 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00697 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00698 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00699 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00700 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00701 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00702 {{3, 11, 6, 4, 0, -1, -1, -1}},
00703 {{6, 4, 8, 11, -1, -1, -1, -1}},
00704 {{6, 10, 9, 8, 7, -1, -1, -1}},
00705 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00706 {{6, 7, 8, 0, 1, 10, -1, -1}},
00707 {{6, 10, 1, 3, 7, -1, -1, -1}},
00708 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00709 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00710 {{7, 8, 0, 2, 6, -1, -1, -1}},
00711 {{2, 6, 7, 3, -1, -1, -1, -1}},
00712 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00713 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00714 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00715 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00716 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00717 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00718 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00719 {{6, 7, 11, -1, -1, -1, -1, -1}},
00720 {{7, 6, 11, -1, -1, -1, -1, -1}},
00721 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00722 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00723 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00724 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00725 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00726 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00727 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00728 {{2, 6, 7, 3, -1, -1, -1, -1}},
00729 {{8, 0, 2, 6, 7, -1, -1, -1}},
00730 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00731 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00732 {{10, 1, 3, 7, 6, -1, -1, -1}},
00733 {{0, 1, 10, 6, 7, 8, -1, -1}},
00734 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00735 {{7, 6, 10, 9, 8, -1, -1, -1}},
00736 {{4, 6, 11, 8, -1, -1, -1, -1}},
00737 {{11, 6, 4, 0, 3, -1, -1, -1}},
00738 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00739 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00740 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00741 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00742 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00743 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00744 {{8, 4, 6, 2, 3, -1, -1, -1}},
00745 {{0, 2, 6, 4, -1, -1, -1, -1}},
00746 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00747 {{1, 9, 4, 6, 2, -1, -1, -1}},
00748 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00749 {{1, 10, 6, 4, 0, -1, -1, -1}},
00750 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00751 {{4, 6, 10, 9, -1, -1, -1, -1}},
00752 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00753 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00754 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00755 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00756 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00757 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00758 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00759 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00760 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00761 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00762 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00763 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00764 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00765 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00766 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00767 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00768 {{5, 9, 8, 11, 6, -1, -1, -1}},
00769 {{5, 6, 11, 3, 0, 9, -1, -1}},
00770 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00771 {{6, 11, 3, 1, 5, -1, -1, -1}},
00772 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00773 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00774 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00775 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00776 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00777 {{5, 9, 0, 2, 6, -1, -1, -1}},
00778 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00779 {{1, 5, 6, 2, -1, -1, -1, -1}},
00780 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00781 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00782 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00783 {{5, 6, 10, -1, -1, -1, -1, -1}},
00784 {{7, 5, 10, 11, -1, -1, -1, -1}},
00785 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00786 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00787 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00788 {{11, 7, 5, 1, 2, -1, -1, -1}},
00789 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00790 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00791 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00792 {{10, 5, 7, 3, 2, -1, -1, -1}},
00793 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00794 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00795 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00796 {{3, 1, 5, 7, -1, -1, -1, -1}},
00797 {{0, 8, 7, 5, 1, -1, -1, -1}},
00798 {{0, 9, 5, 7, 3, -1, -1, -1}},
00799 {{7, 5, 9, 8, -1, -1, -1, -1}},
00800 {{4, 8, 11, 10, 5, -1, -1, -1}},
00801 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00802 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00803 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00804 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00805 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00806 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00807 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00808 {{4, 5, 10, 2, 3, 8, -1, -1}},
00809 {{5, 10, 2, 0, 4, -1, -1, -1}},
00810 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00811 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00812 {{4, 8, 3, 1, 5, -1, -1, -1}},
00813 {{0, 4, 5, 1, -1, -1, -1, -1}},
00814 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00815 {{4, 5, 9, -1, -1, -1, -1, -1}},
00816 {{7, 11, 10, 9, 4, -1, -1, -1}},
00817 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00818 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00819 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00820 {{7, 4, 9, 1, 2, 11, -1, -1}},
00821 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00822 {{7, 11, 2, 0, 4, -1, -1, -1}},
00823 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00824 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00825 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00826 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00827 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00828 {{4, 9, 1, 3, 7, -1, -1, -1}},
00829 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00830 {{3, 7, 4, 0, -1, -1, -1, -1}},
00831 {{7, 4, 8, -1, -1, -1, -1, -1}},
00832 {{10, 11, 8, 9, -1, -1, -1, -1}},
00833 {{0, 3, 11, 10, 9, -1, -1, -1}},
00834 {{1, 0, 8, 11, 10, -1, -1, -1}},
00835 {{1, 3, 11, 10, -1, -1, -1, -1}},
00836 {{2, 1, 9, 8, 11, -1, -1, -1}},
00837 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00838 {{2, 0, 8, 11, -1, -1, -1, -1}},
00839 {{2, 3, 11, -1, -1, -1, -1, -1}},
00840 {{3, 2, 10, 9, 8, -1, -1, -1}},
00841 {{0, 2, 10, 9, -1, -1, -1, -1}},
00842 {{-1, -1, -1, -1, -1, -1, -1, -1}},
00843 {{1, 2, 10, -1, -1, -1, -1, -1}},
00844 {{3, 1, 9, 8, -1, -1, -1, -1}},
00845 {{0, 1, 9, -1, -1, -1, -1, -1}},
00846 {{3, 0, 8, -1, -1, -1, -1, -1}},
00847 {{-1, -1, -1, -1, -1, -1, -1, -1}}
00848 };