default: return -1;
}
}
-
- PField
- TMesh
- ::GetField(const string& theFieldName) const
- {
- TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter = myMeshOnEntityMap.begin();
- for(; aMeshOnEntityMapIter != myMeshOnEntityMap.end(); aMeshOnEntityMapIter++){
- const TFieldMap& aFieldMap = aMeshOnEntityMapIter->second->myFieldMap;
- TFieldMap::const_iterator aFieldMapIter = aFieldMap.begin();
- for(; aFieldMapIter != aFieldMap.end(); aFieldMapIter++)
- if(theFieldName == aFieldMapIter->first)
- return aFieldMapIter->second;
- }
- return PField();
- }
-
-
- PFamily
- FindFamily(VISU::PMesh theMesh,
- const string& theFamilyName)
- {
- PFamily aFamily;
- const TMeshOnEntityMap& aMeshOnEntityMap = theMesh->myMeshOnEntityMap;
- TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
- for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++){
- const PMeshOnEntity aMeshOnEntity = aMeshOnEntityMapIter->second;
- aFamily = GetFamily(aMeshOnEntity,theFamilyName);
- if(aFamily)
- break;
- }
- return aFamily;
- }
-
-
- PFamily
- GetFamily(VISU::PMeshOnEntity theMeshOnEntity,
- const string& theFamilyName)
- {
- PFamily aFamily;
- if(theFamilyName != ""){
- TFamilyMap& aFamilyMap = theMeshOnEntity->myFamilyMap;
- TFamilyMap::iterator aFamilyMapIter = aFamilyMap.find(theFamilyName);
- if(aFamilyMapIter != aFamilyMap.end())
- aFamily = aFamilyMapIter->second;
- }
- return aFamily;
- }
}
#define VISU_Convertor_HeaderFile
#include "VISU_IDMapper.hxx"
+#include "VISU_ConvertorDef.hxx"
#include "MED_Vector.hxx"
#include <string>
#include <stdexcept>
-#include <stdio.h>
-
namespace VISU
{
using MED::TVector;
//---------------------------------------------------------------
- enum TEntity {NODE_ENTITY, EDGE_ENTITY, FACE_ENTITY, CELL_ENTITY};
-
- struct TMesh;
- typedef SharedPtr<TMesh> PMesh;
- typedef std::map<std::string,PMesh> TMeshMap;
-
- struct TGaussSubMesh;
- typedef SharedPtr<TGaussSubMesh> PGaussSubMesh;
-
- struct TGaussMesh;
- typedef SharedPtr<TGaussMesh> PGaussMesh;
-
- struct TSubProfile;
- typedef SharedPtr<TSubProfile> PSubProfile;
-
- struct TProfile;
- typedef SharedPtr<TProfile> PProfile;
-
- struct TMeshOnEntity;
- typedef SharedPtr<TMeshOnEntity> PMeshOnEntity;
-
- struct TFamily;
- typedef SharedPtr<TFamily> PFamily;
-
- struct TGroup;
- typedef SharedPtr<TGroup> PGroup;
-
- struct TField;
- typedef SharedPtr<TField> PField;
-
- struct TGauss;
- typedef SharedPtr<TGauss> PGauss;
-
- struct TValForTime;
- typedef SharedPtr<TValForTime> PValForTime;
-
typedef std::string TName;
typedef TVector<TName> TNames;
-
//---------------------------------------------------------------
struct TIntId: virtual TBaseStructure
{
TMesh(): myDim(0)
{}
-
- PField
- GetField(const std::string& theFieldName) const;
};
+ typedef std::map<std::string,PMesh> TMeshMap;
//---------------------------------------------------------------
//---------------------------------------------------------------
- PFamily
- FindFamily(VISU::PMesh theMesh,
- const std::string& theFamilyName);
-
- PFamily
- GetFamily(VISU::PMeshOnEntity theMeshOnEntity,
- const std::string& theFamilyName);
-
void
WriteToFile(vtkUnstructuredGrid* theDataSet,
const std::string& theFileName);
-
};
CreateConvertor(const std::string& theFileName);
};
+
#endif
static int MYVTKDEBUG = 0;
#ifdef _DEBUG_
-static int MYDEBUG = 1;
+static int MYDEBUG = 0;
static int MYDEBUGWITHFILES = 0;
//#define _DEXCEPT_
#else
const VISU::TEntity& theEntity,
const string& theFamilyName)
{
- PMeshImpl aMesh = FindMesh(theMeshName);
- VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
- VISU::TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter = aMeshOnEntityMap.find(theEntity);
- if(aMeshOnEntityMapIter == aMeshOnEntityMap.end())
- EXCEPTION(runtime_error,"FindFamilyOnEntity >> There is no mesh on the entity - "<<theEntity<<"!!!");
-
- PMeshOnEntityImpl aMeshOnEntity = aMeshOnEntityMapIter->second;
-
- return TFindFamilyOnEntity(aMesh,
- aMeshOnEntity,
- VISU::GetFamily(aMeshOnEntity,theFamilyName));
+ if(theFamilyName != ""){
+ PMeshImpl aMesh = FindMesh(theMeshName);
+ VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
+ VISU::TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter = aMeshOnEntityMap.find(theEntity);
+ if(aMeshOnEntityMapIter == aMeshOnEntityMap.end())
+ EXCEPTION(runtime_error,"FindFamilyOnEntity >> There is no mesh on the entity - "<<theEntity<<"!!!");
+
+ PMeshOnEntityImpl aMeshOnEntity = aMeshOnEntityMapIter->second;
+
+ TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap;
+ TFamilyMap::iterator aFamilyMapIter = aFamilyMap.find(theFamilyName);
+ if(aFamilyMapIter != aFamilyMap.end()){
+ const PFamily& aFamily = aFamilyMapIter->second;
+ return TFindFamilyOnEntity(aMesh,
+ aMeshOnEntity,
+ aFamily);
+ }
+ }
+ return TFindFamilyOnEntity();
}
using MED::EBooleen;
#ifdef _DEBUG_
-static int MYDEBUG = 1;
+static int MYDEBUG = 0;
static int MYVALUEDEBUG = 0;
-static int MY_FAMILY_DEBUG = 1;
-static int MY_GROUP_DEBUG = 1;
+static int MY_FAMILY_DEBUG = 0;
+static int MY_GROUP_DEBUG = 0;
//#define _DEXCEPT_
#else
static int MYDEBUG = 0;
for(int iFamaily = 0; iFamaily < iFamilyEnd; iFamaily++){
SALOME_MED::FAMILY_var aMEDFamily = aFamilies[iFamaily];
CORBA::String_var aFamilyName = aMEDFamily->getName();
- PCFamily aFamily = FindFamily(aMesh,aFamilyName.in());
+ TFindFamilyOnEntity aFindFamilyOnEntity =
+ FindFamilyOnEntity(aMeshName.in(),aVEntity,aFamilyName.in());
+ PCFamily aFamily = boost::get<2>(aFindFamilyOnEntity);
if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aGroup - aFamilyName = '"<<aFamilyName.in()<<"' = "<<bool(aFamily));
if(aFamily){
aFamilySet.insert(aFamily);