From: apo Date: Fri, 18 May 2007 07:51:44 +0000 (+0000) Subject: Porting on VTK 5.0 (it is non realiable to use pointer on vtkFloatingType return... X-Git-Tag: mergeto_BR_Dev_For_4_0_21May07~10 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ad6df69755e8cf1a6a7fa7b73ea37457c941744a;p=modules%2Fvisu.git Porting on VTK 5.0 (it is non realiable to use pointer on vtkFloatingType return value) --- diff --git a/src/VISUGUI/VisuGUI_Selection.cxx b/src/VISUGUI/VisuGUI_Selection.cxx index 0e74d231..c0c1a63a 100644 --- a/src/VISUGUI/VisuGUI_Selection.cxx +++ b/src/VISUGUI/VisuGUI_Selection.cxx @@ -446,8 +446,9 @@ void VisuGUI_SelectionDlg::onSelectionEvent() { myDZLbl->setText(QString::number( ABS(aCoord[5]-aCoord[4]) )); TColStd_IndexedMapOfInteger aMapIndex; - typedef map PointsMap; - PointsMap aPointsMap; + typedef std::vector TCoordArray; + typedef map 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