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 __INTERPKERNELGEO2DELEMENTARYEDGE_HXX__
00021 #define __INTERPKERNELGEO2DELEMENTARYEDGE_HXX__
00022
00023 #include "INTERPKERNELGEOMETRIC2DDefines.hxx"
00024 #include "InterpKernelException.hxx"
00025 #include "InterpKernelGeo2DAbstractEdge.hxx"
00026 #include "InterpKernelGeo2DEdge.hxx"
00027
00028 namespace INTERP_KERNEL
00029 {
00030 class INTERPKERNELGEOMETRIC2D_EXPORT ElementaryEdge
00031 {
00032 public:
00033 ElementaryEdge(Edge *ptr, bool direction):_direction(direction),_ptr(ptr) { }
00034 ElementaryEdge(const ElementaryEdge& other);
00035 ~ElementaryEdge();
00036 bool isThereStartPoint() const { return _iterator.isValid(); }
00037 IteratorOnComposedEdge& getIterator() { return _iterator; }
00038 bool completed() const { return false; }
00039 void declareOn() const { _ptr->declareOn(); }
00040 void declareIn() const { _ptr->declareIn(); }
00041 void declareOut() const { _ptr->declareOut(); }
00042 TypeOfEdgeLocInPolygon getLoc() const { return _ptr->getLoc(); }
00043 Edge *getPtr() const { return _ptr; }
00044 void reverse() { _direction=(!_direction); }
00045 bool isNodeIn(Node *n) const;
00046 double getAreaOfZone() const { double ret=_ptr->getAreaOfZone(); return _direction?ret:-ret; }
00047 void getBarycenterOfZone(double *bary) const;
00048 void fillBounds(Bounds& output) const;
00049 void applySimilarity(double xBary, double yBary, double dimChar) { _ptr->applySimilarity(xBary,yBary,dimChar); }
00050 void getAllNodes(std::set<Node *>& output) const;
00051 void getBarycenter(double *bary, double& weigh) const;
00052 ElementaryEdge *clone() const;
00053 void initLocations() const;
00054 int size() const;
00055 TypeOfEdgeLocInPolygon locateFullyMySelfAbsolute(const ComposedEdge& pol) const;
00056 TypeOfEdgeLocInPolygon locateFullyMySelf(const ComposedEdge& pol, TypeOfEdgeLocInPolygon precEdgeLoc) const;
00057 Node *getEndNode() const;
00058 Node *getStartNode() const;
00059 double getCurveLength() const { return _ptr->getCurveLength(); }
00060 bool changeEndNodeWith(Node *node) const;
00061 bool changeStartNodeWith(Node *node) const;
00062 bool intresicEqual(const ElementaryEdge *other) const;
00063 bool intresicEqualDirSensitive(const ElementaryEdge *other) const;
00064 void dumpInXfigFile(std::ostream& stream, int resolution, const Bounds& box) const;
00065 bool getDirection() const { return _direction; }
00066 bool intresincEqCoarse(const Edge *other) const;
00067 private:
00068 bool _direction;
00069 Edge *_ptr;
00070 IteratorOnComposedEdge _iterator;
00071 };
00072 }
00073
00074 #endif