00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef EDGE_H
00021 #define EDGE_H
00022
00023 #include "conftrans.h"
00024 #include "integrablechord.h"
00025 #include <vector>
00026 #include "config.h"
00027 #ifdef HAVE_LIBPLPLOTCXXD
00028 #include <plplot/plstream.h>
00029 #endif
00030
00031
00036 class edge: public integrablechord {
00040 int nextInChain;
00041
00045 int nposElem;
00046
00050 int nnegElem;
00051
00052
00053 public:
00064 edge(conftrans CT, const chord &ch, int nrule, int nposElem, int nnegElem);
00065
00070 edge(const edge& other);
00076 inline bool isBordering(int nElem) const {
00077 return (nElem==nposElem) || (nElem==nnegElem);
00078 };
00079
00084 bool isOuterBoundary() const {
00085 return tol_eq(getRS(),1.0)&&tol_eq(getRF(),1.0);
00086 };
00087
00092 inline int getPosBordering() {
00093 return nposElem;
00094 };
00095
00100 inline int getNegBordering() {
00101 return nnegElem;
00102 };
00103
00109 inline void replaceBordering(int noldElem, int nnewElem) {
00110 if (nposElem==noldElem) setPosBordering(nnewElem);
00111 if (nnegElem==noldElem) setNegBordering(nnewElem);
00112 };
00113
00118 inline void setPosBordering(int nElem) {
00119 nposElem=nElem;
00120 };
00121
00128 void setPosBordering(int nnewElem, int nelem, std::vector<edge> &Edges);
00129
00130
00135 inline void setNegBordering(int nElem) {
00136 nnegElem=nElem;
00137 };
00138
00145 void setNegBordering(int nnewElem, int nelem, std::vector<edge> &Edges);
00146
00147
00154 void replaceBordering(int noldElem, int nnewElem, std::vector<edge> &Edges);
00155
00160 inline int getNextInChain() const {
00161 return nextInChain;
00162 };
00163
00174 int breakInHalves(conftrans CT, int nelem, std::vector<edge> &Edges);
00175
00181 double getLength(int nelem, const std::vector<edge> &Edges) const;
00182
00183
00188 virtual int getStorage();
00189
00190
00191 #ifdef HAVE_LIBPLPLOTCXXD
00192
00196 void drawEdge(conftrans CT, plstream &pls) const;
00197 #endif
00198
00199 ~edge();
00200
00201 private:
00202
00207 void recalcInfo(conftrans CT);
00208
00209
00219 double getVHLength(int nelem, const std::vector<edge> &Edges) const;
00220 };
00221
00222
00223 typedef std::vector<edge> edges;
00224
00225 #endif