2016-01-07 00:40:27 +00:00
|
|
|
#ifndef URDE_MODEL_VIEWER_HPP
|
|
|
|
#define URDE_MODEL_VIEWER_HPP
|
|
|
|
|
2016-01-17 05:08:46 +00:00
|
|
|
#include "Space.hpp"
|
|
|
|
#include "ViewManager.hpp"
|
|
|
|
#include "CVector3f.hpp"
|
|
|
|
#include "CProjection.hpp"
|
|
|
|
|
2016-01-07 00:40:27 +00:00
|
|
|
namespace URDE
|
|
|
|
{
|
2016-01-17 05:08:46 +00:00
|
|
|
class ModelViewer : public Space
|
|
|
|
{
|
|
|
|
struct State : Space::State
|
|
|
|
{
|
|
|
|
DECL_YAML
|
|
|
|
enum class Mode
|
|
|
|
{
|
|
|
|
Solid,
|
|
|
|
Material,
|
|
|
|
Wireframe
|
|
|
|
};
|
|
|
|
|
|
|
|
Value<Mode> renderMode = Mode::Material;
|
2016-01-17 22:41:49 +00:00
|
|
|
Value<Zeus::CVector3f> cameraPosition;
|
|
|
|
Value<Zeus::CQuaternion> cameraOrientation;
|
|
|
|
|
2016-01-17 05:08:46 +00:00
|
|
|
} m_state;
|
|
|
|
|
|
|
|
const Space::State& spaceState() const { return m_state; }
|
|
|
|
|
|
|
|
struct View : Specter::View
|
|
|
|
{
|
|
|
|
};
|
2016-01-17 22:41:49 +00:00
|
|
|
|
2016-01-17 05:08:46 +00:00
|
|
|
virtual Specter::View* buildContentView(Specter::ViewResources& res)
|
|
|
|
{
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
virtual Specter::View* buildSpaceView(Specter::ViewResources& res)
|
|
|
|
{
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
|
|
|
ModelViewer(ViewManager& vm, Space* parent)
|
|
|
|
: Space(vm, Class::ModelViewer, parent)
|
|
|
|
{
|
|
|
|
reloadState();
|
|
|
|
}
|
|
|
|
|
|
|
|
ModelViewer(ViewManager& vm, Space* parent, const ModelViewer& other)
|
|
|
|
: ModelViewer(vm, parent)
|
|
|
|
{
|
|
|
|
m_state = other.m_state;
|
|
|
|
reloadState();
|
|
|
|
}
|
|
|
|
|
|
|
|
ModelViewer(ViewManager& vm, Space* parent, ConfigReader& r)
|
|
|
|
: ModelViewer(vm, parent)
|
|
|
|
{
|
|
|
|
m_state.read(r);
|
|
|
|
reloadState();
|
|
|
|
}
|
|
|
|
|
|
|
|
void reloadState()
|
|
|
|
{}
|
|
|
|
|
|
|
|
Space* copy(Space *parent) const
|
|
|
|
{
|
|
|
|
return new ModelViewer(m_vm, parent, *this);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool usesToolbar() const { return true; }
|
|
|
|
};
|
|
|
|
|
2016-01-07 00:40:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif // URDE_MODEL_VIEWER_HPP
|