00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "mitkMesh.h"
00020 #include "mitkOperation.h"
00021 #include "mitkOperationActor.h"
00022 #include "mitkLineOperation.h"
00023 #include "mitkLineOperation.h"
00024 #include "mitkPointOperation.h"
00025 #include "mitkVector.h"
00026 #include "mitkStatusBar.h"
00027 #include "mitkInteractionConst.h"
00028 #include "mitkLine.h"
00029 #include "mitkRenderingManager.h"
00030
00031
00032 mitk::Mesh::Mesh()
00033 {
00034 }
00035
00036 mitk::Mesh::~Mesh()
00037 {
00038 }
00039
00040
00041 const mitk::Mesh::DataType *mitk::Mesh::GetMesh( int t ) const
00042 {
00043 return m_PointSetSeries[t];
00044 }
00045
00046
00047 mitk::Mesh::DataType* mitk::Mesh::GetMesh( int t )
00048 {
00049 return m_PointSetSeries[t];
00050 }
00051
00052
00053 void mitk::Mesh::SetMesh( DataType *mesh, int t )
00054 {
00055 this->Expand( t+1 );
00056 m_PointSetSeries[t] = mesh;
00057 }
00058
00059
00060 unsigned long mitk::Mesh::GetNumberOfCells( int t )
00061 {
00062 return m_PointSetSeries[t]->GetNumberOfCells();
00063 }
00064
00065
00066
00067 bool mitk::Mesh::SearchLine( Point3D point, float distance,
00068 unsigned long &lineId, unsigned long &cellId, int t )
00069 {
00070
00071 ScalarType bestDist = distance;
00072
00073
00074 ConstCellIterator cellIt = m_PointSetSeries[t]->GetCells()->Begin();
00075 ConstCellIterator cellEnd = m_PointSetSeries[t]->GetCells()->End();
00076 while( cellIt != cellEnd)
00077 {
00078 if (cellIt.Value()->GetNumberOfPoints() >1)
00079 {
00080
00081 PointIdIterator inAIt = cellIt.Value()->PointIdsBegin();
00082 PointIdIterator inBIt = cellIt.Value()->PointIdsBegin();
00083 PointIdIterator inEnd = cellIt.Value()->PointIdsEnd();
00084
00085 ++inAIt;
00086
00087 int currentLineId = 0;
00088 while(inAIt != inEnd)
00089 {
00090 mitk::PointSet::PointType pointA, pointB;
00091 if ( m_PointSetSeries[t]->GetPoint((*inAIt), &pointA) &&
00092 m_PointSetSeries[t]->GetPoint((*inBIt), &pointB))
00093 {
00094 Line<CoordinateType> *line = new Line<CoordinateType>();
00095 line->SetPoints(pointA, pointB);
00096 double thisDistance = line->Distance(point);
00097 if (thisDistance < bestDist)
00098 {
00099 cellId = cellIt->Index();
00100 lineId = currentLineId;
00101 bestDist = thisDistance;
00102 }
00103 }
00104 ++inAIt;
00105 ++inBIt;
00106 ++currentLineId;
00107 }
00108
00109
00110
00111
00112 CellDataType cellData;
00113 bool dataOk = m_PointSetSeries[t]->GetCellData(cellIt->Index(), &cellData);
00114 if (dataOk)
00115 {
00116 if (cellData.closed)
00117 {
00118
00119 PointIdIterator inAIt = cellIt.Value()->PointIdsBegin();
00120
00121 mitk::PointSet::PointType pointA, pointB;
00122 if ( m_PointSetSeries[t]->GetPoint((*inAIt), &pointA) &&
00123 m_PointSetSeries[t]->GetPoint((*inBIt), &pointB))
00124 {
00125 Line<CoordinateType> *line = new Line<CoordinateType>();
00126 line->SetPoints(pointA, pointB);
00127 double thisDistance = line->Distance(point);
00128 if (thisDistance < bestDist)
00129 {
00130 cellId = cellIt->Index();
00131 lineId = currentLineId;
00132 bestDist = thisDistance;
00133 }
00134 }
00135 }
00136 }
00137 }
00138 ++cellIt;
00139 }
00140 return (bestDist < distance);
00141 }
00142
00143 int mitk::Mesh::SearchFirstCell( unsigned long pointId, int t )
00144 {
00145
00146 ConstCellIterator it = m_PointSetSeries[t]->GetCells()->Begin();
00147 ConstCellIterator end = m_PointSetSeries[t]->GetCells()->End();
00148 while( it != end)
00149 {
00150 PointIdIterator position = std::find(it->Value()->PointIdsBegin(),
00151 it->Value()->PointIdsEnd(), pointId);
00152
00153 if ( position != it->Value()->PointIdsEnd())
00154 {
00155 return it->Index();
00156 }
00157 ++it;
00158 }
00159 return -1;
00160 }
00161
00162
00163
00164
00165
00166 bool mitk::Mesh::EvaluatePosition( mitk::Point3D point,
00167 unsigned long &cellId, float precision, int t )
00168 {
00169 int pointId = this->SearchPoint( point, precision, t );
00170 if (pointId > -1)
00171 {
00172
00173 cellId = this->SearchFirstCell( pointId, t );
00174 return true;
00175 }
00176 unsigned long lineId = 0;
00177 if ( this->SearchLine(point, precision, lineId, cellId, t) )
00178 {
00179 return true;
00180 }
00181
00182 return false;
00183 }
00184
00185 unsigned long mitk::Mesh::GetNewCellId( int t )
00186 {
00187 long nextCellId = -1;
00188 ConstCellIterator it = m_PointSetSeries[t]->GetCells()->Begin();
00189 ConstCellIterator end = m_PointSetSeries[t]->GetCells()->End();
00190
00191 while (it!=end)
00192 {
00193 nextCellId = it.Index();
00194 ++it;
00195 }
00196 ++nextCellId;
00197 return nextCellId;
00198 }
00199
00200 int mitk::Mesh::SearchSelectedCell( int t )
00201 {
00202 CellDataIterator cellDataIt, cellDataEnd;
00203 cellDataEnd = m_PointSetSeries[t]->GetCellData()->End();
00204 for ( cellDataIt = m_PointSetSeries[t]->GetCellData()->Begin();
00205 cellDataIt != cellDataEnd;
00206 cellDataIt++ )
00207 {
00208
00209 if ( cellDataIt->Value().selected )
00210 {
00211 return cellDataIt->Index();
00212 }
00213 }
00214 return -1;
00215 }
00216
00217
00218
00219
00220 bool mitk::Mesh::GetPointIds( unsigned long cellId, unsigned long lineId,
00221 int &idA, int &idB, int t )
00222 {
00223 bool ok = false;
00224 bool found = false;
00225 CellAutoPointer cellAutoPointer;
00226 ok = m_PointSetSeries[t]->GetCell(cellId, cellAutoPointer);
00227 if (ok)
00228 {
00229
00230 CellType * cell = cellAutoPointer.GetPointer();
00231
00232
00233 CellDataType cellData;
00234 m_PointSetSeries[t]->GetCellData(cellId, &cellData);
00235 bool closed = cellData.closed;
00236
00237 PointIdIterator pointIdIt = cell->PointIdsBegin();
00238 PointIdIterator pointIdEnd = cell->PointIdsEnd();
00239 unsigned int counter = 0;
00240 while (pointIdIt != pointIdEnd)
00241 {
00242 if(counter == lineId)
00243 {
00244 idA = (*pointIdIt);
00245 ++pointIdIt;
00246 found = true;
00247 break;
00248 }
00249 ++counter;
00250 ++pointIdIt;
00251 }
00252 if(found)
00253 {
00254
00255 if (pointIdIt != pointIdEnd)
00256 {
00257 idB = (*pointIdIt);
00258 }
00259
00260
00261 else if (closed)
00262 {
00263 pointIdIt = cell->PointIdsBegin();
00264 idB = (*pointIdIt);
00265 }
00266 }
00267 else
00268 ok = false;
00269 }
00270 return ok;
00271 }
00272
00273
00274 void mitk::Mesh::ExecuteOperation(Operation* operation)
00275 {
00276
00277 switch (operation->GetOperationType())
00278 {
00279 case OpNOTHING:
00280 break;
00281
00282 case OpNEWCELL:
00283 {
00284 mitk::LineOperation *lineOp =
00285 dynamic_cast<mitk::LineOperation *>(operation);
00286
00287
00288 if (lineOp == NULL)
00289 {
00290 Superclass::ExecuteOperation(operation);
00291 }
00292
00293 bool ok;
00294 int cellId = lineOp->GetCellId();
00295 CellAutoPointer cellAutoPointer;
00296 ok = m_PointSetSeries[0]->GetCell(cellId, cellAutoPointer);
00297
00298
00299 if (!ok)
00300 {
00301 cellAutoPointer.TakeOwnership( new PolygonType );
00302 m_PointSetSeries[0]->SetCell(cellId, cellAutoPointer);
00303 CellDataType cellData;
00304 cellData.selected = true;
00305 cellData.selectedLines.clear();
00306 cellData.closed = false;
00307 m_PointSetSeries[0]->SetCellData(cellId, cellData);
00308 }
00309 }
00310 break;
00311
00312 case OpDELETECELL:
00313 {
00314 mitk::LineOperation *lineOp = dynamic_cast<mitk::LineOperation *>(operation);
00315 if (lineOp == NULL)
00316 {
00317 Superclass::ExecuteOperation(operation);
00318 }
00319 m_PointSetSeries[0]->GetCells()->DeleteIndex((unsigned)lineOp->GetCellId());
00320 m_PointSetSeries[0]->GetCellData()->DeleteIndex((unsigned)lineOp->GetCellId());
00321 }
00322 break;
00323
00324 case OpCLOSECELL:
00325
00326 {
00327 mitk::LineOperation *lineOp = dynamic_cast<mitk::LineOperation *>(operation);
00328 if (lineOp == NULL)
00329 {
00330
00331 Superclass::ExecuteOperation(operation);
00332 }
00333 bool ok;
00334 int cellId = lineOp->GetCellId();
00335 if (cellId<0)
00336 {
00337 cellId = this->SearchSelectedCell( 0 );
00338 if (cellId < 0 )
00339 return;
00340 }
00341 CellAutoPointer cellAutoPointer;
00342
00343
00344 ok = m_PointSetSeries[0]->GetCell(cellId, cellAutoPointer);
00345 if (ok)
00346 {
00347 CellDataType cellData;
00348 m_PointSetSeries[0]->GetCellData(cellId, &cellData);
00349 cellData.closed = true;
00350 m_PointSetSeries[0]->SetCellData(cellId, cellData);
00351 }
00352 }
00353 break;
00354
00355 case OpOPENCELL:
00356 {
00357 mitk::LineOperation *lineOp = dynamic_cast<mitk::LineOperation *>(operation);
00358 if (lineOp == NULL)
00359 {
00360 Superclass::ExecuteOperation(operation);
00361 }
00362 bool ok;
00363 int cellId = lineOp->GetCellId();
00364 CellAutoPointer cellAutoPointer;
00365 ok = m_PointSetSeries[0]->GetCell(cellId, cellAutoPointer);
00366 if (ok)
00367 {
00368 CellDataType cellData;
00369 m_PointSetSeries[0]->GetCellData(cellId, &cellData);
00370 cellData.closed = false;;
00371 m_PointSetSeries[0]->SetCellData(cellId, cellData);
00372 }
00373 }
00374 break;
00375
00376 case OpADDLINE:
00377
00378
00379 {
00380 mitk::LineOperation *lineOp =
00381 dynamic_cast<mitk::LineOperation *>(operation);
00382
00383 int cellId = -1;
00384 int pId = -1;
00385
00386 if (lineOp == NULL)
00387 {
00388 cellId = this->SearchSelectedCell( 0 );
00389 if (cellId == -1)
00390 return;
00391
00392 pId = this->SearchSelectedPoint( 0 );
00393 if (pId == -1)
00394 return;
00395 }
00396 else
00397 {
00398 cellId = lineOp->GetCellId();
00399 if (cellId == -1)
00400 return;
00401 pId = lineOp->GetPIdA();
00402 if (pId == -1)
00403 return;
00404 }
00405
00406 bool ok;
00407 CellAutoPointer cellAutoPointer;
00408 ok = m_PointSetSeries[0]->GetCell(cellId, cellAutoPointer);
00409 if (ok)
00410 {
00411 CellType * cell = cellAutoPointer.GetPointer();
00412 if( cell->GetType() == CellType::POLYGON_CELL )
00413 {
00414 PolygonType * polygon = static_cast<PolygonType *>( cell );
00415
00416
00417
00418
00419 polygon->AddPointId(pId);
00420
00421
00422
00423 CellDataType cellData;
00424 ok = m_PointSetSeries[0]->GetCellData(cellId, &cellData);
00425 if (ok)
00426 {
00427
00428
00429 if (polygon->GetNumberOfPoints()>1)
00430 cellData.selectedLines.push_back(polygon->GetNumberOfPoints()-2);
00431 }
00432 m_PointSetSeries[0]->SetCellData(cellId, cellData);
00433 m_PointSetSeries[0]->SetCell(cellId, cellAutoPointer);
00434 }
00435 }
00436 }
00437 break;
00438
00439 case OpDELETELINE:
00440 {
00441
00442
00443 mitk::LineOperation *lineOp = dynamic_cast<mitk::LineOperation *>(operation);
00444 int cellId = -1;
00445 int pId = -1;
00446
00447 if (lineOp == NULL)
00448 {
00449 cellId = this->SearchSelectedCell( 0 );
00450 if (cellId == -1)
00451 return;
00452 pId = this->SearchSelectedPoint( 0 );
00453 }
00454 else
00455 {
00456 cellId = lineOp->GetCellId();
00457 if (cellId == -1)
00458 return;
00459 pId = lineOp->GetPIdA();
00460 }
00461
00462 bool ok;
00463 CellAutoPointer cellAutoPointer;
00464 ok = m_PointSetSeries[0]->GetCell(cellId, cellAutoPointer);
00465 if (ok)
00466 {
00467 CellType * cell = cellAutoPointer.GetPointer();
00468 if( cell->GetType() == CellType::POLYGON_CELL )
00469 {
00470 PolygonType * oldPolygon = static_cast<PolygonType *>( cell );
00471
00472 PolygonType * newPolygonCell = new PolygonType;
00473 CellAutoPointer newCell;
00474 newCell.TakeOwnership( newPolygonCell );
00475
00476 PointIdConstIterator it, oldend;
00477 oldend = oldPolygon->PointIdsEnd();
00478 if(pId >= 0)
00479 {
00480 for(it = oldPolygon->PointIdsBegin(); it != oldend; ++it)
00481 {
00482 if((*it) != (MeshType::PointIdentifier)pId)
00483 {
00484 newPolygonCell->AddPointId(*it);
00485 }
00486 }
00487 }
00488 else
00489 {
00490 --oldend;
00491 for(it = oldPolygon->PointIdsBegin(); it != oldend; ++it)
00492 newPolygonCell->AddPointId(*it);
00493 }
00494 oldPolygon->SetPointIds(0, newPolygonCell->GetNumberOfPoints(),
00495 newPolygonCell->PointIdsBegin());
00496 }
00497 }
00498 }
00499 break;
00500
00501 case OpREMOVELINE:
00502
00503
00504 {
00505 mitk::LineOperation *lineOp =
00506 dynamic_cast<mitk::LineOperation *>(operation);
00507 if (lineOp == NULL)
00508 {
00509 Superclass::ExecuteOperation(operation);
00510 }
00511
00512 bool ok;
00513 CellAutoPointer cellAutoPointer;
00514 int cellId = lineOp->GetCellId();
00515 ok = m_PointSetSeries[0]->GetCell(cellId, cellAutoPointer);
00516 if (!ok)
00517 return;
00518
00519 CellType * cell = cellAutoPointer.GetPointer();
00520 CellAutoPointer newCellAutoPointer;
00521 newCellAutoPointer.TakeOwnership( new PolygonType );
00522 PolygonType * newPolygon = static_cast<PolygonType *>( cell );
00523
00524 PointIdIterator it = cell->PointIdsBegin();
00525 PointIdIterator end = cell->PointIdsEnd();
00526 int pointId = lineOp->GetPIdA();
00527 if (pointId<0)
00528 return;
00529
00530 while (it!=end)
00531 {
00532 if ((*it)==(unsigned int)pointId)
00533 {
00534 break;
00535 }
00536 else
00537 {
00538 newPolygon ->AddPointId(*it);
00539 }
00540 ++it;
00541 }
00542 while (it!=end)
00543 {
00544 newPolygon ->AddPointId(*it);
00545 it++;
00546 }
00547 m_PointSetSeries[0]->SetCell(cellId, newCellAutoPointer);
00548 }
00549 break;
00550
00551 case OpINSERTLINE:
00552
00554
00555
00557
00558
00559
00560
00561
00562
00563
00564
00565
00566
00567
00568
00569
00570
00571
00572
00573
00574
00575
00576
00577
00578
00579
00580
00581
00582
00583
00584
00585
00586
00587
00588
00589
00590
00591
00592
00593
00594
00595
00596
00597
00598
00599
00600
00601
00602
00603
00604
00605
00606
00607
00608
00609
00610
00611
00612
00613
00614
00615
00616
00617
00618
00619
00620
00621 break;
00622
00623 case OpMOVELINE:
00624 {
00625 mitk::LineOperation *lineOp =
00626 dynamic_cast<mitk::LineOperation *>(operation);
00627
00628 if (lineOp == NULL)
00629 {
00630 mitk::StatusBar::GetInstance()->DisplayText(
00631 "Message from mitkMesh: Recieved wrong type of operation! See mitkMeshInteractor.cpp", 10000);
00632 return;
00633 }
00634
00635
00636
00637
00638
00639 Point3D pointA, pointB;
00640 pointA.Fill(0.0);
00641 pointB.Fill(0.0);
00642 m_PointSetSeries[0]->GetPoint(lineOp->GetPIdA(), &pointA);
00643 m_PointSetSeries[0]->GetPoint(lineOp->GetPIdB(), &pointB);
00644
00645 pointA[0] += lineOp->GetVector()[0];
00646 pointA[1] += lineOp->GetVector()[1];
00647 pointA[2] += lineOp->GetVector()[2];
00648 pointB[0] += lineOp->GetVector()[0];
00649 pointB[1] += lineOp->GetVector()[1];
00650 pointB[2] += lineOp->GetVector()[2];
00651
00652 mitk::PointOperation* operationA =
00653 new mitk::PointOperation(OpMOVE, pointA, lineOp->GetPIdA());
00654 mitk::PointOperation* operationB =
00655 new mitk::PointOperation(OpMOVE, pointB, lineOp->GetPIdB());
00656
00657 Superclass::ExecuteOperation(operationA);
00658 Superclass::ExecuteOperation(operationB);
00659 }
00660 break;
00661
00662 case OpSELECTLINE:
00663 {
00664 mitk::LineOperation *lineOp =
00665 dynamic_cast<mitk::LineOperation *>(operation);
00666 if (lineOp == NULL)
00667 {
00668 Superclass::ExecuteOperation(operation);
00669 }
00670 int cellId = lineOp->GetCellId();
00671 CellAutoPointer cellAutoPointer;
00672 bool ok = m_PointSetSeries[0]->GetCell(cellId, cellAutoPointer);
00673 if (ok)
00674 {
00675 CellDataType cellData;
00676 m_PointSetSeries[0]->GetCellData(cellId, &cellData);
00677 SelectedLinesType *selectedLines = &(cellData.selectedLines);
00678 SelectedLinesIter position = std::find(selectedLines->begin(),
00679 selectedLines->end(), (unsigned int) lineOp->GetId());
00680
00681 if (position == selectedLines->end())
00682 {
00683 cellData.selectedLines.push_back(lineOp->GetId());
00684 }
00685 m_PointSetSeries[0]->SetCellData(lineOp->GetCellId(), cellData);
00686 }
00687 }
00688 break;
00689
00690 case OpDESELECTLINE:
00691 {
00692 mitk::LineOperation *lineOp = dynamic_cast<mitk::LineOperation *>(operation);
00693 if (lineOp == NULL)
00694 {
00695 Superclass::ExecuteOperation(operation);
00696 }
00697 int cellId = lineOp->GetCellId();
00698 CellAutoPointer cellAutoPointer;
00699 bool ok = m_PointSetSeries[0]->GetCell(cellId, cellAutoPointer);
00700 if (ok)
00701 {
00702 CellDataType cellData;
00703 m_PointSetSeries[0]->GetCellData(cellId, &cellData);
00704 SelectedLinesType *selectedLines = &(cellData.selectedLines);
00705 SelectedLinesIter position = std::find(selectedLines->begin(),
00706 selectedLines->end(), (unsigned int) lineOp->GetId());
00707
00708 if (position != selectedLines->end())
00709 {
00710 selectedLines->erase(position);
00711 }
00712 m_PointSetSeries[0]->SetCellData(cellId, cellData);
00713 }
00714 }
00715 break;
00716
00717 case OpSELECTCELL:
00718 {
00719 mitk::LineOperation *lineOp =
00720 dynamic_cast<mitk::LineOperation *>(operation);
00721 if (lineOp == NULL)
00722 {
00723 Superclass::ExecuteOperation(operation);
00724 }
00725
00726 int cellId = lineOp->GetCellId();
00727 CellAutoPointer cellAutoPointer;
00728
00729
00730 bool ok = m_PointSetSeries[0]->GetCell(cellId, cellAutoPointer);
00731 if (ok)
00732 {
00733 CellDataType cellData;
00734 m_PointSetSeries[0]->GetCellData(cellId, &cellData);
00735 cellData.selected = true;
00736 m_PointSetSeries[0]->SetCellData(cellId, cellData);
00737 }
00738 }
00739 break;
00740
00741 case OpDESELECTCELL:
00742 {
00743 mitk::LineOperation *lineOp = dynamic_cast<mitk::LineOperation *>(operation);
00744 if (lineOp == NULL)
00745 {
00746 Superclass::ExecuteOperation(operation);
00747 }
00748 int cellId = lineOp->GetCellId();
00749 CellAutoPointer cellAutoPointer;
00750 bool ok = m_PointSetSeries[0]->GetCell(cellId, cellAutoPointer);
00751 if (ok)
00752 {
00753 CellDataType cellData;
00754 m_PointSetSeries[0]->GetCellData(cellId, &cellData);
00755 cellData.selected = false;
00756 m_PointSetSeries[0]->SetCellData(cellId, cellData);
00757 }
00758 }
00759 break;
00760
00761 case OpMOVECELL:
00762
00763 {
00764 mitk::CellOperation *lineOp = dynamic_cast<mitk::CellOperation *>(operation);
00765 if (lineOp == NULL)
00766 {
00767 Superclass::ExecuteOperation(operation);
00768 }
00769
00770 int cellId = lineOp->GetCellId();
00771 Vector3D vector = lineOp->GetVector();
00772
00773
00774 CellAutoPointer cellAutoPointer;
00775 bool ok = m_PointSetSeries[0]->GetCell(cellId, cellAutoPointer);
00776 if (!ok)
00777 return;
00778
00779 CellDataType cellData;
00780 m_PointSetSeries[0]->GetCellData(cellId, &cellData);
00781
00782
00783 PointIdIterator it = cellAutoPointer->PointIdsBegin();
00784 PointIdIterator end = cellAutoPointer->PointIdsEnd();
00785 while(it != end)
00786 {
00787 unsigned int position = (*it);
00788 PointType point;
00789 point.Fill(0);
00790 m_PointSetSeries[0]->GetPoint(position, &point);
00791 point = point + vector;
00792 m_PointSetSeries[0]->SetPoint(position, point);
00793 ++it;
00794 }
00795
00796 }
00797 break;
00798
00799 default:
00800
00801 Superclass::ExecuteOperation(operation);
00802 return;
00803 }
00804
00805 this->Modified();
00806
00807 mitk::OperationEndEvent endevent(operation);
00808 ((const itk::Object*)this)->InvokeEvent(endevent);
00809
00810
00811
00812
00813
00814 }
00815
00816 mitk::Mesh::DataType::BoundingBoxPointer
00817 mitk::Mesh::GetBoundingBoxFromCell( unsigned long cellId, int t )
00818 {
00819
00820
00821 DataType::BoundingBoxPointer bBoxPointer = NULL;
00822 CellAutoPointer cellAutoPointer;
00823 if ( m_PointSetSeries[t]->GetCell(cellId, cellAutoPointer))
00824 {
00825 DataType::PointsContainerPointer pointsContainer = DataType::PointsContainer::New();
00826 PointIdIterator bbIt = cellAutoPointer.GetPointer()->PointIdsBegin();
00827 PointIdIterator bbEnd = cellAutoPointer.GetPointer()->PointIdsEnd();
00828 while(bbIt != bbEnd)
00829 {
00830 mitk::PointSet::PointType point;
00831 bool pointOk = m_PointSetSeries[t]->GetPoint((*bbIt), &point);
00832 if (pointOk)
00833 pointsContainer->SetElement((*bbIt), point);
00834 ++bbIt;
00835 }
00836 bBoxPointer = DataType::BoundingBoxType::New();
00837 bBoxPointer->SetPoints(pointsContainer);
00838 bBoxPointer->ComputeBoundingBox();
00839 }
00840 return bBoxPointer;
00841 }