mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#10649 ApplicationLibCode: Use collection.empty() instead of comparing with size
This commit is contained in:
@@ -364,9 +364,9 @@ void RivGridBoxGenerator::createGridBoxFaceParts()
|
||||
m_gridBoxFaceParts.clear();
|
||||
|
||||
CVF_ASSERT( m_displayCoordsBoundingBox.isValid() );
|
||||
CVF_ASSERT( m_displayCoordsXValues.size() > 0 );
|
||||
CVF_ASSERT( m_displayCoordsYValues.size() > 0 );
|
||||
CVF_ASSERT( m_displayCoordsZValues.size() > 0 );
|
||||
CVF_ASSERT( !m_displayCoordsXValues.empty() );
|
||||
CVF_ASSERT( !m_displayCoordsYValues.empty() );
|
||||
CVF_ASSERT( !m_displayCoordsZValues.empty() );
|
||||
|
||||
cvf::Vec3d min = m_displayCoordsBoundingBox.min();
|
||||
cvf::Vec3d max = m_displayCoordsBoundingBox.max();
|
||||
@@ -456,9 +456,9 @@ void RivGridBoxGenerator::createGridBoxLegendParts()
|
||||
m_gridBoxLegendParts.clear();
|
||||
|
||||
CVF_ASSERT( m_displayCoordsBoundingBox.isValid() );
|
||||
CVF_ASSERT( m_displayCoordsXValues.size() > 0 );
|
||||
CVF_ASSERT( m_displayCoordsYValues.size() > 0 );
|
||||
CVF_ASSERT( m_displayCoordsZValues.size() > 0 );
|
||||
CVF_ASSERT( !m_displayCoordsXValues.empty() );
|
||||
CVF_ASSERT( !m_displayCoordsYValues.empty() );
|
||||
CVF_ASSERT( !m_displayCoordsZValues.empty() );
|
||||
|
||||
for ( int edge = POS_Z_POS_X; edge <= NEG_X_NEG_Y; edge++ )
|
||||
{
|
||||
|
||||
@@ -67,8 +67,8 @@ void RivPatchGenerator::setSubdivisions( const std::vector<double>& uValues, con
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivPatchGenerator::generate( cvf::GeometryBuilder* builder )
|
||||
{
|
||||
CVF_ASSERT( m_uValues.size() > 0 );
|
||||
CVF_ASSERT( m_vValues.size() > 0 );
|
||||
CVF_ASSERT( !m_uValues.empty() );
|
||||
CVF_ASSERT( !m_vValues.empty() );
|
||||
|
||||
size_t numVertices = m_uValues.size() * m_vValues.size();
|
||||
|
||||
|
||||
@@ -368,7 +368,7 @@ void RivIntersectionResultsColoringTools::calculateElementBasedGeoMechTextureCoo
|
||||
{
|
||||
textureCoords->resize( triangleToCellIdx.size() * 3 );
|
||||
|
||||
if ( resultValues.size() == 0 )
|
||||
if ( resultValues.empty() )
|
||||
{
|
||||
textureCoords->setAll( cvf::Vec2f( 0.0, 1.0f ) );
|
||||
}
|
||||
|
||||
@@ -302,7 +302,7 @@ std::vector<std::vector<cvf::ref<cvf::Drawable>>>
|
||||
lineBBox.add( displayVertex2 );
|
||||
|
||||
bool addOriginalSegment = true;
|
||||
if ( labelBBoxes.size() > 0 )
|
||||
if ( !labelBBoxes.empty() )
|
||||
{
|
||||
for ( const cvf::BoundingBox& existingBBox : labelBBoxes[i] )
|
||||
{
|
||||
|
||||
@@ -268,7 +268,7 @@ void RivElementVectorResultPartMgr::appendDynamicGeometryPartsToModel( cvf::Mode
|
||||
for ( int nIdx = 0; nIdx < static_cast<int>( nncData->eclipseConnectionCount() ); ++nIdx )
|
||||
{
|
||||
const RigConnection& conn = nncData->availableConnections()[nIdx];
|
||||
if ( conn.polygon().size() )
|
||||
if ( !conn.polygon().empty() )
|
||||
{
|
||||
double resultValue = 0.0;
|
||||
for ( size_t flIdx = 0; flIdx < nncResultVals.size(); flIdx++ )
|
||||
|
||||
@@ -60,7 +60,7 @@ void RivFishbonesSubsPartMgr::appendGeometryPartsToModel( cvf::ModelBasicList*
|
||||
|
||||
if ( !m_rimFishbonesSubs->isActive() ) return;
|
||||
|
||||
if ( m_parts.size() == 0 )
|
||||
if ( m_parts.empty() )
|
||||
{
|
||||
buildParts( displayCoordTransform, characteristicCellSize );
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ void RivNNCGeometryGenerator::computeArrays()
|
||||
|
||||
const RigConnection& conn = m_nncData->allConnections()[conIdx];
|
||||
|
||||
if ( conn.polygon().size() )
|
||||
if ( !conn.polygon().empty() )
|
||||
{
|
||||
bool isVisible = true;
|
||||
if ( isVisibilityCalcActive )
|
||||
@@ -176,7 +176,7 @@ void RivNNCGeometryGenerator::textureCoordinates( cvf::Vec2fArray*
|
||||
nncResultVals = m_nncData->generatedConnectionScalarResult( resVarAddr, nativeTimeStepIndex );
|
||||
}
|
||||
|
||||
if ( !nncResultVals || nncResultVals->size() == 0 )
|
||||
if ( !nncResultVals || nncResultVals->empty() )
|
||||
{
|
||||
textureCoords->setAll( cvf::Vec2f( 0.0f, 1.0f ) );
|
||||
return;
|
||||
|
||||
@@ -82,7 +82,7 @@ bool RivPolylinePartMgr::isPolylinesInBoundingBox( std::vector<std::vector<cvf::
|
||||
void RivPolylinePartMgr::buildPolylineParts( const caf::DisplayCoordTransform* displayXf, const cvf::BoundingBox& boundingBox )
|
||||
{
|
||||
auto polylineDef = m_polylineInterface->polyLinesData();
|
||||
if ( polylineDef.isNull() || polylineDef->polyLines().size() == 0 )
|
||||
if ( polylineDef.isNull() || polylineDef->polyLines().empty() )
|
||||
{
|
||||
clearAllGeometry();
|
||||
return;
|
||||
|
||||
@@ -1141,8 +1141,8 @@ std::vector<cvf::Vec3f> RivWellFracturePartMgr::transformToFractureDisplayCoords
|
||||
cvf::ref<cvf::DrawableGeo> RivWellFracturePartMgr::buildDrawableGeoFromTriangles( const std::vector<cvf::uint>& triangleIndices,
|
||||
const std::vector<cvf::Vec3f>& nodeCoords )
|
||||
{
|
||||
CVF_ASSERT( triangleIndices.size() > 0 );
|
||||
CVF_ASSERT( nodeCoords.size() > 0 );
|
||||
CVF_ASSERT( !triangleIndices.empty() );
|
||||
CVF_ASSERT( !nodeCoords.empty() );
|
||||
|
||||
cvf::ref<cvf::DrawableGeo> geo = new cvf::DrawableGeo;
|
||||
|
||||
|
||||
@@ -249,7 +249,7 @@ bool RivWindowEdgeAxesOverlayItem::pick( int oglXCoord, int oglYCoord, const Vec
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivWindowEdgeAxesOverlayItem::renderGeneric( OpenGLContext* oglContext, const Vec2i& position, const Vec2ui& size, bool software )
|
||||
{
|
||||
if ( size.x() <= 0 || size.y() <= 0 || ( m_windowTickXValues.size() == 0 && m_windowTickYValues.size() == 0 ) )
|
||||
if ( size.x() <= 0 || size.y() <= 0 || ( m_windowTickXValues.empty() && m_windowTickYValues.empty() ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user