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

+        void AddBall(int NewBallID, int node, double diameter);
This commit is contained in:
eap 2012-07-19 13:19:53 +00:00
parent 71fffb2772
commit e519caf020
4 changed files with 70 additions and 39 deletions

View File

@ -24,7 +24,6 @@
// File : SMESH_Command.cxx // File : SMESH_Command.cxx
// Author : Yves FRICAUD, OCC // Author : Yves FRICAUD, OCC
// Module : SMESH // Module : SMESH
// $Header:
// //
#include "SMESHDS_Command.hxx" #include "SMESHDS_Command.hxx"
@ -278,8 +277,8 @@ void SMESHDS_Command::AddVolume(int NewVolID,
//function : AddPolygonalFace //function : AddPolygonalFace
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Command::AddPolygonalFace (const int ElementID, void SMESHDS_Command::AddPolygonalFace (const int ElementID,
std::vector<int> nodes_ids) const std::vector<int>& nodes_ids)
{ {
if (!myType == SMESHDS_AddPolygon) { if (!myType == SMESHDS_AddPolygon) {
MESSAGE("SMESHDS_Command::AddPolygonalFace : Bad Type"); MESSAGE("SMESHDS_Command::AddPolygonalFace : Bad Type");
@ -300,9 +299,9 @@ void SMESHDS_Command::AddPolygonalFace (const int ElementID,
//function : AddPolyhedralVolume //function : AddPolyhedralVolume
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Command::AddPolyhedralVolume (const int ElementID, void SMESHDS_Command::AddPolyhedralVolume (const int ElementID,
std::vector<int> nodes_ids, const std::vector<int>& nodes_ids,
std::vector<int> quantities) const std::vector<int>& quantities)
{ {
if (!myType == SMESHDS_AddPolyhedron) { if (!myType == SMESHDS_AddPolyhedron) {
MESSAGE("SMESHDS_Command::AddPolyhedralVolume : Bad Type"); MESSAGE("SMESHDS_Command::AddPolyhedralVolume : Bad Type");
@ -379,9 +378,9 @@ void SMESHDS_Command::ChangeElementNodes(int ElementID, int nodes[], int nbnodes
//function : ChangePolyhedronNodes //function : ChangePolyhedronNodes
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Command::ChangePolyhedronNodes (const int ElementID, void SMESHDS_Command::ChangePolyhedronNodes (const int ElementID,
std::vector<int> nodes_ids, const std::vector<int>& nodes_ids,
std::vector<int> quantities) const std::vector<int>& quantities)
{ {
if (myType != SMESHDS_ChangePolyhedronNodes) if (myType != SMESHDS_ChangePolyhedronNodes)
{ {
@ -726,3 +725,21 @@ void SMESHDS_Command::AddVolume(int NewVolID, int n1, int n2, int n3,
myNumber++; 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++;
}

View File

@ -43,23 +43,24 @@ class SMESHDS_EXPORT SMESHDS_Command
void AddEdge(int NewEdgeID, int idnode1, int idnode2); 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);
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, void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
int idnode4); int idnode4);
void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3, 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, 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, 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, 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,
int idnode9, int idnode10, int idnode11, int idnode12); int idnode9, int idnode10, int idnode11, int idnode12);
void AddPolygonalFace (const int ElementID, void AddPolygonalFace (const int ElementID,
std::vector<int> nodes_ids); const std::vector<int>& nodes_ids);
void AddPolyhedralVolume (const int ElementID, void AddPolyhedralVolume (const int ElementID,
std::vector<int> nodes_ids, const std::vector<int>& nodes_ids,
std::vector<int> quantities); const std::vector<int>& quantities);
void AddBall(int NewBallID, int node, double diameter);
// special methods for quadratic elements // special methods for quadratic elements
void AddEdge(int NewEdgeID, int n1, int n2, int n12); void AddEdge(int NewEdgeID, int n1, int n2, int n12);
void AddFace(int NewFaceID, int n1, int n2, int n3, void AddFace(int NewFaceID, int n1, int n2, int n3,
@ -95,9 +96,9 @@ class SMESHDS_EXPORT SMESHDS_Command
void RemoveNode(int NodeID); void RemoveNode(int NodeID);
void RemoveElement(int ElementID); void RemoveElement(int ElementID);
void ChangeElementNodes(int ElementID, int nodes[], int nbnodes); void ChangeElementNodes(int ElementID, int nodes[], int nbnodes);
void ChangePolyhedronNodes(const int ElementID, void ChangePolyhedronNodes(const int ElementID,
std::vector<int> nodes_ids, const std::vector<int>& nodes_ids,
std::vector<int> quantities); const std::vector<int>& quantities);
void Renumber (const bool isNodes, const int startID, const int deltaID); void Renumber (const bool isNodes, const int startID, const int deltaID);
SMESHDS_CommandType GetType(); SMESHDS_CommandType GetType();
int GetNumber(); int GetNumber();

View File

@ -24,7 +24,6 @@
// File : SMESH_Script.cxx // File : SMESH_Script.cxx
// Author : Yves FRICAUD, OCC // Author : Yves FRICAUD, OCC
// Module : SMESH // Module : SMESH
// $Header:
// //
#include "SMESHDS_Script.hxx" #include "SMESHDS_Script.hxx"
#include <iostream> #include <iostream>
@ -247,7 +246,7 @@ void SMESHDS_Script::AddVolume(int NewVolID, int idnode1, int idnode2, int idnod
//function : AddPolygonalFace //function : AddPolygonalFace
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Script::AddPolygonalFace (int NewFaceID, std::vector<int> nodes_ids) void SMESHDS_Script::AddPolygonalFace (int NewFaceID, const std::vector<int>& nodes_ids)
{ {
if(myIsEmbeddedMode){ if(myIsEmbeddedMode){
myIsModified = true; myIsModified = true;
@ -260,9 +259,9 @@ void SMESHDS_Script::AddPolygonalFace (int NewFaceID, std::vector<int> nodes_ids
//function : AddPolyhedralVolume //function : AddPolyhedralVolume
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Script::AddPolyhedralVolume (int NewID, void SMESHDS_Script::AddPolyhedralVolume (int NewID,
std::vector<int> nodes_ids, const std::vector<int>& nodes_ids,
std::vector<int> quantities) const std::vector<int>& quantities)
{ {
if(myIsEmbeddedMode){ if(myIsEmbeddedMode){
myIsModified = true; myIsModified = true;
@ -272,6 +271,19 @@ void SMESHDS_Script::AddPolyhedralVolume (int NewID,
(NewID, nodes_ids, quantities); (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 : //function :
//purpose : //purpose :
@ -329,9 +341,9 @@ void SMESHDS_Script::ChangeElementNodes(int ElementID, int nodes[], int nbnodes)
//function : ChangePolyhedronNodes //function : ChangePolyhedronNodes
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Script::ChangePolyhedronNodes (const int ElementID, void SMESHDS_Script::ChangePolyhedronNodes (const int ElementID,
std::vector<int> nodes_ids, const std::vector<int>& nodes_ids,
std::vector<int> quantities) const std::vector<int>& quantities)
{ {
if(myIsEmbeddedMode){ if(myIsEmbeddedMode){
myIsModified = true; myIsModified = true;

View File

@ -62,11 +62,12 @@ class SMESHDS_EXPORT SMESHDS_Script
int idnode4, int idnode5, int idnode6, int idnode7, int idnode8, int idnode4, int idnode5, int idnode6, int idnode7, int idnode8,
int idnode9, int idnode10, int idnode11, int idnode12); int idnode9, int idnode10, int idnode11, int idnode12);
void AddPolygonalFace (const int NewFaceID, void AddPolygonalFace (const int NewFaceID,
std::vector<int> nodes_ids); const std::vector<int>& nodes_ids);
void AddPolyhedralVolume (const int NewVolID, void AddPolyhedralVolume (const int NewVolID,
std::vector<int> nodes_ids, const std::vector<int>& nodes_ids,
std::vector<int> quantities); const std::vector<int>& quantities);
void AddBall(int NewBallID, int node, double diameter);
// special methods for quadratic elements // special methods for quadratic elements
void AddEdge(int NewEdgeID, int n1, int n2, int n12); 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 n15, int n26, int n37, int n48,
int n1234,int n1256,int n2367,int n3478, int n1234,int n1256,int n2367,int n3478,
int n1458,int n5678,int nCenter); 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 RemoveNode(int NodeID);
void RemoveElement(int ElementID); void RemoveElement(int ElementID);
void ChangeElementNodes(int ElementID, int nodes[], int nbnodes); void ChangeElementNodes(int ElementID, int nodes[], int nbnodes);
void ChangePolyhedronNodes(const int ElementID, void ChangePolyhedronNodes(const int ElementID,
std::vector<int> nodes_ids, const std::vector<int>& nodes_ids,
std::vector<int> quantities); const std::vector<int>& quantities);
void Renumber (const bool isNodes, const int startID, const int deltaID); void Renumber (const bool isNodes, const int startID, const int deltaID);
void ClearMesh(); void ClearMesh();
void Clear(); void Clear();