-// Copyright (C) 2007-2012 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
#include "Basics_Utils.hxx"
#include "utilities.h"
-#ifdef WNT
+#ifdef WIN32
#include <process.h>
#else
#include <unistd.h>
}
}
+ //=======================================================================
+ //function : AddBiQuadTriasWithID
+ //=======================================================================
+ inline void AddBiQuadTriasWithID(SMDS_Mesh* theMesh,
+ SMESH::log_array_var theSeq,
+ CORBA::Long theId)
+ {
+ const SMESH::long_array& anIndexes = theSeq[theId].indexes;
+ CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
+ if(8*aNbElems != anIndexes.length())
+ EXCEPTION(runtime_error,"AddBiQuadTriasWithID - 8*aNbElems != anIndexes.length()");
+ for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=8){
+ SMDS_MeshElement* anElem = theMesh->AddFaceWithID(anIndexes[anIndexId+1],
+ anIndexes[anIndexId+2],
+ anIndexes[anIndexId+3],
+ anIndexes[anIndexId+4],
+ anIndexes[anIndexId+5],
+ anIndexes[anIndexId+6],
+ anIndexes[anIndexId+7],
+ anIndexes[anIndexId]);
+ if(!anElem)
+ EXCEPTION(runtime_error,"AddBiQuadTriasWithID() - cannot AddFaceWithID for ID = "<<anElemId);
+ }
+ }
+
//=======================================================================
//function : AddQuadTetrasWithID
static SMESH::SMESH_Gen_var aMeshGen;
if(CORBA::is_nil(aMeshGen.in())){
-#ifdef WNT
+#ifdef WIN32
long aClientPID = (long)_getpid();
#else
long aClientPID = (long)getpid();
case SMESH::ADD_QUADEDGE : AddQuadEdgesWithID ( mySMDSMesh, aSeq, anId ); break;
case SMESH::ADD_QUADTRIANGLE : AddQuadTriasWithID ( mySMDSMesh, aSeq, anId ); break;
case SMESH::ADD_QUADQUADRANGLE : AddQuadQuadsWithID ( mySMDSMesh, aSeq, anId ); break;
- case SMESH::ADD_BIQUAD_QUADRANGLE: AddBiQuadQuadsWithID ( mySMDSMesh, aSeq, anId ); break;
case SMESH::ADD_QUADTETRAHEDRON : AddQuadTetrasWithID ( mySMDSMesh, aSeq, anId ); break;
case SMESH::ADD_QUADPYRAMID : AddQuadPiramidsWithID( mySMDSMesh, aSeq, anId ); break;
case SMESH::ADD_QUADPENTAHEDRON : AddQuadPentasWithID ( mySMDSMesh, aSeq, anId ); break;
case SMESH::ADD_QUADHEXAHEDRON : AddQuadHexasWithID ( mySMDSMesh, aSeq, anId ); break;
+
+ case SMESH::ADD_BIQUAD_QUADRANGLE: AddBiQuadQuadsWithID ( mySMDSMesh, aSeq, anId ); break;
+ case SMESH::ADD_BIQUAD_TRIANGLE : AddBiQuadTriasWithID ( mySMDSMesh, aSeq, anId ); break;
case SMESH::ADD_TRIQUAD_HEXA : AddTriQuadHexasWithID( mySMDSMesh, aSeq, anId ); break;
case SMESH::CLEAR_MESH: