Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Node.hpp
Go to the documentation of this file.
1 /* Generated by Together */
2 
3 #ifndef NODE_H
4 #define NODE_H
5 #include "MVec.hpp"
6 class Element;
7 class Face;
8 class FaceList;
9 class ElementList;
10 class Mesh;
11 
12 class Node {
13 public:
14 
15  enum FlagType{
17  };
18 
19  Node();
20 
21  Node(MVec pos);
22 
23  Node(MVec pos, int flag);
24 
25  // when here node should not be in any face or element
26  ~Node();
27 
28  void setID(int theID);
29 
30  int getID();
31 
32  void setPosition(MVec pos);
33 
34  MVec getPosition();
35 
36 
37  void addFace(Face * face);
38 
39 
40  void removeFace(Face * face);
41 
45  int getNumFaces();
46 
50  Face * getFace(int Index);
51 
55  Face ** getAllFaces();
56 
57 
58  void addElement(Element * elem);
59 
60  void removeElement(Element * elem);
61 
65  int getNumElements();
66 
70  Element * getElement(int Index);
71 
76 
77 
78  Face* sharedFace(Node* n2, Node* n3, Node* n4 = 0 );
79 
80  Node* getNext();
81 
82  void addNextLink( Node* link );
83 
84  boolean separate( Mesh* mesh, FaceList* list, int new_material );
85 
86  int getFlag() const;
87  void setFlag( int flag );
88 
89 
90  friend istream& operator>>(istream& stream, Node& n);
91 
92  friend ostream& operator<<(ostream& stream, Node& n);
93 
94 
95 private:
96 
98 
100  int d_ID;
101 
102  int d_flag;
103 
105 
109 
113 };
114 
115 
116 inline void Node::setID(int theID)
117 { d_ID = theID; }
118 
119 inline int Node::getID()
120 { return d_ID; }
121 
122 inline void Node::setPosition(MVec pos)
123 { d_position = pos; }
124 
126 { return d_position; }
127 
128 inline int Node::getNumFaces()
129 { return d_numFaces; }
130 
131 inline Face * Node::getFace(int Index)
132 { return d_faces[Index]; }
133 
134 
136 { return d_faces; }
137 
138 
139 
141 { return d_numElements; }
142 
143 inline Element * Node::getElement(int Index)
144 { return d_elements[Index]; }
145 
146 
148 { return d_elements; }
149 
150 inline int Node::getFlag() const
151 {return d_flag; }
152 
153 inline void Node::setFlag( int flag )
154 { d_flag = flag; }
155 
156 inline ostream & operator<<(ostream & stream, Node & n){
157  stream << n.d_ID << '\t' << n.d_position << endl;
158  return stream;
159 }
160 
161 inline istream & operator>>(istream & stream, Node & n){
162  stream >> n.d_ID >> n.d_position;
163  return stream;
164 }
165 
166 #endif //NODE_H
boolean separate(Mesh *mesh, FaceList *list, int new_material)
Definition: Node.cpp:162
int d_flag
Definition: Node.hpp:102
Node * d_nextNode
Definition: Node.hpp:104
This class encapsulate a node over a window manifold.
Definition: Manifold_2.h:370
Face * sharedFace(Node *n2, Node *n3, Node *n4=0)
Definition: Node.cpp:118
Definition: face.h:90
void addFace(Face *face)
Definition: Node.cpp:55
Element ** d_elements
Definition: Node.hpp:110
Face ** getAllFaces()
Retrieves a pointer to the internal array of faces associated with this node.
Definition: Node.hpp:135
Node()
Default constructor.
Definition: Manifold_2.h:373
Definition: MVec.hpp:8
Class Mesh is the main class that holds all information to describe the current state of the mesh...
Definition: Mesh.hpp:19
int getID()
Definition: Node.hpp:119
void setPosition(MVec pos)
Definition: Node.hpp:122
void addNextLink(Node *link)
Definition: Node.cpp:139
int d_numFaces
Definition: Node.hpp:108
int d_numElements
Definition: Node.hpp:112
int getNumElements()
retrieves the number of elements currently associated with this node.
Definition: Node.hpp:140
MVec d_position
Definition: Node.hpp:99
int getFlag() const
Definition: Node.hpp:150
~Node()
Definition: Node.cpp:45
MVec getPosition()
Definition: Node.hpp:125
int d_elementArraySize
Definition: Node.hpp:111
int d_ID
Definition: Node.hpp:100
Element * getElement(int Index)
Retrieves a pointer to the element referenced by the supplied index that is associated with this node...
Definition: Node.hpp:143
Face ** d_faces
Definition: Node.hpp:106
const NT & n
Face * getFace(int Index)
Retrieves a pointer to the face referenced by the supplied index that is associated with this node...
Definition: Node.hpp:131
int getNumFaces()
retrieves the number of faces currently associated with this node.
Definition: Node.hpp:128
Node * getNext()
ElementList * getSeparateElements(FaceList *list)
Definition: Node.cpp:192
void setFlag(int flag)
Definition: Node.hpp:153
void setID(int theID)
Definition: Node.hpp:116
FlagType
Definition: Node.hpp:15
std::istream & operator>>(std::istream &is, CGAL::Aff_transformation_2< R > &t)
std::ostream & operator<<(std::ostream &os, const COM_exception &ex)
Print out a given exception.
friend istream & operator>>(istream &stream, Node &n)
Definition: Node.hpp:161
int d_faceArraySize
Definition: Node.hpp:107
void removeFace(Face *face)
Definition: Node.cpp:70
The Face class is an abstract base class that supplies implemented general methods, as well as a vew virtual interface methods to child classes.
Definition: Face.hpp:19
void addElement(Element *elem)
Definition: Node.cpp:86
friend ostream & operator<<(ostream &stream, Node &n)
Definition: Node.hpp:156
void removeElement(Element *elem)
Definition: Node.cpp:102
Element ** getAllElements()
Retrieves a pointer to the internal array of elements associated with this node.
Definition: Node.hpp:147