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 __INTERPKERNELGEO2DEDGELIN_HXX__
00021 #define __INTERPKERNELGEO2DEDGELIN_HXX__
00022
00023 #include "INTERPKERNELGEOMETRIC2DDefines.hxx"
00024 #include "InterpKernelGeo2DEdge.hxx"
00025
00026 namespace INTERP_KERNEL
00027 {
00028 class SegSegIntersector : SameTypeEdgeIntersector
00029 {
00030 friend class Edge;
00031 public:
00032 SegSegIntersector(const EdgeLin& e1, const EdgeLin& e2);
00033 bool areColinears() const;
00034 bool haveTheySameDirection() const;
00035 void getPlacements(Node *start, Node *end, TypeOfLocInEdge& whereStart, TypeOfLocInEdge& whereEnd, MergePoints& commonNode) const;
00036 void areOverlappedOrOnlyColinears(const Bounds *whereToFind, bool& obviousNoIntersection, bool& areOverlapped);
00037 std::list< IntersectElement > getIntersectionsCharacteristicVal() const;
00038 private:
00039 void getCurveAbscisse(Node *node, TypeOfLocInEdge& where, MergePoints& commonNode) const;
00040 private:
00042 int _ind;
00043 double _col[2];
00044 double _matrix[4];
00045 };
00046
00047 class INTERPKERNELGEOMETRIC2D_EXPORT EdgeLin : public Edge
00048 {
00049 friend class SegSegIntersector;
00050 public:
00051 EdgeLin(std::istream& lineInXfig);
00052 EdgeLin(Node *start, Node *end, bool direction=true);
00053 EdgeLin(double sX, double sY, double eX, double eY);
00054 ~EdgeLin();
00055 TypeOfFunction getTypeOfFunc() const { return SEG; }
00056 void dumpInXfigFile(std::ostream& stream, bool direction, int resolution, const Bounds& box) const;
00057 void update(Node *m);
00058 double getNormSq() const;
00059 double getAreaOfZone() const;
00060 double getCurveLength() const;
00061 void getBarycenter(double *bary) const;
00062 void getBarycenterOfZone(double *bary) const;
00063 bool isIn(double characterVal) const;
00064 Node *buildRepresentantOfMySelf() const;
00065 double getCharactValue(const Node& node) const;
00066 double getDistanceToPoint(const double *pt) const;
00067 bool isNodeLyingOn(const double *coordOfNode) const;
00068 bool isLower(double val1, double val2) const { return val1<val2; }
00069 double getCharactValueEng(const double *node) const;
00070 bool doIHaveSameDirectionAs(const Edge& other) const;
00071 void dynCastFunction(const EdgeLin * &seg,
00072 const EdgeArcCircle * &arcSeg) const { seg=this; }
00073 protected:
00074 EdgeLin() { }
00075 void updateBounds();
00076 Edge *buildEdgeLyingOnMe(Node *start, Node *end, bool direction) const;
00077 };
00078 }
00079
00080 #endif