X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FStdMeshers%2FStdMeshers_FaceSide.hxx;h=1d4521dfe99bae2b145976e7f69dbab96b4fa67d;hb=4226c05219cd25e2952e1b553bde88ce8627a88d;hp=738b74f5a4493a4901c9a07a957cf39fd0047a5a;hpb=98119844c8755c5d2f89331db4c5e63a96b00c5e;p=modules%2Fsmesh.git diff --git a/src/StdMeshers/StdMeshers_FaceSide.hxx b/src/StdMeshers/StdMeshers_FaceSide.hxx index 738b74f5a..1d4521dfe 100644 --- a/src/StdMeshers/StdMeshers_FaceSide.hxx +++ b/src/StdMeshers/StdMeshers_FaceSide.hxx @@ -1,23 +1,23 @@ -// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE // -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. // -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File : StdMeshers_FaceSide.hxx @@ -28,14 +28,16 @@ #ifndef StdMeshers_FaceSide_HeaderFile #define StdMeshers_FaceSide_HeaderFile +#include "SMESH_StdMeshers.hxx" + +#include "SMESH_ProxyMesh.hxx" + #include #include #include #include #include -#include "SMESH_StdMeshers.hxx" - #include #include #include @@ -47,24 +49,11 @@ class Adaptor3d_Curve; class BRepAdaptor_CompCurve; class TopoDS_Face; struct SMESH_ComputeError; - -typedef struct uvPtStruct -{ - double param; - //int curvIndex; - double normParam; - double u; // original 2d parameter - double v; - double x; // 2d parameter, normalized [0,1] - double y; - const SMDS_MeshNode * node; -} UVPtStruct; - class StdMeshers_FaceSide; + +typedef boost::shared_ptr< SMESH_ComputeError > TError; typedef boost::shared_ptr< StdMeshers_FaceSide > StdMeshers_FaceSidePtr; -typedef boost::shared_ptr< uvPtStruct > UVPtStructPtr; -typedef std::vector< StdMeshers_FaceSidePtr > TSideVector; -typedef boost::shared_ptr< SMESH_ComputeError > TError; +typedef std::vector< StdMeshers_FaceSidePtr > TSideVector; //================================================================================ /*! @@ -79,33 +68,35 @@ public: /*! * \brief Wrap one edge */ - StdMeshers_FaceSide(const TopoDS_Face& theFace, - const TopoDS_Edge& theEdge, - SMESH_Mesh* theMesh, - const bool theIsForward, - const bool theIgnoreMediumNodes); + StdMeshers_FaceSide(const TopoDS_Face& theFace, + const TopoDS_Edge& theEdge, + SMESH_Mesh* theMesh, + const bool theIsForward, + const bool theIgnoreMediumNodes, + SMESH_ProxyMesh::Ptr theProxyMesh = SMESH_ProxyMesh::Ptr()); /*! * \brief Wrap several edges. Edges must be properly ordered and oriented. */ - StdMeshers_FaceSide(const TopoDS_Face& theFace, + StdMeshers_FaceSide(const TopoDS_Face& theFace, std::list& theEdges, - SMESH_Mesh* theMesh, - const bool theIsForward, - const bool theIgnoreMediumNodes); + SMESH_Mesh* theMesh, + const bool theIsForward, + const bool theIgnoreMediumNodes, + SMESH_ProxyMesh::Ptr theProxyMesh = SMESH_ProxyMesh::Ptr()); /*! - * \brief Wrap for vertex using data from other FaceSide + * \brief Simulate a side from a vertex using data from other FaceSide */ - StdMeshers_FaceSide(const SMDS_MeshNode* theNode, - const gp_Pnt2d thePnt2d, + StdMeshers_FaceSide(const SMDS_MeshNode* theNode, + const gp_Pnt2d thePnt2d, const StdMeshers_FaceSide* theSide); /*! * \brief Return wires of a face as StdMeshers_FaceSide's */ - static TSideVector GetFaceWires(const TopoDS_Face& theFace, - SMESH_Mesh & theMesh, - const bool theIgnoreMediumNodes, - TError & theError); - + static TSideVector GetFaceWires(const TopoDS_Face& theFace, + SMESH_Mesh & theMesh, + const bool theIgnoreMediumNodes, + TError & theError, + SMESH_ProxyMesh::Ptr theProxyMesh = SMESH_ProxyMesh::Ptr()); /*! * \brief Change orientation of side geometry */ @@ -121,7 +112,7 @@ public: /*! * \brief Return mesh */ - SMESH_Mesh* GetMesh() const { return myMesh; } + SMESH_Mesh* GetMesh() const { return myProxyMesh->GetMesh(); } /*! * \brief Return true if there are vertices without nodes */ @@ -131,17 +122,23 @@ public: * \param isXConst - true if normalized parameter X is constant * \param constValue - constant parameter value * - * Missing nodes are allowed only on internal vertices + * Missing nodes are allowed only on internal vertices. + * For a closed side, the 1st point repeats at end */ - const std::vector& GetUVPtStruct(bool isXConst =0, double constValue =0) const; + const UVPtStructVec& GetUVPtStruct(bool isXConst =0, double constValue =0) const; /*! * \brief Simulates detailed data on nodes * \param isXConst - true if normalized parameter X is constant * \param constValue - constant parameter value */ - const std::vector& SimulateUVPtStruct(int nbSeg, - bool isXConst = 0, - double constValue = 0) const; + const UVPtStructVec& SimulateUVPtStruct(int nbSeg, + bool isXConst = 0, + double constValue = 0) const; + /*! + * \brief Return nodes in the order they encounter while walking along the side. + * For a closed side, the 1st point repeats at end + */ + std::vector GetOrderedNodes() const; /*! * \brief Return edge and parameter on edge by normalized parameter */ @@ -166,6 +163,10 @@ public: * \brief Return i-th wrapped edge (count starts from zero) */ const TopoDS_Edge& Edge(int i) const { return myEdge[i]; } + /*! + * \brief Return all edges + */ + const std::vector& Edges() const { return myEdge; } /*! * \brief Return 1st vertex of the i-the edge (count starts from zero) */ @@ -174,14 +175,6 @@ public: * \brief Return last vertex of the i-the edge (count starts from zero) */ TopoDS_Vertex LastVertex(int i=-1) const; - /*! - * \brief Return first normalized parameter of the i-the edge (count starts from zero) - */ - inline double FirstParameter(int i) const; - /*! - * \brief Return ast normalized parameter of the i-the edge (count starts from zero) - */ - inline double LastParameter(int i) const; /*! * \brief Return side length */ @@ -195,10 +188,46 @@ public: void dump(const char* msg=0) const; + /*! + * \brief Return ID of i-th wrapped edge (count starts from zero) + */ + inline int EdgeID(int i) const; + /*! + * \brief Return p-curve of i-th wrapped edge (count starts from zero) + */ + inline Handle(Geom2d_Curve) Curve2d(int i) const; + /*! + * \brief Return first normalized parameter of the i-the edge (count starts from zero) + */ + inline double FirstParameter(int i) const; + /*! + * \brief Return last normalized parameter of the i-the edge (count starts from zero) + */ + inline double LastParameter(int i) const; + /*! + * \brief Return first parameter of the i-the edge (count starts from zero). + * EDGE orientation is taken into account + */ + inline double FirstU(int i) const; + /*! + * \brief Return last parameter of the i-the edge (count starts from zero). + * EDGE orientation is taken into account + */ + inline double LastU(int i) const; + /*! + * \brief Return length of i-th wrapped edge (count starts from zero) + */ + inline double EdgeLength(int i) const; + /*! + * \brief Return orientation of i-th wrapped edge (count starts from zero) + */ + inline bool IsReversed(int i) const; protected: - // DON't FORGET tO update Reverse() when adding one more vector! + void reverseProxySubmesh( const TopoDS_Edge& E ); + + // DON't FORGET to update Reverse() when adding one more vector! std::vector myPoints, myFalsePoints; std::vector myEdge; std::vector myEdgeID; @@ -210,7 +239,7 @@ protected: std::vector myIsUniform; double myLength; int myNbPonits, myNbSegments; - SMESH_Mesh* myMesh; + SMESH_ProxyMesh::Ptr myProxyMesh; bool myMissingVertexNodes, myIgnoreMediumNodes; gp_Pnt2d myDefaultPnt2d; }; @@ -256,7 +285,7 @@ inline double StdMeshers_FaceSide::Parameter(double U, TopoDS_Edge & edge) const inline double StdMeshers_FaceSide::FirstParameter(int i) const { - return i==0 ? 0. : i myLast[i]; } #endif