0021459: EDF 1495 SMESH: Manipulation of discrete elements with attributes

+  virtual SMDS_BallElement* AddBallWithID(int n,                   double diameter, int ID);
+  virtual SMDS_BallElement* AddBallWithID(const SMDS_MeshNode * n, double diameter, int ID);
+  virtual SMDS_BallElement* AddBall      (const SMDS_MeshNode * n, double diameter);
This commit is contained in:
eap 2012-07-19 13:19:31 +00:00
parent 9f32eead4d
commit 71fffb2772
2 changed files with 55 additions and 18 deletions

View File

@ -24,7 +24,6 @@
// File : SMESH_Mesh.cxx
// Author : Yves FRICAUD, OCC
// Module : SMESH
// $Header:
//
#include "SMESHDS_Mesh.hxx"
@ -35,22 +34,23 @@
#include "SMDS_SpacePosition.hxx"
#include "SMDS_Downward.hxx"
#include "SMESHDS_GroupOnGeom.hxx"
#include "SMESHDS_Script.hxx"
#include <Standard_ErrorHandler.hxx>
#include <Standard_OutOfRange.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Iterator.hxx>
#include <TopoDS_Shell.hxx>
#include <TopoDS_Solid.hxx>
#include <TopoDS_Vertex.hxx>
#include "utilities.h"
using namespace std;
/*Standard_Boolean IsEqual( const TopoDS_Shape& S1, const TopoDS_Shape& S2 )
{
return S1.IsSame( S2 );
}*/
//=======================================================================
//function : Create
//purpose :
@ -305,10 +305,40 @@ SMDS_Mesh0DElement* SMESHDS_Mesh::Add0DElement(const SMDS_MeshNode * node)
return anElem;
}
//=======================================================================
//function :AddBallWithID
//purpose :
//=======================================================================
SMDS_BallElement* SMESHDS_Mesh::AddBallWithID(int node, double diameter, int ID)
{
SMDS_BallElement* anElem = SMDS_Mesh::AddBallWithID(node,diameter,ID);
if (anElem) myScript->AddBall(anElem->GetID(), node, diameter);
return anElem;
}
SMDS_BallElement* SMESHDS_Mesh::AddBallWithID(const SMDS_MeshNode * node,
double diameter,
int ID)
{
SMDS_BallElement* anElem = SMDS_Mesh::AddBallWithID(node,diameter,ID);
if (anElem) myScript->AddBall(anElem->GetID(), node->GetID(), diameter);
return anElem;
}
SMDS_BallElement* SMESHDS_Mesh::AddBall (const SMDS_MeshNode * node,
double diameter)
{
SMDS_BallElement* anElem = SMDS_Mesh::AddBall(node,diameter);
if (anElem) myScript->AddBall(anElem->GetID(), node->GetID(), diameter);
return anElem;
}
//=======================================================================
//function :AddEdgeWithID
//purpose :
//=======================================================================
SMDS_MeshEdge* SMESHDS_Mesh::AddEdgeWithID(int n1, int n2, int ID)
{
SMDS_MeshEdge* anElem = SMDS_Mesh::AddEdgeWithID(n1,n2,ID);

View File

@ -30,22 +30,25 @@
#include "SMESH_SMESHDS.hxx"
#include "SMDS_Mesh.hxx"
#include "SMDS_MeshNode.hxx"
#include "SMDS_Mesh0DElement.hxx"
#include "SMDS_MeshEdge.hxx"
#include "SMDS_MeshFace.hxx"
#include "SMDS_MeshVolume.hxx"
#include "SMESHDS_Hypothesis.hxx"
#include "SMESHDS_SubMesh.hxx"
#include "SMESHDS_Script.hxx"
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Solid.hxx>
#include <TopoDS_Shell.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Edge.hxx>
class TopoDS_Solid ;
class TopoDS_Shell ;
class TopoDS_Face ;
class TopoDS_Vertex;
class TopoDS_Edge ;
class SMESHDS_Script;
class SMESHDS_Hypothesis;
class SMDS_MeshNode ;
class SMDS_MeshEdge ;
class SMDS_MeshFace ;
class SMDS_MeshVolume ;
class SMDS_Mesh0DElement;
class SMDS_BallElement;
#include <NCollection_DataMap.hxx>
#include <map>
@ -77,6 +80,10 @@ public:
virtual SMDS_Mesh0DElement* Add0DElementWithID(const SMDS_MeshNode * node, int ID);
virtual SMDS_Mesh0DElement* Add0DElement (const SMDS_MeshNode * node);
virtual SMDS_BallElement* AddBallWithID(int n, double diameter, int ID);
virtual SMDS_BallElement* AddBallWithID(const SMDS_MeshNode * n, double diameter, int ID);
virtual SMDS_BallElement* AddBall (const SMDS_MeshNode * n, double diameter);
virtual SMDS_MeshEdge* AddEdgeWithID(int n1, int n2, int ID);
virtual SMDS_MeshEdge* AddEdgeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,