mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-05 02:20:11 -05:00
Feature/CMake (#1443)
General CMake cleanup/overhaul * Enable precompiled headers for all projects * Move specifications itto separate CMakeLists files * Add openspace-core as a subdirectory * Move handle_modules functionality into modules/CMakeLists.txt * Move handleapplications logic into apps/CMakeLists.txt * Introduce openspace-module-collection interface library to simplify inclusion of modules in applications * Turn module initialization into a two-step process to adapt to the new minimal dependency scenario * Compile time speedup * Remove circular dependencies between modules and core preventing multithreaded compilation on MSVC * Build Spice multithreaded and as static library * Remove dependency from core to module-webbrowser * Remove unused dependency from kameleon * Remove additional unnecessary dependencies * Cleanup volume/kameleon/kameleonvolume modules * Fix visibility issues. Restrict include paths * Compile kameleon in parallel * Other cleanup * Only copy CEF files from one target (hard-coded to OpenSpace right now) * Remove unused instrumentation code * Remove the ability to render AABB for globes as it caused a circular dependency between GlobeBrowsing and Debugging * Removing compiler and cppcheck warnings * Turn almost all includes into non-system includes * Don't warn on deprecrated copy * Updated submodules
This commit is contained in:
@@ -25,49 +25,49 @@
|
||||
include(${OPENSPACE_CMAKE_EXT_DIR}/module_definition.cmake)
|
||||
|
||||
set(HEADER_FILES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/rendering/planetgeometry.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderableconstellationbounds.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablerings.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderableorbitalkepler.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablesatellites.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablesmallbody.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablestars.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/rendering/simplespheregeometry.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/translation/keplertranslation.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/translation/spicetranslation.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/translation/tletranslation.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/translation/horizonstranslation.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/rotation/spicerotation.h
|
||||
rendering/planetgeometry.h
|
||||
rendering/renderableconstellationbounds.h
|
||||
rendering/renderablerings.h
|
||||
rendering/renderableorbitalkepler.h
|
||||
rendering/renderablesatellites.h
|
||||
rendering/renderablesmallbody.h
|
||||
rendering/renderablestars.h
|
||||
rendering/simplespheregeometry.h
|
||||
translation/keplertranslation.h
|
||||
translation/spicetranslation.h
|
||||
translation/tletranslation.h
|
||||
translation/horizonstranslation.h
|
||||
rotation/spicerotation.h
|
||||
)
|
||||
source_group("Header Files" FILES ${HEADER_FILES})
|
||||
|
||||
set(SOURCE_FILES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/rendering/planetgeometry.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderableconstellationbounds.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablerings.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderableorbitalkepler.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablesatellites.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablesmallbody.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderablestars.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/rendering/simplespheregeometry.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/translation/keplertranslation.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/translation/spicetranslation.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/translation/tletranslation.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/translation/horizonstranslation.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/rotation/spicerotation.cpp
|
||||
rendering/planetgeometry.cpp
|
||||
rendering/renderableconstellationbounds.cpp
|
||||
rendering/renderablerings.cpp
|
||||
rendering/renderableorbitalkepler.cpp
|
||||
rendering/renderablesatellites.cpp
|
||||
rendering/renderablesmallbody.cpp
|
||||
rendering/renderablestars.cpp
|
||||
rendering/simplespheregeometry.cpp
|
||||
translation/keplertranslation.cpp
|
||||
translation/spicetranslation.cpp
|
||||
translation/tletranslation.cpp
|
||||
translation/horizonstranslation.cpp
|
||||
rotation/spicerotation.cpp
|
||||
)
|
||||
source_group("Source Files" FILES ${SOURCE_FILES})
|
||||
|
||||
set(SHADER_FILES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/shaders/constellationbounds_fs.glsl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/shaders/constellationbounds_vs.glsl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/shaders/debrisViz_fs.glsl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/shaders/debrisViz_vs.glsl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/shaders/rings_vs.glsl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/shaders/rings_fs.glsl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/shaders/star_fs.glsl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/shaders/star_ge.glsl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/shaders/star_vs.glsl
|
||||
shaders/constellationbounds_fs.glsl
|
||||
shaders/constellationbounds_vs.glsl
|
||||
shaders/debrisViz_fs.glsl
|
||||
shaders/debrisViz_vs.glsl
|
||||
shaders/rings_vs.glsl
|
||||
shaders/rings_fs.glsl
|
||||
shaders/star_fs.glsl
|
||||
shaders/star_ge.glsl
|
||||
shaders/star_vs.glsl
|
||||
)
|
||||
source_group("Shader Files" FILES ${SHADER_FILES})
|
||||
|
||||
|
||||
@@ -185,8 +185,6 @@ void RenderableSmallBody::readDataFile(const std::string& filename) {
|
||||
std::string line;
|
||||
unsigned int csvLine = 0;
|
||||
int fieldCount = 0;
|
||||
float lineSkipFraction = 1.0;
|
||||
int lastLineCount = -1;
|
||||
const std::string expectedHeaderLine = "full_name,epoch_cal,e,a,i,om,w,ma,per";
|
||||
|
||||
try {
|
||||
@@ -197,6 +195,7 @@ void RenderableSmallBody::readDataFile(const std::string& filename) {
|
||||
}
|
||||
_numObjects = numberOfLines;
|
||||
|
||||
float lineSkipFraction = 1.0;
|
||||
if (!_isFileReadinitialized) {
|
||||
_isFileReadinitialized = true;
|
||||
initializeFileReading();
|
||||
@@ -230,6 +229,7 @@ void RenderableSmallBody::readDataFile(const std::string& filename) {
|
||||
skipSingleLineInFile(file);
|
||||
}
|
||||
bool firstDataLine = true;
|
||||
int lastLineCount = -1;
|
||||
for (csvLine = _startRenderIdx + 1;
|
||||
csvLine <= endElement + 1;
|
||||
csvLine++, sequentialLineErrors++)
|
||||
@@ -258,8 +258,8 @@ void RenderableSmallBody::readDataFile(const std::string& filename) {
|
||||
fieldCount, csvLine + 1, numberOfLines, filename
|
||||
));
|
||||
}
|
||||
catch (std::ios_base::failure& f) {
|
||||
throw f;
|
||||
catch (std::ios_base::failure&) {
|
||||
throw;
|
||||
}
|
||||
|
||||
if (sequentialLineErrors == 4) {
|
||||
|
||||
@@ -46,7 +46,7 @@ public:
|
||||
private:
|
||||
void readOrbitalParamsFromThisLine(bool firstDataLine, int& fieldCount,
|
||||
unsigned int& csvLine, std::ifstream& file);
|
||||
void readDataFile(const std::string& filename);
|
||||
virtual void readDataFile(const std::string& filename) override;
|
||||
void initializeFileReading();
|
||||
void skipSingleLineInFile(std::ifstream& file);
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace {
|
||||
|
||||
constexpr double PARSEC = 0.308567756E17;
|
||||
|
||||
struct CommonDataLayout {
|
||||
struct ColorVBOLayout {
|
||||
std::array<float, 3> position;
|
||||
float value;
|
||||
float luminance;
|
||||
@@ -81,19 +81,35 @@ namespace {
|
||||
float apparentMagnitude;
|
||||
};
|
||||
|
||||
struct ColorVBOLayout : public CommonDataLayout {};
|
||||
struct VelocityVBOLayout {
|
||||
std::array<float, 3> position;
|
||||
float value;
|
||||
float luminance;
|
||||
float absoluteMagnitude;
|
||||
float apparentMagnitude;
|
||||
|
||||
struct VelocityVBOLayout : public CommonDataLayout {
|
||||
float vx; // v_x
|
||||
float vy; // v_y
|
||||
float vz; // v_z
|
||||
};
|
||||
|
||||
struct SpeedVBOLayout : public CommonDataLayout {
|
||||
struct SpeedVBOLayout {
|
||||
std::array<float, 3> position;
|
||||
float value;
|
||||
float luminance;
|
||||
float absoluteMagnitude;
|
||||
float apparentMagnitude;
|
||||
|
||||
float speed;
|
||||
};
|
||||
|
||||
struct OtherDataLayout : public CommonDataLayout {};
|
||||
struct OtherDataLayout {
|
||||
std::array<float, 3> position;
|
||||
float value;
|
||||
float luminance;
|
||||
float absoluteMagnitude;
|
||||
float apparentMagnitude;
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo SpeckFileInfo = {
|
||||
"SpeckFile",
|
||||
|
||||
@@ -176,16 +176,9 @@ void HorizonsTranslation::readHorizonsTextFile() {
|
||||
return;
|
||||
}
|
||||
|
||||
// The beginning of a Horizons file has a header with a lot of information about the
|
||||
// query that we do not care about. Ignore everything until data starts, including
|
||||
// the row marked by $$SOE (i.e. Start Of Ephemerides).
|
||||
std::string line;
|
||||
while (line[0] != '$') {
|
||||
std::getline(fileStream, line);
|
||||
}
|
||||
|
||||
// Read data line by line until $$EOE (i.e. End Of Ephemerides).
|
||||
// Skip the rest of the file.
|
||||
std::string line;
|
||||
std::getline(fileStream, line);
|
||||
while (line[0] != '$') {
|
||||
std::stringstream str(line);
|
||||
|
||||
@@ -34,11 +34,10 @@ namespace {
|
||||
|
||||
template <typename T, typename Func>
|
||||
T solveIteration(const Func& function, T x0, const T& err = 0.0, int maxIter = 100) {
|
||||
T x = 0;
|
||||
T x2 = x0;
|
||||
|
||||
for (int i = 0; i < maxIter; ++i) {
|
||||
x = x2;
|
||||
T x = x2;
|
||||
x2 = function(x);
|
||||
if (std::abs(x2 - x) < err) {
|
||||
return x2;
|
||||
|
||||
Reference in New Issue
Block a user