+ //================================================================================
+ /*!
+ * Consider continuous straight EDGES as one side - mark them to unite
+ */
+ //================================================================================
+
+ int countNbSides( const Prism_3D::TPrismTopo & thePrism,
+ vector<int> & nbUnitePerEdge )
+ {
+ int nbEdges = thePrism.myNbEdgesInWires.front(); // nb outer edges
+ int nbSides = nbEdges;
+
+ list< TopoDS_Edge >::const_iterator edgeIt = thePrism.myBottomEdges.begin();
+ std::advance( edgeIt, nbEdges-1 );
+ TopoDS_Edge prevE = *edgeIt;
+ bool isPrevStraight = SMESH_Algo::isStraight( prevE );
+ int iPrev = nbEdges - 1;
+
+ int iUnite = -1; // the first of united EDGEs
+
+ edgeIt = thePrism.myBottomEdges.begin();
+ for ( int iE = 0; iE < nbEdges; ++iE, ++edgeIt )
+ {
+ const TopoDS_Edge& curE = *edgeIt;
+ const bool isCurStraight = SMESH_Algo::isStraight( curE );
+ if ( isPrevStraight && isCurStraight && SMESH_Algo::IsContinuous( prevE, curE ))
+ {
+ if ( iUnite < 0 )
+ iUnite = iPrev;
+ nbUnitePerEdge[ iUnite ]++;
+ nbUnitePerEdge[ iE ] = -1;
+ --nbSides;
+ }
+ else
+ {
+ iUnite = -1;
+ }
+ prevE = curE;
+ isPrevStraight = isCurStraight;
+ iPrev = iE;
+ }
+
+ return nbSides;
+ }
+
+ void pointsToPython(const std::vector<gp_XYZ>& p)
+ {
+#ifdef _DEBUG_
+ for ( int i = SMESH_Block::ID_V000; i < p.size(); ++i )
+ {
+ cout << "mesh.AddNode( " << p[i].X() << ", "<< p[i].Y() << ", "<< p[i].Z() << ") # " << i <<" " ;
+ SMESH_Block::DumpShapeID( i, cout ) << endl;
+ }
+#endif
+ }