From: apo Date: Mon, 21 Aug 2006 14:40:06 +0000 (+0000) Subject: Fix for X-Git-Tag: mergefrom_BR_For_OCT_611_04Sep06~14 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=bd7e4a6c4ff60a74bd863c3ff7e89a10334679bd;p=modules%2Fvisu.git Fix for Bug PAL13237 - CRASH after trying to select a cell for "Selection Info". Bug PAL13239 - Numerations of elements(nodes) for the same mesh in Mesh and Post-Pro modules are different. The two bugs are bound together. The integrated fixes provide more correct definition of mapping between MED and VTK as for MED Families as for MED Entities itself. In case of definition of MED Families mapping it was necessary to increase the VTK index when the Family contains from mesh elements of different geometric type. And MED indexes should be taken from MED not from VISU CONVERTER internal numeration. --- diff --git a/src/CONVERTOR/VISU_Convertor_impl.cxx b/src/CONVERTOR/VISU_Convertor_impl.cxx index 174a0baf..c39f28fe 100644 --- a/src/CONVERTOR/VISU_Convertor_impl.cxx +++ b/src/CONVERTOR/VISU_Convertor_impl.cxx @@ -399,7 +399,7 @@ namespace VISU ::GetVTKOutput() { if(!myFilter.GetPointer()){ - const TVTKAppendFilter& anAppendFilter = myIDMapper.GetFilter(); + const TVTKAppendFilter& anAppendFilter = myIDMapper->GetFilter(); TVTKOutput* aGeometry = anAppendFilter->GetOutput(); const TVTKSource& aSource = mySource.GetSource(); @@ -419,42 +419,42 @@ namespace VISU TIDMapperFilter ::GetNodeObjID(vtkIdType theID) const { - return myIDMapper.GetNodeObjID(theID); + return myIDMapper->GetNodeObjID(theID); } vtkIdType TIDMapperFilter ::GetNodeVTKID(vtkIdType theID) const { - return myIDMapper.GetNodeVTKID(theID); + return myIDMapper->GetNodeVTKID(theID); } vtkFloatingPointType* TIDMapperFilter ::GetNodeCoord(vtkIdType theObjID) { - return myIDMapper.GetNodeCoord(theObjID); + return myIDMapper->GetNodeCoord(theObjID); } vtkIdType TIDMapperFilter ::GetElemObjID(vtkIdType theID) const { - return myIDMapper.GetElemObjID(theID); + return myIDMapper->GetElemObjID(theID); } vtkIdType TIDMapperFilter ::GetElemVTKID(vtkIdType theID) const { - return myIDMapper.GetElemVTKID(theID); + return myIDMapper->GetElemVTKID(theID); } vtkCell* TIDMapperFilter ::GetElemCell(vtkIdType theObjID) { - return myIDMapper.GetElemCell(theObjID); + return myIDMapper->GetElemCell(theObjID); } @@ -1278,9 +1278,9 @@ namespace vtkIdType anID = *aSubMeshIDIter; PrintCells(i,aConnectivity,anArray[anID]); aCellTypesArray->SetValue(j++,(unsigned char)aVGeom); - - anElemObj2VTKID[anID] = i; - aMeshID[i] = anID; + vtkIdType anObjID = aSubMesh.GetElemObjID(anID); + anElemObj2VTKID[anObjID] = i; + aMeshID[i] = anObjID; } } vtkIdType *pts = 0, npts = 0; @@ -2024,7 +2024,7 @@ VISU_Convertor_impl TFamilyArr& aFamilyArr = aGroup->myFamilyArr; aFamilyArr.resize(aFamilySet.size()); - for(vtkIdType anID = 0; anIter != aFamilySet.end(); anIter++){ + for(vtkIdType anID = 0; anIter != aFamilySet.end(); anIter++, anID++){ PFamilyImpl aFamily = *anIter; const std::string& aFamilyName = aFamily->myName; const VISU::TEntity& anEntity = aFamily->myEntity; @@ -2033,9 +2033,10 @@ VISU_Convertor_impl VISU::TVTKOutput* anOutput = anIDMapper->GetVTKOutput(); anAppendFilter->AddInput(anOutput); + vtkIdType aStartID = anElemObj2VTKID.size(); vtkIdType aNbCells = anOutput->GetNumberOfCells(); for(vtkIdType aCellID = 0; aCellID < aNbCells; aCellID++){ - anElemObj2VTKID[aFamily->GetElemObjID(aCellID)] = aCellID; + anElemObj2VTKID[aFamily->GetElemObjID(aCellID)] = aStartID + aCellID; } aFamilyArr[anID] = aFamily; } diff --git a/src/CONVERTOR/VISU_Convertor_impl.hxx b/src/CONVERTOR/VISU_Convertor_impl.hxx index 101de304..60692833 100644 --- a/src/CONVERTOR/VISU_Convertor_impl.hxx +++ b/src/CONVERTOR/VISU_Convertor_impl.hxx @@ -164,6 +164,7 @@ namespace VISU TVTKOutput* GetVTKOutput(); }; + typedef SharedPtr PAppendFilter; //--------------------------------------------------------------- @@ -386,7 +387,7 @@ namespace VISU //! Specialize TIDMapper to provide VTK mapping for MED TIMESTAMP mesh struct TIDMapperFilter: virtual TMergeFilter { - TAppendFilter myIDMapper; //!< Responsible for numbering + PAppendFilter myIDMapper; //!< Responsible for numbering TSource mySource; //!< Keeps assigned data //! Reimplement the TIDMapper::GetNodeObjID