From d23c6b4bb6b4c784a47a8860edba9c30b441f3dc Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 23 Mar 2023 15:49:06 +0100 Subject: [PATCH] Janitor: Several code hygiene adjustments (#9981) * Include all libraries in APP_FWK_LIBRARIES * Several fixes detected by Static Code Analysis * Remove unused code * Add .clang.tidy * Use QElapsedTimer * Use horizontalAdvance * Avoid | between enum of different classes * Avoid illegal character * Renaming and reorder of constructor initialization --- CMakeLists.txt | 37 +++++++++---------- Fwk/AppFwk/.clang-tidy | 4 ++ .../cafCommand/cafCmdFieldChangeExec.cpp | 5 +-- .../cafPdmCore/cafAppEnum.h | 3 +- .../cafPdmCore/cafPdmDataValueField.h | 6 ++- .../cafPdmUiCore/cafIconProvider.cpp | 2 +- .../cafPdmUi3dObjectEditorHandle.cpp | 1 + .../cafPdmUiCore/cafPdmUiFieldHandle.cpp | 4 +- .../cafPdmUiCore/cafPdmUiItem.cpp | 2 + .../cafPdmXml/cafInternalPdmFieldIoHelper.cpp | 8 ++-- .../cafInternalPdmXmlFieldCapability.inl | 7 +++- .../cafInternalPdmXmlFieldReaderWriter.cpp | 3 +- .../cafPdmXml/cafPdmXmlObjectHandle.cpp | 18 ++++----- .../cafTestApplication/CustomObjectEditor.cpp | 7 ++-- .../cafTestApplication/MainWindow.cpp | 6 +-- .../cafTestApplication/MenuItemProducer.cpp | 5 ++- .../cafUserInterface/QMinimizePanel.cpp | 6 +-- .../cafPdmUiActionPushButtonEditor.cpp | 3 +- .../cafPdmUiTreeViewEditor.cpp | 2 +- .../cafPdmUiTreeViewItemDelegate.cpp | 3 +- .../cafPdmUiTreeViewItemDelegate.h | 3 +- .../cafUserInterface/cafProgressInfo.cpp | 9 ++--- Fwk/AppFwk/cafUserInterface/cafUiProcess.h | 3 +- .../cafViewer/cafTrackBallBasedNavigation.cpp | 3 +- .../cafViewer/cafTrackBallBasedNavigation.h | 6 +-- Fwk/AppFwk/cafViewer/cafViewer.cpp | 16 ++++---- .../cafVizExtensions/TranspWB_Shaders.h | 2 +- .../cafVizExtensions/cafCategoryLegend.cpp | 13 +++---- .../cafVizExtensions/cafCategoryLegend.h | 2 +- .../cafHexGridIntersectionTools.cpp | 17 +++------ .../cafOverlayScalarMapperLegend.cpp | 1 - .../cafOverlayScaleLegend.cpp | 25 ++++--------- .../cafVizExtensions/cafOverlayScaleLegend.h | 2 +- .../cafTitledOverlayFrame.cpp | 4 +- 34 files changed, 114 insertions(+), 124 deletions(-) create mode 100644 Fwk/AppFwk/.clang-tidy diff --git a/CMakeLists.txt b/CMakeLists.txt index 4da846eb16..5e1d02ef02 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -610,10 +610,7 @@ add_subdirectory(Fwk/AppFwk/cafVizExtensions) option(CAF_CVF_SCRIPTING "" ON) add_subdirectory(Fwk/AppFwk/cafPdmScripting) -set_property(TARGET cafPdmScripting PROPERTY FOLDER "AppFwk") - add_subdirectory(Fwk/AppFwk/cafCommandFeatures) -set_property(TARGET cafCommandFeatures PROPERTY FOLDER "AppFwk") add_subdirectory(Fwk/AppFwk/cafTensor) add_subdirectory(Fwk/AppFwk/cafHexInterpolator) @@ -665,6 +662,7 @@ list( CommonCode cafVizExtensions cafPdmScripting + cafCommandFeatures ) set_property(TARGET ${APP_FWK_LIBRARIES} PROPERTY FOLDER "AppFwk") @@ -675,30 +673,31 @@ mark_as_advanced(FORCE RESINSIGHT_INCLUDE_APPFWK_TESTS) if(RESINSIGHT_INCLUDE_APPFWK_TESTS) # Unit Tests add_subdirectory(Fwk/AppFwk/cafProjectDataModel/cafProjectDataModel_UnitTests) - set_property( - TARGET cafProjectDataModel_UnitTests PROPERTY FOLDER "AppFwkTests" - ) - add_subdirectory( Fwk/AppFwk/cafProjectDataModel/cafPdmCore/cafPdmCore_UnitTests ) - set_property(TARGET cafPdmCore_UnitTests PROPERTY FOLDER "AppFwkTests") - add_subdirectory(Fwk/AppFwk/cafProjectDataModel/cafPdmXml/cafPdmXml_UnitTests) - set_property(TARGET cafPdmXml_UnitTests PROPERTY FOLDER "AppFwkTests") - add_subdirectory(Fwk/AppFwk/cafPdmScripting/cafPdmScripting_UnitTests) - set_property(TARGET cafPdmScripting_UnitTests PROPERTY FOLDER "AppFwkTests") - add_subdirectory(Fwk/AppFwk/cafUserInterface/cafUserInterface_UnitTests) - set_property(TARGET cafUserInterface_UnitTests PROPERTY FOLDER "AppFwkTests") # Executables add_subdirectory(Fwk/AppFwk/cafTests/cafTestApplication) - set_property(TARGET cafTestApplication PROPERTY FOLDER "AppFwkTests") - add_subdirectory(Fwk/AppFwk/cafTests/cafTestCvfApplication) - set_property(TARGET cafTestCvfApplication PROPERTY FOLDER "AppFwkTests") + + list( + APPEND + APP_FWK_TEST_PROJECTS + cafProjectDataModel_UnitTests + cafPdmCore_UnitTests + cafPdmXml_UnitTests + cafPdmScripting_UnitTests + cafUserInterface_UnitTests + cafTestApplication + cafTestCvfApplication + ) + + set_property(TARGET ${APP_FWK_TEST_PROJECTS} PROPERTY FOLDER "AppFwkTests") + endif() # ############################################################################## @@ -802,8 +801,8 @@ if(MSVC AND RESINSIGHT_ENABLE_STATIC_ANALYSIS) ) set(TARGETS_FOR_STATIC_ANALYSIS - ${APP_FWK_LIBRARIES} ApplicationLibCode Commands ResultStatisticsCache - RigGeoMechDataModel + ${APP_FWK_LIBRARIES} ${APP_FWK_TEST_PROJECTS} ApplicationLibCode Commands + ResultStatisticsCache RigGeoMechDataModel ) foreach(TARGET_PROJECT ${TARGETS_FOR_STATIC_ANALYSIS}) diff --git a/Fwk/AppFwk/.clang-tidy b/Fwk/AppFwk/.clang-tidy new file mode 100644 index 0000000000..4a41145e5b --- /dev/null +++ b/Fwk/AppFwk/.clang-tidy @@ -0,0 +1,4 @@ +--- +Checks: '-*,modernize-use-override,modernize-use-nullptr,modernize-deprecated-headers,bugprone-bool-pointer-implicit-conversion,bugprone-parent-virtual-call,bugprone-redundant-branch-condition,bugprone-suspicious-semicolon,bugprone-suspicious-string-compare' +WarningsAsErrors: '' +FormatStyle: 'file' diff --git a/Fwk/AppFwk/cafCommand/cafCmdFieldChangeExec.cpp b/Fwk/AppFwk/cafCommand/cafCmdFieldChangeExec.cpp index 4b27c7d692..aa7aa9ce80 100644 --- a/Fwk/AppFwk/cafCommand/cafCmdFieldChangeExec.cpp +++ b/Fwk/AppFwk/cafCommand/cafCmdFieldChangeExec.cpp @@ -249,11 +249,10 @@ void CmdFieldChangeExec::readFieldValueFromValidXmlDocument( QXmlStreamReader& x { // See PdmObject::readFields and friends to match token count for reading field values // The stream is supposed to be pointing at the first token of field content when calling readFieldData() - QXmlStreamReader::TokenType tt; - int tokenCount = 3; + int tokenCount = 3; for ( int i = 0; i < tokenCount; i++ ) { - tt = xmlStream.readNext(); + xmlStream.readNext(); } xmlFieldHandle->readFieldData( xmlStream, PdmDefaultObjectFactory::instance() ); xmlFieldHandle->resolveReferences(); diff --git a/Fwk/AppFwk/cafProjectDataModel/cafPdmCore/cafAppEnum.h b/Fwk/AppFwk/cafProjectDataModel/cafPdmCore/cafAppEnum.h index 464017b11b..7a09b0f028 100644 --- a/Fwk/AppFwk/cafProjectDataModel/cafPdmCore/cafAppEnum.h +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmCore/cafAppEnum.h @@ -329,7 +329,8 @@ private: private: EnumMapper() - : m_defaultValueIsSet( false ) + : m_defaultValue( T() ) + , m_defaultValueIsSet( false ) { } diff --git a/Fwk/AppFwk/cafProjectDataModel/cafPdmCore/cafPdmDataValueField.h b/Fwk/AppFwk/cafProjectDataModel/cafPdmCore/cafPdmDataValueField.h index 08750c41e5..ab422dae4a 100644 --- a/Fwk/AppFwk/cafProjectDataModel/cafPdmCore/cafPdmDataValueField.h +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmCore/cafPdmDataValueField.h @@ -72,7 +72,11 @@ public: }; typedef DataType FieldDataType; - PdmDataValueField() {} + PdmDataValueField() + : m_fieldValue( DataType() ) + , m_defaultFieldValue( DataType() ) + { + } PdmDataValueField( const PdmDataValueField& other ) { m_fieldValue = other.m_fieldValue; } explicit PdmDataValueField( const DataType& fieldValue ) { m_fieldValue = fieldValue; } ~PdmDataValueField() override {} diff --git a/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/cafIconProvider.cpp b/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/cafIconProvider.cpp index 0f8d6365b6..3648b65dab 100644 --- a/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/cafIconProvider.cpp +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/cafIconProvider.cpp @@ -66,8 +66,8 @@ IconProvider::IconProvider( const QString& iconResourceString, const QSize& pref //-------------------------------------------------------------------------------------------------- caf::IconProvider::IconProvider( const QPixmap& pixmap ) : m_active( true ) - , m_pixmap( new QPixmap( pixmap ) ) , m_preferredSize( pixmap.size() ) + , m_pixmap( new QPixmap( pixmap ) ) { } diff --git a/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/cafPdmUi3dObjectEditorHandle.cpp b/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/cafPdmUi3dObjectEditorHandle.cpp index cc3efceab7..5a6ca0299d 100644 --- a/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/cafPdmUi3dObjectEditorHandle.cpp +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/cafPdmUi3dObjectEditorHandle.cpp @@ -47,6 +47,7 @@ namespace caf /// //-------------------------------------------------------------------------------------------------- PdmUi3dObjectEditorHandle::PdmUi3dObjectEditorHandle() + : m_isInComparisonView( false ) { } diff --git a/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/cafPdmUiFieldHandle.cpp b/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/cafPdmUiFieldHandle.cpp index 83708df874..bbc92d8b83 100644 --- a/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/cafPdmUiFieldHandle.cpp +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/cafPdmUiFieldHandle.cpp @@ -83,7 +83,9 @@ void PdmUiFieldHandle::notifyFieldChanged( const QVariant& oldFieldValue, const { PdmUiEditorHandle* editorContainingThisField = editorForThisField->topMostContainingEditor(); - bool editorContainingThisFieldIsNotUpdated = !uiObjHandle->hasEditor( editorContainingThisField ); + bool editorContainingThisFieldIsNotUpdated = false; + if ( uiObjHandle ) + editorContainingThisFieldIsNotUpdated = !uiObjHandle->hasEditor( editorContainingThisField ); if ( noOwnerObject || editorContainingThisFieldIsNotUpdated ) { diff --git a/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/cafPdmUiItem.cpp b/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/cafPdmUiItem.cpp index d6cfa56136..37829e1e03 100644 --- a/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/cafPdmUiItem.cpp +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/cafPdmUiItem.cpp @@ -61,6 +61,7 @@ PdmUiItemInfo::PdmUiItemInfo( const QString& uiName, , m_isReadOnly( false ) , m_labelAlignment( LEFT ) , m_isCustomContextMenuEnabled( false ) + , m_notifyAllFieldsInMultiFieldChangedEvents( -1 ) { } @@ -84,6 +85,7 @@ PdmUiItemInfo::PdmUiItemInfo( const QString& uiName, , m_isReadOnly( false ) , m_labelAlignment( LEFT ) , m_isCustomContextMenuEnabled( false ) + , m_notifyAllFieldsInMultiFieldChangedEvents( -1 ) { } diff --git a/Fwk/AppFwk/cafProjectDataModel/cafPdmXml/cafInternalPdmFieldIoHelper.cpp b/Fwk/AppFwk/cafProjectDataModel/cafPdmXml/cafInternalPdmFieldIoHelper.cpp index f5f7625645..5636a90d8d 100644 --- a/Fwk/AppFwk/cafProjectDataModel/cafPdmXml/cafInternalPdmFieldIoHelper.cpp +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmXml/cafInternalPdmFieldIoHelper.cpp @@ -9,10 +9,9 @@ namespace caf //-------------------------------------------------------------------------------------------------- void PdmFieldIOHelper::skipCharactersAndComments( QXmlStreamReader& xmlStream ) { - QXmlStreamReader::TokenType type; - while ( !xmlStream.atEnd() && xmlStream.isCharacters() || xmlStream.isComment() ) + while ( !xmlStream.atEnd() && ( xmlStream.isCharacters() || xmlStream.isComment() ) ) { - type = xmlStream.readNext(); + xmlStream.readNext(); } } @@ -21,10 +20,9 @@ void PdmFieldIOHelper::skipCharactersAndComments( QXmlStreamReader& xmlStream ) //-------------------------------------------------------------------------------------------------- void PdmFieldIOHelper::skipComments( QXmlStreamReader& xmlStream ) { - QXmlStreamReader::TokenType type; while ( !xmlStream.atEnd() && xmlStream.isComment() ) { - type = xmlStream.readNext(); + xmlStream.readNext(); } } diff --git a/Fwk/AppFwk/cafProjectDataModel/cafPdmXml/cafInternalPdmXmlFieldCapability.inl b/Fwk/AppFwk/cafProjectDataModel/cafPdmXml/cafInternalPdmXmlFieldCapability.inl index 9719add212..85b9ecd63f 100644 --- a/Fwk/AppFwk/cafProjectDataModel/cafPdmXml/cafInternalPdmXmlFieldCapability.inl +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmXml/cafInternalPdmXmlFieldCapability.inl @@ -290,8 +290,11 @@ void caf::PdmFieldXmlCap>::readFieldData( QXmlStre std::cout << "Line " << xmlStream.lineNumber() << ": Warning: Unknown object type with class name: " << className.toLatin1().data() << " found while reading the field : " << m_field->keyword().toLatin1().data() << std::endl; - std::cout << " Expected class name: " << xmlObject->classKeyword().toLatin1().data() - << std::endl; + if ( xmlObject ) + { + std::cout << " Expected class name: " << xmlObject->classKeyword().toLatin1().data(); + } + std::cout << std::endl; xmlStream.skipCurrentElement(); // Skip to the endelement of the object we was supposed to read xmlStream.skipCurrentElement(); // Skip to the endelement of this field diff --git a/Fwk/AppFwk/cafProjectDataModel/cafPdmXml/cafInternalPdmXmlFieldReaderWriter.cpp b/Fwk/AppFwk/cafProjectDataModel/cafPdmXml/cafInternalPdmXmlFieldReaderWriter.cpp index d6361d45bb..0634f4410e 100644 --- a/Fwk/AppFwk/cafProjectDataModel/cafPdmXml/cafInternalPdmXmlFieldReaderWriter.cpp +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmXml/cafInternalPdmXmlFieldReaderWriter.cpp @@ -16,8 +16,7 @@ void PdmFieldReader::readFieldData( QString& field, QXmlStreamReader& x field = xmlStream.text().toString(); // Make stream point to end of element - QXmlStreamReader::TokenType type; - type = xmlStream.readNext(); + xmlStream.readNext(); PdmFieldIOHelper::skipCharactersAndComments( xmlStream ); } diff --git a/Fwk/AppFwk/cafProjectDataModel/cafPdmXml/cafPdmXmlObjectHandle.cpp b/Fwk/AppFwk/cafProjectDataModel/cafPdmXml/cafPdmXmlObjectHandle.cpp index 5002f4d3a9..ed5da92aa8 100644 --- a/Fwk/AppFwk/cafProjectDataModel/cafPdmXml/cafPdmXmlObjectHandle.cpp +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmXml/cafPdmXmlObjectHandle.cpp @@ -84,8 +84,7 @@ void PdmXmlObjectHandle::readFields( QXmlStreamReader& xmlStream, PdmObjectFacto // readFieldData assumes that the xmlStream points to first token of field content. // After reading, the xmlStream is supposed to point to the first token after the field // content. (typically an "endElement") - QXmlStreamReader::TokenType tt; - tt = xmlStream.readNext(); + xmlStream.readNext(); xmlFieldHandle->readFieldData( xmlStream, objectFactory ); } else @@ -179,9 +178,8 @@ void PdmXmlObjectHandle::readObjectFromXmlString( const QString& xmlString, PdmO QXmlStreamReader inputStream( xmlString ); - QXmlStreamReader::TokenType tt; - tt = inputStream.readNext(); // Start of document - tt = inputStream.readNext(); + inputStream.readNext(); // Start of document + inputStream.readNext(); QString classKeyword = inputStream.name().toString(); CAF_ASSERT( classKeyword == this->classKeyword() ); @@ -197,9 +195,8 @@ PdmObjectHandle* PdmXmlObjectHandle::readUnknownObjectFromXmlString( const QStri { QXmlStreamReader inputStream( xmlString ); - QXmlStreamReader::TokenType tt; - tt = inputStream.readNext(); // Start of document - tt = inputStream.readNext(); + inputStream.readNext(); // Start of document + inputStream.readNext(); QString classKeyword = inputStream.name().toString(); PdmObjectHandle* newObject = objectFactory->create( classKeyword ); @@ -243,9 +240,8 @@ caf::PdmObjectHandle* PdmXmlObjectHandle::copyAndCastByXmlSerialization( const Q QXmlStreamReader inputStream( xmlString ); - QXmlStreamReader::TokenType tt; - tt = inputStream.readNext(); // Start of document - tt = inputStream.readNext(); + inputStream.readNext(); // Start of document + inputStream.readNext(); QString classKeyword = inputStream.name().toString(); CAF_ASSERT( classKeyword == sourceClassKeyword ); diff --git a/Fwk/AppFwk/cafTests/cafTestApplication/CustomObjectEditor.cpp b/Fwk/AppFwk/cafTests/cafTestApplication/CustomObjectEditor.cpp index fa4c63cf74..2a6a353211 100644 --- a/Fwk/AppFwk/cafTests/cafTestApplication/CustomObjectEditor.cpp +++ b/Fwk/AppFwk/cafTests/cafTestApplication/CustomObjectEditor.cpp @@ -66,8 +66,9 @@ namespace caf //-------------------------------------------------------------------------------------------------- CustomObjectEditor::CustomObjectEditor() { - m_columnCount = 3; - m_rowCount = 2; + m_columnCount = 3; + m_rowCount = 2; + m_currentCellId = -1; } //-------------------------------------------------------------------------------------------------- @@ -155,8 +156,6 @@ void CustomObjectEditor::recursivelyConfigureAndUpdateTopLevelUiOrdering(const P { resetCellId(); - QWidget* previousTabOrderWidget = nullptr; - const std::vector& topLevelUiItems = topLevelUiOrdering.uiItemsWithLayout(); for (size_t i = 0; i < topLevelUiItems.size(); ++i) diff --git a/Fwk/AppFwk/cafTests/cafTestApplication/MainWindow.cpp b/Fwk/AppFwk/cafTests/cafTestApplication/MainWindow.cpp index 19e746878a..920563e3a6 100644 --- a/Fwk/AppFwk/cafTests/cafTestApplication/MainWindow.cpp +++ b/Fwk/AppFwk/cafTests/cafTestApplication/MainWindow.cpp @@ -993,8 +993,6 @@ public: group1->add(&m_doubleField); caf::PdmUiGroup* group2 = uiOrdering.addNewGroup("Name2"); group2->add(&m_intField); - caf::PdmUiGroup* group3 = group2->addNewGroup("Name3"); - // group3->add(&m_textField); uiOrdering.skipRemainingFields(); } @@ -1557,8 +1555,7 @@ void MainWindow::slotSimpleSelectionChanged() { std::vector selection; m_pdmUiTreeView->selectedUiItems(selection); - caf::PdmObjectHandle* obj = nullptr; - caf::PdmChildArrayFieldHandle* listField = nullptr; + caf::PdmObjectHandle* obj = nullptr; if (selection.size()) { @@ -1576,7 +1573,6 @@ void MainWindow::slotShowTableView() { std::vector selection; m_pdmUiTreeView2->selectedUiItems(selection); - caf::PdmObjectHandle* obj = nullptr; caf::PdmUiFieldHandle* uiFieldHandle = nullptr; caf::PdmChildArrayFieldHandle* childArrayFieldHandle = nullptr; diff --git a/Fwk/AppFwk/cafTests/cafTestApplication/MenuItemProducer.cpp b/Fwk/AppFwk/cafTests/cafTestApplication/MenuItemProducer.cpp index 32fb4d3775..252bab72ab 100644 --- a/Fwk/AppFwk/cafTests/cafTestApplication/MenuItemProducer.cpp +++ b/Fwk/AppFwk/cafTests/cafTestApplication/MenuItemProducer.cpp @@ -46,7 +46,10 @@ //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -MenuItemProducer::MenuItemProducer() {} +MenuItemProducer::MenuItemProducer() + : m_textPosition(0) +{ +} //-------------------------------------------------------------------------------------------------- /// diff --git a/Fwk/AppFwk/cafUserInterface/QMinimizePanel.cpp b/Fwk/AppFwk/cafUserInterface/QMinimizePanel.cpp index 92d1efbe2f..d4df416646 100644 --- a/Fwk/AppFwk/cafUserInterface/QMinimizePanel.cpp +++ b/Fwk/AppFwk/cafUserInterface/QMinimizePanel.cpp @@ -208,7 +208,7 @@ void QMinimizePanel::enableFrame( bool showFrame ) { if ( showFrame ) { - this->setFrameStyle( QFrame::StyledPanel | QFrame::Plain ); + this->setFrameStyle( static_cast( QFrame::StyledPanel ) | static_cast( QFrame::Plain ) ); m_titleFrame->show(); m_titleLabel->show(); m_collapseButton->show(); @@ -384,7 +384,7 @@ void QMinimizePanel::toggleExpanded() //-------------------------------------------------------------------------------------------------- void QMinimizePanel::initialize( const QString& title ) { - this->setFrameStyle( QFrame::StyledPanel | QFrame::Plain ); + this->setFrameStyle( static_cast( QFrame::StyledPanel ) | static_cast( QFrame::Plain ) ); QVBoxLayout* fullLayout = new QVBoxLayout( this ); fullLayout->setContentsMargins( 0, 0, 0, 0 ); @@ -403,7 +403,7 @@ void QMinimizePanel::initialize( const QString& title ) { m_titleLabel = new QLabel( title ); QPalette titleLabelPalette = m_titleLabel->palette(); - titleLabelPalette.setBrush( QPalette::Foreground, titleLabelPalette.windowText() ); + titleLabelPalette.setBrush( QPalette::WindowText, titleLabelPalette.windowText() ); m_titleLabel->setPalette( titleLabelPalette ); titleLayout->addWidget( m_titleLabel, 1, Qt::AlignLeft ); } diff --git a/Fwk/AppFwk/cafUserInterface/cafPdmUiActionPushButtonEditor.cpp b/Fwk/AppFwk/cafUserInterface/cafPdmUiActionPushButtonEditor.cpp index aef1bb47bb..df19a94742 100644 --- a/Fwk/AppFwk/cafUserInterface/cafPdmUiActionPushButtonEditor.cpp +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiActionPushButtonEditor.cpp @@ -76,7 +76,8 @@ void PdmUiActionPushButtonEditor::configureAndUpdateUi( const QString& uiConfigN { m_pushButton->setText( uiField()->uiName( uiConfigName ) ); QFontMetrics fontMetr = m_pushButton->fontMetrics(); - m_pushButton->setMaximumWidth( fontMetr.width( m_pushButton->text() ) + 2 * fontMetr.width( "M" ) ); + m_pushButton->setMaximumWidth( fontMetr.horizontalAdvance( m_pushButton->text() ) + + 2 * fontMetr.horizontalAdvance( "M" ) ); } QVariant variantFieldValue = uiField()->uiValue(); diff --git a/Fwk/AppFwk/cafUserInterface/cafPdmUiTreeViewEditor.cpp b/Fwk/AppFwk/cafUserInterface/cafPdmUiTreeViewEditor.cpp index 95778c323c..c02d365c64 100644 --- a/Fwk/AppFwk/cafUserInterface/cafPdmUiTreeViewEditor.cpp +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiTreeViewEditor.cpp @@ -204,7 +204,7 @@ QWidget* PdmUiTreeViewEditor::createWidget( QWidget* parent ) m_treeView->setModel( m_filterModel ); m_treeView->installEventFilter( this ); - m_delegate = new PdmUiTreeViewItemDelegate( this, m_filterModel ); + m_delegate = new PdmUiTreeViewItemDelegate( this ); m_treeView->setItemDelegate( m_delegate ); diff --git a/Fwk/AppFwk/cafUserInterface/cafPdmUiTreeViewItemDelegate.cpp b/Fwk/AppFwk/cafUserInterface/cafPdmUiTreeViewItemDelegate.cpp index ec3d41abcd..132bb939b5 100644 --- a/Fwk/AppFwk/cafUserInterface/cafPdmUiTreeViewItemDelegate.cpp +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiTreeViewItemDelegate.cpp @@ -62,10 +62,9 @@ namespace caf //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -PdmUiTreeViewItemDelegate::PdmUiTreeViewItemDelegate( PdmUiTreeViewEditor* parent, QAbstractItemModel* model ) +PdmUiTreeViewItemDelegate::PdmUiTreeViewItemDelegate( PdmUiTreeViewEditor* parent ) : QStyledItemDelegate( parent->treeView() ) , m_treeView( parent ) - , m_model( model ) { } diff --git a/Fwk/AppFwk/cafUserInterface/cafPdmUiTreeViewItemDelegate.h b/Fwk/AppFwk/cafUserInterface/cafPdmUiTreeViewItemDelegate.h index b63d5e2fae..5c442e7914 100644 --- a/Fwk/AppFwk/cafUserInterface/cafPdmUiTreeViewItemDelegate.h +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiTreeViewItemDelegate.h @@ -57,7 +57,7 @@ class PdmUiTreeViewEditor; class PdmUiTreeViewItemDelegate : public QStyledItemDelegate { public: - PdmUiTreeViewItemDelegate( PdmUiTreeViewEditor* parent, QAbstractItemModel* model ); + PdmUiTreeViewItemDelegate( PdmUiTreeViewEditor* parent ); void clearTags( QModelIndex index ); void clearAllTags(); void addTag( QModelIndex index, std::unique_ptr tag ); @@ -77,7 +77,6 @@ protected: private: PdmUiTreeViewEditor* m_treeView; - QAbstractItemModel* m_model; std::map>> m_tags; }; diff --git a/Fwk/AppFwk/cafUserInterface/cafProgressInfo.cpp b/Fwk/AppFwk/cafUserInterface/cafProgressInfo.cpp index 9ab26ad3b8..e30138291c 100644 --- a/Fwk/AppFwk/cafUserInterface/cafProgressInfo.cpp +++ b/Fwk/AppFwk/cafUserInterface/cafProgressInfo.cpp @@ -375,12 +375,11 @@ void openDebugWindow() #pragma warning( disable : 4996 ) AllocConsole(); - FILE* consoleFilePointer; - errno_t err; + FILE* consoleFilePointer; - err = freopen_s( &consoleFilePointer, "conin$", "r", stdin ); - err = freopen_s( &consoleFilePointer, "conout$", "w", stdout ); - err = freopen_s( &consoleFilePointer, "conout$", "w", stderr ); + freopen_s( &consoleFilePointer, "conin$", "r", stdin ); + freopen_s( &consoleFilePointer, "conout$", "w", stdout ); + freopen_s( &consoleFilePointer, "conout$", "w", stderr ); #pragma warning( pop ) #endif diff --git a/Fwk/AppFwk/cafUserInterface/cafUiProcess.h b/Fwk/AppFwk/cafUserInterface/cafUiProcess.h index 2011fa92af..3f1bafe228 100644 --- a/Fwk/AppFwk/cafUserInterface/cafUiProcess.h +++ b/Fwk/AppFwk/cafUserInterface/cafUiProcess.h @@ -37,6 +37,7 @@ #pragma once #include +#include #include namespace caf @@ -54,7 +55,7 @@ class UiProcess : public QProcess Q_OBJECT private: - QTime m_timer; + QElapsedTimer m_timer; public: explicit UiProcess( QObject* pParent = nullptr ); diff --git a/Fwk/AppFwk/cafViewer/cafTrackBallBasedNavigation.cpp b/Fwk/AppFwk/cafViewer/cafTrackBallBasedNavigation.cpp index 6f2569b4d4..125133c225 100644 --- a/Fwk/AppFwk/cafViewer/cafTrackBallBasedNavigation.cpp +++ b/Fwk/AppFwk/cafViewer/cafTrackBallBasedNavigation.cpp @@ -60,9 +60,10 @@ caf::TrackBallBasedNavigation::TrackBallBasedNavigation() , m_isZooming( false ) , m_lastPosX( 0 ) , m_lastPosY( 0 ) + , m_consumeEvents( false ) + , m_isRotationEnabled( false ) , m_lastWheelZoomPosX( -1 ) , m_lastWheelZoomPosY( -1 ) - , m_consumeEvents( false ) { } diff --git a/Fwk/AppFwk/cafViewer/cafTrackBallBasedNavigation.h b/Fwk/AppFwk/cafViewer/cafTrackBallBasedNavigation.h index a090d7ba0d..6b7f35df8d 100644 --- a/Fwk/AppFwk/cafViewer/cafTrackBallBasedNavigation.h +++ b/Fwk/AppFwk/cafViewer/cafTrackBallBasedNavigation.h @@ -53,10 +53,10 @@ class RotationSensitivityCalculator { public: RotationSensitivityCalculator() - : m_lastPosX( 0 ) + : m_isEnabled( false ) + , m_lastPosX( 0 ) , m_lastPosY( 0 ) , m_lastMouseVelocityLenght( 200 ) - , m_isEnabled( false ) , m_fixedSensitivity( std::numeric_limits::infinity() ) { } @@ -80,7 +80,7 @@ private: bool m_isEnabled; int m_lastPosX; /// Previous mouse position int m_lastPosY; - unsigned long m_lastTime; + unsigned long m_lastTime{}; double m_lastMouseVelocityLenght; double m_fixedSensitivity; }; diff --git a/Fwk/AppFwk/cafViewer/cafViewer.cpp b/Fwk/AppFwk/cafViewer/cafViewer.cpp index 33f6a3544d..09bd66a4cb 100644 --- a/Fwk/AppFwk/cafViewer/cafViewer.cpp +++ b/Fwk/AppFwk/cafViewer/cafViewer.cpp @@ -121,17 +121,18 @@ caf::Viewer::Viewer( const QGLFormat& format, QWidget* parent ) , m_defaultPerspectiveNearPlaneDistance( 0.05 ) , m_maxClipPlaneDistance( cvf::UNDEFINED_DOUBLE ) , m_cameraFieldOfViewYDeg( 40.0 ) + , m_showPerfInfoHud( false ) , m_paintCounter( 0 ) , m_releaseOGLResourcesEachFrame( false ) , m_isOverlayPaintingEnabled( true ) - , m_offscreenViewportWidth( 0 ) - , m_offscreenViewportHeight( 0 ) - , m_parallelProjectionLightDirection( 0, 0, -1 ) - , // Light directly from behind - m_comparisonViewOffset( 0, 0, 0 ) - , m_comparisonWindowNormalizedRect( 0.5f, 0.0f, 0.5f, 1.0f ) + , m_animationControl( nullptr ) , m_isComparisonFollowingAnimation( true ) , m_isComparisonViewActiveFlag( false ) + , m_comparisonViewOffset( 0, 0, 0 ) + , m_comparisonWindowNormalizedRect( 0.5f, 0.0f, 0.5f, 1.0f ) + , m_parallelProjectionLightDirection( 0, 0, -1 ) + , m_offscreenViewportWidth( 0 ) + , m_offscreenViewportHeight( 0 ) { m_layoutWidget = new QWidget( parent ); @@ -1588,8 +1589,7 @@ void caf::Viewer::enableParallelProjection( bool enableOrtho ) Vec3d eye, vrp, up; m_mainCamera->toLookAt( &eye, &vrp, &up ); - Vec3d eyeToFocus = pointOfInterest - eye; - Vec3d camDir = vrp - eye; + Vec3d camDir = vrp - eye; camDir.normalize(); double distToFocusPlane = 0.5 * ( m_mainCamera->farPlane() - m_mainCamera->nearPlane() ); diff --git a/Fwk/AppFwk/cafVizExtensions/TranspWB_Shaders.h b/Fwk/AppFwk/cafVizExtensions/TranspWB_Shaders.h index f72af66c62..0dcaf0f1e8 100644 --- a/Fwk/AppFwk/cafVizExtensions/TranspWB_Shaders.h +++ b/Fwk/AppFwk/cafVizExtensions/TranspWB_Shaders.h @@ -12,7 +12,7 @@ static const char TranspWB_CombinationFrag_inl[] = "// Weighted Blended Order-Independent Transparency \n" "// Morgan McGuire and Louis Bavoil NVIDIA \n" "// Journal of Computer Graphics Techniques Vol. 2, No. 2, 2013 \n" -"// Adapted by Jacob Støren to fit with a pure combination pass with no blending \n" +"// Adapted by Jacob Storen to fit with a pure combination pass with no blending \n" "//-------------------------------------------------------------------------------------- \n" " \n" "#extension GL_ARB_texture_rectangle : enable \n" diff --git a/Fwk/AppFwk/cafVizExtensions/cafCategoryLegend.cpp b/Fwk/AppFwk/cafVizExtensions/cafCategoryLegend.cpp index aef1722dc6..a67574b341 100644 --- a/Fwk/AppFwk/cafVizExtensions/cafCategoryLegend.cpp +++ b/Fwk/AppFwk/cafVizExtensions/cafCategoryLegend.cpp @@ -41,8 +41,8 @@ namespace caf //-------------------------------------------------------------------------------------------------- CategoryLegend::CategoryLegend( Font* font, const CategoryMapper* categoryMapper ) : TitledOverlayFrame( font, 200, 200 ) + , m_layout( Vec2ui( 200u, 200u ) ) , m_categoryMapper( categoryMapper ) - , m_Layout( Vec2ui( 200u, 200u ) ) { CVF_ASSERT( font ); CVF_ASSERT( !font->isEmpty() ); @@ -129,13 +129,12 @@ void CategoryLegend::renderGeneric( OpenGLContext* oglContext, const Vec2i& posi camera.applyOpenGL(); camera.viewport()->applyOpenGL( oglContext, Viewport::CLEAR_DEPTH ); - m_Layout = OverlayColorLegendLayoutInfo( size ); - layoutInfo( &m_Layout ); + m_layout = OverlayColorLegendLayoutInfo( size ); + layoutInfo( &m_layout ); m_textDrawer = new TextDrawer( this->font() ); // Set up text drawer - float maxLegendRightPos = 0; - setupTextDrawer( m_textDrawer.p(), &m_Layout ); + setupTextDrawer( m_textDrawer.p(), &m_layout ); Vec2f backgroundSize( size ); @@ -147,7 +146,7 @@ void CategoryLegend::renderGeneric( OpenGLContext* oglContext, const Vec2i& posi backgroundSize, this->backgroundColor(), this->backgroundFrameColor() ); - renderLegendImmediateMode( oglContext, &m_Layout ); + renderLegendImmediateMode( oglContext, &m_layout ); m_textDrawer->renderSoftware( oglContext, camera ); } else @@ -159,7 +158,7 @@ void CategoryLegend::renderGeneric( OpenGLContext* oglContext, const Vec2i& posi backgroundSize, this->backgroundColor(), this->backgroundFrameColor() ); - renderLegendUsingShaders( oglContext, &m_Layout, matrixState ); + renderLegendUsingShaders( oglContext, &m_layout, matrixState ); m_textDrawer->render( oglContext, camera ); } diff --git a/Fwk/AppFwk/cafVizExtensions/cafCategoryLegend.h b/Fwk/AppFwk/cafVizExtensions/cafCategoryLegend.h index 61633550b2..4636e5656a 100644 --- a/Fwk/AppFwk/cafVizExtensions/cafCategoryLegend.h +++ b/Fwk/AppFwk/cafVizExtensions/cafCategoryLegend.h @@ -77,7 +77,7 @@ protected: protected: std::vector m_visibleCategoryLabels; // Skip labels ending up on top of previous visible label - OverlayColorLegendLayoutInfo m_Layout; + OverlayColorLegendLayoutInfo m_layout; cvf::ref m_textDrawer; cvf::cref m_categoryMapper; }; diff --git a/Fwk/AppFwk/cafVizExtensions/cafHexGridIntersectionTools/cafHexGridIntersectionTools.cpp b/Fwk/AppFwk/cafVizExtensions/cafHexGridIntersectionTools/cafHexGridIntersectionTools.cpp index bec62b0f40..74dfcdef52 100644 --- a/Fwk/AppFwk/cafVizExtensions/cafHexGridIntersectionTools/cafHexGridIntersectionTools.cpp +++ b/Fwk/AppFwk/cafVizExtensions/cafHexGridIntersectionTools/cafHexGridIntersectionTools.cpp @@ -186,33 +186,30 @@ bool HexGridIntersectionTools::planeTriangleIntersection( const cvf::Plane& plan CVF_ASSERT( false ); } - bool ok1 = false; - bool ok2 = false; - if ( topVx == 1 ) { - ok1 = planeLineIntersect( plane, p1, p2, &( ( *newVx1 ).vx ), &( ( *newVx1 ).normDistFromEdgeVx1 ), nonDimensionalTolerance ); + planeLineIntersect( plane, p1, p2, &( ( *newVx1 ).vx ), &( ( *newVx1 ).normDistFromEdgeVx1 ), nonDimensionalTolerance ); ( *newVx1 ).clippedEdgeVx1Id = p1Id; ( *newVx1 ).clippedEdgeVx2Id = p2Id; - ok2 = planeLineIntersect( plane, p1, p3, &( ( *newVx2 ).vx ), &( ( *newVx2 ).normDistFromEdgeVx1 ), nonDimensionalTolerance ); + planeLineIntersect( plane, p1, p3, &( ( *newVx2 ).vx ), &( ( *newVx2 ).normDistFromEdgeVx1 ), nonDimensionalTolerance ); ( *newVx2 ).clippedEdgeVx1Id = p1Id; ( *newVx2 ).clippedEdgeVx2Id = p3Id; } else if ( topVx == 2 ) { - ok1 = planeLineIntersect( plane, p2, p3, &( ( *newVx1 ).vx ), &( ( *newVx1 ).normDistFromEdgeVx1 ), nonDimensionalTolerance ); + planeLineIntersect( plane, p2, p3, &( ( *newVx1 ).vx ), &( ( *newVx1 ).normDistFromEdgeVx1 ), nonDimensionalTolerance ); ( *newVx1 ).clippedEdgeVx1Id = p2Id; ( *newVx1 ).clippedEdgeVx2Id = p3Id; - ok2 = planeLineIntersect( plane, p2, p1, &( ( *newVx2 ).vx ), &( ( *newVx2 ).normDistFromEdgeVx1 ), nonDimensionalTolerance ); + planeLineIntersect( plane, p2, p1, &( ( *newVx2 ).vx ), &( ( *newVx2 ).normDistFromEdgeVx1 ), nonDimensionalTolerance ); ( *newVx2 ).clippedEdgeVx1Id = p2Id; ( *newVx2 ).clippedEdgeVx2Id = p1Id; } else if ( topVx == 3 ) { - ok1 = planeLineIntersect( plane, p3, p1, &( ( *newVx1 ).vx ), &( ( *newVx1 ).normDistFromEdgeVx1 ), nonDimensionalTolerance ); + planeLineIntersect( plane, p3, p1, &( ( *newVx1 ).vx ), &( ( *newVx1 ).normDistFromEdgeVx1 ), nonDimensionalTolerance ); ( *newVx1 ).clippedEdgeVx1Id = p3Id; ( *newVx1 ).clippedEdgeVx2Id = p1Id; - ok2 = planeLineIntersect( plane, p3, p2, &( ( *newVx2 ).vx ), &( ( *newVx2 ).normDistFromEdgeVx1 ), nonDimensionalTolerance ); + planeLineIntersect( plane, p3, p2, &( ( *newVx2 ).vx ), &( ( *newVx2 ).normDistFromEdgeVx1 ), nonDimensionalTolerance ); ( *newVx2 ).clippedEdgeVx1Id = p3Id; ( *newVx2 ).clippedEdgeVx2Id = p2Id; } @@ -221,8 +218,6 @@ bool HexGridIntersectionTools::planeTriangleIntersection( const cvf::Plane& plan CVF_ASSERT( false ); } - // CVF_TIGHT_ASSERT(ok1 && ok2); - return true; } diff --git a/Fwk/AppFwk/cafVizExtensions/cafOverlayScalarMapperLegend.cpp b/Fwk/AppFwk/cafVizExtensions/cafOverlayScalarMapperLegend.cpp index c16850de13..4b0c6428cd 100644 --- a/Fwk/AppFwk/cafVizExtensions/cafOverlayScalarMapperLegend.cpp +++ b/Fwk/AppFwk/cafVizExtensions/cafOverlayScalarMapperLegend.cpp @@ -187,7 +187,6 @@ void OverlayScalarMapperLegend::renderGeneric( OpenGLContext* oglContext, const m_textDrawer = new TextDrawer( this->font() ); // Set up text drawer - float maxLegendRightPos = 0; setupTextDrawer( m_textDrawer.p(), &m_Layout ); Vec2f backgroundSize( size ); diff --git a/Fwk/AppFwk/cafVizExtensions/cafOverlayScaleLegend.cpp b/Fwk/AppFwk/cafVizExtensions/cafOverlayScaleLegend.cpp index 0aa86b39c6..96888e83e5 100644 --- a/Fwk/AppFwk/cafVizExtensions/cafOverlayScaleLegend.cpp +++ b/Fwk/AppFwk/cafVizExtensions/cafOverlayScaleLegend.cpp @@ -88,9 +88,9 @@ OverlayScaleLegend::OverlayScaleLegend( Font* font ) : TitledOverlayFrame( font, 200, 200 ) , m_tickNumberPrecision( 4 ) , m_numberFormat( AUTO ) - , m_Layout( Vec2ui( 200u, 200u ) ) - , m_font( font ) , m_orientation( HORIZONTAL ) + , m_layout( Vec2ui( 200u, 200u ) ) + , m_font( font ) , m_currentScale( 1.0 ) { CVF_ASSERT( font ); @@ -138,16 +138,15 @@ void OverlayScaleLegend::renderGeneric( OpenGLContext* oglContext, const Vec2i& camera.applyOpenGL(); camera.viewport()->applyOpenGL( oglContext, Viewport::CLEAR_DEPTH ); - m_Layout = LayoutInfo( size ); - layoutInfo( &m_Layout ); + m_layout = LayoutInfo( size ); + layoutInfo( &m_layout ); m_textDrawer = new TextDrawer( this->font() ); // Set up text drawer - float maxLegendRightPos = 0; if ( m_orientation == HORIZONTAL ) - setupHorizontalTextDrawer( m_textDrawer.p(), &m_Layout ); + setupHorizontalTextDrawer( m_textDrawer.p(), &m_layout ); else - setupVerticalTextDrawer( m_textDrawer.p(), &m_Layout ); + setupVerticalTextDrawer( m_textDrawer.p(), &m_layout ); Vec2f backgroundSize( size ); @@ -161,7 +160,7 @@ void OverlayScaleLegend::renderGeneric( OpenGLContext* oglContext, const Vec2i& this->backgroundColor(), this->backgroundFrameColor() ); } - renderLegendImmediateMode( oglContext, &m_Layout ); + renderLegendImmediateMode( oglContext, &m_layout ); m_textDrawer->renderSoftware( oglContext, camera ); } else @@ -175,7 +174,7 @@ void OverlayScaleLegend::renderGeneric( OpenGLContext* oglContext, const Vec2i& this->backgroundColor(), this->backgroundFrameColor() ); } - renderLegendUsingShaders( oglContext, &m_Layout, matrixState ); + renderLegendUsingShaders( oglContext, &m_layout, matrixState ); m_textDrawer->render( oglContext, camera ); } @@ -201,8 +200,6 @@ void OverlayScaleLegend::setupHorizontalTextDrawer( TextDrawer* textDrawer, cons float lastVisibleTextX = 0.0; size_t numTicks = layout->ticks.size(); - size_t numMajorTicks = - std::count_if( layout->ticks.begin(), layout->ticks.end(), []( const LayoutInfo::Tick& t ) { return t.isMajor; } ); size_t it; for ( it = 0; it < numTicks; it++ ) { @@ -344,12 +341,6 @@ void OverlayScaleLegend::renderLegendUsingShaders( OpenGLContext* oglContext, La // Per vector convenience pointers float* v0 = &vertexArray[0]; float* v1 = &vertexArray[3]; - float* v2 = &vertexArray[6]; - float* v3 = &vertexArray[9]; - float* v4 = &vertexArray[12]; - - // Connects - static const ushort trianglesConnects[] = { 0, 1, 4, 0, 4, 3 }; ref shaderProgram = oglContext->resourceManager()->getLinkedUnlitColorShaderProgram( oglContext ); CVF_TIGHT_ASSERT( shaderProgram.notNull() ); diff --git a/Fwk/AppFwk/cafVizExtensions/cafOverlayScaleLegend.h b/Fwk/AppFwk/cafVizExtensions/cafOverlayScaleLegend.h index 4fa63ccdf2..09dff1917e 100644 --- a/Fwk/AppFwk/cafVizExtensions/cafOverlayScaleLegend.h +++ b/Fwk/AppFwk/cafVizExtensions/cafOverlayScaleLegend.h @@ -167,7 +167,7 @@ protected: NumberFormat m_numberFormat; Orientation m_orientation; - LayoutInfo m_Layout; + LayoutInfo m_layout; cvf::ref m_textDrawer; cvf::ref m_font; diff --git a/Fwk/AppFwk/cafVizExtensions/cafTitledOverlayFrame.cpp b/Fwk/AppFwk/cafVizExtensions/cafTitledOverlayFrame.cpp index 240f4e7379..432120b7dc 100644 --- a/Fwk/AppFwk/cafVizExtensions/cafTitledOverlayFrame.cpp +++ b/Fwk/AppFwk/cafVizExtensions/cafTitledOverlayFrame.cpp @@ -48,14 +48,14 @@ namespace caf /// //-------------------------------------------------------------------------------------------------- TitledOverlayFrame::TitledOverlayFrame( Font* font, unsigned int width, unsigned int height ) - : m_font( font ) - , m_renderSize( width, height ) + : m_renderSize( width, height ) , m_textColor( Color3::BLACK ) , m_lineColor( Color3::BLACK ) , m_lineWidth( 1 ) , m_isBackgroundEnabled( true ) , m_backgroundColor( 1.0f, 1.0f, 1.0f, 0.8f ) , m_backgroundFrameColor( 0.0f, 0.0f, 0.0f, 0.5f ) + , m_font( font ) { }