Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __INTERPKERNELGEO2DCOMPOSEDNODE_HXX__
00021 #define __INTERPKERNELGEO2DCOMPOSEDNODE_HXX__
00022
00023 #include "INTERPKERNELGEOMETRIC2DDefines.hxx"
00024
00025 #include <set>
00026 #include <list>
00027 #include <vector>
00028 #include <ostream>
00029
00030 namespace INTERP_KERNEL
00031 {
00032 class Node;
00033 class Edge;
00034 class Bounds;
00035 class ElementaryEdge;
00036 class IteratorOnComposedEdge;
00037
00038 class INTERPKERNELGEOMETRIC2D_EXPORT ComposedEdge
00039 {
00040 friend class IteratorOnComposedEdge;
00041 public:
00042 ComposedEdge() { }
00043 ComposedEdge(const ComposedEdge& other);
00044 ComposedEdge(int size):_sub_edges(size) { }
00045 static void Delete(ComposedEdge *pt) { delete pt; }
00046 static void SoftDelete(ComposedEdge *pt) { pt->_sub_edges.clear(); delete pt; }
00047 void reverse();
00048 int recursiveSize() const { return _sub_edges.size(); }
00049 void initLocations() const;
00050 ComposedEdge *clone() const;
00051 bool isNodeIn(Node *n) const;
00052 double getArea() const;
00053 double getPerimeter() const;
00054 double getHydraulicDiameter() const;
00055 void getBarycenter(double *bary) const;
00056 void getBarycenterGeneral(double *bary) const;
00057 double normalize(ComposedEdge *other, double& xBary, double& yBary);
00058 void fillBounds(Bounds& output) const;
00059 void applySimilarity(double xBary, double yBary, double dimChar);
00060 void applyGlobalSimilarity(double xBary, double yBary, double dimChar);
00061 void dispatchPerimeter(double& partConsidered) const;
00062 void dispatchPerimeterExcl(double& partConsidered, double& commonPart) const;
00063 double dispatchPerimeterAdv(const ComposedEdge& father, std::vector<double>& result) const;
00064 void getAllNodes(std::set<Node *>& output) const;
00065 void getBarycenter(double *bary, double& weigh) const;
00066 bool completed() const { return getEndNode()==getStartNode(); }
00067 void setValueAt(int i, Edge *e, bool direction=true);
00068 double getCommonLengthWith(const ComposedEdge& other) const;
00069 void clear();
00070 bool empty() const { return _sub_edges.empty(); }
00071 ElementaryEdge *front() const { return _sub_edges.front(); }
00072 ElementaryEdge *back() const { return _sub_edges.back(); }
00073 void resize(int i) { _sub_edges.resize(i); }
00074 void pushBack(Edge *edge, bool direction=true);
00075 void pushBack(ElementaryEdge *elem);
00076 void pushBack(ComposedEdge *elem);
00077 int size() const { return _sub_edges.size(); }
00078 ElementaryEdge *operator[](int i) const;
00079 Node *getEndNode() const;
00080 Node *getStartNode() const;
00081 bool changeEndNodeWith(Node *node) const;
00082 bool changeStartNodeWith(Node *node) const;
00083 void dumpInXfigFile(std::ostream& stream, int resolution, const Bounds& box) const;
00084 bool isInOrOut(Node *nodeToTest) const;
00085 bool getDirection() const;
00086 bool intresincEqCoarse(const Edge *other) const;
00087 private:
00088 std::list<ElementaryEdge *>* getListBehind() { return &_sub_edges; }
00089 protected:
00090 ~ComposedEdge();
00091 private:
00092 void clearAll(std::list<ElementaryEdge *>::iterator startToDel);
00093 protected:
00094 std::list<ElementaryEdge *> _sub_edges;
00095 };
00096 }
00097
00098 #endif