Path: blob/devel/meshgen2d/src/include/BoundaryElement.h
3203 views
#if !defined( MESH_BOUNDARYELEMENT_H )1#define MESH_BOUNDARYELEMENT_H23#include "Node.h"4#include "Vertex.h"5#include <iostream>6#include <fstream>78class BoundaryElement9{10public:11friend std::ostream& operator<< (std::ostream& o, const BoundaryElement& A);12BoundaryElement( int edgeTag, Node* n1, Node* n2 )13{14edge = edgeTag;15a = n1;16b = n2;17c = NULL;18left = right = 0;19flipped = false;20newTag();21}2223void newTag();2425void flip( bool status ) { flipped = status; }2627Vertex* setHolder( Vertex *v )28{29Vertex *holder;3031if( !flipped )32{33holder = v->vertexWith(a, b);34left = holder->elementId();35}36else37{38holder = v->vertexWith(b, a);39right = holder->elementId();40}4142return holder;43}4445void setLeft( int id ) { (flipped?right:left) = id; }46void setRight( int id ) { (flipped?left:right) = id; }4748Node *from() { return a; }49Node *to() { return b; }50Node *middle() { return c; }5152void addMiddleNode(Node *n) { c = n; }5354private:55int edge;56Node *a, *b, *c;57int left, right;58bool flipped;59int tag;60};6162std::ostream& operator<< (std::ostream& o, const BoundaryElement& A);6364#endif /* MESH_BOUNDARYELEMENT_H */656667