Skip to content

Commit

Permalink
Fix .h => .hpp ;
Browse files Browse the repository at this point in the history
Fix attribute initialisation ;
  • Loading branch information
hoshiryu committed Jul 9, 2020
1 parent ee599c3 commit 270f84c
Show file tree
Hide file tree
Showing 15 changed files with 78 additions and 93 deletions.
12 changes: 6 additions & 6 deletions cmake/filelistGuiBase.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ set(guibase_headers
BaseApplication.hpp
MainWindowInterface.hpp
RaGuiBase.hpp
KeyFrameEditor/KeyFrameEditor.h
KeyFrameEditor/KeyFrameEditorFrame.h
KeyFrameEditor/KeyFrameEditorFrameScale.h
KeyFrameEditor/KeyFrameEditorScrollArea.h
KeyFrameEditor/KeyFrameEditorTimeScale.h
KeyFrameEditor/KeyFrameEditorValueScale.h
KeyFrameEditor/KeyFrameEditor.hpp
KeyFrameEditor/KeyFrameEditorFrame.hpp
KeyFrameEditor/KeyFrameEditorFrameScale.hpp
KeyFrameEditor/KeyFrameEditorScrollArea.hpp
KeyFrameEditor/KeyFrameEditorTimeScale.hpp
KeyFrameEditor/KeyFrameEditorValueScale.hpp
SelectionManager/SelectionManager.hpp
Timeline/HelpDialog.hpp
Timeline/Configurations.hpp
Expand Down
4 changes: 2 additions & 2 deletions src/GuiBase/KeyFrameEditor/KeyFrameEditor.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "ui_KeyFrameEditor.h"
#include <GuiBase/KeyFrameEditor/KeyFrameEditor.h>
#include <GuiBase/KeyFrameEditor/KeyFrameEditorFrame.h>
#include <GuiBase/KeyFrameEditor/KeyFrameEditor.hpp>
#include <GuiBase/KeyFrameEditor/KeyFrameEditorFrame.hpp>

#include <Core/Animation/KeyFramedValue.hpp>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef RADIUMENGINE_KEYFRAME_EDITOR_H
#define RADIUMENGINE_KEYFRAME_EDITOR_H
#pragma once

#include <GuiBase/RaGuiBase.hpp>

Expand Down Expand Up @@ -67,9 +66,7 @@ class RA_GUIBASE_API KeyFrameEditor : public QDialog
void resizeEvent( QResizeEvent* ev ) override;

private:
Ui::KeyFrameEditor* ui;
Ui::KeyFrameEditor* ui {nullptr};
};

} // namespace Ra::GuiBase

#endif // RADIUMENGINE_KEYFRAME_EDITOR_H
10 changes: 5 additions & 5 deletions src/GuiBase/KeyFrameEditor/KeyFrameEditor.ui
Original file line number Diff line number Diff line change
Expand Up @@ -1312,31 +1312,31 @@
<customwidget>
<class>Ra::GuiBase::KeyFrameEditorFrame</class>
<extends>QFrame</extends>
<header>GuiBase/KeyFrameEditor/KeyFrameEditorFrame.h</header>
<header>GuiBase/KeyFrameEditor/KeyFrameEditorFrame.hpp</header>
<container>1</container>
</customwidget>
<customwidget>
<class>Ra::GuiBase::KeyFrameEditorScrollArea</class>
<extends>QScrollArea</extends>
<header>GuiBase/KeyFrameEditor/KeyFrameEditorScrollArea.h</header>
<header>GuiBase/KeyFrameEditor/KeyFrameEditorScrollArea.hpp</header>
<container>1</container>
</customwidget>
<customwidget>
<class>Ra::GuiBase::KeyFrameEditorTimeScale</class>
<extends>QFrame</extends>
<header>GuiBase/KeyFrameEditor/KeyFrameEditorTimeScale.h</header>
<header>GuiBase/KeyFrameEditor/KeyFrameEditorTimeScale.hpp</header>
<container>1</container>
</customwidget>
<customwidget>
<class>Ra::GuiBase::KeyframeEditorValueScale</class>
<extends>QFrame</extends>
<header>GuiBase/KeyFrameEditor/KeyFrameEditorValueScale.h</header>
<header>GuiBase/KeyFrameEditor/KeyFrameEditorValueScale.hpp</header>
<container>1</container>
</customwidget>
<customwidget>
<class>Ra::GuiBase::KeyFrameEditorFrameScale</class>
<extends>QFrame</extends>
<header>GuiBase/KeyFrameEditor/KeyFrameEditorFrameScale.h</header>
<header>GuiBase/KeyFrameEditor/KeyFrameEditorFrameScale.hpp</header>
<container>1</container>
</customwidget>
</customwidgets>
Expand Down
6 changes: 3 additions & 3 deletions src/GuiBase/KeyFrameEditor/KeyFrameEditorFrame.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <GuiBase/KeyFrameEditor/KeyFrameEditorFrame.h>
#include <GuiBase/KeyFrameEditor/KeyFrameEditorFrame.hpp>

