2003-07-10 16:13:42 +06:00
|
|
|
// 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_2D_Algo.cxx
|
|
|
|
// Author : Paul RASCLE, EDF
|
|
|
|
// Module : SMESH
|
|
|
|
// $Header$
|
|
|
|
|
2003-05-19 19:18:36 +06:00
|
|
|
using namespace std;
|
|
|
|
using namespace std;
|
|
|
|
#include "SMESH_2D_Algo.hxx"
|
|
|
|
#include "SMESH_Gen.hxx"
|
|
|
|
|
|
|
|
#include "utilities.h"
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
/*!
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
//=============================================================================
|
|
|
|
|
|
|
|
SMESH_2D_Algo::SMESH_2D_Algo(int hypId, int studyId, SMESH_Gen* gen)
|
|
|
|
: SMESH_Algo(hypId, studyId, gen)
|
|
|
|
{
|
|
|
|
// _compatibleHypothesis.push_back("hypothese_2D_bidon");
|
|
|
|
_type = ALGO_2D;
|
|
|
|
gen->_map2D_Algo[hypId] = this;
|
|
|
|
}
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
/*!
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
//=============================================================================
|
|
|
|
|
|
|
|
SMESH_2D_Algo::~SMESH_2D_Algo()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
/*!
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
//=============================================================================
|
|
|
|
|
|
|
|
ostream & SMESH_2D_Algo::SaveTo(ostream & save)
|
|
|
|
{
|
|
|
|
return save << this;
|
|
|
|
}
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
/*!
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
//=============================================================================
|
|
|
|
|
|
|
|
istream & SMESH_2D_Algo::LoadFrom(istream & load)
|
|
|
|
{
|
|
|
|
return load >> (*this);
|
|
|
|
}
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
/*!
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
//=============================================================================
|
|
|
|
|
|
|
|
ostream& operator << (ostream & save, SMESH_2D_Algo & hyp)
|
|
|
|
{
|
|
|
|
return save;
|
|
|
|
}
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
/*!
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
//=============================================================================
|
|
|
|
|
|
|
|
istream& operator >> (istream & load, SMESH_2D_Algo & hyp)
|
|
|
|
{
|
|
|
|
return load;
|
|
|
|
}
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
/*!
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
//=============================================================================
|
|
|
|
|
|
|
|
int SMESH_2D_Algo::NumberOfWires(const TopoDS_Shape& S)
|
|
|
|
{
|
|
|
|
int i = 0;
|
|
|
|
for (TopExp_Explorer exp(S,TopAbs_WIRE); exp.More(); exp.Next())
|
|
|
|
i++;
|
|
|
|
return i;
|
|
|
|
}
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
/*!
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
//=============================================================================
|
|
|
|
|
|
|
|
int SMESH_2D_Algo::NumberOfPoints(SMESH_Mesh& aMesh, const TopoDS_Wire& W)
|
|
|
|
{
|
|
|
|
int nbPoints = 0;
|
|
|
|
for (TopExp_Explorer exp(W,TopAbs_EDGE); exp.More(); exp.Next())
|
|
|
|
{
|
|
|
|
const TopoDS_Edge& E = TopoDS::Edge(exp.Current());
|
|
|
|
int nb = aMesh.GetSubMesh(E)->GetSubMeshDS()->NbNodes();
|
|
|
|
//SCRUTE(nb);
|
|
|
|
nbPoints += nb +1; // internal points plus 1 vertex of 2 (last point ?)
|
|
|
|
}
|
|
|
|
//SCRUTE(nbPoints);
|
|
|
|
return nbPoints;
|
|
|
|
}
|