17 #ifndef __itkBinaryMask3DMeshSource_txx
18 #define __itkBinaryMask3DMeshSource_txx
21 #ifdef __INTEL_COMPILER
22 #pragma warning(disable: 592)
26 #include "itkNumericTraits.h"
31 template<
class TInputImage,
class TOutputMesh>
36 this->SetNumberOfRequiredInputs(1);
46 m_CurrentRowIndex = 0;
47 m_CurrentFrameIndex = 0;
54 m_CurrentRowNum = 200;
55 m_CurrentFrameNum = 2000;
56 this->GetOutput()->GetPoints()->Reserve(m_NodeLimit);
57 this->GetOutput()->GetCells()->Reserve(m_CellLimit);
59 m_ObjectValue = NumericTraits< InputPixelType >::One;
62 template<
class TInputImage,
class TOutputMesh>
70 for (i = 0; i < 2000; i++)
72 free(m_CurrentFrame[i]);
74 free (m_CurrentFrame);
78 for (i = 0; i < 200; i++)
80 free(m_CurrentRow[i]);
86 for (i = 0; i < m_LastFrameNum; i++)
94 for (i = 0; i < m_LastRowNum; i++)
103 template<
class TInputImage,
class TOutputMesh>
109 const_cast< InputImageType * >( image ) );
113 template<
class TInputImage,
class TOutputMesh>
118 this->InitializeLUT();
122 template<
class TInputImage,
class TOutputMesh>
127 unsigned char nodeindex;
134 switch ( (
int)nodeindex )
175 template<
class TInputImage,
class TOutputMesh>
180 unsigned char nodeindex;
187 switch ( (
int)nodeindex )
228 template<
class TInputImage,
class TOutputMesh>
233 unsigned char nodeindex;
240 switch ( (
int)nodeindex )
281 template<
class TInputImage,
class TOutputMesh>
286 unsigned char nodeindex;
293 switch ( (
int)nodeindex )
338 template<
class TInputImage,
class TOutputMesh>
343 unsigned char nodeindex;
350 switch ( (
int)nodeindex )
395 template<
class TInputImage,
class TOutputMesh>
400 unsigned char nodeindex;
407 switch ( (
int)nodeindex )
452 template<
class TInputImage,
class TOutputMesh>
463 template<
class TInputImage,
class TOutputMesh>
981 m_LocationOffset[1][0] = 0.5;
982 m_LocationOffset[2][0] = 1;
983 m_LocationOffset[3][0] = 0.5;
984 m_LocationOffset[4][0] = 0;
985 m_LocationOffset[5][0] = 0.5;
986 m_LocationOffset[6][0] = 1;
987 m_LocationOffset[7][0] = 0.5;
988 m_LocationOffset[8][0] = 0;
989 m_LocationOffset[9][0] = 0;
990 m_LocationOffset[10][0] = 1;
991 m_LocationOffset[11][0] = 1;
992 m_LocationOffset[12][0] = 0;
993 m_LocationOffset[13][0] = 0.5;
994 m_LocationOffset[1][1] = 0;
995 m_LocationOffset[2][1] = 0.5;
996 m_LocationOffset[3][1] = 1;
997 m_LocationOffset[4][1] = 0.5;
998 m_LocationOffset[5][1] = 0;
999 m_LocationOffset[6][1] = 0.5;
1000 m_LocationOffset[7][1] = 1;
1001 m_LocationOffset[8][1] = 0.5;
1002 m_LocationOffset[9][1] = 0;
1003 m_LocationOffset[10][1] = 0;
1004 m_LocationOffset[11][1] = 1;
1005 m_LocationOffset[12][1] = 1;
1006 m_LocationOffset[13][1] = 0.5;
1007 m_LocationOffset[1][2] = 0;
1008 m_LocationOffset[2][2] = 0;
1009 m_LocationOffset[3][2] = 0;
1010 m_LocationOffset[4][2] = 0;
1011 m_LocationOffset[5][2] = 1;
1012 m_LocationOffset[6][2] = 1;
1013 m_LocationOffset[7][2] = 1;
1014 m_LocationOffset[8][2] = 1;
1015 m_LocationOffset[9][2] = 0.5;
1016 m_LocationOffset[10][2] = 0.5;
1017 m_LocationOffset[11][2] = 0.5;
1018 m_LocationOffset[12][2] = 0.5;
1019 m_LocationOffset[13][2] = 0.5;
1023 template<
class TInputImage,
class TOutputMesh>
1038 m_NumberOfCells = 0;
1039 m_NumberOfNodes = 0;
1043 m_LastVoxelIndex = 0;
1044 m_LastFrameIndex = 0;
1045 m_CurrentRowIndex = 0;
1046 m_CurrentFrameIndex = 0;
1053 m_CurrentRowNum = 200;
1054 m_CurrentFrameNum = 2000;
1070 m_ImageWidth = inputImageSize[0];
1071 m_ImageHeight = inputImageSize[1];
1072 m_ImageDepth = inputImageSize[2];
1073 int frame = m_ImageWidth * m_ImageHeight;
1074 int row = m_ImageWidth;
1095 unsigned char vertexindex;
1099 for (i = 0; i < 200; i++)
1101 free(m_CurrentRow[i]);
1103 free (m_CurrentRow);
1105 m_CurrentRow = (
unsigned long ** ) malloc( 200*
sizeof(
unsigned long *) );
1106 for ( i=0; i<200; i++ )
1108 m_CurrentRow[i] = (
unsigned long * ) malloc( 2*
sizeof(
unsigned long ) );
1113 for (i = 0; i < 2000; i++)
1115 free(m_CurrentFrame[i]);
1117 free (m_CurrentFrame);
1120 m_CurrentFrame = (
unsigned long ** ) malloc( 2000*
sizeof(
unsigned short *) );
1122 for ( i=0; i<2000; i++ )
1124 m_CurrentFrame[i] = (
unsigned long * ) malloc( 2*
sizeof(
unsigned long ) );
1129 while ( !it4.IsAtEnd() )
1133 if ( it1.Value() == m_ObjectValue ) vertexindex += 1;
1134 if ( it2.Value() == m_ObjectValue ) vertexindex += 8;
1135 if ( it3.Value() == m_ObjectValue ) vertexindex += 16;
1136 if ( it4.Value() == m_ObjectValue ) vertexindex += 128;
1143 if (( i % m_ImageWidth < m_ImageWidth - 1 ) && ((i % (m_ImageWidth*m_ImageHeight)) / m_ImageWidth < m_ImageHeight - 1) )
1145 if ( it1.Value() == m_ObjectValue ) vertexindex += 2;
1146 if ( it2.Value() == m_ObjectValue ) vertexindex += 4;
1147 if ( it3.Value() == m_ObjectValue ) vertexindex += 32;
1148 if ( it4.Value() == m_ObjectValue ) vertexindex += 64;
1152 if ((i % (m_ImageWidth*m_ImageHeight)) / m_ImageWidth == m_ImageHeight - 1)
1154 if ( vertexindex > 50 ) vertexindex -= 128;
1155 if ( ((vertexindex > 7) && (vertexindex < 10)) || (vertexindex > 17) ) vertexindex -= 8;
1156 if ( it1.Value() == m_ObjectValue ) vertexindex += 2;
1157 if ( it3.Value() == m_ObjectValue ) vertexindex += 32;
1161 for ( j=0; j<14; j++ ) m_CurrentVoxel[j] = 0;
1163 if ( ( vertexindex == 0 ) || (vertexindex == 255 ) )
1169 this->AddCells( m_LUT[vertexindex][0], m_LUT[vertexindex][1], i );
1177 this->GetOutput()->SetBufferedRegion( this->GetOutput()->GetRequestedRegion() );
1182 template<
class TInputImage,
class TOutputMesh>
1185 ::AddCells(
unsigned char celltype,
unsigned char celltran,
int index )
1188 unsigned long **currentrowtmp;
1189 unsigned long **currentframetmp;
1190 currentrowtmp = (
unsigned long ** ) malloc( 4*
sizeof(
unsigned long *) );
1191 for ( i=0; i<4; i++ )
1193 currentrowtmp[i] = (
unsigned long * ) malloc( 2*
sizeof(
unsigned long ) );
1194 currentrowtmp[i][0] = 0;
1195 currentrowtmp[i][1] = 0;
1197 currentframetmp = (
unsigned long ** ) malloc( 4*
sizeof(
unsigned long *) );
1198 for ( i=0; i<4; i++ )
1200 currentframetmp[i] = (
unsigned long * ) malloc( 2*
sizeof(
unsigned long ) );
1201 currentframetmp[i][0] = 0;
1202 currentframetmp[i][1] = 0;
1205 if ( (index % m_ImageWidth == 0) || (index > m_LastVoxelIndex + 1) )
1208 for (i=0; i<14; i++)
1218 if ( ((index % (m_ImageWidth*m_ImageHeight)) < m_ImageWidth) ||
1219 ((index / m_ImageWidth) > m_LastRowIndex + 1) )
1228 if ( ( index < m_ImageWidth*m_ImageHeight) ||
1229 ((index / (m_ImageWidth*m_ImageHeight)) > m_LastFrameIndex + 1) )
1239 if ( m_RowFlag == 1 )
1241 if ( (index / m_ImageWidth) != m_LastRowIndex )
1243 if ( m_LastRowNum == 0 )
1245 m_LastRow = (
unsigned long ** ) malloc( m_CurrentRowIndex*
sizeof(
unsigned long *) );
1249 if (m_LastRowNum > m_CurrentRowIndex)
1251 for (i = m_CurrentRowIndex; i < m_LastRowNum; i++)
1256 m_LastRow = (
unsigned long ** ) realloc( m_LastRow, m_CurrentRowIndex*
sizeof(
unsigned long *) );
1258 for ( i=0; i<m_CurrentRowIndex; i++ )
1260 if ( i > m_LastRowNum-1 )
1262 m_LastRow[i] = (
unsigned long *) malloc( 2*
sizeof(
unsigned long ) );
1264 m_LastRow[i][0] = m_CurrentRow[i][0];
1265 m_LastRow[i][1] = m_CurrentRow[i][1];
1267 m_LastRowNum = m_CurrentRowIndex;
1268 m_CurrentRowIndex = 0;
1273 if ( m_ColFlag == 0 )
1275 if ( m_LastRowNum > 0 )
1277 for ( i=0; i<m_LastRowNum; i++ )
1279 free (m_LastRow[i]);
1288 if ( m_FrameFlag == 1 )
1290 if ( (index / (m_ImageWidth * m_ImageHeight)) != m_LastFrameIndex )
1292 if ( m_LastFrameNum == 0 )
1294 m_LastFrame = (
unsigned long ** ) malloc( m_CurrentFrameIndex*
sizeof(
unsigned long *) );
1298 if (m_LastFrameNum > m_CurrentFrameIndex)
1300 for (i = m_CurrentFrameIndex; i < m_LastFrameNum; i++)
1302 free(m_LastFrame[i]);
1305 m_LastFrame = (
unsigned long ** ) realloc( m_LastFrame, m_CurrentFrameIndex*
sizeof(
unsigned long *) );
1307 for ( i=0; i<m_CurrentFrameIndex; i++ )
1309 if ( i > m_LastFrameNum-1 )
1311 m_LastFrame[i] = (
unsigned long * ) malloc( 2*
sizeof(
unsigned long ) );
1313 m_LastFrame[i][0] = m_CurrentFrame[i][0];
1314 m_LastFrame[i][1] = m_CurrentFrame[i][1];
1316 m_LastFrameNum = m_CurrentFrameIndex;
1317 m_CurrentFrameIndex = 0;
1322 if ( index % (m_ImageWidth * m_ImageHeight) == 0 )
1324 for ( i=0; i<m_LastFrameNum; i++ )
1326 free (m_LastFrame[i]);
1333 m_LastVoxelIndex = index;
1334 m_LastRowIndex = index / m_ImageWidth;
1335 m_LastFrameIndex = index / (m_ImageWidth*m_ImageHeight);
1337 m_AvailableNodes[1] = 0;
1338 m_AvailableNodes[2] = 0;
1339 m_AvailableNodes[3] = 0;
1340 m_AvailableNodes[4] = 0;
1341 m_AvailableNodes[5] = 0;
1342 m_AvailableNodes[6] = 1;
1343 m_AvailableNodes[7] = 1;
1344 m_AvailableNodes[8] = 0;
1345 m_AvailableNodes[9] = 0;
1346 m_AvailableNodes[10] = 0;
1347 m_AvailableNodes[11] = 1;
1348 m_AvailableNodes[12] = 0;
1349 m_AvailableNodes[13] = 1;
1351 if ( m_ColFlag == 0 )
1353 m_AvailableNodes[4] = 1;
1354 m_AvailableNodes[8] = 1;
1355 m_AvailableNodes[9] = 1;
1356 m_AvailableNodes[12] = 1;
1359 if ( m_RowFlag == 0 )
1361 m_AvailableNodes[1] = 1;
1362 m_AvailableNodes[5] = 1;
1363 m_AvailableNodes[9] = 1;
1364 m_AvailableNodes[10] = 1;
1368 if ( m_FrameFlag == 0 )
1370 m_AvailableNodes[1] = 1;
1371 m_AvailableNodes[2] = 1;
1372 m_AvailableNodes[3] = 1;
1373 m_AvailableNodes[4] = 1;
1376 typename TriCell::CellAutoPointer insertCell;
1377 unsigned long tripoints[3];
1379 tp = (
unsigned char *) malloc( 3*
sizeof(
unsigned char ) );
1382 tpl = (
unsigned long *) malloc( 3*
sizeof(
unsigned long ) );
1384 switch ( (
int) celltype )
1390 CellTransfer( tp, celltran );
1391 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
1392 tripoints[0] = tpl[0];
1393 tripoints[1] = tpl[2];
1394 tripoints[2] = tpl[1];
1395 insertCell.TakeOwnership(
new TriCell );
1396 insertCell->SetPointIds(tripoints);
1397 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
1398 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
1405 CellTransfer( tp, celltran );
1406 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
1407 tripoints[0] = tpl[0];
1408 tripoints[1] = tpl[2];
1409 tripoints[2] = tpl[1];
1410 insertCell.TakeOwnership(
new TriCell );
1411 insertCell->SetPointIds(tripoints);
1412 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
1413 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
1418 CellTransfer( tp, celltran );
1419 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
1420 tripoints[0] = tpl[0];
1421 tripoints[1] = tpl[2];
1422 tripoints[2] = tpl[1];
1423 insertCell.TakeOwnership(
new TriCell );
1424 insertCell->SetPointIds(tripoints);
1425 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
1426 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
1433 CellTransfer( tp, celltran );
1434 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
1435 tripoints[0] = tpl[0];
1436 tripoints[1] = tpl[2];
1437 tripoints[2] = tpl[1];
1438 insertCell.TakeOwnership(
new TriCell );
1439 insertCell->SetPointIds(tripoints);
1440 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
1441 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
1446 CellTransfer( tp, celltran );
1447 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
1448 tripoints[0] = tpl[0];
1449 tripoints[1] = tpl[2];
1450 tripoints[2] = tpl[1];
1451 insertCell.TakeOwnership(
new TriCell );
1452 insertCell->SetPointIds(tripoints);
1453 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
1454 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
1461 CellTransfer( tp, celltran );
1462 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
1463 tripoints[0] = tpl[0];
1464 tripoints[1] = tpl[2];
1465 tripoints[2] = tpl[1];
1466 insertCell.TakeOwnership(
new TriCell );
1467 insertCell->SetPointIds(tripoints);
1468 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
1469 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
1474 CellTransfer( tp, celltran );
1475 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
1476 tripoints[0] = tpl[0];
1477 tripoints[1] = tpl[2];
1478 tripoints[2] = tpl[1];
1479 insertCell.TakeOwnership(
new TriCell );
1480 insertCell->SetPointIds(tripoints);
1481 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
1482 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
1489 CellTransfer( tp, celltran );
1490 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
1491 tripoints[0] = tpl[0];
1492 tripoints[1] = tpl[2];
1493 tripoints[2] = tpl[1];
1494 insertCell.TakeOwnership(
new TriCell );
1495 insertCell->SetPointIds(tripoints);
1496 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
1497 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
1502 CellTransfer( tp, celltran );
1503 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
1504 tripoints[0] = tpl[0];
1505 tripoints[1] = tpl[2];
1506 tripoints[2] = tpl[1];
1507 insertCell.TakeOwnership(
new TriCell );
1508 insertCell->SetPointIds(tripoints);
1509 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
1510 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
1515 CellTransfer( tp, celltran );
1516 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
1517 tripoints[0] = tpl[0];
1518 tripoints[1] = tpl[2];
1519 tripoints[2] = tpl[1];
1520 insertCell.TakeOwnership(
new TriCell );
1521 insertCell->SetPointIds(tripoints);
1522 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
1523 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
1528 CellTransfer( tp, celltran );
1529 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
1530 tripoints[0] = tpl[0];
1531 tripoints[1] = tpl[2];
1532 tripoints[2] = tpl[1];
1533 insertCell.TakeOwnership(
new TriCell );
1534 insertCell->SetPointIds(tripoints);
1535 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
1536 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
1541 CellTransfer( tp, celltran );
1542 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
1543 tripoints[0] = tpl[0];
1544 tripoints[1] = tpl[2];
1545 tripoints[2] = tpl[1];
1546 insertCell.TakeOwnership(
new TriCell );
1547 insertCell->SetPointIds(tripoints);
1548 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
1549 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
1556 CellTransfer( tp, celltran );
1557 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
1558 tripoints[0] = tpl[0];
1559 tripoints[1] = tpl[2];
1560 tripoints[2] = tpl[1];
1561 insertCell.TakeOwnership(
new TriCell );
1562 insertCell->SetPointIds(tripoints);
1563 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
1564 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
1569 CellTransfer( tp, celltran );
1570 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
1571 tripoints[0] = tpl[0];
1572 tripoints[1] = tpl[2];
1573 tripoints[2] = tpl[1];
1574 insertCell.TakeOwnership(
new TriCell );
1575 insertCell->SetPointIds(tripoints);
1576 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
1577 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
1582 CellTransfer( tp, celltran );
1583 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
1584 tripoints[0] = tpl[0];
1585 tripoints[1] = tpl[2];
1586 tripoints[2] = tpl[1];
1587 insertCell.TakeOwnership(
new TriCell );
1588 insertCell->SetPointIds(tripoints);
1589 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
1590 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
1597 CellTransfer( tp, celltran );
1598 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
1599 tripoints[0] = tpl[0];
1600 tripoints[1] = tpl[2];
1601 tripoints[2] = tpl[1];
1602 insertCell.TakeOwnership(
new TriCell );
1603 insertCell->SetPointIds(tripoints);
1604 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
1605 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
1610 CellTransfer( tp, celltran );
1611 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
1612 tripoints[0] = tpl[0];
1613 tripoints[1] = tpl[2];
1614 tripoints[2] = tpl[1];
1615 insertCell.TakeOwnership(
new TriCell );
1616 insertCell->SetPointIds(tripoints);
1617 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
1618 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
1623 CellTransfer( tp, celltran );
1624 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
1625 tripoints[0] = tpl[0];
1626 tripoints[1] = tpl[2];
1627 tripoints[2] = tpl[1];
1628 insertCell.TakeOwnership(
new TriCell );
1629 insertCell->SetPointIds(tripoints);
1630 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
1631 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
1638 CellTransfer( tp, celltran );
1639 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
1640 tripoints[0] = tpl[0];
1641 tripoints[1] = tpl[2];
1642 tripoints[2] = tpl[1];
1643 insertCell.TakeOwnership(
new TriCell );
1644 insertCell->SetPointIds(tripoints);
1645 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
1646 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
1651 CellTransfer( tp, celltran );
1652 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
1653 tripoints[0] = tpl[0];
1654 tripoints[1] = tpl[2];
1655 tripoints[2] = tpl[1];
1656 insertCell.TakeOwnership(
new TriCell );
1657 insertCell->SetPointIds(tripoints);
1658 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
1659 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
1664 CellTransfer( tp, celltran );
1665 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
1666 tripoints[0] = tpl[0];
1667 tripoints[1] = tpl[2];
1668 tripoints[2] = tpl[1];
1669 insertCell.TakeOwnership(
new TriCell );
1670 insertCell->SetPointIds(tripoints);
1671 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
1672 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
1677 CellTransfer( tp, celltran );
1678 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
1679 tripoints[0] = tpl[0];
1680 tripoints[1] = tpl[2];
1681 tripoints[2] = tpl[1];
1682 insertCell.TakeOwnership(
new TriCell );
1683 insertCell->SetPointIds(tripoints);
1684 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
1685 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
1692 CellTransfer( tp, celltran );
1693 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
1694 tripoints[0] = tpl[0];
1695 tripoints[1] = tpl[2];
1696 tripoints[2] = tpl[1];
1697 insertCell.TakeOwnership(
new TriCell );
1698 insertCell->SetPointIds(tripoints);
1699 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
1700 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
1705 CellTransfer( tp, celltran );
1706 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
1707 tripoints[0] = tpl[0];
1708 tripoints[1] = tpl[2];
1709 tripoints[2] = tpl[1];
1710 insertCell.TakeOwnership(
new TriCell );
1711 insertCell->SetPointIds(tripoints);
1712 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
1713 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
1718 CellTransfer( tp, celltran );
1719 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
1720 tripoints[0] = tpl[0];
1721 tripoints[1] = tpl[2];
1722 tripoints[2] = tpl[1];
1723 insertCell.TakeOwnership(
new TriCell );
1724 insertCell->SetPointIds(tripoints);
1725 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
1726 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
1731 CellTransfer( tp, celltran );
1732 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
1733 tripoints[0] = tpl[0];
1734 tripoints[1] = tpl[2];
1735 tripoints[2] = tpl[1];
1736 insertCell.TakeOwnership(
new TriCell );
1737 insertCell->SetPointIds(tripoints);
1738 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
1739 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
1744 CellTransfer( tp, celltran );
1745 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
1746 tripoints[0] = tpl[0];
1747 tripoints[1] = tpl[2];
1748 tripoints[2] = tpl[1];
1749 insertCell.TakeOwnership(
new TriCell );
1750 insertCell->SetPointIds(tripoints);
1751 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
1752 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
1757 CellTransfer( tp, celltran );
1758 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
1759 tripoints[0] = tpl[0];
1760 tripoints[1] = tpl[2];
1761 tripoints[2] = tpl[1];
1762 insertCell.TakeOwnership(
new TriCell );
1763 insertCell->SetPointIds(tripoints);
1764 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
1765 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
1772 CellTransfer( tp, celltran );
1773 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
1774 tripoints[0] = tpl[0];
1775 tripoints[1] = tpl[2];
1776 tripoints[2] = tpl[1];
1777 insertCell.TakeOwnership(
new TriCell );
1778 insertCell->SetPointIds(tripoints);
1779 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
1780 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
1785 CellTransfer( tp, celltran );
1786 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
1787 tripoints[0] = tpl[0];
1788 tripoints[1] = tpl[2];
1789 tripoints[2] = tpl[1];
1790 insertCell.TakeOwnership(
new TriCell );
1791 insertCell->SetPointIds(tripoints);
1792 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
1793 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
1798 CellTransfer( tp, celltran );
1799 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
1800 tripoints[0] = tpl[0];
1801 tripoints[1] = tpl[2];
1802 tripoints[2] = tpl[1];
1803 insertCell.TakeOwnership(
new TriCell );
1804 insertCell->SetPointIds(tripoints);
1805 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
1806 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
1811 CellTransfer( tp, celltran );
1812 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
1813 tripoints[0] = tpl[0];
1814 tripoints[1] = tpl[2];
1815 tripoints[2] = tpl[1];
1816 insertCell.TakeOwnership(
new TriCell );
1817 insertCell->SetPointIds(tripoints);
1818 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
1819 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
1826 CellTransfer( tp, celltran );
1827 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
1828 tripoints[0] = tpl[0];
1829 tripoints[1] = tpl[2];
1830 tripoints[2] = tpl[1];
1831 insertCell.TakeOwnership(
new TriCell );
1832 insertCell->SetPointIds(tripoints);
1833 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
1834 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
1839 CellTransfer( tp, celltran );
1840 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
1841 tripoints[0] = tpl[0];
1842 tripoints[1] = tpl[2];
1843 tripoints[2] = tpl[1];
1844 insertCell.TakeOwnership(
new TriCell );
1845 insertCell->SetPointIds(tripoints);
1846 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
1847 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
1852 CellTransfer( tp, celltran );
1853 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
1854 tripoints[0] = tpl[0];
1855 tripoints[1] = tpl[2];
1856 tripoints[2] = tpl[1];
1857 insertCell.TakeOwnership(
new TriCell );
1858 insertCell->SetPointIds(tripoints);
1859 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
1860 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
1865 CellTransfer( tp, celltran );
1866 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
1867 tripoints[0] = tpl[0];
1868 tripoints[1] = tpl[2];
1869 tripoints[2] = tpl[1];
1870 insertCell.TakeOwnership(
new TriCell );
1871 insertCell->SetPointIds(tripoints);
1872 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
1873 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
1878 CellTransfer( tp, celltran );
1879 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
1880 tripoints[0] = tpl[0];
1881 tripoints[1] = tpl[2];
1882 tripoints[2] = tpl[1];
1883 insertCell.TakeOwnership(
new TriCell );
1884 insertCell->SetPointIds(tripoints);
1885 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
1886 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
1891 CellTransfer( tp, celltran );
1892 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
1893 tripoints[0] = tpl[0];
1894 tripoints[1] = tpl[2];
1895 tripoints[2] = tpl[1];
1896 insertCell.TakeOwnership(
new TriCell );
1897 insertCell->SetPointIds(tripoints);
1898 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
1899 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
1906 CellTransfer( tp, celltran );
1907 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
1908 tripoints[0] = tpl[0];
1909 tripoints[1] = tpl[2];
1910 tripoints[2] = tpl[1];
1911 insertCell.TakeOwnership(
new TriCell );
1912 insertCell->SetPointIds(tripoints);
1913 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
1914 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
1919 CellTransfer( tp, celltran );
1920 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
1921 tripoints[0] = tpl[0];
1922 tripoints[1] = tpl[2];
1923 tripoints[2] = tpl[1];
1924 insertCell.TakeOwnership(
new TriCell );
1925 insertCell->SetPointIds(tripoints);
1926 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
1927 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
1932 CellTransfer( tp, celltran );
1933 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
1934 tripoints[0] = tpl[0];
1935 tripoints[1] = tpl[2];
1936 tripoints[2] = tpl[1];
1937 insertCell.TakeOwnership(
new TriCell );
1938 insertCell->SetPointIds(tripoints);
1939 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
1940 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
1945 CellTransfer( tp, celltran );
1946 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
1947 tripoints[0] = tpl[0];
1948 tripoints[1] = tpl[2];
1949 tripoints[2] = tpl[1];
1950 insertCell.TakeOwnership(
new TriCell );
1951 insertCell->SetPointIds(tripoints);
1952 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
1953 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
1958 CellTransfer( tp, celltran );
1959 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
1960 tripoints[0] = tpl[0];
1961 tripoints[1] = tpl[2];
1962 tripoints[2] = tpl[1];
1963 insertCell.TakeOwnership(
new TriCell );
1964 insertCell->SetPointIds(tripoints);
1965 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
1966 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
1971 CellTransfer( tp, celltran );
1972 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
1973 tripoints[0] = tpl[0];
1974 tripoints[1] = tpl[2];
1975 tripoints[2] = tpl[1];
1976 insertCell.TakeOwnership(
new TriCell );
1977 insertCell->SetPointIds(tripoints);
1978 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
1979 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
1986 CellTransfer( tp, celltran );
1987 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
1988 tripoints[0] = tpl[0];
1989 tripoints[1] = tpl[2];
1990 tripoints[2] = tpl[1];
1991 insertCell.TakeOwnership(
new TriCell );
1992 insertCell->SetPointIds(tripoints);
1993 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
1994 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
1999 CellTransfer( tp, celltran );
2000 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
2001 tripoints[0] = tpl[0];
2002 tripoints[1] = tpl[2];
2003 tripoints[2] = tpl[1];
2004 insertCell.TakeOwnership(
new TriCell );
2005 insertCell->SetPointIds(tripoints);
2006 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
2007 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
2012 CellTransfer( tp, celltran );
2013 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
2014 tripoints[0] = tpl[0];
2015 tripoints[1] = tpl[2];
2016 tripoints[2] = tpl[1];
2017 insertCell.TakeOwnership(
new TriCell );
2018 insertCell->SetPointIds(tripoints);
2019 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
2020 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
2025 CellTransfer( tp, celltran );
2026 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
2027 tripoints[0] = tpl[0];
2028 tripoints[1] = tpl[2];
2029 tripoints[2] = tpl[1];
2030 insertCell.TakeOwnership(
new TriCell );
2031 insertCell->SetPointIds(tripoints);
2032 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
2033 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
2040 CellTransfer( tp, celltran );
2041 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
2042 tripoints[0] = tpl[0];
2043 tripoints[1] = tpl[2];
2044 tripoints[2] = tpl[1];
2045 insertCell.TakeOwnership(
new TriCell );
2046 insertCell->SetPointIds(tripoints);
2047 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
2048 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
2053 CellTransfer( tp, celltran );
2054 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
2055 tripoints[0] = tpl[0];
2056 tripoints[1] = tpl[2];
2057 tripoints[2] = tpl[1];
2058 insertCell.TakeOwnership(
new TriCell );
2059 insertCell->SetPointIds(tripoints);
2060 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
2061 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
2066 CellTransfer( tp, celltran );
2067 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
2068 tripoints[0] = tpl[0];
2069 tripoints[1] = tpl[2];
2070 tripoints[2] = tpl[1];
2071 insertCell.TakeOwnership(
new TriCell );
2072 insertCell->SetPointIds(tripoints);
2073 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
2074 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
2079 CellTransfer( tp, celltran );
2080 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
2081 tripoints[0] = tpl[0];
2082 tripoints[1] = tpl[2];
2083 tripoints[2] = tpl[1];
2084 insertCell.TakeOwnership(
new TriCell );
2085 insertCell->SetPointIds(tripoints);
2086 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
2087 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
2092 CellTransfer( tp, celltran );
2093 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
2094 tripoints[0] = tpl[0];
2095 tripoints[1] = tpl[2];
2096 tripoints[2] = tpl[1];
2097 insertCell.TakeOwnership(
new TriCell );
2098 insertCell->SetPointIds(tripoints);
2099 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
2100 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
2105 CellTransfer( tp, celltran );
2106 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
2107 tripoints[0] = tpl[0];
2108 tripoints[1] = tpl[2];
2109 tripoints[2] = tpl[1];
2110 insertCell.TakeOwnership(
new TriCell );
2111 insertCell->SetPointIds(tripoints);
2112 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
2113 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
2118 CellTransfer( tp, celltran );
2119 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
2120 tripoints[0] = tpl[0];
2121 tripoints[1] = tpl[2];
2122 tripoints[2] = tpl[1];
2123 insertCell.TakeOwnership(
new TriCell );
2124 insertCell->SetPointIds(tripoints);
2125 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
2126 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
2133 CellTransfer( tp, celltran );
2134 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
2135 tripoints[0] = tpl[0];
2136 tripoints[1] = tpl[2];
2137 tripoints[2] = tpl[1];
2138 insertCell.TakeOwnership(
new TriCell );
2139 insertCell->SetPointIds(tripoints);
2140 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
2141 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
2146 CellTransfer( tp, celltran );
2147 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
2148 tripoints[0] = tpl[0];
2149 tripoints[1] = tpl[2];
2150 tripoints[2] = tpl[1];
2151 insertCell.TakeOwnership(
new TriCell );
2152 insertCell->SetPointIds(tripoints);
2153 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
2154 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
2159 CellTransfer( tp, celltran );
2160 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
2161 tripoints[0] = tpl[0];
2162 tripoints[1] = tpl[2];
2163 tripoints[2] = tpl[1];
2164 insertCell.TakeOwnership(
new TriCell );
2165 insertCell->SetPointIds(tripoints);
2166 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
2167 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
2172 CellTransfer( tp, celltran );
2173 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
2174 tripoints[0] = tpl[0];
2175 tripoints[1] = tpl[2];
2176 tripoints[2] = tpl[1];
2177 insertCell.TakeOwnership(
new TriCell );
2178 insertCell->SetPointIds(tripoints);
2179 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
2180 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
2185 CellTransfer( tp, celltran );
2186 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
2187 tripoints[0] = tpl[0];
2188 tripoints[1] = tpl[2];
2189 tripoints[2] = tpl[1];
2190 insertCell.TakeOwnership(
new TriCell );
2191 insertCell->SetPointIds(tripoints);
2192 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
2193 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
2198 CellTransfer( tp, celltran );
2199 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
2200 tripoints[0] = tpl[0];
2201 tripoints[1] = tpl[2];
2202 tripoints[2] = tpl[1];
2203 insertCell.TakeOwnership(
new TriCell );
2204 insertCell->SetPointIds(tripoints);
2205 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
2206 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
2213 CellTransfer( tp, celltran );
2214 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
2215 tripoints[0] = tpl[0];
2216 tripoints[1] = tpl[2];
2217 tripoints[2] = tpl[1];
2218 insertCell.TakeOwnership(
new TriCell );
2219 insertCell->SetPointIds(tripoints);
2220 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
2221 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
2226 CellTransfer( tp, celltran );
2227 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
2228 tripoints[0] = tpl[0];
2229 tripoints[1] = tpl[2];
2230 tripoints[2] = tpl[1];
2231 insertCell.TakeOwnership(
new TriCell );
2232 insertCell->SetPointIds(tripoints);
2233 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
2234 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
2239 CellTransfer( tp, celltran );
2240 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
2241 tripoints[0] = tpl[0];
2242 tripoints[1] = tpl[2];
2243 tripoints[2] = tpl[1];
2244 insertCell.TakeOwnership(
new TriCell );
2245 insertCell->SetPointIds(tripoints);
2246 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
2247 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
2252 CellTransfer( tp, celltran );
2253 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
2254 tripoints[0] = tpl[0];
2255 tripoints[1] = tpl[2];
2256 tripoints[2] = tpl[1];
2257 insertCell.TakeOwnership(
new TriCell );
2258 insertCell->SetPointIds(tripoints);
2259 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
2260 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
2265 CellTransfer( tp, celltran );
2266 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
2267 tripoints[0] = tpl[0];
2268 tripoints[1] = tpl[2];
2269 tripoints[2] = tpl[1];
2270 insertCell.TakeOwnership(
new TriCell );
2271 insertCell->SetPointIds(tripoints);
2272 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
2273 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
2278 CellTransfer( tp, celltran );
2279 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
2280 tripoints[0] = tpl[0];
2281 tripoints[1] = tpl[2];
2282 tripoints[2] = tpl[1];
2283 insertCell.TakeOwnership(
new TriCell );
2284 insertCell->SetPointIds(tripoints);
2285 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
2286 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
2291 CellTransfer( tp, celltran );
2292 AddNodes(index, tp, tpl, currentrowtmp, currentframetmp);
2293 tripoints[0] = tpl[0];
2294 tripoints[1] = tpl[2];
2295 tripoints[2] = tpl[1];
2296 insertCell.TakeOwnership(
new TriCell );
2297 insertCell->SetPointIds(tripoints);
2298 this->GetOutput()->SetCell(m_NumberOfCells, insertCell);
2299 this->GetOutput()->SetCellData(m_NumberOfCells, 0.0);
2308 if ( currentrowtmp[i][0] != 0 )
2310 m_CurrentRow[m_CurrentRowIndex][1] = currentrowtmp[i][1];
2311 m_CurrentRow[m_CurrentRowIndex++][0] = currentrowtmp[i][0];
2312 if ( m_CurrentRowIndex == m_CurrentRowNum )
2314 m_CurrentRowNum += 100;
2315 m_CurrentRow = (
unsigned long **) realloc(m_CurrentRow,
sizeof(
unsigned long *) * m_CurrentRowNum);
2316 for ( j = m_CurrentRowIndex; j < m_CurrentRowNum; j++ ) m_CurrentRow[j] = (
unsigned long *) malloc(
sizeof(
unsigned long) * 2);
2320 if ( currentframetmp[i][0] != 0 )
2322 m_CurrentFrame[m_CurrentFrameIndex][1] = currentframetmp[i][1];
2323 m_CurrentFrame[m_CurrentFrameIndex++][0] = currentframetmp[i][0];
2324 if ( m_CurrentFrameIndex == m_CurrentFrameNum )
2326 m_CurrentFrameNum += 1000;
2327 m_CurrentFrame = (
unsigned long **) realloc(m_CurrentFrame,
sizeof(
unsigned long *) * m_CurrentFrameNum);
2328 for ( j = m_CurrentFrameIndex; j < m_CurrentFrameNum; j++ ) m_CurrentFrame[j] = (
unsigned long *) malloc(
sizeof(
unsigned long) * 2);
2335 for ( i=0; i<4; i++ )
2337 free (currentrowtmp[i]);
2339 free (currentrowtmp);
2341 for ( i=0; i<4; i++ )
2343 free (currentframetmp[i]);
2346 free (currentframetmp);
2351 m_LastVoxel[4] = m_CurrentVoxel[2];
2352 m_LastVoxel[9] = m_CurrentVoxel[10];
2353 m_LastVoxel[8] = m_CurrentVoxel[6];
2354 m_LastVoxel[12] = m_CurrentVoxel[11];
2355 for ( i=1; i<14; i++ ) m_CurrentVoxel[i] = 0;
2358 template<
class TInputImage,
class TOutputMesh>
2361 ::AddNodes(
int index,
unsigned char *nodesid,
unsigned long *globalnodesid,
unsigned long **currentrowtmp,
unsigned long **currentframetmp )
2366 for ( i=0; i<3; i++ )
2369 if ( m_AvailableNodes[nodesid[i]] != 0 )
2374 indTemp[0] = m_LocationOffset[nodesid[i]][0]
2375 + ( index % m_ImageWidth );
2376 indTemp[1] = m_LocationOffset[nodesid[i]][1]
2377 + ( (index % (m_ImageWidth*m_ImageHeight)) / m_ImageWidth );
2378 indTemp[2] = m_LocationOffset[nodesid[i]][2]
2379 + ( index / (m_ImageWidth*m_ImageHeight) );
2385 SpacingType spacing = this->GetInput(0)->GetSpacing();
2386 OriginType origin = this->GetInput(0)->GetOrigin();
2388 new_p[0] = indTemp[0]*spacing[0]+origin[0];
2389 new_p[1] = indTemp[1]*spacing[1]+origin[1];
2390 new_p[2] = indTemp[2]*spacing[2]+origin[2];
2392 this->GetOutput()->SetPoint( m_NumberOfNodes, new_p );
2394 switch ( nodesid[i] )
2397 m_CurrentVoxel[2] = m_NumberOfNodes;
2400 m_CurrentVoxel[6] = m_NumberOfNodes;
2401 currentframetmp[1][1] = m_NumberOfNodes;
2402 currentframetmp[1][0] = (index%(m_ImageWidth*m_ImageHeight))*13+2;
2405 m_CurrentVoxel[10] = m_NumberOfNodes;
2408 m_CurrentVoxel[11] = m_NumberOfNodes;
2409 currentrowtmp[3][1] = m_NumberOfNodes;
2410 currentrowtmp[3][0] = (index%m_ImageWidth)*13+10;
2413 currentrowtmp[0][1] = m_NumberOfNodes;
2414 currentrowtmp[0][0] = (index%m_ImageWidth)*13+1;
2417 currentrowtmp[1][1] = m_NumberOfNodes;
2418 currentrowtmp[1][0] = (index%m_ImageWidth)*13+5;
2419 currentframetmp[2][1] = m_NumberOfNodes;
2420 currentframetmp[2][0] = (index%(m_ImageWidth*m_ImageHeight))*13+3;
2423 currentrowtmp[2][1] = m_NumberOfNodes;
2424 currentrowtmp[2][0] = (index%m_ImageWidth)*13+9;
2427 currentframetmp[0][1] = m_NumberOfNodes;
2428 currentframetmp[0][0] = (index%(m_ImageWidth*m_ImageHeight))*13+1;
2431 currentframetmp[3][1] = m_NumberOfNodes;
2432 currentframetmp[3][0] = (index%(m_ImageWidth*m_ImageHeight))*13+4;
2435 m_CurrentVoxel[1] = m_NumberOfNodes;
2438 m_CurrentVoxel[4] = m_NumberOfNodes;
2441 m_CurrentVoxel[9] = m_NumberOfNodes;
2444 m_CurrentVoxel[13] = m_NumberOfNodes;
2447 globalnodesid[i] = m_NumberOfNodes;
2448 m_AvailableNodes[ nodesid[i] ] = 0;
2449 m_CurrentVoxel[ nodesid[i] ] = m_NumberOfNodes;
2454 if ( m_CurrentVoxel[ nodesid[i] ] != 0 )
2456 globalnodesid[i] = m_CurrentVoxel[ nodesid[i] ];
2461 if ( m_LastVoxel[ nodesid[i] ] != 0 )
2463 globalnodesid[i] = m_LastVoxel[ nodesid[i] ];
2468 if ( (m_LastRowNum != 0) && ( (nodesid[i] == 1) || (nodesid[i] == 5) || (nodesid[i] == 9) || (nodesid[i] == 10) ) )
2471 globalnodesid[i] = this->SearchThroughLastRow((index % m_ImageWidth)*13+nodesid[i], 0, m_LastRowNum-1);
2472 if ( m_PointFound != 0 )
continue;
2475 if (nodesid[i] == 9) globalnodesid[i] = this->SearchThroughLastRow((index % m_ImageWidth)*13-3, 0, m_LastRowNum-1);
2476 if (nodesid[i] == 10) globalnodesid[i] = this->SearchThroughLastRow((index % m_ImageWidth)*13+22, 0, m_LastRowNum-1);
2477 if ( m_PointFound != 0 )
continue;
2480 if ( (m_LastFrameNum != 0) && ( (nodesid[i] == 1) || (nodesid[i] == 2) || (nodesid[i] == 3) || (nodesid[i] == 4) ) )
2483 globalnodesid[i] = this->SearchThroughLastFrame((index % (m_ImageWidth*m_ImageHeight))*13+nodesid[i], 0, m_LastFrameNum-1);
2484 if ( m_PointFound != 0 )
continue;
2487 if (nodesid[i] == 4) globalnodesid[i] = this->SearchThroughLastFrame((index % (m_ImageWidth*m_ImageHeight))*13-11, 0, m_LastFrameNum-1);
2488 if (nodesid[i] == 1) globalnodesid[i] = this->SearchThroughLastFrame((index % (m_ImageWidth*m_ImageHeight) - m_ImageWidth)*13+3, 0, m_LastFrameNum-1);
2489 if ( m_PointFound != 0 )
continue;
2494 if (m_PointFound == 0)
2496 m_AvailableNodes[nodesid[i]] = 1;
2502 template<
class TInputImage,
class TOutputMesh>
2507 if ( (celltran & 1) != 0 )
2509 this->ZFlip(nodesid);
2510 if ( celltran > 64 ) celltran -= 64;
2511 else celltran += 64;
2513 if ( (celltran & 2) != 0 )
2515 this->YFlip(nodesid);
2516 if ( celltran > 64 ) celltran -= 64;
2517 else celltran += 64;
2519 if ( (celltran & 4) != 0 )
2521 this->XFlip(nodesid);
2522 if ( celltran > 64 ) celltran -= 64;
2523 else celltran += 64;
2525 if ( (celltran & 8) != 0 ) this->ZRotation(nodesid);
2526 if ( (celltran & 16) != 0 ) this->YRotation(nodesid);
2527 if ( (celltran & 32) != 0 ) this->XRotation(nodesid);
2528 if ( (celltran & 64) != 0 ) this->inverse(nodesid);
2531 template<
class TInputImage,
class TOutputMesh>
2537 unsigned long lindex =
static_cast<unsigned long>( index );
2538 if ( (end - start) > 1 )
2540 mid =
static_cast<int>( vcl_floor(static_cast<float>((start + end)/2)) );
2541 if ( lindex == m_LastRow[mid][0] )
2544 return m_LastRow[mid][1];
2548 if( lindex > m_LastRow[mid][0] )
2550 return this->SearchThroughLastRow(index, mid+1, end);
2554 return this->SearchThroughLastRow(index, start, mid);
2560 if ( lindex == m_LastRow[start][0] )
2563 return m_LastRow[start][1];
2565 if ( lindex == m_LastRow[end][0] )
2568 return m_LastRow[end][1];
2574 template<
class TInputImage,
class TOutputMesh>
2580 unsigned long lindex =
static_cast<unsigned long>( index );
2581 unsigned long result = 0;
2582 if ( (end - start) > 1 )
2584 mid =
static_cast<int>( vcl_floor(static_cast<float>((start + end)/2)) );
2585 if ( lindex == m_LastFrame[mid][0] )
2588 result = m_LastFrame[mid][1];
2592 if ( lindex > m_LastFrame[mid][0] )
2594 result = this->SearchThroughLastFrame(index, mid+1, end);
2598 result = this->SearchThroughLastFrame(index, start, mid);
2604 if ( lindex == m_LastFrame[start][0] )
2607 result = m_LastFrame[start][1];
2609 if ( lindex == m_LastFrame[end][0] )
2612 result = m_LastFrame[end][1];
2619 template<
class TInputImage,
class TOutputMesh>
2624 Superclass::PrintSelf(os, indent);
2628 <<
static_cast<NumericTraits<unsigned char>::PrintType
>(m_ObjectValue)
2632 <<
"NumberOfNodes: "
2637 <<
"NumberOfCells: "