X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FStdMeshers%2FStdMeshers_FaceSide.cxx;h=37bc6c346792d2ccbb0e37dae0ed57c9e389019c;hp=36f0680cc4267e48bd301fc4ff4df772709f3011;hb=9a54694a0ab1e5cbc558a35c4606ceea4f7af2ef;hpb=1067ffa6e7e5c394e3a1b17219d8b355a57607cd diff --git a/src/StdMeshers/StdMeshers_FaceSide.cxx b/src/StdMeshers/StdMeshers_FaceSide.cxx index 36f0680cc..37bc6c346 100644 --- a/src/StdMeshers/StdMeshers_FaceSide.cxx +++ b/src/StdMeshers/StdMeshers_FaceSide.cxx @@ -160,11 +160,10 @@ StdMeshers_FaceSide::StdMeshers_FaceSide(const TopoDS_Face& theFace, double d4 = GCPnts_AbscissaPoint::Length( A2dC, myFirst[i], p4 ); //cout<<"len = "< 0 ) + { + StdMeshers_FaceSide* me = (StdMeshers_FaceSide*) this; + me->myNbPonits = 0; + me->myNbSegments = 0; + me->myMissingVertexNodes = false; + + for ( int i = 0; i < NbEdges(); ++i ) + { + TopoDS_Vertex v1 = SMESH_MesherHelper::IthVertex( 0, myEdge[i] ); + if ( SMESH_Algo::VertexNode( v1, myProxyMesh->GetMeshDS() )) + me->myNbPonits += 1; // for the first end + else + me->myMissingVertexNodes = true; + + if ( const SMESHDS_SubMesh* sm = myProxyMesh->GetSubMesh( Edge(i) )) { + int nbN = sm->NbNodes(); + if ( myIgnoreMediumNodes ) { + SMDS_ElemIteratorPtr elemIt = sm->GetElements(); + if ( elemIt->more() && elemIt->next()->IsQuadratic() ) + nbN -= sm->NbElements(); + } + me->myNbPonits += nbN; + me->myNbSegments += sm->NbElements(); + } + } + TopoDS_Vertex v1 = SMESH_MesherHelper::IthVertex( 1, Edge( NbEdges()-1 )); + if ( SMESH_Algo::VertexNode( v1, myProxyMesh->GetMeshDS() )) + me->myNbPonits++; // for the last end + else + me->myMissingVertexNodes = true; + } + return myNbPonits; +} + +//======================================================================= +//function : NbSegments +//purpose : Return nb edges +// Call it with update == true if mesh of this side can be recomputed +// since creation of this side +//======================================================================= + +int StdMeshers_FaceSide::NbSegments(const bool update) const +{ + return NbPoints( update ), myNbSegments; } //================================================================================ @@ -709,7 +806,6 @@ BRepAdaptor_CompCurve* StdMeshers_FaceSide::GetCurve3d() const return new BRepAdaptor_CompCurve( aWire ); } - //================================================================================ /*! * \brief Return 2D point by normalized parameter @@ -743,6 +839,35 @@ gp_Pnt2d StdMeshers_FaceSide::Value2d(double U) const return myDefaultPnt2d; } +//================================================================================ +/*! + * \brief Return XYZ by normalized parameter + * \param U - normalized parameter value + * \retval gp_Pnt - point + */ +//================================================================================ + +gp_Pnt StdMeshers_FaceSide::Value3d(double U) const +{ + int i = EdgeIndex( U ); + double prevU = i ? myNormPar[ i-1 ] : 0; + double r = ( U - prevU )/ ( myNormPar[ i ] - prevU ); + + double par = myFirst[i] * ( 1 - r ) + myLast[i] * r; + + // check parametrization of curve + if( !myIsUniform[i] ) + { + double aLen3dU = r * myEdgeLength[i] * ( myFirst[i]>myLast[i] ? -1. : 1.); + GCPnts_AbscissaPoint AbPnt + ( const_cast( myC3dAdaptor[i]), aLen3dU, myFirst[i] ); + if( AbPnt.IsDone() ) { + par = AbPnt.Parameter(); + } + } + return myC3dAdaptor[ i ].Value(par); +} + //================================================================================ /*! * \brief Return wires of a face as StdMeshers_FaceSide's @@ -755,10 +880,9 @@ TSideVector StdMeshers_FaceSide::GetFaceWires(const TopoDS_Face& theFace, TError & theError, SMESH_ProxyMesh::Ptr theProxyMesh) { - TopoDS_Vertex V1; list< TopoDS_Edge > edges, internalEdges; list< int > nbEdgesInWires; - int nbWires = SMESH_Block::GetOrderedEdges (theFace, V1, edges, nbEdgesInWires); + int nbWires = SMESH_Block::GetOrderedEdges (theFace, edges, nbEdgesInWires); // split list of all edges into separate wires TSideVector wires( nbWires );