+//=======================================================================
+//function : makeQuadsForOutInProjection
+//purpose : Create artificial wall quads for vertical projection between
+// the outer and inner walls
+//=======================================================================
+
+void StdMeshers_Prism_3D::makeQuadsForOutInProjection( const Prism_3D::TPrismTopo& thePrism,
+ multimap< int, int >& wgt2quad,
+ map< int, FaceQuadStruct >& iQ2oiQuads)
+{
+ if ( thePrism.NbWires() <= 1 )
+ return;
+
+ std::set< int > doneWires; // processed wires
+
+ SMESH_Mesh* mesh = myHelper->GetMesh();
+ const bool isForward = true;
+ const bool skipMedium = myHelper->GetIsQuadratic();
+
+ // make a source side for all projections
+
+ multimap< int, int >::reverse_iterator w2q = wgt2quad.rbegin();
+ const int iQuad = w2q->second;
+ const int iWire = getWireIndex( thePrism.myWallQuads[ iQuad ].front() );
+ doneWires.insert( iWire );
+
+ UVPtStructVec srcNodes;
+
+ Prism_3D::TQuadList::const_iterator quad = thePrism.myWallQuads[ iQuad ].begin();
+ for ( ; quad != thePrism.myWallQuads[ iQuad ].end(); ++quad )
+ {
+ StdMeshers_FaceSidePtr lftSide = (*quad)->side[ QUAD_LEFT_SIDE ];
+
+ // assure that all the source (left) EDGEs are meshed
+ for ( int i = 0; i < lftSide->NbEdges(); ++i )
+ {
+ const TopoDS_Edge& srcE = lftSide->Edge(i);
+ SMESH_subMesh* srcSM = mesh->GetSubMesh( srcE );
+ if ( !srcSM->IsMeshComputed() ) {
+ srcSM->ComputeSubMeshStateEngine( SMESH_subMesh::COMPUTE );
+ srcSM->ComputeStateEngine ( SMESH_subMesh::COMPUTE );
+ }
+ if ( !srcSM->IsMeshComputed() )
+ return;
+ }
+ const UVPtStructVec& subNodes = lftSide->GetUVPtStruct();
+ UVPtStructVec::const_iterator subBeg = subNodes.begin(), subEnd = subNodes.end();
+ if ( !srcNodes.empty() ) ++subBeg;
+ srcNodes.insert( srcNodes.end(), subBeg, subEnd );
+ }
+ StdMeshers_FaceSidePtr srcSide = StdMeshers_FaceSide::New( srcNodes );
+
+ // make the quads
+
+ list< TopoDS_Edge > sideEdges;
+ TopoDS_Face face;
+ for ( ++w2q; w2q != wgt2quad.rend(); ++w2q )
+ {
+ const int iQuad = w2q->second;
+ const Prism_3D::TQuadList& quads = thePrism.myWallQuads[ iQuad ];
+ const int iWire = getWireIndex( quads.front() );
+ if ( !doneWires.insert( iWire ).second )
+ continue;
+
+ sideEdges.clear();
+ for ( quad = quads.begin(); quad != quads.end(); ++quad )
+ {
+ StdMeshers_FaceSidePtr lftSide = (*quad)->side[ QUAD_LEFT_SIDE ];
+ for ( int i = 0; i < lftSide->NbEdges(); ++i )
+ sideEdges.push_back( lftSide->Edge( i ));
+ face = lftSide->Face();
+ }
+ StdMeshers_FaceSidePtr tgtSide =
+ StdMeshers_FaceSide::New( face, sideEdges, mesh, isForward, skipMedium, myHelper );
+
+ FaceQuadStruct& newQuad = iQ2oiQuads[ iQuad ];
+ newQuad.side.resize( 4 );
+ newQuad.side[ QUAD_LEFT_SIDE ] = srcSide;
+ newQuad.side[ QUAD_RIGHT_SIDE ] = tgtSide;
+
+ wgt2quad.insert( *w2q ); // to process this quad after processing the newQuad
+ }
+}
+