#include <QCheckBox>
#include <QPainter>
Expand All @@ -15,8 +15,8 @@
#include <Core/Utils/Color.hpp>
#include <Core/Utils/Log.hpp>

#include <GuiBase/KeyFrameEditor/KeyFrameEditorScrollArea.h>
#include <GuiBase/Timeline/Configurations.h>
#include <GuiBase/KeyFrameEditor/KeyFrameEditorScrollArea.hpp>
#include <GuiBase/Timeline/Configurations.hpp>
#include <ui_KeyFrameEditor.h>

static constexpr int CTRL_PT_RAD = 5;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef RADIUMENGINE_KEYFRAME_EDITOR_FRAME_H
#define RADIUMENGINE_KEYFRAME_EDITOR_FRAME_H
#pragma once

#include <QDoubleSpinBox>
#include <QFrame>
Expand Down Expand Up @@ -182,17 +181,17 @@ class KeyFrameEditorFrame : public QFrame

private:
/// The currently edited KeyFramedValue.
KeyFrame* m_value{nullptr};
KeyFrame* m_value {nullptr};

/// The current time of the Timeline's playzone.
Scalar m_cursor;
Scalar m_cursor {0_ra};

/// The display state of the KeyFramed value channels.
std::array<bool, 10> m_displayCurve =
{true, true, true, true, true, true, true, true, true, true};
std::array<bool, 10>
m_displayCurve {true, true, true, true, true, true, true, true, true, true};

/// Whether the user is editing values or not.
bool m_mouseLeftClicked{false};
bool m_mouseLeftClicked {false};

/// The type for KeyFramedValue edition control points.
using CurveControlPoints = std::vector<Ra::Core::Vector2>;
Expand All @@ -201,15 +200,13 @@ class KeyFrameEditorFrame : public QFrame
std::array<CurveControlPoints, 10> m_curveControlPoints;

/// The current control point.
Ra::Core::Vector2i m_currentControlPoint{-1, -1};
Ra::Core::Vector2i m_currentControlPoint {-1, -1};

/// The QPainter to display all the data.
QPainter* m_painter{nullptr};
QPainter* m_painter {nullptr};

/// The KeyFrameEditor UI.
Ui::KeyFrameEditor* m_ui{nullptr};
Ui::KeyFrameEditor* m_ui {nullptr};
};

} // namespace Ra::GuiBase

#endif // RADIUMENGINE_KEYFRAME_EDITOR_FRAME_H
8 changes: 4 additions & 4 deletions src/GuiBase/KeyFrameEditor/KeyFrameEditorFrameScale.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#include <GuiBase/KeyFrameEditor/KeyFrameEditorFrameScale.h>
#include <GuiBase/KeyFrameEditor/KeyFrameEditorFrameScale.hpp>

#include <QPainter>
#include <QScrollBar>

#include <GuiBase/Timeline/Configurations.h>
#include <GuiBase/Timeline/Configurations.hpp>

#include <GuiBase/KeyFrameEditor/KeyFrameEditorFrame.h>
#include <GuiBase/KeyFrameEditor/KeyFrameEditorScrollArea.h>
#include <GuiBase/KeyFrameEditor/KeyFrameEditorFrame.hpp>
#include <GuiBase/KeyFrameEditor/KeyFrameEditorScrollArea.hpp>

