Merge branch 'develop' of openspace.itn.liu.se:/openspace into develop

Conflicts:
	src/properties/optionproperty.cpp
This commit is contained in:
Michal Marcinkowski
2014-12-09 14:12:13 -05:00
26 changed files with 449 additions and 260 deletions
+15
View File
@@ -34,6 +34,10 @@
#include <string>
#include <vector>
namespace ghoul {
class SharedMemory;
}
namespace openspace {
namespace properties {
@@ -67,10 +71,21 @@ public:
static scripting::ScriptEngine::LuaLibrary luaLibrary();
private:
void renderMainWindow();
void renderPropertyWindow();
void renderPerformanceWindow();
bool _isEnabled;
bool _showPropertyWindow;
bool _showPerformanceWindow;
bool _showHelp;
ghoul::SharedMemory* _performanceMemory;
float _minMaxValues[2];
std::set<properties::Property*> _boolProperties;
std::set<properties::Property*> _intProperties;
std::set<properties::Property*> _floatProperties;
+1
View File
@@ -56,6 +56,7 @@ public:
virtual bool deinitialize() = 0;
virtual bool isReady() const = 0;
bool isEnabled() const;
void setBoundingSphere(const PowerScaledScalar& boundingSphere);
const PowerScaledScalar& getBoundingSphere();
+14 -1
View File
@@ -27,6 +27,10 @@
#include <openspace/scripting/scriptengine.h>
namespace ghoul {
class SharedMemory;
}
namespace openspace {
// Forward declare to minimize dependencies
@@ -39,6 +43,8 @@ class ScreenLog;
class RenderEngine {
public:
static const std::string PerformanceMeasurementSharedData;
RenderEngine();
~RenderEngine();
@@ -59,6 +65,9 @@ public:
void takeScreenshot();
void toggleVisualizeABuffer(bool b);
void setPerformanceMeasurements(bool performanceMeasurements);
bool doesPerformanceMeasurements() const;
void serialize(SyncBuffer* syncBuffer);
void deserialize(SyncBuffer* syncBuffer);
@@ -72,8 +81,9 @@ public:
*/
static scripting::ScriptEngine::LuaLibrary luaLibrary();
private:
void storePerformanceMeasurements();
Camera* _mainCamera;
SceneGraph* _sceneGraph;
ABuffer* _abuffer;
@@ -83,6 +93,9 @@ private:
bool _showScreenLog;
bool _takeScreenshot;
bool _doPerformanceMeasurements;
ghoul::SharedMemory* _performanceMemory;
void generateGlslConfig();
bool _visualizeABuffer;
+4 -6
View File
@@ -35,7 +35,6 @@
#include <openspace/util/updatestructures.h>
#include <openspace/scripting/scriptengine.h>
// ghoul includes
#include <ghoul/opengl/programobject.h>
#include <ghoul/misc/dictionary.h>
@@ -44,6 +43,8 @@ namespace openspace {
class SceneGraphNode;
// Notifications:
// SceneGraphFinishedLoading
class SceneGraph {
public:
// constructors & destructor
@@ -83,11 +84,6 @@ public:
*/
void render(const RenderData& data);
/*
* Prints the SceneGraph tree. For debugging purposes
*/
void printChildren() const;
/*
* Returns the root SceneGraphNode
*/
@@ -99,6 +95,8 @@ public:
*/
SceneGraphNode* sceneGraphNode(const std::string& name) const;
std::vector<SceneGraphNode*> allSceneGraphNodes() const;
/**
* Returns the Lua library that contains all Lua functions available to change the
* scene graph. The functions contained are
+12 -13
View File
@@ -44,9 +44,14 @@ namespace openspace {
class SceneGraphNode : public properties::PropertyOwner {
public:
struct PerformanceRecord {
long long renderTime; // time in ns
long long updateTimeRenderable; // time in ns
long long updateTimeEphemeris; // time in ns
};
static std::string RootNodeName;
// constructors & destructor
SceneGraphNode();
~SceneGraphNode();
@@ -55,12 +60,10 @@ public:
bool initialize();
bool deinitialize();
// essential
void update(const UpdateData& data);
void evaluate(const Camera* camera, const psc& parentPosition = psc());
void render(const RenderData& data);
// set & get
void addNode(SceneGraphNode* child);
void setParent(SceneGraphNode* parent);
@@ -70,35 +73,31 @@ public:
SceneGraphNode* parent() const;
const std::vector<SceneGraphNode*>& children() const;
// bounding sphere
PowerScaledScalar calculateBoundingSphere();
PowerScaledScalar boundingSphere() const;
SceneGraphNode* childNode(const std::string& name);
void print() const;
const PerformanceRecord& performanceRecord() const { return _performanceRecord; }
// renderable
void setRenderable(Renderable* renderable);
const Renderable* renderable() const;
Renderable* renderable();
private:
// essential
std::vector<SceneGraphNode*> _children;
bool sphereInsideFrustum(const psc s_pos, const PowerScaledScalar& s_rad, const Camera* camera);
std::vector<SceneGraphNode*> _children;
SceneGraphNode* _parent;
Ephemeris* _ephemeris;
// renderable
PerformanceRecord _performanceRecord;
Renderable* _renderable;
bool _renderableVisible;
// bounding sphere
bool _boundingSphereVisible;
PowerScaledScalar _boundingSphere;
// private helper methods
bool sphereInsideFrustum(const psc s_pos, const PowerScaledScalar& s_rad, const Camera* camera);
};
} // namespace openspace
+4 -31
View File
@@ -111,7 +111,7 @@ public:
/**
* Determines whether values exist for some <code>item</code> for any
* code>body</code> in the kernel pool by passing it to the <code>bodfnd_c</code>
* <code>body</code> in the kernel pool by passing it to the <code>bodfnd_c</code>
* function.
* http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/bodfnd_c.html
* \param body The name of the body that should be sampled
@@ -465,8 +465,9 @@ public:
* surface point on a body with the NAIF ID of <code>id</code> to rectangular
* <code>coordinates</code>. For further details, refer to
* http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/srfrec_c.html.
* \param body The body on which the <code>longitude</code> and <code>latitude</code>
* are defined. This body needs to have a defined radius for this function to work
* \param id The identifier of the body on which the <code>longitude</code> and
* <code>latitude</code> are defined. This body needs to have a defined radius for
* this function to work.
* \param longitude The longitude of the point on the <code>body</code> in radians
* \param latitude The latitude of the point on the <code>body</code> in radians
* \param coordinates The output containing the rectangular coordinates of the point
@@ -524,34 +525,6 @@ public:
double& targetEphemerisTime,
glm::dvec3& vectorToSurfacePoint) const;
/**
* Computes the rectangular coordinates of the sub-solar point on
* a target body at a specified epoch, optionally corrected for
* light time and stellar aberration.
* For further details, please refer to 'subslr_c ' in SPICE Docummentation
*
* \param computationMethod Computation method.
* \param target Name of target body.
* \param ephemeris Epoch in ephemeris seconds past J2000 TDB.
* \param bodyFixedFrame Body-fixed, body-centered target body frame.
* \param aberrationCorrection Aberration correction.
* \param observer Name of observing body.
* \param subObserverPoint Sub-observer point on the target body.
* \param targetEpoch Sub-observer point epoch.
* \param observerToSubObserverVec Vector from observer to sub-observer point.
* \return Whether the function succeeded or not
*/
//bool getSubSolarPoint(std::string target,
// std::string computationMethod,
//
// double ephemeris,
// std::string bodyFixedFrame,
// std::string aberrationCorrection,
//
// glm::dvec3& subSolarPoint,
// double& targetEpoch,
// glm::dvec3& vectorToSurfacePoint) const;
/**
* This method checks if one of the previous SPICE methods has failed. If it has, the
* <code>errorMessage</code> is used to log an error along with the original SPICE
+1 -1
View File
@@ -81,7 +81,7 @@ public:
/**
* Sets the current time to the specified value in seconds past the J2000 epoch. This
* value can be negative to represent dates before the epoch.
* \param The number of seconds after the J2000 epoch
* \param value The number of seconds after the J2000 epoch
*/
void setTime(double value);
+2 -1
View File
@@ -33,12 +33,13 @@ namespace openspace {
struct UpdateData {
double time;
double delta;
bool doPerformanceMeasurement;
};
struct RenderData {
const Camera& camera;
psc position;
bool doPerformanceMeasurement;
};
}