31enum NodeState{No, Original, Secondary, Connected};
39class DLLEXPORT
Node :
public BaseEntity {
46 Node(
double x,
double y,
double z=0.0);
49 Node(
const RVector3 & pos);
52 Node(
const RVector3 & pos,
int marker,
int id=-1);
58 Node & operator = (
const Node & node);
64 inline double & operator [] (
const Index i) {
return this->at(i); }
67 inline const double & operator [] (
const Index i)
const {
return this->at(i); }
69 inline uint
rtti()
const {
return MESH_NODE_RTTI; }
71 inline void setPos(
const RVector3 & pos) { changed_(); pos_ = pos; }
73 inline const RVector3 & pos()
const {
return pos_; }
76 inline RVector3 &
pos() {
return pos_; }
78 inline void insertBoundary(
Boundary * bound){ boundSet_.insert(bound); }
80 inline void eraseBoundary(Boundary * bound){ boundSet_.erase(bound); }
82 inline void insertCell(Cell * cell){ cellSet_.insert(cell); }
84 inline void eraseCell(Cell * cell){ cellSet_.erase(cell); }
86 inline const std::set < Boundary * > & boundSet()
const {
return boundSet_; }
88 inline std::set < Boundary * > & boundSet() {
return boundSet_; }
90 inline const std::set < Cell * > & cellSet()
const {
return cellSet_; }
92 inline std::set < Cell * > & cellSet() {
return cellSet_; }
94 void transform(
const RMatrix & mat);
96 inline void scale(
const RVector3 & s) { changed_(); pos_.scale(s); }
98 inline void translate(
const RVector3 & t) { changed_(); pos_.translate(t); }
100 inline void translate(
double x,
double y=0.0,
double z=0.0) {
101 changed_(); pos_.translate(x, y, z); }
103 inline void rotate(
const RVector3 & r) { changed_(); pos_.rotate(r); }
105 inline void swap(Index i, Index j) { changed_(); pos_.swap(i, j); }
107 inline const double &
x()
const {
return pos_[0]; }
109 inline const double &
y()
const {
return pos_[1]; }
111 inline const double &
z()
const {
return pos_[2]; }
113 inline double & at(Index i) {
return pos_[i]; }
115 inline const double & at(Index i)
const {
return pos_[i]; }
117 inline double dist(
const Node & n)
const {
return pos_.dist(n.pos()); }
120 void smooth(uint function);
126 const NodeState
state()
const {
return this->_state; }
128 void setSecondaryParent(
MeshEntity * e) { this->_secondaryParent = e; }
134 void copy_(
const Node & node);
142 std::set < Boundary * > boundSet_;
143 std::set < Cell * > cellSet_;
151DLLEXPORT std::ostream & operator << (std::ostream & str,
const std::vector < GIMLI::Node * > & nodes);