namespace Ra::GuiBase {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef RADIUMENGINE_KEYFRAME_EDITOR_FRAMESCALE_H
#define RADIUMENGINE_KEYFRAME_EDITOR_FRAMESCALE_H
#pragma once

#include <QFrame>

Expand Down Expand Up @@ -31,12 +30,10 @@ class KeyFrameEditorFrameScale : public QFrame

private:
/// The KeyFrameEditorFrame.
KeyFrameEditorFrame* m_editorFrame{nullptr};
KeyFrameEditorFrame* m_editorFrame {nullptr};

/// The KeyFrameEditorScrollArea.
KeyFrameEditorScrollArea* m_scrollArea{nullptr};
KeyFrameEditorScrollArea* m_scrollArea {nullptr};
};

} // namespace Ra::GuiBase

#endif // RADIUMENGINE_KEYFRAME_EDITOR_FRAMESCALE_H
6 changes: 3 additions & 3 deletions src/GuiBase/KeyFrameEditor/KeyFrameEditorScrollArea.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#include <GuiBase/KeyFrameEditor/KeyFrameEditorScrollArea.h>
#include <GuiBase/KeyFrameEditor/KeyFrameEditorScrollArea.hpp>

#include <cmath>

#include <QScrollBar>
#include <QWheelEvent>

#include <GuiBase/Timeline/Timeline.h>
#include <GuiBase/Timeline/TimelineFrameSelector.h>
#include <GuiBase/Timeline/Timeline.hpp>
#include <GuiBase/Timeline/TimelineFrameSelector.hpp>

namespace Ra::GuiBase {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef RADIUMENGINE_KEYFRAME_EDITOR_SCROLLAREARULER_H
#define RADIUMENGINE_KEYFRAME_EDITOR_SCROLLAREARULER_H
#pragma once

#include <QScrollArea>

Expand Down Expand Up @@ -95,38 +94,36 @@ class KeyFrameEditorScrollArea : public QScrollArea
int m_sliderPosX; ///< x coordinate of the slider on mouse middle click.
int m_sliderPosY; ///< y coordinate of the slider on mouse middle click.

Scalar m_maxTime{200}; ///< <b>end<\b> of the Timeline's playzone.
Scalar m_stepTime; ///< Step between two time scale graduations.
int m_nbIntervalTime{0}; ///< Number of time scale graduations.
Scalar m_pixPerTime; ///< Number of pixels used to display 1 second on the scale.
Scalar m_zeroTime; ///< Pixel corresponding to time 0.
Scalar m_maxTime {200}; ///< <b>end<\b> of the Timeline's playzone.
Scalar m_stepTime {10}; ///< Step between two time scale graduations.
int m_nbIntervalTime {0}; ///< Number of time scale graduations.
Scalar m_pixPerTime {10}; ///< Number of pixels used to display 1 second on the scale.
Scalar m_zeroTime {10}; ///< Pixel corresponding to time 0.

Scalar m_maxValue{200}; ///< Maximal extent of a KeyFrame value.
Scalar m_stepValue; ///< Step between two value scale graduations.
int m_nbIntervalValue{0}; ///< Number of value scale graduations.
Scalar
m_pixPerValue; ///< Number of pixels used to display a value difference of 1 on the scale.
Scalar m_zeroValue; ///< Pixel corresponding to time 0.
Scalar m_maxValue {200}; ///< Maximal extent of a KeyFrame value.
Scalar m_stepValue {10}; ///< Step between two value scale graduations.
int m_nbIntervalValue {0}; ///< Number of value scale graduations.
Scalar m_pixPerValue {
10}; ///< Number of pixels used to display a value difference of 1 on the scale.
Scalar m_zeroValue {10}; ///< Pixel corresponding to time 0.

/// Number of possible steps.
static constexpr int s_nbSteps = 13;
static constexpr int s_nbSteps {13};

/// Possible steps.
static constexpr Scalar s_steps[s_nbSteps] = {0.01_ra,
0.02_ra,
0.05_ra,
0.1_ra,
0.2_ra,
0.5_ra,
1.0_ra,
2.0_ra,
5.0_ra,
10.0_ra,
20.0_ra,
50.0_ra,
100.0_ra};
static constexpr Scalar s_steps[s_nbSteps] {0.01_ra,
0.02_ra,
0.05_ra,
0.1_ra,
0.2_ra,
0.5_ra,
1.0_ra,
2.0_ra,
5.0_ra,
10.0_ra,
20.0_ra,
50.0_ra,
100.0_ra};
};

} // namespace Ra::GuiBase

