mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-25 17:00:34 +05:00
Add support for tetra, pyramid and prism
This commit is contained in:
parent
00c069f8d4
commit
4ea4ccf36f
@ -329,8 +329,8 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MESSAGE("Error : Not implemented");
|
volume=new SMDS_VolumeOfNodes(node1,node2,node3,node4);
|
||||||
return NULL;
|
myVolumes.insert(volume);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(myElementIDFactory->BindID(ID, volume))
|
if(myElementIDFactory->BindID(ID, volume))
|
||||||
@ -424,8 +424,8 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MESSAGE("Error : Not implemented");
|
volume=new SMDS_VolumeOfNodes(node1,node2,node3,node4,node5);
|
||||||
return NULL;
|
myVolumes.insert(volume);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(myElementIDFactory->BindID(ID, volume))
|
if(myElementIDFactory->BindID(ID, volume))
|
||||||
@ -525,8 +525,8 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MESSAGE("Error : Not implemented");
|
volume=new SMDS_VolumeOfNodes(node1,node2,node3,node4,node5,node6);
|
||||||
return NULL;
|
myVolumes.insert(volume);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(myElementIDFactory->BindID(ID, volume))
|
if(myElementIDFactory->BindID(ID, volume))
|
||||||
|
@ -37,6 +37,7 @@ SMDS_VolumeOfNodes::SMDS_VolumeOfNodes(
|
|||||||
SMDS_MeshNode * node7,
|
SMDS_MeshNode * node7,
|
||||||
SMDS_MeshNode * node8)
|
SMDS_MeshNode * node8)
|
||||||
{
|
{
|
||||||
|
myNodes.resize(8);
|
||||||
myNodes[0]=node1;
|
myNodes[0]=node1;
|
||||||
myNodes[1]=node2;
|
myNodes[1]=node2;
|
||||||
myNodes[2]=node3;
|
myNodes[2]=node3;
|
||||||
@ -47,6 +48,50 @@ SMDS_VolumeOfNodes::SMDS_VolumeOfNodes(
|
|||||||
myNodes[7]=node8;
|
myNodes[7]=node8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SMDS_VolumeOfNodes::SMDS_VolumeOfNodes(
|
||||||
|
SMDS_MeshNode * node1,
|
||||||
|
SMDS_MeshNode * node2,
|
||||||
|
SMDS_MeshNode * node3,
|
||||||
|
SMDS_MeshNode * node4)
|
||||||
|
{
|
||||||
|
myNodes.resize(4);
|
||||||
|
myNodes[0]=node1;
|
||||||
|
myNodes[1]=node2;
|
||||||
|
myNodes[2]=node3;
|
||||||
|
myNodes[3]=node4;
|
||||||
|
}
|
||||||
|
|
||||||
|
SMDS_VolumeOfNodes::SMDS_VolumeOfNodes(
|
||||||
|
SMDS_MeshNode * node1,
|
||||||
|
SMDS_MeshNode * node2,
|
||||||
|
SMDS_MeshNode * node3,
|
||||||
|
SMDS_MeshNode * node4,
|
||||||
|
SMDS_MeshNode * node5)
|
||||||
|
{
|
||||||
|
myNodes.resize(5);
|
||||||
|
myNodes[0]=node1;
|
||||||
|
myNodes[1]=node2;
|
||||||
|
myNodes[2]=node3;
|
||||||
|
myNodes[3]=node4;
|
||||||
|
myNodes[4]=node5;
|
||||||
|
}
|
||||||
|
|
||||||
|
SMDS_VolumeOfNodes::SMDS_VolumeOfNodes(
|
||||||
|
SMDS_MeshNode * node1,
|
||||||
|
SMDS_MeshNode * node2,
|
||||||
|
SMDS_MeshNode * node3,
|
||||||
|
SMDS_MeshNode * node4,
|
||||||
|
SMDS_MeshNode * node5,
|
||||||
|
SMDS_MeshNode * node6)
|
||||||
|
{
|
||||||
|
myNodes.resize(6);
|
||||||
|
myNodes[0]=node1;
|
||||||
|
myNodes[1]=node2;
|
||||||
|
myNodes[2]=node3;
|
||||||
|
myNodes[3]=node4;
|
||||||
|
myNodes[4]=node5;
|
||||||
|
myNodes[5]=node6;
|
||||||
|
}
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : Print
|
//function : Print
|
||||||
//purpose :
|
//purpose :
|
||||||
@ -62,17 +107,31 @@ void SMDS_VolumeOfNodes::Print(ostream & OS) const
|
|||||||
|
|
||||||
int SMDS_VolumeOfNodes::NbFaces() const
|
int SMDS_VolumeOfNodes::NbFaces() const
|
||||||
{
|
{
|
||||||
return 6;
|
switch(NbNodes())
|
||||||
|
{
|
||||||
|
case 4: return 4;
|
||||||
|
case 5: return 5;
|
||||||
|
case 6: return 5;
|
||||||
|
case 8: return 6;
|
||||||
|
default: MESSAGE("invalid number of nodes");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int SMDS_VolumeOfNodes::NbNodes() const
|
int SMDS_VolumeOfNodes::NbNodes() const
|
||||||
{
|
{
|
||||||
return 8;
|
return myNodes.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
int SMDS_VolumeOfNodes::NbEdges() const
|
int SMDS_VolumeOfNodes::NbEdges() const
|
||||||
{
|
{
|
||||||
return 12;
|
switch(NbNodes())
|
||||||
|
{
|
||||||
|
case 4: return 6;
|
||||||
|
case 5: return 8;
|
||||||
|
case 6: return 9;
|
||||||
|
case 8: return 12;
|
||||||
|
default: MESSAGE("invalid number of nodes");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SMDS_Iterator<const SMDS_MeshElement *> * SMDS_VolumeOfNodes::
|
SMDS_Iterator<const SMDS_MeshElement *> * SMDS_VolumeOfNodes::
|
||||||
@ -80,15 +139,15 @@ SMDS_Iterator<const SMDS_MeshElement *> * SMDS_VolumeOfNodes::
|
|||||||
{
|
{
|
||||||
class MyIterator:public SMDS_Iterator<const SMDS_MeshElement*>
|
class MyIterator:public SMDS_Iterator<const SMDS_MeshElement*>
|
||||||
{
|
{
|
||||||
const SMDS_MeshNode * const* mySet;
|
const vector<const SMDS_MeshNode*>& mySet;
|
||||||
int index;
|
int index;
|
||||||
public:
|
public:
|
||||||
MyIterator(const SMDS_MeshNode * const* s):mySet(s),index(0)
|
MyIterator(const vector<const SMDS_MeshNode*>& s):mySet(s),index(0)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
bool more()
|
bool more()
|
||||||
{
|
{
|
||||||
return index<8;
|
return index<mySet.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
const SMDS_MeshElement* next()
|
const SMDS_MeshElement* next()
|
||||||
@ -97,7 +156,6 @@ SMDS_Iterator<const SMDS_MeshElement *> * SMDS_VolumeOfNodes::
|
|||||||
return mySet[index-1];
|
return mySet[index-1];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
switch(type)
|
switch(type)
|
||||||
{
|
{
|
||||||
case SMDSAbs_Volume:return SMDS_MeshElement::elementsIterator(SMDSAbs_Volume);
|
case SMDSAbs_Volume:return SMDS_MeshElement::elementsIterator(SMDSAbs_Volume);
|
||||||
|
@ -28,11 +28,31 @@
|
|||||||
#define _SMDS_VolumeOfNodes_HeaderFile
|
#define _SMDS_VolumeOfNodes_HeaderFile
|
||||||
|
|
||||||
#include "SMDS_MeshVolume.hxx"
|
#include "SMDS_MeshVolume.hxx"
|
||||||
|
#include <vector>
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
class SMDS_VolumeOfNodes:public SMDS_MeshVolume
|
class SMDS_VolumeOfNodes:public SMDS_MeshVolume
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
SMDS_VolumeOfNodes(
|
||||||
|
SMDS_MeshNode * node1,
|
||||||
|
SMDS_MeshNode * node2,
|
||||||
|
SMDS_MeshNode * node3,
|
||||||
|
SMDS_MeshNode * node4);
|
||||||
|
SMDS_VolumeOfNodes(
|
||||||
|
SMDS_MeshNode * node1,
|
||||||
|
SMDS_MeshNode * node2,
|
||||||
|
SMDS_MeshNode * node3,
|
||||||
|
SMDS_MeshNode * node4,
|
||||||
|
SMDS_MeshNode * node5);
|
||||||
|
SMDS_VolumeOfNodes(
|
||||||
|
SMDS_MeshNode * node1,
|
||||||
|
SMDS_MeshNode * node2,
|
||||||
|
SMDS_MeshNode * node3,
|
||||||
|
SMDS_MeshNode * node4,
|
||||||
|
SMDS_MeshNode * node5,
|
||||||
|
SMDS_MeshNode * node6);
|
||||||
SMDS_VolumeOfNodes(
|
SMDS_VolumeOfNodes(
|
||||||
SMDS_MeshNode * node1,
|
SMDS_MeshNode * node1,
|
||||||
SMDS_MeshNode * node2,
|
SMDS_MeshNode * node2,
|
||||||
@ -51,6 +71,6 @@ class SMDS_VolumeOfNodes:public SMDS_MeshVolume
|
|||||||
protected:
|
protected:
|
||||||
SMDS_Iterator<const SMDS_MeshElement *> *
|
SMDS_Iterator<const SMDS_MeshElement *> *
|
||||||
elementsIterator(SMDSAbs_ElementType type) const;
|
elementsIterator(SMDSAbs_ElementType type) const;
|
||||||
SMDS_MeshNode * myNodes[8];
|
vector<const SMDS_MeshNode *> myNodes;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user