Feature/time frame (#642)

* First implementation of time frames
* Add TimeFrameUnion. Only show solar system 1850-2150.
* Consider dependencies when determining whether time frame is active
* Code review fixes.
This commit is contained in:
Emil Axelsson
2018-07-11 10:42:06 +02:00
committed by GitHub
parent c2b1a3fd42
commit 1b3df16c28
16 changed files with 605 additions and 20 deletions
+5
View File
@@ -48,6 +48,8 @@ class Scale;
class Scene;
struct UpdateData;
struct SurfacePositionHandle;
class TimeFrame;
class Time;
namespace documentation { struct Documentation; }
@@ -120,6 +122,7 @@ public:
glm::dmat4 modelTransform() const;
glm::dmat4 inverseModelTransform() const;
double worldScale() const;
bool isTimeFrameActive(const Time& time) const;
SceneGraphNode* parent() const;
std::vector<SceneGraphNode*> children() const;
@@ -168,6 +171,8 @@ private:
std::unique_ptr<Scale> scale;
} _transform;
std::unique_ptr<TimeFrame> _timeFrame;
// Cached transform data
glm::dvec3 _worldPositionCached;
glm::dmat3 _worldRotationCached;
+58
View File
@@ -0,0 +1,58 @@
/*****************************************************************************************
* *
* OpenSpace *
* *
* Copyright (c) 2014-2018 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
* without restriction, including without limitation the rights to use, copy, modify, *
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *
* permit persons to whom the Software is furnished to do so, subject to the following *
* conditions: *
* *
* The above copyright notice and this permission notice shall be included in all copies *
* or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#ifndef __OPENSPACE_CORE___TIMEFRAME___H__
#define __OPENSPACE_CORE___TIMEFRAME___H__
#include <openspace/properties/propertyowner.h>
#include <ghoul/glm.h>
#include <memory>
namespace ghoul { class Dictionary; }
namespace openspace {
class Time;
namespace documentation { struct Documentation; }
class TimeFrame : public properties::PropertyOwner {
public:
static std::unique_ptr<TimeFrame> createFromDictionary(
const ghoul::Dictionary& dictionary);
TimeFrame();
virtual ~TimeFrame() = default;
virtual bool initialize();
virtual bool isActive(const Time& time) const = 0;
static documentation::Documentation Documentation();
};
} // namespace openspace
#endif // __OPENSPACE_CORE___TIMEFRAME___H__