X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FStdMeshers%2FStdMeshers_Prism_3D.cxx;h=d8944838db33a6e3459d985cf83b13d50c3af2a6;hp=9fc322c753cfc8d2d54424f6d46c12eb9f3cc4e6;hb=f816f204d33b5250ee211247a798a1af42c528ea;hpb=86ca5611705a674ccb26c7ea2176cf518bec24f5 diff --git a/src/StdMeshers/StdMeshers_Prism_3D.cxx b/src/StdMeshers/StdMeshers_Prism_3D.cxx index 9fc322c75..d8944838d 100644 --- a/src/StdMeshers/StdMeshers_Prism_3D.cxx +++ b/src/StdMeshers/StdMeshers_Prism_3D.cxx @@ -96,21 +96,21 @@ namespace { */ struct TQuadrangleAlgo : public StdMeshers_Quadrangle_2D { - TQuadrangleAlgo(int studyId, SMESH_Gen* gen) - : StdMeshers_Quadrangle_2D( gen->GetANewId(), studyId, gen) + TQuadrangleAlgo(SMESH_Gen* gen) + : StdMeshers_Quadrangle_2D( gen->GetANewId(), gen) { } static StdMeshers_Quadrangle_2D* instance( SMESH_Algo* fatherAlgo, SMESH_MesherHelper* helper=0) { - static TQuadrangleAlgo* algo = new TQuadrangleAlgo( fatherAlgo->GetStudyId(), - fatherAlgo->GetGen() ); + static TQuadrangleAlgo* algo = new TQuadrangleAlgo( fatherAlgo->GetGen() ); if ( helper && algo->myProxyMesh && algo->myProxyMesh->GetMesh() != helper->GetMesh() ) algo->myProxyMesh.reset( new SMESH_ProxyMesh( *helper->GetMesh() )); algo->myQuadList.clear(); + algo->myHelper = 0; if ( helper ) algo->_quadraticMesh = helper->GetIsQuadratic(); @@ -126,16 +126,15 @@ namespace { { StdMeshers_ProjectionSource1D myHyp; - TProjction1dAlgo(int studyId, SMESH_Gen* gen) - : StdMeshers_Projection_1D( gen->GetANewId(), studyId, gen), - myHyp( gen->GetANewId(), studyId, gen) + TProjction1dAlgo(SMESH_Gen* gen) + : StdMeshers_Projection_1D( gen->GetANewId(), gen), + myHyp( gen->GetANewId(), gen) { StdMeshers_Projection_1D::_sourceHypo = & myHyp; } static TProjction1dAlgo* instance( SMESH_Algo* fatherAlgo ) { - static TProjction1dAlgo* algo = new TProjction1dAlgo( fatherAlgo->GetStudyId(), - fatherAlgo->GetGen() ); + static TProjction1dAlgo* algo = new TProjction1dAlgo( fatherAlgo->GetGen() ); return algo; } }; @@ -147,16 +146,15 @@ namespace { { StdMeshers_ProjectionSource2D myHyp; - TProjction2dAlgo(int studyId, SMESH_Gen* gen) - : StdMeshers_Projection_1D2D( gen->GetANewId(), studyId, gen), - myHyp( gen->GetANewId(), studyId, gen) + TProjction2dAlgo(SMESH_Gen* gen) + : StdMeshers_Projection_1D2D( gen->GetANewId(), gen), + myHyp( gen->GetANewId(), gen) { StdMeshers_Projection_2D::_sourceHypo = & myHyp; } static TProjction2dAlgo* instance( SMESH_Algo* fatherAlgo ) { - static TProjction2dAlgo* algo = new TProjction2dAlgo( fatherAlgo->GetStudyId(), - fatherAlgo->GetGen() ); + static TProjction2dAlgo* algo = new TProjction2dAlgo( fatherAlgo->GetGen() ); return algo; } const NSProjUtils::TNodeNodeMap& GetNodesMap() @@ -567,8 +565,8 @@ namespace { //purpose : //======================================================================= -StdMeshers_Prism_3D::StdMeshers_Prism_3D(int hypId, int studyId, SMESH_Gen* gen) - :SMESH_3D_Algo(hypId, studyId, gen) +StdMeshers_Prism_3D::StdMeshers_Prism_3D(int hypId, SMESH_Gen* gen) + :SMESH_3D_Algo(hypId, gen) { _name = "Prism_3D"; _shapeType = (1 << TopAbs_SOLID); // 1 bit per shape type @@ -1169,6 +1167,11 @@ bool StdMeshers_Prism_3D::compute(const Prism_3D::TPrismTopo& thePrism) if ( !assocOrProjBottom2Top( bottomToTopTrsf, thePrism ) ) // it also fills myBotToColumnMap return false; + // If all "vertical" EDGEs are straight, then all nodes of an internal node column + // are located on a line connecting the top node and the bottom node. + bool isStrightColunm = allVerticalEdgesStraight( thePrism ); + if ( isStrightColunm ) + myUseBlock = false; // Create nodes inside the block @@ -1207,9 +1210,6 @@ bool StdMeshers_Prism_3D::compute(const Prism_3D::TPrismTopo& thePrism) myHelper->SetElementsOnShape( true ); - // If all "vertical" EDGEs are straight, then all nodes of an internal node column - // are located on a line connecting the top node and the bottom node. - bool isStrightColunm = allVerticalEdgesStraight( thePrism ); if ( !isStrightColunm ) { double tol = getSweepTolerance( thePrism ); @@ -1797,9 +1797,8 @@ bool StdMeshers_Prism_3D::computeWalls(const Prism_3D::TPrismTopo& thePrism) if ( myHelper->GetIsQuadratic() ) { // fill myHelper with medium nodes built by quadAlgo - SMDS_ElemIteratorPtr fIt = fSM->GetSubMeshDS()->GetElements(); - while ( fIt->more() ) - myHelper->AddTLinks( dynamic_cast( fIt->next() )); + for ( SMDS_ElemIteratorPtr fIt = fSM->GetSubMeshDS()->GetElements(); fIt->more(); ) + myHelper->AddTLinks( SMDS_Mesh::DownCast( fIt->next() )); } } } @@ -2589,8 +2588,8 @@ double StdMeshers_Prism_3D::getSweepTolerance( const Prism_3D::TPrismTopo& thePr //======================================================================= //function : isSimpleQuad -//purpose : check if the bottom FACE is meshable with nice qudrangles, -// if so the block aproach can work rather fast. +//purpose : check if the bottom FACE is meshable with nice quadrangles, +// if so the block approach can work rather fast. // This is a temporary mean caused by problems in StdMeshers_Sweeper //======================================================================= @@ -3062,7 +3061,7 @@ bool StdMeshers_Prism_3D::IsApplicable(const TopoDS_Shape & shape, bool toCheckA if ( side._topEdge.IsNull() ) { - // find vertical EDGEs --- EGDEs shared with neighbor side FACEs + // find vertical EDGEs --- EDGEs shared with neighbor side FACEs for ( int is2nd = 0; is2nd < 2 && isOK; ++is2nd ) // 2 adjacent neighbors { int di = is2nd ? 1 : -1; @@ -3423,7 +3422,7 @@ bool StdMeshers_Prism_3D::initPrism(Prism_3D::TPrismTopo& thePrism, if ( !botSM ) // find a proper bottom { bool savedSetErrorToSM = mySetErrorToSM; - mySetErrorToSM = false; // ingore errors in initPrism() + mySetErrorToSM = false; // ignore errors in initPrism() // search among meshed FACEs list< SMESH_subMesh* >::iterator sm = meshedSubMesh.begin(); @@ -3980,7 +3979,7 @@ bool StdMeshers_PrismAsBlock::GetLayersTransformation(vector & if ( p0.SquareDistance( pz ) > tol2 ) { t = gp_Trsf(); - return ( z == zSize - 1 ); // OK if fails only botton->top trsf + return ( z == zSize - 1 ); // OK if fails only bottom->top trsf } } } @@ -3994,7 +3993,7 @@ bool StdMeshers_PrismAsBlock::GetLayersTransformation(vector & * \param columnsMap - node columns map of side face * \param bottomEdge - the bootom edge * \param sideFaceID - side face in-block ID - * \retval bool - true if orientation coinside with in-block forward orientation + * \retval bool - true if orientation coincide with in-block forward orientation */ //================================================================================ @@ -4846,7 +4845,7 @@ TPCurveOnHorFaceAdaptor::TPCurveOnHorFaceAdaptor( const TSideFace* sideFace, } if ( !C2d.IsNull() ) { - double u = static_cast< const SMDS_EdgePosition* >( n->GetPosition() )->GetUParameter(); + double u = SMDS_EdgePositionPtr( n->GetPosition() )->GetUParameter(); if ( f <= u && u <= l ) { uv = C2d->Value( u ).XY(); @@ -4958,7 +4957,7 @@ bool StdMeshers_Sweeper::ComputeNodesByTrsf( const double tol, const size_t zSrc = 0, zTgt = zSize-1; if ( zSize < 3 ) return true; - vector< vector< gp_XYZ > > intPntsOfLayer( zSize ); // node coodinates to compute + vector< vector< gp_XYZ > > intPntsOfLayer( zSize ); // node coordinates to compute // set coordinates of src and tgt nodes for ( size_t z = 0; z < intPntsOfLayer.size(); ++z ) intPntsOfLayer[ z ].resize( myIntColumns.size() ); @@ -4972,7 +4971,7 @@ bool StdMeshers_Sweeper::ComputeNodesByTrsf( const double tol, prepareTopBotDelaunay(); bool isErrorCorrectable = findDelaunayTriangles(); - // compute coordinates of internal nodes by projecting (transfroming) src and tgt + // compute coordinates of internal nodes by projecting (transforming) src and tgt // nodes towards the central layer vector< NSProjUtils::TrsfFinder3D > trsfOfLayer( zSize );