Version: 6.3.1

src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DComposedEdge.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 __INTERPKERNELGEO2DCOMPOSEDNODE_HXX__
00021 #define __INTERPKERNELGEO2DCOMPOSEDNODE_HXX__
00022 
00023 #include "INTERPKERNELGEOMETRIC2DDefines.hxx"
00024 
00025 #include <set>
00026 #include <list>
00027 #include <vector>
00028 #include <ostream>
00029 
00030 namespace INTERP_KERNEL
00031 {
00032   class Node;
00033   class Edge;
00034   class Bounds;
00035   class ElementaryEdge;
00036   class IteratorOnComposedEdge;
00037 
00038   class INTERPKERNELGEOMETRIC2D_EXPORT ComposedEdge
00039   {
00040     friend class IteratorOnComposedEdge;
00041   public:
00042     ComposedEdge() { }
00043     ComposedEdge(const ComposedEdge& other);
00044     ComposedEdge(int size):_sub_edges(size) { }
00045     static void Delete(ComposedEdge *pt) { delete pt; }
00046     static void SoftDelete(ComposedEdge *pt) { pt->_sub_edges.clear(); delete pt; }
00047     void reverse();
00048     int recursiveSize() const { return _sub_edges.size(); }
00049     void initLocations() const;
00050     ComposedEdge *clone() const;
00051     bool isNodeIn(Node *n) const;
00052     double getArea() const;
00053     double getPerimeter() const;
00054     double getHydraulicDiameter() const;
00055     void getBarycenter(double *bary) const;
00056     void getBarycenterGeneral(double *bary) const;
00057     double normalize(ComposedEdge *other, double& xBary, double& yBary);
00058     void fillBounds(Bounds& output) const;
00059     void applySimilarity(double xBary, double yBary, double dimChar);
00060     void applyGlobalSimilarity(double xBary, double yBary, double dimChar);
00061     void dispatchPerimeter(double& partConsidered) const;
00062     void dispatchPerimeterExcl(double& partConsidered, double& commonPart) const;
00063     double dispatchPerimeterAdv(const ComposedEdge& father, std::vector<double>& result) const;
00064     void getAllNodes(std::set<Node *>& output) const;
00065     void getBarycenter(double *bary, double& weigh) const;
00066     bool completed() const { return getEndNode()==getStartNode(); }
00067     void setValueAt(int i, Edge *e, bool direction=true);
00068     double getCommonLengthWith(const ComposedEdge& other) const;
00069     void clear();
00070     bool empty() const { return _sub_edges.empty(); }
00071     ElementaryEdge *front() const { return _sub_edges.front(); }
00072     ElementaryEdge *back() const { return _sub_edges.back(); }
00073     void resize(int i) { _sub_edges.resize(i); }
00074     void pushBack(Edge *edge, bool direction=true);
00075     void pushBack(ElementaryEdge *elem);
00076     void pushBack(ComposedEdge *elem);
00077     int size() const { return _sub_edges.size(); }
00078     ElementaryEdge *operator[](int i) const;
00079     Node *getEndNode() const;
00080     Node *getStartNode() const;
00081     bool changeEndNodeWith(Node *node) const;
00082     bool changeStartNodeWith(Node *node) const;
00083     void dumpInXfigFile(std::ostream& stream, int resolution, const Bounds& box) const;
00084     bool isInOrOut(Node *nodeToTest) const;
00085     bool getDirection() const;
00086     bool intresincEqCoarse(const Edge *other) const;
00087   private:
00088     std::list<ElementaryEdge *>* getListBehind() { return &_sub_edges; }
00089   protected:
00090     ~ComposedEdge();
00091   private:
00092     void clearAll(std::list<ElementaryEdge *>::iterator startToDel);
00093   protected:
00094     std::list<ElementaryEdge *> _sub_edges;
00095   };
00096 }
00097 
00098 #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