#endif // RADIUMENGINE_KEYFRAME_EDITOR_SCROLLAREARULER_H
4 changes: 2 additions & 2 deletions src/GuiBase/KeyFrameEditor/KeyFrameEditorTimeScale.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include <GuiBase/KeyFrameEditor/KeyFrameEditorTimeScale.h>
#include <GuiBase/KeyFrameEditor/KeyFrameEditorTimeScale.hpp>

#include <QPainter>
#include <QScrollBar>

#include <GuiBase/KeyFrameEditor/KeyFrameEditorScrollArea.h>
#include <GuiBase/KeyFrameEditor/KeyFrameEditorScrollArea.hpp>

namespace Ra::GuiBase {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef RADIUMENGINE_KEY_FRAME_EDITOR_TIMESCALE_H
#define RADIUMENGINE_KEY_FRAME_EDITOR_TIMESCALE_H
#pragma once

#include <QFrame>

Expand Down Expand Up @@ -27,9 +26,7 @@ class KeyFrameEditorTimeScale : public QFrame

private:
/// The KeyFrameEditorScrollArea.
KeyFrameEditorScrollArea* m_scrollArea{nullptr};
KeyFrameEditorScrollArea* m_scrollArea {nullptr};
};

} // namespace Ra::GuiBase

#endif // RADIUMENGINE_KEY_FRAME_EDITOR_TIMESCALE_H
4 changes: 2 additions & 2 deletions src/GuiBase/KeyFrameEditor/KeyFrameEditorValueScale.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include <GuiBase/KeyFrameEditor/KeyFrameEditorValueScale.h>
#include <GuiBase/KeyFrameEditor/KeyFrameEditorValueScale.hpp>

#include <QPainter>
#include <QScrollBar>

#include <GuiBase/KeyFrameEditor/KeyFrameEditorScrollArea.h>
#include <GuiBase/KeyFrameEditor/KeyFrameEditorScrollArea.hpp>

namespace Ra::GuiBase {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef RADIUMENGINE_KEYFRAME_EDITOR_VALUESCALE_H
#define RADIUMENGINE_KEYFRAME_EDITOR_VALUESCALE_H
#pragma once

#include <QFrame>

Expand Down Expand Up @@ -27,9 +26,7 @@ class KeyframeEditorValueScale : public QFrame

private:
/// The KeyframeEditorScrollArea.
KeyFrameEditorScrollArea* m_scrollArea{nullptr};
KeyFrameEditorScrollArea* m_scrollArea {nullptr};
};

} // namespace Ra::GuiBase

#endif // RADIUMENGINE_KEYFRAME_EDITOR_VALUESCALE_H
11 changes: 7 additions & 4 deletions src/GuiBase/Timeline/Timeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <Engine/Renderer/RenderObject/RenderObject.hpp>
#include <Engine/Renderer/RenderObject/RenderObjectManager.hpp>

#include <GuiBase/KeyFrameEditor/KeyFrameEditor.h>
#include <GuiBase/KeyFrameEditor/KeyFrameEditor.hpp>
#include <GuiBase/Timeline/HelpDialog.hpp>

using namespace Ra::Core::Utils;
Expand Down Expand Up @@ -428,7 +428,8 @@ void Timeline::on_comboBox_attribute_currentIndexChanged( const QString& arg1 )

switch ( names.size() )
{
case 2: {
case 2:
{
const std::string entityName = names.at( 0 ).toStdString();
const std::string frameName = names.at( 1 ).toStdString();
auto lambda = [entityName]( const auto& frame ) {
Expand All @@ -438,7 +439,8 @@ void Timeline::on_comboBox_attribute_currentIndexChanged( const QString& arg1 )
GET_KEYFRAMEDVALUE( list, frameName );
}
break;
case 3: {
case 3:
{
const std::string compName = names.at( 1 ).toStdString();
const std::string frameName = names.at( 2 ).toStdString();
auto lambda = [compName]( const auto& frame ) {
Expand All @@ -448,7 +450,8 @@ void Timeline::on_comboBox_attribute_currentIndexChanged( const QString& arg1 )
GET_KEYFRAMEDVALUE( list, frameName );
}
break;
case 4: {
case 4:
{
const QStringList fullRoName = names.at( 2 ).split( '_' );
bool ok;
const auto roIdx = fullRoName.last().toInt( &ok );
Expand Down

0 comments on commit 270f84c

Please sign in to comment.