Remove style guide errors

Add missing newline errors
This commit is contained in:
Alexander Bock
2017-07-21 11:52:25 -04:00
parent 1abb9ccfe6
commit e661324002
29 changed files with 256 additions and 173 deletions
+1 -1
View File
@@ -28,7 +28,7 @@
#include <openspace/util/keys.h>
#include <openspace/util/mouse.h>
#include <glm/glm.hpp>
#include <ghoul/glm.h>
#include <list>
@@ -28,7 +28,7 @@
#include <openspace/util/timeline.h>
#include <openspace/network/parallelconnection.h>
#include <glm/glm.hpp>
#include <ghoul/glm.h>
#include <glm/gtx/quaternion.hpp>
namespace openspace { class Camera; }
+1 -1
View File
@@ -28,7 +28,7 @@
#include <openspace/interaction/delayedvariable.h>
#include <openspace/interaction/inputstate.h>
#include <glm/glm.hpp>
#include <ghoul/glm.h>
namespace openspace::interaction {
@@ -34,7 +34,7 @@
#include <openspace/properties/scalar/boolproperty.h>
#include <openspace/properties/scalar/floatproperty.h>
#include <glm/glm.hpp>
#include <ghoul/glm.h>
#include <glm/gtx/quaternion.hpp>
namespace openspace {
@@ -234,4 +234,5 @@ void RenderableSphericalGrid::update(const UpdateData& data) {
_parentMatrix = SpiceManager::ref().positionTransformMatrix("IAU_JUPITER", "GALACTIC", data.time.j2000Seconds());
}
}
} // namespace openspace
@@ -181,4 +181,5 @@ int ScreenSpaceFramebuffer::id(){
static int id = 0;
return id++;
}
} //namespace openspace
} //namespace openspace
+1 -1
View File
@@ -60,4 +60,4 @@ void main() {
float distanceToCamera = length(positionCameraSpace.xyz);
vs_pointColor.a = maximumDistance / (distanceToCamera / 100.0);
}
}
+1 -1
View File
@@ -83,4 +83,4 @@ PixelBuffer::operator GLuint() const {
return _id;
}
} // namespace openspace::globebrowsing
} // namespace openspace::globebrowsing
@@ -22,8 +22,8 @@
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___GPULAYER_ADJUSMENT___H__
#define __OPENSPACE_MODULE_GLOBEBROWSING___GPULAYER_ADJUSMENT___H__
#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___GPULAYER_ADJUSTMENT___H__
#define __OPENSPACE_MODULE_GLOBEBROWSING___GPULAYER_ADJUSTMENT___H__
#include <openspace/util/gpudata.h>
@@ -49,4 +49,4 @@ private:
} // namespace openspace::globebrowsing
#endif // __OPENSPACE_MODULE_GLOBEBROWSING___GPULAYER_ADJUSMENT___H__
#endif // __OPENSPACE_MODULE_GLOBEBROWSING___GPULAYER_ADJUSTMENT___H__
@@ -399,4 +399,4 @@ int GdalRawTileDataReader::calculateTileLevelDifference(int minimumPixelSize) co
} // namespace openspace::globebrowsing
#endif // GLOBEBROWSING_USE_GDAL
#endif // GLOBEBROWSING_USE_GDAL
@@ -22,8 +22,8 @@
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___CACHING_TILE_PROVIDER___H__
#define __OPENSPACE_MODULE_GLOBEBROWSING___CACHING_TILE_PROVIDER___H__
#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___DEFAULT_TILE_PROVIDER___H__
#define __OPENSPACE_MODULE_GLOBEBROWSING___DEFAULT_TILE_PROVIDER___H__
#include <modules/globebrowsing/tile/tileprovider/tileprovider.h>
#include <modules/globebrowsing/cache/memoryawaretilecache.h>
@@ -90,4 +90,4 @@ private:
} // namespace openspace::globebrowsing::tileprovider
#endif // __OPENSPACE_MODULE_GLOBEBROWSING___CACHING_TILE_PROVIDER___H__
#endif // __OPENSPACE_MODULE_GLOBEBROWSING___DEFAULT_TILE_PROVIDER___H__
+1 -1
View File
@@ -321,4 +321,4 @@ void DataCygnet::subscribeToGroup(){
}
} //namespace openspace
} //namespace openspace
+1 -1
View File
@@ -173,4 +173,4 @@ std::vector<float*> DataPlane::textureData(){
return d;
}
}// namespace openspace
}// namespace openspace
+12 -10
View File
@@ -52,9 +52,9 @@ DataSphere::DataSphere(const ghoul::Dictionary& dictionary)
_fsPath = "${MODULE_ISWA}/shaders/datasphere_fs.glsl";
}
DataSphere::~DataSphere(){}
DataSphere::~DataSphere() {}
bool DataSphere::initialize(){
bool DataSphere::initialize() {
IswaCygnet::initialize();
//rotate 90 degrees because of the texture coordinates in PowerScaledSphere
@@ -90,7 +90,7 @@ bool DataSphere::initialize(){
return true;
}
bool DataSphere::createGeometry(){
bool DataSphere::createGeometry() {
PowerScaledScalar radius = PowerScaledScalar(6.371f*_radius, 6.0);
int segments = 100;
_sphere = std::make_shared<PowerScaledSphere>(radius, segments);
@@ -98,7 +98,7 @@ bool DataSphere::createGeometry(){
return true;
}
bool DataSphere::destroyGeometry(){
bool DataSphere::destroyGeometry() {
_sphere = nullptr;
return true;
}
@@ -109,18 +109,19 @@ void DataSphere::renderGeometry() const {
_sphere->render();
}
std::vector<float*> DataSphere::textureData(){
std::vector<float*> DataSphere::textureData() {
// if the buffer in the datafile is empty, do not proceed
if(_dataBuffer.empty())
if(_dataBuffer.empty()) {
return std::vector<float*>();
}
if(!_dataOptions.options().size()){ // load options for value selection
if(!_dataOptions.options().size()) { // load options for value selection
fillOptions(_dataBuffer);
_dataProcessor->addDataValues(_dataBuffer, _dataOptions);
// if this datacygnet has added new values then reload texture
// for the whole group, including this datacygnet, and return after.
if(_group){
if(_group) {
_group->updateGroup();
return std::vector<float*>();
}
@@ -129,10 +130,11 @@ std::vector<float*> DataSphere::textureData(){
return _dataProcessor->processData(_dataBuffer, _dataOptions, _textureDimensions);
}
void DataSphere::setUniforms(){
void DataSphere::setUniforms() {
// set both data texture and transfer function texture
setTextureUniforms();
_shader->setUniform("backgroundValues", _backgroundValues.value());
_shader->setUniform("transparency", _alpha.value());
}
} //namespace openspace
} //namespace openspace
+1 -1
View File
@@ -109,4 +109,4 @@ void IswaBaseGroup::unregisterProperties(){
_registered = false;
}
} //namespace openspace
} //namespace openspace
+71 -41
View File
@@ -38,12 +38,11 @@ namespace {
namespace openspace {
KameleonPlane::KameleonPlane(const ghoul::Dictionary& dictionary)
:DataCygnet(dictionary)
,_fieldlines("fieldlineSeedsIndexFile", "Fieldline Seedpoints")
,_resolution("resolution", "Resolution%", 100.0f, 10.0f, 200.0f)
,_slice("slice", "Slice", 0.0, 0.0, 1.0)
{
: DataCygnet(dictionary)
, _fieldlines("fieldlineSeedsIndexFile", "Fieldline Seedpoints")
, _resolution("resolution", "Resolution%", 100.0f, 10.0f, 200.0f)
, _slice("slice", "Slice", 0.0, 0.0, 1.0)
{
addProperty(_resolution);
addProperty(_slice);
addProperty(_fieldlines);
@@ -56,9 +55,15 @@ KameleonPlane::KameleonPlane(const ghoul::Dictionary& dictionary)
std::string axis;
dictionary.getValue("axisCut", axis);
if(axis == "x") _cut = 0;
else if (axis == "y") _cut = 1;
else _cut = 2;
if (axis == "x") {
_cut = 0;
}
else if (axis == "y") {
_cut = 1;
}
else {
_cut = 2;
}
_origOffset = _data->offset;
@@ -75,9 +80,9 @@ KameleonPlane::KameleonPlane(const ghoul::Dictionary& dictionary)
_fsPath = "${MODULE_ISWA}/shaders/dataplane_fs.glsl";
}
KameleonPlane::~KameleonPlane(){}
KameleonPlane::~KameleonPlane() {}
bool KameleonPlane::deinitialize(){
bool KameleonPlane::deinitialize() {
IswaCygnet::deinitialize();
_fieldlines.set(std::vector<int>());
return true;
@@ -95,17 +100,17 @@ bool KameleonPlane::initialize(){
readFieldlinePaths(absPath(_fieldlineIndexFile));
if(_group){
if (_group) {
_dataProcessor = _group->dataProcessor();
subscribeToGroup();
}else{
} else {
_dataProcessor = std::make_shared<DataProcessorKameleon>();
//If autofiler is on, background values property should be hidden
_autoFilter.onChange([this](){
// If autofiler is selected, use _dataProcessor to set backgroundValues
// and unregister backgroundvalues property.
if(_autoFilter.value()){
if (_autoFilter) {
_backgroundValues.setValue(_dataProcessor->filterValues());
_backgroundValues.setVisibility(properties::Property::Visibility::Hidden);
//_backgroundValues.setVisible(false);
@@ -183,14 +188,28 @@ bool KameleonPlane::createGeometry() {
glBindBuffer(GL_ARRAY_BUFFER, _vertexPositionBuffer); // bind buffer
glBufferData(GL_ARRAY_BUFFER, sizeof(vertex_data), vertex_data, GL_STATIC_DRAW);
glEnableVertexAttribArray(0);
glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, sizeof(GLfloat) * 6, reinterpret_cast<void*>(0));
glVertexAttribPointer(
0,
4,
GL_FLOAT,
GL_FALSE,
sizeof(GLfloat) * 6,
reinterpret_cast<void*>(0)
);
glEnableVertexAttribArray(1);
glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, sizeof(GLfloat) * 6, reinterpret_cast<void*>(sizeof(GLfloat) * 4));
glVertexAttribPointer(
1,
2,
GL_FLOAT,
GL_FALSE,
sizeof(GLfloat) * 6,
reinterpret_cast<void*>(sizeof(GLfloat) * 4)
);
return true;
}
bool KameleonPlane::destroyGeometry(){
bool KameleonPlane::destroyGeometry() {
glDeleteVertexArrays(1, &_quad);
_quad = 0;
@@ -206,32 +225,37 @@ void KameleonPlane::renderGeometry() const {
}
std::vector<float*> KameleonPlane::textureData() {
return std::dynamic_pointer_cast<DataProcessorKameleon>(_dataProcessor)->processData(_kwPath, _dataOptions, _dimensions, _slice);
return std::dynamic_pointer_cast<DataProcessorKameleon>(_dataProcessor)->processData(
_kwPath,
_dataOptions,
_dimensions,
_slice
);
};
bool KameleonPlane::updateTextureResource(){
bool KameleonPlane::updateTextureResource() {
_data->offset[_cut] = _data->gridMin[_cut]+_slice.value()*_scale;
// _textureDirty = true;
updateTexture();
return true;
}
void KameleonPlane::setUniforms(){
void KameleonPlane::setUniforms() {
setTextureUniforms();
_shader->setUniform("backgroundValues", _backgroundValues.value());
_shader->setUniform("transparency", _alpha.value());
}
void KameleonPlane::updateFieldlineSeeds(){
void KameleonPlane::updateFieldlineSeeds() {
std::vector<int> selectedOptions = _fieldlines.value();
// SeedPath == map<int selectionValue, tuple< string name, string path, bool active > >
for (auto& seedPath: _fieldlineState) {
// if this option was turned off
if( std::find(selectedOptions.begin(), selectedOptions.end(), seedPath.first)==selectedOptions.end() && std::get<2>(seedPath.second)){
if(OsEng.renderEngine().scene()->sceneGraphNode(std::get<0>(seedPath.second)) == nullptr) return;
if (std::find(selectedOptions.begin(), selectedOptions.end(), seedPath.first)==selectedOptions.end() && std::get<2>(seedPath.second)) {
if (OsEng.renderEngine().scene()->sceneGraphNode(std::get<0>(seedPath.second)) == nullptr) {
return;
}
LDEBUG("Removed fieldlines: " + std::get<0>(seedPath.second));
OsEng.scriptEngine().queueScript(
@@ -240,8 +264,10 @@ void KameleonPlane::updateFieldlineSeeds(){
);
std::get<2>(seedPath.second) = false;
// if this option was turned on
} else if( std::find(selectedOptions.begin(), selectedOptions.end(), seedPath.first)!=selectedOptions.end() && !std::get<2>(seedPath.second)) {
if(OsEng.renderEngine().scene()->sceneGraphNode(std::get<0>(seedPath.second)) != nullptr) return;
} else if (std::find(selectedOptions.begin(), selectedOptions.end(), seedPath.first)!=selectedOptions.end() && !std::get<2>(seedPath.second)) {
if (OsEng.renderEngine().scene()->sceneGraphNode(std::get<0>(seedPath.second)) != nullptr) {
return;
}
LDEBUG("Created fieldlines: " + std::get<0>(seedPath.second));
IswaManager::ref().createFieldline(std::get<0>(seedPath.second), _kwPath, std::get<1>(seedPath.second));
std::get<2>(seedPath.second) = true;
@@ -249,19 +275,23 @@ void KameleonPlane::updateFieldlineSeeds(){
}
}
void KameleonPlane::readFieldlinePaths(std::string indexFile){
void KameleonPlane::readFieldlinePaths(std::string indexFile) {
LINFO("Reading seed points paths from file '" << indexFile << "'");
if(_group){
std::dynamic_pointer_cast<IswaKameleonGroup>(_group)->setFieldlineInfo(indexFile, _kwPath);
if (_group) {
std::dynamic_pointer_cast<IswaKameleonGroup>(_group)->setFieldlineInfo(
indexFile,
_kwPath
);
return;
}
// Read the index file from disk
std::ifstream seedFile(indexFile);
if (!seedFile.good())
if (!seedFile.good()) {
LERROR("Could not open seed points file '" << indexFile << "'");
}
else {
try{
try {
//Parse and add each fieldline as an selection
json fieldlines = json::parse(seedFile);
int i = 0;
@@ -276,13 +306,13 @@ void KameleonPlane::readFieldlinePaths(std::string indexFile){
);
i++;
}
} catch(const std::exception& e) {
} catch (const std::exception& e) {
LERROR("Error when reading json file with paths to seedpoints: " + std::string(e.what()));
}
}
}
void KameleonPlane::subscribeToGroup(){
void KameleonPlane::subscribeToGroup() {
// Subscribe to DataCygnet events
DataCygnet::subscribeToGroup();
@@ -292,7 +322,7 @@ void KameleonPlane::subscribeToGroup(){
LDEBUG(name() + " Event resolutionChanged");
float resolution;
bool success = dict.getValue("resolution", resolution);
if(success){
if (success) {
_resolution.setValue(resolution);
}
});
@@ -301,25 +331,25 @@ void KameleonPlane::subscribeToGroup(){
LDEBUG(name() + " Event cdfChanged");
std::string path;
bool success = dict.getValue("path", path);
if(success){
if (success) {
changeKwPath(path);
}
updateTexture();
});
}
void KameleonPlane::setDimensions(){
void KameleonPlane::setDimensions() {
// the cdf files has an offset of 0.5 in normali resolution.
// with lower resolution the offset increases.
_data->offset = _origOffset - 0.5f*(100.0f/_resolution.value());
_dimensions = glm::size3_t(_data->scale*((float)_resolution.value()/100.f));
_dimensions[_cut] = 1;
if(_cut == 0){
if (_cut == 0) {
_textureDimensions = glm::size3_t(_dimensions.y, _dimensions.z, 1);
}else if(_cut == 1){
} else if(_cut == 1) {
_textureDimensions = glm::size3_t(_dimensions.x, _dimensions.z, 1);
}else{
} else {
_textureDimensions = glm::size3_t(_dimensions.x, _dimensions.y, 1);
}
}
@@ -328,4 +358,4 @@ void KameleonPlane::changeKwPath(std::string kwPath){
_kwPath = kwPath;
}
}// namespace openspace
}// namespace openspace
+14 -13
View File
@@ -33,7 +33,7 @@ namespace {
namespace openspace {
TextureCygnet::TextureCygnet(const ghoul::Dictionary& dictionary)
:IswaCygnet(dictionary)
: IswaCygnet(dictionary)
{
registerProperties();
}
@@ -41,7 +41,6 @@ TextureCygnet::TextureCygnet(const ghoul::Dictionary& dictionary)
TextureCygnet::~TextureCygnet() {}
bool TextureCygnet::updateTexture() {
std::unique_ptr<ghoul::opengl::Texture> texture = ghoul::io::TextureReader::ref().loadTexture(
(void*) _imageFile.buffer,
_imageFile.size,
@@ -58,17 +57,21 @@ bool TextureCygnet::updateTexture() {
return false;
}
bool TextureCygnet::downloadTextureResource(double timestamp){
if(_futureObject.valid())
bool TextureCygnet::downloadTextureResource(double timestamp) {
if (_futureObject.valid()) {
return false;
}
if(_textures.empty())
if (_textures.empty()) {
_textures.push_back(nullptr);
}
std::future<DownloadManager::MemoryFile> future = IswaManager::ref().fetchImageCygnet(_data->id, timestamp);
std::future<DownloadManager::MemoryFile> future = IswaManager::ref().fetchImageCygnet(
_data->id,
timestamp
);
if(future.valid()){
if (future.valid()) {
_futureObject = std::move(future);
return true;
}
@@ -83,9 +86,8 @@ bool TextureCygnet::updateTextureResource(){
if(_futureObject.valid() && DownloadManager::futureReady(_futureObject)){
imageFile = _futureObject.get();
if(imageFile.corrupted){
if(imageFile.buffer)
delete[] imageFile.buffer;
if (imageFile.corrupted) {
delete[] imageFile.buffer;
return false;
} else {
_imageFile = imageFile;
@@ -101,5 +103,4 @@ bool TextureCygnet::readyToRender() const {
return (isReady() && ((!_textures.empty()) && (_textures[0] != nullptr)));
}
} //namespace openspace
} //namespace openspace
+1 -1
View File
@@ -260,4 +260,4 @@ void DataProcessor::add(std::vector<std::vector<float>>& optionValues,
}
}
} // namespace
} // namespace
+1 -1
View File
@@ -181,4 +181,4 @@ int iswa_setBaseUrl(lua_State* L){
}// namespace luascriptfunctions
}// namespace openspace
}// namespace openspace
@@ -214,7 +214,4 @@ float KameleonVolumeReader::maxValue(const std::string & variable) const {
return _model->getVariableAttribute(variable, "actual_max").getAttributeFloat();
}
}
} // namespace openspace
+1 -1
View File
@@ -1,4 +1,4 @@
/*****************************************************************************************
/*****************************************************************************************
* *
* OpenSpace *
* *
+3 -3
View File
@@ -22,8 +22,8 @@
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#ifndef __OPENSPACE_TOUCH___INTERACTION___H__
#define __OPENSPACE_TOUCH___INTERACTION___H__
#ifndef __OPENSPACE_MODULE_TOUCH___TOUCH_INTERACTION___H__
#define __OPENSPACE_MODULE_TOUCH___TOUCH_INTERACTION___H__
#include <openspace/properties/propertyowner.h>
@@ -201,5 +201,5 @@ private:
} // openspace namespace
#endif // __OPENSPACE_TOUCH___INTERACTION___H__
#endif // __OPENSPACE_MODULE_TOUCH___TOUCH_INTERACTION___H__
+4 -4
View File
@@ -22,8 +22,8 @@
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#ifndef __OPENSPACE_TOUCH___MARKER___H__
#define __OPENSPACE_TOUCH___MARKER___H__
#ifndef __OPENSPACE_MODULE_TOUCH___TOUCH_MARKER___H__
#define __OPENSPACE_MODULE_TOUCH___TOUCH_MARKER___H__
#include <modules/touch/include/tuioear.h>
@@ -36,8 +36,8 @@
#include <openspace/properties/scalar/floatproperty.h>
#include <openspace/properties/vector/vec3property.h>
#include <ghoul/glm.h>
#include <glm/glm.hpp>
#include <memory>
#include <vector>
@@ -73,4 +73,4 @@ class TouchMarker : public properties::PropertyOwner {
} // openspace namespace
#endif // __OPENSPACE_TOUCH___MARKER___H__
#endif // __OPENSPACE_MODULE_TOUCH___TOUCH_MARKER___H__
+4 -4
View File
@@ -22,15 +22,15 @@
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#ifndef __OPENSPACE_MODULE_TOUCH___TOUCHEAR___H__
#define __OPENSPACE_MODULE_TOUCH___TOUCHEAR___H__
#ifndef __OPENSPACE_MODULE_TOUCH___TUIO_EAR___H__
#define __OPENSPACE_MODULE_TOUCH___TUIO_EAR___H__
#include <modules/touch/ext/libTUIO11/TUIO/TuioListener.h>
#include <modules/touch/ext/libTUIO11/TUIO/TuioClient.h>
#include <modules/touch/ext/libTUIO11/TUIO/UdpReceiver.h>
#include <modules/touch/ext/libTUIO11/TUIO/TcpReceiver.h>
#include <glm/glm.hpp>
#include <ghoul/glm.h>
#include <math.h>
#include <vector>
@@ -104,4 +104,4 @@ class TuioEar : public TUIO::TuioListener {
};
#endif // __OPENSPACE_MODULE_TOUCH___TOUCHWRAPPER___H__
#endif // __OPENSPACE_MODULE_TOUCH___TUIO_EAR___H__
+1 -1
View File
@@ -139,4 +139,4 @@ void TouchMarker::createVertexList(const std::vector<TUIO::TuioCursor>& list) {
);
}
} // openspace namespace
} // openspace namespace
+16 -5
View File
@@ -30,8 +30,20 @@
namespace openspace {
VolumeClipPlane::VolumeClipPlane(const ghoul::Dictionary& dictionary)
: _normal("normal", "Normal", glm::vec3(1.0, 0.0, 0.0), glm::vec3(-1.0), glm::vec3(1.0))
, _offsets("offsets", "Offsets", glm::vec2(-2.0, 0.0), glm::vec2(-2.0, 0.0), glm::vec2(2.0, 1.0))
: _normal(
"normal",
"Normal",
glm::vec3(1.f, 0.f, 0.f),
glm::vec3(-1.f),
glm::vec3(1.f)
)
, _offsets(
"offsets",
"Offsets",
glm::vec2(-2.f, 0.f),
glm::vec2(-2.f, 0.f),
glm::vec2(2.f, 1.f)
)
{
glm::vec3 normal;
glm::vec2 offsets;
@@ -42,8 +54,7 @@ VolumeClipPlane::VolumeClipPlane(const ghoul::Dictionary& dictionary)
_offsets = offsets;
}
void VolumeClipPlane::initialize()
{
void VolumeClipPlane::initialize() {
addProperty(_normal);
addProperty(_offsets);
}
@@ -56,4 +67,4 @@ glm::vec2 VolumeClipPlane::offsets() {
return _offsets;
}
} // namespace openspace
} // namespace openspace
-1
View File
@@ -8,7 +8,6 @@ return {
-- A regular 1280x720 window
SGCTConfig = sgct.config.single{},
-- SGCTConfig = "${CONFIG}/single.xml",
-- A regular 1920x1080 window
-- SGCTConfig = sgct.config.single{1920, 1080},
+80 -63
View File
@@ -33,84 +33,101 @@
const char* _loggerCat = "TransformationManager";
} // namespace
namespace openspace{
TransformationManager::TransformationManager(){
namespace openspace {
TransformationManager::TransformationManager(){
#ifdef OPENSPACE_MODULE_KAMELEON_ENABLED
_kameleon = std::make_shared<ccmc::Kameleon>();
_kameleon = std::make_shared<ccmc::Kameleon>();
#else
LWARNING("Kameleon module needed for transformations with dynamic frames");
LWARNING("Kameleon module needed for transformations with dynamic frames");
#endif
_kameleonFrames = { "J2000", "GEI", "GEO", "MAG", "GSE", "GSM", "SM", "RTN", "GSEQ", //geocentric
"HEE", "HAE", "HEEQ" //heliocentric
};
}
_kameleonFrames = {
"J2000", "GEI", "GEO", "MAG", "GSE", "GSM", "SM", "RTN", "GSEQ", //geocentric
"HEE", "HAE", "HEEQ" //heliocentric
};
}
TransformationManager::~TransformationManager(){
TransformationManager::~TransformationManager(){
#ifdef OPENSPACE_MODULE_KAMELEON_ENABLED
_kameleon = nullptr;
_kameleon = nullptr;
#endif
}
}
glm::dmat3 TransformationManager::kameleonTransformationMatrix( std::string from,
std::string to,
double ephemerisTime) const
{
glm::dmat3 TransformationManager::kameleonTransformationMatrix(std::string from,
std::string to,
double ephemerisTime) const
{
#ifdef OPENSPACE_MODULE_KAMELEON_ENABLED
ccmc::Position in0 = {1.f, 0.f, 0.f};
ccmc::Position in1 = {0.f, 1.f, 0.f};
ccmc::Position in2 = {0.f, 0.f, 1.f};
ccmc::Position in0 = {1.f, 0.f, 0.f};
ccmc::Position in1 = {0.f, 1.f, 0.f};
ccmc::Position in2 = {0.f, 0.f, 1.f};
ccmc::Position out0;
ccmc::Position out1;
ccmc::Position out2;
ccmc::Position out0;
ccmc::Position out1;
ccmc::Position out2;
_kameleon->_cxform(from.c_str(), to.c_str(), ephemerisTime, &in0, &out0);
_kameleon->_cxform(from.c_str(), to.c_str(), ephemerisTime, &in1, &out1);
_kameleon->_cxform(from.c_str(), to.c_str(), ephemerisTime, &in2, &out2);
_kameleon->_cxform(from.c_str(), to.c_str(), ephemerisTime, &in0, &out0);
_kameleon->_cxform(from.c_str(), to.c_str(), ephemerisTime, &in1, &out1);
_kameleon->_cxform(from.c_str(), to.c_str(), ephemerisTime, &in2, &out2);
return glm::dmat3(
out0.c0 , out0.c1 , out0.c2,
out1.c0 , out1.c1 , out1.c2,
out2.c0 , out2.c1 , out2.c2
);
return glm::dmat3(
out0.c0 , out0.c1 , out0.c2,
out1.c0 , out1.c1 , out1.c2,
out2.c0 , out2.c1 , out2.c2
);
#else
return glm::dmat3(0.0);
return glm::dmat3(0.0);
#endif
}
}
glm::dmat3 TransformationManager::frameTransformationMatrix(std::string from,
std::string to,
double ephemerisTime) const
{
glm::dmat3 TransformationManager::frameTransformationMatrix(std::string from,
std::string to,
double ephemerisTime) const
{
#ifdef OPENSPACE_MODULE_KAMELEON_ENABLED
auto fromit = _kameleonFrames.find(from);
auto toit = _kameleonFrames.find(to);
auto fromit = _kameleonFrames.find(from);
auto toit = _kameleonFrames.find(to);
bool fromKameleon = (fromit != _kameleonFrames.end());
bool toKameleon = (toit != _kameleonFrames.end());
bool fromKameleon = (fromit != _kameleonFrames.end());
bool toKameleon = (toit != _kameleonFrames.end());
if(!fromKameleon && !toKameleon){
return SpiceManager::ref().frameTransformationMatrix(from, to, ephemerisTime);
}
if(fromKameleon && toKameleon){
return kameleonTransformationMatrix(from, to, ephemerisTime);
}else if(fromKameleon && !toKameleon){
glm::dmat3 kameleonTransformation = kameleonTransformationMatrix(from, "J2000", ephemerisTime);
glm::dmat3 spiceTransformation = SpiceManager::ref().frameTransformationMatrix("J2000", to, ephemerisTime);
return spiceTransformation*kameleonTransformation;
}else if(!fromKameleon && toKameleon){
glm::dmat3 spiceTransformation = SpiceManager::ref().frameTransformationMatrix(from, "J2000", ephemerisTime);
glm::dmat3 kameleonTransformation = kameleonTransformationMatrix("J2000", to, ephemerisTime);
return kameleonTransformation*spiceTransformation;
}
#else
LERROR("Can not transform dynamic frames without kameleon module enabled");
#endif
return glm::dmat3(1.0);
if (!fromKameleon && !toKameleon) {
return SpiceManager::ref().frameTransformationMatrix(from, to, ephemerisTime);
}
}
if (fromKameleon && toKameleon) {
return kameleonTransformationMatrix(from, to, ephemerisTime);
} else if (fromKameleon && !toKameleon) {
glm::dmat3 kameleonTransformation = kameleonTransformationMatrix(
from,
"J2000",
ephemerisTime
);
glm::dmat3 spiceTransformation = SpiceManager::ref().frameTransformationMatrix(
"J2000",
to,
ephemerisTime
);
return spiceTransformation*kameleonTransformation;
} else if (!fromKameleon && toKameleon) {
glm::dmat3 spiceTransformation = SpiceManager::ref().frameTransformationMatrix(
from,
"J2000",
ephemerisTime
);
glm::dmat3 kameleonTransformation = kameleonTransformationMatrix(
"J2000",
to,
ephemerisTime
);
return kameleonTransformation*spiceTransformation;
}
#else
LERROR("Can not transform dynamic frames without kameleon module enabled");
#endif
return glm::dmat3(1.0);
}
} // namespace openspace
+27 -3
View File
@@ -268,6 +268,13 @@ def check_using_namespace(lines):
def check_end_of_line(lines):
if lines[-1][-1] != '\n':
return lines[-1][-1]
else:
return ''
previousSymbols = {}
def check_header_file(file, component):
with open(file, 'r+') as f:
@@ -313,6 +320,11 @@ def check_header_file(file, component):
print(file, '\t', 'Naming convention broken', '\t', naming_subcomponent)
return
end_of_line = check_end_of_line(lines)
if end_of_line:
print(file, '\t', 'Last line does not contain a newline character: ', end_of_line)
return
duplicates, symbol = check_duplicates(lines, previousSymbols)
if not duplicates:
print(file, '\t', 'Duplicate include guard', symbol, 'first in', previousSymbols[symbol])
@@ -329,9 +341,11 @@ def check_header_file(file, component):
if core_dependency:
print(file, '\t', 'Wrong dependency (core depends on module)', core_dependency)
using_namespaces = check_using_namespace(lines)
if using_namespaces:
print(file, '\t', 'Using namespace found in header file')
if (not 'ghoul_gl.h' in file):
# ghoul_gl.h is allowed to use 'using namespace' to pull the gl namespace in
using_namespaces = check_using_namespace(lines)
if using_namespaces:
print(file, '\t', 'Using namespace found in header file')
bom = check_byte_order_mark_character(lines)
if bom:
@@ -355,6 +369,11 @@ def check_inline_file(file, component):
if core_dependency:
print(file, '\t', 'Wrong dependency (core depends on module)', core_dependency)
end_of_line = check_end_of_line(lines)
if end_of_line:
print(file, '\t', 'Last line does not contain a newline character: ', end_of_line)
return
bom = check_byte_order_mark_character(lines)
if bom:
print(file, '\t', 'Byte order mark failed:', bom)
@@ -380,6 +399,11 @@ def check_source_file(file, component):
if core_dependency:
print(file, '\t' 'Wrong core dependency', core_dependency)
end_of_line = check_end_of_line(lines)
if end_of_line:
print(file, '\t', 'Last line does not contain a newline character: ', end_of_line)
return
copyright = check_copyright(lines)
if copyright:
print(file, '\t', 'Copyright check failed', '\t', copyright)