X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FDriverGMF%2FDriverGMF_Write.cxx;h=a49f7a7f2ac96eec2cfdbe2b1bd390fa54d802fe;hb=2f549d1c9a2a2791550d3f617354ade97d588a78;hp=5beadcd1797e55f3d144d7e5c36a2dc172b31fae;hpb=920fe932b10ce5e9da132f0fce3be2bbef95fa3a;p=modules%2Fsmesh.git diff --git a/src/DriverGMF/DriverGMF_Write.cxx b/src/DriverGMF/DriverGMF_Write.cxx index 5beadcd17..a49f7a7f2 100644 --- a/src/DriverGMF/DriverGMF_Write.cxx +++ b/src/DriverGMF/DriverGMF_Write.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2023 CEA, EDF, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -34,6 +34,8 @@ #include "utilities.h" +using SMESHUtils::ControlPnt; + extern "C" { #include "libmesh5.h" @@ -55,8 +57,8 @@ extern "C" elemIt = elementIterator( SMDSGeom ); \ if ( elemIt->more() ) \ { \ - int totalNbElems = myMesh->GetMeshInfo().NbElements( SMDSGeom ); \ - int nbLinearElems = myMesh->GetMeshInfo().NbElements( LinType ); \ + smIdType totalNbElems = myMesh->GetMeshInfo().NbElements( SMDSGeom );\ + smIdType nbLinearElems = myMesh->GetMeshInfo().NbElements( LinType ); \ if ( totalNbElems - nbLinearElems > 0 ) \ { \ GmfSetKwd(meshID, GmfKwd, totalNbElems - nbLinearElems); \ @@ -80,29 +82,6 @@ extern "C" }}}} -Control_Pnt::Control_Pnt(): gp_Pnt() -{ - size=0; -} -Control_Pnt::Control_Pnt( const gp_Pnt& aPnt, - double theSize): gp_Pnt( aPnt ) -{ - size=theSize; -} -Control_Pnt::Control_Pnt(double theX, - double theY, - double theZ): gp_Pnt(theX, theY, theZ) -{ - size=0; -} -Control_Pnt::Control_Pnt(double theX, - double theY, - double theZ, - double theSize): gp_Pnt(theX, theY, theZ) -{ - size=theSize; -} - DriverGMF_Write::DriverGMF_Write(): Driver_SMESHDS_Mesh(), _exportRequiredGroups( true ) { @@ -121,6 +100,9 @@ Driver_Mesh::Status DriverGMF_Write::Perform() { Kernel_Utils::Localizer loc; + if ( Driver_Mesh::IsMeshTooLarge< int >( myMesh, /*checkIDs =*/ false)) + return DRS_TOO_LARGE_MESH; + const int dim = 3, version = sizeof(double) < 8 ? 1 : 2; int meshID = GmfOpenMesh( myFile.c_str(), GmfWrite, version, dim ); @@ -136,7 +118,7 @@ Driver_Mesh::Status DriverGMF_Write::Perform() // nodes std::map< const SMDS_MeshNode* , int > node2IdMap; - int iN = 0, nbNodes = myMesh->NbNodes(); + smIdType iN = 0, nbNodes = myMesh->NbNodes(); GmfSetKwd( meshID, GmfVertices, nbNodes ); double xyz[3]; SMDS_NodeIteratorPtr nodeIt = myMesh->nodesIterator(); @@ -225,10 +207,10 @@ Driver_Mesh::Status DriverGMF_Write::Perform() // pyramids BEGIN_ELEM_WRITE( SMDSEntity_Pyramid, GmfPyramids, pyra ) - node2IdMap[ pyra->GetNode( 0 )], + node2IdMap[ pyra->GetNode( 3 )], node2IdMap[ pyra->GetNode( 2 )], node2IdMap[ pyra->GetNode( 1 )], - node2IdMap[ pyra->GetNode( 3 )], + node2IdMap[ pyra->GetNode( 0 )], node2IdMap[ pyra->GetNode( 4 )], END_ELEM_WRITE( pyra ); @@ -365,7 +347,7 @@ Driver_Mesh::Status DriverGMF_Write::Perform() return DRS_OK; } -Driver_Mesh::Status DriverGMF_Write::PerformSizeMap( const std::vector& points ) +Driver_Mesh::Status DriverGMF_Write::PerformSizeMap( const std::vector& points ) { // const int dim = 3, version = sizeof(long) == 4 ? 2 : 3; const int dim = 3, version = 2; // Version 3 not supported by mg-hexa @@ -383,7 +365,7 @@ Driver_Mesh::Status DriverGMF_Write::PerformSizeMap( const std::vector::const_iterator points_it; + std::vector::const_iterator points_it; for (points_it = points.begin(); points_it != points.end(); points_it++ ) { GmfSetLin( verticesFileID, GmfVertices, points_it->X(), points_it->Y(), points_it->Z(), 0 );