Version: 6.3.1

src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DElementaryEdge.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 __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
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