From: eap Date: Thu, 19 Jul 2012 13:19:53 +0000 (+0000) Subject: 0021459: EDF 1495 SMESH: Manipulation of discrete elements with attributes X-Git-Tag: V6_6_0a1~242 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e519caf020d96284d39bcff24d1a97693d97841b;p=modules%2Fsmesh.git 0021459: EDF 1495 SMESH: Manipulation of discrete elements with attributes + void AddBall(int NewBallID, int node, double diameter); --- diff --git a/src/SMESHDS/SMESHDS_Command.cxx b/src/SMESHDS/SMESHDS_Command.cxx index e8624bc41..658ad24ae 100644 --- a/src/SMESHDS/SMESHDS_Command.cxx +++ b/src/SMESHDS/SMESHDS_Command.cxx @@ -24,7 +24,6 @@ // File : SMESH_Command.cxx // Author : Yves FRICAUD, OCC // Module : SMESH -// $Header: // #include "SMESHDS_Command.hxx" @@ -278,8 +277,8 @@ void SMESHDS_Command::AddVolume(int NewVolID, //function : AddPolygonalFace //purpose : //======================================================================= -void SMESHDS_Command::AddPolygonalFace (const int ElementID, - std::vector nodes_ids) +void SMESHDS_Command::AddPolygonalFace (const int ElementID, + const std::vector& nodes_ids) { if (!myType == SMESHDS_AddPolygon) { MESSAGE("SMESHDS_Command::AddPolygonalFace : Bad Type"); @@ -300,9 +299,9 @@ void SMESHDS_Command::AddPolygonalFace (const int ElementID, //function : AddPolyhedralVolume //purpose : //======================================================================= -void SMESHDS_Command::AddPolyhedralVolume (const int ElementID, - std::vector nodes_ids, - std::vector quantities) +void SMESHDS_Command::AddPolyhedralVolume (const int ElementID, + const std::vector& nodes_ids, + const std::vector& quantities) { if (!myType == SMESHDS_AddPolyhedron) { MESSAGE("SMESHDS_Command::AddPolyhedralVolume : Bad Type"); @@ -379,9 +378,9 @@ void SMESHDS_Command::ChangeElementNodes(int ElementID, int nodes[], int nbnodes //function : ChangePolyhedronNodes //purpose : //======================================================================= -void SMESHDS_Command::ChangePolyhedronNodes (const int ElementID, - std::vector nodes_ids, - std::vector quantities) +void SMESHDS_Command::ChangePolyhedronNodes (const int ElementID, + const std::vector& nodes_ids, + const std::vector& quantities) { if (myType != SMESHDS_ChangePolyhedronNodes) { @@ -726,3 +725,21 @@ void SMESHDS_Command::AddVolume(int NewVolID, int n1, int n2, int n3, myNumber++; } +//================================================================================ +/*! + * \brief Record adding a Ball + */ +//================================================================================ + +void SMESHDS_Command::AddBall(int NewBallID, int node, double diameter) +{ + if (!myType == SMESHDS_AddBall) + { + MESSAGE("SMESHDS_Command::SMESHDS_AddBall : Bad Type"); + return; + } + myIntegers.push_back(NewBallID); + myIntegers.push_back(node); + myReals.push_back(diameter); + myNumber++; +} diff --git a/src/SMESHDS/SMESHDS_Command.hxx b/src/SMESHDS/SMESHDS_Command.hxx index 7603fdbcc..72acadc58 100644 --- a/src/SMESHDS/SMESHDS_Command.hxx +++ b/src/SMESHDS/SMESHDS_Command.hxx @@ -43,23 +43,24 @@ class SMESHDS_EXPORT SMESHDS_Command void AddEdge(int NewEdgeID, int idnode1, int idnode2); void AddFace(int NewFaceID, int idnode1, int idnode2, int idnode3); void AddFace(int NewFaceID, int idnode1, int idnode2, int idnode3, - int idnode4); + int idnode4); void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3, - int idnode4); + int idnode4); void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3, - int idnode4, int idnode5); + int idnode4, int idnode5); void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3, - int idnode4, int idnode5, int idnode6); + int idnode4, int idnode5, int idnode6); void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3, - int idnode4, int idnode5, int idnode6, int idnode7, int idnode8); + int idnode4, int idnode5, int idnode6, int idnode7, int idnode8); void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3, int idnode4, int idnode5, int idnode6, int idnode7, int idnode8, int idnode9, int idnode10, int idnode11, int idnode12); - void AddPolygonalFace (const int ElementID, - std::vector nodes_ids); - void AddPolyhedralVolume (const int ElementID, - std::vector nodes_ids, - std::vector quantities); + void AddPolygonalFace (const int ElementID, + const std::vector& nodes_ids); + void AddPolyhedralVolume (const int ElementID, + const std::vector& nodes_ids, + const std::vector& quantities); + void AddBall(int NewBallID, int node, double diameter); // special methods for quadratic elements void AddEdge(int NewEdgeID, int n1, int n2, int n12); void AddFace(int NewFaceID, int n1, int n2, int n3, @@ -95,9 +96,9 @@ class SMESHDS_EXPORT SMESHDS_Command void RemoveNode(int NodeID); void RemoveElement(int ElementID); void ChangeElementNodes(int ElementID, int nodes[], int nbnodes); - void ChangePolyhedronNodes(const int ElementID, - std::vector nodes_ids, - std::vector quantities); + void ChangePolyhedronNodes(const int ElementID, + const std::vector& nodes_ids, + const std::vector& quantities); void Renumber (const bool isNodes, const int startID, const int deltaID); SMESHDS_CommandType GetType(); int GetNumber(); diff --git a/src/SMESHDS/SMESHDS_Script.cxx b/src/SMESHDS/SMESHDS_Script.cxx index fba549274..b4ec13f7c 100644 --- a/src/SMESHDS/SMESHDS_Script.cxx +++ b/src/SMESHDS/SMESHDS_Script.cxx @@ -24,7 +24,6 @@ // File : SMESH_Script.cxx // Author : Yves FRICAUD, OCC // Module : SMESH -// $Header: // #include "SMESHDS_Script.hxx" #include @@ -247,7 +246,7 @@ void SMESHDS_Script::AddVolume(int NewVolID, int idnode1, int idnode2, int idnod //function : AddPolygonalFace //purpose : //======================================================================= -void SMESHDS_Script::AddPolygonalFace (int NewFaceID, std::vector nodes_ids) +void SMESHDS_Script::AddPolygonalFace (int NewFaceID, const std::vector& nodes_ids) { if(myIsEmbeddedMode){ myIsModified = true; @@ -260,9 +259,9 @@ void SMESHDS_Script::AddPolygonalFace (int NewFaceID, std::vector nodes_ids //function : AddPolyhedralVolume //purpose : //======================================================================= -void SMESHDS_Script::AddPolyhedralVolume (int NewID, - std::vector nodes_ids, - std::vector quantities) +void SMESHDS_Script::AddPolyhedralVolume (int NewID, + const std::vector& nodes_ids, + const std::vector& quantities) { if(myIsEmbeddedMode){ myIsModified = true; @@ -272,6 +271,19 @@ void SMESHDS_Script::AddPolyhedralVolume (int NewID, (NewID, nodes_ids, quantities); } +//======================================================================= +//function : AddBall +//purpose : Record adding a Ball +//======================================================================= + +void SMESHDS_Script::AddBall(int NewBallID, int node, double diameter) +{ + if ( myIsEmbeddedMode ) + myIsModified = true; + else + getCommand(SMESHDS_AddBall)->AddBall(NewBallID, node, diameter); +} + //======================================================================= //function : //purpose : @@ -329,9 +341,9 @@ void SMESHDS_Script::ChangeElementNodes(int ElementID, int nodes[], int nbnodes) //function : ChangePolyhedronNodes //purpose : //======================================================================= -void SMESHDS_Script::ChangePolyhedronNodes (const int ElementID, - std::vector nodes_ids, - std::vector quantities) +void SMESHDS_Script::ChangePolyhedronNodes (const int ElementID, + const std::vector& nodes_ids, + const std::vector& quantities) { if(myIsEmbeddedMode){ myIsModified = true; diff --git a/src/SMESHDS/SMESHDS_Script.hxx b/src/SMESHDS/SMESHDS_Script.hxx index 8608df010..8bd3fc579 100644 --- a/src/SMESHDS/SMESHDS_Script.hxx +++ b/src/SMESHDS/SMESHDS_Script.hxx @@ -62,11 +62,12 @@ class SMESHDS_EXPORT SMESHDS_Script int idnode4, int idnode5, int idnode6, int idnode7, int idnode8, int idnode9, int idnode10, int idnode11, int idnode12); - void AddPolygonalFace (const int NewFaceID, - std::vector nodes_ids); - void AddPolyhedralVolume (const int NewVolID, - std::vector nodes_ids, - std::vector quantities); + void AddPolygonalFace (const int NewFaceID, + const std::vector& nodes_ids); + void AddPolyhedralVolume (const int NewVolID, + const std::vector& nodes_ids, + const std::vector& quantities); + void AddBall(int NewBallID, int node, double diameter); // special methods for quadratic elements void AddEdge(int NewEdgeID, int n1, int n2, int n12); @@ -98,13 +99,13 @@ class SMESHDS_EXPORT SMESHDS_Script int n15, int n26, int n37, int n48, int n1234,int n1256,int n2367,int n3478, int n1458,int n5678,int nCenter); - void MoveNode(int NewNodeID, double x, double y, double z); + void MoveNode(int NewNodeID, double x, double y, double z); void RemoveNode(int NodeID); void RemoveElement(int ElementID); void ChangeElementNodes(int ElementID, int nodes[], int nbnodes); - void ChangePolyhedronNodes(const int ElementID, - std::vector nodes_ids, - std::vector quantities); + void ChangePolyhedronNodes(const int ElementID, + const std::vector& nodes_ids, + const std::vector& quantities); void Renumber (const bool isNodes, const int startID, const int deltaID); void ClearMesh(); void Clear();