Sprout from V1_4_1a 2004-05-03 12:09:00 UTC nri <nri@opencascade.com> 'NRI : Merge from Event_Server. Add missing include QPushButton.'
Delete:
src/SMESH/SMESH_Hexa_3D.cxx
src/SMESH/SMESH_Hexa_3D.hxx
src/SMESH/SMESH_HypothesisCreator.hxx
src/SMESH/SMESH_HypothesisFactory.cxx
src/SMESH/SMESH_HypothesisFactory.hxx
src/SMESH/SMESH_LengthFromEdges.cxx
src/SMESH/SMESH_LengthFromEdges.hxx
src/SMESH/SMESH_LocalLength.cxx
src/SMESH/SMESH_LocalLength.hxx
src/SMESH/SMESH_MEFISTO_2D.cxx
src/SMESH/SMESH_MEFISTO_2D.hxx
src/SMESH/SMESH_MaxElementArea.cxx
src/SMESH/SMESH_MaxElementArea.hxx
src/SMESH/SMESH_MaxElementVolume.cxx
src/SMESH/SMESH_MaxElementVolume.hxx
src/SMESH/SMESH_NETGEN_3D.cxx
src/SMESH/SMESH_NETGEN_3D.hxx
src/SMESH/SMESH_NumberOfSegments.cxx
src/SMESH/SMESH_NumberOfSegments.hxx
src/SMESH/SMESH_Quadrangle_2D.cxx
src/SMESH/SMESH_Quadrangle_2D.hxx
src/SMESH/SMESH_Regular_1D.cxx
src/SMESH/SMESH_Regular_1D.hxx
src/SMESH_I/SMESH_Hexa_3D_i.cxx
src/SMESH_I/SMESH_Hexa_3D_i.hxx
src/SMESH_I/SMESH_HypothesisFactory_i.cxx
src/SMESH_I/SMESH_HypothesisFactory_i.hxx
src/SMESH_I/SMESH_LengthFromEdges_i.cxx
src/SMESH_I/SMESH_LengthFromEdges_i.hxx
src/SMESH_I/SMESH_LocalLength_i.cxx
src/SMESH_I/SMESH_LocalLength_i.hxx
src/SMESH_I/SMESH_MEFISTO_2D_i.cxx
src/SMESH_I/SMESH_MEFISTO_2D_i.hxx
src/SMESH_I/SMESH_MaxElementArea_i.cxx
src/SMESH_I/SMESH_MaxElementArea_i.hxx
src/SMESH_I/SMESH_MaxElementVolume_i.cxx
src/SMESH_I/SMESH_MaxElementVolume_i.hxx
src/SMESH_I/SMESH_NETGEN_3D_i.cxx
src/SMESH_I/SMESH_NETGEN_3D_i.hxx
src/SMESH_I/SMESH_NumberOfSegments_i.cxx
src/SMESH_I/SMESH_NumberOfSegments_i.hxx
src/SMESH_I/SMESH_Quadrangle_2D_i.cxx
src/SMESH_I/SMESH_Quadrangle_2D_i.hxx
src/SMESH_I/SMESH_Regular_1D_i.cxx
src/SMESH_I/SMESH_Regular_1D_i.hxx
+++ /dev/null
-// SMESH SMESH : implementaion of SMESH idl descriptions
-//
-// Copyright (C) 2003 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.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SMESH_Hexa_3D.cxx
-// Author : Paul RASCLE, EDF
-// Module : SMESH
-// $Header$
-
-using namespace std;
-#include "SMESH_Hexa_3D.hxx"
-#include "SMESH_Quadrangle_2D.hxx"
-#include "SMESH_Gen.hxx"
-#include "SMESH_Mesh.hxx"
-
-#include "SMDS_MeshElement.hxx"
-#include "SMDS_MeshNode.hxx"
-#include "SMDS_FacePosition.hxx"
-
-#include <TopExp.hxx>
-#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
-#include <TopTools_ListOfShape.hxx>
-#include <TopTools_ListIteratorOfListOfShape.hxx>
-#include <TColStd_ListIteratorOfListOfInteger.hxx>
-
-#include <BRep_Tool.hxx>
-#include <Geom_Surface.hxx>
-#include <Geom_Curve.hxx>
-#include <Geom2d_Curve.hxx>
-#include <Handle_Geom2d_Curve.hxx>
-#include <Handle_Geom_Curve.hxx>
-
-#include "utilities.h"
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-SMESH_Hexa_3D::SMESH_Hexa_3D(int hypId, int studyId,
- SMESH_Gen * gen):SMESH_3D_Algo(hypId, studyId, gen)
-{
- MESSAGE("SMESH_Hexa_3D::SMESH_Hexa_3D");
- _name = "Hexa_3D";
-// _shapeType = TopAbs_SOLID;
- _shapeType = (1 << TopAbs_SHELL) | (1 << TopAbs_SOLID); // 1 bit /shape type
-// MESSAGE("_shapeType octal " << oct << _shapeType);
- for (int i = 0; i < 6; i++)
- _quads[i] = 0;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-SMESH_Hexa_3D::~SMESH_Hexa_3D()
-{
- MESSAGE("SMESH_Hexa_3D::~SMESH_Hexa_3D");
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-bool SMESH_Hexa_3D::CheckHypothesis(SMESH_Mesh & aMesh,
- const TopoDS_Shape & aShape)
-{
- MESSAGE("SMESH_Hexa_3D::CheckHypothesis");
-
- bool isOk = true;
-
- // nothing to check
-
- return isOk;
-}
-
-//=============================================================================
-/*!
- * Hexahedron mesh on hexaedron like form
- * -0. - shape and face mesh verification
- * -1. - identify faces and vertices of the "cube"
- * -2. - Algorithm from:
- * "Application de l'interpolation transfinie à la création de maillages
- * C0 ou G1 continus sur des triangles, quadrangles, tetraedres, pentaedres
- * et hexaedres déformés."
- * Alain PERONNET - 8 janvier 1999
- */
-//=============================================================================
-
-bool SMESH_Hexa_3D::Compute(SMESH_Mesh & aMesh,
- const TopoDS_Shape & aShape)throw(SALOME_Exception)
-{
- MESSAGE("SMESH_Hexa_3D::Compute");
-
- bool isOk = false;
- SMESHDS_Mesh * meshDS = aMesh.GetMeshDS();
- SMESH_subMesh *theSubMesh = aMesh.GetSubMesh(aShape);
- //const SMESHDS_SubMesh *& subMeshDS = theSubMesh->GetSubMeshDS();
-
- // 0. - shape and face mesh verification
- // 0.1 - shape must be a solid (or a shell) with 6 faces
- MESSAGE("---");
-
- vector < SMESH_subMesh * >meshFaces;
- for (TopExp_Explorer exp(aShape, TopAbs_FACE); exp.More(); exp.Next())
- {
- SMESH_subMesh *aSubMesh = aMesh.GetSubMeshContaining(exp.Current());
- ASSERT(aSubMesh);
- meshFaces.push_back(aSubMesh);
- }
- if (meshFaces.size() != 6)
- {
- SCRUTE(meshFaces.size());
- ASSERT(0);
- return false;
- }
-
- // 0.2 - is each face meshed with Quadrangle_2D? (so, with a wire of 4 edges)
- MESSAGE("---");
-
- for (int i = 0; i < 6; i++)
- {
- TopoDS_Shape aShape = meshFaces[i]->GetSubShape();
- SMESH_Algo *algo = _gen->GetAlgo(aMesh, aShape);
- string algoName = algo->GetName();
- if (algoName != "Quadrangle_2D")
- {
- // *** delete _quads
- SCRUTE(algoName);
- ASSERT(0);
- return false;
- }
- SMESH_Quadrangle_2D *quadAlgo =
- dynamic_cast < SMESH_Quadrangle_2D * >(algo);
- ASSERT(quadAlgo);
- try
- {
- _quads[i] = quadAlgo->CheckAnd2Dcompute(aMesh, aShape);
- // *** to delete after usage
- }
- catch(SALOME_Exception & S_ex)
- {
- // *** delete _quads
- // *** throw exception
- ASSERT(0);
- }
- }
-
- // 1. - identify faces and vertices of the "cube"
- // 1.1 - ancestor maps vertex->edges in the cube
- MESSAGE("---");
-
- TopTools_IndexedDataMapOfShapeListOfShape MS;
- TopExp::MapShapesAndAncestors(aShape, TopAbs_VERTEX, TopAbs_EDGE, MS);
-
- // 1.2 - first face is choosen as face Y=0 of the unit cube
- MESSAGE("---");
-
- const TopoDS_Shape & aFace = meshFaces[0]->GetSubShape();
- const TopoDS_Face & F = TopoDS::Face(aFace);
-
- // 1.3 - identify the 4 vertices of the face Y=0: V000, V100, V101, V001
- MESSAGE("---");
-
- int i = 0;
- TopoDS_Edge E = _quads[0]->edge[i]; //edge will be Y=0,Z=0 on unit cube
- double f, l;
- Handle(Geom2d_Curve) C2d = BRep_Tool::CurveOnSurface(E, F, f, l);
- TopoDS_Vertex VFirst, VLast;
- TopExp::Vertices(E, VFirst, VLast); // corresponds to f and l
- bool isForward =
- (((l - f) * (_quads[0]->last[i] - _quads[0]->first[i])) > 0);
-
- if (isForward)
- {
- _cube.V000 = VFirst; // will be (0,0,0) on the unit cube
- _cube.V100 = VLast; // will be (1,0,0) on the unit cube
- }
- else
- {
- _cube.V000 = VLast;
- _cube.V100 = VFirst;
- }
-
- i = 1;
- E = _quads[0]->edge[i];
- C2d = BRep_Tool::CurveOnSurface(E, F, f, l);
- TopExp::Vertices(E, VFirst, VLast);
- isForward = (((l - f) * (_quads[0]->last[i] - _quads[0]->first[i])) > 0);
- if (isForward)
- _cube.V101 = VLast; // will be (1,0,1) on the unit cube
- else
- _cube.V101 = VFirst;
-
- i = 2;
- E = _quads[0]->edge[i];
- C2d = BRep_Tool::CurveOnSurface(E, F, f, l);
- TopExp::Vertices(E, VFirst, VLast);
- isForward = (((l - f) * (_quads[0]->last[i] - _quads[0]->first[i])) > 0);
- if (isForward)
- _cube.V001 = VLast; // will be (0,0,1) on the unit cube
- else
- _cube.V001 = VFirst;
-
- // 1.4 - find edge X=0, Z=0 (ancestor of V000 not in face Y=0)
- // - find edge X=1, Z=0 (ancestor of V100 not in face Y=0)
- // - find edge X=1, Z=1 (ancestor of V101 not in face Y=0)
- // - find edge X=0, Z=1 (ancestor of V001 not in face Y=0)
- MESSAGE("---");
-
- TopoDS_Edge E_0Y0 = EdgeNotInFace(aMesh, aShape, F, _cube.V000, MS);
- ASSERT(!E_0Y0.IsNull());
-
- TopoDS_Edge E_1Y0 = EdgeNotInFace(aMesh, aShape, F, _cube.V100, MS);
- ASSERT(!E_1Y0.IsNull());
-
- TopoDS_Edge E_1Y1 = EdgeNotInFace(aMesh, aShape, F, _cube.V101, MS);
- ASSERT(!E_1Y1.IsNull());
-
- TopoDS_Edge E_0Y1 = EdgeNotInFace(aMesh, aShape, F, _cube.V001, MS);
- ASSERT(!E_0Y1.IsNull());
-
- // 1.5 - identify the 4 vertices in face Y=1: V010, V110, V111, V011
- MESSAGE("---");
-
- TopExp::Vertices(E_0Y0, VFirst, VLast);
- if (VFirst.IsSame(_cube.V000))
- _cube.V010 = VLast;
- else
- _cube.V010 = VFirst;
-
- TopExp::Vertices(E_1Y0, VFirst, VLast);
- if (VFirst.IsSame(_cube.V100))
- _cube.V110 = VLast;
- else
- _cube.V110 = VFirst;
-
- TopExp::Vertices(E_1Y1, VFirst, VLast);
- if (VFirst.IsSame(_cube.V101))
- _cube.V111 = VLast;
- else
- _cube.V111 = VFirst;
-
- TopExp::Vertices(E_0Y1, VFirst, VLast);
- if (VFirst.IsSame(_cube.V001))
- _cube.V011 = VLast;
- else
- _cube.V011 = VFirst;
-
- // 1.6 - find remaining faces given 4 vertices
- MESSAGE("---");
-
- _indY0 = 0;
- _cube.quad_Y0 = _quads[_indY0];
-
- _indY1 = GetFaceIndex(aMesh, aShape, meshFaces,
- _cube.V010, _cube.V011, _cube.V110, _cube.V111);
- _cube.quad_Y1 = _quads[_indY1];
-
- _indZ0 = GetFaceIndex(aMesh, aShape, meshFaces,
- _cube.V000, _cube.V010, _cube.V100, _cube.V110);
- _cube.quad_Z0 = _quads[_indZ0];
-
- _indZ1 = GetFaceIndex(aMesh, aShape, meshFaces,
- _cube.V001, _cube.V011, _cube.V101, _cube.V111);
- _cube.quad_Z1 = _quads[_indZ1];
-
- _indX0 = GetFaceIndex(aMesh, aShape, meshFaces,
- _cube.V000, _cube.V001, _cube.V010, _cube.V011);
- _cube.quad_X0 = _quads[_indX0];
-
- _indX1 = GetFaceIndex(aMesh, aShape, meshFaces,
- _cube.V100, _cube.V101, _cube.V110, _cube.V111);
- _cube.quad_X1 = _quads[_indX1];
-
- MESSAGE("---");
-
- // 1.7 - get convertion coefs from face 2D normalized to 3D normalized
-
- Conv2DStruct cx0; // for face X=0
- Conv2DStruct cx1; // for face X=1
- Conv2DStruct cy0;
- Conv2DStruct cy1;
- Conv2DStruct cz0;
- Conv2DStruct cz1;
-
- GetConv2DCoefs(*_cube.quad_X0, meshFaces[_indX0]->GetSubShape(),
- _cube.V000, _cube.V010, _cube.V011, _cube.V001, cx0);
- GetConv2DCoefs(*_cube.quad_X1, meshFaces[_indX1]->GetSubShape(),
- _cube.V100, _cube.V110, _cube.V111, _cube.V101, cx1);
- GetConv2DCoefs(*_cube.quad_Y0, meshFaces[_indY0]->GetSubShape(),
- _cube.V000, _cube.V100, _cube.V101, _cube.V001, cy0);
- GetConv2DCoefs(*_cube.quad_Y1, meshFaces[_indY1]->GetSubShape(),
- _cube.V010, _cube.V110, _cube.V111, _cube.V011, cy1);
- GetConv2DCoefs(*_cube.quad_Z0, meshFaces[_indZ0]->GetSubShape(),
- _cube.V000, _cube.V100, _cube.V110, _cube.V010, cz0);
- GetConv2DCoefs(*_cube.quad_Z1, meshFaces[_indZ1]->GetSubShape(),
- _cube.V001, _cube.V101, _cube.V111, _cube.V011, cz1);
-
- // 1.8 - create a 3D structure for normalized values
-
- MESSAGE("---");
- int nbx = _cube.quad_Y0->nbPts[0];
- int nby = _cube.quad_Y0->nbPts[1];
- int nbz;
- if (cx0.a1 != 0)
- nbz = _cube.quad_X0->nbPts[1];
- else
- nbz = _cube.quad_X0->nbPts[0];
- //SCRUTE(nbx);
- //SCRUTE(nby);
- //SCRUTE(nbz);
- int nbxyz = nbx * nby * nbz;
- Point3DStruct *np = new Point3DStruct[nbxyz];
-
- // 1.9 - store node indexes of faces
-
- {
- const TopoDS_Face & F = TopoDS::Face(meshFaces[_indX0]->GetSubShape());
-
- faceQuadStruct *quad = _cube.quad_X0;
- int i = 0; // j = x/face , k = y/face
- int nbdown = quad->nbPts[0];
- int nbright = quad->nbPts[1];
-
-
- SMDS_Iterator<const SMDS_MeshNode *> * itf=
- aMesh.GetSubMesh(F)->GetSubMeshDS()->GetNodes();
-
- while(itf->more())
- {
- const SMDS_MeshNode * node = itf->next();
- const SMDS_FacePosition* fpos
- = static_cast<const SMDS_FacePosition*>(node->GetPosition());
- double ri = fpos->GetUParameter();
- double rj = fpos->GetVParameter();
- int i1 = int (ri);
- int j1 = int (rj);
- int ij1 = j1 * nbdown + i1;
- quad->uv_grid[ij1].node = node;
- }
- delete itf;
-
- for (int i1 = 0; i1 < nbdown; i1++)
- for (int j1 = 0; j1 < nbright; j1++)
- {
- int ij1 = j1 * nbdown + i1;
- int j = cx0.ia * i1 + cx0.ib * j1 + cx0.ic; // j = x/face
- int k = cx0.ja * i1 + cx0.jb * j1 + cx0.jc; // k = y/face
- int ijk = k * nbx * nby + j * nbx + i;
- //MESSAGE(" "<<ij1<<" "<<i<<" "<<j<<" "<<ijk);
- np[ijk].node = quad->uv_grid[ij1].node;
- //SCRUTE(np[ijk].nodeId);
- }
- }
-
- {
- const TopoDS_Face & F = TopoDS::Face(meshFaces[_indX1]->GetSubShape());
-
- SMDS_Iterator<const SMDS_MeshNode *> * itf=
- aMesh.GetSubMesh(F)->GetSubMeshDS()->GetNodes();
-
- faceQuadStruct *quad = _cube.quad_X1;
- int i = nbx - 1; // j = x/face , k = y/face
- int nbdown = quad->nbPts[0];
- int nbright = quad->nbPts[1];
-
- while(itf->more())
- {
- const SMDS_MeshNode * node = itf->next();
- const SMDS_FacePosition* fpos
- = static_cast<const SMDS_FacePosition*>(node->GetPosition());
- double ri = fpos->GetUParameter();
- double rj = fpos->GetVParameter();
- int i1 = int (ri);
- int j1 = int (rj);
- int ij1 = j1 * nbdown + i1;
- quad->uv_grid[ij1].node = node;
- }
- delete itf;
-
- for (int i1 = 0; i1 < nbdown; i1++)
- for (int j1 = 0; j1 < nbright; j1++)
- {
- int ij1 = j1 * nbdown + i1;
- int j = cx1.ia * i1 + cx1.ib * j1 + cx1.ic; // j = x/face
- int k = cx1.ja * i1 + cx1.jb * j1 + cx1.jc; // k = y/face
- int ijk = k * nbx * nby + j * nbx + i;
- //MESSAGE(" "<<ij1<<" "<<i<<" "<<j<<" "<<ijk);
- np[ijk].node = quad->uv_grid[ij1].node;
- //SCRUTE(np[ijk].nodeId);
- }
- }
-
- {
- const TopoDS_Face & F = TopoDS::Face(meshFaces[_indY0]->GetSubShape());
-
- SMDS_Iterator<const SMDS_MeshNode *> * itf=
- aMesh.GetSubMesh(F)->GetSubMeshDS()->GetNodes();
-
- faceQuadStruct *quad = _cube.quad_Y0;
- int j = 0; // i = x/face , k = y/face
- int nbdown = quad->nbPts[0];
- int nbright = quad->nbPts[1];
-
- while(itf->more())
- {
- const SMDS_MeshNode * node = itf->next();
- const SMDS_FacePosition * fpos
- = static_cast<const SMDS_FacePosition*>(node->GetPosition());
- double ri = fpos->GetUParameter();
- double rj = fpos->GetVParameter();
- int i1 = int (ri);
- int j1 = int (rj);
- int ij1 = j1 * nbdown + i1;
- quad->uv_grid[ij1].node = node;
- }
- delete itf;
-
- for (int i1 = 0; i1 < nbdown; i1++)
- for (int j1 = 0; j1 < nbright; j1++)
- {
- int ij1 = j1 * nbdown + i1;
- int i = cy0.ia * i1 + cy0.ib * j1 + cy0.ic; // i = x/face
- int k = cy0.ja * i1 + cy0.jb * j1 + cy0.jc; // k = y/face
- int ijk = k * nbx * nby + j * nbx + i;
- //MESSAGE(" "<<ij1<<" "<<i<<" "<<j<<" "<<ijk);
- np[ijk].node = quad->uv_grid[ij1].node;
- //SCRUTE(np[ijk].nodeId);
- }
- }
-
- {
- const TopoDS_Face & F = TopoDS::Face(meshFaces[_indY1]->GetSubShape());
-
- SMDS_Iterator<const SMDS_MeshNode *> * itf=
- aMesh.GetSubMesh(F)->GetSubMeshDS()->GetNodes();
-
- faceQuadStruct *quad = _cube.quad_Y1;
- int j = nby - 1; // i = x/face , k = y/face
- int nbdown = quad->nbPts[0];
- int nbright = quad->nbPts[1];
-
- while(itf->more())
- {
- const SMDS_MeshNode * node = itf->next();
- const SMDS_FacePosition* fpos =
- static_cast<const SMDS_FacePosition *>(node->GetPosition());
- double ri = fpos->GetUParameter();
- double rj = fpos->GetVParameter();
- int i1 = int (ri);
- int j1 = int (rj);
- int ij1 = j1 * nbdown + i1;
- quad->uv_grid[ij1].node = node;
- }
-
- for (int i1 = 0; i1 < nbdown; i1++)
- for (int j1 = 0; j1 < nbright; j1++)
- {
- int ij1 = j1 * nbdown + i1;
- int i = cy1.ia * i1 + cy1.ib * j1 + cy1.ic; // i = x/face
- int k = cy1.ja * i1 + cy1.jb * j1 + cy1.jc; // k = y/face
- int ijk = k * nbx * nby + j * nbx + i;
- //MESSAGE(" "<<ij1<<" "<<i<<" "<<j<<" "<<ijk);
- np[ijk].node = quad->uv_grid[ij1].node;
- //SCRUTE(np[ijk].nodeId);
- }
- }
-
- {
- const TopoDS_Face & F = TopoDS::Face(meshFaces[_indZ0]->GetSubShape());
-
- SMDS_Iterator<const SMDS_MeshNode *> * itf=
- aMesh.GetSubMesh(F)->GetSubMeshDS()->GetNodes();
-
- faceQuadStruct *quad = _cube.quad_Z0;
- int k = 0; // i = x/face , j = y/face
- int nbdown = quad->nbPts[0];
- int nbright = quad->nbPts[1];
-
- while(itf->more())
- {
- const SMDS_MeshNode * node = itf->next();
- const SMDS_FacePosition * fpos
- = static_cast<const SMDS_FacePosition*>(node->GetPosition());
- double ri = fpos->GetUParameter();
- double rj = fpos->GetVParameter();
- int i1 = int (ri);
- int j1 = int (rj);
- int ij1 = j1 * nbdown + i1;
- quad->uv_grid[ij1].node = node;
- }
-
- for (int i1 = 0; i1 < nbdown; i1++)
- for (int j1 = 0; j1 < nbright; j1++)
- {
- int ij1 = j1 * nbdown + i1;
- int i = cz0.ia * i1 + cz0.ib * j1 + cz0.ic; // i = x/face
- int j = cz0.ja * i1 + cz0.jb * j1 + cz0.jc; // j = y/face
- int ijk = k * nbx * nby + j * nbx + i;
- //MESSAGE(" "<<ij1<<" "<<i<<" "<<j<<" "<<ijk);
- np[ijk].node = quad->uv_grid[ij1].node;
- //SCRUTE(np[ijk].nodeId);
- }
- }
-
- {
- const TopoDS_Face & F = TopoDS::Face(meshFaces[_indZ1]->GetSubShape());
-
- SMDS_Iterator<const SMDS_MeshNode *> * itf=
- aMesh.GetSubMesh(F)->GetSubMeshDS()->GetNodes();
-
- faceQuadStruct *quad = _cube.quad_Z1;
- int k = nbz - 1; // i = x/face , j = y/face
- int nbdown = quad->nbPts[0];
- int nbright = quad->nbPts[1];
-
- while(itf->more())
- {
- const SMDS_MeshNode * node = itf->next();
- const SMDS_FacePosition* fpos
- = static_cast<const SMDS_FacePosition*>(node->GetPosition());
- double ri = fpos->GetUParameter();
- double rj = fpos->GetVParameter();
- int i1 = int (ri);
- int j1 = int (rj);
- int ij1 = j1 * nbdown + i1;
- quad->uv_grid[ij1].node = node;
- }
-
- for (int i1 = 0; i1 < nbdown; i1++)
- for (int j1 = 0; j1 < nbright; j1++)
- {
- int ij1 = j1 * nbdown + i1;
- int i = cz1.ia * i1 + cz1.ib * j1 + cz1.ic; // i = x/face
- int j = cz1.ja * i1 + cz1.jb * j1 + cz1.jc; // j = y/face
- int ijk = k * nbx * nby + j * nbx + i;
- //MESSAGE(" "<<ij1<<" "<<i<<" "<<j<<" "<<ijk);
- np[ijk].node = quad->uv_grid[ij1].node;
- //SCRUTE(np[ijk].nodeId);
- }
- }
-
- // 2.0 - for each node of the cube:
- // - get the 8 points 3D = 8 vertices of the cube
- // - get the 12 points 3D on the 12 edges of the cube
- // - get the 6 points 3D on the 6 faces with their ID
- // - compute the point 3D
- // - store the point 3D in SMESHDS, store its ID in 3D structure
-
- TopoDS_Shell aShell;
- TopExp_Explorer exp(aShape, TopAbs_SHELL);
- if (exp.More())
- {
- aShell = TopoDS::Shell(exp.Current());
- }
- else
- {
- MESSAGE("no shell...");
- ASSERT(0);
- }
-
- Pt3 p000, p001, p010, p011, p100, p101, p110, p111;
- Pt3 px00, px01, px10, px11;
- Pt3 p0y0, p0y1, p1y0, p1y1;
- Pt3 p00z, p01z, p10z, p11z;
- Pt3 pxy0, pxy1, px0z, px1z, p0yz, p1yz;
-
- GetPoint(p000, 0, 0, 0, nbx, nby, nbz, np, meshDS);
- GetPoint(p001, 0, 0, nbz - 1, nbx, nby, nbz, np, meshDS);
- GetPoint(p010, 0, nby - 1, 0, nbx, nby, nbz, np, meshDS);
- GetPoint(p011, 0, nby - 1, nbz - 1, nbx, nby, nbz, np, meshDS);
- GetPoint(p100, nbx - 1, 0, 0, nbx, nby, nbz, np, meshDS);
- GetPoint(p101, nbx - 1, 0, nbz - 1, nbx, nby, nbz, np, meshDS);
- GetPoint(p110, nbx - 1, nby - 1, 0, nbx, nby, nbz, np, meshDS);
- GetPoint(p111, nbx - 1, nby - 1, nbz - 1, nbx, nby, nbz, np, meshDS);
-
- for (int i = 1; i < nbx - 1; i++)
- {
- for (int j = 1; j < nby - 1; j++)
- {
- for (int k = 1; k < nbz - 1; k++)
- {
- // *** seulement maillage regulier
- // 12 points on edges
- GetPoint(px00, i, 0, 0, nbx, nby, nbz, np, meshDS);
- GetPoint(px01, i, 0, nbz - 1, nbx, nby, nbz, np, meshDS);
- GetPoint(px10, i, nby - 1, 0, nbx, nby, nbz, np, meshDS);
- GetPoint(px11, i, nby - 1, nbz - 1, nbx, nby, nbz, np, meshDS);
-
- GetPoint(p0y0, 0, j, 0, nbx, nby, nbz, np, meshDS);
- GetPoint(p0y1, 0, j, nbz - 1, nbx, nby, nbz, np, meshDS);
- GetPoint(p1y0, nbx - 1, j, 0, nbx, nby, nbz, np, meshDS);
- GetPoint(p1y1, nbx - 1, j, nbz - 1, nbx, nby, nbz, np, meshDS);
-
- GetPoint(p00z, 0, 0, k, nbx, nby, nbz, np, meshDS);
- GetPoint(p01z, 0, nby - 1, k, nbx, nby, nbz, np, meshDS);
- GetPoint(p10z, nbx - 1, 0, k, nbx, nby, nbz, np, meshDS);
- GetPoint(p11z, nbx - 1, nby - 1, k, nbx, nby, nbz, np, meshDS);
-
- // 12 points on faces
- GetPoint(pxy0, i, j, 0, nbx, nby, nbz, np, meshDS);
- GetPoint(pxy1, i, j, nbz - 1, nbx, nby, nbz, np, meshDS);
- GetPoint(px0z, i, 0, k, nbx, nby, nbz, np, meshDS);
- GetPoint(px1z, i, nby - 1, k, nbx, nby, nbz, np, meshDS);
- GetPoint(p0yz, 0, j, k, nbx, nby, nbz, np, meshDS);
- GetPoint(p1yz, nbx - 1, j, k, nbx, nby, nbz, np, meshDS);
-
- int ijk = k * nbx * nby + j * nbx + i;
- double x = double (i) / double (nbx - 1); // *** seulement
- double y = double (j) / double (nby - 1); // *** maillage
- double z = double (k) / double (nbz - 1); // *** regulier
-
- Pt3 X;
- for (int i = 0; i < 3; i++)
- {
- X[i] =
- (1 - x) * p0yz[i] + x * p1yz[i]
- + (1 - y) * px0z[i] + y * px1z[i]
- + (1 - z) * pxy0[i] + z * pxy1[i]
- - (1 - x) * ((1 - y) * p00z[i] + y * p01z[i])
- - x * ((1 - y) * p10z[i] + y * p11z[i])
- - (1 - y) * ((1 - z) * px00[i] + z * px01[i])
- - y * ((1 - z) * px10[i] + z * px11[i])
- - (1 - z) * ((1 - x) * p0y0[i] + x * p1y0[i])
- - z * ((1 - x) * p0y1[i] + x * p1y1[i])
- + (1 - x) * ((1 - y) * ((1 - z) * p000[i] + z * p001[i])
- + y * ((1 - z) * p010[i] + z * p011[i]))
- + x * ((1 - y) * ((1 - z) * p100[i] + z * p101[i])
- + y * ((1 - z) * p110[i] + z * p111[i]));
- }
-
- SMDS_MeshNode * node = meshDS->AddNode(X[0], X[1], X[2]);
- np[ijk].node = node;
- //meshDS->SetNodeInVolume(node, TopoDS::Solid(aShape));
- meshDS->SetNodeInVolume(node, aShell);
- }
- }
- }
-
- //2.1 - for each node of the cube (less 3 *1 Faces):
- // - store hexahedron in SMESHDS
- MESSAGE("Storing hexahedron into the DS");
- for (int i = 0; i < nbx - 1; i++)
- for (int j = 0; j < nby - 1; j++)
- for (int k = 0; k < nbz - 1; k++)
- {
- int n1 = k * nbx * nby + j * nbx + i;
- int n2 = k * nbx * nby + j * nbx + i + 1;
- int n3 = k * nbx * nby + (j + 1) * nbx + i + 1;
- int n4 = k * nbx * nby + (j + 1) * nbx + i;
- int n5 = (k + 1) * nbx * nby + j * nbx + i;
- int n6 = (k + 1) * nbx * nby + j * nbx + i + 1;
- int n7 = (k + 1) * nbx * nby + (j + 1) * nbx + i + 1;
- int n8 = (k + 1) * nbx * nby + (j + 1) * nbx + i;
-
-// MESSAGE(" "<<n1<<" "<<n2<<" "<<n3<<" "<<n4<<" "<<n5<<" "<<n6<<" "<<n7<<" "<<n8);
- //MESSAGE(" "<<np[n1].nodeId<<" "<<np[n2].nodeId<<" "<<np[n3].nodeId<<" "<<np[n4].nodeId<<" "<<np[n5].nodeId<<" "<<np[n6].nodeId<<" "<<np[n7].nodeId<<" "<<np[n8].nodeId);
-
- SMDS_MeshVolume * elt = meshDS->AddVolume(np[n1].node,
- np[n2].node,
- np[n3].node,
- np[n4].node,
- np[n5].node,
- np[n6].node,
- np[n7].node,
- np[n8].node);
- ;
- meshDS->SetMeshElementOnShape(elt, aShell);
-
- // *** 5 tetrahedres ... verifier orientations,
- // mettre en coherence &vec quadrangles-> triangles
- // choisir afficher 1 parmi edges, face et volumes
-// int tetra1 = meshDS->AddVolume(np[n1].nodeId,
-// np[n2].nodeId,
-// np[n4].nodeId,
-// np[n5].nodeId);
-// int tetra2 = meshDS->AddVolume(np[n2].nodeId,
-// np[n3].nodeId,
-// np[n4].nodeId,
-// np[n7].nodeId);
-// int tetra3 = meshDS->AddVolume(np[n5].nodeId,
-// np[n6].nodeId,
-// np[n7].nodeId,
-// np[n2].nodeId);
-// int tetra4 = meshDS->AddVolume(np[n5].nodeId,
-// np[n7].nodeId,
-// np[n8].nodeId,
-// np[n4].nodeId);
-// int tetra5 = meshDS->AddVolume(np[n5].nodeId,
-// np[n7].nodeId,
-// np[n2].nodeId,
-// np[n4].nodeId);
-
- }
-
- MESSAGE("End of SMESH_Hexa_3D::Compute()");
- return true;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-void SMESH_Hexa_3D::GetPoint(Pt3 p, int i, int j, int k, int nbx, int nby,
- int nbz, Point3DStruct * np, const SMESHDS_Mesh * meshDS)
-{
- int ijk = k * nbx * nby + j * nbx + i;
- const SMDS_MeshNode * node = np[ijk].node;
- p[0] = node->X();
- p[1] = node->Y();
- p[2] = node->Z();
- //MESSAGE(" "<<i<<" "<<j<<" "<<k<<" "<<p[0]<<" "<<p[1]<<" "<<p[2]);
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-int SMESH_Hexa_3D::GetFaceIndex(SMESH_Mesh & aMesh,
- const TopoDS_Shape & aShape,
- const vector < SMESH_subMesh * >&meshFaces,
- const TopoDS_Vertex & V0,
- const TopoDS_Vertex & V1,
- const TopoDS_Vertex & V2, const TopoDS_Vertex & V3)
-{
- MESSAGE("SMESH_Hexa_3D::GetFaceIndex");
- int faceIndex = -1;
- for (int i = 1; i < 6; i++)
- {
- const TopoDS_Shape & aFace = meshFaces[i]->GetSubShape();
- //const TopoDS_Face& F = TopoDS::Face(aFace);
- TopTools_IndexedMapOfShape M;
- TopExp::MapShapes(aFace, TopAbs_VERTEX, M);
- bool verticesInShape = false;
- if (M.Contains(V0))
- if (M.Contains(V1))
- if (M.Contains(V2))
- if (M.Contains(V3))
- verticesInShape = true;
- if (verticesInShape)
- {
- faceIndex = i;
- break;
- }
- }
- ASSERT(faceIndex > 0);
- SCRUTE(faceIndex);
- return faceIndex;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-TopoDS_Edge
- SMESH_Hexa_3D::EdgeNotInFace(SMESH_Mesh & aMesh,
- const TopoDS_Shape & aShape,
- const TopoDS_Face & aFace,
- const TopoDS_Vertex & aVertex,
- const TopTools_IndexedDataMapOfShapeListOfShape & MS)
-{
- MESSAGE("SMESH_Hexa_3D::EdgeNotInFace");
- TopTools_IndexedDataMapOfShapeListOfShape MF;
- TopExp::MapShapesAndAncestors(aFace, TopAbs_VERTEX, TopAbs_EDGE, MF);
- const TopTools_ListOfShape & ancestorsInSolid = MS.FindFromKey(aVertex);
- const TopTools_ListOfShape & ancestorsInFace = MF.FindFromKey(aVertex);
- SCRUTE(ancestorsInSolid.Extent());
- SCRUTE(ancestorsInFace.Extent());
- ASSERT(ancestorsInSolid.Extent() == 6); // 6 (edges doublees)
- ASSERT(ancestorsInFace.Extent() == 2);
-
- TopoDS_Edge E;
- E.Nullify();
- TopTools_ListIteratorOfListOfShape its(ancestorsInSolid);
- for (; its.More(); its.Next())
- {
- TopoDS_Shape ancestor = its.Value();
- TopTools_ListIteratorOfListOfShape itf(ancestorsInFace);
- bool isInFace = false;
- for (; itf.More(); itf.Next())
- {
- TopoDS_Shape ancestorInFace = itf.Value();
- if (ancestorInFace.IsSame(ancestor))
- {
- isInFace = true;
- break;
- }
- }
- if (!isInFace)
- {
- E = TopoDS::Edge(ancestor);
- break;
- }
- }
- return E;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-void SMESH_Hexa_3D::GetConv2DCoefs(const faceQuadStruct & quad,
- const TopoDS_Shape & aShape,
- const TopoDS_Vertex & V0,
- const TopoDS_Vertex & V1,
- const TopoDS_Vertex & V2, const TopoDS_Vertex & V3, Conv2DStruct & conv)
-{
- MESSAGE("SMESH_Hexa_3D::GetConv2DCoefs");
- const TopoDS_Face & F = TopoDS::Face(aShape);
- TopoDS_Edge E = quad.edge[0];
- double f, l;
- Handle(Geom2d_Curve) C2d = BRep_Tool::CurveOnSurface(E, F, f, l);
- TopoDS_Vertex VFirst, VLast;
- TopExp::Vertices(E, VFirst, VLast); // corresponds to f and l
- bool isForward = (((l - f) * (quad.last[0] - quad.first[0])) > 0);
- TopoDS_Vertex VA, VB;
- if (isForward)
- {
- VA = VFirst;
- VB = VLast;
- }
- else
- {
- VA = VLast;
- VB = VFirst;
- }
- int a1, b1, c1, a2, b2, c2;
- if (VA.IsSame(V0))
- if (VB.IsSame(V1))
- {
- a1 = 1;
- b1 = 0;
- c1 = 0; // x
- a2 = 0;
- b2 = 1;
- c2 = 0; // y
- }
- else
- {
- ASSERT(VB.IsSame(V3));
- a1 = 0;
- b1 = 1;
- c1 = 0; // y
- a2 = 1;
- b2 = 0;
- c2 = 0; // x
- }
- if (VA.IsSame(V1))
- if (VB.IsSame(V2))
- {
- a1 = 0;
- b1 = -1;
- c1 = 1; // 1-y
- a2 = 1;
- b2 = 0;
- c2 = 0; // x
- }
- else
- {
- ASSERT(VB.IsSame(V0));
- a1 = -1;
- b1 = 0;
- c1 = 1; // 1-x
- a2 = 0;
- b2 = 1;
- c2 = 0; // y
- }
- if (VA.IsSame(V2))
- if (VB.IsSame(V3))
- {
- a1 = -1;
- b1 = 0;
- c1 = 1; // 1-x
- a2 = 0;
- b2 = -1;
- c2 = 1; // 1-y
- }
- else
- {
- ASSERT(VB.IsSame(V1));
- a1 = 0;
- b1 = -1;
- c1 = 1; // 1-y
- a2 = -1;
- b2 = 0;
- c2 = 1; // 1-x
- }
- if (VA.IsSame(V3))
- if (VB.IsSame(V0))
- {
- a1 = 0;
- b1 = 1;
- c1 = 0; // y
- a2 = -1;
- b2 = 0;
- c2 = 1; // 1-x
- }
- else
- {
- ASSERT(VB.IsSame(V2));
- a1 = 1;
- b1 = 0;
- c1 = 0; // x
- a2 = 0;
- b2 = -1;
- c2 = 1; // 1-y
- }
- MESSAGE("X = " << c1 << "+ " << a1 << "*x + " << b1 << "*y");
- MESSAGE("Y = " << c2 << "+ " << a2 << "*x + " << b2 << "*y");
- conv.a1 = a1;
- conv.b1 = b1;
- conv.c1 = c1;
- conv.a2 = a2;
- conv.b2 = b2;
- conv.c2 = c2;
-
- int nbdown = quad.nbPts[0];
- int nbright = quad.nbPts[1];
- conv.ia = int (a1);
- conv.ib = int (b1);
- conv.ic =
- int (c1 * a1 * a1) * (nbdown - 1) + int (c1 * b1 * b1) * (nbright - 1);
- conv.ja = int (a2);
- conv.jb = int (b2);
- conv.jc =
- int (c2 * a2 * a2) * (nbdown - 1) + int (c2 * b2 * b2) * (nbright - 1);
- MESSAGE("I " << conv.ia << " " << conv.ib << " " << conv.ic);
- MESSAGE("J " << conv.ja << " " << conv.jb << " " << conv.jc);
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-ostream & SMESH_Hexa_3D::SaveTo(ostream & save)
-{
- return save << this;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-istream & SMESH_Hexa_3D::LoadFrom(istream & load)
-{
- return load >> (*this);
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-ostream & operator <<(ostream & save, SMESH_Hexa_3D & hyp)
-{
- return save;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-istream & operator >>(istream & load, SMESH_Hexa_3D & hyp)
-{
- return load;
-}
+++ /dev/null
-// SMESH SMESH : implementaion of SMESH idl descriptions
-//
-// Copyright (C) 2003 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.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SMESH_Hexa_3D.hxx
-// Author : Paul RASCLE, EDF
-// Module : SMESH
-// $Header$
-
-#ifndef _SMESH_HEXA_3D_HXX_
-#define _SMESH_HEXA_3D_HXX_
-
-#include "SMESH_3D_Algo.hxx"
-#include "SMESH_Mesh.hxx"
-#include "SMESH_Quadrangle_2D.hxx"
-#include "Utils_SALOME_Exception.hxx"
-
-typedef struct point3Dstruct
-{
- const SMDS_MeshNode * node;
-} Point3DStruct;
-
-typedef double Pt3[3];
-
-typedef struct conv2dstruct
-{
- double a1; // X = a1*x + b1*y + c1
- double b1; // Y = a2*x + b2*y + c2
- double c1; // a1, b1 a2, b2 in {-1,0,1}
- double a2; // c1, c2 in {0,1}
- double b2;
- double c2;
- int ia; // I = ia*i + ib*j + ic
- int ib;
- int ic;
- int ja; // J = ja*i + jb*j + jc
- int jb;
- int jc;
-} Conv2DStruct;
-
-typedef struct cubeStruct
-{
- TopoDS_Vertex V000;
- TopoDS_Vertex V001;
- TopoDS_Vertex V010;
- TopoDS_Vertex V011;
- TopoDS_Vertex V100;
- TopoDS_Vertex V101;
- TopoDS_Vertex V110;
- TopoDS_Vertex V111;
- faceQuadStruct* quad_X0;
- faceQuadStruct* quad_X1;
- faceQuadStruct* quad_Y0;
- faceQuadStruct* quad_Y1;
- faceQuadStruct* quad_Z0;
- faceQuadStruct* quad_Z1;
- Point3DStruct* np; // normalised 3D coordinates
-} CubeStruct;
-
-class SMESH_Hexa_3D:
- public SMESH_3D_Algo
-{
-public:
- SMESH_Hexa_3D(int hypId, int studyId, SMESH_Gen* gen);
- virtual ~SMESH_Hexa_3D();
-
- virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape);
-
- virtual bool Compute(SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape)
- throw (SALOME_Exception);
-
- ostream & SaveTo(ostream & save);
- istream & LoadFrom(istream & load);
- friend ostream & operator << (ostream & save, SMESH_Hexa_3D & hyp);
- friend istream & operator >> (istream & load, SMESH_Hexa_3D & hyp);
-
-protected:
- TopoDS_Edge
- EdgeNotInFace(SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape,
- const TopoDS_Face& aFace,
- const TopoDS_Vertex& aVertex,
- const TopTools_IndexedDataMapOfShapeListOfShape& MS);
-
- int GetFaceIndex(SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape,
- const vector<SMESH_subMesh*>& meshFaces,
- const TopoDS_Vertex& V0,
- const TopoDS_Vertex& V1,
- const TopoDS_Vertex& V2,
- const TopoDS_Vertex& V3);
-
- void GetConv2DCoefs(const faceQuadStruct& quad,
- const TopoDS_Shape& aShape,
- const TopoDS_Vertex& V0,
- const TopoDS_Vertex& V1,
- const TopoDS_Vertex& V2,
- const TopoDS_Vertex& V3,
- Conv2DStruct& conv);
-
- void GetPoint(Pt3 p,
- int i, int j, int k,
- int nbx, int nby, int nbz,
- Point3DStruct *np,
- const SMESHDS_Mesh* meshDS);
-
- CubeStruct _cube;
- FaceQuadStruct* _quads[6];
- int _indX0;
- int _indX1;
- int _indY0;
- int _indY1;
- int _indZ0;
- int _indZ1;
-};
-
-#endif
+++ /dev/null
-// SMESH SMESH : implementaion of SMESH idl descriptions
-//
-// Copyright (C) 2003 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.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SMESH_HypothesisCreator.hxx
-// Author : Paul RASCLE, EDF
-// Module : SMESH
-// $Header$
-
-#ifndef _SMESH_HYPOTHESISCREATOR_HXX_
-#define _SMESH_HYPOTHESISCREATOR_HXX_
-
-#include "SMESH_HypothesisFactory.hxx"
-
-class SMESH_gen;
-
-//=============================================================================
-/*!
- * Specific Hypothesis Creators are generated with a template which inherits a
- * generic hypothesis creator. Each creator returns an hypothesis of the type
- * given in the template.
- */
-//=============================================================================
-
-template <class T> class SMESH_HypothesisCreator
- : public GenericHypothesisCreator
-{
-public:
-// map<int, T*> _instances;
-
-// virtual T* GetInstance(int hypId)
-// {
-// if (_instances.find(hypId) != _instances.end())
-// return _instances[hypId];
-// else
-// return NULL;
-// }
-
- virtual T* Create (int hypId, int studyId, SMESH_Gen* gen)
- {
- T* anInstance= new T(hypId, studyId, gen);
-// _gen->StoreHypothesisInstance(anInstance);
-// _instances[hypId] = anInstance;
- return anInstance;
- };
-};
-
-
-#endif
+++ /dev/null
-// SMESH SMESH : implementaion of SMESH idl descriptions
-//
-// Copyright (C) 2003 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.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SMESH_HypothesisFactory.cxx
-// Author : Paul RASCLE, EDF
-// Module : SMESH
-// $Header$
-
-using namespace std;
-using namespace std;
-#include "SMESH_HypothesisFactory.hxx"
-#include "SMESH_Hypothesis.hxx"
-#include "SMESH_HypothesisCreator.hxx"
-#include "SMESH_Gen.hxx"
-
-#include "utilities.h"
-
-// Add new hypothesis here (include file)
-//---------------------------------------
-#include "SMESH_LocalLength.hxx"
-#include "SMESH_LengthFromEdges.hxx"
-#include "SMESH_NumberOfSegments.hxx"
-#include "SMESH_MaxElementArea.hxx"
-#include "SMESH_MaxElementVolume.hxx"
-#include "SMESH_Regular_1D.hxx"
-#include "SMESH_MEFISTO_2D.hxx"
-#include "SMESH_Quadrangle_2D.hxx"
-#include "SMESH_Hexa_3D.hxx"
-#ifdef HAVE_NETGEN
-#include "SMESH_NETGEN_3D.hxx"
-#endif
-//---------------------------------------
-
-//=============================================================================
-/*!
- * Specific Hypothesis Creators are generated with a template which inherits a
- * generic hypothesis creator. Each creator returns an hypothesis of the type
- * given in the template.
- */
-//=============================================================================
-
-// template <class T> class HypothesisCreator: public GenericHypothesisCreator
-// {
-// public:
-// virtual T* Create (int hypId)
-// {
-// // return new T(hypId);
-// };
-
-// };
-
-//=============================================================================
-/*!
- * Constructor: instanciate specific hypothesis creators, fill a private map
- * indexed by hypothesis names. THIS METHOD MUST BE COMPLETED WHEN A NEW
- * HYPOTHESIS IS ADDED.
- * Specific hypothesis creator are defined with the above template.
- * Hypothesis names are related to the corresponding class names:
- * prefix = SMESH_ ; suffix = .
- */
-//=============================================================================
-
-SMESH_HypothesisFactory::SMESH_HypothesisFactory()
-{
- _hypId = 0;
-
-// Add new hypothesis here (creators)
-//---------------------------------------
-_creatorMap["LocalLength"] = new SMESH_HypothesisCreator<SMESH_LocalLength>;
-_creatorMap["NumberOfSegments"] = new SMESH_HypothesisCreator<SMESH_NumberOfSegments>;
-_creatorMap["LengthFromEdges"] = new SMESH_HypothesisCreator<SMESH_LengthFromEdges>;
-_creatorMap["MaxElementArea"] = new SMESH_HypothesisCreator<SMESH_MaxElementArea>;
-_creatorMap["MaxElementVolume"] = new SMESH_HypothesisCreator<SMESH_MaxElementVolume>;
-_creatorMap["Regular_1D"] = new SMESH_HypothesisCreator<SMESH_Regular_1D>;
-_creatorMap["MEFISTO_2D"] = new SMESH_HypothesisCreator<SMESH_MEFISTO_2D>;
-_creatorMap["Quadrangle_2D"] = new SMESH_HypothesisCreator<SMESH_Quadrangle_2D>;
-_creatorMap["Hexa_3D"] = new SMESH_HypothesisCreator<SMESH_Hexa_3D>;
-#ifdef HAVE_NETGEN
-_creatorMap["NETGEN_3D"] = new SMESH_HypothesisCreator<SMESH_NETGEN_3D>;
-#endif
-//---------------------------------------
-}
-
-//=============================================================================
-/*!
- * Destructor: deletes specific hypothesis creators instanciated in the
- * constructor.
- */
-//=============================================================================
-
-SMESH_HypothesisFactory::~SMESH_HypothesisFactory()
-{
- map<string, GenericHypothesisCreator*>::iterator it;
- for (it = _creatorMap.begin(); it != _creatorMap.end(); it++)
- {
- delete (*it).second;
- }
- _creatorMap.clear();
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-SMESH_Hypothesis* SMESH_HypothesisFactory::Create(const char* anHypName,
- int studyId)
- throw (SALOME_Exception)
-{
- MESSAGE("SMESH_HypothesisFactory::Create " << anHypName);
- if (_creatorMap.find(anHypName) == _creatorMap.end())
- throw(SALOME_Exception(LOCALIZED("bad hypothesis type name")));
- SMESH_Hypothesis* myHyp = _creatorMap[anHypName]->Create(_hypId++,
- studyId,
- _gen);
- return myHyp;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-GenericHypothesisCreator*
-SMESH_HypothesisFactory::GetCreator(const char* anHypName)
- throw (SALOME_Exception)
-{
- MESSAGE("SMESH_HypothesisFactory::GetCreator " << anHypName);
- if (_creatorMap.find(anHypName) == _creatorMap.end())
- throw(SALOME_Exception(LOCALIZED("bad hypothesis type name")));
- return _creatorMap[anHypName];
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-int SMESH_HypothesisFactory::GetANewId()
-{
- //MESSAGE("SMESH_HypothesisFactory::GetANewId");
- return _hypId++;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-void SMESH_HypothesisFactory::SetGen(SMESH_Gen* gen)
-{
- //MESSAGE("SMESH_HypothesisFactory::SetGen");
- _gen = gen;
-}
-
+++ /dev/null
-// SMESH SMESH : implementaion of SMESH idl descriptions
-//
-// Copyright (C) 2003 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.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SMESH_HypothesisFactory.hxx
-// Author : Paul RASCLE, EDF
-// Module : SMESH
-// $Header$
-
-#ifndef _SMESH_HYPOTHESISFACTORY_HXX_
-#define _SMESH_HYPOTHESISFACTORY_HXX_
-
-#include "SMESH_Hypothesis.hxx"
-
-#include "Utils_SALOME_Exception.hxx"
-
-#include <map>
-
-class SMESH_Gen;
-
-class GenericHypothesisCreator
-{
-public:
-// virtual SMESH_Hypothesis* GetInstance(int hypId) = 0;
- virtual SMESH_Hypothesis* Create(int hypId, int studyId, SMESH_Gen* gen) = 0;
-};
-
-class SMESH_HypothesisFactory
-{
-public:
- SMESH_HypothesisFactory();
- virtual ~SMESH_HypothesisFactory();
-
- void SetGen(SMESH_Gen* gen);
-
- SMESH_Hypothesis* Create(const char* anHypName, int studyId)
- throw (SALOME_Exception);
-
- GenericHypothesisCreator* GetCreator(const char* anHypName)
- throw (SALOME_Exception);
-
- int GetANewId();
-
-private:
- map<string, GenericHypothesisCreator*> _creatorMap;
- int _hypId;
- SMESH_Gen* _gen;
-};
-
-#endif
+++ /dev/null
-// SMESH SMESH : implementaion of SMESH idl descriptions
-//
-// Copyright (C) 2003 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.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SMESH_LengthFromEdges.cxx
-// Author : Paul RASCLE, EDF
-// Module : SMESH
-// $Header$
-
-using namespace std;
-using namespace std;
-#include "SMESH_LengthFromEdges.hxx"
-#include "utilities.h"
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-SMESH_LengthFromEdges::SMESH_LengthFromEdges(int hypId, int studyId, SMESH_Gen* gen)
- : SMESH_Hypothesis(hypId, studyId, gen)
-{
- _mode =1;
- _name = "LengthFromEdges";
-// SCRUTE(_name);
-// SCRUTE(&_name);
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-SMESH_LengthFromEdges::~SMESH_LengthFromEdges()
-{
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-void SMESH_LengthFromEdges::SetMode(int mode)
- throw (SALOME_Exception)
-{
- int oldMode = _mode;
- if (mode <= 0)
- throw SALOME_Exception(LOCALIZED("mode must be positive"));
- _mode = mode;
- if (oldMode != _mode)
- NotifySubMeshesHypothesisModification();
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-int SMESH_LengthFromEdges::GetMode()
-{
- return _mode;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-ostream & SMESH_LengthFromEdges::SaveTo(ostream & save)
-{
- return save << this;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-istream & SMESH_LengthFromEdges::LoadFrom(istream & load)
-{
- return load >> (*this);
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-ostream & operator << (ostream & save, SMESH_LengthFromEdges & hyp)
-{
- save << hyp._mode;
- return save;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-istream & operator >> (istream & load, SMESH_LengthFromEdges & hyp)
-{
- bool isOK = true;
- int a;
- isOK = (load >> a);
- if (isOK) hyp._mode = a;
- else load.clear(ios::badbit | load.rdstate());
- return load;
-}
-
+++ /dev/null
-// SMESH SMESH : implementaion of SMESH idl descriptions
-//
-// Copyright (C) 2003 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.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SMESH_LengthFromEdges.hxx
-// Author : Paul RASCLE, EDF
-// Module : SMESH
-// $Header$
-
-#ifndef _SMESH_LENGTHFROMEDGES_HXX_
-#define _SMESH_LENGTHFROMEDGES_HXX_
-
-#include "SMESH_Hypothesis.hxx"
-#include "Utils_SALOME_Exception.hxx"
-
-class SMESH_LengthFromEdges:
- public SMESH_Hypothesis
-{
-public:
- SMESH_LengthFromEdges(int hypId, int studyId, SMESH_Gen* gen);
- virtual ~SMESH_LengthFromEdges();
-
- void SetMode(int mode)
- throw (SALOME_Exception);
-
- int GetMode();
-
- virtual ostream & SaveTo(ostream & save);
- virtual istream & LoadFrom(istream & load);
- friend ostream & operator << (ostream & save, SMESH_LengthFromEdges & hyp);
- friend istream & operator >> (istream & load, SMESH_LengthFromEdges & hyp);
-
-protected:
- int _mode;
-};
-
-#endif
+++ /dev/null
-// SMESH SMESH : implementaion of SMESH idl descriptions
-//
-// Copyright (C) 2003 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.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SMESH_LocalLength.cxx
-// Author : Paul RASCLE, EDF
-// Module : SMESH
-// $Header$
-
-using namespace std;
-using namespace std;
-#include "SMESH_LocalLength.hxx"
-#include "utilities.h"
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-SMESH_LocalLength::SMESH_LocalLength(int hypId, int studyId,
- SMESH_Gen * gen):SMESH_Hypothesis(hypId, studyId, gen)
-{
- _length = 1.;
- _name = "LocalLength";
-// SCRUTE(_name);
-// SCRUTE(&_name);
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-SMESH_LocalLength::~SMESH_LocalLength()
-{
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-void SMESH_LocalLength::SetLength(double length) throw(SALOME_Exception)
-{
- double oldLength = _length;
- if (length <= 0)
- throw SALOME_Exception(LOCALIZED("length must be positive"));
- _length = length;
- if (oldLength != _length)
- NotifySubMeshesHypothesisModification();
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-double SMESH_LocalLength::GetLength() const
-{
- return _length;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-ostream & SMESH_LocalLength::SaveTo(ostream & save)
-{
- return save << this;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-istream & SMESH_LocalLength::LoadFrom(istream & load)
-{
- return load >> (*this);
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-ostream & operator <<(ostream & save, SMESH_LocalLength & hyp)
-{
- save << hyp._length;
- return save;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-istream & operator >>(istream & load, SMESH_LocalLength & hyp)
-{
- bool isOK = true;
- double a;
- isOK = (load >> a);
- if (isOK)
- hyp._length = a;
- else
- load.clear(ios::badbit | load.rdstate());
- return load;
-}
+++ /dev/null
-// SMESH SMESH : implementaion of SMESH idl descriptions
-//
-// Copyright (C) 2003 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.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SMESH_LocalLength.hxx
-// Author : Paul RASCLE, EDF
-// Module : SMESH
-// $Header$
-
-#ifndef _SMESH_LOCALLENGTH_HXX_
-#define _SMESH_LOCALLENGTH_HXX_
-
-#include "SMESH_Hypothesis.hxx"
-#include "Utils_SALOME_Exception.hxx"
-
-class SMESH_LocalLength:public SMESH_Hypothesis
-{
- public:
- SMESH_LocalLength(int hypId, int studyId, SMESH_Gen * gen);
- virtual ~ SMESH_LocalLength();
-
- void SetLength(double length) throw(SALOME_Exception);
-
- double GetLength() const;
-
- virtual ostream & SaveTo(ostream & save);
- virtual istream & LoadFrom(istream & load);
- friend ostream & operator <<(ostream & save, SMESH_LocalLength & hyp);
- friend istream & operator >>(istream & load, SMESH_LocalLength & hyp);
-
- protected:
- double _length;
-};
-
-#endif
+++ /dev/null
-// SMESH SMESH : implementaion of SMESH idl descriptions
-//
-// Copyright (C) 2003 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.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SMESH_MEFISTO_2D.cxx
-// Author : Paul RASCLE, EDF
-// Module : SMESH
-// $Header$
-
-using namespace std;
-#include "SMESH_MEFISTO_2D.hxx"
-#include "SMESH_Gen.hxx"
-#include "SMESH_Mesh.hxx"
-
-#include "SMESH_MaxElementArea.hxx"
-#include "SMESH_LengthFromEdges.hxx"
-
-#include "Rn.h"
-#include "aptrte.h"
-
-#include "SMDS_MeshElement.hxx"
-#include "SMDS_MeshNode.hxx"
-#include "SMDS_EdgePosition.hxx"
-#include "SMDS_FacePosition.hxx"
-
-#include "utilities.h"
-
-#include <TopoDS_Face.hxx>
-#include <TopoDS_Edge.hxx>
-#include <TopoDS_Shape.hxx>
-#include <Geom_Surface.hxx>
-#include <GeomAdaptor_Curve.hxx>
-#include <Geom2d_Curve.hxx>
-#include <gp_Pnt2d.hxx>
-#include <BRep_Tool.hxx>
-#include <BRepTools.hxx>
-#include <BRepTools_WireExplorer.hxx>
-#include <GCPnts_AbscissaPoint.hxx>
-#include <GCPnts_UniformAbscissa.hxx>
-#include <TColStd_ListIteratorOfListOfInteger.hxx>
-
-#include <string>
-#include <algorithm>
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-SMESH_MEFISTO_2D::SMESH_MEFISTO_2D(int hypId, int studyId,
- SMESH_Gen * gen):SMESH_2D_Algo(hypId, studyId, gen)
-{
- MESSAGE("SMESH_MEFISTO_2D::SMESH_MEFISTO_2D");
- _name = "MEFISTO_2D";
-// _shapeType = TopAbs_FACE;
- _shapeType = (1 << TopAbs_FACE);
- _compatibleHypothesis.push_back("MaxElementArea");
- _compatibleHypothesis.push_back("LengthFromEdges");
-
- _edgeLength = 0;
- _maxElementArea = 0;
- _hypMaxElementArea = NULL;
- _hypLengthFromEdges = NULL;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-SMESH_MEFISTO_2D::~SMESH_MEFISTO_2D()
-{
- MESSAGE("SMESH_MEFISTO_2D::~SMESH_MEFISTO_2D");
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-bool SMESH_MEFISTO_2D::CheckHypothesis(SMESH_Mesh & aMesh,
- const TopoDS_Shape & aShape)
-{
- //MESSAGE("SMESH_MEFISTO_2D::CheckHypothesis");
-
- _hypMaxElementArea = NULL;
- _hypLengthFromEdges = NULL;
-
- list <const SMESHDS_Hypothesis * >::const_iterator itl;
- const SMESHDS_Hypothesis *theHyp;
-
- const list <const SMESHDS_Hypothesis * >&hyps = GetUsedHypothesis(aMesh, aShape);
- int nbHyp = hyps.size();
- if (nbHyp != 1) return false;// only one compatible hypothesis allowed
-
- itl = hyps.begin();
- theHyp = (*itl);
-
- string hypName = theHyp->GetName();
- int hypId = theHyp->GetID();
- //SCRUTE(hypName);
-
- bool isOk = false;
-
- if (hypName == "MaxElementArea")
- {
- _hypMaxElementArea = static_cast<const SMESH_MaxElementArea *>(theHyp);
- ASSERT(_hypMaxElementArea);
- _maxElementArea = _hypMaxElementArea->GetMaxArea();
- _edgeLength = 0;
- isOk = true;
- }
-
- if (hypName == "LengthFromEdges")
- {
- _hypLengthFromEdges = static_cast<const SMESH_LengthFromEdges *>(theHyp);
- ASSERT(_hypLengthFromEdges);
- _edgeLength = 0;
- _maxElementArea = 0;
- isOk = true;
- }
-
- if (isOk)
- {
- isOk = false;
- if (_maxElementArea > 0)
- {
- _edgeLength = 2 * sqrt(_maxElementArea); // triangles : minorant
- isOk = true;
- }
- else
- isOk = (_hypLengthFromEdges != NULL); // **** check mode
- }
-
- //SCRUTE(_edgeLength);
- //SCRUTE(_maxElementArea);
- return isOk;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-bool SMESH_MEFISTO_2D::Compute(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape)
-{
- MESSAGE("SMESH_MEFISTO_2D::Compute");
-
- if (_hypLengthFromEdges)
- _edgeLength = ComputeEdgeElementLength(aMesh, aShape);
-
- bool isOk = false;
- const SMESHDS_Mesh * meshDS = aMesh.GetMeshDS();
- SMESH_subMesh *theSubMesh = aMesh.GetSubMesh(aShape);
-
- const TopoDS_Face & FF = TopoDS::Face(aShape);
- bool faceIsForward = (FF.Orientation() == TopAbs_FORWARD);
- TopoDS_Face F = TopoDS::Face(FF.Oriented(TopAbs_FORWARD));
-
- Z nblf; //nombre de lignes fermees (enveloppe en tete)
- Z *nudslf = NULL; //numero du dernier sommet de chaque ligne fermee
- R2 *uvslf = NULL;
- Z nbpti = 0; //nombre points internes futurs sommets de la triangulation
- R2 *uvpti = NULL;
-
- Z nbst;
- R2 *uvst = NULL;
- Z nbt;
- Z *nust = NULL;
- Z ierr = 0;
-
- Z nutysu = 1; // 1: il existe un fonction areteideale_()
- // Z nutysu=0; // 0: on utilise aretmx
- R aretmx = _edgeLength; // longueur max aretes future triangulation
- //SCRUTE(aretmx);
-
- nblf = NumberOfWires(F);
- //SCRUTE(nblf);
-
- nudslf = new Z[1 + nblf];
- nudslf[0] = 0;
- int iw = 1;
- int nbpnt = 0;
-
- const TopoDS_Wire OW1 = BRepTools::OuterWire(F);
- nbpnt += NumberOfPoints(aMesh, OW1);
- nudslf[iw++] = nbpnt;
- //SCRUTE(nbpnt);
-
- for (TopExp_Explorer exp(F, TopAbs_WIRE); exp.More(); exp.Next())
- {
- const TopoDS_Wire & W = TopoDS::Wire(exp.Current());
- if (!OW1.IsSame(W))
- {
- nbpnt += NumberOfPoints(aMesh, W);
- nudslf[iw++] = nbpnt;
- //SCRUTE(nbpnt);
- }
- }
-
- uvslf = new R2[nudslf[nblf]];
- //SCRUTE(nudslf[nblf]);
- int m = 0;
-
- map<int, const SMDS_MeshNode*> mefistoToDS; // correspondence mefisto index--> points IDNodes
- TopoDS_Wire OW = BRepTools::OuterWire(F);
- LoadPoints(aMesh, F, OW, uvslf, m, mefistoToDS);
- //SCRUTE(m);
-
- for (TopExp_Explorer exp(F, TopAbs_WIRE); exp.More(); exp.Next())
- {
- const TopoDS_Wire & W = TopoDS::Wire(exp.Current());
- if (!OW.IsSame(W))
- {
- LoadPoints(aMesh, F, W, uvslf, m, mefistoToDS);
- //SCRUTE(m);
- }
- }
-// SCRUTE(nudslf[nblf]);
-// for (int i=0; i<=nblf; i++)
-// {
-// MESSAGE(" -+- " <<i<< " "<< nudslf[i]);
-// }
-// for (int i=0; i<nudslf[nblf]; i++)
-// {
-// MESSAGE(" -+- " <<i<< " "<< uvslf[i]);
-// }
-// SCRUTE(nutysu);
-// SCRUTE(aretmx);
-// SCRUTE(nblf);
-
- MESSAGE("MEFISTO triangulation ...");
- uvst = NULL;
- nust = NULL;
- aptrte(nutysu, aretmx,
- nblf, nudslf, uvslf, nbpti, uvpti, nbst, uvst, nbt, nust, ierr);
-
- if (ierr == 0)
- {
- MESSAGE("... End Triangulation Generated Triangle Number " << nbt);
- MESSAGE(" Node Number " << nbst);
- //SCRUTE(nbst);
- //SCRUTE(nbt);
- StoreResult(aMesh, nbst, uvst, nbt, nust, F,
- faceIsForward, mefistoToDS);
- isOk = true;
- }
- else
- {
- MESSAGE("Error in Triangulation");
- isOk = false;
- }
- if (nudslf != NULL)
- delete[]nudslf;
- if (uvslf != NULL)
- delete[]uvslf;
- if (uvst != NULL)
- delete[]uvst;
- if (nust != NULL)
- delete[]nust;
- return isOk;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-void SMESH_MEFISTO_2D::LoadPoints(SMESH_Mesh & aMesh,
- const TopoDS_Face & FF,
- const TopoDS_Wire & WW, R2 * uvslf, int &m,
- map<int, const SMDS_MeshNode*>&mefistoToDS)
-{
- MESSAGE("SMESH_MEFISTO_2D::LoadPoints");
-
- SMDS_Mesh * meshDS = aMesh.GetMeshDS();
-
- double scalex;
- double scaley;
- TopoDS_Face F = TopoDS::Face(FF.Oriented(TopAbs_FORWARD));
- ComputeScaleOnFace(aMesh, F, scalex, scaley);
-
- TopoDS_Wire W = TopoDS::Wire(WW.Oriented(TopAbs_FORWARD));
- BRepTools_WireExplorer wexp(W, F);
- for (wexp.Init(W, F); wexp.More(); wexp.Next())
- {
- const TopoDS_Edge & E = wexp.Current();
-
- // --- IDNodes of first and last Vertex
-
- TopoDS_Vertex VFirst, VLast;
- TopExp::Vertices(E, VFirst, VLast); // corresponds to f and l
-
- ASSERT(!VFirst.IsNull());
- SMDS_Iterator<const SMDS_MeshNode *> * lid=
- aMesh.GetSubMesh(VFirst)->GetSubMeshDS()->GetNodes();
- const SMDS_MeshNode* idFirst = lid->next();
- delete lid;
-
- ASSERT(!VLast.IsNull());
- lid=aMesh.GetSubMesh(VLast)->GetSubMeshDS()->GetNodes();
- const SMDS_MeshNode* idLast = lid->next();
- delete lid;
-
- // --- edge internal IDNodes (relies on good order storage, not checked)
-
- int nbPoints = aMesh.GetSubMesh(E)->GetSubMeshDS()->NbNodes();
- //SCRUTE(nbPoints);
-
- double f, l;
- Handle(Geom2d_Curve) C2d = BRep_Tool::CurveOnSurface(E, F, f, l);
-
- SMDS_Iterator<const SMDS_MeshNode *> * ite=
- aMesh.GetSubMesh(E)->GetSubMeshDS()->GetNodes();
-
- bool isForward = (E.Orientation() == TopAbs_FORWARD);
- map<double, const SMDS_MeshNode*> params;
-
- while(ite->more())
- {
- const SMDS_MeshNode * node = ite->next();
- const SMDS_EdgePosition* epos
- = static_cast<const SMDS_EdgePosition*>(node->GetPosition());
- double param = epos->GetUParameter();
- params[param] = node;
- }
- delete ite;
- // --- load 2D values into MEFISTO structure,
- // add IDNodes in mefistoToDS map
-
- if (E.Orientation() == TopAbs_FORWARD)
- {
- gp_Pnt2d p = C2d->Value(f); // first point = Vertex Forward
- uvslf[m].x = scalex * p.X();
- uvslf[m].y = scaley * p.Y();
- mefistoToDS[m + 1] = idFirst;
- //MESSAGE(" "<<m<<" "<<mefistoToDS[m+1]);
- //MESSAGE("__ f "<<f<<" "<<uvslf[m].x <<" "<<uvslf[m].y);
- m++;
- map<double, const SMDS_MeshNode*>::iterator itp = params.begin();
- for (int i = 1; i <= nbPoints; i++) // nbPoints internal
- {
- double param = (*itp).first;
- gp_Pnt2d p = C2d->Value(param);
- uvslf[m].x = scalex * p.X();
- uvslf[m].y = scaley * p.Y();
- mefistoToDS[m + 1] = (*itp).second;
-// MESSAGE(" "<<m<<" "<<mefistoToDS[m+1]);
-// MESSAGE("__ "<<i<<" "<<param<<" "<<uvslf[m].x <<" "<<uvslf[m].y);
- m++;
- itp++;
- }
- }
- else
- {
- gp_Pnt2d p = C2d->Value(l); // last point = Vertex Reversed
- uvslf[m].x = scalex * p.X();
- uvslf[m].y = scaley * p.Y();
- mefistoToDS[m + 1] = idLast;
-// MESSAGE(" "<<m<<" "<<mefistoToDS[m+1]);
-// MESSAGE("__ l "<<l<<" "<<uvslf[m].x <<" "<<uvslf[m].y);
- m++;
- map<double, const SMDS_MeshNode*>::reverse_iterator itp = params.rbegin();
- for (int i = nbPoints; i >= 1; i--)
- {
- double param = (*itp).first;
- gp_Pnt2d p = C2d->Value(param);
- uvslf[m].x = scalex * p.X();
- uvslf[m].y = scaley * p.Y();
- mefistoToDS[m + 1] = (*itp).second;
-// MESSAGE(" "<<m<<" "<<mefistoToDS[m+1]);
-// MESSAGE("__ "<<i<<" "<<param<<" "<<uvslf[m].x <<" "<<uvslf[m].y);
- m++;
- itp++;
- }
- }
- }
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-// **** a mettre dans SMESH_Algo ou SMESH_2D_Algo
-
-void SMESH_MEFISTO_2D::ComputeScaleOnFace(SMESH_Mesh & aMesh,
- const TopoDS_Face & aFace, double &scalex, double &scaley)
-{
- //MESSAGE("SMESH_MEFISTO_2D::ComputeScaleOnFace");
- TopoDS_Face F = TopoDS::Face(aFace.Oriented(TopAbs_FORWARD));
- TopoDS_Wire W = BRepTools::OuterWire(F);
-
- BRepTools_WireExplorer wexp(W, F);
-
- double xmin = 1.e300; // min & max of face 2D parametric coord.
- double xmax = -1.e300;
- double ymin = 1.e300;
- double ymax = -1.e300;
- int nbp = 50;
- scalex = 1;
- scaley = 1;
- for (wexp.Init(W, F); wexp.More(); wexp.Next())
- {
- const TopoDS_Edge & E = wexp.Current();
- double f, l;
- Handle(Geom2d_Curve) C2d = BRep_Tool::CurveOnSurface(E, F, f, l);
- for (int i = 0; i <= nbp; i++)
- {
- double param = f + (double (i) / double (nbp))*(l - f);
- gp_Pnt2d p = C2d->Value(param);
- if (p.X() < xmin)
- xmin = p.X();
- if (p.X() > xmax)
- xmax = p.X();
- if (p.Y() < ymin)
- ymin = p.Y();
- if (p.Y() > ymax)
- ymax = p.Y();
-// MESSAGE(" "<< f<<" "<<l<<" "<<param<<" "<<xmin<<" "<<xmax<<" "<<ymin<<" "<<ymax);
- }
- }
-// SCRUTE(xmin);
-// SCRUTE(xmax);
-// SCRUTE(ymin);
-// SCRUTE(ymax);
- double xmoy = (xmax + xmin) / 2.;
- double ymoy = (ymax + ymin) / 2.;
-
- Handle(Geom_Surface) S = BRep_Tool::Surface(F); // 3D surface
-
- double length_x = 0;
- double length_y = 0;
- gp_Pnt PX0 = S->Value(xmin, ymoy);
- gp_Pnt PY0 = S->Value(xmoy, ymin);
- for (int i = 1; i <= nbp; i++)
- {
- double x = xmin + (double (i) / double (nbp))*(xmax - xmin);
- gp_Pnt PX = S->Value(x, ymoy);
- double y = ymin + (double (i) / double (nbp))*(ymax - ymin);
- gp_Pnt PY = S->Value(xmoy, y);
- length_x += PX.Distance(PX0);
- length_y += PY.Distance(PY0);
- PX0.SetCoord(PX.X(), PX.Y(), PX.Z());
- PY0.SetCoord(PY.X(), PY.Y(), PY.Z());
- }
-// SCRUTE(length_x);
-// SCRUTE(length_y);
- scalex = length_x / (xmax - xmin);
- scaley = length_y / (ymax - ymin);
-// SCRUTE(scalex);
-// SCRUTE(scaley);
- ASSERT(scalex);
- ASSERT(scaley);
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-void SMESH_MEFISTO_2D::StoreResult(SMESH_Mesh & aMesh,
- Z nbst, R2 * uvst, Z nbt, Z * nust,
- const TopoDS_Face & F, bool faceIsForward,
- map<int, const SMDS_MeshNode*>&mefistoToDS)
-{
- double scalex;
- double scaley;
- ComputeScaleOnFace(aMesh, F, scalex, scaley);
-
- SMESHDS_Mesh * meshDS = aMesh.GetMeshDS();
-
- Z n, m;
- Handle(Geom_Surface) S = BRep_Tool::Surface(F);
-
- for (n = 0; n < nbst; n++)
- {
- double u = uvst[n][0] / scalex;
- double v = uvst[n][1] / scaley;
- gp_Pnt P = S->Value(u, v);
-
- if (mefistoToDS.find(n + 1) == mefistoToDS.end())
- {
- SMDS_MeshNode * node = meshDS->AddNode(P.X(), P.Y(), P.Z());
- meshDS->SetNodeOnFace(node, F);
-
- //MESSAGE(nodeId<<" "<<P.X()<<" "<<P.Y()<<" "<<P.Z());
- mefistoToDS[n + 1] = node;
- //MESSAGE(" "<<n<<" "<<mefistoToDS[n+1]);
- SMDS_FacePosition* fpos
- = static_cast<SMDS_FacePosition*>(node->GetPosition());
- fpos->SetUParameter(u);
- fpos->SetVParameter(v);
- }
- }
-
- m = 0;
- int mt = 0;
-
- //SCRUTE(faceIsForward);
- for (n = 1; n <= nbt; n++)
- {
- int inode1 = nust[m++];
- int inode2 = nust[m++];
- int inode3 = nust[m++];
-
- const SMDS_MeshNode *n1, *n2, *n3;
- n1 = mefistoToDS[inode1];
- n2 = mefistoToDS[inode2];
- n3 = mefistoToDS[inode3];
- //MESSAGE("-- "<<inode1<<" "<<inode2<<" "<<inode3<<" ++ "<<nodeId1<<" "<<nodeId2<<" "<<nodeId3);
-
- // triangle points must be in trigonometric order if face is Forward
- // else they must be put clockwise
-
- bool triangleIsWellOriented = faceIsForward;
-
- SMDS_MeshElement * elt;
- if (triangleIsWellOriented)
- elt = meshDS->AddFace(n1, n2, n3);
- else
- elt = meshDS->AddFace(n1, n3, n2);
-
- meshDS->SetMeshElementOnShape(elt, F);
- m++;
- }
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-double SMESH_MEFISTO_2D::ComputeEdgeElementLength(SMESH_Mesh & aMesh,
- const TopoDS_Shape & aShape)
-{
- MESSAGE("SMESH_MEFISTO_2D::ComputeEdgeElementLength");
- // **** a mettre dans SMESH_2D_Algo ?
-
- const TopoDS_Face & FF = TopoDS::Face(aShape);
- bool faceIsForward = (FF.Orientation() == TopAbs_FORWARD);
- TopoDS_Face F = TopoDS::Face(FF.Oriented(TopAbs_FORWARD));
-
- double meanElementLength = 100;
- double wireLength = 0;
- int wireElementsNumber = 0;
- for (TopExp_Explorer exp(F, TopAbs_WIRE); exp.More(); exp.Next())
- {
- const TopoDS_Wire & W = TopoDS::Wire(exp.Current());
- for (TopExp_Explorer expe(W, TopAbs_EDGE); expe.More(); expe.Next())
- {
- const TopoDS_Edge & E = TopoDS::Edge(expe.Current());
- int nb = aMesh.GetSubMesh(E)->GetSubMeshDS()->NbNodes();
- double length = EdgeLength(E);
- wireLength += length;
- wireElementsNumber += nb;
- }
- }
- if (wireElementsNumber)
- meanElementLength = wireLength / wireElementsNumber;
- //SCRUTE(meanElementLength);
- return meanElementLength;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-ostream & SMESH_MEFISTO_2D::SaveTo(ostream & save)
-{
- return save << this;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-istream & SMESH_MEFISTO_2D::LoadFrom(istream & load)
-{
- return load >> (*this);
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-ostream & operator <<(ostream & save, SMESH_MEFISTO_2D & hyp)
-{
- return save;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-istream & operator >>(istream & load, SMESH_MEFISTO_2D & hyp)
-{
- return load;
-}
+++ /dev/null
-// SMESH SMESH : implementaion of SMESH idl descriptions
-//
-// Copyright (C) 2003 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.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SMESH_MEFISTO_2D.hxx
-// Author : Paul RASCLE, EDF
-// Module : SMESH
-// $Header$
-
-#ifndef _SMESH_MEFISTO_2D_HXX_
-#define _SMESH_MEFISTO_2D_HXX_
-
-#include "SMESH_2D_Algo.hxx"
-#include "SMESH_MaxElementArea.hxx"
-#include "SMESH_LengthFromEdges.hxx"
-#include "Rn.h"
-
-class SMDS_MeshNode;
-#include <TopoDS_Face.hxx>
-#include <map>
-
-class SMESH_MEFISTO_2D:
- public SMESH_2D_Algo
-{
-public:
- SMESH_MEFISTO_2D(int hypId, int studyId, SMESH_Gen* gen);
- virtual ~SMESH_MEFISTO_2D();
-
- virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape);
-
- virtual bool Compute(SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape);
-
- double ComputeEdgeElementLength(SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape);
-
- void LoadPoints(SMESH_Mesh& aMesh,
- const TopoDS_Face& F,
- const TopoDS_Wire& W,
- R2* uvslf,
- int& m,
- map<int,const SMDS_MeshNode*>& mefistoToDS);
-
- void ComputeScaleOnFace(SMESH_Mesh& aMesh,
- const TopoDS_Face& aFace,
- double& scalex,
- double& scaley);
-
- void StoreResult (SMESH_Mesh& aMesh,
- Z nbst, R2* uvst, Z nbt, Z* nust,
- const TopoDS_Face& F, bool faceIsForward,
- map<int,const SMDS_MeshNode*>& mefistoToDS);
-
- ostream & SaveTo(ostream & save);
- istream & LoadFrom(istream & load);
- friend ostream & operator << (ostream & save, SMESH_MEFISTO_2D & hyp);
- friend istream & operator >> (istream & load, SMESH_MEFISTO_2D & hyp);
-
-protected:
- double _edgeLength;
- double _maxElementArea;
- const SMESH_MaxElementArea* _hypMaxElementArea;
- const SMESH_LengthFromEdges* _hypLengthFromEdges;
-};
-
-#endif
+++ /dev/null
-// SMESH SMESH : implementaion of SMESH idl descriptions
-//
-// Copyright (C) 2003 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.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SMESH_MaxElementArea.cxx
-// Author : Paul RASCLE, EDF
-// Module : SMESH
-// $Header$
-
-using namespace std;
-using namespace std;
-#include "SMESH_MaxElementArea.hxx"
-#include "utilities.h"
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-SMESH_MaxElementArea::SMESH_MaxElementArea(int hypId, int studyId, SMESH_Gen* gen)
- : SMESH_Hypothesis(hypId, studyId, gen)
-{
- _maxArea =1.;
- _name = "MaxElementArea";
-// SCRUTE(_name);
-// SCRUTE(&_name);
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-SMESH_MaxElementArea::~SMESH_MaxElementArea()
-{
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-void SMESH_MaxElementArea::SetMaxArea(double maxArea)
- throw (SALOME_Exception)
-{
- double oldArea = _maxArea;
- if (maxArea <= 0)
- throw SALOME_Exception(LOCALIZED("maxArea must be positive"));
- _maxArea = maxArea;
- if (_maxArea != oldArea)
- NotifySubMeshesHypothesisModification();
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-double SMESH_MaxElementArea::GetMaxArea() const
-{
- return _maxArea;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-ostream & SMESH_MaxElementArea::SaveTo(ostream & save)
-{
- return save << this;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-istream & SMESH_MaxElementArea::LoadFrom(istream & load)
-{
- return load >> (*this);
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-ostream & operator << (ostream & save, SMESH_MaxElementArea & hyp)
-{
- save << hyp._maxArea;
- return save;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-istream & operator >> (istream & load, SMESH_MaxElementArea & hyp)
-{
- bool isOK = true;
- double a;
- isOK = (load >> a);
- if (isOK) hyp._maxArea = a;
- else load.clear(ios::badbit | load.rdstate());
- return load;
-}
-
+++ /dev/null
-// SMESH SMESH : implementaion of SMESH idl descriptions
-//
-// Copyright (C) 2003 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.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SMESH_MaxElementArea.hxx
-// Author : Paul RASCLE, EDF
-// Module : SMESH
-// $Header$
-
-#ifndef _SMESH_MAXELEMENTAREA_HXX_
-#define _SMESH_MAXELEMENTAREA_HXX_
-
-#include "SMESH_Hypothesis.hxx"
-#include "Utils_SALOME_Exception.hxx"
-
-class SMESH_MaxElementArea:public SMESH_Hypothesis
-{
- public:
- SMESH_MaxElementArea(int hypId, int studyId, SMESH_Gen * gen);
- virtual ~ SMESH_MaxElementArea();
-
- void SetMaxArea(double maxArea) throw(SALOME_Exception);
-
- double GetMaxArea() const;
-
- virtual ostream & SaveTo(ostream & save);
- virtual istream & LoadFrom(istream & load);
- friend ostream & operator <<(ostream & save, SMESH_MaxElementArea & hyp);
- friend istream & operator >>(istream & load, SMESH_MaxElementArea & hyp);
-
- protected:
- double _maxArea;
-};
-
-#endif
+++ /dev/null
-// SMESH SMESH : implementaion of SMESH idl descriptions
-//
-// Copyright (C) 2003 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.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SMESH_MaxElementVolume.cxx
-// Author : Paul RASCLE, EDF
-// Module : SMESH
-// $Header$
-
-using namespace std;
-
-#include "SMESH_MaxElementVolume.hxx"
-#include "utilities.h"
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-SMESH_MaxElementVolume::SMESH_MaxElementVolume(int hypId, int studyId, SMESH_Gen* gen)
- : SMESH_Hypothesis(hypId, studyId, gen)
-{
- _maxVolume =1.;
- _name = "MaxElementVolume";
-// SCRUTE(_name);
- SCRUTE(&_name);
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-SMESH_MaxElementVolume::~SMESH_MaxElementVolume()
-{
- MESSAGE("SMESH_MaxElementVolume::~SMESH_MaxElementVolume");
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-void SMESH_MaxElementVolume::SetMaxVolume(double maxVolume)
- throw (SALOME_Exception)
-{
- double oldVolume = _maxVolume;
- if (maxVolume <= 0)
- throw SALOME_Exception(LOCALIZED("maxVolume must be positive"));
- _maxVolume = maxVolume;
- if (_maxVolume != oldVolume)
- NotifySubMeshesHypothesisModification();
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-double SMESH_MaxElementVolume::GetMaxVolume() const
-{
- return _maxVolume;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-ostream & SMESH_MaxElementVolume::SaveTo(ostream & save)
-{
- return save << this;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-istream & SMESH_MaxElementVolume::LoadFrom(istream & load)
-{
- return load >> (*this);
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-ostream & operator << (ostream & save, SMESH_MaxElementVolume & hyp)
-{
- save << hyp._maxVolume;
- return save;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-istream & operator >> (istream & load, SMESH_MaxElementVolume & hyp)
-{
- bool isOK = true;
- double a;
- isOK = (load >> a);
- if (isOK) hyp._maxVolume = a;
- else load.clear(ios::badbit | load.rdstate());
- return load;
-}
-
+++ /dev/null
-// SMESH SMESH : implementaion of SMESH idl descriptions
-//
-// Copyright (C) 2003 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.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SMESH_MaxElementVolume.hxx
-// Author : Paul RASCLE, EDF
-// Module : SMESH
-// $Header$
-
-#ifndef _SMESH_MAXELEMENTVOLUME_HXX_
-#define _SMESH_MAXELEMENTVOLUME_HXX_
-
-#include "SMESH_Hypothesis.hxx"
-#include "Utils_SALOME_Exception.hxx"
-
-class SMESH_MaxElementVolume:
- public SMESH_Hypothesis
-{
-public:
- SMESH_MaxElementVolume(int hypId, int studyId, SMESH_Gen* gen);
- virtual ~SMESH_MaxElementVolume();
-
- void SetMaxVolume(double maxVolume)
- throw (SALOME_Exception);
-
- double GetMaxVolume() const;
-
- virtual ostream & SaveTo(ostream & save);
- virtual istream & LoadFrom(istream & load);
- friend ostream & operator << (ostream & save, SMESH_MaxElementVolume & hyp);
- friend istream & operator >> (istream & load, SMESH_MaxElementVolume & hyp);
-
-protected:
- double _maxVolume;
-};
-
-#endif
+++ /dev/null
-//=============================================================================
-// File : SMESH_NETGEN_3D.cxx
-// Created : lundi 27 Janvier 2003
-// Author : Nadir BOUHAMOU (CEA)
-// Project : SALOME
-// Copyright : CEA 2003
-// $Header$
-//=============================================================================
-using namespace std;
-
-#include "SMESH_NETGEN_3D.hxx"
-#include "SMESH_MEFISTO_2D.hxx"
-#include "SMESH_Gen.hxx"
-#include "SMESH_Mesh.hxx"
-
-#include "SMDS_MeshElement.hxx"
-#include "SMDS_MeshNode.hxx"
-#include "SMDS_FacePosition.hxx"
-
-#include <TopExp.hxx>
-#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
-#include <TopTools_ListOfShape.hxx>
-#include <TopTools_ListIteratorOfListOfShape.hxx>
-#include <TColStd_ListIteratorOfListOfInteger.hxx>
-
-#include <BRep_Tool.hxx>
-#include <Geom_Surface.hxx>
-#include <Geom_Curve.hxx>
-#include <Geom2d_Curve.hxx>
-
-#include "utilities.h"
-
-/*
- Netgen include files
-*/
-
-#include "nglib.h"
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-SMESH_NETGEN_3D::SMESH_NETGEN_3D(int hypId, int studyId,
- SMESH_Gen* gen)
- : SMESH_3D_Algo(hypId, studyId, gen)
-{
- MESSAGE("SMESH_NETGEN_3D::SMESH_NETGEN_3D");
- _name = "NETGEN_3D";
-// _shapeType = TopAbs_SOLID;
- _shapeType = (1 << TopAbs_SHELL) | (1 << TopAbs_SOLID);// 1 bit /shape type
-// MESSAGE("_shapeType octal " << oct << _shapeType);
- _compatibleHypothesis.push_back("MaxElementVolume");
-
- _maxElementVolume = 0.;
-
- _hypMaxElementVolume = NULL;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-SMESH_NETGEN_3D::~SMESH_NETGEN_3D()
-{
- MESSAGE("SMESH_NETGEN_3D::~SMESH_NETGEN_3D");
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-bool SMESH_NETGEN_3D::CheckHypothesis(SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape)
-{
- MESSAGE("SMESH_NETGEN_3D::CheckHypothesis");
-
- _hypMaxElementVolume = NULL;
-
- list<const SMESHDS_Hypothesis*>::const_iterator itl;
- const SMESHDS_Hypothesis* theHyp;
-
- const list<const SMESHDS_Hypothesis*>& hyps = GetUsedHypothesis(aMesh, aShape);
- int nbHyp = hyps.size();
- if (nbHyp != 1) return false; // only one compatible hypothesis allowed
-
- itl = hyps.begin();
- theHyp = (*itl);
-
- string hypName = theHyp->GetName();
- int hypId = theHyp->GetID();
- SCRUTE(hypName);
-
- bool isOk = false;
-
- if (hypName == "MaxElementVolume")
- {
- _hypMaxElementVolume = static_cast<const SMESH_MaxElementVolume*> (theHyp);
- ASSERT(_hypMaxElementVolume);
- _maxElementVolume = _hypMaxElementVolume->GetMaxVolume();
- isOk =true;
- }
-
- return isOk;
-}
-
-//=============================================================================
-/*!
- *Here we are going to use the NETGEN mesher
- */
-//=============================================================================
-
-bool SMESH_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape)
- throw (SALOME_Exception)
-{
- MESSAGE("SMESH_NETGEN_3D::Compute with maxElmentsize = " << _maxElementVolume);
-
- bool isOk = false;
- SMESHDS_Mesh* meshDS = aMesh.GetMeshDS();
- SMESH_subMesh* theSubMesh = aMesh.GetSubMesh(aShape);
- //const Handle(SMESHDS_SubMesh)& subMeshDS = theSubMesh->GetSubMeshDS();
-
- map<int, const SMDS_MeshNode*> netgenToDS;
-
- MESSAGE("SMESH_NETGEN_3D::Compute Checking the mesh Faces");
-
- // check if all faces were meshed by a triangle mesher (here MESFISTO_2D)
-
- vector<SMESH_subMesh*> meshFaces;
- vector<TopoDS_Shape> shapeFaces;
-
- for (TopExp_Explorer exp(aShape,TopAbs_FACE);exp.More();exp.Next())
- {
- TopoDS_Shape aShapeFace = exp.Current();
- SMESH_subMesh* aSubMesh = aMesh.GetSubMeshContaining(exp.Current());
- ASSERT (aSubMesh);
- int internal_size = meshFaces.size();
- int index = 0;
- for (int i = 0;i<internal_size;i++)
- {
- if (aSubMesh == meshFaces[i]) index = 1;
- }
- if (index == 0) meshFaces.push_back(aSubMesh);
-
- internal_size = shapeFaces.size();
- index = 0;
- for (int i = 0;i<internal_size;i++)
- {
- if (aShapeFace == shapeFaces[i]) index = 1;
- }
- if (index == 0) shapeFaces.push_back(aShapeFace);
- }
-
- int numberOfFaces = meshFaces.size();
- int numberOfShapeFaces = shapeFaces.size();
-
- SCRUTE(numberOfFaces);
- SCRUTE(numberOfShapeFaces);
-
- MESSAGE("---");
-
- int NbTotOfTria = 0;
- int NbTotOfNodesFaces = 0;
-
- for (int i=0; i<numberOfFaces; i++)
- {
- TopoDS_Shape aShapeFace = meshFaces[i]->GetSubShape();
- TopoDS_Shape aFace = shapeFaces[i];
- SMESH_Algo* algoFace = _gen->GetAlgo(aMesh, aShapeFace);
- string algoFaceName = algoFace->GetName();
- SCRUTE(algoFaceName);
- if (algoFaceName != "MEFISTO_2D")
- {
- SCRUTE(algoFaceName);
- ASSERT(0);
- return false;
- }
-
- bool orientationMeshFace = (aFace.Orientation() == aShapeFace.Orientation());
-
- const SMESHDS_SubMesh* aSubMeshDSFace = meshFaces[i]->GetSubMeshDS();
- SCRUTE(aSubMeshDSFace);
-
- int nbNodes = aSubMeshDSFace->NbNodes();
- NbTotOfNodesFaces += nbNodes;
- int nbTria = aSubMeshDSFace->NbElements();
- NbTotOfTria += nbTria;
- int index = 0;
-
- MESSAGE("SMESH_NETGEN_3D::Compute The mesh Face " << (i+1) << " has " << nbNodes << " face internal Nodes, " << nbTria << " triangles");
-
- SCRUTE(orientationMeshFace);
-
- if (orientationMeshFace)
- {
- MESSAGE("The mesh and face have the same orientation");
- }
- else
- {
- MESSAGE("The mesh and face have different orientations");
- }
-
- SMDS_Iterator<const SMDS_MeshNode *> * iteratorNodes = aSubMeshDSFace->GetNodes();
- SCRUTE(nbNodes);
- index = 0;
- while(iteratorNodes->more())
- {
- index++;
- const SMDS_MeshNode * node = iteratorNodes->next();
-// int nodeId = node->GetID();
-// double nodeX = node->X();
-// double nodeY = node->Y();
-// double nodeZ = node->Z();
-// MESSAGE("NODE -> ID = " << nodeId << " X = " << nodeX << " Y = " << nodeY << " Z = " << nodeZ);
- }
- delete iteratorNodes;
-
- SCRUTE(index);
-
- SMDS_Iterator<const SMDS_MeshElement *> * iteratorTriangle = aSubMeshDSFace->GetElements();
-
- SCRUTE(nbTria);
- index = 0;
- int numberOfDegeneratedTriangle = 0;
- while(iteratorTriangle->more())
- {
- index++;
- const SMDS_MeshElement * triangle = iteratorTriangle->next();
- int triangleId = triangle->GetID();
-
- SMDS_Iterator<const SMDS_MeshElement *> * triangleNodesIt = triangle->nodesIterator();
-
- const SMDS_MeshNode * node1 = static_cast<const SMDS_MeshNode *>(triangleNodesIt->next());
- double node1X = node1->X();
- double node1Y = node1->Y();
- double node1Z = node1->Z();
-
- const SMDS_MeshNode * node2 = static_cast<const SMDS_MeshNode *>(triangleNodesIt->next());
- double node2X = node2->X();
- double node2Y = node2->Y();
- double node2Z = node2->Z();
-
- const SMDS_MeshNode * node3 = static_cast<const SMDS_MeshNode *>(triangleNodesIt->next());
- double node3X = node3->X();
- double node3Y = node3->Y();
- double node3Z = node3->Z();
-
- int triangleNode1 = node1->GetID();
- int triangleNode2 = node2->GetID();
- int triangleNode3 = node3->GetID();
-
- // Compute the triangle surface
-
- double vect1 = ((node2Y - node1Y)*(node3Z - node1Z) - (node2Z - node1Z)*(node3Y - node1Y));
- double vect2 = - ((node2X - node1X)*(node3Z - node1Z) - (node2Z - node1Z)*(node3X - node1X));
- double vect3 = ((node2X - node1X)*(node3Y - node1Y) - (node2Y - node1Y)*(node3X - node1X));
- double epsilon = 1.0e-6;
-
- bool triangleIsDegenerated = ((abs(vect1)<epsilon) && (abs(vect2)<epsilon) && (abs(vect3)<epsilon));
-
- if (triangleIsDegenerated)
- {
-// MESSAGE("TRIANGLE -> ID = " << triangleId << " N1 = " << triangleNode1 << " N2 = " << triangleNode2 << " N3 = " << triangleNode3 << " is degenerated");
-// MESSAGE("NODE -> ID = " << triangleNode1 << " X = " << node1X << " Y = " << node1Y << " Z = " << node1Z);
-// MESSAGE("NODE -> ID = " << triangleNode2 << " X = " << node2X << " Y = " << node2Y << " Z = " << node2Z);
-// MESSAGE("NODE -> ID = " << triangleNode3 << " X = " << node3X << " Y = " << node3Y << " Z = " << node3Z);
- numberOfDegeneratedTriangle++;
- }
- else
- {
-// MESSAGE("TRIANGLE -> ID = " << triangleId << " N1 = " << triangleNode1 << " N2 = " << triangleNode2 << " N3 = " << triangleNode3 << " is normal");
- }
- }
-
- delete iteratorTriangle;
-
- if (numberOfDegeneratedTriangle > 0)
- MESSAGE("WARNING THERE IS(ARE) " << numberOfDegeneratedTriangle << " degenerated triangle on this face");
-
- SCRUTE(index);
- }
-
-
-
- SCRUTE(NbTotOfTria);
- SCRUTE(NbTotOfNodesFaces);
-
- MESSAGE("SMESH_NETGEN_3D::Compute Checking the mesh Edges");
-
- // check if all edges were meshed by a edge mesher (here Regular_1D)
-
- vector<SMESH_subMesh*> meshEdges;
- for (TopExp_Explorer exp(aShape,TopAbs_EDGE);exp.More();exp.Next())
- {
- SMESH_subMesh* aSubMesh = aMesh.GetSubMeshContaining(exp.Current());
- ASSERT (aSubMesh);
- int internal_size = meshEdges.size();
- int index = 0;
- for (int i = 0;i<internal_size;i++)
- {
- if (aSubMesh == meshEdges[i]) index = 1;
- }
- if (index == 0) meshEdges.push_back(aSubMesh);
- }
-
- int numberOfEdges = meshEdges.size();
- SCRUTE(numberOfEdges);
-
- MESSAGE("---");
-
- int NbTotOfNodesEdges = 0;
- int NbTotOfSegs = 0;
-
- for (int i=0; i<numberOfEdges; i++)
- {
- TopoDS_Shape aShapeEdge = meshEdges[i]->GetSubShape();
- SMESH_Algo* algoEdge = _gen->GetAlgo(aMesh, aShapeEdge);
- string algoEdgeName = algoEdge->GetName();
- SCRUTE(algoEdgeName);
- if (algoEdgeName != "Regular_1D")
- {
- SCRUTE(algoEdgeName);
- ASSERT(0);
- return false;
- }
-
- const SMESHDS_SubMesh* aSubMeshDSEdge = meshEdges[i]->GetSubMeshDS();
- SCRUTE(aSubMeshDSEdge);
-
- int nbNodes = aSubMeshDSEdge->NbNodes();
- NbTotOfNodesEdges += nbNodes;
- int nbSegs = aSubMeshDSEdge->NbElements();
- NbTotOfSegs += nbSegs;
-
- MESSAGE("SMESH_NETGEN_3D::Compute The mesh Edge " << (i+1) << " has " << nbNodes << " edge internal Nodes, " << nbSegs << " segments");
-
- SMDS_Iterator<const SMDS_MeshNode *> * iteratorNodes = aSubMeshDSEdge->GetNodes();
- SCRUTE(nbNodes);
- int index = 0;
- while(iteratorNodes->more())
- {
- index++;
- const SMDS_MeshNode * node = iteratorNodes->next();
-// int nodeId = node->GetID();
-// double nodeX = node->X();
-// double nodeY = node->Y();
-// double nodeZ = node->Z();
-// MESSAGE("NODE -> ID = " << nodeId << " X = " << nodeX << " Y = " << nodeY << " Z = " << nodeZ);
- }
- delete iteratorNodes;
-
- SCRUTE(index);
- }
-
- SCRUTE(NbTotOfNodesEdges);
- SCRUTE(NbTotOfSegs);
-
- MESSAGE("SMESH_NETGEN_3D::Compute Checking the mesh Vertices");
-
- vector<SMESH_subMesh*> meshVertices;
- for (TopExp_Explorer exp(aShape,TopAbs_VERTEX);exp.More();exp.Next())
- {
- SMESH_subMesh* aSubMesh = aMesh.GetSubMeshContaining(exp.Current());
- ASSERT (aSubMesh);
- int internal_size = meshVertices.size();
- int index = 0;
- for (int i = 0;i<internal_size;i++)
- {
- if (aSubMesh == meshVertices[i]) index = 1;
- }
- if (index == 0) meshVertices.push_back(aSubMesh);
- }
-
- int numberOfVertices = meshVertices.size();
- SCRUTE(numberOfVertices);
-
- MESSAGE("---");
-
- int NbTotOfNodesVertices = 0;
-
- for (int i=0; i<numberOfVertices; i++)
- {
- TopoDS_Shape aShapeVertex = meshVertices[i]->GetSubShape();
-
- const SMESHDS_SubMesh * aSubMeshDSVertex = meshVertices[i]->GetSubMeshDS();
- SCRUTE(aSubMeshDSVertex);
-
- int nbNodes = aSubMeshDSVertex->NbNodes();
- NbTotOfNodesVertices += nbNodes;
-
- MESSAGE("SMESH_NETGEN_3D::Compute The mesh Vertex " << (i+1) << " has " << nbNodes << " Nodes");
-
- SMDS_Iterator<const SMDS_MeshNode *> * iteratorNodes = aSubMeshDSVertex->GetNodes();
- SCRUTE(nbNodes);
- int index = 0;
- while(iteratorNodes->more())
- {
- index++;
- const SMDS_MeshNode * node = iteratorNodes->next();
-// int nodeId = node->GetID();
-// double nodeX = node->X();
-// double nodeY = node->Y();
-// double nodeZ = node->Z();
-// MESSAGE("NODE -> ID = " << nodeId << " X = " << nodeX << " Y = " << nodeY << " Z = " << nodeZ);
- }
- delete iteratorNodes;
-
- SCRUTE(index);
- }
-
- SCRUTE(NbTotOfNodesVertices);
-
- MESSAGE("SMESH_NETGEN_3D::Compute --> Analysis of all shell mesh");
-
- vector<SMESH_subMesh*> meshShells;
- TopoDS_Shell aShell;
-
- for (TopExp_Explorer exp(aShape,TopAbs_SHELL);exp.More();exp.Next())
- {
- SMESH_subMesh* aSubMesh = aMesh.GetSubMesh(exp.Current());
- ASSERT(aSubMesh);
- SCRUTE(aSubMesh);
- aShell = TopoDS::Shell(exp.Current());
- meshShells.push_back(aSubMesh);
- }
-
- int numberOfShells = meshShells.size();
- SCRUTE(numberOfShells);
-
- if (numberOfShells == 1)
- {
- MESSAGE("SMESH_NETGEN_3D::Compute Only one shell --> generation of the mesh using directly Netgen");
-
- /*
- Prepare the Netgen surface mesh from the SMESHDS
- */
-
- MESSAGE("SMESH_NETGEN_3D::Compute Prepare the Netgen surface mesh from the SMESHDS");
-
- int spaceDimension = 3;
- int nbNodesByTri = 3;
- int nbNodesByTetra = 4;
-
- int Netgen_NbOfNodes = NbTotOfNodesFaces +
- NbTotOfNodesEdges +
- NbTotOfNodesVertices;
- int Netgen_NbOfTria = NbTotOfTria;
- int Netgen_param2ndOrder = 0;
- double Netgen_paramFine = 1.;
- double Netgen_paramSize = _maxElementVolume;
-
- SCRUTE(Netgen_NbOfNodes);
- SCRUTE(Netgen_NbOfTria);
-
- double * Netgen_Coordinates = new double [spaceDimension*
- Netgen_NbOfNodes];
- int * listNodeCoresNetgenSmesh = new int [Netgen_NbOfNodes];
- int * Netgen_Connectivity = new int [nbNodesByTri*Netgen_NbOfTria];
- double * Netgen_point = new double [spaceDimension];
- int * Netgen_triangle = new int [nbNodesByTri];
- int * Netgen_tetrahedron = new int [nbNodesByTetra];
-
- for (int i=0; i<Netgen_NbOfTria; i++)
- {
- for (int j=0; j<nbNodesByTri; j++)
- Netgen_Connectivity[i*nbNodesByTri+j] = 0;
- }
-
- double bigNumber = 1.e20;
-
- for (int i=0; i<Netgen_NbOfNodes; i++)
- {
- listNodeCoresNetgenSmesh[i] = 0;
- for (int j=0; j<spaceDimension; j++)
- Netgen_Coordinates[i*spaceDimension+j] = bigNumber;
- }
-
- int indexNodes = 0;
- for (int i=0; i<numberOfVertices; i++)
- {
- const SMESHDS_SubMesh * aSubMeshDSVertex =
- meshVertices[i]->GetSubMeshDS();
-
- SMDS_Iterator<const SMDS_MeshNode *> * iteratorNodes = aSubMeshDSVertex->GetNodes();
-
- while(iteratorNodes->more())
- {
- const SMDS_MeshNode * node = iteratorNodes->next();
- int nodeId = node->GetID();
- double nodeX = node->X();
- double nodeY = node->Y();
- double nodeZ = node->Z();
-// MESSAGE("NODE -> ID = " << nodeId << " X = " << nodeX << " Y = " << nodeY << " Z = " << nodeZ);
- listNodeCoresNetgenSmesh[indexNodes] = nodeId;
- int index = indexNodes*spaceDimension;
- Netgen_Coordinates[index] = nodeX;
- Netgen_Coordinates[index+1] = nodeY;
- Netgen_Coordinates[index+2] = nodeZ;
- netgenToDS[indexNodes] = node;
- indexNodes++;
- }
- delete iteratorNodes;
- }
-
- for (int i=0; i<numberOfEdges; i++)
- {
- const SMESHDS_SubMesh * aSubMeshDSEdge =
- meshEdges[i]->GetSubMeshDS();
-
- SMDS_Iterator<const SMDS_MeshNode *> * iteratorNodes = aSubMeshDSEdge->GetNodes();
-
- while(iteratorNodes->more())
- {
- const SMDS_MeshNode * node = iteratorNodes->next();
- int nodeId = node->GetID();
- double nodeX = node->X();
- double nodeY = node->Y();
- double nodeZ = node->Z();
-// MESSAGE("NODE -> ID = " << nodeId << " X = " << nodeX << " Y = " << nodeY << " Z = " << nodeZ);
- listNodeCoresNetgenSmesh[indexNodes] = node->GetID();
- int index = indexNodes*spaceDimension;
- Netgen_Coordinates[index] = node->X();
- Netgen_Coordinates[index+1] = node->Y();
- Netgen_Coordinates[index+2] = node->Z();
- netgenToDS[indexNodes] = node;
- indexNodes++;
- }
- delete iteratorNodes;
- }
-
- for (int i=0; i<numberOfFaces; i++)
- {
- const SMESHDS_SubMesh * aSubMeshDSFace =
- meshFaces[i]->GetSubMeshDS();
-
- SMDS_Iterator<const SMDS_MeshNode *> * iteratorNodes = aSubMeshDSFace->GetNodes();
-
- while(iteratorNodes->more())
- {
- const SMDS_MeshNode * node = iteratorNodes->next();
- int nodeId = node->GetID();
- double nodeX = node->X();
- double nodeY = node->Y();
- double nodeZ = node->Z();
-// MESSAGE("NODE -> ID = " << nodeId << " X = " << nodeX << " Y = " << nodeY << " Z = " << nodeZ);
- listNodeCoresNetgenSmesh[indexNodes] = nodeId;
- int index = indexNodes*spaceDimension;
- Netgen_Coordinates[index] = nodeX;
- Netgen_Coordinates[index+1] = nodeY;
- Netgen_Coordinates[index+2] = nodeZ;
- netgenToDS[indexNodes] = node;
- indexNodes++;
- }
- delete iteratorNodes;
- }
-
- SCRUTE(indexNodes);
-
- for (int i=0; i<Netgen_NbOfNodes; i++)
- {
- ASSERT(listNodeCoresNetgenSmesh[i] != 0);
-
- for (int j=0; j<Netgen_NbOfNodes && j!=i; j++)
- ASSERT(listNodeCoresNetgenSmesh[i] != listNodeCoresNetgenSmesh[j]);
-
- for (int j=0; j<spaceDimension; j++)
- ASSERT(Netgen_Coordinates[i*spaceDimension+j] != bigNumber);
- }
-
- int indexTrias = 0;
- for (int i=0; i<numberOfFaces; i++)
- {
- const SMESHDS_SubMesh * aSubMeshDSFace =
- meshFaces[i]->GetSubMeshDS();
-
- TopoDS_Shape aFace = shapeFaces[i];
-
- SMDS_Iterator<const SMDS_MeshElement *> * iteratorTriangle = aSubMeshDSFace->GetElements();
-
- TopoDS_Shape aShapeFace = meshFaces[i]->GetSubShape();
-
- bool orientationMeshFace = (aFace.Orientation() == aShapeFace.Orientation());
-
- SCRUTE(orientationMeshFace);
-
- if (orientationMeshFace)
- {
- MESSAGE("The mesh and face have the same orientation");
-
- while(iteratorTriangle->more())
- {
- const SMDS_MeshElement * triangle = iteratorTriangle->next();
- int triangleId = triangle->GetID();
-
- SMDS_Iterator<const SMDS_MeshElement *> * triangleNodesIt = triangle->nodesIterator();
-
- int triangleNode1 = (triangleNodesIt->next())->GetID();
- int triangleNode2 = (triangleNodesIt->next())->GetID();
- int triangleNode3 = (triangleNodesIt->next())->GetID();
-
-// MESSAGE("TRIANGLE -> ID = " << triangleId << " N1 = " << triangleNode1 << " N2 = " << triangleNode2 << " N3 = " << triangleNode3);
-
- int N1New = 0;
- int N2New = 0;
- int N3New = 0;
- int index = indexTrias*nbNodesByTri;
-
- for (int j=0; j<Netgen_NbOfNodes; j++)
- {
- int jp1 = j+1;
-
- if (triangleNode1 == listNodeCoresNetgenSmesh[j])
- N1New = jp1;
- else if (triangleNode2 == listNodeCoresNetgenSmesh[j])
- N2New = jp1;
- else if (triangleNode3 == listNodeCoresNetgenSmesh[j])
- N3New = jp1;
- }
-
- triangleNode1 = N1New;
- triangleNode2 = N2New;
- triangleNode3 = N3New;
-
- Netgen_Connectivity[index] = triangleNode1;
- Netgen_Connectivity[index+1] = triangleNode2;
- Netgen_Connectivity[index+2] = triangleNode3;
-
- indexTrias++;
- }
- delete iteratorTriangle;
- }
- else
- {
- MESSAGE("The mesh and face have different orientations");
-
- while(iteratorTriangle->more())
- {
- const SMDS_MeshElement * triangle = iteratorTriangle->next();
- int triangleId = triangle->GetID();
-
- SMDS_Iterator<const SMDS_MeshElement *> * triangleNodesIt = triangle->nodesIterator();
-
- int triangleNode1 = (triangleNodesIt->next())->GetID();
- int triangleNode3 = (triangleNodesIt->next())->GetID();
- int triangleNode2 = (triangleNodesIt->next())->GetID();
-
-// MESSAGE("TRIANGLE -> ID = " << triangleId << " N1 = " << triangleNode1 << " N2 = " << triangleNode2 << " N3 = " << triangleNode3);
-
- int N1New = 0;
- int N2New = 0;
- int N3New = 0;
- int index = indexTrias*nbNodesByTri;
-
- for (int j=0; j<Netgen_NbOfNodes; j++)
- {
- int jp1 = j+1;
-
- if (triangleNode1 == listNodeCoresNetgenSmesh[j])
- N1New = jp1;
- else if (triangleNode2 == listNodeCoresNetgenSmesh[j])
- N2New = jp1;
- else if (triangleNode3 == listNodeCoresNetgenSmesh[j])
- N3New = jp1;
- }
-
- triangleNode1 = N1New;
- triangleNode2 = N2New;
- triangleNode3 = N3New;
-
- Netgen_Connectivity[index] = triangleNode1;
- Netgen_Connectivity[index+1] = triangleNode2;
- Netgen_Connectivity[index+2] = triangleNode3;
-
- indexTrias++;
- }
- delete iteratorTriangle;
- }
- }
-
- SCRUTE(indexTrias);
-
- int * nodesUsed = new int[Netgen_NbOfNodes];
-
- for (int i=0; i<Netgen_NbOfNodes; i++) nodesUsed[i] = 0;
-
- for (int i=0; i<Netgen_NbOfTria; i++)
- for (int j=0; j<nbNodesByTri; j++)
- {
- int Nij = Netgen_Connectivity[i*nbNodesByTri+j];
-
- ASSERT((Nij>=1) && (Nij<=Netgen_NbOfNodes));
-
- nodesUsed[Nij-1] = 1;
- Netgen_Connectivity[i*nbNodesByTri+j] = Nij;
- }
-
- for (int i=0; i<Netgen_NbOfNodes; i++)
- {
- ASSERT(nodesUsed[i] != 0);
- }
-
- delete [] nodesUsed;
-
- /*
- Feed the Netgen surface mesh
- */
-
- MESSAGE("SMESH_NETGEN_3D::Compute Feed the Netgen surface mesh");
-
- Ng_Mesh * Netgen_mesh;
-
- Ng_Init();
-
- Netgen_mesh = Ng_NewMesh();
-
- Ng_Meshing_Parameters Netgen_param;
-
- for (int i=0; i<Netgen_NbOfNodes; i++)
- {
- for (int j=0; j<spaceDimension; j++)
- Netgen_point[j] = Netgen_Coordinates[i*spaceDimension+j];
-
- Ng_AddPoint(Netgen_mesh, Netgen_point);
- }
-
- for (int i=0; i<Netgen_NbOfTria; i++)
- {
- for (int j=0; j<nbNodesByTri; j++)
- Netgen_triangle[j] = Netgen_Connectivity[i*nbNodesByTri+j];
-
- Ng_AddSurfaceElement(Netgen_mesh, NG_TRIG, Netgen_triangle);
- }
-
- SCRUTE(Netgen_paramSize);
-
- Netgen_param.secondorder = Netgen_param2ndOrder;
- Netgen_param.fineness = Netgen_paramFine;
- Netgen_param.maxh = Netgen_paramSize;
-
- /*
- Generate the volume mesh
- */
-
- MESSAGE("SMESH_NETGEN_3D::Compute Generate the volume mesh");
-
- SCRUTE(Netgen_NbOfNodes);
- SCRUTE(Netgen_NbOfTria);
-
- SCRUTE(Ng_GetNP(Netgen_mesh));
- SCRUTE(Ng_GetNE(Netgen_mesh));
- SCRUTE(Ng_GetNSE(Netgen_mesh));
-
- ASSERT(Netgen_NbOfNodes == Ng_GetNP(Netgen_mesh));
- ASSERT(Ng_GetNE(Netgen_mesh) == 0);
- ASSERT(Netgen_NbOfTria == Ng_GetNSE(Netgen_mesh));
-
- Ng_Result status;
-
- status = Ng_GenerateVolumeMesh(Netgen_mesh, &Netgen_param);
-
- SCRUTE(status);
-
- int Netgen_NbOfNodesNew = Ng_GetNP(Netgen_mesh);
-
- int Netgen_NbOfTetra = Ng_GetNE(Netgen_mesh);
-
- SCRUTE(Netgen_NbOfNodesNew);
-
- SCRUTE(Netgen_NbOfTetra);
-
- if ((status != NG_OK) ||
- (Netgen_NbOfNodesNew <= Netgen_NbOfNodes) ||
- (Netgen_NbOfTetra <= 0))
- {
- MESSAGE("SMESH_NETGEN_3D::Compute The Volume Mesh Generation has failed ...");
- SCRUTE(status);
-
- /*
- Free the memory needed by to generate the Netgen Mesh
- */
-
- MESSAGE("SMESH_NETGEN_3D::Compute Free the memory needed by to generate the Netgen Mesh");
-
- delete [] Netgen_Coordinates;
- delete [] Netgen_Connectivity;
- delete [] Netgen_point;
- delete [] Netgen_triangle;
- delete [] Netgen_tetrahedron;
-
- delete [] listNodeCoresNetgenSmesh;
-
- Ng_DeleteMesh(Netgen_mesh);
- Ng_Exit();
-
- return false;
- }
-
- MESSAGE("SMESH_NETGEN_3D::Compute End of Volume Mesh Generation");
- SCRUTE(status);
-
- double * Netgen_CoordinatesNew = new double [spaceDimension*Netgen_NbOfNodesNew];
- int * Netgen_ConnectivityNew = new int [nbNodesByTetra*Netgen_NbOfTetra];
-
- for (int i=0; i<Netgen_NbOfNodesNew; i++)
- {
- Ng_GetPoint(Netgen_mesh, (i+1), Netgen_point);
-
- for (int j=0; j<spaceDimension; j++)
- Netgen_CoordinatesNew[i*spaceDimension+j] = Netgen_point[j];
- }
-
- for (int i=0; i<Netgen_NbOfNodes; i++)
- for (int j=0; j<spaceDimension; j++)
- ASSERT(Netgen_CoordinatesNew[i*spaceDimension+j] == Netgen_Coordinates[i*spaceDimension+j])
-
- for (int i=0; i<Netgen_NbOfTetra; i++)
- {
- Ng_GetVolumeElement(Netgen_mesh, (i+1), Netgen_tetrahedron);
-
- for (int j=0; j<nbNodesByTetra; j++)
- Netgen_ConnectivityNew[i*nbNodesByTetra+j] = Netgen_tetrahedron[j];
- }
-
- /*
- Feed back the SMESHDS with the generated Nodes and Volume Elements
- */
-
- MESSAGE("SMESH_NETGEN_3D::Compute Feed back the SMESHDS with the generated Nodes and Volume Elements");
-
- int NbTotOfNodesShell = Netgen_NbOfNodesNew - Netgen_NbOfNodes;
-
- SCRUTE(NbTotOfNodesShell);
-
- int * listNodeShellCoresNetgenSmesh = new int [NbTotOfNodesShell];
-
- for (int i=0; i<NbTotOfNodesShell; i++)
- listNodeShellCoresNetgenSmesh[i] = 0;
-
- MESSAGE("SMESH_NETGEN_3D::Compute --> Adding the New Nodes to SMESHDS");
-
- for (int i=0; i<NbTotOfNodesShell; i++)
- {
- int index = (i+Netgen_NbOfNodes)*spaceDimension;
-
- SMDS_MeshNode * node =
- meshDS->AddNode(Netgen_CoordinatesNew[index],
- Netgen_CoordinatesNew[index+1],
- Netgen_CoordinatesNew[index+2]);
-
- meshDS->SetNodeInVolume(node, aShell);
-
- index = i+Netgen_NbOfNodes;
- netgenToDS[index] = node;
-
- listNodeShellCoresNetgenSmesh[i] = node->GetID();
- }
-
- SCRUTE(Netgen_NbOfNodesNew);
-
- SCRUTE(netgenToDS.size());
-
- for (int i=0; i<NbTotOfNodesShell; i++)
- {
- ASSERT(listNodeShellCoresNetgenSmesh[i] != 0);
-
- for (int j=0; j<NbTotOfNodesShell && j!=i; j++)
- ASSERT(listNodeShellCoresNetgenSmesh[i] != listNodeShellCoresNetgenSmesh[j]);
- }
-
- MESSAGE("SMESH_NETGEN_3D::Compute --> Adding the New elements (Tetrahedrons) to the SMESHDS");
-
- for (int i=0; i<Netgen_NbOfTetra; i++)
- {
- int index = i*nbNodesByTetra;
- int tetraNode1 = Netgen_ConnectivityNew[index];
- int tetraNode2 = Netgen_ConnectivityNew[index+1];
- int tetraNode3 = Netgen_ConnectivityNew[index+2];
- int tetraNode4 = Netgen_ConnectivityNew[index+3];
-
- const SMDS_MeshNode * node1 = netgenToDS[tetraNode1-1];
- const SMDS_MeshNode * node2 = netgenToDS[tetraNode2-1];
- const SMDS_MeshNode * node3 = netgenToDS[tetraNode3-1];
- const SMDS_MeshNode * node4 = netgenToDS[tetraNode4-1];
-
- index = tetraNode1;
- if (index <= Netgen_NbOfNodes)
- tetraNode1 = listNodeCoresNetgenSmesh[index-1];
- else
- tetraNode1 = listNodeShellCoresNetgenSmesh[index-Netgen_NbOfNodes-1];
-
- index = tetraNode2;
- if (index <= Netgen_NbOfNodes)
- tetraNode2 = listNodeCoresNetgenSmesh[index-1];
- else
- tetraNode2 = listNodeShellCoresNetgenSmesh[index-Netgen_NbOfNodes-1];
-
- index = tetraNode3;
- if (index <= Netgen_NbOfNodes)
- tetraNode3 = listNodeCoresNetgenSmesh[index-1];
- else
- tetraNode3 = listNodeShellCoresNetgenSmesh[index-Netgen_NbOfNodes-1];
-
- index = tetraNode4;
- if (index <= Netgen_NbOfNodes)
- tetraNode4 = listNodeCoresNetgenSmesh[index-1];
- else
- tetraNode4 = listNodeShellCoresNetgenSmesh[index-Netgen_NbOfNodes-1];
-
- SMDS_MeshVolume * elt =
- meshDS->AddVolume(node1,node2,node3,node4);
-
- meshDS->SetMeshElementOnShape(elt, aShell);
- }
-
- /*
- Free the memory needed by to generate the Netgen Mesh
- */
-
- MESSAGE("SMESH_NETGEN_3D::Compute Free the memory needed by to generate the Netgen Mesh");
-
- delete [] Netgen_Coordinates;
- delete [] Netgen_Connectivity;
- delete [] Netgen_CoordinatesNew;
- delete [] Netgen_ConnectivityNew;
- delete [] Netgen_point;
- delete [] Netgen_triangle;
- delete [] Netgen_tetrahedron;
-
- delete [] listNodeCoresNetgenSmesh;
- delete [] listNodeShellCoresNetgenSmesh;
-
- Ng_DeleteMesh(Netgen_mesh);
- Ng_Exit();
-
- /*
- Verification
- */
-
- {
- MESSAGE("SMESH_NETGEN_3D::Compute Verification of the Shell mesh");
-
- TopoDS_Shape aShapeShell = meshShells[0]->GetSubShape();
- SMESH_Algo* algoShell = _gen->GetAlgo(aMesh, aShapeShell);
- string algoShellName = algoShell->GetName();
- SCRUTE(algoShellName);
- if (algoShellName != "NETGEN_3D")
- {
- SCRUTE(algoShellName);
- ASSERT(0);
- return false;
- }
-
- const SMESHDS_SubMesh * aSubMeshDSShell = meshShells[0]->GetSubMeshDS();
- SCRUTE(&aSubMeshDSShell);
-
- int nbNodes = aSubMeshDSShell->NbNodes();
- int nbTetra = aSubMeshDSShell->NbElements();
-
- MESSAGE("SMESH_NETGEN_3D::Compute The mesh Shell has " << nbNodes << " shell internal Nodes, " << nbTetra << " tetrahedrons");
-
- SMDS_Iterator<const SMDS_MeshNode *> * iteratorNodes = aSubMeshDSShell->GetNodes();
-
- SCRUTE(nbNodes);
-
- int index;
-
- index = 0;
-
- while(iteratorNodes->more())
- {
- index++;
- const SMDS_MeshNode * node = iteratorNodes->next();
- int nodeId = node->GetID();
- double nodeX = node->X();
- double nodeY = node->Y();
- double nodeZ = node->Z();
-// MESSAGE("NODE -> ID = " << nodeId << " X = " << nodeX << " Y = " << nodeY << " Z = " << nodeZ);
- }
- delete iteratorNodes;
-
- SCRUTE(index);
-
- SMDS_Iterator<const SMDS_MeshElement *> * iteratorTetra = aSubMeshDSShell->GetElements();
-
- SCRUTE(nbTetra);
-
- index = 0;
- while(iteratorTetra->more())
- {
- index++;
- const SMDS_MeshElement * tetra = iteratorTetra->next();
- int tetraId = tetra->GetID();
-
- SMDS_Iterator<const SMDS_MeshElement *> * tetraNodesIt = tetra->nodesIterator();
-
- int tetraNode1 = (tetraNodesIt->next())->GetID();
- int tetraNode2 = (tetraNodesIt->next())->GetID();
- int tetraNode3 = (tetraNodesIt->next())->GetID();
- int tetraNode4 = (tetraNodesIt->next())->GetID();
-
-// MESSAGE("TETRAHEDRON -> ID = " << tetraId << " N1 = " << tetraNode1 << " N2 = " << tetraNode2 << " N3 = " << tetraNode3 << " N4 = " << tetraNode4);
-
- }
- delete iteratorTetra;
-
- SCRUTE(index);
- }
- }
- else
- {
- SCRUTE(numberOfShells);
- MESSAGE("SMESH_NETGEN_3D::Compute ERROR More than one shell ????? ");
- return false;
- }
-
- return true;
-}
-
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-ostream & SMESH_NETGEN_3D::SaveTo(ostream & save)
-{
- return save << this;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-istream & SMESH_NETGEN_3D::LoadFrom(istream & load)
-{
- return load >> (*this);
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-ostream & operator << (ostream & save, SMESH_NETGEN_3D & hyp)
-{
- return save;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-istream & operator >> (istream & load, SMESH_NETGEN_3D & hyp)
-{
- return load;
-}
+++ /dev/null
-//=============================================================================
-// File : SMESH_NETGEN_3D.hxx
-// Created : lundi 27 Janvier 2003
-// Author : Nadir BOUHAMOU (CEA)
-// Project : SALOME
-// Copyright : CEA 2003
-// $Header$
-//=============================================================================
-
-#ifndef _SMESH_NETGEN_3D_HXX_
-#define _SMESH_NETGEN_3D_HXX_
-
-#include "SMESH_3D_Algo.hxx"
-#include "SMESH_Mesh.hxx"
-#include "SMESH_MaxElementVolume.hxx"
-#include "Utils_SALOME_Exception.hxx"
-
-class SMESH_NETGEN_3D: public SMESH_3D_Algo
-{
-public:
- SMESH_NETGEN_3D(int hypId, int studyId, SMESH_Gen* gen);
- virtual ~SMESH_NETGEN_3D();
-
- virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape);
-
- virtual bool Compute(SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape)
- throw (SALOME_Exception);
-
- ostream & SaveTo(ostream & save);
- istream & LoadFrom(istream & load);
- friend ostream & operator << (ostream & save, SMESH_NETGEN_3D & hyp);
- friend istream & operator >> (istream & load, SMESH_NETGEN_3D & hyp);
-
-protected:
- double _maxElementVolume;
-
- const SMESH_MaxElementVolume* _hypMaxElementVolume;
-};
-
-#endif
+++ /dev/null
-// SMESH SMESH : implementaion of SMESH idl descriptions
-//
-// Copyright (C) 2003 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.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SMESH_NumberOfSegments.cxx
-// Author : Paul RASCLE, EDF
-// Module : SMESH
-// $Header$
-
-using namespace std;
-#include "SMESH_NumberOfSegments.hxx"
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-SMESH_NumberOfSegments::SMESH_NumberOfSegments(int hypId, int studyId,
- SMESH_Gen * gen):SMESH_Hypothesis(hypId, studyId, gen)
-{
- _numberOfSegments = 1;
- _scaleFactor = 1.0;
- _name = "NumberOfSegments";
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-SMESH_NumberOfSegments::~SMESH_NumberOfSegments()
-{
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-void SMESH_NumberOfSegments::SetNumberOfSegments(int segmentsNumber)
-throw(SALOME_Exception)
-{
- int oldNumberOfSegments = _numberOfSegments;
- if (segmentsNumber <= 0)
- throw
- SALOME_Exception(LOCALIZED("number of segments must be positive"));
- _numberOfSegments = segmentsNumber;
-
- if (oldNumberOfSegments != _numberOfSegments)
- NotifySubMeshesHypothesisModification();
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-int SMESH_NumberOfSegments::GetNumberOfSegments() const
-{
- return _numberOfSegments;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-void SMESH_NumberOfSegments::SetScaleFactor(double scaleFactor)
-throw(SALOME_Exception)
-{
- if (scaleFactor < 0)
- throw SALOME_Exception(LOCALIZED("scale factor must be positive"));
- _scaleFactor = scaleFactor;
-
- NotifySubMeshesHypothesisModification();
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-double SMESH_NumberOfSegments::GetScaleFactor() const
-{
- return _scaleFactor;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-ostream & SMESH_NumberOfSegments::SaveTo(ostream & save)
-{
- return save << this;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-istream & SMESH_NumberOfSegments::LoadFrom(istream & load)
-{
- return load >> (*this);
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-ostream & operator <<(ostream & save, SMESH_NumberOfSegments & hyp)
-{
- save << hyp._numberOfSegments;
- return save;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-istream & operator >>(istream & load, SMESH_NumberOfSegments & hyp)
-{
- bool isOK = true;
- int a;
- isOK = (load >> a);
- if (isOK)
- hyp._numberOfSegments = a;
- else
- load.clear(ios::badbit | load.rdstate());
- return load;
-}
+++ /dev/null
-// SMESH SMESH : implementaion of SMESH idl descriptions
-//
-// Copyright (C) 2003 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.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SMESH_NumberOfSegments.hxx
-// Author : Paul RASCLE, EDF
-// Module : SMESH
-// $Header$
-
-#ifndef _SMESH_NUMBEROFSEGMENTS_HXX_
-#define _SMESH_NUMBEROFSEGMENTS_HXX_
-
-#include "SMESH_Hypothesis.hxx"
-#include "Utils_SALOME_Exception.hxx"
-
-class SMESH_NumberOfSegments:
- public SMESH_Hypothesis
-{
-public:
- SMESH_NumberOfSegments(int hypId, int studyId, SMESH_Gen* gen);
- virtual ~SMESH_NumberOfSegments();
-
- void SetNumberOfSegments(int segmentsNumber)
- throw (SALOME_Exception);
-
- int GetNumberOfSegments() const;
-
- void SetScaleFactor(double scaleFactor)
- throw (SALOME_Exception);
-
- double GetScaleFactor() const;
-
- virtual ostream & SaveTo(ostream & save);
- virtual istream & LoadFrom(istream & load);
- friend ostream& operator << (ostream & save, SMESH_NumberOfSegments & hyp);
- friend istream& operator >> (istream & load, SMESH_NumberOfSegments & hyp);
-
-protected:
- int _numberOfSegments;
- double _scaleFactor;
-};
-
-#endif
+++ /dev/null
-// SMESH SMESH : implementaion of SMESH idl descriptions
-//
-// Copyright (C) 2003 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.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SMESH_Quadrangle_2D.cxx
-// Author : Paul RASCLE, EDF
-// Module : SMESH
-// $Header$
-
-using namespace std;
-#include "SMESH_Quadrangle_2D.hxx"
-#include "SMESH_Gen.hxx"
-#include "SMESH_Mesh.hxx"
-
-#include "SMDS_MeshElement.hxx"
-#include "SMDS_MeshNode.hxx"
-#include "SMDS_EdgePosition.hxx"
-#include "SMDS_FacePosition.hxx"
-
-#include <BRep_Tool.hxx>
-#include <BRepTools.hxx>
-#include <BRepTools_WireExplorer.hxx>
-#include <Geom_Surface.hxx>
-#include <Geom_Curve.hxx>
-#include <Geom2d_Curve.hxx>
-#include <Handle_Geom2d_Curve.hxx>
-#include <Handle_Geom_Curve.hxx>
-#include <gp_Pnt2d.hxx>
-#include <TColStd_ListIteratorOfListOfInteger.hxx>
-
-#include "utilities.h"
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-SMESH_Quadrangle_2D::SMESH_Quadrangle_2D(int hypId,
- int studyId, SMESH_Gen * gen):SMESH_2D_Algo(hypId, studyId, gen)
-{
- MESSAGE("SMESH_Quadrangle_2D::SMESH_Quadrangle_2D");
- _name = "Quadrangle_2D";
- // _shapeType = TopAbs_FACE;
- _shapeType = (1 << TopAbs_FACE);
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-SMESH_Quadrangle_2D::~SMESH_Quadrangle_2D()
-{
- MESSAGE("SMESH_Quadrangle_2D::~SMESH_Quadrangle_2D");
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-bool SMESH_Quadrangle_2D::CheckHypothesis(SMESH_Mesh & aMesh,
- const TopoDS_Shape & aShape)
-{
- //MESSAGE("SMESH_Quadrangle_2D::CheckHypothesis");
-
- bool isOk = true;
-
- // nothing to check
-
- return isOk;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-bool SMESH_Quadrangle_2D::Compute(SMESH_Mesh & aMesh,
- const TopoDS_Shape & aShape)throw(SALOME_Exception)
-{
- //MESSAGE("SMESH_Quadrangle_2D::Compute");
- SMESHDS_Mesh * meshDS = aMesh.GetMeshDS();
- SMESH_subMesh *theSubMesh = aMesh.GetSubMesh(aShape);
-
- FaceQuadStruct *quad = CheckAnd2Dcompute(aMesh, aShape);
- if (!quad)
- return false;
-
- // --- compute 3D values on points, store points & quadrangles
-
- int nbdown = quad->nbPts[0];
- int nbright = quad->nbPts[1];
- int nbVertices = nbdown * nbright;
- int nbQuad = (nbdown - 1) * (nbright - 1);
- //SCRUTE(nbVertices);
- //SCRUTE(nbQuad);
-
- // const TopoDS_Face& FF = TopoDS::Face(aShape);
- // bool faceIsForward = (FF.Orientation() == TopAbs_FORWARD);
- // TopoDS_Face F = TopoDS::Face(FF.Oriented(TopAbs_FORWARD));
- const TopoDS_Face & F = TopoDS::Face(aShape);
- bool faceIsForward = (F.Orientation() == TopAbs_FORWARD);
- Handle(Geom_Surface) S = BRep_Tool::Surface(F);
-
- for (int i = 1; i < nbdown - 1; i++)
- for (int j = 1; j < nbright - 1; j++) // internal points
- {
- int ij = j * nbdown + i;
- double u = quad->uv_grid[ij].u;
- double v = quad->uv_grid[ij].v;
- gp_Pnt P = S->Value(u, v);
- SMDS_MeshNode * node = meshDS->AddNode(P.X(), P.Y(), P.Z());
- meshDS->SetNodeOnFace(node, F);
- quad->uv_grid[ij].node = node;
-// Handle (SMDS_FacePosition) fpos
-// = new SMDS_FacePosition(theSubMesh->GetId(),i,j); // easier than u,v
-// node->SetPosition(fpos);
- SMDS_FacePosition* fpos
- = dynamic_cast<SMDS_FacePosition*>(node->GetPosition());
- fpos->SetUParameter(i);
- fpos->SetVParameter(j);
- }
-
- // bool isQuadForward = ( faceIsForward == quad->isEdgeForward[0]);
- for (int i = 0; i < nbdown - 1; i++)
- for (int j = 0; j < nbright - 1; j++) // faces
- {
- const SMDS_MeshNode *a, *b, *c, *d;
- a = quad->uv_grid[j * nbdown + i].node;
- b = quad->uv_grid[j * nbdown + i + 1].node;
- c = quad->uv_grid[(j + 1) * nbdown + i + 1].node;
- d = quad->uv_grid[(j + 1) * nbdown + i].node;
- // if (isQuadForward) faceId = meshDS->AddFace(a,b,c,d);
- // else faceId = meshDS->AddFace(a,d,c,b);
- SMDS_MeshFace * face = meshDS->AddFace(a, b, c, d);
- meshDS->SetMeshElementOnShape(face, F);
- }
-
- QuadDelete(quad);
- bool isOk = true;
- return isOk;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-FaceQuadStruct *SMESH_Quadrangle_2D::CheckAnd2Dcompute(SMESH_Mesh & aMesh,
- const TopoDS_Shape & aShape)throw(SALOME_Exception)
-{
- //MESSAGE("SMESH_Quadrangle_2D::ComputeWithoutStore");
-
- SMESH_subMesh *theSubMesh = aMesh.GetSubMesh(aShape);
-
- // const TopoDS_Face& FF = TopoDS::Face(aShape);
- // bool faceIsForward = (FF.Orientation() == TopAbs_FORWARD);
- // TopoDS_Face F = TopoDS::Face(FF.Oriented(TopAbs_FORWARD));
- const TopoDS_Face & F = TopoDS::Face(aShape);
- bool faceIsForward = (F.Orientation() == TopAbs_FORWARD);
-
- // verify 1 wire only, with 4 edges, same number of points on opposite edges
-
- if (NumberOfWires(F) != 1)
- {
- MESSAGE("only 1 wire by face (quadrangles)");
- return 0;
- //throw SALOME_Exception(LOCALIZED("only 1 wire by face (quadrangles)"));
- }
- // const TopoDS_Wire WW = BRepTools::OuterWire(F);
- // TopoDS_Wire W = TopoDS::Wire(WW.Oriented(TopAbs_FORWARD));
- const TopoDS_Wire & W = BRepTools::OuterWire(F);
- BRepTools_WireExplorer wexp(W, F);
-
- FaceQuadStruct *quad = new FaceQuadStruct;
- for (int i = 0; i < 4; i++)
- quad->uv_edges[i] = 0;
- quad->uv_grid = 0;
-
- int nbEdges = 0;
- for (wexp.Init(W, F); wexp.More(); wexp.Next())
- {
- // const TopoDS_Edge& EE = wexp.Current();
- // TopoDS_Edge E = TopoDS::Edge(EE.Oriented(TopAbs_FORWARD));
- const TopoDS_Edge & E = wexp.Current();
- int nb = aMesh.GetSubMesh(E)->GetSubMeshDS()->NbNodes();
- if (nbEdges < 4)
- {
- quad->edge[nbEdges] = E;
- quad->nbPts[nbEdges] = nb + 2; // internal points + 2 extrema
- }
- nbEdges++;
- }
-
- if (nbEdges != 4)
- {
- MESSAGE("face must have 4 edges /quadrangles");
- QuadDelete(quad);
- return 0;
- //throw SALOME_Exception(LOCALIZED("face must have 4 edges /quadrangles"));
- }
-
- if (quad->nbPts[0] != quad->nbPts[2])
- {
- MESSAGE("different point number-opposed edge");
- QuadDelete(quad);
- return 0;
- //throw SALOME_Exception(LOCALIZED("different point number-opposed edge"));
- }
-
- if (quad->nbPts[1] != quad->nbPts[3])
- {
- MESSAGE("different point number-opposed edge");
- QuadDelete(quad);
- return 0;
- //throw SALOME_Exception(LOCALIZED("different point number-opposed edge"));
- }
-
- // set normalized grid on unit square in parametric domain
-
- SetNormalizedGrid(aMesh, F, quad);
-
- return quad;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-void SMESH_Quadrangle_2D::QuadDelete(FaceQuadStruct * quad)
-{
- //MESSAGE("SMESH_Quadrangle_2D::QuadDelete");
- if (quad)
- {
- for (int i = 0; i < 4; i++)
- {
- if (quad->uv_edges[i])
- delete[]quad->uv_edges[i];
- quad->edge[i].Nullify();
- }
- if (quad->uv_grid)
- delete[]quad->uv_grid;
- delete quad;
- }
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-void SMESH_Quadrangle_2D::SetNormalizedGrid(SMESH_Mesh & aMesh,
- const TopoDS_Shape & aShape, FaceQuadStruct * quad) throw(SALOME_Exception)
-{
- // Algorithme décrit dans "Génération automatique de maillages"
- // P.L. GEORGE, MASSON, § 6.4.1 p. 84-85
- // traitement dans le domaine paramétrique 2d u,v
- // transport - projection sur le carré unité
-
- const TopoDS_Face & F = TopoDS::Face(aShape);
-
- // 1 --- find orientation of the 4 edges, by test on extrema
-
- // max min 0 x1 1
- // |<----north-2-------^ a3 -------------> a2
- // | | ^1 1^
- // west-3 east-1 =right | |
- // | | ==> | |
- // y0 | | y1 | |
- // | | |0 0|
- // v----south-0--------> a0 -------------> a1
- // min max 0 x0 1
- // =down
- //
-
- Handle(Geom2d_Curve) c2d[4];
- gp_Pnt2d pf[4];
- gp_Pnt2d pl[4];
- for (int i = 0; i < 4; i++)
- {
- c2d[i] = BRep_Tool::CurveOnSurface(quad->edge[i],
- F, quad->first[i], quad->last[i]);
- pf[i] = c2d[i]->Value(quad->first[i]);
- pl[i] = c2d[i]->Value(quad->last[i]);
- quad->isEdgeForward[i] = false;
- }
-
- double eps2d = 1.e-3; // *** utiliser plutot TopExp::CommonVertex, puis
- // distances si piece fausse
- int i = 0;
- if ((pf[1].Distance(pl[0]) < eps2d) || (pl[1].Distance(pl[0]) < eps2d))
- {
- quad->isEdgeForward[0] = true;
- }
- else
- {
- double tmp = quad->first[0];
- quad->first[0] = quad->last[0];
- quad->last[0] = tmp;
- pf[0] = c2d[0]->Value(quad->first[0]);
- pl[0] = c2d[0]->Value(quad->last[0]);
- }
- for (int i = 1; i < 4; i++)
- {
- quad->isEdgeForward[i] = (pf[i].Distance(pl[i - 1]) < eps2d);
- if (!quad->isEdgeForward[i])
- {
- double tmp = quad->first[i];
- quad->first[i] = quad->last[i];
- quad->last[i] = tmp;
- pf[i] = c2d[i]->Value(quad->first[i]);
- pl[i] = c2d[i]->Value(quad->last[i]);
- //SCRUTE(pf[i].Distance(pl[i-1]));
- ASSERT(pf[i].Distance(pl[i - 1]) < eps2d);
- }
- }
- //SCRUTE(pf[0].Distance(pl[3]));
- ASSERT(pf[0].Distance(pl[3]) < eps2d);
-
-// for (int i=0; i<4; i++)
-// {
-// SCRUTE(quad->isEdgeForward[i]);
-// MESSAGE(" -first "<<i<<" "<<pf[i].X()<<" "<<pf[i].Y());
-// MESSAGE(" -last "<<i<<" "<<pl[i].X()<<" "<<pl[i].Y());
-// }
-
- // 2 --- load 2d edge points (u,v) with orientation and value on unit square
-
- for (int i = 0; i < 2; i++)
- {
- quad->uv_edges[i] = LoadEdgePoints(aMesh, F,
- quad->edge[i], quad->first[i], quad->last[i]);
-
- // quad->isEdgeForward[i]);
- }
- for (int i = 2; i < 4; i++)
- {
- quad->uv_edges[i] = LoadEdgePoints(aMesh, F,
- quad->edge[i], quad->last[i], quad->first[i]);
-
- // !quad->isEdgeForward[i]);
- }
-
- // 3 --- 2D normalized values on unit square [0..1][0..1]
-
- int nbdown = quad->nbPts[0];
- int nbright = quad->nbPts[1];
- quad->uv_grid = new UVPtStruct[nbright * nbdown];
-
- UVPtStruct *uv_grid = quad->uv_grid;
- UVPtStruct *uv_e0 = quad->uv_edges[0];
- UVPtStruct *uv_e1 = quad->uv_edges[1];
- UVPtStruct *uv_e2 = quad->uv_edges[2];
- UVPtStruct *uv_e3 = quad->uv_edges[3];
- gp_Pnt2d a0 = pf[0];
- gp_Pnt2d a1 = pf[1];
- gp_Pnt2d a2 = pf[2];
- gp_Pnt2d a3 = pf[3];
-
- // nodes Id on edges
-
- int j = 0;
- for (int i = 0; i < nbdown; i++)
- {
- int ij = j * nbdown + i;
- uv_grid[ij].node = uv_e0[i].node;
- }
- i = nbdown - 1;
- for (int j = 0; j < nbright; j++)
- {
- int ij = j * nbdown + i;
- uv_grid[ij].node = uv_e1[j].node;
- }
- j = nbright - 1;
- for (int i = 0; i < nbdown; i++)
- {
- int ij = j * nbdown + i;
- uv_grid[ij].node = uv_e2[i].node;
- }
- i = 0;
- for (int j = 0; j < nbright; j++)
- {
- int ij = j * nbdown + i;
- uv_grid[ij].node = uv_e3[j].node;
- }
-
- // normalized 2d values on grid
-
- for (int i = 0; i < nbdown; i++)
- for (int j = 0; j < nbright; j++)
- {
- int ij = j * nbdown + i;
- // --- droite i cste : x = x0 + y(x1-x0)
- double x0 = uv_e0[i].normParam; // bas - sud
- double x1 = uv_e2[i].normParam; // haut - nord
- // --- droite j cste : y = y0 + x(y1-y0)
- double y0 = uv_e3[j].normParam; // gauche-ouest
- double y1 = uv_e1[j].normParam; // droite - est
- // --- intersection : x=x0+(y0+x(y1-y0))(x1-x0)
- double x = (x0 + y0 * (x1 - x0)) / (1 - (y1 - y0) * (x1 - x0));
- double y = y0 + x * (y1 - y0);
- uv_grid[ij].x = x;
- uv_grid[ij].y = y;
- //MESSAGE("-xy-01 "<<x0<<" "<<x1<<" "<<y0<<" "<<y1);
- //MESSAGE("-xy-norm "<<i<<" "<<j<<" "<<x<<" "<<y);
- }
-
- // 4 --- projection on 2d domain (u,v)
-
- for (int i = 0; i < nbdown; i++)
- for (int j = 0; j < nbright; j++)
- {
- int ij = j * nbdown + i;
- double x = uv_grid[ij].x;
- double y = uv_grid[ij].y;
- double param_0 = uv_e0[0].param + x * (uv_e0[nbdown - 1].param - uv_e0[0].param); // sud
- double param_2 = uv_e2[0].param + x * (uv_e2[nbdown - 1].param - uv_e2[0].param); // nord
- double param_1 = uv_e1[0].param + y * (uv_e1[nbright - 1].param - uv_e1[0].param); // est
- double param_3 = uv_e3[0].param + y * (uv_e3[nbright - 1].param - uv_e3[0].param); // ouest
-
- //MESSAGE("params "<<param_0<<" "<<param_1<<" "<<param_2<<" "<<param_3);
- gp_Pnt2d p0 = c2d[0]->Value(param_0);
- gp_Pnt2d p1 = c2d[1]->Value(param_1);
- gp_Pnt2d p2 = c2d[2]->Value(param_2);
- gp_Pnt2d p3 = c2d[3]->Value(param_3);
-
- double u =
- (1 - y) * p0.X() + x * p1.X() + y * p2.X() + (1 - x) * p3.X();
- double v =
- (1 - y) * p0.Y() + x * p1.Y() + y * p2.Y() + (1 - x) * p3.Y();
-
- u -= (1 - x) * (1 - y) * a0.X() + x * (1 - y) * a1.X() +
- x * y * a2.X() + (1 - x) * y * a3.X();
- v -= (1 - x) * (1 - y) * a0.Y() + x * (1 - y) * a1.Y() +
- x * y * a2.Y() + (1 - x) * y * a3.Y();
-
- uv_grid[ij].u = u;
- uv_grid[ij].v = v;
-
- //MESSAGE("-uv- "<<i<<" "<<j<<" "<<uv_grid[ij].u<<" "<<uv_grid[ij].v);
- }
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-UVPtStruct *SMESH_Quadrangle_2D::LoadEdgePoints(SMESH_Mesh & aMesh,
- const TopoDS_Face & F, const TopoDS_Edge & E, double first, double last)
- // bool isForward)
-{
- //MESSAGE("SMESH_Quadrangle_2D::LoadEdgePoints");
-
- SMDS_Mesh * meshDS = aMesh.GetMeshDS();
-
- // --- IDNodes of first and last Vertex
-
- TopoDS_Vertex VFirst, VLast;
- TopExp::Vertices(E, VFirst, VLast); // corresponds to f and l
-
- ASSERT(!VFirst.IsNull());
- SMDS_Iterator<const SMDS_MeshNode *> * lid=
- aMesh.GetSubMesh(VFirst)->GetSubMeshDS()->GetNodes();
- const SMDS_MeshNode * idFirst = lid->next();
- delete lid;
-
- ASSERT(!VLast.IsNull());
- lid=aMesh.GetSubMesh(VLast)->GetSubMeshDS()->GetNodes();
- const SMDS_MeshNode * idLast = lid->next();
- delete lid;
-
- // --- edge internal IDNodes (relies on good order storage, not checked)
-
- int nbPoints = aMesh.GetSubMesh(E)->GetSubMeshDS()->NbNodes();
- //SCRUTE(nbPoints);
- UVPtStruct *uvslf = new UVPtStruct[nbPoints + 2];
-
- double f, l;
- Handle(Geom2d_Curve) C2d = BRep_Tool::CurveOnSurface(E, F, f, l);
-
- map<double, const SMDS_MeshNode *> params;
- SMDS_Iterator<const SMDS_MeshNode *> * ite=
- aMesh.GetSubMesh(E)->GetSubMeshDS()->GetNodes();
-
- while(ite->more())
- {
- const SMDS_MeshNode * node = ite->next();
- const SMDS_EdgePosition* epos
- = static_cast<const SMDS_EdgePosition*>(node->GetPosition());
- double param = epos->GetUParameter();
- params[param] = node;
- }
- delete ite;
-
- bool isForward = (((l - f) * (last - first)) > 0);
- double paramin = 0;
- double paramax = 0;
- if (isForward)
- {
- paramin = f;
- paramax = l;
- gp_Pnt2d p = C2d->Value(f); // first point = Vertex Forward
- uvslf[0].x = p.X();
- uvslf[0].y = p.Y();
- uvslf[0].param = f;
- uvslf[0].node = idFirst;
- //MESSAGE("__ f "<<f<<" "<<uvslf[0].x <<" "<<uvslf[0].y);
- map < double, const SMDS_MeshNode* >::iterator itp = params.begin();
- for (int i = 1; i <= nbPoints; i++) // nbPoints internal
- {
- double param = (*itp).first;
- gp_Pnt2d p = C2d->Value(param);
- uvslf[i].x = p.X();
- uvslf[i].y = p.Y();
- uvslf[i].param = param;
- uvslf[i].node = (*itp).second;
- //MESSAGE("__ "<<i<<" "<<param<<" "<<uvslf[i].x <<" "<<uvslf[i].y);
- itp++;
- }
- p = C2d->Value(l); // last point = Vertex Reversed
- uvslf[nbPoints + 1].x = p.X();
- uvslf[nbPoints + 1].y = p.Y();
- uvslf[nbPoints + 1].param = l;
- uvslf[nbPoints + 1].node = idLast;
- //MESSAGE("__ l "<<l<<" "<<uvslf[nbPoints+1].x <<" "<<uvslf[nbPoints+1].y);
- }
- else
- {
- paramin = l;
- paramax = f;
- gp_Pnt2d p = C2d->Value(l); // first point = Vertex Reversed
- uvslf[0].x = p.X();
- uvslf[0].y = p.Y();
- uvslf[0].param = l;
- uvslf[0].node = idLast;
- //MESSAGE("__ l "<<l<<" "<<uvslf[0].x <<" "<<uvslf[0].y);
- map < double, const SMDS_MeshNode* >::reverse_iterator itp = params.rbegin();
- for (int j = nbPoints; j >= 1; j--) // nbPoints internal
- {
- double param = (*itp).first;
- int i = nbPoints + 1 - j;
- gp_Pnt2d p = C2d->Value(param);
- uvslf[i].x = p.X();
- uvslf[i].y = p.Y();
- uvslf[i].param = param;
- uvslf[i].node = (*itp).second;
- //MESSAGE("__ "<<i<<" "<<param<<" "<<uvslf[i].x <<" "<<uvslf[i].y);
- itp++;
- }
- p = C2d->Value(f); // last point = Vertex Forward
- uvslf[nbPoints + 1].x = p.X();
- uvslf[nbPoints + 1].y = p.Y();
- uvslf[nbPoints + 1].param = f;
- uvslf[nbPoints + 1].node = idFirst;
- //MESSAGE("__ f "<<f<<" "<<uvslf[nbPoints+1].x <<" "<<uvslf[nbPoints+1].y);
- }
-
- ASSERT(paramin != paramax);
- for (int i = 0; i < nbPoints + 2; i++)
- {
- uvslf[i].normParam = (uvslf[i].param - paramin) / (paramax - paramin);
- //SCRUTE(uvslf[i].normParam);
- }
-
- return uvslf;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-ostream & SMESH_Quadrangle_2D::SaveTo(ostream & save)
-{
- return save << this;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-istream & SMESH_Quadrangle_2D::LoadFrom(istream & load)
-{
- return load >> (*this);
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-ostream & operator <<(ostream & save, SMESH_Quadrangle_2D & hyp)
-{
- return save;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-istream & operator >>(istream & load, SMESH_Quadrangle_2D & hyp)
-{
- return load;
-}
+++ /dev/null
-// SMESH SMESH : implementaion of SMESH idl descriptions
-//
-// Copyright (C) 2003 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.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SMESH_Quadrangle_2D.hxx
-// Author : Paul RASCLE, EDF
-// Module : SMESH
-// $Header$
-
-#ifndef _SMESH_QUADRANGLE_2D_HXX_
-#define _SMESH_QUADRANGLE_2D_HXX_
-
-#include "SMESH_2D_Algo.hxx"
-#include "SMESH_Mesh.hxx"
-#include "Utils_SALOME_Exception.hxx"
-
-typedef struct uvPtStruct
-{
- double param;
- double normParam;
- double u; // original 2d parameter
- double v;
- double x; // 2d parameter, normalized [0,1]
- double y;
- const SMDS_MeshNode * node;
-} UVPtStruct;
-
-typedef struct faceQuadStruct
-{
- int nbPts[4];
- TopoDS_Edge edge[4];
- double first[4];
- double last[4];
- bool isEdgeForward[4];
- UVPtStruct* uv_edges[4];
- UVPtStruct* uv_grid;
-} FaceQuadStruct;
-
-class SMESH_Quadrangle_2D:
- public SMESH_2D_Algo
-{
-public:
- SMESH_Quadrangle_2D(int hypId, int studyId, SMESH_Gen* gen);
- virtual ~SMESH_Quadrangle_2D();
-
- virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape);
-
- virtual bool Compute(SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape)
- throw (SALOME_Exception);
-
- FaceQuadStruct* CheckAnd2Dcompute(SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape)
- throw (SALOME_Exception);
-
- void QuadDelete(FaceQuadStruct* quad);
-
- ostream & SaveTo(ostream & save);
- istream & LoadFrom(istream & load);
- friend ostream & operator << (ostream & save, SMESH_Quadrangle_2D & hyp);
- friend istream & operator >> (istream & load, SMESH_Quadrangle_2D & hyp);
-
-protected:
-
- void SetNormalizedGrid(SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape,
- FaceQuadStruct* quad)
- throw (SALOME_Exception);
-
- UVPtStruct* LoadEdgePoints(SMESH_Mesh& aMesh,
- const TopoDS_Face& F,
- const TopoDS_Edge& E,
- double first,
- double last);
-// bool isForward);
-
-// FaceQuadStruct _quadDesc;
-};
-
-#endif
+++ /dev/null
-// SMESH SMESH : implementaion of SMESH idl descriptions
-//
-// Copyright (C) 2003 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.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SMESH_Regular_1D.cxx
-// Author : Paul RASCLE, EDF
-// Module : SMESH
-// $Header$
-
-using namespace std;
-
-#include "SMESH_Regular_1D.hxx"
-#include "SMESH_Gen.hxx"
-#include "SMESH_Mesh.hxx"
-
-#include "SMESH_LocalLength.hxx"
-#include "SMESH_NumberOfSegments.hxx"
-
-#include "SMDS_MeshElement.hxx"
-#include "SMDS_MeshNode.hxx"
-#include "SMDS_EdgePosition.hxx"
-
-#include "utilities.h"
-
-#include <TopoDS_Edge.hxx>
-#include <TopoDS_Shape.hxx>
-#include <GeomAdaptor_Curve.hxx>
-#include <BRep_Tool.hxx>
-#include <GCPnts_AbscissaPoint.hxx>
-#include <GCPnts_UniformAbscissa.hxx>
-
-#include <string>
-#include <algorithm>
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-SMESH_Regular_1D::SMESH_Regular_1D(int hypId, int studyId,
- SMESH_Gen * gen):SMESH_1D_Algo(hypId, studyId, gen)
-{
- MESSAGE("SMESH_Regular_1D::SMESH_Regular_1D");
- _name = "Regular_1D";
- // _shapeType = TopAbs_EDGE;
- _shapeType = (1 << TopAbs_EDGE);
- _compatibleHypothesis.push_back("LocalLength");
- _compatibleHypothesis.push_back("NumberOfSegments");
-
- _localLength = 0;
- _numberOfSegments = 0;
- _hypLocalLength = NULL;
- _hypNumberOfSegments = NULL;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-SMESH_Regular_1D::~SMESH_Regular_1D()
-{
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-ostream & SMESH_Regular_1D::SaveTo(ostream & save)
-{
- return save << this;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-istream & SMESH_Regular_1D::LoadFrom(istream & load)
-{
- return load >> (*this);
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-ostream & operator <<(ostream & save, SMESH_Regular_1D & hyp)
-{
- return save;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-istream & operator >>(istream & load, SMESH_Regular_1D & hyp)
-{
- return load;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-bool SMESH_Regular_1D::CheckHypothesis(SMESH_Mesh & aMesh,
- const TopoDS_Shape & aShape)
-{
- //MESSAGE("SMESH_Regular_1D::CheckHypothesis");
-
- list <const SMESHDS_Hypothesis * >::const_iterator itl;
- const SMESHDS_Hypothesis *theHyp;
-
- const list <const SMESHDS_Hypothesis * >&hyps = GetUsedHypothesis(aMesh, aShape);
- int nbHyp = hyps.size();
- if (nbHyp != 1) return false; // only one compatible hypothesis allowed
-
- itl = hyps.begin();
- theHyp = (*itl);
-
- string hypName = theHyp->GetName();
- int hypId = theHyp->GetID();
- //SCRUTE(hypName);
-
- bool isOk = false;
-
- if (hypName == "LocalLength")
- {
- _hypLocalLength = dynamic_cast <const SMESH_LocalLength * >(theHyp);
- ASSERT(_hypLocalLength);
- _localLength = _hypLocalLength->GetLength();
- _numberOfSegments = 0;
- isOk = true;
- }
-
- if (hypName == "NumberOfSegments")
- {
- _hypNumberOfSegments =
- dynamic_cast <const SMESH_NumberOfSegments * >(theHyp);
- ASSERT(_hypNumberOfSegments);
- _numberOfSegments = _hypNumberOfSegments->GetNumberOfSegments();
- _scaleFactor = _hypNumberOfSegments->GetScaleFactor();
- _localLength = 0;
- isOk = true;
- }
-
- //SCRUTE(_localLength);
- //SCRUTE(_numberOfSegments);
-
- return isOk;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-bool SMESH_Regular_1D::Compute(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape)
-{
- MESSAGE("SMESH_Regular_1D::Compute");
-
- SMESHDS_Mesh * meshDS = aMesh.GetMeshDS();
- SMESH_subMesh *theSubMesh = aMesh.GetSubMesh(aShape);
-
- const TopoDS_Edge & EE = TopoDS::Edge(aShape);
- TopoDS_Edge E = TopoDS::Edge(EE.Oriented(TopAbs_FORWARD));
-
- double f, l;
- Handle(Geom_Curve) Curve = BRep_Tool::Curve(E, f, l);
-
- TopoDS_Vertex VFirst, VLast;
- TopExp::Vertices(E, VFirst, VLast); // Vfirst corresponds to f and Vlast to l
-
- double length = EdgeLength(E);
- //SCRUTE(length);
-
- double eltSize = 1;
-// if (_localLength > 0) eltSize = _localLength;
- if (_localLength > 0)
- {
- double nbseg = ceil(length / _localLength); // integer sup
- if (nbseg <= 0)
- nbseg = 1; // degenerated edge
- eltSize = length / nbseg;
- }
- else
- {
- ASSERT(_numberOfSegments > 0);
- eltSize = length / _numberOfSegments;
- }
-
- ASSERT(!VFirst.IsNull());
- SMDS_Iterator<const SMDS_MeshNode *> * lid=
- aMesh.GetSubMesh(VFirst)->GetSubMeshDS()->GetNodes();
- const SMDS_MeshNode * idFirst = lid->next();
- delete lid;
-
- ASSERT(!VLast.IsNull());
- lid=aMesh.GetSubMesh(VLast)->GetSubMeshDS()->GetNodes();
- const SMDS_MeshNode * idLast = lid->next();
- delete lid;
-
- if (!Curve.IsNull())
- {
- GeomAdaptor_Curve C3d(Curve);
- GCPnts_UniformAbscissa Discret(C3d, eltSize, f, l);
- int NbPoints = Discret.NbPoints();
- //MESSAGE("nb points on edge : "<<NbPoints);
-
- // edge extrema (indexes : 1 & NbPoints) already in SMDS (TopoDS_Vertex)
- // only internal nodes receive an edge position with param on curve
-
- const SMDS_MeshNode * idPrev = idFirst;
- for (int i = 2; i < NbPoints; i++)
- {
- double param = Discret.Parameter(i);
-
- if (_numberOfSegments > 1)
- {
- double epsilon = 0.001;
- if (fabs(_scaleFactor - 1.0) > epsilon)
- {
- double alpha =
- pow(_scaleFactor, 1.0 / (_numberOfSegments - 1));
- double d =
- length * (1 - pow(alpha, i - 1)) / (1 - pow(alpha,
- _numberOfSegments));
- param = d;
- }
- }
-
- gp_Pnt P = Curve->Value(param);
-
- //Add the Node in the DataStructure
- //MESSAGE("point "<<nodeId<<" "<<P.X()<<" "<<P.Y()<<" "<<P.Z()<<" - "<<i<<" "<<param);
- SMDS_MeshNode * node = meshDS->AddNode(P.X(), P.Y(), P.Z());
- meshDS->SetNodeOnEdge(node, E);
-
- // **** edgePosition associe au point = param.
- SMDS_EdgePosition* epos=dynamic_cast<SMDS_EdgePosition *>(node->GetPosition());
- epos->SetUParameter(param);
-
- SMDS_MeshEdge * edge = meshDS->AddEdge(idPrev, node);
- meshDS->SetMeshElementOnShape(edge, E);
- idPrev = node;
- }
- SMDS_MeshEdge* edge = meshDS->AddEdge(idPrev, idLast);
- meshDS->SetMeshElementOnShape(edge, E);
- }
- else
- {
-// MESSAGE ("Edge Degeneree non traitee --- arret");
-// ASSERT(0);
- if (BRep_Tool::Degenerated(E))
- {
- // Edge is a degenerated Edge : We put n = 5 points on the edge.
- int NbPoints = 5;
- BRep_Tool::Range(E, f, l);
- double du = (l - f) / (NbPoints - 1);
- MESSAGE("************* Degenerated edge! *****************");
-
- TopoDS_Vertex V1, V2;
- TopExp::Vertices(E, V1, V2);
- gp_Pnt P = BRep_Tool::Pnt(V1);
-
- const SMDS_MeshNode * idPrev = idFirst;
- for (int i = 2; i < NbPoints; i++)
- {
- double param = f + (i - 1) * du;
- SMDS_MeshNode * node = meshDS->AddNode(P.X(), P.Y(), P.Z());
- meshDS->SetNodeOnEdge(node, E);
-
-// Handle (SMDS_EdgePosition) epos
-// = new SMDS_EdgePosition(theSubMesh->GetId(),param);
-// node->SetPosition(epos);
- SMDS_EdgePosition* epos
- = dynamic_cast<SMDS_EdgePosition*>(node->GetPosition());
- epos->SetUParameter(param);
-
- SMDS_MeshEdge * edge = meshDS->AddEdge(idPrev, node);
- meshDS->SetMeshElementOnShape(edge, E);
- idPrev = node;
- }
- SMDS_MeshEdge * edge = meshDS->AddEdge(idPrev, idLast);
- meshDS->SetMeshElementOnShape(edge, E);
- }
- else
- ASSERT(0);
- }
- return true;
-}
+++ /dev/null
-// SMESH SMESH : implementaion of SMESH idl descriptions
-//
-// Copyright (C) 2003 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.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SMESH_Regular_1D.hxx
-// Author : Paul RASCLE, EDF
-// Module : SMESH
-// $Header$
-
-#ifndef _SMESH_REGULAR_1D_HXX_
-#define _SMESH_REGULAR_1D_HXX_
-
-#include "SMESH_1D_Algo.hxx"
-
-class SMESH_LocalLength;
-class SMESH_NumberOfSegments;
-
-class SMESH_Regular_1D:
- public SMESH_1D_Algo
-{
-public:
- SMESH_Regular_1D(int hypId, int studyId, SMESH_Gen* gen);
- virtual ~SMESH_Regular_1D();
-
- virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape);
-
- virtual bool Compute(SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape);
-
- ostream & SaveTo(ostream & save);
- istream & LoadFrom(istream & load);
- friend ostream & operator << (ostream & save, SMESH_Regular_1D & hyp);
- friend istream & operator >> (istream & load, SMESH_Regular_1D & hyp);
-
-protected:
- double _localLength;
- int _numberOfSegments;
- double _scaleFactor;
- const SMESH_LocalLength* _hypLocalLength;
- const SMESH_NumberOfSegments* _hypNumberOfSegments;
-};
-
-#endif
+++ /dev/null
-// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
-//
-// Copyright (C) 2003 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.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SMESH_Hexa_3D_i.cxx
-// Author : Paul RASCLE, EDF
-// Module : SMESH
-// $Header$
-
-using namespace std;
-using namespace std;
-#include "SMESH_Hexa_3D_i.hxx"
-#include "SMESH_Gen.hxx"
-#include "SMESH_HypothesisFactory.hxx"
-
-#include "Utils_CorbaException.hxx"
-#include "utilities.h"
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-SMESH_Hexa_3D_i::SMESH_Hexa_3D_i(const char* anHyp,
- int studyId,
- ::SMESH_Gen* genImpl)
-{
- MESSAGE("SMESH_Hexa_3D_i::SMESH_Hexa_3D_i");
- _genImpl = genImpl;
- ::SMESH_Hexa_3D* impl
- = new ::SMESH_Hexa_3D(_genImpl->_hypothesisFactory.GetANewId(),
- studyId,
- genImpl);
- SetImpl(impl);
- _baseImpl = _impl;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-SMESH_Hexa_3D_i::~SMESH_Hexa_3D_i()
-{
- MESSAGE("SMESH_Hexa_3D_i::~SMESH_Hexa_3D_i");
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-void SMESH_Hexa_3D_i::SetImpl(::SMESH_Hexa_3D* impl)
-{
- MESSAGE("SMESH_Hexa_3D_i::SetImpl");
- SMESH_3D_Algo_i::SetImpl(impl);
- _impl = impl;
-}
+++ /dev/null
-// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
-//
-// Copyright (C) 2003 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.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SMESH_Hexa_3D_i.hxx
-// Author : Paul RASCLE, EDF
-// Module : SMESH
-// $Header$
-
-#ifndef _SMESH_HEXA_3D_I_HXX_
-#define _SMESH_HEXA_3D_I_HXX_
-
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SMESH_BasicHypothesis)
-
-#include "SMESH_3D_Algo_i.hxx"
-
-#include "SMESH_Hexa_3D.hxx"
-
-class SMESH_Hexa_3D_i:
- public POA_SMESH::SMESH_Hexa_3D,
- public SMESH_3D_Algo_i
-{
-public:
- SMESH_Hexa_3D_i(const char* anHyp,
- int studyId,
- ::SMESH_Gen* genImpl);
-
- virtual ~SMESH_Hexa_3D_i();
-
-protected:
- virtual void SetImpl(::SMESH_Hexa_3D* impl);
-
- ::SMESH_Hexa_3D* _impl;
-};
-
-#endif
+++ /dev/null
-// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
-//
-// Copyright (C) 2003 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.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SMESH_HypothesisFactory_i.cxx
-// Author : Paul RASCLE, EDF
-// Module : SMESH
-// $Header$
-
-using namespace std;
-#include "SMESH_HypothesisFactory_i.hxx"
-#include "SMESH_Hypothesis_i.hxx"
-
-#include "Utils_CorbaException.hxx"
-#include "utilities.h"
-
-// Add new hypothesis here (include file)
-//---------------------------------------
-#include "SMESH_LocalLength_i.hxx"
-#include "SMESH_NumberOfSegments_i.hxx"
-#include "SMESH_LengthFromEdges_i.hxx"
-#include "SMESH_MaxElementArea_i.hxx"
-#include "SMESH_MaxElementVolume_i.hxx"
-#include "SMESH_Regular_1D_i.hxx"
-#include "SMESH_MEFISTO_2D_i.hxx"
-#include "SMESH_Quadrangle_2D_i.hxx"
-#include "SMESH_Hexa_3D_i.hxx"
-#ifdef HAVE_NETGEN
-#include "SMESH_NETGEN_3D_i.hxx"
-#endif
-//---------------------------------------
-
-//=============================================================================
-/*!
- * Specific Hypothesis Creators are generated with a template which inherits a
- * generic hypothesis creator. Each creator returns an hypothesis of the type
- * given in the template.
- */
-//=============================================================================
-
-template <class T> class HypothesisCreator_i: public GenericHypothesisCreator_i
-{
-public:
- virtual SMESH_Hypothesis_i* Create (const char* anHyp,
- int studyId,
- ::SMESH_Gen* genImpl)
- {
- return new T(anHyp, studyId, genImpl);
- };
-};
-
-//=============================================================================
-/*!
- * Constructor: instanciate specific hypothesis creators, fill a private map
- * indexed by hypothesis names. THIS METHOD MUST BE COMPLETED WHEN A NEW
- * HYPOTHESIS IS ADDED.
- * Specific hypothesis creator are defined with the above template.
- * Hypothesis names are related to the corresponding class names:
- * prefix = SMESH_ ; suffix = _i .
- */
-//=============================================================================
-
-SMESH_HypothesisFactory_i::SMESH_HypothesisFactory_i()
-{
-// Add new hypothesis here (creators)
-//---------------------------------------
-_creatorMap["LocalLength"] = new HypothesisCreator_i<SMESH_LocalLength_i>;
-_creatorMap["NumberOfSegments"] = new HypothesisCreator_i<SMESH_NumberOfSegments_i>;
-_creatorMap["LengthFromEdges"] = new HypothesisCreator_i<SMESH_LengthFromEdges_i>;
-_creatorMap["MaxElementArea"] = new HypothesisCreator_i<SMESH_MaxElementArea_i>;
-_creatorMap["MaxElementVolume"] = new HypothesisCreator_i<SMESH_MaxElementVolume_i>;
-_creatorMap["Regular_1D"] = new HypothesisCreator_i<SMESH_Regular_1D_i>;
-_creatorMap["MEFISTO_2D"] = new HypothesisCreator_i<SMESH_MEFISTO_2D_i>;
-_creatorMap["Quadrangle_2D"] = new HypothesisCreator_i<SMESH_Quadrangle_2D_i>;
-_creatorMap["Hexa_3D"] = new HypothesisCreator_i<SMESH_Hexa_3D_i>;
-#ifdef HAVE_NETGEN
-_creatorMap["NETGEN_3D"] = new HypothesisCreator_i<SMESH_NETGEN_3D_i>;
-#endif
-//---------------------------------------
-}
-
-//=============================================================================
-/*!
- * Destructor: deletes specific hypothesis creators instanciated in the
- * constructor.
- */
-//=============================================================================
-
-SMESH_HypothesisFactory_i::~SMESH_HypothesisFactory_i()
-{
- map<string, GenericHypothesisCreator_i*>::iterator it;
- for (it = _creatorMap.begin(); it != _creatorMap.end(); it++)
- {
- delete (*it).second;
- }
- _creatorMap.clear();
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-SMESH_Hypothesis_i* SMESH_HypothesisFactory_i::Create(const char* anHyp,
- CORBA::Long studyId,
- ::SMESH_Gen* genImpl)
- throw (SALOME::SALOME_Exception)
-{
- MESSAGE("SMESH_HypothesisFactory::Create " << anHyp);
- if (_creatorMap.find(anHyp) == _creatorMap.end())
- {
- MESSAGE("levee exception CORBA");
- THROW_SALOME_CORBA_EXCEPTION("bad hypothesis type name", \
- SALOME::BAD_PARAM);
- }
- SMESH_Hypothesis_i* myHyp = _creatorMap[anHyp]->Create(anHyp,
- studyId,
- genImpl);
- return myHyp;
-}
-
-
+++ /dev/null
-// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
-//
-// Copyright (C) 2003 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.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SMESH_HypothesisFactory_i.hxx
-// Author : Paul RASCLE, EDF
-// Module : SMESH
-// $Header$
-
-#ifndef _SMESH_HYPOTHESISFACTORY_I_HXX_
-#define _SMESH_HYPOTHESISFACTORY_I_HXX_
-
-#include "SMESH_Hypothesis_i.hxx"
-#include <map>
-#include <string>
-
-class GenericHypothesisCreator_i
-{
-public:
- virtual SMESH_Hypothesis_i* Create(const char* anHyp,
- int studyId,
- ::SMESH_Gen* genImpl) = 0;
-};
-
-class SMESH_HypothesisFactory_i
-{
-public:
- SMESH_HypothesisFactory_i();
- virtual ~SMESH_HypothesisFactory_i();
-
- SMESH_Hypothesis_i* Create(const char* anHyp,
- CORBA::Long studyId,
- ::SMESH_Gen* genImpl)
- throw (SALOME::SALOME_Exception);
-
-private:
- map<string, GenericHypothesisCreator_i*> _creatorMap;
-};
-
-#endif
+++ /dev/null
-// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
-//
-// Copyright (C) 2003 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.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SMESH_LengthFromEdges_i.cxx
-// Author : Nadir BOUHAMOU CEA/DEN, Paul RASCLE, EDF
-// Module : SMESH
-// $Header$
-
-using namespace std;
-using namespace std;
-#include "SMESH_LengthFromEdges_i.hxx"
-#include "SMESH_Gen.hxx"
-#include "SMESH_HypothesisFactory.hxx"
-
-#include "Utils_CorbaException.hxx"
-#include "utilities.h"
-
-//=============================================================================
-/*!
- * Constructor:
- * _name is related to the class name: prefix = SMESH_ ; suffix = _i .
- */
-//=============================================================================
-
-SMESH_LengthFromEdges_i::SMESH_LengthFromEdges_i(const char* anHyp,
- int studyId,
- ::SMESH_Gen* genImpl)
-{
- MESSAGE("SMESH_LengthFromEdges_i::SMESH_LengthFromEdges_i");
- _impl = new ::SMESH_LengthFromEdges(genImpl->_hypothesisFactory.GetANewId(),
- studyId,
- genImpl);
- _baseImpl = _impl;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-SMESH_LengthFromEdges_i::~SMESH_LengthFromEdges_i()
-{
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-void SMESH_LengthFromEdges_i::SetMode(CORBA::Long mode)
- throw (SALOME::SALOME_Exception)
-{
- ASSERT(_impl);
- try
- {
- _impl->SetMode(mode);
- }
- catch (SALOME_Exception& S_ex)
- {
- THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), \
- SALOME::BAD_PARAM);
- }
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-CORBA::Long SMESH_LengthFromEdges_i::GetMode()
-{
- ASSERT(_impl);
- return _impl->GetMode();
-}
-
+++ /dev/null
-// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
-//
-// Copyright (C) 2003 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.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SMESH_LengthFromEdges_i.hxx
-// Author : Nadir BOUHAMOU CEA/DEN, Paul RASCLE, EDF
-// Module : SMESH
-// $Header$
-
-#ifndef _SMESH_LENGTHFROMEDGES_I_HXX_
-#define _SMESH_LENGTHFROMEDGES_I_HXX_
-
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SMESH_BasicHypothesis)
-
-#include "SMESH_Hypothesis_i.hxx"
-
-#include "SMESH_LengthFromEdges.hxx"
-
-class SMESH_LengthFromEdges_i:
- public POA_SMESH::SMESH_LengthFromEdges,
- public SMESH_Hypothesis_i
-{
-public:
- SMESH_LengthFromEdges_i(const char* anHyp,
- int studyId,
- ::SMESH_Gen* genImpl);
- virtual ~SMESH_LengthFromEdges_i();
-
- void SetMode(CORBA::Long mode)
- throw (SALOME::SALOME_Exception);
-
- CORBA::Long GetMode();
-
-protected:
- ::SMESH_LengthFromEdges* _impl;
-};
-
-#endif
-
+++ /dev/null
-// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
-//
-// Copyright (C) 2003 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.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SMESH_LocalLength_i.cxx
-// Author : Paul RASCLE, EDF
-// Module : SMESH
-// $Header$
-
-using namespace std;
-using namespace std;
-#include "SMESH_LocalLength_i.hxx"
-#include "SMESH_Gen.hxx"
-#include "SMESH_HypothesisFactory.hxx"
-
-#include "Utils_CorbaException.hxx"
-#include "utilities.h"
-
-//=============================================================================
-/*!
- * Constructor:
- * _name is related to the class name: prefix = SMESH_ ; suffix = _i .
- */
-//=============================================================================
-
-SMESH_LocalLength_i::SMESH_LocalLength_i(const char* anHyp,
- int studyId,
- ::SMESH_Gen* genImpl)
-{
- MESSAGE("SMESH_LocalLength_i::SMESH_LocalLength_i");
- _impl = new ::SMESH_LocalLength(genImpl->_hypothesisFactory.GetANewId(),
- studyId,
- genImpl);
- _baseImpl = _impl;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-SMESH_LocalLength_i::~SMESH_LocalLength_i()
-{
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-void SMESH_LocalLength_i::SetLength(CORBA::Double length)
- throw (SALOME::SALOME_Exception)
-{
- ASSERT(_impl);
- try
- {
- _impl->SetLength(length);
- }
- catch (SALOME_Exception& S_ex)
- {
- THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), \
- SALOME::BAD_PARAM);
- }
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-CORBA::Double SMESH_LocalLength_i::GetLength()
-{
- ASSERT(_impl);
- return _impl->GetLength();
-}
-
+++ /dev/null
-// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
-//
-// Copyright (C) 2003 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.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SMESH_LocalLength_i.hxx
-// Author : Paul RASCLE, EDF
-// Module : SMESH
-// $Header$
-
-#ifndef _SMESH_LOCALLENGTH_I_HXX_
-#define _SMESH_LOCALLENGTH_I_HXX_
-
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SMESH_BasicHypothesis)
-
-#include "SMESH_Hypothesis_i.hxx"
-
-#include "SMESH_LocalLength.hxx"
-
-class SMESH_LocalLength_i:
- public POA_SMESH::SMESH_LocalLength,
- public SMESH_Hypothesis_i
-{
-public:
- SMESH_LocalLength_i(const char* anHyp,
- int studyId,
- ::SMESH_Gen* genImpl);
- virtual ~SMESH_LocalLength_i();
-
- void SetLength(CORBA::Double length)
- throw (SALOME::SALOME_Exception);
-
- CORBA::Double GetLength();
-
-protected:
- ::SMESH_LocalLength* _impl;
-};
-
-#endif
-
+++ /dev/null
-// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
-//
-// Copyright (C) 2003 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.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SMESH_MEFISTO_2D_i.cxx
-// Author : Paul RASCLE, EDF
-// Module : SMESH
-// $Header$
-
-using namespace std;
-using namespace std;
-#include "SMESH_MEFISTO_2D_i.hxx"
-#include "SMESH_Gen.hxx"
-#include "SMESH_HypothesisFactory.hxx"
-
-#include "Utils_CorbaException.hxx"
-#include "utilities.h"
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-SMESH_MEFISTO_2D_i::SMESH_MEFISTO_2D_i(const char* anHyp,
- int studyId,
- ::SMESH_Gen* genImpl)
-{
- MESSAGE("SMESH_MEFISTO_2D_i::SMESH_MEFISTO_2D_i");
- _genImpl = genImpl;
- ::SMESH_MEFISTO_2D* impl
- = new ::SMESH_MEFISTO_2D(_genImpl->_hypothesisFactory.GetANewId(),
- studyId,
- genImpl);
- SetImpl(impl);
- _baseImpl = _impl;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-SMESH_MEFISTO_2D_i::~SMESH_MEFISTO_2D_i()
-{
- MESSAGE("SMESH_MEFISTO_2D_i::~SMESH_MEFISTO_2D_i");
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-void SMESH_MEFISTO_2D_i::SetImpl(::SMESH_MEFISTO_2D* impl)
-{
- MESSAGE("SMESH_MEFISTO_2D_i::SetImpl");
- SMESH_2D_Algo_i::SetImpl(impl);
- _impl = impl;
-}
+++ /dev/null
-// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
-//
-// Copyright (C) 2003 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.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SMESH_MEFISTO_2D_i.hxx
-// Author : Paul RASCLE, EDF
-// Module : SMESH
-// $Header$
-
-#ifndef _SMESH_MEFISTO_2D_I_HXX_
-#define _SMESH_MEFISTO_2D_I_HXX_
-
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SMESH_BasicHypothesis)
-
-#include "SMESH_2D_Algo_i.hxx"
-
-#include "SMESH_MEFISTO_2D.hxx"
-
-class SMESH_MEFISTO_2D_i:
- public POA_SMESH::SMESH_MEFISTO_2D,
- public SMESH_2D_Algo_i
-{
-public:
- SMESH_MEFISTO_2D_i(const char* anHyp,
- int studyId,
- ::SMESH_Gen* genImpl);
-
- virtual ~SMESH_MEFISTO_2D_i();
-
-protected:
- virtual void SetImpl(::SMESH_MEFISTO_2D* impl);
-
- ::SMESH_MEFISTO_2D* _impl;
-};
-
-#endif
+++ /dev/null
-// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
-//
-// Copyright (C) 2003 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.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SMESH_MaxElementArea_i.cxx
-// Author : Paul RASCLE, EDF
-// Module : SMESH
-// $Header$
-
-using namespace std;
-using namespace std;
-#include "SMESH_MaxElementArea_i.hxx"
-#include "SMESH_Gen.hxx"
-#include "SMESH_HypothesisFactory.hxx"
-
-#include "Utils_CorbaException.hxx"
-#include "utilities.h"
-
-//=============================================================================
-/*!
- * Constructor:
- * _name is related to the class name: prefix = SMESH_ ; suffix = _i .
- */
-//=============================================================================
-
-SMESH_MaxElementArea_i::SMESH_MaxElementArea_i(const char* anHyp,
- int studyId,
- ::SMESH_Gen* genImpl)
-{
- MESSAGE("SMESH_MaxElementArea_i::SMESH_MaxElementArea_i");
- _impl = new ::SMESH_MaxElementArea(genImpl->_hypothesisFactory.GetANewId(),
- studyId,
- genImpl);
- _baseImpl = _impl;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-SMESH_MaxElementArea_i::~SMESH_MaxElementArea_i()
-{
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-void SMESH_MaxElementArea_i::SetMaxElementArea(CORBA::Double area)
- throw (SALOME::SALOME_Exception)
-{
- ASSERT(_impl);
- try
- {
- _impl->SetMaxArea(area);
- }
- catch (SALOME_Exception& S_ex)
- {
- THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), \
- SALOME::BAD_PARAM);
- }
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-CORBA::Double SMESH_MaxElementArea_i::GetMaxElementArea()
-{
- ASSERT(_impl);
- return _impl->GetMaxArea();
-}
-
+++ /dev/null
-// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
-//
-// Copyright (C) 2003 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.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SMESH_MaxElementArea_i.hxx
-// Author : Paul RASCLE, EDF
-// Module : SMESH
-// $Header$
-
-#ifndef _SMESH_MAXELEMENTAREA_I_HXX_
-#define _SMESH_MAXELEMENTAREA_I_HXX_
-
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SMESH_BasicHypothesis)
-
-#include "SMESH_Hypothesis_i.hxx"
-
-#include "SMESH_MaxElementArea.hxx"
-
-class SMESH_MaxElementArea_i:
- public POA_SMESH::SMESH_MaxElementArea,
- public SMESH_Hypothesis_i
-{
-public:
- SMESH_MaxElementArea_i(const char* anHyp,
- int studyId,
- ::SMESH_Gen* genImpl);
- virtual ~SMESH_MaxElementArea_i();
-
- void SetMaxElementArea(CORBA::Double area)
- throw (SALOME::SALOME_Exception);
-
- CORBA::Double GetMaxElementArea();
-
-protected:
- ::SMESH_MaxElementArea* _impl;
-};
-
-#endif
+++ /dev/null
-// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
-//
-// Copyright (C) 2003 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.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SMESH_MaxElementVolume_i.cxx
-// Author : Paul RASCLE, EDF
-// Module : SMESH
-// $Header$
-
-using namespace std;
-
-#include "SMESH_MaxElementVolume_i.hxx"
-#include "SMESH_Gen.hxx"
-#include "SMESH_HypothesisFactory.hxx"
-
-#include "Utils_CorbaException.hxx"
-#include "utilities.h"
-
-//=============================================================================
-/*!
- * Constructor:
- * _name is related to the class name: prefix = SMESH_ ; suffix = _i .
- */
-//=============================================================================
-
-SMESH_MaxElementVolume_i::SMESH_MaxElementVolume_i(const char* anHyp,
- int studyId,
- ::SMESH_Gen* genImpl)
-{
- MESSAGE("SMESH_MaxElementVolume_i::SMESH_MaxElementVolume_i");
- _impl = new ::SMESH_MaxElementVolume(genImpl->_hypothesisFactory.GetANewId(),
- studyId,
- genImpl);
- _baseImpl = _impl;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-SMESH_MaxElementVolume_i::~SMESH_MaxElementVolume_i()
-{
- MESSAGE("SMESH_MaxElementVolume_i::~SMESH_MaxElementVolume_i()");
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-void SMESH_MaxElementVolume_i::SetMaxElementVolume(CORBA::Double volume)
- throw (SALOME::SALOME_Exception)
-{
- ASSERT(_impl);
- try
- {
- _impl->SetMaxVolume(volume);
- }
- catch (SALOME_Exception& S_ex)
- {
- THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), \
- SALOME::BAD_PARAM);
- }
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-CORBA::Double SMESH_MaxElementVolume_i::GetMaxElementVolume()
-{
- ASSERT(_impl);
- return _impl->GetMaxVolume();
-}
-
+++ /dev/null
-// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
-//
-// Copyright (C) 2003 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.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SMESH_MaxElementVolume_i.hxx
-// Author : Paul RASCLE, EDF
-// Module : SMESH
-// $Header$
-
-#ifndef _SMESH_MAXELEMENTVOLUME_I_HXX_
-#define _SMESH_MAXELEMENTVOLUME_I_HXX_
-
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SMESH_BasicHypothesis)
-
-#include "SMESH_Hypothesis_i.hxx"
-
-#include "SMESH_MaxElementVolume.hxx"
-
-class SMESH_MaxElementVolume_i:
- public POA_SMESH::SMESH_MaxElementVolume,
- public SMESH_Hypothesis_i
-{
-public:
- SMESH_MaxElementVolume_i(const char* anHyp,
- int studyId,
- ::SMESH_Gen* genImpl);
- virtual ~SMESH_MaxElementVolume_i();
-
- void SetMaxElementVolume(CORBA::Double volume)
- throw (SALOME::SALOME_Exception);
-
- CORBA::Double GetMaxElementVolume();
-
-protected:
- ::SMESH_MaxElementVolume* _impl;
-};
-
-#endif
+++ /dev/null
-//=============================================================================
-// File : SMESH_NETGEN_3D_i.cxx
-// Created : Jeudi 31 Janvier 2003
-// Author : Nadir Bouhamou CEA
-// Project : SALOME
-// Copyright : CEA 2003
-// $Header$
-//=============================================================================
-using namespace std;
-
-#include "SMESH_NETGEN_3D_i.hxx"
-#include "SMESH_Gen.hxx"
-#include "SMESH_HypothesisFactory.hxx"
-
-#include "Utils_CorbaException.hxx"
-#include "utilities.h"
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-SMESH_NETGEN_3D_i::SMESH_NETGEN_3D_i(const char* anHyp,
- int studyId,
- ::SMESH_Gen* genImpl)
-{
- MESSAGE("SMESH_NETGEN_3D_i::SMESH_NETGEN_3D_i");
- _genImpl = genImpl;
- ::SMESH_NETGEN_3D* impl
- = new ::SMESH_NETGEN_3D(_genImpl->_hypothesisFactory.GetANewId(),
- studyId,
- genImpl);
- SetImpl(impl);
- _baseImpl = _impl;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-SMESH_NETGEN_3D_i::~SMESH_NETGEN_3D_i()
-{
- MESSAGE("SMESH_NETGEN_3D_i::~SMESH_NETGEN_3D_i");
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-void SMESH_NETGEN_3D_i::SetImpl(::SMESH_NETGEN_3D* impl)
-{
- MESSAGE("SMESH_NETGEN_3D_i::SetImpl");
- SMESH_3D_Algo_i::SetImpl(impl);
- _impl = impl;
-}
+++ /dev/null
-//=============================================================================
-// File : SMESH_NETGEN_3D_i.hxx
-// Created : Jeudi 31 Janvier 2003
-// Author : Nadir Bouhamou CEA
-// Project : SALOME
-// Copyright : CEA 2003
-// $Header$
-//=============================================================================
-#ifndef _SMESH_NETGEN_3D_I_HXX_
-#define _SMESH_NETGEN_3D_I_HXX_
-
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SMESH_BasicHypothesis)
-
-#include "SMESH_3D_Algo_i.hxx"
-
-#include "SMESH_NETGEN_3D.hxx"
-
-class SMESH_NETGEN_3D_i:
- public POA_SMESH::SMESH_NETGEN_3D,
- public SMESH_3D_Algo_i
-{
-public:
- SMESH_NETGEN_3D_i(const char* anHyp,
- int studyId,
- ::SMESH_Gen* genImpl);
-
- virtual ~SMESH_NETGEN_3D_i();
-
-protected:
- virtual void SetImpl(::SMESH_NETGEN_3D* impl);
-
- ::SMESH_NETGEN_3D* _impl;
-};
-
-#endif
+++ /dev/null
-// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
-//
-// Copyright (C) 2003 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.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SMESH_NumberOfSegments_i.cxx
-// Author : Paul RASCLE, EDF
-// Module : SMESH
-// $Header$
-
-using namespace std;
-using namespace std;
-#include "SMESH_NumberOfSegments_i.hxx"
-#include "SMESH_Gen.hxx"
-#include "SMESH_HypothesisFactory.hxx"
-
-#include "Utils_CorbaException.hxx"
-#include "utilities.h"
-
-//=============================================================================
-/*!
- * Constructor:
- * _name is related to the class name: prefix = SMESH_ ; suffix = _i .
- */
-//=============================================================================
-
-SMESH_NumberOfSegments_i::SMESH_NumberOfSegments_i(const char* anHyp,
- int studyId,
- ::SMESH_Gen* genImpl)
-{
- MESSAGE("SMESH_NumberOfSegments_i::SMESH_NumberOfSegments_i");
- _impl= new ::SMESH_NumberOfSegments(genImpl->_hypothesisFactory.GetANewId(),
- studyId,
- genImpl);
- _baseImpl = _impl;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-SMESH_NumberOfSegments_i::~SMESH_NumberOfSegments_i()
-{
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-void
-SMESH_NumberOfSegments_i::SetNumberOfSegments(CORBA::Long segmentsNumber)
- throw (SALOME::SALOME_Exception)
-{
- ASSERT(_impl);
- try
- {
- _impl->SetNumberOfSegments(segmentsNumber);
- }
- catch (SALOME_Exception& S_ex)
- {
- THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), \
- SALOME::BAD_PARAM);
- }
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-CORBA::Long SMESH_NumberOfSegments_i::GetNumberOfSegments()
-{
- ASSERT(_impl);
- return _impl->GetNumberOfSegments();
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-void
-SMESH_NumberOfSegments_i::SetScaleFactor(CORBA::Double scaleFactor)
- throw (SALOME::SALOME_Exception)
-{
- ASSERT(_impl);
- try
- {
- _impl->SetScaleFactor(scaleFactor);
- }
- catch (SALOME_Exception& S_ex)
- {
- THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), \
- SALOME::BAD_PARAM);
- }
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-CORBA::Double SMESH_NumberOfSegments_i::GetScaleFactor()
-{
- ASSERT(_impl);
- return _impl->GetScaleFactor();
-}
-
+++ /dev/null
-// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
-//
-// Copyright (C) 2003 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.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SMESH_NumberOfSegments_i.hxx
-// Author : Paul RASCLE, EDF
-// Module : SMESH
-// $Header$
-
-#ifndef _SMESH_NUMBEROFSEGMENTS_I_HXX_
-#define _SMESH_NUMBEROFSEGMENTS_I_HXX_
-
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SMESH_BasicHypothesis)
-
-#include "SMESH_Hypothesis_i.hxx"
-
-#include "SMESH_NumberOfSegments.hxx"
-
-class SMESH_NumberOfSegments_i:
- public POA_SMESH::SMESH_NumberOfSegments,
- public SMESH_Hypothesis_i
-{
-public:
- SMESH_NumberOfSegments_i(const char* anHyp,
- int studyId,
- ::SMESH_Gen* genImpl);
- virtual ~SMESH_NumberOfSegments_i();
-
- void SetNumberOfSegments(CORBA::Long segmentsNumber)
- throw (SALOME::SALOME_Exception);
-
- CORBA::Long GetNumberOfSegments();
-
- void SetScaleFactor(CORBA::Double scaleFactor)
- throw (SALOME::SALOME_Exception);
-
- CORBA::Double GetScaleFactor();
-
-protected:
- ::SMESH_NumberOfSegments* _impl;
-};
-
-#endif
+++ /dev/null
-// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
-//
-// Copyright (C) 2003 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.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SMESH_Quadrangle_2D_i.cxx
-// Author : Paul RASCLE, EDF
-// Module : SMESH
-// $Header$
-
-using namespace std;
-using namespace std;
-#include "SMESH_Quadrangle_2D_i.hxx"
-#include "SMESH_Gen.hxx"
-#include "SMESH_HypothesisFactory.hxx"
-
-#include "Utils_CorbaException.hxx"
-#include "utilities.h"
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-SMESH_Quadrangle_2D_i::SMESH_Quadrangle_2D_i(const char* anHyp,
- int studyId,
- ::SMESH_Gen* genImpl)
-{
- MESSAGE("SMESH_Quadrangle_2D_i::SMESH_Quadrangle_2D_i");
- _genImpl = genImpl;
- ::SMESH_Quadrangle_2D* impl
- = new ::SMESH_Quadrangle_2D(_genImpl->_hypothesisFactory.GetANewId(),
- studyId,
- genImpl);
- SetImpl(impl);
- _baseImpl = _impl;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-SMESH_Quadrangle_2D_i::~SMESH_Quadrangle_2D_i()
-{
- MESSAGE("SMESH_Quadrangle_2D_i::~SMESH_Quadrangle_2D_i");
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-void SMESH_Quadrangle_2D_i::SetImpl(::SMESH_Quadrangle_2D* impl)
-{
- MESSAGE("SMESH_Quadrangle_2D_i::SetImpl");
- SMESH_2D_Algo_i::SetImpl(impl);
- _impl = impl;
-}
+++ /dev/null
-// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
-//
-// Copyright (C) 2003 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.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SMESH_Quadrangle_2D_i.hxx
-// Author : Paul RASCLE, EDF
-// Module : SMESH
-// $Header$
-
-#ifndef _SMESH_QUADRANGLE_2D_I_HXX_
-#define _SMESH_QUADRANGLE_2D_I_HXX_
-
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SMESH_BasicHypothesis)
-
-#include "SMESH_2D_Algo_i.hxx"
-
-#include "SMESH_Quadrangle_2D.hxx"
-
-class SMESH_Quadrangle_2D_i:
- public POA_SMESH::SMESH_Quadrangle_2D,
- public SMESH_2D_Algo_i
-{
-public:
- SMESH_Quadrangle_2D_i(const char* anHyp,
- int studyId,
- ::SMESH_Gen* genImpl);
-
- virtual ~SMESH_Quadrangle_2D_i();
-
-protected:
- virtual void SetImpl(::SMESH_Quadrangle_2D* impl);
-
- ::SMESH_Quadrangle_2D* _impl;
-};
-
-#endif
+++ /dev/null
-// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
-//
-// Copyright (C) 2003 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.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SMESH_Regular_1D_i.cxx
-// Author : Paul RASCLE, EDF
-// Module : SMESH
-// $Header$
-
-using namespace std;
-using namespace std;
-#include "SMESH_Regular_1D_i.hxx"
-#include "SMESH_Gen.hxx"
-#include "SMESH_HypothesisFactory.hxx"
-
-#include "Utils_CorbaException.hxx"
-#include "utilities.h"
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-SMESH_Regular_1D_i::SMESH_Regular_1D_i(const char* anHyp,
- int studyId,
- ::SMESH_Gen* genImpl)
-{
- MESSAGE("SMESH_Regular_1D_i::SMESH_Regular_1D_i");
- _genImpl = genImpl;
- ::SMESH_Regular_1D* impl
- = new ::SMESH_Regular_1D(_genImpl->_hypothesisFactory.GetANewId(),
- studyId,
- genImpl);
- SetImpl(impl);
- _baseImpl = _impl;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-SMESH_Regular_1D_i::~SMESH_Regular_1D_i()
-{
- MESSAGE("SMESH_Regular_1D_i::~SMESH_Regular_1D_i");
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-void SMESH_Regular_1D_i::SetImpl(::SMESH_Regular_1D* impl)
-{
- MESSAGE("SMESH_Regular_1D_i::SetImpl");
- SMESH_1D_Algo_i::SetImpl(impl);
- _impl = impl;
-}
+++ /dev/null
-// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
-//
-// Copyright (C) 2003 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.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SMESH_Regular_1D_i.hxx
-// Author : Paul RASCLE, EDF
-// Module : SMESH
-// $Header$
-
-#ifndef _SMESH_REGULAR_1D_I_HXX_
-#define _SMESH_REGULAR_1D_I_HXX_
-
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SMESH_BasicHypothesis)
-
-#include "SMESH_1D_Algo_i.hxx"
-
-#include "SMESH_Regular_1D.hxx"
-
-class SMESH_Regular_1D_i:
- public POA_SMESH::SMESH_Regular_1D,
- public SMESH_1D_Algo_i
-{
-public:
- SMESH_Regular_1D_i(const char* anHyp,
- int studyId,
- ::SMESH_Gen* genImpl);
-
- virtual ~SMESH_Regular_1D_i();
-
-protected:
- virtual void SetImpl(::SMESH_Regular_1D* impl);
-
- ::SMESH_Regular_1D* _impl;
-};
-
-#endif