-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015 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
// 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.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include <Geom2d_Curve.hxx>
#include <GeomAdaptor_Curve.hxx>
#include <TopoDS_Edge.hxx>
+#include <TopoDS_Face.hxx>
#include <TopoDS_Vertex.hxx>
#include <gp_Pnt2d.hxx>
class Adaptor2d_Curve2d;
class Adaptor3d_Curve;
class BRepAdaptor_CompCurve;
-class TopoDS_Face;
struct SMESH_ComputeError;
class StdMeshers_FaceSide;
/*!
* \brief Create a side from an UVPtStructVec
*/
- StdMeshers_FaceSide(UVPtStructVec& theSideNodes);
+ StdMeshers_FaceSide(UVPtStructVec& theSideNodes,
+ const TopoDS_Face& theFace = TopoDS_Face());
+
+ // static "consrtuctors"
+ static StdMeshers_FaceSidePtr New(const TopoDS_Face& Face,
+ const TopoDS_Edge& Edge,
+ SMESH_Mesh* Mesh,
+ const bool IsForward,
+ const bool IgnoreMediumNodes,
+ SMESH_ProxyMesh::Ptr ProxyMesh = SMESH_ProxyMesh::Ptr())
+ { return StdMeshers_FaceSidePtr
+ ( new StdMeshers_FaceSide( Face,Edge,Mesh,IsForward,IgnoreMediumNodes,ProxyMesh ));
+ }
+ static StdMeshers_FaceSidePtr New (const TopoDS_Face& Face,
+ std::list<TopoDS_Edge>& Edges,
+ SMESH_Mesh* Mesh,
+ const bool IsForward,
+ const bool IgnoreMediumNodes,
+ SMESH_ProxyMesh::Ptr ProxyMesh = SMESH_ProxyMesh::Ptr())
+ { return StdMeshers_FaceSidePtr
+ ( new StdMeshers_FaceSide( Face,Edges,Mesh,IsForward,IgnoreMediumNodes,ProxyMesh ));
+ }
+ static StdMeshers_FaceSidePtr New (const StdMeshers_FaceSide* Side,
+ const SMDS_MeshNode* Node,
+ const gp_Pnt2d* Pnt2d1,
+ const gp_Pnt2d* Pnt2d2=NULL,
+ const Handle(Geom2d_Curve)& C2d=NULL,
+ const double UFirst=0.,
+ const double ULast=1.)
+ { return StdMeshers_FaceSidePtr
+ ( new StdMeshers_FaceSide( Side,Node,Pnt2d1,Pnt2d2,C2d,UFirst,ULast ));
+ }
+ static StdMeshers_FaceSidePtr New (UVPtStructVec& theSideNodes,
+ const TopoDS_Face& theFace = TopoDS_Face())
+ {
+ return StdMeshers_FaceSidePtr( new StdMeshers_FaceSide( theSideNodes, theFace ));
+ }
/*!
* \brief Return wires of a face as StdMeshers_FaceSide's
SMESH_Mesh & theMesh,
const bool theIgnoreMediumNodes,
TError & theError,
- SMESH_ProxyMesh::Ptr theProxyMesh = SMESH_ProxyMesh::Ptr());
+ SMESH_ProxyMesh::Ptr theProxyMesh = SMESH_ProxyMesh::Ptr(),
+ const bool theCheckVertexNodes=true);
/*!
* \brief Change orientation of side geometry
*/
bool isXConst = 0,
double constValue = 0) const;
/*!
- * \brief Return nodes in the order they encounter while walking along the side.
+ * \brief Return nodes in the order they encounter while walking along
+ * the while side or a specified EDGE.
* For a closed side, the 1st point repeats at end
*/
- std::vector<const SMDS_MeshNode*> GetOrderedNodes() const;
+ std::vector<const SMDS_MeshNode*> GetOrderedNodes(int iE=-1) const;
+
+ /*!
+ * \brief Return nodes of the i-th EDGE.
+ * Nodes moved to other geometry by MergeNodes() are also returned.
+ * \retval bool - is OK
+ */
+ bool GetEdgeNodes(const size_t i,
+ std::vector<const SMDS_MeshNode*>& nodes,
+ bool inlude1stVertex=true,
+ bool inludeLastVertex=true) const;
+
+ /*!
+ * \brief Return a node from the i-th VERTEX (count starts from zero)
+ * Nodes moved to other geometry by MergeNodes() are also returned.
+ */
+ const SMDS_MeshNode* VertexNode(std::size_t i, bool* isMoved = 0) const;
/*!
* \brief Return edge and parameter on edge by normalized parameter
*/
int NbEdges() const { return myEdge.size(); }
/*!
- * \brief Return i-th wrapped edge (count starts from zero)
+ * \brief Return i-th edge (count starts from zero)
*/
const TopoDS_Edge& Edge(int i) const { return myEdge[i]; }
/*!
*/
const std::vector<TopoDS_Edge>& Edges() const { return myEdge; }
/*!
- * \brief Return 1st vertex of the i-the edge (count starts from zero)
+ * \brief Return 1st vertex of the i-th edge (count starts from zero)
*/
TopoDS_Vertex FirstVertex(int i=0) const;
/*!
- * \brief Return last vertex of the i-the edge (count starts from zero)
+ * \brief Return last vertex of the i-th edge (count starts from zero)
*/
TopoDS_Vertex LastVertex(int i=-1) const;
+ /*!
+ * \brief Return \c true if the chain of EDGEs is closed
+ */
+ bool IsClosed() const;
/*!
* \brief Return side length
*/
*/
inline Handle(Geom2d_Curve) Curve2d(int i) const;
/*!
- * \brief Return first normalized parameter of the i-the edge (count starts from zero)
+ * \brief Return first normalized parameter of the i-th 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)
+ * \brief Return last normalized parameter of the i-th edge (count starts from zero)
*/
inline double LastParameter(int i) const;
/*!
- * \brief Return first parameter of the i-the edge (count starts from zero).
+ * \brief Return first parameter of the i-th 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).
+ * \brief Return last parameter of the i-th edge (count starts from zero).
* EDGE orientation is taken into account
*/
inline double LastU(int i) const;
void reverseProxySubmesh( const TopoDS_Edge& E );
// DON't FORGET to update Reverse() when adding one more vector!
+ TopoDS_Face myFace;
std::vector<uvPtStruct> myPoints, myFalsePoints;
std::vector<TopoDS_Edge> myEdge;
std::vector<int> myEdgeID;
//================================================================================
/*!
- * \brief Return first normalized parameter of the i-the edge
+ * \brief Return first normalized parameter of the i-th edge
*/
//================================================================================
//================================================================================
/*!
- * \brief Return ast normalized parameter of the i-the edge
+ * \brief Return ast normalized parameter of the i-th edge
*/
//================================================================================
//================================================================================
/*!
- * \brief Return first parameter of the i-the edge
+ * \brief Return first parameter of the i-th edge
*/
//================================================================================
//================================================================================
/*!
- * \brief Return last parameter of the i-the edge
+ * \brief Return last parameter of the i-th edge
*/
//================================================================================