+SMESH_Block::TEdge::~TEdge()
+{
+ if ( myC3d ) delete myC3d;
+}
+
+//================================================================================
+/*!
+ * \brief Set face data
+ * \param faceID - block subshape ID
+ * \param S - face surface geometry
+ * \param c2d - 4 pcurves in the order as returned by GetFaceEdgesIDs(faceID)
+ * \param isForward - orientation of pcurves comparing with block edge direction
+ */
+//================================================================================
+
+void SMESH_Block::TFace::Set( const int faceID,
+ Adaptor3d_Surface* S,
+ Adaptor2d_Curve2d* c2D[4],
+ const bool isForward[4] )
+{
+ if ( myS ) delete myS;
+ myS = S;
+ // pcurves
+ vector< int > edgeIdVec;
+ GetFaceEdgesIDs( faceID, edgeIdVec );
+ for ( int iE = 0; iE < edgeIdVec.size(); iE++ ) // loop on 4 edges
+ {
+ myCoordInd[ iE ] = GetCoordIndOnEdge( edgeIdVec[ iE ] );
+ if ( myC2d[ iE ]) delete myC2d[ iE ];
+ myC2d[ iE ] = c2D[ iE ];
+ myFirst[ iE ] = myC2d[ iE ]->FirstParameter();
+ myLast [ iE ] = myC2d[ iE ]->LastParameter();
+ if ( !isForward[ iE ])
+ std::swap( myFirst[ iE ], myLast[ iE ] );
+ }
+ // 2d corners
+ myCorner[ 0 ] = myC2d[ 0 ]->Value( myFirst[0] ).XY();
+ myCorner[ 1 ] = myC2d[ 0 ]->Value( myLast[0] ).XY();
+ myCorner[ 2 ] = myC2d[ 1 ]->Value( myLast[1] ).XY();
+ myCorner[ 3 ] = myC2d[ 1 ]->Value( myFirst[1] ).XY();
+}
+
+//================================================================================
+/*!
+ * \brief Set face data to work with mesh block
+ * \param faceID - block subshape ID
+ * \param edgeU0 - filled data of edge u0 = GetFaceEdgesIDs(faceID)[ 0 ]
+ * \param edgeU1 - filled data of edge u1 = GetFaceEdgesIDs(faceID)[ 1 ]
+ */
+//================================================================================
+
+void SMESH_Block::TFace::Set( const int faceID, const TEdge& edgeU0, const TEdge& edgeU1 )
+{
+ vector< int > edgeIdVec;
+ GetFaceEdgesIDs( faceID, edgeIdVec );
+ myNodes[ 0 ] = edgeU0.NodeXYZ( 1 );
+ myNodes[ 1 ] = edgeU0.NodeXYZ( 0 );
+ myNodes[ 2 ] = edgeU1.NodeXYZ( 0 );
+ myNodes[ 3 ] = edgeU1.NodeXYZ( 1 );
+ myCoordInd[ 0 ] = GetCoordIndOnEdge( edgeIdVec[ 0 ] );
+ myCoordInd[ 1 ] = GetCoordIndOnEdge( edgeIdVec[ 1 ] );
+ myCoordInd[ 2 ] = GetCoordIndOnEdge( edgeIdVec[ 2 ] );
+ myCoordInd[ 3 ] = GetCoordIndOnEdge( edgeIdVec[ 3 ] );
+ if ( myS ) delete myS;
+ myS = 0;
+}
+
+//================================================================================
+/*!
+ * \brief Destructor
+ */
+//================================================================================
+
+SMESH_Block::TFace::~TFace()
+{
+ if ( myS ) delete myS;
+ for ( int i = 0 ; i < 4; ++i )
+ if ( myC2d[ i ]) delete myC2d[ i ];