X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FStdMeshers%2FStdMeshers_FaceSide.hxx;h=4a119ed848e7ebb7e5a4619dab2b25155389f974;hb=2c8f4c513e0fed76a7f0331542e520e315740aa4;hp=e34dfe51235aea00329542e008410156a0fe90cb;hpb=79b1ac2b6df9117f16f11d444b1f165d477a1813;p=modules%2Fsmesh.git diff --git a/src/StdMeshers/StdMeshers_FaceSide.hxx b/src/StdMeshers/StdMeshers_FaceSide.hxx index e34dfe512..4a119ed84 100644 --- a/src/StdMeshers/StdMeshers_FaceSide.hxx +++ b/src/StdMeshers/StdMeshers_FaceSide.hxx @@ -1,42 +1,40 @@ -// SMESH SMESH : implementaion of SMESH idl descriptions +// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE // -// Copyright (C) 2003 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 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 -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// 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 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 // +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + // File : StdMeshers_FaceSide.hxx // Created : Wed Jan 31 18:41:25 2007 // Author : Edward AGAPOV (eap) // Module : SMESH - +// #ifndef StdMeshers_FaceSide_HeaderFile #define StdMeshers_FaceSide_HeaderFile -#include +#include "SMESH_StdMeshers.hxx" + +#include +#include #include #include -#include -#include - -#include "SMESH_StdMeshers.hxx" -#include "SMESH_Algo.hxx" +#include #include #include @@ -48,7 +46,7 @@ class Adaptor2d_Curve2d; class Adaptor3d_Curve; class BRepAdaptor_CompCurve; class TopoDS_Face; -class SMESH_ComputeError; +struct SMESH_ComputeError; typedef struct uvPtStruct { @@ -64,9 +62,8 @@ typedef struct uvPtStruct class StdMeshers_FaceSide; 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; +typedef boost::shared_ptr< SMESH_ComputeError > TError; //================================================================================ /*! @@ -89,12 +86,17 @@ public: /*! * \brief Wrap several edges. Edges must be properly ordered and oriented. */ - StdMeshers_FaceSide(const TopoDS_Face& theFace, - list& theEdges, - SMESH_Mesh* theMesh, - const bool theIsForward, - const bool theIgnoreMediumNodes); - + StdMeshers_FaceSide(const TopoDS_Face& theFace, + std::list& theEdges, + SMESH_Mesh* theMesh, + const bool theIsForward, + const bool theIgnoreMediumNodes); + /*! + * \brief Simulate a side from a vertex using data from other FaceSide + */ + StdMeshers_FaceSide(const SMDS_MeshNode* theNode, + const gp_Pnt2d thePnt2d, + const StdMeshers_FaceSide* theSide); /*! * \brief Return wires of a face as StdMeshers_FaceSide's */ @@ -120,7 +122,7 @@ public: */ SMESH_Mesh* GetMesh() const { return myMesh; } /*! - * \brief Return true if there vertices without nodes + * \brief Return true if there are vertices without nodes */ bool MissVertexNode() const { return myMissingVertexNodes; } /*! @@ -128,17 +130,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 vector& GetUVPtStruct(bool isXConst =0, double constValue =0) const; + const std::vector& 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 vector& SimulateUVPtStruct(int nbSeg, - bool isXConst = 0, - double constValue = 0) const; + const std::vector& 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 */ @@ -163,14 +171,18 @@ 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) */ - inline TopoDS_Vertex FirstVertex(int i=0) const; + TopoDS_Vertex FirstVertex(int i=0) const; /*! * \brief Return last vertex of the i-the edge (count starts from zero) */ - inline TopoDS_Vertex LastVertex(int i=-1) const; + TopoDS_Vertex LastVertex(int i=-1) const; /*! * \brief Return first normalized parameter of the i-the edge (count starts from zero) */ @@ -194,15 +206,22 @@ public: protected: - vector myPoints, myFalsePoints; - vector myEdge; - vector myC2d; - vector myFirst, myLast; - vector myNormPar; - double myLength; - int myNbPonits, myNbSegments; - SMESH_Mesh* myMesh; - bool myMissingVertexNodes, myIgnoreMediumNodes; + + // DON't FORGET to update Reverse() when adding one more vector! + std::vector myPoints, myFalsePoints; + std::vector myEdge; + std::vector myEdgeID; + std::vector myC2d; + std::vector myC3dAdaptor; + std::vector myFirst, myLast; + std::vector myNormPar; + std::vector myEdgeLength; + std::vector myIsUniform; + double myLength; + int myNbPonits, myNbSegments; + SMESH_Mesh* myMesh; + bool myMissingVertexNodes, myIgnoreMediumNodes; + gp_Pnt2d myDefaultPnt2d; }; @@ -238,28 +257,6 @@ inline double StdMeshers_FaceSide::Parameter(double U, TopoDS_Edge & edge) const return myFirst[i] * ( 1 - r ) + myLast[i] * r; } -//================================================================================ -/*! - * \brief Return 1st vertex of the i-the edge - */ -//================================================================================ - -inline TopoDS_Vertex StdMeshers_FaceSide::FirstVertex(int i) const -{ - return i < myEdge.size() ? TopExp::FirstVertex( myEdge[i], 1 ) : TopoDS_Vertex(); -} - -//================================================================================ -/*! - * \brief Return last vertex of the i-the edge - */ -//================================================================================ - -inline TopoDS_Vertex StdMeshers_FaceSide::LastVertex(int i) const -{ - return i<0 ? TopExp::LastVertex( myEdge.back(), 1) : i