Skip to content

Commit

Permalink
uint -> unsigned int
Browse files Browse the repository at this point in the history
  • Loading branch information
kriben committed Nov 4, 2024
1 parent 0a28dcf commit 094a88e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
30 changes: 15 additions & 15 deletions ApplicationLibCode/ReservoirDataModel/RigContourMapProjection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ cvf::Vec2ui RigContourMapProjection::numberOfVerticesIJ() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RigContourMapProjection::valueAtVertex( uint i, uint j ) const
double RigContourMapProjection::valueAtVertex( unsigned int i, unsigned int j ) const
{
size_t index = m_contourMapGrid.vertexIndexFromIJ( i, j );
if ( index < numberOfVertices() )
Expand All @@ -130,18 +130,18 @@ double RigContourMapProjection::valueAtVertex( uint i, uint j ) const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
uint RigContourMapProjection::numberOfCells() const
unsigned int RigContourMapProjection::numberOfCells() const
{
return m_contourMapGrid.numberOfCells();
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
uint RigContourMapProjection::numberOfValidCells() const
unsigned int RigContourMapProjection::numberOfValidCells() const
{
uint validCount = 0u;
for ( uint i = 0; i < numberOfCells(); ++i )
unsigned int validCount = 0u;
for ( unsigned int i = 0; i < numberOfCells(); ++i )
{
cvf::Vec2ui ij = m_contourMapGrid.ijFromCellIndex( i );
if ( hasResultInCell( ij.x(), ij.y() ) )
Expand Down Expand Up @@ -204,8 +204,8 @@ size_t RigContourMapProjection::gridResultIndex( size_t globalCellIdx ) const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RigContourMapProjection::calculateValueInMapCell( uint i,
uint j,
double RigContourMapProjection::calculateValueInMapCell( unsigned int i,
unsigned int j,
const std::vector<double>& gridCellValues,
RigContourMapCalculator::ResultAggregationEnum resultAggregation ) const
{
Expand Down Expand Up @@ -349,7 +349,7 @@ double RigContourMapProjection::interpolateValue( const cvf::Vec2d& gridPos2d )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RigContourMapProjection::valueInCell( uint i, uint j ) const
double RigContourMapProjection::valueInCell( unsigned int i, unsigned int j ) const
{
size_t index = m_contourMapGrid.cellIndexFromIJ( i, j );
if ( index < numberOfCells() )
Expand All @@ -362,28 +362,28 @@ double RigContourMapProjection::valueInCell( uint i, uint j ) const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RigContourMapProjection::hasResultInCell( uint i, uint j ) const
bool RigContourMapProjection::hasResultInCell( unsigned int i, unsigned int j ) const
{
return !cellsAtIJ( i, j ).empty();
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RigContourMapProjection::calculateValueAtVertex( uint vi, uint vj ) const
double RigContourMapProjection::calculateValueAtVertex( unsigned int vi, unsigned int vj ) const
{
std::vector<uint> averageIs;
std::vector<uint> averageJs;
std::vector<unsigned int> averageIs;
std::vector<unsigned int> averageJs;

if ( vi > 0u ) averageIs.push_back( vi - 1 );
if ( vj > 0u ) averageJs.push_back( vj - 1 );
if ( vi < m_contourMapGrid.mapSize().x() ) averageIs.push_back( vi );
if ( vj < m_contourMapGrid.mapSize().y() ) averageJs.push_back( vj );

RiaWeightedMeanCalculator<double> calc;
for ( uint j : averageJs )
for ( unsigned int j : averageJs )
{
for ( uint i : averageIs )
for ( unsigned int i : averageIs )
{
if ( hasResultInCell( i, j ) )
{
Expand All @@ -401,7 +401,7 @@ double RigContourMapProjection::calculateValueAtVertex( uint vi, uint vj ) const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<std::pair<size_t, double>> RigContourMapProjection::cellsAtIJ( uint i, uint j ) const
std::vector<std::pair<size_t, double>> RigContourMapProjection::cellsAtIJ( unsigned int i, unsigned int j ) const
{
size_t cellIndex = m_contourMapGrid.cellIndexFromIJ( i, j );
if ( cellIndex < m_projected3dGridIndices.size() )
Expand Down
20 changes: 10 additions & 10 deletions ApplicationLibCode/ReservoirDataModel/RigContourMapProjection.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ class RigContourMapProjection
cvf::Vec2ui numberOfElementsIJ() const;
cvf::Vec2ui numberOfVerticesIJ() const;

double valueAtVertex( uint i, uint j ) const;
double valueAtVertex( unsigned int i, unsigned int j ) const;

uint numberOfCells() const;
uint numberOfValidCells() const;
size_t numberOfVertices() const;
unsigned int numberOfCells() const;
unsigned int numberOfValidCells() const;
size_t numberOfVertices() const;

bool checkForMapIntersection( const cvf::Vec3d& domainPoint3d, cvf::Vec2d* contourMapPoint, double* valueAtPoint ) const;
cvf::Vec3d origin3d() const;
Expand Down Expand Up @@ -90,16 +90,16 @@ class RigContourMapProjection
const std::vector<std::vector<std::pair<size_t, double>>>& projected3dGridIndices() const { return m_projected3dGridIndices; }

// Cell index and position conversion
std::vector<CellIndexAndResult> cellsAtIJ( uint i, uint j ) const;
std::vector<CellIndexAndResult> cellsAtIJ( unsigned int i, unsigned int j ) const;

virtual std::vector<bool> getMapCellVisibility( int viewStepIndex, RigContourMapCalculator::ResultAggregationEnum resultAggregation ) = 0;

static double maxValue( const std::vector<double>& aggregatedResults );
static double minValue( const std::vector<double>& aggregatedResults );

protected:
double calculateValueInMapCell( uint i,
uint j,
double calculateValueInMapCell( unsigned int i,
unsigned int j,
const std::vector<double>& gridCellValues,
RigContourMapCalculator::ResultAggregationEnum resultAggregation ) const;

Expand All @@ -109,9 +109,9 @@ class RigContourMapProjection

static double sumTriangleAreas( const std::vector<cvf::Vec4d>& triangles );

double valueInCell( uint i, uint j ) const;
bool hasResultInCell( uint i, uint j ) const;
double calculateValueAtVertex( uint i, uint j ) const;
double valueInCell( unsigned int i, unsigned int j ) const;
bool hasResultInCell( unsigned int i, unsigned int j ) const;
double calculateValueAtVertex( unsigned int i, unsigned int j ) const;

protected:
cvf::ref<cvf::UByteArray> m_cellGridIdxVisibility;
Expand Down

0 comments on commit 094a88e

Please sign in to comment.