mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4683 clang-format on all files in ApplicationCode
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2016 Statoil ASA
|
||||
//
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -20,89 +20,118 @@
|
||||
|
||||
#include "RiaDefines.h"
|
||||
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmChildField.h"
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
class RimMdiWindowController;
|
||||
|
||||
struct RimMdiWindowGeometry
|
||||
struct RimMdiWindowGeometry
|
||||
{
|
||||
RimMdiWindowGeometry() : mainWindowID(-1), x(0), y(0), width(-1), height(-1), isMaximized(false) {}
|
||||
bool isValid() const { return (mainWindowID >= 0 && width >= 0 && height >= 0);}
|
||||
RimMdiWindowGeometry()
|
||||
: mainWindowID( -1 )
|
||||
, x( 0 )
|
||||
, y( 0 )
|
||||
, width( -1 )
|
||||
, height( -1 )
|
||||
, isMaximized( false )
|
||||
{
|
||||
}
|
||||
bool isValid() const
|
||||
{
|
||||
return ( mainWindowID >= 0 && width >= 0 && height >= 0 );
|
||||
}
|
||||
|
||||
int mainWindowID;
|
||||
|
||||
int x;
|
||||
int y;
|
||||
int width;
|
||||
int height;
|
||||
int x;
|
||||
int y;
|
||||
int width;
|
||||
int height;
|
||||
bool isMaximized;
|
||||
};
|
||||
|
||||
class RimViewWindow : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
RimViewWindow(void);
|
||||
~RimViewWindow(void) override;
|
||||
RimViewWindow( void );
|
||||
~RimViewWindow( void ) override;
|
||||
|
||||
void loadDataAndUpdate();
|
||||
void handleMdiWindowClosed();
|
||||
void updateMdiWindowVisibility();
|
||||
|
||||
void setAs3DViewMdiWindow() { setAsMdiWindow(0); }
|
||||
void setAsPlotMdiWindow() { setAsMdiWindow(1); }
|
||||
bool isMdiWindow() const;
|
||||
|
||||
void setMdiWindowGeometry(const RimMdiWindowGeometry& windowGeometry);
|
||||
RimMdiWindowGeometry mdiWindowGeometry();
|
||||
|
||||
virtual QWidget* viewWidget() = 0;
|
||||
|
||||
virtual QImage snapshotWindowContent() = 0;
|
||||
virtual void zoomAll() = 0;
|
||||
void loadDataAndUpdate();
|
||||
void handleMdiWindowClosed();
|
||||
void updateMdiWindowVisibility();
|
||||
|
||||
void viewNavigationChanged();
|
||||
void setAs3DViewMdiWindow()
|
||||
{
|
||||
setAsMdiWindow( 0 );
|
||||
}
|
||||
void setAsPlotMdiWindow()
|
||||
{
|
||||
setAsMdiWindow( 1 );
|
||||
}
|
||||
bool isMdiWindow() const;
|
||||
|
||||
void setMdiWindowGeometry( const RimMdiWindowGeometry& windowGeometry );
|
||||
RimMdiWindowGeometry mdiWindowGeometry();
|
||||
|
||||
virtual bool hasCustomFontSizes(RiaDefines::FontSettingType fontSettingType, int defaultFontSize) const { return false;}
|
||||
virtual bool applyFontSize(RiaDefines::FontSettingType fontSettingType, int oldFontSize, int fontSize, bool forceChange = false) { return false;}
|
||||
virtual QWidget* viewWidget() = 0;
|
||||
|
||||
virtual QImage snapshotWindowContent() = 0;
|
||||
virtual void zoomAll() = 0;
|
||||
|
||||
void viewNavigationChanged();
|
||||
|
||||
virtual bool hasCustomFontSizes( RiaDefines::FontSettingType fontSettingType, int defaultFontSize ) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
virtual bool applyFontSize( RiaDefines::FontSettingType fontSettingType,
|
||||
int oldFontSize,
|
||||
int fontSize,
|
||||
bool forceChange = false )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
protected:
|
||||
void removeMdiWindowFromMdiArea();
|
||||
void removeMdiWindowFromMdiArea();
|
||||
|
||||
///////// Interface for the Window controller
|
||||
friend class RimMdiWindowController;
|
||||
|
||||
QString windowTitle();
|
||||
virtual QWidget* createViewWidget(QWidget* mainWindowParent) = 0;
|
||||
virtual void updateViewWidgetAfterCreation() {};
|
||||
virtual void updateMdiWindowTitle(); // Has real default implementation
|
||||
virtual void deleteViewWidget() = 0;
|
||||
virtual void onLoadDataAndUpdate() = 0;
|
||||
virtual void onViewNavigationChanged();
|
||||
virtual bool isWindowVisible() { return m_showWindow();} // Virtual To allow special visibility control
|
||||
QString windowTitle();
|
||||
virtual QWidget* createViewWidget( QWidget* mainWindowParent ) = 0;
|
||||
virtual void updateViewWidgetAfterCreation(){};
|
||||
virtual void updateMdiWindowTitle(); // Has real default implementation
|
||||
virtual void deleteViewWidget() = 0;
|
||||
virtual void onLoadDataAndUpdate() = 0;
|
||||
virtual void onViewNavigationChanged();
|
||||
virtual bool isWindowVisible()
|
||||
{
|
||||
return m_showWindow();
|
||||
} // Virtual To allow special visibility control
|
||||
//////////
|
||||
|
||||
// Derived classes are not supposed to override this function. The intention is to always use m_showWindow
|
||||
// as the objectToggleField for this class. This way the visibility of a widget being part of a composite widget
|
||||
// can be controlled from the project tree using check box toggles
|
||||
caf::PdmFieldHandle* objectToggleField() final;
|
||||
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;
|
||||
void initAfterRead() override;
|
||||
|
||||
caf::PdmField<bool> m_showWindow;
|
||||
|
||||
private:
|
||||
void setAsMdiWindow(int mainWindowID);
|
||||
caf::PdmField<bool> m_showWindow;
|
||||
|
||||
private:
|
||||
void setAsMdiWindow( int mainWindowID );
|
||||
|
||||
caf::PdmChildField<RimMdiWindowController*> m_windowController;
|
||||
|
||||
|
||||
// Obsoleted field
|
||||
caf::PdmField< std::vector<int> > obsoleteField_windowGeometry;
|
||||
caf::PdmField<std::vector<int>> obsoleteField_windowGeometry;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user