From a31e6c3f5d39fc7453b00710f5b283d64508fdf1 Mon Sep 17 00:00:00 2001 From: abuhsing Date: Thu, 29 Nov 2012 17:50:27 +0000 Subject: [PATCH] Abu : Suite Hexa5/Lot1 --- src/HEXABLOCKPlugin/HEXABLOCKPlugin_mesh.cxx | 389 ++++++++++--------- 1 file changed, 206 insertions(+), 183 deletions(-) diff --git a/src/HEXABLOCKPlugin/HEXABLOCKPlugin_mesh.cxx b/src/HEXABLOCKPlugin/HEXABLOCKPlugin_mesh.cxx index c7a45d6..b513a0b 100755 --- a/src/HEXABLOCKPlugin/HEXABLOCKPlugin_mesh.cxx +++ b/src/HEXABLOCKPlugin/HEXABLOCKPlugin_mesh.cxx @@ -17,7 +17,7 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File : SMESH_HexaBlocks.cxx -// Author : +// Author : // Module : SMESH // @@ -95,10 +95,11 @@ static int MYDEBUG = 0; #endif -static double HEXA_EPSILON = 1E-3; //1E-3; +static double HEXA_EPS = 1.0e-3; //1E-3; static double HEXA_QUAD_WAY = PI/4.; //3.*PI/8.; // static double HEXA_QUAD_WAY2 = 499999999.*PI/1000000000.; +// ============================================================ string2shape TopoDS_Shape string2shape( const string& brep ) { TopoDS_Shape shape; @@ -108,6 +109,7 @@ TopoDS_Shape string2shape( const string& brep ) return shape; } +// ============================================================ shape2coord bool shape2coord(const TopoDS_Shape& aShape, double& x, double& y, double& z) { if ( aShape.ShapeType() == TopAbs_VERTEX ){ @@ -122,7 +124,50 @@ bool shape2coord(const TopoDS_Shape& aShape, double& x, double& y, double& z) return(0); }; } - +// ============================================================= edge_length +double edge_length(const TopoDS_Edge & E) +{ + double UMin = 0, UMax = 0; + if (BRep_Tool::Degenerated(E)) + return 0; + TopLoc_Location L; + Handle(Geom_Curve) C = BRep_Tool::Curve(E, L, UMin, UMax); + GeomAdaptor_Curve AdaptCurve(C); + double length = GCPnts_AbscissaPoint::Length(AdaptCurve, UMin, UMax); + return length; +} +// =============================================================== make_curve +BRepAdaptor_Curve* make_curve (Hex::Shape* assoc, gp_Pnt& pstart, gp_Pnt& pend, + double& length, double& u_start) +{ + string theBrep = assoc->getBrep(); + double ass_debut = std::min (assoc->getStart(), assoc->getEnd()); + double ass_fin = std::max (assoc->getStart(), assoc->getEnd()); + TopoDS_Shape theShape = string2shape( theBrep ); + TopoDS_Edge theEdge = TopoDS::Edge( theShape ); + + double curv_length = edge_length( theEdge ); + double u_end = 0; + + if ( curv_length <= 0.0 ) + return NULL; + + BRepAdaptor_Curve* theCurve = new BRepAdaptor_Curve( theEdge ); + + GCPnts_AbscissaPoint discret_start (*theCurve, curv_length*ass_debut, + theCurve->FirstParameter() ); + GCPnts_AbscissaPoint discret_end (*theCurve, curv_length*ass_fin, + theCurve->FirstParameter() ); + u_start = discret_start.Parameter(); + u_end = discret_end .Parameter(); + + ASSERT( discret_start.IsDone() && discret_end.IsDone() ); + pstart = theCurve->Value( u_start); + pend = theCurve->Value( u_end ); + length = curv_length*( ass_fin - ass_debut); + return theCurve; +} +// ============================================================== Constructeur // SMESH_HexaBlocks::SMESH_HexaBlocks( SMESH_Mesh* theMesh ): SMESH_HexaBlocks::SMESH_HexaBlocks(SMESH_Mesh& theMesh): _total(0), @@ -149,10 +194,21 @@ SMESH_HexaBlocks::~SMESH_HexaBlocks() // -------------------------------------------------------------- // Vertex computing // -------------------------------------------------------------- +//--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8 +// ============================================================== computeVertex bool SMESH_HexaBlocks::computeVertex(HEXA_NS::Vertex& vx) { - bool ok = false; - ok = computeVertexByAssoc( vx ); + double px, py, pz; + vx.getAssoCoord (px, py, pz); + + SMDS_MeshNode* new_node = _theMeshDS->AddNode (px, py, pz); + _vertex [new_node] = &vx; + _node [&vx] = new_node; //needed in computeEdge() + _computeVertexOK = true; + return true; + +/*********************************** + bool ok = computeVertexByAssoc( vx ); if ( ok == false ){ ok = computeVertexByModel( vx ); } @@ -160,6 +216,7 @@ bool SMESH_HexaBlocks::computeVertex(HEXA_NS::Vertex& vx) _computeVertexOK = true; } return ok; +***********************************/ } @@ -284,22 +341,22 @@ bool SMESH_HexaBlocks::computeEdgeByAssoc( HEXA_NS::Edge& edge, HEXA_NS::Law& la SMDS_MeshNode* LAST_NODE = _node[vx1]; - // A) Build myCurve - std::list< BRepAdaptor_Curve* > myCurve; - double myCurve_length; + // A) Build myCurve_list + std::list< BRepAdaptor_Curve* > myCurve_list; + double myCurve_tot_len; std::map< BRepAdaptor_Curve*, double> myCurve_lengths; std::map< BRepAdaptor_Curve*, bool> myCurve_ways; std::map< BRepAdaptor_Curve*, double> myCurve_starts; - gp_Pnt myCurve_start( FIRST_NODE->X(), FIRST_NODE->Y(), FIRST_NODE->Z() ); - gp_Pnt myCurve_end( LAST_NODE->X(), LAST_NODE->Y(), LAST_NODE->Z() ); + gp_Pnt myCurve_pt_start(FIRST_NODE->X(), FIRST_NODE->Y(), FIRST_NODE->Z()); + gp_Pnt myCurve_pt_end (LAST_NODE->X(), LAST_NODE->Y(), LAST_NODE->Z()); _buildMyCurve( associations, - myCurve_start, - myCurve_end, - myCurve, - myCurve_length, + myCurve_pt_start, + myCurve_pt_end, + myCurve_list, + myCurve_tot_len, myCurve_lengths, myCurve_ways, myCurve_starts, @@ -307,7 +364,7 @@ bool SMESH_HexaBlocks::computeEdgeByAssoc( HEXA_NS::Edge& edge, HEXA_NS::Law& la ); - // B) Build nodes and edges on mesh from myCurve + // B) Build nodes and edges on mesh from myCurve_list SMDS_MeshNode* node_a = NULL; SMDS_MeshNode* node_b = NULL; SMDS_MeshEdge* edge_ab = NULL; @@ -327,17 +384,17 @@ bool SMESH_HexaBlocks::computeEdgeByAssoc( HEXA_NS::Edge& edge, HEXA_NS::Law& la if (MYDEBUG) MESSAGE("nbNodes -> "< "< "< "< "<AddEdge( node_a, node_b ); nodesOnEdge.push_back( node_b ); edgesOnEdge.push_back( edge_ab ); -// nodesXxOnEdge.push_back( u ); if (_nodeXx.count(node_b) >= 1 ) ASSERT(false); _nodeXx[node_b] = u; node_a = node_b; @@ -353,15 +409,10 @@ bool SMESH_HexaBlocks::computeEdgeByAssoc( HEXA_NS::Edge& edge, HEXA_NS::Law& la edge_ab = _theMeshDS->AddEdge( node_a, LAST_NODE ); nodesOnEdge.push_back( LAST_NODE ); edgesOnEdge.push_back( edge_ab ); -// nodesXxOnEdge.push_back( 1. ); - // _nodeXx[LAST_NODE] = 1.; _nodesOnEdge[&edge] = nodesOnEdge; _edgesOnEdge[&edge] = edgesOnEdge; - -// _edgeXx[&edge] = nodesXxOnEdge; - if(MYDEBUG) MESSAGE("computeEdgeByAssoc() : end >>>>>>>>"); return ok; } @@ -478,7 +529,7 @@ std::map SMESH_HexaBlocks::computeQuadWays( HEXA_NS::Docu } } - // SECOND STEP: setting edges ways + // SECOND STEP: setting edges ways while ( skinQuad.size()>0 ){ if(MYDEBUG) MESSAGE("SEARCHING INITIAL QUAD ..." ); for ( std::list::iterator it = skinQuad.begin(); it != skinQuad.end(); it++ ){ @@ -488,7 +539,7 @@ std::map SMESH_HexaBlocks::computeQuadWays( HEXA_NS::Docu break; } } - if ( e_0 == NULL and e_1 == NULL ) ASSERT(false);// should never happened, + if ( e_0 == NULL and e_1 == NULL ) ASSERT(false);// should never happened, if(MYDEBUG) MESSAGE("INITIAL QUAD FOUND!" ); for ( int j=0 ; j < 4 ; ++j ){ e = q->getEdge(j); @@ -514,7 +565,7 @@ std::map SMESH_HexaBlocks::computeQuadWays( HEXA_NS::Docu if ( q == first_q ){ localEdgeWays[e] = std::make_pair( edgeWays[e].first, edgeWays[e].second ); } else { - localEdgeWays[e] = std::make_pair( edgeWays[e].second, edgeWays[e].first); + localEdgeWays[e] = std::make_pair( edgeWays[e].second, edgeWays[e].first); } firstVertex = localEdgeWays[e].first; lastVertex = localEdgeWays[e].second; @@ -522,7 +573,7 @@ std::map SMESH_HexaBlocks::computeQuadWays( HEXA_NS::Docu } else { HEXA_NS::Vertex* e_0 = e->getVertex(0); HEXA_NS::Vertex* e_1 = e->getVertex(1); - + if ( lastVertex == e_0 ){ firstVertex = e_0; lastVertex = e_1; } else if ( lastVertex == e_1 ){ @@ -541,8 +592,8 @@ std::map SMESH_HexaBlocks::computeQuadWays( HEXA_NS::Docu } ++i; } - - + + //add new working quad for ( int i=0 ; i < 4; ++i ){ HEXA_NS::Quad* next_q = NULL; @@ -553,7 +604,7 @@ std::map SMESH_HexaBlocks::computeQuadWays( HEXA_NS::Docu next_q = NULL; } int fromSkin = std::count( skinQuad.begin(), skinQuad.end(), next_q ); - if (fromSkin != 0){ + if (fromSkin != 0){ int fromWorkingQuad = std::count( workingQuad.begin(), workingQuad.end(), next_q ); if ( fromWorkingQuad == 0 ){ workingQuad.push_front( next_q ); @@ -561,11 +612,11 @@ std::map SMESH_HexaBlocks::computeQuadWays( HEXA_NS::Docu } } } - + // setting quad way HEXA_NS::Edge* e0 = q->getEdge(0); HEXA_NS::Vertex* e0_0 = e0->getVertex(0); - + if ( e0_0 == localEdgeWays[ e0 ].first ){ quadWays[q] = true; } else if ( e0_0 == localEdgeWays[ e0 ].second ){ @@ -592,7 +643,7 @@ std::map SMESH_HexaBlocks::computeQuadWays( HEXA_NS::Docu // // std::map edgeWays; // // std::map > edgeWays; // std::map > workingQuads; -// +// // std::list skinQuad; // std::list notSkinQuad; // // std::list workingQuad; @@ -600,7 +651,7 @@ std::map SMESH_HexaBlocks::computeQuadWays( HEXA_NS::Docu // HEXA_NS::Quad* q = NULL; // HEXA_NS::Edge* e = NULL; // HEXA_NS::Vertex *e_0, *e_1 = NULL; -// +// // // FIRST STEP: eliminate free quad + internal quad // int nTotalQuad = doc.countQuad(); // for (int i=0; i < nTotalQuad; ++i ){ @@ -612,29 +663,29 @@ std::map SMESH_HexaBlocks::computeQuadWays( HEXA_NS::Docu // default: if ( q->getNbrParents() > 2 ) ASSERT(false); // } // } -// -// +// +// // // SECOND STEP // q = first_q = skinQuad.front(); // e = q->getUsedEdge(0); // e_0 = e->getVertex(0); // e_1 = e->getVertex(1); -// +// // workingQuads[q] = std::make_pair( e_0, e_1 ); -// +// // while ( workingQuads.size() > 0 ){ // MESSAGE("CURRENT QUAD ------>"<< q->getId()); // HEXA_NS::Vertex *lastVertex=NULL, *firstVertex = NULL; // int i = 0; -// +// // std::map > localEdgeWays; // while ( localEdgeWays.size() != 4 ){ // HEXA_NS::Edge* e = q->getUsedEdge(i%4); // if ( lastVertex == NULL ){ // HEXA_NS::Vertex* e_0 = e->getVertex(0); // HEXA_NS::Vertex* e_1 = e->getVertex(1); -// -// if ( (workingQuads[q].first == e_0 and workingQuads[q].second == e_1) +// +// if ( (workingQuads[q].first == e_0 and workingQuads[q].second == e_1) // or (workingQuads[q].first == e_1 and workingQuads[q].second == e_0) ){ // if ( q == first_q ){ // localEdgeWays[e] = std::make_pair( workingQuads[q].first, workingQuads[q].second ); @@ -671,8 +722,8 @@ std::map SMESH_HexaBlocks::computeQuadWays( HEXA_NS::Docu // } // ++i; // } -// -// +// +// // //add new working quad // for ( int i=0 ; i < 4; ++i ){ // HEXA_NS::Quad* next_q = NULL; @@ -684,23 +735,23 @@ std::map SMESH_HexaBlocks::computeQuadWays( HEXA_NS::Docu // next_q = NULL; // } // int fromSkin = std::count( skinQuad.begin(), skinQuad.end(), next_q ); -// if (fromSkin != 0){ +// if (fromSkin != 0){ // // int fromWorkingQuad = std::count( workingQuads.begin(), workingQuads.end(), next_q ); // int fromWorkingQuad = workingQuads.count( next_q ); -// // MESSAGE("CHECK QUAD:"<< newWorkingQuad->getId()); +// // MESSAGE("CHECK QUAD:"<< newWorkingQuad->getId()); // if ( fromWorkingQuad == 0 ){ // // workingQuads.push_front( next_q ); // workingQuads[ next_q ] = localEdgeWays[e]; -// // MESSAGE("EDGE :"<getId()<<"ADD QUAD :"<< newWorkingQuad->getId()); +// // MESSAGE("EDGE :"<getId()<<"ADD QUAD :"<< newWorkingQuad->getId()); // } // } // } // } -// +// // //setting quad way // HEXA_NS::Edge* e0 = q->getUsedEdge(0); // HEXA_NS::Vertex* e0_0 = e0->getVertex(0); -// +// // if ( e0_0 == localEdgeWays[ e0 ].first ){ // quadWays[q] = true; // } else if ( e0_0 == localEdgeWays[ e0 ].second ){ @@ -709,7 +760,7 @@ std::map SMESH_HexaBlocks::computeQuadWays( HEXA_NS::Docu // ASSERT(false); // } // MESSAGE("quadWays ID ="<< q->getId() << ", WAY = " << quadWays[q] ); -// +// // // workingQuad.remove( q ); // workingQuads.erase( q ); // skinQuad.remove( q ); @@ -767,7 +818,7 @@ bool SMESH_HexaBlocks::computeQuadByAssoc( HEXA_NS::Quad& quad, bool way ) if ( shapes.size() == 0 ){ if(MYDEBUG) MESSAGE("computeQuadByAssoc() : end >>>>>>>>"); return false; - } + } TopoDS_Shape shapeOrCompound = _getShapeOrCompound( shapes ); // bool quadWay = _computeQuadWay( quad, S1, S2, S3, S4, &shapeOrCompound ); // bool quadWay = _computeQuadWay( quad ); @@ -801,7 +852,7 @@ bool SMESH_HexaBlocks::computeQuadByAssoc( HEXA_NS::Quad& quad, bool way ) double v = yy[j]; _nodeInterpolationUV(u, v, Pg, Pd, Ph, Pb, S1, S2, S3, S4, newNodeX, newNodeY, newNodeZ); - gp_Pnt newPt = gp_Pnt( newNodeX, newNodeY, newNodeZ );//interpolated point + gp_Pnt newPt = gp_Pnt( newNodeX, newNodeY, newNodeZ );//interpolated point gp_Pnt pt1; gp_Pnt pt3; if ( interpolatedPoints.count(n1) > 0 ){ @@ -852,7 +903,7 @@ bool SMESH_HexaBlocks::computeQuadByAssoc( HEXA_NS::Quad& quad, bool way ) } _quadNodes[ &quad ] = nodesOnQuad; _facesOnQuad[&quad] = facesOnQuad; - + if(MYDEBUG) MESSAGE("computeQuadByLinearApproximation() : end >>>>>>>>"); return ok; } @@ -1018,7 +1069,7 @@ bool SMESH_HexaBlocks::computeQuadByLinearApproximation( HEXA_NS::Quad& quad, bo std::vector xx, yy; // Elements for quad computation - SMDS_MeshNode *S1, *S2, *S4, *S3; + SMDS_MeshNode *S1, *S2, *S4, *S3; // bool initOk = _computeQuadInit( quad, eh, eb, eg, ed, S1, S2, S3, S4 ); bool initOk = _computeQuadInit( quad, nodesOnQuad, xx, yy ); @@ -1075,7 +1126,7 @@ bool SMESH_HexaBlocks::computeQuadByLinearApproximation( HEXA_NS::Quad& quad, bo } _quadNodes[ &quad ] = nodesOnQuad; _facesOnQuad[&quad] = facesOnQuad; - + if(MYDEBUG) MESSAGE("computeQuadByLinearApproximation() : end >>>>>>>>"); return ok; } @@ -1120,7 +1171,7 @@ bool SMESH_HexaBlocks::computeDoc( HEXA_NS::Document* doc ) bool ok = true; // A) Vertex computation - + doc->lockDump (); int nVertex = doc->countUsedVertex(); HEXA_NS::Vertex* vertex = NULL; @@ -1233,6 +1284,7 @@ double SMESH_HexaBlocks::_Xx( double i, HEXA_NS::Law law, double nbNodes) //, do } +// ============================================================= _edgeLength double SMESH_HexaBlocks::_edgeLength(const TopoDS_Edge & E) { if(MYDEBUG) MESSAGE("_edgeLength() : : begin <<<<<<"); @@ -1247,141 +1299,117 @@ double SMESH_HexaBlocks::_edgeLength(const TopoDS_Edge & E) return length; } - +// ============================================================== _buildMyCurve +// === construire ma courbe a moi void SMESH_HexaBlocks::_buildMyCurve( const std::vector & associations, //IN - const gp_Pnt& myCurve_start, //IN - const gp_Pnt& myCurve_end, //IN - std::list< BRepAdaptor_Curve* >& myCurve, //INOUT - double& myCurve_length, //INOUT + const gp_Pnt& myCurve_pt_start, //IN + const gp_Pnt& myCurve_pt_end, //IN + std::list< BRepAdaptor_Curve* >& myCurve_list, //INOUT + double& myCurve_tot_len, //INOUT std::map< BRepAdaptor_Curve*, double>& myCurve_lengths,//INOUT std::map< BRepAdaptor_Curve*, bool>& myCurve_ways, //INOUT std::map< BRepAdaptor_Curve*, double>& myCurve_starts, //INOUT HEXA_NS::Edge& edge) // For error diagnostic { if(MYDEBUG) MESSAGE("_buildMyCurve() : : begin <<<<<<"); - bool myCurve_way = true; - myCurve_length = 0.; + bool current_way = true; + myCurve_tot_len = 0.; BRepAdaptor_Curve* thePreviousCurve = NULL; BRepAdaptor_Curve* theCurve = NULL; - gp_Pnt theCurve_start, theCurve_end; - gp_Pnt thePreviousCurve_start , thePreviousCurve_end; + gp_Pnt curv_start, curv_end; + gp_Pnt p_curv_start , p_curv_end; + double u_start = 0; + double curv_length = 0; - for ( std::vector ::const_iterator assoc = associations.begin(); - assoc != associations.end(); - ++assoc ){ - string theBrep = (*assoc)->getBrep(); - double ass_debut = std::min ((*assoc)->getStart(), (*assoc)->getEnd()); - double ass_fin = std::max ((*assoc)->getStart(), (*assoc)->getEnd()); - TopoDS_Shape theShape = string2shape( theBrep ); - TopoDS_Edge theEdge = TopoDS::Edge( theShape ); - double theCurve_length = _edgeLength( theEdge ); - if (MYDEBUG) - MESSAGE("_edgeLength ->"< 0 ){ + int nbass = associations.size (); + for (int nro = 0 ; nro < nbass ; ++nro) + { + theCurve = make_curve (associations[nro], curv_start, curv_end, + curv_length, u_start); + if (theCurve != NULL) + { + bool sens = true; double f, l; - Handle(Geom_Curve) testCurve = BRep_Tool::Curve(theEdge, f, l); - theCurve = new BRepAdaptor_Curve( theEdge ); - - GCPnts_AbscissaPoint discret_start (*theCurve, - theCurve_length*ass_debut, - theCurve->FirstParameter() ); - GCPnts_AbscissaPoint discret_end (*theCurve, - theCurve_length*ass_fin, - theCurve->FirstParameter() ); - double u_start = discret_start.Parameter(); - double u_end = discret_end.Parameter(); - ASSERT( discret_start.IsDone() && discret_end.IsDone() ); - theCurve_start = theCurve->Value( u_start); - theCurve_end = theCurve->Value( u_end ); - theCurve_length = theCurve_length*( ass_fin - ass_debut); - - if (MYDEBUG){ - MESSAGE("testCurve->f ->"<l ->"<FirstParameter ->"<FirstParameter()); - MESSAGE("testCurve->LastParameter ->"<LastParameter()); - - MESSAGE("FirstParameter ->"<FirstParameter()); - MESSAGE("LastParameter ->"<LastParameter()); - MESSAGE("theCurve_length ->"<getStart() ->"<< ass_debut ); - MESSAGE("(*assoc)->getEnd() ->"<< ass_fin ); - MESSAGE("u_start ->"<"< 0 ){ + p_curv_start = curv_start; + p_curv_end = curv_end; + }//if ( theCurveLength > 0 ) }// for - if ( myCurve_way == false ){ - std::list< BRepAdaptor_Curve* > tmp( myCurve.size() ); - std::copy( myCurve.rbegin(), myCurve.rend(), tmp.begin() ); - myCurve = tmp; + if ( NOT current_way ){ + std::list< BRepAdaptor_Curve* > tmp( myCurve_list.size() ); + std::copy( myCurve_list.rbegin(), myCurve_list.rend(), tmp.begin() ); + myCurve_list = tmp; } if (MYDEBUG) { - MESSAGE("myCurve_way was :"<>>>>>>>"); } } @@ -1389,12 +1417,12 @@ void SMESH_HexaBlocks::_buildMyCurve( -gp_Pnt SMESH_HexaBlocks::_getPtOnMyCurve( +gp_Pnt SMESH_HexaBlocks::_getPtOnMyCurve( const double& myCurve_u, //IN std::map< BRepAdaptor_Curve*, bool>& myCurve_ways, //IN std::map< BRepAdaptor_Curve*, double>& myCurve_lengths,//IN std::map< BRepAdaptor_Curve*, double>& myCurve_starts, //IN - std::list< BRepAdaptor_Curve* >& myCurve, //INOUT + std::list< BRepAdaptor_Curve* >& myCurve_list, //INOUT double& myCurve_start ) //INOUT // std::map< BRepAdaptor_Curve*, double>& myCurve_firsts, // std::map< BRepAdaptor_Curve*, double>& myCurve_lasts, @@ -1402,8 +1430,8 @@ gp_Pnt SMESH_HexaBlocks::_getPtOnMyCurve( if(MYDEBUG) MESSAGE("_getPtOnMyCurve() : : begin <<<<<<"); gp_Pnt ptOnMyCurve; - // looking for curve which contains parameter myCurve_u - BRepAdaptor_Curve* curve = myCurve.front(); + // looking for curve which contains parameter myCurve_u + BRepAdaptor_Curve* curve = myCurve_list.front(); double curve_start = myCurve_start; double curve_end = curve_start + myCurve_lengths[curve]; double curve_u; @@ -1414,18 +1442,13 @@ gp_Pnt SMESH_HexaBlocks::_getPtOnMyCurve( MESSAGE("looking for curve: curve_start = "<getBrep(); return string2shape( strBrep ); } else { @@ -1529,7 +1552,7 @@ inline double carre (double val) // ================================================== dist2 inline double dist2 (const gp_Pnt& pt1, const gp_Pnt& pt2) { - double dist = carre (pt2.X()-pt1.X()) + carre (pt2.Y()-pt1.Y()) + double dist = carre (pt2.X()-pt1.X()) + carre (pt2.Y()-pt1.Y()) + carre (pt2.Z()-pt1.Z()); return dist; } @@ -1647,7 +1670,7 @@ void SMESH_HexaBlocks::_searchInitialQuadWay( HEXA_NS::Quad* q, HEXA_NS::Vertex* gp_Vec AB( pA, pB ); gp_Vec AC( pA, pC ); - gp_Vec normP = AB^AC; + gp_Vec normP = AB^AC; gp_Dir dirP( normP ); // building plane for point projection @@ -1672,7 +1695,7 @@ void SMESH_HexaBlocks::_searchInitialQuadWay( HEXA_NS::Quad* q, HEXA_NS::Vertex* if ( CC.IsOpposite(DD, HEXA_QUAD_WAY) ) return; // ok, give the input quad the good orientation by - // setting 2 vertex + // setting 2 vertex if ( !dirP.IsOpposite(AA, HEXA_QUAD_WAY) ) { //OK v0 = qA; v1 = qB; } else { @@ -1768,7 +1791,7 @@ void SMESH_HexaBlocks::_fillGroup(HEXA_NS::Group* grHex ) } } break; - case HEXA_NS::HexaNode: + case HEXA_NS::HexaNode: { HEXA_NS::Hexa* h = reinterpret_cast(grHexElt); if ( _volumesOnHexa.count(h)>0 ){ @@ -1776,7 +1799,7 @@ void SMESH_HexaBlocks::_fillGroup(HEXA_NS::Group* grHex ) for ( SMESHVolumes::iterator aVolume = volumes.begin(); aVolume != volumes.end(); ++aVolume ){ SMDS_ElemIteratorPtr aNodeIter = (*aVolume)->nodesIterator(); while( aNodeIter->more() ){ - const SMDS_MeshNode* aNode = + const SMDS_MeshNode* aNode = dynamic_cast( aNodeIter->next() ); if ( aNode ){ aGrEltIDs.push_back(aNode); -- 2.39.2