+
+ //================================================================================
+ /*!
+ * \brief Fill in _FaceGrid::_ijkColumns
+ * \param [in,out] fg - a _FaceGrid
+ * \param [in] i1 - coordinate index along _columns
+ * \param [in] i2 - coordinate index along _columns[i]
+ * \param [in] v3 - value of the constant parameter
+ */
+ //================================================================================
+
+ void computeIJK( _FaceGrid& fg, int i1, int i2, double v3 )
+ {
+ gp_XYZ ijk( v3, v3, v3 );
+ const size_t nbCol = fg._columns.size();
+ const size_t nbRow = fg._columns[0].size();
+
+ fg._ijkColumns.resize( nbCol );
+ for ( size_t i = 0; i < nbCol; ++i )
+ fg._ijkColumns[ i ].resize( nbRow, ijk );
+
+ vector< double > len( nbRow );
+ len[0] = 0;
+ for ( size_t i = 0; i < nbCol; ++i )
+ {
+ gp_Pnt pPrev = fg.GetXYZ( i, 0 );
+ for ( size_t j = 1; j < nbRow; ++j )
+ {
+ gp_Pnt p = fg.GetXYZ( i, j );
+ len[ j ] = len[ j-1 ] + p.Distance( pPrev );
+ pPrev = p;
+ }
+ for ( size_t j = 0; j < nbRow; ++j )
+ fg.GetIJK( i, j ).SetCoord( i2, len[ j ]/len.back() );
+ }
+
+ len.resize( nbCol );
+ for ( size_t j = 0; j < nbRow; ++j )
+ {
+ gp_Pnt pPrev = fg.GetXYZ( 0, j );
+ for ( size_t i = 1; i < nbCol; ++i )
+ {
+ gp_Pnt p = fg.GetXYZ( i, j );
+ len[ i ] = len[ i-1 ] + p.Distance( pPrev );
+ pPrev = p;
+ }
+ for ( size_t i = 0; i < nbCol; ++i )
+ fg.GetIJK( i, j ).SetCoord( i1, len[ i ]/len.back() );
+ }
+ }