Merge remote-tracking branch 'origin/kameleon' into properties

This commit is contained in:
Alexander Bock
2014-05-02 16:59:50 +02:00
28 changed files with 806 additions and 105 deletions
+1 -1
View File
@@ -71,7 +71,7 @@ public:
bool CalculateTemporalError();
int * Data() { return &data_[0]; }
unsigned int Size() { return data_.size(); }
size_t Size() { return data_.size(); }
// TODO support dimensions of differens sizes
unsigned int BrickDim() const { return xBrickDim_; }
@@ -58,13 +58,19 @@ public:
void mouseScrollWheelCallback(int pos);
private:
glm::vec3 mapToTrackball(glm::vec2 mousePos);
void trackballRotate(int x, int y);
Camera *camera_;
Camera* camera_;
bool enabled_;
SceneGraphNode *node_;
double dt_;
glm::vec3 _lastTrackballPos;
bool _leftMouseButtonDown, _isMouseBeingPressedAndHeld;
// used for calling when updating and deallocation
std::vector<ExternalControl*> controllers_;
@@ -75,4 +81,4 @@ private:
} // namespace openspace
#endif
#endif
+2 -1
View File
@@ -24,6 +24,7 @@
#ifndef INTERFACE_H_
#define INTERFACE_H_
#include <openspace/engine/openspaceengine.h>
#include <boost/property_tree/ptree.hpp>
#include <openspace/engine/openspaceengine.h>
@@ -31,7 +32,6 @@
namespace openspace {
class Interface {
struct Node {
std::string _key;
std::string _value;
@@ -62,6 +62,7 @@ public:
void callback(const char * receivedChars);
private:
void handleNodes();
void loadIntoNodes(const boost::property_tree::ptree& tree, std::string parent = "", const int depth = 0);
@@ -44,6 +44,7 @@ public:
protected:
std::string findPath(const std::string& path);
ghoul::opengl::Texture* loadVolume(const std::string& filepath, const ghoul::Dictionary& hintsDictionary);
ghoul::RawVolumeReader::ReadHints readHints(const ghoul::Dictionary& dictionary);
ghoul::opengl::Texture* loadTransferFunction(const std::string& filepath);
@@ -43,6 +43,10 @@
#define SGCT_WINDOWS_INCLUDE
#include <sgct.h>
namespace sgct_utils {
class SGCTBox;
}
//#include <vector>
//#include <string>
#ifdef __APPLE__
@@ -37,7 +37,6 @@
#include <ghoul/opencl/clcommandqueue.h>
#include <ghoul/opencl/clprogram.h>
#include <ghoul/opencl/clkernel.h>
#include <ghoul/io/rawvolumereader.h>
#include <ghoul/filesystem/file.h>
#ifdef __APPLE__
@@ -75,7 +74,7 @@ private:
// Volumes
std::vector<std::string> _volumePaths;
std::vector<ghoul::RawVolumeReader::ReadHints> _volumeHints;
std::vector<ghoul::Dictionary> _volumeHints;
// Textures
ghoul::opengl::Texture* _output;
@@ -98,6 +97,8 @@ private:
ghoul::opencl::CLWorkSize* _ws;
ghoul::filesystem::File* _kernelSourceFile;
std::vector<std::pair<ghoul::opencl::CLProgram::Option, bool> > _kernelOptions;
std::vector<std::string> _kernelIncludes;
std::vector<std::pair<std::string,std::string> > _kernelDefinitions;
bool _programUpdateOnSave;
// mutexes to prevent inconsistencies
@@ -105,10 +106,10 @@ private:
std::mutex* _textureLock;
ghoul::opengl::ProgramObject *_quadProgram;
sgct_utils::SGCTBox* _boundingBox;
GLuint _screenQuad;
VolumeRaycasterBox* _colorBoxRenderer;
glm::vec3 _boxScaling;
};
@@ -44,6 +44,10 @@
#include <mutex>
#endif
namespace sgct_utils {
class SGCTBox;
}
namespace openspace {
class RenderableVolumeGL: public RenderableVolume {
@@ -25,13 +25,18 @@
#ifndef VOLUMERAYCASTERBOX_H_
#define VOLUMERAYCASTERBOX_H_
#include <ghoul/opengl/programobject.h>
#include <ghoul/opengl/framebufferobject.h>
#include <ghoul/opengl/texture.h>
// forward declare private objects
namespace sgct_utils {
class SGCTBox;
}
namespace ghoul {
namespace opengl {
class FramebufferObject;
class ProgramObject;
}
}
namespace openspace {
@@ -40,7 +45,7 @@ public:
VolumeRaycasterBox();
~VolumeRaycasterBox();
bool initialize();
void render(glm::mat4 MVP);
void render(const glm::mat4& MVP);
ghoul::opengl::Texture* backFace();
ghoul::opengl::Texture* frontFace();
@@ -56,5 +61,5 @@ private:
glm::size2_t _dimensions;
};
} /* namespace openspace */
#endif /* VOLUMERAYCASTERBOX_H_ */
} // namespace openspace
#endif // VOLUMERAYCASTERBOX_H_
+58
View File
@@ -0,0 +1,58 @@
/*****************************************************************************************
* *
* OpenSpace *
* *
* Copyright (c) 2014 *
* *
* 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 KAMELEONWRAPPER_H_
#define KAMELEONWRAPPER_H_
#include <glm/glm.hpp>
#include <glm/gtx/std_based_type.hpp>
namespace ccmc {
class Model;
class Interpolator;
}
namespace openspace {
class KameleonWrapper {
public:
enum class Model {
ENLIL, // Heliosphere
BATSRUS // Magnetosphere
};
KameleonWrapper(const std::string& filename, Model model);
~KameleonWrapper();
float* getUniformSampledValues(const std::string& var, glm::size3_t outDimensions);
private:
ccmc::Model* _model;
Model _type;
ccmc::Interpolator* _interpolator;
};
} // namespace openspace
#endif // KAMELEONWRAPPER_H_