-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// File : DriverMED_W_SMESHDS_Mesh.cxx
// Module : SMESH
//
-#include <sstream>
#include "DriverMED_W_SMESHDS_Mesh.h"
-#include "DriverMED_Family.h"
-#include "SMESHDS_Mesh.hxx"
+#include "DriverMED_Family.h"
+#include "MED_Factory.hxx"
+#include "MED_Utilities.hxx"
#include "SMDS_MeshElement.hxx"
#include "SMDS_MeshNode.hxx"
#include "SMDS_PolyhedralVolumeOfNodes.hxx"
+#include "SMESHDS_Mesh.hxx"
-#include "utilities.h"
+#include <utilities.h>
-#include "MED_Utilities.hxx"
#define _EDF_NODE_IDS_
//#define _ELEMENTS_BY_DIM_
DriverMED_W_SMESHDS_Mesh::DriverMED_W_SMESHDS_Mesh():
+ myMedVersion(MED::eV2_2),
myAllSubMeshes (false),
myDoGroupOfNodes (false),
myDoGroupOfEdges (false),
myDoGroupOfFaces (false),
myDoGroupOfVolumes (false),
myDoGroupOf0DElems(false),
- myDoGroupOfBalls(false)
+ myDoGroupOfBalls(false),
+ myAutoDimension(true)
{}
void DriverMED_W_SMESHDS_Mesh::SetFile(const std::string& theFileName,
- MED::EVersion theId)
+ MED::EVersion theId)
{
- myMed = CrWrapper(theFileName,theId);
Driver_SMESHDS_Mesh::SetFile(theFileName);
+ myMedVersion = theId;
}
void DriverMED_W_SMESHDS_Mesh::SetFile(const std::string& theFileName)
{
- return SetFile(theFileName,MED::eV2_2);
+ Driver_SMESHDS_Mesh::SetFile(theFileName);
}
string DriverMED_W_SMESHDS_Mesh::GetVersionString(const MED::EVersion theVersion, int theNbDigits)
myDoGroupOfVolumes = true;
}
-namespace{
+namespace
+{
typedef double (SMDS_MeshNode::* TGetCoord)() const;
typedef const char* TName;
typedef const char* TUnit;
}
// Mesh dimension definition
- TInt aSpaceDimension;
+ TInt aSpaceDimension = 3;
TCoordHelperPtr aCoordHelperPtr;
{
bool anIsXDimension = false;
bool anIsYDimension = false;
bool anIsZDimension = false;
+ if ( myAutoDimension )
{
SMDS_NodeIteratorPtr aNodesIter = myMesh->nodesIterator();
double aBounds[6];
if ( myMesh->NbVolumes() > 0 )
aMeshDimension = 3;
+ MED::PWrapper myMed = CrWrapper(myFile,myMedVersion);
PMeshInfo aMeshInfo = myMed->CrMeshInfo(aMeshDimension,aSpaceDimension,aMeshName);
MESSAGE("Add - aMeshName : "<<aMeshName<<"; "<<aMeshInfo->GetName());
myMed->SetMeshInfo(aMeshInfo);