From 2aae2e1b19f5502eab29dd6e5ace9dfde3879090 Mon Sep 17 00:00:00 2001 From: apo Date: Fri, 16 Dec 2005 16:35:03 +0000 Subject: [PATCH] To fix Bug GVIEW10692 displaced parent mesh element on TRIA3 element on Sandia file --- src/CONVERTOR/VISU_Convertor.hxx | 2 +- src/CONVERTOR/VISU_Convertor_impl.cxx | 53 ++++++++++++++++++++------- src/CONVERTOR/VISU_Convertor_impl.hxx | 10 +++++ src/CONVERTOR/VISU_MedConvertor.cxx | 2 + 4 files changed, 52 insertions(+), 15 deletions(-) diff --git a/src/CONVERTOR/VISU_Convertor.hxx b/src/CONVERTOR/VISU_Convertor.hxx index ea3debee..95b7cb1a 100644 --- a/src/CONVERTOR/VISU_Convertor.hxx +++ b/src/CONVERTOR/VISU_Convertor.hxx @@ -93,7 +93,7 @@ namespace VISU //--------------------------------------------------------------- //! Define a containerfor MED PROFILE entities which belongs to the same MED ENTITY - struct TProfile: virtual TIDMapper + struct TProfile: virtual TNamedIDMapper {}; diff --git a/src/CONVERTOR/VISU_Convertor_impl.cxx b/src/CONVERTOR/VISU_Convertor_impl.cxx index 195714ae..c1ef8027 100644 --- a/src/CONVERTOR/VISU_Convertor_impl.cxx +++ b/src/CONVERTOR/VISU_Convertor_impl.cxx @@ -312,7 +312,7 @@ namespace VISU TProfileImpl ::GetNodeCoord(vtkIdType theObjID) { - if(myMeshOnEntity) + if(myIsAll) return myMeshOnEntity->GetNodeCoord(theObjID); vtkIdType aVtkID = GetNodeVTKID(theObjID); @@ -323,7 +323,7 @@ namespace VISU TProfileImpl ::GetElemObjID(vtkIdType theID) const { - if(myMeshOnEntity) + if(myIsAll) return myMeshOnEntity->GetElemObjID(theID); vtkIdType anInputID; @@ -337,7 +337,7 @@ namespace VISU TProfileImpl ::GetElemVTKID(vtkIdType theID) const { - if(myMeshOnEntity) + if(myIsAll) return myMeshOnEntity->GetElemVTKID(theID); if(myElemObj2VTKID.empty()) @@ -354,7 +354,7 @@ namespace VISU TProfileImpl ::GetElemCell(vtkIdType theObjID) { - if(myMeshOnEntity) + if(myIsAll) return myMeshOnEntity->GetElemCell(theObjID); vtkIdType aVtkID = GetElemVTKID(theObjID); @@ -365,7 +365,31 @@ namespace VISU TProfileImpl ::GetVTKOutput() { - return mySource.GetVTKOutput(); + const TVTKAppendFilter& anAppendFilter = GetFilter(); + return anAppendFilter->GetOutput(); + } + + std::string + TProfileImpl + ::GetNodeName(vtkIdType theObjID) const + { + return myNamedPointCoords->GetNodeName(theObjID); + } + + std::string + TProfileImpl + ::GetElemName(vtkIdType theObjID) const + { + if(myIsAll) + return myMeshOnEntity->GetElemName(theObjID); + + vtkIdType anInputID; + vtkIdType aVTKId = GetElemVTKID(theObjID); + const TVTKAppendFilter& anAppendFilter = GetFilter(); + vtkIdType aSubID = anAppendFilter->GetCellInputID(aVTKId,anInputID); + PSubProfileImpl aSubProfileImpl = mySubProfileArr[anInputID]; + vtkIdType anEntityObjId = aSubProfileImpl->GetElemObjID(aSubID); + return myMeshOnEntity->GetElemName(anEntityObjId); } @@ -494,6 +518,7 @@ namespace VISU vtkIdType anInputDataSetID; vtkIdType anInputID = anAppendFilter->GetCellInputID(theID,anInputDataSetID); const TGaussSubMeshImpl& aSubMeshImpl = myGaussSubMeshArr[anInputDataSetID]; + return aSubMeshImpl.GetObjID(anInputID); } @@ -1475,13 +1500,13 @@ namespace if(theProfile->myIsVTKDone) return; + theProfile->myMeshOnEntity = theMeshOnEntity.get(); const TVTKAppendFilter& anAppendFilter = theProfile->GetFilter(); anAppendFilter->SetPoints(GetPoints(theMesh)); if(theProfile->myIsAll){ TVTKOutput* aDataSet = theMeshOnEntity->GetVTKOutput(); anAppendFilter->AddInput(aDataSet); - theProfile->myMeshOnEntity = theMeshOnEntity.get(); }else{ const TGeom2SubProfile& aGeom2SubProfile = theProfile->myGeom2SubProfile; @@ -1736,7 +1761,6 @@ namespace anAppendFilter->Update(); // Fix on VTK theMeshOnEntity->GetVTKOutput()->Update(); - theGaussMesh->myParent = theMeshOnEntity.get(); vtkDataSet* aSource = anAppendFilter->GetOutput(); INITMSGA(MYDEBUG,0,"aNbPoints - "<GetNumberOfPoints()<myStartID = aCellID; vtkIdType aNbCells = aSource->GetNumberOfCells(); for(vtkIdType aCell = 0; aCell < aNbCells; aCell++, aCellID++){ - anElemObj2VTKID[aSubMesh->GetElemObjID(aCell)] = aCellID; + vtkIdType anObjID = aSubMesh->GetElemObjID(aCell); + anElemObj2VTKID[anObjID] = aCellID; } aSubMeshArr[anID] = aSubMesh; } @@ -2083,11 +2108,7 @@ VISU_Convertor_impl GetMeshOnEntity(aVTKMeshOnEntity->myMeshName,aVTKMeshOnEntity->myEntity); PProfileImpl aProfile = aValForTime->myProfile; - TSource& aProfileSource = aProfile->mySource; - if(!aProfileSource.myIsVTKDone){ - GetMeshOnProfile(aMesh,aVTKMeshOnEntity,aProfile); - aProfileSource.myIsVTKDone = true; - } + GetMeshOnProfile(aMesh,aVTKMeshOnEntity,aProfile); anIDMapperFilter->myIDMapper = aProfile; TVTKOutput* anOutput = anIDMapperFilter->GetVTKOutput(); @@ -2163,13 +2184,17 @@ VISU_Convertor_impl GetMeshOnEntity(aVTKMeshOnEntity->myMeshName,aVTKMeshOnEntity->myEntity); + PProfileImpl aProfile = aValForTime->myProfile; + GetMeshOnProfile(aMesh,aVTKMeshOnEntity,aProfile); + PGaussMeshImpl aGaussMesh = aValForTime->myGaussMesh; TSource& aGaussPtsSource = aGaussMesh->mySource; if(!aGaussPtsSource.myIsVTKDone){ BuildGaussMesh(aMesh,aVTKMeshOnEntity,aGaussMesh); + aGaussMesh->myParent = aProfile.get(); aGaussPtsSource.myIsVTKDone = true; } - + aGaussPtsIDFilter->myIDMapper = aGaussMesh; aGaussPtsIDFilter->myGaussPtsIDMapper = aGaussMesh; TVTKOutput* anOutput = aGaussPtsIDFilter->GetVTKOutput(); diff --git a/src/CONVERTOR/VISU_Convertor_impl.hxx b/src/CONVERTOR/VISU_Convertor_impl.hxx index c1923c3b..583fb0bf 100644 --- a/src/CONVERTOR/VISU_Convertor_impl.hxx +++ b/src/CONVERTOR/VISU_Convertor_impl.hxx @@ -361,6 +361,16 @@ namespace VISU TVTKOutput* GetVTKOutput(); + //! Reimplement the TNamedIDMapper::GetNodeName + virtual + std::string + GetNodeName(vtkIdType theObjID) const; + + //! Reimplement the TNamedIDMapper::GetElemName + virtual + std::string + GetElemName(vtkIdType theObjID) const; + TID2ID myElemObj2VTKID; //!< Keeps object to VTK numeration mapping TSubProfileArr mySubProfileArr; //!< Keeps sequence of TSubProfiles as they were added into TAppendFilter PNamedPointCoords myNamedPointCoords; //!< Keeps reference on the same TNamedPointCoords as TMesh diff --git a/src/CONVERTOR/VISU_MedConvertor.cxx b/src/CONVERTOR/VISU_MedConvertor.cxx index f4bb2ec2..4cb7050c 100644 --- a/src/CONVERTOR/VISU_MedConvertor.cxx +++ b/src/CONVERTOR/VISU_MedConvertor.cxx @@ -378,6 +378,8 @@ namespace MED::TGeom2Size::const_iterator aTimeStampIter = theGeom2Size.find(aMGeom); if(aTimeStampIter != theGeom2Size.end()){ TInt aNbCells = aTimeStampIter->second; + if(aSubProfile->myStatus == eAddPart) + aNbCells = aSubProfile->myNbCells; PMEDGaussSubMesh aGaussSubMesh(new TMEDGaussSubMesh()); aGaussSubMesh->mySubProfile = aSubProfile; -- 2.39.2