|
|
@ -7,15 +7,14 @@
|
|
|
|
#include <QWidget>
|
|
|
|
#include <QWidget>
|
|
|
|
#include <QTimer>
|
|
|
|
#include <QTimer>
|
|
|
|
|
|
|
|
|
|
|
|
#include <osgViewer/View>
|
|
|
|
|
|
|
|
#include <osgViewer/CompositeViewer>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <boost/shared_ptr.hpp>
|
|
|
|
#include <boost/shared_ptr.hpp>
|
|
|
|
|
|
|
|
|
|
|
|
#include "lightingday.hpp"
|
|
|
|
#include "lightingday.hpp"
|
|
|
|
#include "lightingnight.hpp"
|
|
|
|
#include "lightingnight.hpp"
|
|
|
|
#include "lightingbright.hpp"
|
|
|
|
#include "lightingbright.hpp"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <osgViewer/View>
|
|
|
|
|
|
|
|
#include <osgViewer/CompositeViewer>
|
|
|
|
|
|
|
|
|
|
|
|
namespace Resource
|
|
|
|
namespace Resource
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -54,7 +53,6 @@ namespace CSVRender
|
|
|
|
RenderWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
|
|
|
|
RenderWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
|
|
|
|
virtual ~RenderWidget();
|
|
|
|
virtual ~RenderWidget();
|
|
|
|
|
|
|
|
|
|
|
|
/// Initiates a request to redraw the view
|
|
|
|
|
|
|
|
void flagAsModified();
|
|
|
|
void flagAsModified();
|
|
|
|
|
|
|
|
|
|
|
|
void setVisibilityMask(int mask);
|
|
|
|
void setVisibilityMask(int mask);
|
|
|
@ -64,16 +62,13 @@ namespace CSVRender
|
|
|
|
protected:
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
|
|
|
osg::ref_ptr<osgViewer::View> mView;
|
|
|
|
osg::ref_ptr<osgViewer::View> mView;
|
|
|
|
osg::ref_ptr<osg::Group> mRootNode;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QTimer mTimer;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected slots:
|
|
|
|
osg::Group* mRootNode;
|
|
|
|
|
|
|
|
|
|
|
|
void toggleRenderStats();
|
|
|
|
QTimer mTimer;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/// Extension of RenderWidget to support lighting mode selection & toolbar
|
|
|
|
// Extension of RenderWidget to support lighting mode selection & toolbar
|
|
|
|
class SceneWidget : public RenderWidget
|
|
|
|
class SceneWidget : public RenderWidget
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
Q_OBJECT
|
|
|
@ -95,8 +90,18 @@ namespace CSVRender
|
|
|
|
|
|
|
|
|
|
|
|
void setAmbient(const osg::Vec4f& ambient);
|
|
|
|
void setAmbient(const osg::Vec4f& ambient);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
virtual void mousePressEvent (QMouseEvent *event);
|
|
|
|
|
|
|
|
virtual void mouseReleaseEvent (QMouseEvent *event);
|
|
|
|
virtual void mouseMoveEvent (QMouseEvent *event);
|
|
|
|
virtual void mouseMoveEvent (QMouseEvent *event);
|
|
|
|
virtual void wheelEvent (QWheelEvent *event);
|
|
|
|
virtual void wheelEvent (QWheelEvent *event);
|
|
|
|
|
|
|
|
virtual void keyPressEvent (QKeyEvent *event);
|
|
|
|
|
|
|
|
virtual void keyReleaseEvent (QKeyEvent *event);
|
|
|
|
|
|
|
|
virtual void focusOutEvent (QFocusEvent *event);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// \return Is \a key a button mapping setting? (ignored otherwise)
|
|
|
|
|
|
|
|
virtual bool storeMappingSetting (const CSMPrefs::Setting *setting);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::string mapButton (QMouseEvent *event);
|
|
|
|
|
|
|
|
|
|
|
|
boost::shared_ptr<Resource::ResourceSystem> mResourceSystem;
|
|
|
|
boost::shared_ptr<Resource::ResourceSystem> mResourceSystem;
|
|
|
|
|
|
|
|
|
|
|
@ -109,15 +114,17 @@ namespace CSVRender
|
|
|
|
LightingBright mLightingBright;
|
|
|
|
LightingBright mLightingBright;
|
|
|
|
|
|
|
|
|
|
|
|
int mPrevMouseX, mPrevMouseY;
|
|
|
|
int mPrevMouseX, mPrevMouseY;
|
|
|
|
|
|
|
|
std::string mMouseMode;
|
|
|
|
FreeCameraController* mFreeCamControl;
|
|
|
|
std::auto_ptr<FreeCameraController> mFreeCamControl;
|
|
|
|
OrbitCameraController* mOrbitCamControl;
|
|
|
|
std::auto_ptr<OrbitCameraController> mOrbitCamControl;
|
|
|
|
CameraController* mCurrentCamControl;
|
|
|
|
CameraController* mCurrentCamControl;
|
|
|
|
|
|
|
|
/// Tells update that camera isn't set
|
|
|
|
private:
|
|
|
|
|
|
|
|
bool mCamPositionSet;
|
|
|
|
bool mCamPositionSet;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::map<std::pair<Qt::MouseButton, bool>, std::string> mButtonMapping;
|
|
|
|
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
public slots:
|
|
|
|
|
|
|
|
/// \note Remember set the camera before running
|
|
|
|
void update(double dt);
|
|
|
|
void update(double dt);
|
|
|
|
|
|
|
|
|
|
|
|
protected slots:
|
|
|
|
protected slots:
|
|
|
|