From: apo Date: Thu, 9 Feb 2006 13:12:37 +0000 (+0000) Subject: Fix for Bug IPAL11380 X-Git-Tag: mergeto_trunk_13Mar06~53 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d319d9fc14d0ad4da8c46bf024b8676588c22819;p=modules%2Fvisu.git Fix for Bug IPAL11380 Position of the parent mesh element is incorrect: --- diff --git a/src/CONVERTOR/VISU_Convertor_impl.cxx b/src/CONVERTOR/VISU_Convertor_impl.cxx index ba2a8ad5..8d1fe336 100644 --- a/src/CONVERTOR/VISU_Convertor_impl.cxx +++ b/src/CONVERTOR/VISU_Convertor_impl.cxx @@ -326,11 +326,11 @@ namespace VISU if(myIsAll) return myMeshOnEntity->GetElemObjID(theID); - vtkIdType anInputID; + vtkIdType anInputID, aStartID, anInputDataSetID; const TVTKAppendFilter& anAppendFilter = GetFilter(); - vtkIdType aID = anAppendFilter->GetCellInputID(theID,anInputID); - PSubProfileImpl aSubProfileImpl = mySubProfileArr[anInputID]; - return aSubProfileImpl->GetElemObjID(aID); + anAppendFilter->GetCellInputID(theID,anInputID,aStartID,anInputDataSetID); + PSubProfileImpl aSubProfileImpl = mySubProfileArr[anInputDataSetID]; + return aSubProfileImpl->GetElemObjID(anInputID); } vtkIdType @@ -383,12 +383,12 @@ namespace VISU if(myIsAll) return myMeshOnEntity->GetElemName(theObjID); - vtkIdType anInputID; vtkIdType aVTKId = GetElemVTKID(theObjID); + vtkIdType anInputID, aStartID, anInputDataSetID; const TVTKAppendFilter& anAppendFilter = GetFilter(); - vtkIdType aSubID = anAppendFilter->GetCellInputID(aVTKId,anInputID); - PSubProfileImpl aSubProfileImpl = mySubProfileArr[anInputID]; - vtkIdType anEntityObjId = aSubProfileImpl->GetElemObjID(aSubID); + anAppendFilter->GetCellInputID(aVTKId,anInputID,aStartID,anInputDataSetID); + PSubProfileImpl aSubProfileImpl = mySubProfileArr[anInputDataSetID]; + vtkIdType anEntityObjId = aSubProfileImpl->GetElemObjID(anInputID); return myMeshOnEntity->GetElemName(anEntityObjId); } @@ -475,9 +475,10 @@ namespace VISU TGaussPointID TGaussSubMeshImpl - ::GetObjID(vtkIdType theID) const + ::GetObjID(vtkIdType theID, + vtkIdType theStartID) const { - TCellID aCellID = theID / myGauss->myNbPoints; + TCellID aCellID = theStartID + theID / myGauss->myNbPoints; TLocalPntID aLocalPntID = theID % myGauss->myNbPoints; return TGaussPointID(aCellID,aLocalPntID); @@ -514,12 +515,12 @@ namespace VISU TGaussMeshImpl ::GetObjID(vtkIdType theID) const { + vtkIdType anInputID, aStartId, anInputDataSetID; const TVTKAppendFilter& anAppendFilter = GetFilter(); - vtkIdType anInputDataSetID; - vtkIdType anInputID = anAppendFilter->GetCellInputID(theID,anInputDataSetID); + anAppendFilter->GetCellInputID(theID,anInputID,aStartId,anInputDataSetID); const TGaussSubMeshImpl& aSubMeshImpl = myGaussSubMeshArr[anInputDataSetID]; - return aSubMeshImpl.GetObjID(anInputID); + return aSubMeshImpl.GetObjID(anInputID,aStartId); } TVTKOutput* @@ -601,11 +602,11 @@ namespace VISU TMeshOnEntityImpl ::GetElemObjID(vtkIdType theID) const { - vtkIdType anInputID; + vtkIdType anInputID, aStartId, anInputDataSetID; const TVTKAppendFilter& anAppendFilter = GetFilter(); - vtkIdType aID = anAppendFilter->GetCellInputID(theID,anInputID); - const PSubMeshImpl& aSubMesh = mySubMeshArr[anInputID]; - return aSubMesh->GetElemObjID(aID); + anAppendFilter->GetCellInputID(theID,anInputID,aStartId,anInputDataSetID); + const PSubMeshImpl& aSubMesh = mySubMeshArr[anInputDataSetID]; + return aSubMesh->GetElemObjID(anInputID); } std::string @@ -620,11 +621,11 @@ namespace VISU ::GetElemName(vtkIdType theObjID) const { vtkIdType aVTKId = GetElemVTKID(theObjID); - vtkIdType anInputID; + vtkIdType anInputID, aStartId, anInputDataSetID; const TVTKAppendFilter& anAppendFilter = GetFilter(); - vtkIdType aSubID = anAppendFilter->GetCellInputID(aVTKId,anInputID); - const PSubMeshImpl& aSubMesh = mySubMeshArr[anInputID]; - return aSubMesh->GetElemName(aSubID); + anAppendFilter->GetCellInputID(aVTKId,anInputID,aStartId,anInputDataSetID); + const PSubMeshImpl& aSubMesh = mySubMeshArr[anInputDataSetID]; + return aSubMesh->GetElemName(anInputID); } //--------------------------------------------------------------- @@ -704,11 +705,11 @@ namespace VISU TGroupImpl ::GetElemObjID(vtkIdType theID) const { - vtkIdType anInputID; + vtkIdType anInputID, aStartId, anInputDataSetID; const TVTKAppendFilter& anAppendFilter = GetFilter(); - vtkIdType anID = anAppendFilter->GetCellInputID(theID,anInputID); - const PFamilyImpl& aFamily = myFamilyArr[anInputID]; - return aFamily->GetElemObjID(anID); + anAppendFilter->GetCellInputID(theID,anInputID,aStartId,anInputDataSetID); + const PFamilyImpl& aFamily = myFamilyArr[anInputDataSetID]; + return aFamily->GetElemObjID(anInputID); } vtkIdType diff --git a/src/CONVERTOR/VISU_Convertor_impl.hxx b/src/CONVERTOR/VISU_Convertor_impl.hxx index c4efc7d2..20889db7 100644 --- a/src/CONVERTOR/VISU_Convertor_impl.hxx +++ b/src/CONVERTOR/VISU_Convertor_impl.hxx @@ -456,7 +456,8 @@ namespace VISU //! To implement the TGaussPtsIDMapper::GetObjID virtual TGaussPointID - GetObjID(vtkIdType theID) const; + GetObjID(vtkIdType theID, + vtkIdType theStartID) const; PGaussImpl myGauss; //myNbPoints; - TCellID aCellID = theID / aNbPoints; + TCellID aCellID = theID / myGauss->myNbPoints; + TLocalPntID aLocalPntID = theID % myGauss->myNbPoints; + if(myIsElemNum) aCellID = myElemNum[aCellID]; - - TLocalPntID aLocalPntID = theID % aNbPoints; + else + aCellID += theStartID; return TGaussPointID(aCellID,aLocalPntID); } @@ -913,7 +915,10 @@ namespace ::Init(const MED::PElemInfo& theElemInfo) { myIsElemNum = theElemInfo->IsElemNum(); - myElemNum = theElemInfo->myElemNum; + + if(myIsElemNum) + myElemNum = theElemInfo->myElemNum; + if(theElemInfo->IsElemNames()) myElemInfo = theElemInfo; } diff --git a/src/CONVERTOR/VISU_MedConvertor.hxx b/src/CONVERTOR/VISU_MedConvertor.hxx index abcb6ad7..0ce3377a 100644 --- a/src/CONVERTOR/VISU_MedConvertor.hxx +++ b/src/CONVERTOR/VISU_MedConvertor.hxx @@ -99,7 +99,8 @@ namespace VISU virtual TGaussPointID - GetObjID(vtkIdType theID) const; + GetObjID(vtkIdType theID, + vtkIdType theStartID) const; }; typedef SharedPtr PMEDGaussSubMesh;