From e3601d4962b1abffe1683355e5cad56415b0ef5d Mon Sep 17 00:00:00 2001 From: apo Date: Thu, 21 Jul 2005 13:32:31 +0000 Subject: [PATCH] To implement Slice of the points coordinates --- src/CONVERTOR/VISUConvertor.cxx | 44 +++++++++++++-------------- src/CONVERTOR/VISU_Convertor_impl.cxx | 42 +++++++++++++++++++++---- src/CONVERTOR/VISU_Convertor_impl.hxx | 36 ++++++++++++++++++++-- src/CONVERTOR/VISU_MedConvertor.cxx | 2 +- 4 files changed, 91 insertions(+), 33 deletions(-) diff --git a/src/CONVERTOR/VISUConvertor.cxx b/src/CONVERTOR/VISUConvertor.cxx index e43e8c0b..22aa9c72 100644 --- a/src/CONVERTOR/VISUConvertor.cxx +++ b/src/CONVERTOR/VISUConvertor.cxx @@ -44,7 +44,9 @@ static int MYDEBUG = 0; #endif void parseFile(const char* theFileName) { +#ifndef _DEBUG_ try{ +#endif MSG(MYDEBUG,"'"< aCon(CreateConvertor(theFileName)); //aCon->GetSize(); @@ -105,37 +107,33 @@ void parseFile(const char* theFileName) { } } MSG(MYDEBUG,"OK"); - }catch(std::exception& exc){ +#ifndef _DEBUG_ + }catch(std::exception& exc){ MSG(MYDEBUG,"Follow exception was occured in file:"< 1){ - QFileInfo fi(argv[1]); - for(int i = 0; i < 1; i++){ - if(fi.exists()){ - if(fi.isDir()){ - QDir aDir(fi.absFilePath()); - QStringList aStringList = aDir.entryList("*.med",QDir::Files); - int jEnd = aStringList.count(); - for(int j = 0; j < jEnd; j++){ - parseFile(aDir.filePath(aStringList[j]).latin1()); - } - }else{ - parseFile(argv[1]); + if(argc > 1){ + QFileInfo fi(argv[1]); + for(int i = 0; i < 1; i++){ + if(fi.exists()){ + if(fi.isDir()){ + QDir aDir(fi.absFilePath()); + QStringList aStringList = aDir.entryList("*.med",QDir::Files); + int jEnd = aStringList.count(); + for(int j = 0; j < jEnd; j++){ + parseFile(aDir.filePath(aStringList[j]).latin1()); } + }else{ + parseFile(argv[1]); } } - return 0; } - }catch(std::exception& exc){ - MSG(MYDEBUG,"Follow exception was occured :\n"< VISU::TCoord - GetCoord(const VISU::TMeshImpl::TPointsCoord& thePointsCoord, + GetCoord(const VISU::TPointsCoord& thePointsCoord, int theStartPos) { return thePointsCoord[theStartPos+TheCoordId]; @@ -226,7 +256,7 @@ namespace template<> VISU::TCoord - GetCoord(const VISU::TMeshImpl::TPointsCoord& thePointsCoord, + GetCoord(const VISU::TPointsCoord& thePointsCoord, int theStartPos) { return 0.0; @@ -279,10 +309,10 @@ namespace class TCoordHelper{ - const VISU::TMeshImpl::TPointsCoord& myPointsCoord; + const VISU::TPointsCoord& myPointsCoord; TGetCoord* myGetCoord; public: - TCoordHelper(const VISU::TMeshImpl::TPointsCoord& thePointsCoord, + TCoordHelper(const VISU::TPointsCoord& thePointsCoord, TGetCoord* theGetCoord): myPointsCoord(thePointsCoord), myGetCoord(theGetCoord) @@ -305,7 +335,7 @@ namespace if(!theMesh->myIsInitialized){ TCoordHelperPtr aCoordHelperPtr; - const VISU::TMeshImpl::TPointsCoord& anArray = theMesh->myPointsCoord; + const VISU::TPointsCoord& anArray = theMesh->myPointsCoord; { int aMeshDimension = theMesh->myDim; bool anIsDimPresent[3] = {false, false, false}; diff --git a/src/CONVERTOR/VISU_Convertor_impl.hxx b/src/CONVERTOR/VISU_Convertor_impl.hxx index 6cadc0ba..c1d97dbf 100644 --- a/src/CONVERTOR/VISU_Convertor_impl.hxx +++ b/src/CONVERTOR/VISU_Convertor_impl.hxx @@ -9,8 +9,6 @@ #ifndef VISU_Convertor_impl_HeaderFile #define VISU_Convertor_impl_HeaderFile -#include "VISU_Convertor.hxx" - #include #include @@ -21,9 +19,15 @@ class vtkPoints; class vtkAppendFilter; class vtkUnstructuredGrid; +#include "VISU_Convertor.hxx" +#include "MED_SliceArray.hxx" + namespace VISU { + using MED::TCSlice; + using MED::TSlice; + typedef vtkSmartPointer TVTKPoints; typedef vtkSmartPointer TVTKSource; typedef vtkSmartPointer TVTKAppendFilter; @@ -42,11 +46,37 @@ namespace VISU bool myIsInitialized; }; + + //--------------------------------------------------------------- + typedef std::vector TPointsCoord; + typedef TSlice TPointSlice; + typedef TCSlice TCPointSlice; + + struct TPoints: virtual TBaseStructure + { + vtkIdType myDim; + + TPointsCoord myCoord; + + public: + + TCPointSlice + GetPointSlice(vtkIdType theElemId) const; + + TPointSlice + GetPointSlice(vtkIdType theElemId); + + void + Init(vtkIdType theDim); + + vtkIdType + size() const; + }; + //--------------------------------------------------------------- struct TMeshImpl: virtual TMesh { - typedef std::vector TPointsCoord; TPointsCoord myPointsCoord; typedef std::vector TPointsDim; diff --git a/src/CONVERTOR/VISU_MedConvertor.cxx b/src/CONVERTOR/VISU_MedConvertor.cxx index 10af20dc..8b27ec3d 100644 --- a/src/CONVERTOR/VISU_MedConvertor.cxx +++ b/src/CONVERTOR/VISU_MedConvertor.cxx @@ -854,7 +854,7 @@ VISU_MedConvertor for(int iDim = 0; iDim < theMesh->myDim; iDim++) aPointsDim[iDim] = aNodeInfo->GetCoordName(iDim); - VISU::TMeshImpl::TPointsCoord& aPointsCoord = theMesh->myPointsCoord; + VISU::TPointsCoord& aPointsCoord = theMesh->myPointsCoord; aPointsCoord.resize(aNbElem*theMesh->myDim); for (int iElem = 0; iElem < aNbElem; iElem++) for(int iDim = 0, iElem2Dim = iElem*theMesh->myDim; iDim < theMesh->myDim; iDim++, iElem2Dim++) -- 2.39.2