]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Porting on VTK 5.0 (it is non realiable to use pointer on vtkFloatingType return...
authorapo <apo@opencascade.com>
Fri, 18 May 2007 07:51:44 +0000 (07:51 +0000)
committerapo <apo@opencascade.com>
Fri, 18 May 2007 07:51:44 +0000 (07:51 +0000)
src/VISUGUI/VisuGUI_Selection.cxx

index 0e74d23170e03ed836330c422c003b51a36fd7d2..c0c1a63a67b786a3cae38c3bba586eaab856961e 100644 (file)
@@ -446,8 +446,9 @@ void VisuGUI_SelectionDlg::onSelectionEvent() {
       myDZLbl->setText(QString::number( ABS(aCoord[5]-aCoord[4]) ));
 
       TColStd_IndexedMapOfInteger aMapIndex;
-      typedef map<int,vtkFloatingPointType*> PointsMap;
-      PointsMap aPointsMap;
+      typedef std::vector<vtkFloatingPointType> TCoordArray;
+      typedef map<int, TCoordArray> TPointCoordsMap;
+      TPointCoordsMap aPointCoordsMap;
 
       aSelector->GetIndex(anIO, aMapIndex);
 
@@ -504,7 +505,8 @@ void VisuGUI_SelectionDlg::onSelectionEvent() {
                   int aNodeVTKId = aPointList->GetId(i);
                   vtkFloatingPointType* aCoord = aDataSet->GetPoint(aNodeVTKId);
                  vtkIdType aNodeObjId = anVISUActor->GetNodeObjId(aNodeVTKId);
-                  aPointsMap.insert(PointsMap::value_type(aNodeObjId,aCoord));
+                 TCoordArray aCoordArray(aCoord, aCoord + 3);
+                  aPointCoordsMap[aNodeObjId] = aCoordArray;
                 }
               }
             }
@@ -513,13 +515,13 @@ void VisuGUI_SelectionDlg::onSelectionEvent() {
         }
       }
 
-      myListPoints->setNumRows(aPointsMap.size());
-      PointsMap::const_iterator It = aPointsMap.begin();
+      myListPoints->setNumRows(aPointCoordsMap.size());
+      TPointCoordsMap::const_iterator anIter = aPointCoordsMap.begin();
 
       const VISU::PIDMapper& aMapper = aPrs3d->GetPipeLine()->GetIDMapper();
-      for (int i = 0; It != aPointsMap.end() && i < myListPoints->numRows(); It++, i++) {
+      for (int i = 0; anIter != aPointCoordsMap.end() && i < myListPoints->numRows(); anIter++, i++) {
         myListPoints->verticalHeader()->setLabel(i, QString::number( i ));
-        int id = It->first;
+        int id = anIter->first;
        //ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
        VISU::TIdTypeVector aVec = aMapper->GetIndexesOfNode(id);
        QString aI,aJ,aK;
@@ -538,10 +540,10 @@ void VisuGUI_SelectionDlg::onSelectionEvent() {
        //ENK: 23.11.2006
 
         myListPoints->setText(i, 0, QString::number( id ));
-        vtkFloatingPointType* aCoord = It->second;
-        myListPoints->setText(i, 1, QString::number( aCoord[0] ));
-        myListPoints->setText(i, 2, QString::number( aCoord[1] ));
-        myListPoints->setText(i, 3, QString::number( aCoord[2] ));
+        const TCoordArray& aCoordArray = anIter->second;
+        myListPoints->setText(i, 1, QString::number( aCoordArray[0] ));
+        myListPoints->setText(i, 2, QString::number( aCoordArray[1] ));
+        myListPoints->setText(i, 3, QString::number( aCoordArray[2] ));
         myListPoints->setText(i, 4, aI);//ENK: 23.11.2006 - PAL13176
         myListPoints->setText(i, 5, aJ);//ENK: 23.11.2006 - PAL13176
         myListPoints->setText(i, 6, aK);//ENK: 23.11.2006 - PAL13176