From 71fffb277202a8215ce46278cfc686702e5416d9 Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 19 Jul 2012 13:19:31 +0000 Subject: [PATCH] 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); --- src/SMESHDS/SMESHDS_Mesh.cxx | 42 ++++++++++++++++++++++++++++++------ src/SMESHDS/SMESHDS_Mesh.hxx | 31 +++++++++++++++----------- 2 files changed, 55 insertions(+), 18 deletions(-) diff --git a/src/SMESHDS/SMESHDS_Mesh.cxx b/src/SMESHDS/SMESHDS_Mesh.cxx index 1c3592841..a42b9acc0 100644 --- a/src/SMESHDS/SMESHDS_Mesh.cxx +++ b/src/SMESHDS/SMESHDS_Mesh.cxx @@ -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 #include #include #include +#include +#include #include +#include +#include +#include #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); diff --git a/src/SMESHDS/SMESHDS_Mesh.hxx b/src/SMESHDS/SMESHDS_Mesh.hxx index cf5cbd9e9..573e06b91 100644 --- a/src/SMESHDS/SMESHDS_Mesh.hxx +++ b/src/SMESHDS/SMESHDS_Mesh.hxx @@ -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 #include -#include -#include -#include -#include -#include + +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 #include @@ -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, -- 2.39.2