#include "SMESH_Algo.hxx"
#include "SMESH_Mesh.hxx"
#include "SMESH_MeshEditor.hxx"
+#include "SMESH_ComputeError.hxx"
+#include "SMESH_Block.hxx"
#include <Adaptor2d_Curve2d.hxx>
#include <BRepAdaptor_CompCurve.hxx>
}
return gp_Pnt2d( 1e+100, 1e+100 );
}
+
+//================================================================================
+/*!
+ * \brief Return wires of a face as StdMeshers_FaceSide's
+ */
+//================================================================================
+
+TSideVector StdMeshers_FaceSide::GetFaceWires(const TopoDS_Face& theFace,
+ SMESH_Mesh & theMesh,
+ const bool theIgnoreMediumNodes,
+ TError & theError)
+{
+ TopoDS_Vertex V1;
+ list< TopoDS_Edge > edges;
+ list< int > nbEdgesInWires;
+ int nbWires = SMESH_Block::GetOrderedEdges (theFace, V1, edges, nbEdgesInWires);
+
+ // split list of all edges into separate wires
+ TSideVector wires( nbWires );
+ list< int >::iterator nbE = nbEdgesInWires.begin();
+ list< TopoDS_Edge >::iterator from, to;
+ from = to = edges.begin();
+ for ( int iW = 0; iW < nbWires; ++iW )
+ {
+ std::advance( to, *nbE++ );
+ list< TopoDS_Edge > wireEdges( from, to );
+ // assure that there is a node on the first vertex
+ // as StdMeshers_FaceSide::GetUVPtStruct() requires
+ while ( !SMESH_Algo::VertexNode( TopExp::FirstVertex( wireEdges.front(), true),
+ theMesh.GetMeshDS()))
+ {
+ wireEdges.splice(wireEdges.end(), wireEdges,
+ wireEdges.begin(), ++wireEdges.begin());
+ if ( from->IsSame( wireEdges.front() )) {
+ theError = TError
+ ( new SMESH_ComputeError(COMPERR_BAD_INPUT_MESH,"No nodes on vertices"));
+ return TSideVector(0);
+ }
+ }
+ StdMeshers_FaceSide* wire = new StdMeshers_FaceSide( theFace, wireEdges, &theMesh,
+ true, theIgnoreMediumNodes);
+ wires[ iW ] = StdMeshers_FaceSidePtr( wire );
+ from = to;
+ }
+ return wires;
+}
+
class Adaptor3d_Curve;
class BRepAdaptor_CompCurve;
class TopoDS_Face;
+class SMESH_ComputeError;
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;
//================================================================================
/*!
SMESH_Mesh* theMesh,
const bool theIsForward,
const bool theIgnoreMediumNodes);
+
+ /*!
+ * \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);
+
/*!
* \brief Change orientation of side geometry
*/
*
* Missing nodes are allowed only on internal vertices
*/
- const vector<UVPtStruct>& GetUVPtStruct(bool isXConst, double constValue) const;
+ const vector<UVPtStruct>& 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<UVPtStruct>& SimulateUVPtStruct(int nbSeg,
- bool isXConst,
- double constValue) const;
+ bool isXConst = 0,
+ double constValue = 0) const;
/*!
* \brief Return edge and parameter on edge by normalized parameter
*/