#endif
void parseFile(const char* theFileName) {
+#ifndef _DEBUG_
try{
+#endif
MSG(MYDEBUG,"'"<<theFileName<<"'...");
auto_ptr<VISU_Convertor> aCon(CreateConvertor(theFileName));
//aCon->GetSize();
}
}
MSG(MYDEBUG,"OK");
- }catch(std::exception& exc){
+#ifndef _DEBUG_
+ }catch(std::exception& exc){
MSG(MYDEBUG,"Follow exception was occured in file:"<<theFileName<<"\n"<<exc.what());
- }catch(...){
+ }catch(...){
MSG(MYDEBUG,"Unknown exception was occured in VISU_Convertor_impl in file:"<<theFileName);
- }
+ }
+#endif
}
int main(int argc, char** argv){
- try{
- 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]);
+ 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"<<exc.what());
- }catch(...){
- MSG(MYDEBUG,"Unknown exception was occured in VISU_Convertor_impl");
- }
+ return 0;
+ }
return 1;
}
}
+ //---------------------------------------------------------------
+ void
+ TPoints
+ ::Init(vtkIdType theDim)
+ {
+ myDim = theDim;
+ }
+
+ vtkIdType
+ TPoints
+ ::size() const
+ {
+ return myCoord.size()/myDim;
+ }
+
+ TCPointSlice
+ TPoints
+ ::GetPointSlice(vtkIdType theElemId) const
+ {
+ return TCPointSlice(myCoord,std::slice(theElemId*myDim,myDim,1));
+ }
+
+ TPointSlice
+ TPoints
+ ::GetPointSlice(vtkIdType theElemId)
+ {
+ return TPointSlice(myCoord,std::slice(theElemId*myDim,myDim,1));
+ }
+
+
//---------------------------------------------------------------
TMeshImpl::TMeshImpl():
myPoints(vtkPoints::New()),
//---------------------------------------------------------------
enum ECoordName{eX, eY, eZ, eNone};
- typedef VISU::TCoord (*TGetCoord)(const VISU::TMeshImpl::TPointsCoord&, int);
+ typedef VISU::TCoord (*TGetCoord)(const VISU::TPointsCoord&, int);
template<ECoordName TheCoordId>
VISU::TCoord
- GetCoord(const VISU::TMeshImpl::TPointsCoord& thePointsCoord,
+ GetCoord(const VISU::TPointsCoord& thePointsCoord,
int theStartPos)
{
return thePointsCoord[theStartPos+TheCoordId];
template<>
VISU::TCoord
- GetCoord<eNone>(const VISU::TMeshImpl::TPointsCoord& thePointsCoord,
+ GetCoord<eNone>(const VISU::TPointsCoord& thePointsCoord,
int theStartPos)
{
return 0.0;
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)
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};
#ifndef VISU_Convertor_impl_HeaderFile
#define VISU_Convertor_impl_HeaderFile
-#include "VISU_Convertor.hxx"
-
#include <vtkSystemIncludes.h>
#include <vtkSmartPointer.h>
class vtkAppendFilter;
class vtkUnstructuredGrid;
+#include "VISU_Convertor.hxx"
+#include "MED_SliceArray.hxx"
+
namespace VISU
{
+ using MED::TCSlice;
+ using MED::TSlice;
+
typedef vtkSmartPointer<vtkPoints> TVTKPoints;
typedef vtkSmartPointer<vtkUnstructuredGrid> TVTKSource;
typedef vtkSmartPointer<vtkAppendFilter> TVTKAppendFilter;
bool myIsInitialized;
};
+
+ //---------------------------------------------------------------
+ typedef std::vector<TCoord> TPointsCoord;
+ typedef TSlice<TPointsCoord> TPointSlice;
+ typedef TCSlice<TPointsCoord> 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<TCoord> TPointsCoord;
TPointsCoord myPointsCoord;
typedef std::vector<std::string> TPointsDim;
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++)