Version: 6.3.1

src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdgeLin.hxx

Go to the documentation of this file.
00001 // Copyright (C) 2007-2011  CEA/DEN, EDF R&D
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
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];//SPACEDIM*SPACEDIM
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
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS