// Created : Mon Apr 12 14:41:22 2010
// Author : Edward AGAPOV (eap)
-
#include "DirectedBoundingBox.hxx"
#include "InterpolationUtils.hxx"
if ( dim > 1 )
{
for ( coord = pts; coord < coordEnd; )
- for ( int i = 0; i < dim; ++i )
+ for ( int i = 0; i < (int)dim; ++i )
gc[i] += *coord++;
- for ( int j = 0; j < dim; ++j )
+ for ( int j = 0; j < (int)dim; ++j )
gc[j] /= numPts;
}
if ( dim > 1 )
{
for ( unsigned i = 0; i < numPts; ++i )
- for ( int j = 0; j < dim; ++j )
+ for ( int j = 0; j < (int)dim; ++j )
gc[j] += pts[i][j];
- for ( int j = 0; j < dim; ++j )
+ for ( int j = 0; j < (int)dim; ++j )
gc[j] /= numPts;
}
const double* minmax) const
{
int iC, nbCorners = 1;
- for ( int i=0;i<_dim;++i ) nbCorners *= 2;
+ for ( int i=0;i<(int)_dim;++i ) nbCorners *= 2;
corners.resize( nbCorners * _dim );
// each coordinate is filled with either min or max, nbSwap is number of corners
// after which min and max swap
for ( int iC = 0, nC = cornersThis.size()/_dim; iC < nC; ++iC)
{
fromLocalCS( &cornersThis[iC*_dim], globCorner );
- for ( int i = 0; i < _dim; ++i )
+ for ( int i = 0; i < (int)_dim; ++i )
{
if ( globCorner[i] < mmBox._minmax[i*2] ) mmBox._minmax[i*2] = globCorner[i];
if ( globCorner[i] > mmBox._minmax[i*2+1] ) mmBox._minmax[i*2+1] = globCorner[i];
data.insert( data.end(), &_axes[0], &_axes[0] + _axes.size());
data.insert( data.end(), &_minmax[0], &_minmax[0] + _minmax.size());
}
- if ( data.size() < dataSize( _dim ))
+ if ( data.size() < (unsigned)dataSize( _dim ))
data.resize( dataSize( _dim ), 0 );
return data;
}
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#ifndef __DirectedBoundingBox_HXX__
-#define __DirectedBoundingBox_HXX__
+
+#ifndef __DIRECTEDBOUNDINGBOX_HXX__
+#define __DIRECTEDBOUNDINGBOX_HXX__
#include "INTERPKERNELDefines.hxx"
inline bool DirectedBoundingBox::isLocalOut(const double* pLoc) const
{
- for ( int i = 0; i < _dim; ++i )
+ for ( int i = 0; i < (int)_dim; ++i )
if ( pLoc[i] < _minmax[i*2] || pLoc[i] > _minmax[i*2+1] )
return true;
return false;
inline void DirectedBoundingBox::addPointToBox(const double* coord)
{
- for ( int i = 0; i < _dim; ++i )
+ for ( int i = 0; i < (int)_dim; ++i )
{
double c = 0;
- for ( int j = 0; j < _dim; ++j ) c += coord[j]*_axes[i*_dim+j];
+ for ( int j = 0; j < (int)_dim; ++j ) c += coord[j]*_axes[i*_dim+j];
if ( c < _minmax[i*2] ) _minmax[i*2] = c;
if ( c > _minmax[i*2+1] ) _minmax[i*2+1] = c;
}
// make upper triangular matrix (forward elimination)
int iR[nbRow];// = { 0, 1, 2 };
- for ( int i = 0; i < nbRow; ++i ) iR[i] = i;
+ for ( int i = 0; i < (int) nbRow; ++i ) iR[i] = i;
- for ( int i = 0; i < nbRow-1; ++i ) // nullify nbRow-1 rows
+ for ( int i = 0; i < (int)(nbRow-1); ++i ) // nullify nbRow-1 rows
{
// swap rows to have max value of i-th column in i-th row
double max = std::fabs( M[ iR[i] ][i] );
- for ( int r = i+1; r < nbRow; ++r ) {
+ for ( int r = i+1; r < (int)nbRow; ++r ) {
double m = std::fabs( M[ iR[r] ][i] );
if ( m > max ) {
max = m;
}
// make 0 below M[i][i] (actually we do not modify i-th column)
double* tUpRow = M[ iR[i] ];
- for ( int r = i+1; r < nbRow; ++r ) {
+ for ( int r = i+1; r < (int)nbRow; ++r ) {
double* mRow = M[ iR[r] ];
double coef = mRow[ i ] / tUpRow[ i ];
for ( int c = i+1; c < nbCol; ++c )
* @param res must be of size at least 3 to store the result.
*/
template<class ConnType, NumberingPolicy numPol>
- inline double areaVectorOfPolygon(const ConnType *connec, int lgth, const double *coords, double *res)
+ inline void areaVectorOfPolygon(const ConnType *connec, int lgth, const double *coords, double *res)
{
res[0]=0.; res[1]=0.; res[2]=0.;
for(int ptId=0;ptId<lgth;ptId++)