1 | #ifndef __RP_MESH3D_H__ |
---|
2 | #define __RP_MESH3D_H__ |
---|
3 | |
---|
4 | #include <string> |
---|
5 | #include "element.h" |
---|
6 | #include "node3d.h" |
---|
7 | #include "util.h" |
---|
8 | |
---|
9 | |
---|
10 | class RpMesh3d { |
---|
11 | public: |
---|
12 | // constructor |
---|
13 | RpMesh3d(const char* id, int numNodes, int numElements, |
---|
14 | int nodesInElement); |
---|
15 | |
---|
16 | int numNodes() { return m_numNodes; }; |
---|
17 | int numElements() { return m_numElements; }; |
---|
18 | const char* id() { return m_id.c_str(); }; |
---|
19 | |
---|
20 | // want user to set these numbers in constructor |
---|
21 | //void numNodes(int n) { m_numNodes = n; }; |
---|
22 | //void numElements(int n) { m_numElements = n; }; |
---|
23 | //void id(const char* id) { m_id = id; }; |
---|
24 | |
---|
25 | // add all nodes to mesh |
---|
26 | RP_ERROR addAllNodes(int numNodes, int* nodesList[]); |
---|
27 | |
---|
28 | // add one node to mesh |
---|
29 | RP_ERROR addNode(int* nodesList); |
---|
30 | |
---|
31 | // add an element to mesh |
---|
32 | RP_ERROR addElement(int numNodesInElem, const int* nodes); |
---|
33 | |
---|
34 | // retrieve nodes |
---|
35 | void getNode(int nodeSeqNum, int& x, int& y, int& z); |
---|
36 | RP_ERROR getNode(int nodeSeqNum, RpNode3d& node); |
---|
37 | RP_ERROR getNodesList(int* nodesList, int& num); |
---|
38 | |
---|
39 | RpElement getElement(int elemSeqNum); |
---|
40 | RP_ERROR getElement(int elemSeqNum, int* nodesBuf); |
---|
41 | |
---|
42 | // serialization |
---|
43 | char* serialize(); |
---|
44 | RP_ERROR serialize(char* buf, int buflen); |
---|
45 | RP_ERROR deserialize(const char* buf); |
---|
46 | |
---|
47 | void xmlString(std::string& str); |
---|
48 | void print(); |
---|
49 | |
---|
50 | virtual ~RpMesh3d(); |
---|
51 | |
---|
52 | protected: |
---|
53 | // default constructor |
---|
54 | RpMesh3d() { }; |
---|
55 | |
---|
56 | private: |
---|
57 | std::string m_id; |
---|
58 | int m_numNodes; |
---|
59 | int m_numElements; |
---|
60 | int m_nodeIndex; |
---|
61 | int m_elemIndex; |
---|
62 | vector<RpNode3d> m_nodeList; // list of node objects |
---|
63 | vector<RpElement> * m_elemList; // ptr to a list of RpElement objects |
---|
64 | }; |
---|
65 | |
---|
66 | #endif |
---|