Fixes by clang-format

This commit is contained in:
github-actions[bot] 2020-06-08 09:09:11 +00:00 committed by Magne Sjaastad
parent 64a719b1f4
commit 6b5f4dddc9
58 changed files with 202 additions and 206 deletions

View File

@ -91,11 +91,11 @@
#include "RimWellLogFile.h" #include "RimWellLogFile.h"
#include "RimWellLogPlot.h" #include "RimWellLogPlot.h"
#include "RimWellLogPlotCollection.h" #include "RimWellLogPlotCollection.h"
#include "RimWellPath.h"
#include "RimWellPathCollection.h" #include "RimWellPathCollection.h"
#include "RimWellPathFracture.h" #include "RimWellPathFracture.h"
#include "RimWellPltPlot.h" #include "RimWellPltPlot.h"
#include "RimWellRftPlot.h" #include "RimWellRftPlot.h"
#include "RimWellPath.h"
#include "Riu3DMainWindowTools.h" #include "Riu3DMainWindowTools.h"
#include "RiuViewer.h" #include "RiuViewer.h"
@ -1480,9 +1480,9 @@ cvf::Font* RiaApplication::defaultSceneFont()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
cvf::Font* RiaApplication::sceneFont( int fontSize ) cvf::Font* RiaApplication::sceneFont( int fontSize )
{ {
if (fontSize != caf::FontTools::absolutePointSize(m_preferences->defaultSceneFontSize())) if ( fontSize != caf::FontTools::absolutePointSize( m_preferences->defaultSceneFontSize() ) )
{ {
auto font = RiaFontCache::getFont(fontSize); auto font = RiaFontCache::getFont( fontSize );
return font.p(); return font.p();
} }
return defaultSceneFont(); return defaultSceneFont();

View File

@ -188,7 +188,7 @@ public:
static std::vector<QString> readFileListFromTextFile( QString listFileName ); static std::vector<QString> readFileListFromTextFile( QString listFileName );
cvf::Font* defaultSceneFont(); cvf::Font* defaultSceneFont();
cvf::Font* sceneFont(int fontSize); cvf::Font* sceneFont( int fontSize );
cvf::Font* defaultAnnotationFont(); cvf::Font* defaultAnnotationFont();
cvf::Font* defaultWellLabelFont(); cvf::Font* defaultWellLabelFont();

View File

@ -42,7 +42,7 @@ public:
using FontSize = caf::FontTools::FontSize; using FontSize = caf::FontTools::FontSize;
using FontSizeEnum = caf::FontTools::FontSizeEnum; using FontSizeEnum = caf::FontTools::FontSizeEnum;
static cvf::ref<caf::FixedAtlasFont> getFont(FontSize fontSize); static cvf::ref<caf::FixedAtlasFont> getFont( FontSize fontSize );
static cvf::ref<caf::FixedAtlasFont> getFont( int pointSize ); static cvf::ref<caf::FixedAtlasFont> getFont( int pointSize );
static FontSize legacyEnumToPointSize( int enumValue ); static FontSize legacyEnumToPointSize( int enumValue );
static void clear(); static void clear();

View File

@ -43,7 +43,7 @@ public:
static std::vector<std::string> splitStringBySpace( const std::string& s ); static std::vector<std::string> splitStringBySpace( const std::string& s );
static int computeEditDistance( const std::string& x, const std::string& y); static int computeEditDistance( const std::string& x, const std::string& y );
private: private:
template <class Container> template <class Container>

View File

@ -33,7 +33,7 @@ RiaWellPlanCalculator::RiaWellPlanCalculator( const cvf::Vec3d& sta
{ {
if ( m_lineArcEndPoints.size() < 2 ) return; if ( m_lineArcEndPoints.size() < 2 ) return;
WellPlanSegment segment = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; WellPlanSegment segment = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
RiaOffshoreSphericalCoords startAziIncRad( m_startTangent ); RiaOffshoreSphericalCoords startAziIncRad( m_startTangent );
segment.inc = cvf::Math::toDegrees( startAziIncRad.inc() ); segment.inc = cvf::Math::toDegrees( startAziIncRad.inc() );
@ -80,7 +80,7 @@ void RiaWellPlanCalculator::addSegment( cvf::Vec3d t1, cvf::Vec3d p1, cvf::Vec3d
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RiaWellPlanCalculator::addLineSegment( cvf::Vec3d p1, cvf::Vec3d p2, cvf::Vec3d* endTangent ) void RiaWellPlanCalculator::addLineSegment( cvf::Vec3d p1, cvf::Vec3d p2, cvf::Vec3d* endTangent )
{ {
WellPlanSegment segment = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; WellPlanSegment segment = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
cvf::Vec3d p1p2 = p2 - p1; cvf::Vec3d p1p2 = p2 - p1;
double length = p1p2.length(); double length = p1p2.length();
@ -110,7 +110,7 @@ void RiaWellPlanCalculator::addLineSegment( cvf::Vec3d p1, cvf::Vec3d p2, cvf::V
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RiaWellPlanCalculator::addArcSegment( cvf::Vec3d t1, cvf::Vec3d p1, cvf::Vec3d p2, cvf::Vec3d* endTangent ) void RiaWellPlanCalculator::addArcSegment( cvf::Vec3d t1, cvf::Vec3d p1, cvf::Vec3d p2, cvf::Vec3d* endTangent )
{ {
WellPlanSegment segment = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; WellPlanSegment segment = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
RiaArcCurveCalculator arcCalc( p1, t1, p2 ); RiaArcCurveCalculator arcCalc( p1, t1, p2 );

View File

@ -88,8 +88,7 @@ caf::PdmScriptResponse RicfExportFlowCharacteristics::execute()
exportFileName = exportFolder + "/" + fi.fileName(); exportFileName = exportFolder + "/" + fi.fileName();
} }
RimFlowPlotCollection* flowPlotColl = RimFlowPlotCollection* flowPlotColl = RimProject::current()->mainPlotCollection->flowPlotCollection();
RimProject::current()->mainPlotCollection->flowPlotCollection();
if ( flowPlotColl ) if ( flowPlotColl )
{ {
RimFlowCharacteristicsPlot* plot = flowPlotColl->defaultFlowCharacteristicsPlot(); RimFlowCharacteristicsPlot* plot = flowPlotColl->defaultFlowCharacteristicsPlot();

View File

@ -49,7 +49,7 @@ std::vector<caf::FontHolderInterface*> findFontObjects()
for ( auto fontObject : allFontObjects ) for ( auto fontObject : allFontObjects )
{ {
defaultFontObjects.push_back( fontObject ); defaultFontObjects.push_back( fontObject );
} }
return defaultFontObjects; return defaultFontObjects;
} }

View File

@ -106,7 +106,9 @@ private:
static std::vector<RiaQDateTimeTools::DateTimePeriod> tabs() static std::vector<RiaQDateTimeTools::DateTimePeriod> tabs()
{ {
std::vector<RiaQDateTimeTools::DateTimePeriod> dateTimePeriods = RiaQDateTimeTools::dateTimePeriods(); std::vector<RiaQDateTimeTools::DateTimePeriod> dateTimePeriods = RiaQDateTimeTools::dateTimePeriods();
dateTimePeriods.erase( std::remove( dateTimePeriods.begin(), dateTimePeriods.end(), RiaQDateTimeTools::DateTimePeriod::DECADE ), dateTimePeriods.erase( std::remove( dateTimePeriods.begin(),
dateTimePeriods.end(),
RiaQDateTimeTools::DateTimePeriod::DECADE ),
dateTimePeriods.end() ); dateTimePeriods.end() );
return dateTimePeriods; return dateTimePeriods;
} }

View File

@ -60,5 +60,5 @@ private:
double holeRadius, double holeRadius,
double startMeasuredDepth, double startMeasuredDepth,
double endMeasuredDepth, double endMeasuredDepth,
const RimFishbonesMultipleSubs* fishbonesDefinitions ); const RimFishbonesMultipleSubs* fishbonesDefinitions );
}; };

View File

@ -70,8 +70,7 @@ void RicExportEclipseSectorModelFeature::openDialogAndExecuteCommand( RimEclipse
cvf::Vec3i min, max; cvf::Vec3i min, max;
std::tie( min, max ) = getVisibleCellRange( view, cellVisibility ); std::tie( min, max ) = getVisibleCellRange( view, cellVisibility );
RicExportEclipseSectorModelUi* exportSettings = RicExportEclipseSectorModelUi* exportSettings = RimProject::current()->dialogData()->exportSectorModelUi();
RimProject::current()->dialogData()->exportSectorModelUi();
exportSettings->setCaseData( caseData, min, max ); exportSettings->setCaseData( caseData, min, max );
exportSettings->applyBoundaryDefaults(); exportSettings->applyBoundaryDefaults();

View File

@ -124,10 +124,10 @@ void RicExportSelectedWellPathsFeature::writeWellPathGeometryToStream( QTextStre
stream << "WELLNAME: '" << caf::Utils::makeValidFileBasename( exportName ) << "'" << endl; stream << "WELLNAME: '" << caf::Utils::makeValidFileBasename( exportName ) << "'" << endl;
auto numberFormat = RifTextDataTableDoubleFormatting( RIF_FLOAT, 2 ); auto numberFormat = RifTextDataTableDoubleFormatting( RIF_FLOAT, 2 );
formatter.header( { { "X", numberFormat, RIGHT }, formatter.header( {{"X", numberFormat, RIGHT},
{ "Y", numberFormat, RIGHT }, {"Y", numberFormat, RIGHT},
{ "TVDMSL", numberFormat, RIGHT }, {"TVDMSL", numberFormat, RIGHT},
{ useMdRkb ? "MDRKB" : "MDMSL", numberFormat, RIGHT } } ); {useMdRkb ? "MDRKB" : "MDMSL", numberFormat, RIGHT}} );
while ( currMd < endMd ) while ( currMd < endMd )
{ {

View File

@ -88,8 +88,7 @@ void RicShowFlowCharacteristicsPlotFeature::onActionTriggered( bool isChecked )
if ( RimProject::current() ) if ( RimProject::current() )
{ {
RimFlowPlotCollection* flowPlotColl = RimFlowPlotCollection* flowPlotColl = RimProject::current()->mainPlotCollection->flowPlotCollection();
RimProject::current()->mainPlotCollection->flowPlotCollection();
if ( flowPlotColl ) if ( flowPlotColl )
{ {
RiuPlotMainWindowTools::showPlotMainWindow(); RiuPlotMainWindowTools::showPlotMainWindow();

View File

@ -105,8 +105,7 @@ void RicShowWellAllocationPlotFeature::onActionTriggered( bool isChecked )
if ( RimProject::current() ) if ( RimProject::current() )
{ {
RimFlowPlotCollection* flowPlotColl = RimFlowPlotCollection* flowPlotColl = RimProject::current()->mainPlotCollection->flowPlotCollection();
RimProject::current()->mainPlotCollection->flowPlotCollection();
if ( flowPlotColl ) if ( flowPlotColl )
{ {
flowPlotColl->defaultWellAllocPlot()->setFromSimulationWell( simWell ); flowPlotColl->defaultWellAllocPlot()->setFromSimulationWell( simWell );

View File

@ -56,8 +56,7 @@ void RicHoloLensExportToFolderFeature::onActionTriggered( bool isChecked )
{ {
RimGridView* activeView = RiaApplication::instance()->activeGridView(); RimGridView* activeView = RiaApplication::instance()->activeGridView();
RicHoloLensExportToFolderUi* featureUi = RicHoloLensExportToFolderUi* featureUi = RimProject::current()->dialogData()->holoLensExportToFolderData();
RimProject::current()->dialogData()->holoLensExportToFolderData();
featureUi->setViewForExport( activeView ); featureUi->setViewForExport( activeView );
caf::PdmUiPropertyViewDialog propertyDialog( nullptr, caf::PdmUiPropertyViewDialog propertyDialog( nullptr,

View File

@ -91,8 +91,7 @@ void RicSummaryPlotTemplateTools::appendSummaryPlotToPlotCollection(
if ( selectedSummaryCases.empty() && selectedEnsembles.empty() ) return; if ( selectedSummaryCases.empty() && selectedEnsembles.empty() ) return;
RimSummaryPlotCollection* plotColl = RimSummaryPlotCollection* plotColl = RimProject::current()->mainPlotCollection()->summaryPlotCollection();
RimProject::current()->mainPlotCollection()->summaryPlotCollection();
plotColl->summaryPlots.push_back( summaryPlot ); plotColl->summaryPlots.push_back( summaryPlot );
summaryPlot->resolveReferencesRecursively(); summaryPlot->resolveReferencesRecursively();

View File

@ -152,7 +152,7 @@ bool RicImportFaciesFeature::matchByName( const QString name, RimColorLegend* co
int RicImportFaciesFeature::computeEditDistance( const QString& a, const QString& b ) int RicImportFaciesFeature::computeEditDistance( const QString& a, const QString& b )
{ {
// Remove common words from the domain which does not help in the matching // Remove common words from the domain which does not help in the matching
std::vector<QString> stopWords = { "rocks", "rock", "stones", "stone" }; std::vector<QString> stopWords = {"rocks", "rock", "stones", "stone"};
QString aSimplified = a.toLower(); QString aSimplified = a.toLower();
QString bSimplified = b.toLower(); QString bSimplified = b.toLower();
for ( auto r : stopWords ) for ( auto r : stopWords )

View File

@ -170,10 +170,10 @@ bool RicAsciiExportSummaryPlotFeature::exportTextToFile( const QString& fileName
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RicAsciiExportSummaryPlotFeature::exportAsciiForSummaryPlot( const QString& fileName, bool RicAsciiExportSummaryPlotFeature::exportAsciiForSummaryPlot( const QString& fileName,
const RimSummaryPlot* summaryPlot, const RimSummaryPlot* summaryPlot,
RiaQDateTimeTools::DateTimePeriod resamplingPeriod, RiaQDateTimeTools::DateTimePeriod resamplingPeriod,
bool showTimeAsLongString ) bool showTimeAsLongString )
{ {
QString text = summaryPlot->description(); QString text = summaryPlot->description();
text.append( summaryPlot->asciiDataForSummaryPlotExport( resamplingPeriod, showTimeAsLongString ) ); text.append( summaryPlot->asciiDataForSummaryPlotExport( resamplingPeriod, showTimeAsLongString ) );

View File

@ -42,8 +42,8 @@ protected:
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
private: private:
static bool exportAsciiForSummaryPlot( const QString& fileName, static bool exportAsciiForSummaryPlot( const QString& fileName,
const RimSummaryPlot* selectedSummaryPlots, const RimSummaryPlot* selectedSummaryPlots,
RiaQDateTimeTools::DateTimePeriod resamplingPeriod, RiaQDateTimeTools::DateTimePeriod resamplingPeriod,
bool showTimeAsLongString ); bool showTimeAsLongString );
}; };

View File

@ -146,8 +146,7 @@ void RicSummaryPlotFeatureImpl::ensureAtLeastOnePlot( RimSummaryPlotCollection*
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
caf::PdmObject* RicSummaryPlotFeatureImpl::createDefaultSummaryPlot( RimSummaryCase* summaryCase ) caf::PdmObject* RicSummaryPlotFeatureImpl::createDefaultSummaryPlot( RimSummaryCase* summaryCase )
{ {
RimSummaryPlotCollection* summaryPlotCollection = RimSummaryPlotCollection* summaryPlotCollection = RimProject::current()->mainPlotCollection->summaryPlotCollection();
RimProject::current()->mainPlotCollection->summaryPlotCollection();
caf::PdmObject* itemToSelect = nullptr; caf::PdmObject* itemToSelect = nullptr;
@ -393,8 +392,7 @@ void RicSummaryPlotFeatureImpl::createSummaryPlotsFromArgumentLine( const QStrin
RimSummaryPlot* lastPlotCreated = nullptr; RimSummaryPlot* lastPlotCreated = nullptr;
RimSummaryPlotCollection* sumPlotColl = RimSummaryPlotCollection* sumPlotColl = RimProject::current()->mainPlotCollection()->summaryPlotCollection();
RimProject::current()->mainPlotCollection()->summaryPlotCollection();
splitAddressFiltersInGridAndSummary( summaryCasesToUse[0], splitAddressFiltersInGridAndSummary( summaryCasesToUse[0],
allCurveAddressFilters, allCurveAddressFilters,

View File

@ -91,9 +91,10 @@ cvf::ref<RigFormationNames> RifColorLegendData::readLyrFormationNameFile( const
if ( QColor::isValidColor( colorWord ) ) if ( QColor::isValidColor( colorWord ) )
numberString.remove( colorWord ); // remove color if present as last word on line numberString.remove( colorWord ); // remove color if present as last word on line
QStringList numberWords = QStringList numberWords = numberString.split( QRegExp( "-" ), QString::SkipEmptyParts ); // extract words
numberString.split( QRegExp( "-" ), QString::SkipEmptyParts ); // extract words containing formation // containing
// number(s) // formation
// number(s)
if ( numberWords.size() == 2 ) // formation range with or without color at end of line if ( numberWords.size() == 2 ) // formation range with or without color at end of line
{ {

View File

@ -106,7 +106,7 @@
// vertex indices // vertex indices
// //
static const size_t cellMappingECLRi[8] = { 0, 1, 3, 2, 4, 5, 7, 6 }; static const size_t cellMappingECLRi[8] = {0, 1, 3, 2, 4, 5, 7, 6};
//************************************************************************************************** //**************************************************************************************************
// Static functions // Static functions

View File

@ -78,9 +78,9 @@ void RifSurfaceReader::readGocadFile( const QString& filename, RigGocadData* goc
if ( firstToken.compare( "VRTX" ) == 0 ) if ( firstToken.compare( "VRTX" ) == 0 )
{ {
int vertexId = -1; int vertexId = -1;
double x{ std::numeric_limits<double>::infinity() }; double x{std::numeric_limits<double>::infinity()};
double y{ std::numeric_limits<double>::infinity() }; double y{std::numeric_limits<double>::infinity()};
double z{ std::numeric_limits<double>::infinity() }; double z{std::numeric_limits<double>::infinity()};
std::string endVertex; std::string endVertex;
lineStream >> vertexId >> x >> y >> z >> endVertex; lineStream >> vertexId >> x >> y >> z >> endVertex;
@ -99,9 +99,9 @@ void RifSurfaceReader::readGocadFile( const QString& filename, RigGocadData* goc
else if ( firstToken.compare( "PVRTX" ) == 0 ) else if ( firstToken.compare( "PVRTX" ) == 0 )
{ {
int vertexId = -1; int vertexId = -1;
double x{ std::numeric_limits<double>::infinity() }; double x{std::numeric_limits<double>::infinity()};
double y{ std::numeric_limits<double>::infinity() }; double y{std::numeric_limits<double>::infinity()};
double z{ std::numeric_limits<double>::infinity() }; double z{std::numeric_limits<double>::infinity()};
lineStream >> vertexId >> x >> y >> z; lineStream >> vertexId >> x >> y >> z;
@ -124,9 +124,9 @@ void RifSurfaceReader::readGocadFile( const QString& filename, RigGocadData* goc
} }
else if ( firstToken.compare( "TRGL" ) == 0 ) else if ( firstToken.compare( "TRGL" ) == 0 )
{ {
int id1{ -1 }; int id1{-1};
int id2{ -1 }; int id2{-1};
int id3{ -1 }; int id3{-1};
lineStream >> id1 >> id2 >> id3; lineStream >> id1 >> id2 >> id3;
@ -252,7 +252,7 @@ std::pair<std::vector<cvf::Vec3d>, std::vector<unsigned>> RifSurfaceReader::read
// Add point // Add point
surfaceDataPoints.push_back( { i, j, { x, y, z }, values } ); surfaceDataPoints.push_back( {i, j, {x, y, z}, values} );
minI = std::min( minI, i ); minI = std::min( minI, i );
minJ = std::min( minJ, j ); minJ = std::min( minJ, j );

View File

@ -37,7 +37,7 @@ RigFemClosestResultIndexCalculator::RigFemClosestResultIndexCalculator( RigFemPa
if ( resultPosition != RIG_ELEMENT_NODAL_FACE || m_face == -1 ) if ( resultPosition != RIG_ELEMENT_NODAL_FACE || m_face == -1 )
{ {
RigElementType elmType = femPart->elementType( elementIndex ); RigElementType elmType = femPart->elementType( elementIndex );
const int* elementConn = femPart->connectivities( elementIndex ); const int* elementConn = femPart->connectivities( elementIndex );
int elmNodeCount = RigFemTypes::elementNodeCount( elmType ); int elmNodeCount = RigFemTypes::elementNodeCount( elmType );
// Find the closest node // Find the closest node

View File

@ -308,10 +308,10 @@ float RigFemPart::characteristicElementSize() const
if ( eType == HEX8P ) if ( eType == HEX8P )
{ {
const int* elementConn = this->connectivities( elmIdx ); const int* elementConn = this->connectivities( elmIdx );
cvf::Vec3f nodePos0 = this->nodes().coordinates[elementConn[0]]; cvf::Vec3f nodePos0 = this->nodes().coordinates[elementConn[0]];
cvf::Vec3f nodePos1 = this->nodes().coordinates[elementConn[1]]; cvf::Vec3f nodePos1 = this->nodes().coordinates[elementConn[1]];
cvf::Vec3f nodePos3 = this->nodes().coordinates[elementConn[3]]; cvf::Vec3f nodePos3 = this->nodes().coordinates[elementConn[3]];
cvf::Vec3f nodePos4 = this->nodes().coordinates[elementConn[4]]; cvf::Vec3f nodePos4 = this->nodes().coordinates[elementConn[4]];
float l1 = ( nodePos1 - nodePos0 ).length(); float l1 = ( nodePos1 - nodePos0 ).length();
float l3 = ( nodePos3 - nodePos0 ).length(); float l3 = ( nodePos3 - nodePos0 ).length();

View File

@ -496,32 +496,31 @@ std::vector<RiaGrpcCallbackInterface*> RiaGrpcNNCPropertiesService::createCallba
std::vector<RiaGrpcCallbackInterface*> callbacks; std::vector<RiaGrpcCallbackInterface*> callbacks;
callbacks = callbacks =
{ new RiaGrpcUnaryCallback<Self, CaseRequest, AvailableNNCProperties>( this, {new RiaGrpcUnaryCallback<Self, CaseRequest, AvailableNNCProperties>( this,
&Self::GetAvailableNNCProperties, &Self::GetAvailableNNCProperties,
&Self::RequestGetAvailableNNCProperties ), &Self::RequestGetAvailableNNCProperties ),
new RiaGrpcServerToClientStreamCallback<Self, new RiaGrpcServerToClientStreamCallback<Self,
CaseRequest, CaseRequest,
rips::NNCConnections, rips::NNCConnections,
RiaNNCConnectionsStateHandler>( this, RiaNNCConnectionsStateHandler>( this,
&Self::GetNNCConnections, &Self::GetNNCConnections,
&Self::RequestGetNNCConnections, &Self::RequestGetNNCConnections,
new RiaNNCConnectionsStateHandler ), new RiaNNCConnectionsStateHandler ),
new RiaGrpcServerToClientStreamCallback<Self, new RiaGrpcServerToClientStreamCallback<Self,
NNCValuesRequest, NNCValuesRequest,
rips::NNCValues, rips::NNCValues,
RiaNNCValuesStateHandler>( this, RiaNNCValuesStateHandler>( this,
&Self::GetNNCValues, &Self::GetNNCValues,
&Self::RequestGetNNCValues, &Self::RequestGetNNCValues,
new RiaNNCValuesStateHandler ), new RiaNNCValuesStateHandler ),
new RiaGrpcClientToServerStreamCallback<Self, new RiaGrpcClientToServerStreamCallback<Self,
NNCValuesChunk, NNCValuesChunk,
ClientToServerStreamReply, ClientToServerStreamReply,
RiaNNCInputValuesStateHandler>( this, RiaNNCInputValuesStateHandler>( this,
&Self::SetNNCValues, &Self::SetNNCValues,
&Self::RequestSetNNCValues, &Self::RequestSetNNCValues,
new RiaNNCInputValuesStateHandler( new RiaNNCInputValuesStateHandler( true ) )};
true ) ) };
return callbacks; return callbacks;
} }

View File

@ -52,7 +52,7 @@ RivGridBoxGenerator::RivGridBoxGenerator()
m_scaleZ = 1.0; m_scaleZ = 1.0;
m_displayModelOffset = cvf::Vec3d::ZERO; m_displayModelOffset = cvf::Vec3d::ZERO;
m_fontPointSize = caf::FontTools::absolutePointSize(RiaPreferences::current()->defaultSceneFontSize()); m_fontPointSize = caf::FontTools::absolutePointSize( RiaPreferences::current()->defaultSceneFontSize() );
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -221,9 +221,9 @@ void RivGridBoxGenerator::createGridBoxParts()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RivGridBoxGenerator::setGridLabelFontSize( int fontSize ) void RivGridBoxGenerator::setGridLabelFontSize( int fontSize )
{ {
if (m_fontPointSize != fontSize) if ( m_fontPointSize != fontSize )
{ {
m_fontPointSize = fontSize; m_fontPointSize = fontSize;
m_needsRegeneration = true; m_needsRegeneration = true;
} }
} }
@ -670,9 +670,9 @@ void RivGridBoxGenerator::createLegend( EdgeType edge, cvf::Collection<cvf::Part
cvf::ref<cvf::DrawableText> geo = new cvf::DrawableText; cvf::ref<cvf::DrawableText> geo = new cvf::DrawableText;
cvf::ref<cvf::Font> font = RiaGuiApplication::instance()->defaultSceneFont(); cvf::ref<cvf::Font> font = RiaGuiApplication::instance()->defaultSceneFont();
if (caf::FontTools::absolutePointSize(RiaPreferences::current()->defaultSceneFontSize()) != m_fontPointSize) if ( caf::FontTools::absolutePointSize( RiaPreferences::current()->defaultSceneFontSize() ) != m_fontPointSize )
{ {
font = RiaFontCache::getFont(m_fontPointSize); font = RiaFontCache::getFont( m_fontPointSize );
} }
geo->setFont( font.p() ); geo->setFont( font.p() );
geo->setTextColor( m_gridLegendColor ); geo->setTextColor( m_gridLegendColor );

View File

@ -48,7 +48,7 @@ public:
void updateFromBackgroundColor( const cvf::Color3f& backgroundColor ); void updateFromBackgroundColor( const cvf::Color3f& backgroundColor );
void createGridBoxParts(); void createGridBoxParts();
void setGridLabelFontSize(int fontSize); void setGridLabelFontSize( int fontSize );
void updateFromCamera( const cvf::Camera* camera ); void updateFromCamera( const cvf::Camera* camera );
cvf::Model* model(); cvf::Model* model();

View File

@ -449,7 +449,7 @@ void RimAnalysisPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering
{ {
caf::PdmUiGroup* selVectorsGrp = uiOrdering.addNewGroup( "Selected Vectors" ); caf::PdmUiGroup* selVectorsGrp = uiOrdering.addNewGroup( "Selected Vectors" );
selVectorsGrp->add( &m_selectedVarsUiField ); selVectorsGrp->add( &m_selectedVarsUiField );
selVectorsGrp->add( &m_selectVariablesButtonField, { false } ); selVectorsGrp->add( &m_selectVariablesButtonField, {false} );
QString vectorNames; QString vectorNames;
if ( m_analyserOfSelectedCurveDefs ) if ( m_analyserOfSelectedCurveDefs )
@ -471,14 +471,14 @@ void RimAnalysisPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering
timeStepGrp->add( &m_addTimestepUiField ); timeStepGrp->add( &m_addTimestepUiField );
timeStepGrp->add( &m_selectedTimeSteps ); timeStepGrp->add( &m_selectedTimeSteps );
uiOrdering.add( &m_referenceCase, { true, 3, 2 } ); uiOrdering.add( &m_referenceCase, {true, 3, 2} );
uiOrdering.add( &m_showPlotTitle ); uiOrdering.add( &m_showPlotTitle );
uiOrdering.add( &m_useAutoPlotTitle, { false } ); uiOrdering.add( &m_useAutoPlotTitle, {false} );
uiOrdering.add( &m_description, { false } ); uiOrdering.add( &m_description, {false} );
m_description.uiCapability()->setUiReadOnly( m_useAutoPlotTitle() ); m_description.uiCapability()->setUiReadOnly( m_useAutoPlotTitle() );
uiOrdering.add( &m_barOrientation, { true, 3, 2 } ); uiOrdering.add( &m_barOrientation, {true, 3, 2} );
caf::PdmUiGroup* sortGrp = uiOrdering.addNewGroup( "Sorting and Grouping" ); caf::PdmUiGroup* sortGrp = uiOrdering.addNewGroup( "Sorting and Grouping" );
sortGrp->add( &m_majorGroupType ); sortGrp->add( &m_majorGroupType );
@ -486,7 +486,7 @@ void RimAnalysisPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering
sortGrp->add( &m_minorGroupType ); sortGrp->add( &m_minorGroupType );
sortGrp->add( &m_valueSortOperation ); sortGrp->add( &m_valueSortOperation );
sortGrp->add( &m_useTopBarsFilter ); sortGrp->add( &m_useTopBarsFilter );
sortGrp->add( &m_maxBarCount, { false } ); sortGrp->add( &m_maxBarCount, {false} );
m_maxBarCount.uiCapability()->setUiReadOnly( !m_useTopBarsFilter() ); m_maxBarCount.uiCapability()->setUiReadOnly( !m_useTopBarsFilter() );
caf::PdmUiGroup* legendGrp = uiOrdering.addNewGroup( "Legend" ); caf::PdmUiGroup* legendGrp = uiOrdering.addNewGroup( "Legend" );
@ -499,10 +499,10 @@ void RimAnalysisPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering
caf::PdmUiGroup* barLabelGrp = uiOrdering.addNewGroup( "Bar Labels" ); caf::PdmUiGroup* barLabelGrp = uiOrdering.addNewGroup( "Bar Labels" );
barLabelGrp->add( &m_useBarText ); barLabelGrp->add( &m_useBarText );
barLabelGrp->add( &m_useQuantityInBarText ); barLabelGrp->add( &m_useQuantityInBarText );
barLabelGrp->add( &m_useSummaryItemInBarText, { false } ); barLabelGrp->add( &m_useSummaryItemInBarText, {false} );
barLabelGrp->add( &m_useCaseInBarText ); barLabelGrp->add( &m_useCaseInBarText );
barLabelGrp->add( &m_useEnsembleInBarText, { false } ); barLabelGrp->add( &m_useEnsembleInBarText, {false} );
barLabelGrp->add( &m_useTimeStepInBarText, { true, 4, 1 } ); barLabelGrp->add( &m_useTimeStepInBarText, {true, 4, 1} );
m_useQuantityInBarText.uiCapability()->setUiReadOnly( !m_useBarText ); m_useQuantityInBarText.uiCapability()->setUiReadOnly( !m_useBarText );
m_useSummaryItemInBarText.uiCapability()->setUiReadOnly( !m_useBarText ); m_useSummaryItemInBarText.uiCapability()->setUiReadOnly( !m_useBarText );
@ -556,16 +556,16 @@ QList<caf::PdmOptionItemInfo> RimAnalysisPlot::calculateValueOptions( const caf:
if ( fieldNeedingOptions == &m_addTimestepUiField ) if ( fieldNeedingOptions == &m_addTimestepUiField )
{ {
options.push_back( { "None", QDateTime() } ); options.push_back( {"None", QDateTime()} );
std::set<time_t> timeStepUnion = allAvailableTimeSteps(); std::set<time_t> timeStepUnion = allAvailableTimeSteps();
for ( time_t timeT : timeStepUnion ) for ( time_t timeT : timeStepUnion )
{ {
QDateTime dateTime = RiaQDateTimeTools::fromTime_t( timeT ); QDateTime dateTime = RiaQDateTimeTools::fromTime_t( timeT );
QString formatString = RiaQDateTimeTools::createTimeFormatStringFromDates( { dateTime } ); QString formatString = RiaQDateTimeTools::createTimeFormatStringFromDates( {dateTime} );
options.push_back( { dateTime.toString( formatString ), dateTime } ); options.push_back( {dateTime.toString( formatString ), dateTime} );
} }
} }
else if ( fieldNeedingOptions == &m_valueSortOperation ) else if ( fieldNeedingOptions == &m_valueSortOperation )
@ -588,7 +588,7 @@ QList<caf::PdmOptionItemInfo> RimAnalysisPlot::calculateValueOptions( const caf:
{ {
std::vector<RimSummaryCase*> allSummaryCases = RimProject::current()->allSummaryCases(); std::vector<RimSummaryCase*> allSummaryCases = RimProject::current()->allSummaryCases();
options.push_back( { "None", nullptr } ); options.push_back( {"None", nullptr} );
for ( auto sumCase : allSummaryCases ) for ( auto sumCase : allSummaryCases )
{ {
@ -599,7 +599,7 @@ QList<caf::PdmOptionItemInfo> RimAnalysisPlot::calculateValueOptions( const caf:
displayName = caseColl->name() + "/" + displayName; displayName = caseColl->name() + "/" + displayName;
} }
options.push_back( { displayName, sumCase } ); options.push_back( {displayName, sumCase} );
} }
} }
@ -1034,7 +1034,7 @@ void RimAnalysisPlot::applyFilter( const RimPlotDataFilterItem* filter,
if ( filter->useAbsoluteValues() ) value = fabs( value ); if ( filter->useAbsoluteValues() ) value = fabs( value );
bool useLargest = filter->filterOperation() == RimPlotDataFilterItem::TOP_N; bool useLargest = filter->filterOperation() == RimPlotDataFilterItem::TOP_N;
auto itIsInsertedPair = casesToKeepWithValue.insert( { sumCase, value } ); auto itIsInsertedPair = casesToKeepWithValue.insert( {sumCase, value} );
if ( !itIsInsertedPair.second ) // Already exists in map if ( !itIsInsertedPair.second ) // Already exists in map
{ {
double& insertedValue = itIsInsertedPair.first->second; double& insertedValue = itIsInsertedPair.first->second;
@ -1128,7 +1128,7 @@ void RimAnalysisPlot::applyFilter( const RimPlotDataFilterItem* filter,
if ( historyTimesteps.size() ) if ( historyTimesteps.size() )
{ {
selectedTimestepIndices = selectedTimestepIndices =
RimAnalysisPlot::findTimestepIndices( { historyTimesteps.back() }, timesteps ); RimAnalysisPlot::findTimestepIndices( {historyTimesteps.back()}, timesteps );
} }
} }
else if ( filter->consideredTimeStepsType() == RimPlotDataFilterItem::SELECT_TIMESTEP_RANGE ) else if ( filter->consideredTimeStepsType() == RimPlotDataFilterItem::SELECT_TIMESTEP_RANGE )
@ -1186,7 +1186,7 @@ void RimAnalysisPlot::applyFilter( const RimPlotDataFilterItem* filter,
if ( filter->useAbsoluteValues() ) value = fabs( value ); if ( filter->useAbsoluteValues() ) value = fabs( value );
bool useLargest = filter->filterOperation() == RimPlotDataFilterItem::TOP_N; bool useLargest = filter->filterOperation() == RimPlotDataFilterItem::TOP_N;
auto itIsInsertedPair = casesToKeepWithValue.insert( { sumCaseInEvaluation, value } ); auto itIsInsertedPair = casesToKeepWithValue.insert( {sumCaseInEvaluation, value} );
if ( !itIsInsertedPair.second ) // Already exists in map if ( !itIsInsertedPair.second ) // Already exists in map
{ {
double& insertedValue = itIsInsertedPair.first->second; double& insertedValue = itIsInsertedPair.first->second;
@ -1240,7 +1240,7 @@ void RimAnalysisPlot::applyFilter( const RimPlotDataFilterItem* filter,
if ( filter->useAbsoluteValues() ) value = fabs( value ); if ( filter->useAbsoluteValues() ) value = fabs( value );
bool useLargest = filter->filterOperation() == RimPlotDataFilterItem::TOP_N; bool useLargest = filter->filterOperation() == RimPlotDataFilterItem::TOP_N;
auto itIsInsertedPair = sumItemsToKeepWithValue.insert( { sumItem, value } ); auto itIsInsertedPair = sumItemsToKeepWithValue.insert( {sumItem, value} );
if ( !itIsInsertedPair.second ) // Already exists in map if ( !itIsInsertedPair.second ) // Already exists in map
{ {
double& insertedValue = itIsInsertedPair.first->second; double& insertedValue = itIsInsertedPair.first->second;
@ -1268,7 +1268,7 @@ void RimAnalysisPlot::applyFilter( const RimPlotDataFilterItem* filter,
std::multimap<double, RifEclipseSummaryAddress> valueSortedSumItems; std::multimap<double, RifEclipseSummaryAddress> valueSortedSumItems;
for ( const auto& itemValPair : sumItemsToKeepWithValue ) for ( const auto& itemValPair : sumItemsToKeepWithValue )
{ {
valueSortedSumItems.insert( { itemValPair.second, itemValPair.first } ); valueSortedSumItems.insert( {itemValPair.second, itemValPair.first} );
} }
if ( filter->filterOperation() == RimPlotDataFilterItem::TOP_N ) if ( filter->filterOperation() == RimPlotDataFilterItem::TOP_N )
@ -1299,7 +1299,7 @@ void RimAnalysisPlot::applyFilter( const RimPlotDataFilterItem* filter,
std::multimap<double, RimSummaryCase*> valueSortedSumCases; std::multimap<double, RimSummaryCase*> valueSortedSumCases;
for ( const auto& caseValPair : casesToKeepWithValue ) for ( const auto& caseValPair : casesToKeepWithValue )
{ {
valueSortedSumCases.insert( { caseValPair.second, caseValPair.first } ); valueSortedSumCases.insert( {caseValPair.second, caseValPair.first} );
} }
if ( filter->filterOperation() == RimPlotDataFilterItem::TOP_N ) if ( filter->filterOperation() == RimPlotDataFilterItem::TOP_N )
@ -1411,7 +1411,7 @@ void RimAnalysisPlot::addDataToChartBuilder( RiuGroupedBarChartBuilder& chartBui
double sortValue = std::numeric_limits<double>::infinity(); double sortValue = std::numeric_limits<double>::infinity();
QDateTime dateTime = RiaQDateTimeTools::fromTime_t( timesteps[timestepIdx] ); QDateTime dateTime = RiaQDateTimeTools::fromTime_t( timesteps[timestepIdx] );
QString formatString = RiaQDateTimeTools::createTimeFormatStringFromDates( { dateTime } ); QString formatString = RiaQDateTimeTools::createTimeFormatStringFromDates( {dateTime} );
QString timestepString = dateTime.toString( formatString ); QString timestepString = dateTime.toString( formatString );
@ -1517,7 +1517,7 @@ void RimAnalysisPlot::updatePlotTitle()
{ {
if ( !autoTitle.isEmpty() ) autoTitle += " @ "; if ( !autoTitle.isEmpty() ) autoTitle += " @ ";
QString formatString = RiaQDateTimeTools::createTimeFormatStringFromDates( { m_selectedTimeSteps()[0] } ); QString formatString = RiaQDateTimeTools::createTimeFormatStringFromDates( {m_selectedTimeSteps()[0]} );
autoTitle += m_selectedTimeSteps()[0].toString( formatString ); autoTitle += m_selectedTimeSteps()[0].toString( formatString );
} }
@ -1592,7 +1592,7 @@ std::vector<RiaSummaryCurveDefinition> RimAnalysisPlot::curveDefinitionsWithEmbe
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
std::set<RimPlotAxisPropertiesInterface*> RimAnalysisPlot::allPlotAxes() const std::set<RimPlotAxisPropertiesInterface*> RimAnalysisPlot::allPlotAxes() const
{ {
return { m_valueAxisProperties }; return {m_valueAxisProperties};
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -106,7 +106,7 @@ RimAnnotationInViewCollection::RimAnnotationInViewCollection()
"", "",
"" ); "" );
CAF_PDM_InitFieldNoDefault(&m_annotationFontSize, "AnnotationFontSize", "Default Font Size", "", "", ""); CAF_PDM_InitFieldNoDefault( &m_annotationFontSize, "AnnotationFontSize", "Default Font Size", "", "", "" );
m_globalTextAnnotations.uiCapability()->setUiHidden( true ); m_globalTextAnnotations.uiCapability()->setUiHidden( true );
m_globalReachCircleAnnotations.uiCapability()->setUiHidden( true ); m_globalReachCircleAnnotations.uiCapability()->setUiHidden( true );
@ -250,7 +250,7 @@ void RimAnnotationInViewCollection::onGlobalCollectionChanged( const RimAnnotati
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
int RimAnnotationInViewCollection::fontSize() const int RimAnnotationInViewCollection::fontSize() const
{ {
return caf::FontTools::absolutePointSize(RiaPreferences::current()->defaultSceneFontSize(), m_annotationFontSize()); return caf::FontTools::absolutePointSize( RiaPreferences::current()->defaultSceneFontSize(), m_annotationFontSize() );
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -63,6 +63,7 @@ public:
void updateFonts(); void updateFonts();
void onChildDeleted( caf::PdmChildArrayFieldHandle* childArray, void onChildDeleted( caf::PdmChildArrayFieldHandle* childArray,
std::vector<caf::PdmObjectHandle*>& referringObjects ) override; std::vector<caf::PdmObjectHandle*>& referringObjects ) override;
protected: protected:
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
@ -79,7 +80,7 @@ private:
caf::PdmField<double> m_annotationPlaneDepth; caf::PdmField<double> m_annotationPlaneDepth;
caf::PdmField<bool> m_snapAnnotations; caf::PdmField<bool> m_snapAnnotations;
caf::PdmField<caf::FontTools::RelativeSizeEnum> m_annotationFontSize; caf::PdmField<caf::FontTools::RelativeSizeEnum> m_annotationFontSize;
caf::PdmChildField<RimAnnotationGroupCollection*> m_globalTextAnnotations; caf::PdmChildField<RimAnnotationGroupCollection*> m_globalTextAnnotations;
caf::PdmChildField<RimAnnotationGroupCollection*> m_globalReachCircleAnnotations; caf::PdmChildField<RimAnnotationGroupCollection*> m_globalReachCircleAnnotations;
caf::PdmChildField<RimAnnotationGroupCollection*> m_globalUserDefinedPolylineAnnotations; caf::PdmChildField<RimAnnotationGroupCollection*> m_globalUserDefinedPolylineAnnotations;

View File

@ -248,7 +248,7 @@ void RimFlowCharacteristicsPlot::setAquiferCellThreshold( double aquiferCellThre
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
int RimFlowCharacteristicsPlot::fontSize() const int RimFlowCharacteristicsPlot::fontSize() const
{ {
return caf::FontTools::absolutePointSize(RiaPreferences::current()->defaultPlotFontSize()); return caf::FontTools::absolutePointSize( RiaPreferences::current()->defaultPlotFontSize() );
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -821,7 +821,7 @@ QString RimFlowCharacteristicsPlot::curveDataAsText() const
std::vector<QDateTime> timeStepDates = m_case->timeStepDates(); std::vector<QDateTime> timeStepDates = m_case->timeStepDates();
std::vector<double> storageCapacitySamplingValues = { 0.08, 0.1, 0.2, 0.3, 0.4 }; std::vector<double> storageCapacitySamplingValues = {0.08, 0.1, 0.2, 0.3, 0.4};
size_t sampleCount = storageCapacitySamplingValues.size(); size_t sampleCount = storageCapacitySamplingValues.size();
for ( const auto& timeIndex : m_currentlyPlottedTimeSteps ) for ( const auto& timeIndex : m_currentlyPlottedTimeSteps )

View File

@ -140,7 +140,7 @@ size_t RimTofAccumulatedPhaseFractionsPlot::timeStep()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
int RimTofAccumulatedPhaseFractionsPlot::fontSize() const int RimTofAccumulatedPhaseFractionsPlot::fontSize() const
{ {
return caf::FontTools::absolutePointSize(RiaPreferences::current()->defaultPlotFontSize()); return caf::FontTools::absolutePointSize( RiaPreferences::current()->defaultPlotFontSize() );
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -75,6 +75,7 @@ public:
int fontSize() const override; int fontSize() const override;
void updateFonts() override; void updateFonts() override;
protected: protected:
// RimViewWindow overrides // RimViewWindow overrides
void assignIdIfNecessary() final; void assignIdIfNecessary() final;

View File

@ -93,7 +93,7 @@ void RimTotalWellAllocationPlot::deleteViewWidget()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
int RimTotalWellAllocationPlot::fontSize() const int RimTotalWellAllocationPlot::fontSize() const
{ {
return caf::FontTools::absolutePointSize(RiaPreferences::current()->defaultPlotFontSize()); return caf::FontTools::absolutePointSize( RiaPreferences::current()->defaultPlotFontSize() );
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -125,9 +125,9 @@ RimWellAllocationPlot::RimWellAllocationPlot()
this->setAsPlotMdiWindow(); this->setAsPlotMdiWindow();
m_accumulatedWellFlowPlot->setAvailableDepthUnits( {} ); m_accumulatedWellFlowPlot->setAvailableDepthUnits( {} );
m_accumulatedWellFlowPlot->setAvailableDepthTypes( { RiaDefines::DepthTypeEnum::CONNECTION_NUMBER, m_accumulatedWellFlowPlot->setAvailableDepthTypes( {RiaDefines::DepthTypeEnum::CONNECTION_NUMBER,
RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH, RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH,
RiaDefines::DepthTypeEnum::PSEUDO_LENGTH } ); RiaDefines::DepthTypeEnum::PSEUDO_LENGTH} );
m_accumulatedWellFlowPlot->setCommonDataSourceEnabled( false ); m_accumulatedWellFlowPlot->setCommonDataSourceEnabled( false );
@ -800,7 +800,7 @@ void RimWellAllocationPlot::showPlotLegend( bool doShow )
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
int RimWellAllocationPlot::fontSize() const int RimWellAllocationPlot::fontSize() const
{ {
return caf::FontTools::absolutePointSize(RiaPreferences::current()->defaultPlotFontSize()); return caf::FontTools::absolutePointSize( RiaPreferences::current()->defaultPlotFontSize() );
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -55,8 +55,8 @@ RimLegendConfig::~RimLegendConfig()
int RimLegendConfig::fontSize() const int RimLegendConfig::fontSize() const
{ {
caf::FontHolderInterface* parentFontHolder = nullptr; caf::FontHolderInterface* parentFontHolder = nullptr;
this->firstAncestorOfType(parentFontHolder); this->firstAncestorOfType( parentFontHolder );
if (parentFontHolder) return parentFontHolder->fontSize(); if ( parentFontHolder ) return parentFontHolder->fontSize();
return caf::FontTools::absolutePointSize(RiaPreferences::current()->defaultSceneFontSize()); return caf::FontTools::absolutePointSize( RiaPreferences::current()->defaultSceneFontSize() );
} }

View File

@ -132,7 +132,7 @@ QString RimModeledWellPath::wellPlanText()
formatter.setTableRowLineAppendText( "" ); formatter.setTableRowLineAppendText( "" );
std::vector<RifTextDataTableColumn> tableHeader; std::vector<RifTextDataTableColumn> tableHeader;
std::vector<QString> columns = { "MDRKB", "CL", "Inc", "Azi", "TVDMSL", "NS", "EW", "Dogleg", "Build", "Turn" }; std::vector<QString> columns = {"MDRKB", "CL", "Inc", "Azi", "TVDMSL", "NS", "EW", "Dogleg", "Build", "Turn"};
for ( QString column : columns ) for ( QString column : columns )
{ {
tableHeader.push_back( tableHeader.push_back(

View File

@ -66,10 +66,10 @@ QWidget* RimPlot::createViewWidget( QWidget* parent /*= nullptr */ )
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimPlot::updateFonts() void RimPlot::updateFonts()
{ {
if (viewer()) if ( viewer() )
{ {
viewer()->setPlotTitleFontSize(titleFontSize()); viewer()->setPlotTitleFontSize( titleFontSize() );
viewer()->setLegendFontSize(legendFontSize()); viewer()->setLegendFontSize( legendFontSize() );
} }
} }

View File

@ -99,6 +99,7 @@ protected:
QWidget* createViewWidget( QWidget* parent = nullptr ) final; QWidget* createViewWidget( QWidget* parent = nullptr ) final;
void updateFonts(); void updateFonts();
private: private:
virtual void doRemoveFromCollection() = 0; virtual void doRemoveFromCollection() = 0;
virtual void doRenderWindowContent( QPaintDevice* paintDevice ); virtual void doRenderWindowContent( QPaintDevice* paintDevice );

View File

@ -201,8 +201,7 @@ void RimSummaryCalculationVariable::readDataFromApplicationStore( RiuSummaryVect
RiaApplication::instance()->cacheDataObject( "CalculatorSummaryCase" ).toString(); RiaApplication::instance()->cacheDataObject( "CalculatorSummaryCase" ).toString();
auto* lastUsedSummaryCase = dynamic_cast<RimSummaryCase*>( auto* lastUsedSummaryCase = dynamic_cast<RimSummaryCase*>(
caf::PdmReferenceHelper::objectFromReference( RimProject::current(), caf::PdmReferenceHelper::objectFromReference( RimProject::current(), lastUsedSummaryCaseString ) );
lastUsedSummaryCaseString ) );
if ( lastUsedSummaryCase ) if ( lastUsedSummaryCase )
{ {
sumCase = lastUsedSummaryCase; sumCase = lastUsedSummaryCase;
@ -217,8 +216,7 @@ void RimSummaryCalculationVariable::readDataFromApplicationStore( RiuSummaryVect
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimSummaryCalculationVariable::writeDataToApplicationStore() const void RimSummaryCalculationVariable::writeDataToApplicationStore() const
{ {
QString refFromProjectToObject = QString refFromProjectToObject = caf::PdmReferenceHelper::referenceFromRootToObject( RimProject::current(), m_case );
caf::PdmReferenceHelper::referenceFromRootToObject( RimProject::current(), m_case );
RiaApplication::instance()->setCacheDataObject( "CalculatorSummaryCase", refFromProjectToObject ); RiaApplication::instance()->setCacheDataObject( "CalculatorSummaryCase", refFromProjectToObject );
QVariant sumAdrVar = QVariant::fromValue( m_summaryAddress->address() ); QVariant sumAdrVar = QVariant::fromValue( m_summaryAddress->address() );

View File

@ -245,9 +245,9 @@ void RimTernaryLegendConfig::recreateLegend()
// has been removed, (and thus the opengl resources has been deleted) The text in // has been removed, (and thus the opengl resources has been deleted) The text in
// the legend disappeared because of this, so workaround: recreate the legend when needed: // the legend disappeared because of this, so workaround: recreate the legend when needed:
int fontSize = this->fontSize(); int fontSize = this->fontSize();
cvf::Font* font = RiaApplication::instance()->sceneFont(fontSize); cvf::Font* font = RiaApplication::instance()->sceneFont( fontSize );
m_legend = new RivTernarySaturationOverlayItem( font ); m_legend = new RivTernarySaturationOverlayItem( font );
m_legend->setLayout( cvf::OverlayItem::VERTICAL, cvf::OverlayItem::BOTTOM_LEFT ); m_legend->setLayout( cvf::OverlayItem::VERTICAL, cvf::OverlayItem::BOTTOM_LEFT );
updateLegend(); updateLegend();

View File

@ -798,8 +798,8 @@ QList<caf::PdmOptionItemInfo>
options.push_back( caf::PdmOptionItemInfo( "No Trajectory Types", -1 ) ); options.push_back( caf::PdmOptionItemInfo( "No Trajectory Types", -1 ) );
} }
} }
std::vector<RimWellLogExtractionCurve::TrajectoryType> trajectoryTypes = { RimWellLogExtractionCurve::WELL_PATH, std::vector<RimWellLogExtractionCurve::TrajectoryType> trajectoryTypes = {RimWellLogExtractionCurve::WELL_PATH,
RimWellLogExtractionCurve::SIMULATION_WELL }; RimWellLogExtractionCurve::SIMULATION_WELL};
for ( RimWellLogExtractionCurve::TrajectoryType trajectoryType : trajectoryTypes ) for ( RimWellLogExtractionCurve::TrajectoryType trajectoryType : trajectoryTypes )
{ {
caf::PdmOptionItemInfo item( caf::AppEnum<RimWellLogExtractionCurve::TrajectoryType>::uiText( trajectoryType ), caf::PdmOptionItemInfo item( caf::AppEnum<RimWellLogExtractionCurve::TrajectoryType>::uiText( trajectoryType ),

View File

@ -505,7 +505,7 @@ void RimWellLogTrack::updateYZoom()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
int RimWellLogTrack::axisFontSize() const int RimWellLogTrack::axisFontSize() const
{ {
return caf::FontTools::absolutePointSize(RiaPreferences::current()->defaultPlotFontSize(), m_axisFontSize()); return caf::FontTools::absolutePointSize( RiaPreferences::current()->defaultPlotFontSize(), m_axisFontSize() );
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -643,10 +643,10 @@ void RimSummaryCurve::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering
QString curveDataGroupName = "Summary Vector"; QString curveDataGroupName = "Summary Vector";
if ( isCrossPlotCurve() ) curveDataGroupName += " Y"; if ( isCrossPlotCurve() ) curveDataGroupName += " Y";
caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroupWithKeyword( curveDataGroupName, "Summary Vector Y" ); caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroupWithKeyword( curveDataGroupName, "Summary Vector Y" );
curveDataGroup->add( &m_yValuesSummaryCase, { true, 3, 1 } ); curveDataGroup->add( &m_yValuesSummaryCase, {true, 3, 1} );
curveDataGroup->add( &m_yValuesSummaryAddressUiField, { true, 2, 1 } ); curveDataGroup->add( &m_yValuesSummaryAddressUiField, {true, 2, 1} );
curveDataGroup->add( &m_yPushButtonSelectSummaryAddress, { false, 1, 0 } ); curveDataGroup->add( &m_yPushButtonSelectSummaryAddress, {false, 1, 0} );
curveDataGroup->add( &m_plotAxis, { true, 3, 1 } ); curveDataGroup->add( &m_plotAxis, {true, 3, 1} );
if ( isCrossPlotCurve() ) if ( isCrossPlotCurve() )
m_showErrorBars = false; m_showErrorBars = false;
@ -657,9 +657,9 @@ void RimSummaryCurve::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering
if ( isCrossPlotCurve() ) if ( isCrossPlotCurve() )
{ {
caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroup( "Summary Vector X" ); caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroup( "Summary Vector X" );
curveDataGroup->add( &m_xValuesSummaryCase, { true, 3, 1 } ); curveDataGroup->add( &m_xValuesSummaryCase, {true, 3, 1} );
curveDataGroup->add( &m_xValuesSummaryAddressUiField, { true, 2, 1 } ); curveDataGroup->add( &m_xValuesSummaryAddressUiField, {true, 2, 1} );
curveDataGroup->add( &m_xPushButtonSelectSummaryAddress, { false, 1, 0 } ); curveDataGroup->add( &m_xPushButtonSelectSummaryAddress, {false, 1, 0} );
} }
caf::PdmUiGroup* appearanceGroup = uiOrdering.addNewGroup( "Appearance" ); caf::PdmUiGroup* appearanceGroup = uiOrdering.addNewGroup( "Appearance" );

View File

@ -43,7 +43,7 @@ cvf::StructGridInterface::FaceType
{ {
// Try to find the shared face // Try to find the shared face
bool isPossibleNeighborInDirection[6] = { true, true, true, true, true, true }; bool isPossibleNeighborInDirection[6] = {true, true, true, true, true, true};
if ( c1.hostGrid() == c2.hostGrid() ) if ( c1.hostGrid() == c2.hostGrid() )
{ {

View File

@ -107,10 +107,11 @@ void RigFisbonesGeometry::computeLateralPositionAndOrientation( size_t subI
} }
{ {
double initialRotationAngle = m_fishbonesSub->rotationAngle( subIndex ); double initialRotationAngle = m_fishbonesSub->rotationAngle( subIndex );
double lateralOffsetDegrees = 360.0 / m_fishbonesSub->lateralLengths().size(); double lateralOffsetDegrees = 360.0 / m_fishbonesSub->lateralLengths().size();
double lateralOffsetRadians = cvf::Math::toRadians( initialRotationAngle + lateralOffsetDegrees * lateralIndex ); double lateralOffsetRadians =
cvf::Math::toRadians( initialRotationAngle + lateralOffsetDegrees * lateralIndex );
cvf::Mat4d lateralOffsetMatrix = cvf::Mat4d::fromRotation( alongWellPath, lateralOffsetRadians ); cvf::Mat4d lateralOffsetMatrix = cvf::Mat4d::fromRotation( alongWellPath, lateralOffsetRadians );

View File

@ -910,10 +910,10 @@ void RigMainGrid::setDualPorosity( bool enable )
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
std::array<double, 6> RigMainGrid::defaultMapAxes() std::array<double, 6> RigMainGrid::defaultMapAxes()
{ {
const double origin[2] = { 0.0, 0.0 }; const double origin[2] = {0.0, 0.0};
const double xPoint[2] = { 1.0, 0.0 }; const double xPoint[2] = {1.0, 0.0};
const double yPoint[2] = { 0.0, 1.0 }; const double yPoint[2] = {0.0, 1.0};
// Order (see Elipse Reference Manual for keyword MAPAXES): Y_x, Y_y, O_x, O_y, X_x, X_y // Order (see Elipse Reference Manual for keyword MAPAXES): Y_x, Y_y, O_x, O_y, X_x, X_y
return { yPoint[0], yPoint[1], origin[0], origin[1], xPoint[0], xPoint[1] }; return {yPoint[0], yPoint[1], origin[0], origin[1], xPoint[0], xPoint[1]};
} }

View File

@ -21,8 +21,8 @@ TEST( RiaInterpolationToolsTest, LinearEmptyData )
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
TEST( RiaInterpolationToolsTest, SingleValue ) TEST( RiaInterpolationToolsTest, SingleValue )
{ {
std::vector<double> x = { 1.0 }; std::vector<double> x = {1.0};
std::vector<double> y = { 3.0 }; std::vector<double> y = {3.0};
double res = RiaInterpolationTools::linear( x, y, 2.0 ); double res = RiaInterpolationTools::linear( x, y, 2.0 );
EXPECT_EQ( std::numeric_limits<double>::infinity(), res ); EXPECT_EQ( std::numeric_limits<double>::infinity(), res );
@ -33,8 +33,8 @@ TEST( RiaInterpolationToolsTest, SingleValue )
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
TEST( RiaInterpolationToolsTest, ValidInterval ) TEST( RiaInterpolationToolsTest, ValidInterval )
{ {
std::vector<double> x = { 0.0, 1.0 }; std::vector<double> x = {0.0, 1.0};
std::vector<double> y = { 0.0, 2.0 }; std::vector<double> y = {0.0, 2.0};
double res = RiaInterpolationTools::linear( x, y, 0.5 ); double res = RiaInterpolationTools::linear( x, y, 0.5 );
EXPECT_DOUBLE_EQ( 1.0, res ); EXPECT_DOUBLE_EQ( 1.0, res );
@ -45,8 +45,8 @@ TEST( RiaInterpolationToolsTest, ValidInterval )
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
TEST( RiaInterpolationToolsTest, ValidIntervalLastBin ) TEST( RiaInterpolationToolsTest, ValidIntervalLastBin )
{ {
std::vector<double> x = { 0.0, 1.0, 100.0, 1100.0 }; std::vector<double> x = {0.0, 1.0, 100.0, 1100.0};
std::vector<double> y = { 0.0, 2.0, 0.0, 2000.0 }; std::vector<double> y = {0.0, 2.0, 0.0, 2000.0};
double res = RiaInterpolationTools::linear( x, y, 600.0 ); double res = RiaInterpolationTools::linear( x, y, 600.0 );
EXPECT_DOUBLE_EQ( 1000.0, res ); EXPECT_DOUBLE_EQ( 1000.0, res );
@ -57,8 +57,8 @@ TEST( RiaInterpolationToolsTest, ValidIntervalLastBin )
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
TEST( RiaInterpolationToolsTest, ValidIntervalValueTooLow ) TEST( RiaInterpolationToolsTest, ValidIntervalValueTooLow )
{ {
std::vector<double> x = { 0.0, 1.0 }; std::vector<double> x = {0.0, 1.0};
std::vector<double> y = { 0.0, 2.0 }; std::vector<double> y = {0.0, 2.0};
// Outside interval on low side // Outside interval on low side
double res = RiaInterpolationTools::linear( x, y, -1.0 ); double res = RiaInterpolationTools::linear( x, y, -1.0 );
@ -70,8 +70,8 @@ TEST( RiaInterpolationToolsTest, ValidIntervalValueTooLow )
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
TEST( RiaInterpolationToolsTest, ValidIntervalValueTooHigh ) TEST( RiaInterpolationToolsTest, ValidIntervalValueTooHigh )
{ {
std::vector<double> x = { 0.0, 1.0 }; std::vector<double> x = {0.0, 1.0};
std::vector<double> y = { 0.0, 2.0 }; std::vector<double> y = {0.0, 2.0};
// Outside interval on high side // Outside interval on high side
double res = RiaInterpolationTools::linear( x, y, 100.0 ); double res = RiaInterpolationTools::linear( x, y, 100.0 );

View File

@ -507,10 +507,10 @@ void RiuGroupedBarChartBuilder::addBarChartToPlot( QwtPlot* plot, Qt::Orientatio
barPoints = &( legendToBarPointsPair->second ); barPoints = &( legendToBarPointsPair->second );
} }
barPoints->push_back( { currentBarPosition, barDef.m_value } ); barPoints->push_back( {currentBarPosition, barDef.m_value} );
if ( !barDef.m_barText.isEmpty() ) if ( !barDef.m_barText.isEmpty() )
{ {
positionedBarLabels[currentBarPosition] = { QwtScaleDiv::MinorTick, barDef.m_barText }; positionedBarLabels[currentBarPosition] = {QwtScaleDiv::MinorTick, barDef.m_barText};
} }
// Increment the bar position for the next bar // Increment the bar position for the next bar

View File

@ -39,7 +39,7 @@ RiuDockedQwtPlot::RiuDockedQwtPlot( QWidget* parent /*= nullptr*/ )
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RiuDockedQwtPlot::applyFontSizes( bool replot /*= false*/ ) void RiuDockedQwtPlot::applyFontSizes( bool replot /*= false*/ )
{ {
std::set<QwtPlot::Axis> allAxes = { QwtPlot::xBottom, QwtPlot::yLeft, QwtPlot::xTop, QwtPlot::yRight }; std::set<QwtPlot::Axis> allAxes = {QwtPlot::xBottom, QwtPlot::yLeft, QwtPlot::xTop, QwtPlot::yRight};
caf::FontTools::FontSize fontSize = RiaPreferences::current()->defaultPlotFontSize(); caf::FontTools::FontSize fontSize = RiaPreferences::current()->defaultPlotFontSize();

View File

@ -283,7 +283,7 @@ void RiuFemResultTextBuilder::appendTextFromResultColors( RigGeoMechCaseData*
{ {
RigFemPart* femPart = geomData->femParts()->part( gridIndex ); RigFemPart* femPart = geomData->femParts()->part( gridIndex );
RigElementType elmType = femPart->elementType( cellIndex ); RigElementType elmType = femPart->elementType( cellIndex );
const int* elementConn = femPart->connectivities( cellIndex ); const int* elementConn = femPart->connectivities( cellIndex );
int elmNodeCount = RigFemTypes::elementNodeCount( elmType ); int elmNodeCount = RigFemTypes::elementNodeCount( elmType );
const int* lElmNodeToIpMap = RigFemTypes::localElmNodeToIntegrationPointMapping( elmType ); const int* lElmNodeToIpMap = RigFemTypes::localElmNodeToIntegrationPointMapping( elmType );

View File

@ -35,8 +35,8 @@ class RiuPlotAnnotationTool
public: public:
enum class RegionAnnotationType enum class RegionAnnotationType
{ {
NO_ANNOTATIONS = 0, NO_ANNOTATIONS = 0,
FORMATION_ANNOTATIONS = 1, FORMATION_ANNOTATIONS = 1,
// Used to have Wbs-parameter coding as 2 // Used to have Wbs-parameter coding as 2
RESULT_PROPERTY_ANNOTATIONS = 3 RESULT_PROPERTY_ANNOTATIONS = 3
}; };

View File

@ -68,7 +68,7 @@ void RiuQwtPlotTools::setCommonPlotBehaviour( QwtPlot* plot )
plot->setAxisFont( QwtPlot::yRight, axisFont ); plot->setAxisFont( QwtPlot::yRight, axisFont );
// Axis title font // Axis title font
std::vector<QwtPlot::Axis> axes = { QwtPlot::xBottom, QwtPlot::xTop, QwtPlot::yLeft, QwtPlot::yRight }; std::vector<QwtPlot::Axis> axes = {QwtPlot::xBottom, QwtPlot::xTop, QwtPlot::yLeft, QwtPlot::yRight};
for ( QwtPlot::Axis axis : axes ) for ( QwtPlot::Axis axis : axes )
{ {
@ -132,14 +132,14 @@ void RiuQwtPlotTools::enableDateBasedBottomXAxis( QwtPlot*
{ {
QwtDateScaleDraw* scaleDraw = new QwtDateScaleDraw( Qt::UTC ); QwtDateScaleDraw* scaleDraw = new QwtDateScaleDraw( Qt::UTC );
std::set<QwtDate::IntervalType> intervals = { QwtDate::Year, std::set<QwtDate::IntervalType> intervals = {QwtDate::Year,
QwtDate::Month, QwtDate::Month,
QwtDate::Week, QwtDate::Week,
QwtDate::Day, QwtDate::Day,
QwtDate::Hour, QwtDate::Hour,
QwtDate::Minute, QwtDate::Minute,
QwtDate::Second, QwtDate::Second,
QwtDate::Millisecond }; QwtDate::Millisecond};
for ( QwtDate::IntervalType interval : intervals ) for ( QwtDate::IntervalType interval : intervals )
{ {

View File

@ -209,7 +209,7 @@ RiuViewer::RiuViewer( const QGLFormat& format, QWidget* parent )
m_comparisonWindowMover = new RiuComparisonViewMover( this ); m_comparisonWindowMover = new RiuComparisonViewMover( this );
this->setComparisonViewToFollowAnimation( false ); this->setComparisonViewToFollowAnimation( false );
m_fontPointSize = caf::FontTools::absolutePointSize(RiaPreferences::current()->defaultSceneFontSize()); m_fontPointSize = caf::FontTools::absolutePointSize( RiaPreferences::current()->defaultSceneFontSize() );
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -719,7 +719,7 @@ void RiuViewer::addColorLegendToBottomLeftCorner( caf::TitledOverlayFrame* added
addedLegend->enableBackground( preferences->showLegendBackground() ); addedLegend->enableBackground( preferences->showLegendBackground() );
addedLegend->setBackgroundColor( backgroundColor ); addedLegend->setBackgroundColor( backgroundColor );
addedLegend->setBackgroundFrameColor( frameColor ); addedLegend->setBackgroundFrameColor( frameColor );
addedLegend->setFont( app->sceneFont(m_fontPointSize) ); addedLegend->setFont( app->sceneFont( m_fontPointSize ) );
overlayRendering->addOverlayItem( addedLegend ); overlayRendering->addOverlayItem( addedLegend );
@ -912,7 +912,7 @@ void RiuViewer::updateLegendLayout()
const int xPos = width() - (int)scaleLegendSize.x() - margin - edgeAxisBorderWidth; const int xPos = width() - (int)scaleLegendSize.x() - margin - edgeAxisBorderWidth;
const int yPos = margin + edgeAxisBorderHeight + margin + otherItemsHeight; const int yPos = margin + edgeAxisBorderHeight + margin + otherItemsHeight;
m_scaleLegend->setLayoutFixedPosition( { xPos, yPos } ); m_scaleLegend->setLayoutFixedPosition( {xPos, yPos} );
} }
} }
@ -1115,17 +1115,17 @@ void RiuViewer::leaveEvent( QEvent* )
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RiuViewer::updateGridBoxData( double scaleZ, void RiuViewer::updateGridBoxData( double scaleZ,
const cvf::Vec3d& displayModelOffset, const cvf::Vec3d& displayModelOffset,
const cvf::Color3f& backgroundColor, const cvf::Color3f& backgroundColor,
const cvf::BoundingBox& domainCoordBoundingBox, const cvf::BoundingBox& domainCoordBoundingBox,
int fontPointSize ) int fontPointSize )
{ {
m_gridBoxGenerator->setScaleZ( scaleZ ); m_gridBoxGenerator->setScaleZ( scaleZ );
m_gridBoxGenerator->setDisplayModelOffset( displayModelOffset ); m_gridBoxGenerator->setDisplayModelOffset( displayModelOffset );
m_gridBoxGenerator->updateFromBackgroundColor( backgroundColor ); m_gridBoxGenerator->updateFromBackgroundColor( backgroundColor );
m_gridBoxGenerator->setGridBoxDomainCoordBoundingBox( domainCoordBoundingBox ); m_gridBoxGenerator->setGridBoxDomainCoordBoundingBox( domainCoordBoundingBox );
m_gridBoxGenerator->setGridLabelFontSize(fontPointSize); m_gridBoxGenerator->setGridLabelFontSize( fontPointSize );
m_gridBoxGenerator->createGridBoxParts(); m_gridBoxGenerator->createGridBoxParts();
@ -1291,9 +1291,9 @@ void RiuViewer::showScaleLegend( bool show )
if ( show ) if ( show )
{ {
if ( m_scaleLegend->orientation() == caf::OverlayScaleLegend::HORIZONTAL ) if ( m_scaleLegend->orientation() == caf::OverlayScaleLegend::HORIZONTAL )
m_scaleLegend->setRenderSize( { 280, 45 } ); m_scaleLegend->setRenderSize( {280, 45} );
else else
m_scaleLegend->setRenderSize( { 50, 280 } ); m_scaleLegend->setRenderSize( {50, 280} );
overlayItemsRendering()->addOverlayItem( m_scaleLegend.p() ); overlayItemsRendering()->addOverlayItem( m_scaleLegend.p() );
} }
@ -1322,16 +1322,16 @@ void RiuViewer::clearHoverCursor()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RiuViewer::updateFonts(int fontPointSize) void RiuViewer::updateFonts( int fontPointSize )
{ {
m_fontPointSize = fontPointSize; m_fontPointSize = fontPointSize;
auto defaultFontSize = RiaApplication::instance()->preferences()->defaultSceneFontSize(); auto defaultFontSize = RiaApplication::instance()->preferences()->defaultSceneFontSize();
cvf::Font* axisFont = RiaGuiApplication::instance()->defaultSceneFont(); cvf::Font* axisFont = RiaGuiApplication::instance()->defaultSceneFont();
QFont font = QApplication::font(); QFont font = QApplication::font();
font.setPixelSize( caf::FontTools::pointSizeToPixelSize(m_fontPointSize )); font.setPixelSize( caf::FontTools::pointSizeToPixelSize( m_fontPointSize ) );
if ( caf::FontTools::absolutePointSize(defaultFontSize) != m_fontPointSize ) if ( caf::FontTools::absolutePointSize( defaultFontSize ) != m_fontPointSize )
{ {
axisFont = RiaFontCache::getFont( m_fontPointSize ).p(); axisFont = RiaFontCache::getFont( m_fontPointSize ).p();
} }
@ -1352,7 +1352,7 @@ void RiuViewer::updateFonts(int fontPointSize)
m_animationProgressCompView->setFont( font ); m_animationProgressCompView->setFont( font );
m_versionInfoLabel->setFont( font ); m_versionInfoLabel->setFont( font );
m_gridBoxGenerator->setGridLabelFontSize(m_fontPointSize); m_gridBoxGenerator->setGridLabelFontSize( m_fontPointSize );
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -99,11 +99,11 @@ public:
void setHistogramPercentiles( double pmin, double pmax, double mean ); void setHistogramPercentiles( double pmin, double pmax, double mean );
void showGridBox( bool enable ); void showGridBox( bool enable );
void updateGridBoxData( double scaleZ, void updateGridBoxData( double scaleZ,
const cvf::Vec3d& displayModelOffset, const cvf::Vec3d& displayModelOffset,
const cvf::Color3f& backgroundColor, const cvf::Color3f& backgroundColor,
const cvf::BoundingBox& domainCoordBoundingBox, const cvf::BoundingBox& domainCoordBoundingBox,
int fontPointSize ); int fontPointSize );
void showEdgeTickMarksXY( bool enable, bool showAxisLines = false ); void showEdgeTickMarksXY( bool enable, bool showAxisLines = false );
void showEdgeTickMarksXZ( bool enable, bool showAxisLines = false ); void showEdgeTickMarksXZ( bool enable, bool showAxisLines = false );
@ -138,7 +138,7 @@ public:
static void setHoverCursor( const QCursor& cursor ); static void setHoverCursor( const QCursor& cursor );
static void clearHoverCursor(); static void clearHoverCursor();
void updateFonts(int fontPointSize); void updateFonts( int fontPointSize );
public slots: public slots:
void slotSetCurrentFrame( int frameIndex ) override; void slotSetCurrentFrame( int frameIndex ) override;