mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-05 19:09:23 -05:00
Enable warnings for missing case labels and subsequent cleanup. Updated ghoul, sgct, and codegen repository for same
This commit is contained in:
+1
-1
Submodule apps/OpenSpace/ext/sgct updated: cfd94f0e6a...d0003e83eb
+1
-1
Submodule ext/ghoul updated: 16d676f1d9...84675b277a
@@ -292,8 +292,6 @@ RenderableLabel::RenderableLabel(const ghoul::Dictionary& dictionary)
|
||||
case BlendMode::Additive:
|
||||
setRenderBin(Renderable::RenderBin::PreDeferredTransparent);
|
||||
break;
|
||||
default:
|
||||
throw ghoul::MissingCaseException();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -505,37 +503,37 @@ float RenderableLabel::computeFadeFactor(float distanceNodeToCamera) const {
|
||||
|
||||
float RenderableLabel::unit(int unit) const {
|
||||
switch (static_cast<Unit>(unit)) {
|
||||
case Meter: return 1.f;
|
||||
case Kilometer: return 1e3f;
|
||||
case Megameter: return 1e6f;
|
||||
case Gigameter: return 1e9f;
|
||||
case Meter: return 1.f;
|
||||
case Kilometer: return 1e3f;
|
||||
case Megameter: return 1e6f;
|
||||
case Gigameter: return 1e9f;
|
||||
case AstronomicalUnit: return 149597870700.f;
|
||||
case Terameter: return 1e12f;
|
||||
case Petameter: return 1e15f;
|
||||
case Parsec: return static_cast<float>(PARSEC);
|
||||
case KiloParsec: return static_cast<float>(1e3 * PARSEC);
|
||||
case MegaParsec: return static_cast<float>(1e6 * PARSEC);
|
||||
case GigaParsec: return static_cast<float>(1e9 * PARSEC);
|
||||
case GigaLightyear: return static_cast<float>(306391534.73091 * PARSEC);
|
||||
default: throw std::logic_error("Missing case label");
|
||||
case Terameter: return 1e12f;
|
||||
case Petameter: return 1e15f;
|
||||
case Parsec: return static_cast<float>(PARSEC);
|
||||
case KiloParsec: return static_cast<float>(1e3 * PARSEC);
|
||||
case MegaParsec: return static_cast<float>(1e6 * PARSEC);
|
||||
case GigaParsec: return static_cast<float>(1e9 * PARSEC);
|
||||
case GigaLightyear: return static_cast<float>(306391534.73091 * PARSEC);
|
||||
default: throw ghoul::MissingCaseException();
|
||||
}
|
||||
}
|
||||
|
||||
std::string_view RenderableLabel::toString(int unit) const {
|
||||
switch (static_cast<Unit>(unit)) {
|
||||
case Meter: return MeterUnit;
|
||||
case Kilometer: return KilometerUnit;
|
||||
case Megameter: return MegameterUnit;
|
||||
case Gigameter: return GigameterUnit;
|
||||
case Meter: return MeterUnit;
|
||||
case Kilometer: return KilometerUnit;
|
||||
case Megameter: return MegameterUnit;
|
||||
case Gigameter: return GigameterUnit;
|
||||
case AstronomicalUnit: return AstronomicalUnitUnit;
|
||||
case Terameter: return TerameterUnit;
|
||||
case Petameter: return PetameterUnit;
|
||||
case Parsec: return ParsecUnit;
|
||||
case KiloParsec: return KiloparsecUnit;
|
||||
case MegaParsec: return MegaparsecUnit;
|
||||
case GigaParsec: return GigaparsecUnit;
|
||||
case GigaLightyear: return GigalightyearUnit;
|
||||
default: throw std::logic_error("Missing case label");
|
||||
case Terameter: return TerameterUnit;
|
||||
case Petameter: return PetameterUnit;
|
||||
case Parsec: return ParsecUnit;
|
||||
case KiloParsec: return KiloparsecUnit;
|
||||
case MegaParsec: return MegaparsecUnit;
|
||||
case GigaParsec: return GigaparsecUnit;
|
||||
case GigaLightyear: return GigalightyearUnit;
|
||||
default: throw ghoul::MissingCaseException();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -430,8 +430,6 @@ RenderableModel::RenderableModel(const ghoul::Dictionary& dictionary)
|
||||
case Parameters::AnimationMode::Once:
|
||||
_animationMode = AnimationMode::Once;
|
||||
break;
|
||||
default:
|
||||
throw ghoul::MissingCaseException();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1048,7 +1046,7 @@ void RenderableModel::update(const UpdateData& data) {
|
||||
|
||||
|
||||
if (_geometry->hasAnimation() && !_animationStart.empty()) {
|
||||
double relativeTime;
|
||||
double relativeTime = 0.0;
|
||||
double now = data.time.j2000Seconds();
|
||||
double startTime = data.time.convertTime(_animationStart);
|
||||
double duration = _geometry->animationDuration();
|
||||
@@ -1109,8 +1107,6 @@ void RenderableModel::update(const UpdateData& data) {
|
||||
relativeTime = duration;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw ghoul::MissingCaseException();
|
||||
}
|
||||
_geometry->update(relativeTime);
|
||||
}
|
||||
|
||||
@@ -156,15 +156,14 @@ RenderablePlane::RenderablePlane(const ghoul::Dictionary& dictionary)
|
||||
{ static_cast<int>(BlendMode::Additive), "Additive"}
|
||||
});
|
||||
_blendMode.onChange([this]() {
|
||||
switch (_blendMode) {
|
||||
case static_cast<int>(BlendMode::Normal):
|
||||
BlendMode m = static_cast<BlendMode>(_blendMode.value());
|
||||
switch (m) {
|
||||
case BlendMode::Normal:
|
||||
setRenderBinFromOpacity();
|
||||
break;
|
||||
case static_cast<int>(BlendMode::Additive):
|
||||
case BlendMode::Additive:
|
||||
setRenderBin(Renderable::RenderBin::PreDeferredTransparent);
|
||||
break;
|
||||
default:
|
||||
throw ghoul::MissingCaseException();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -266,15 +266,14 @@ RenderablePlanesCloud::RenderablePlanesCloud(const ghoul::Dictionary& dictionary
|
||||
{ BlendModeAdditive, "Additive" }
|
||||
});
|
||||
_blendMode.onChange([this]() {
|
||||
switch (_blendMode) {
|
||||
BlendMode m = static_cast<BlendMode>(_blendMode.value());
|
||||
switch (m) {
|
||||
case BlendModeNormal:
|
||||
setRenderBin(Renderable::RenderBin::Opaque);
|
||||
break;
|
||||
case BlendModeAdditive:
|
||||
setRenderBin(Renderable::RenderBin::PreDeferredTransparent);
|
||||
break;
|
||||
default:
|
||||
throw ghoul::MissingCaseException();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -359,8 +359,6 @@ void RenderableFieldlines::loadSeedPoints() {
|
||||
case SeedPointSourceTable:
|
||||
loadSeedPointsFromTable();
|
||||
break;
|
||||
default:
|
||||
throw ghoul::MissingCaseException();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -106,10 +106,10 @@ Geodetic2 GeodeticPatch::size() const {
|
||||
|
||||
Geodetic2 GeodeticPatch::corner(Quad q) const {
|
||||
switch (q) {
|
||||
case NORTH_WEST: return Geodetic2{ maxLat(), minLon() };// northWestCorner();
|
||||
case NORTH_EAST: return Geodetic2{ maxLat(), maxLon() };// northEastCorner();
|
||||
case SOUTH_WEST: return Geodetic2{ minLat(), minLon() };// southWestCorner();
|
||||
case SOUTH_EAST: return Geodetic2{ minLat(), maxLon() };// southEastCorner();
|
||||
case NORTH_WEST: return Geodetic2{ maxLat(), minLon() }; // northWestCorner();
|
||||
case NORTH_EAST: return Geodetic2{ maxLat(), maxLon() }; // northEastCorner();
|
||||
case SOUTH_WEST: return Geodetic2{ minLat(), minLon() }; // southWestCorner();
|
||||
case SOUTH_EAST: return Geodetic2{ minLat(), maxLon() }; // southEastCorner();
|
||||
default: throw ghoul::MissingCaseException();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,8 +99,6 @@ void GPULayerGroup::setValue(ghoul::opengl::ProgramObject& program,
|
||||
case layers::Layer::ID::SolidColor:
|
||||
program.setUniform(galuc.color, al.solidColor());
|
||||
break;
|
||||
default:
|
||||
throw ghoul::MissingCaseException();
|
||||
}
|
||||
|
||||
if (gal.isHeightLayer) {
|
||||
@@ -165,8 +163,6 @@ void GPULayerGroup::bind(ghoul::opengl::ProgramObject& p, const LayerGroup& laye
|
||||
case layers::Layer::ID::SolidColor:
|
||||
galuc.color = p.uniformLocation(name + "color");
|
||||
break;
|
||||
default:
|
||||
throw ghoul::MissingCaseException();
|
||||
}
|
||||
|
||||
if (gal.isHeightLayer) {
|
||||
|
||||
@@ -209,16 +209,10 @@ Layer::Layer(layers::Group::ID id, const ghoul::Dictionary& layerDict, LayerGrou
|
||||
{
|
||||
const Parameters p = codegen::bake<Parameters>(layerDict);
|
||||
|
||||
layers::Layer::ID typeID;
|
||||
if (p.type.has_value()) {
|
||||
typeID = ghoul::from_string<layers::Layer::ID>(*p.type);
|
||||
if (typeID == layers::Layer::ID::Unknown) {
|
||||
throw ghoul::RuntimeError("Unknown layer type");
|
||||
}
|
||||
}
|
||||
else {
|
||||
typeID = layers::Layer::ID::DefaultTileProvider;
|
||||
}
|
||||
layers::Layer::ID typeID =
|
||||
p.type.has_value() ?
|
||||
ghoul::from_string<layers::Layer::ID>(*p.type) :
|
||||
layers::Layer::ID::DefaultTileProvider;
|
||||
|
||||
initializeBasedOnType(typeID, layerDict);
|
||||
|
||||
@@ -330,8 +324,6 @@ Layer::Layer(layers::Group::ID id, const ghoul::Dictionary& layerDict, LayerGrou
|
||||
case layers::Layer::ID::SolidColor:
|
||||
removeProperty(_solidColor);
|
||||
break;
|
||||
default:
|
||||
throw ghoul::MissingCaseException();
|
||||
}
|
||||
|
||||
_typeId = static_cast<layers::Layer::ID>(_typeOption.value());
|
||||
@@ -502,8 +494,6 @@ void Layer::initializeBasedOnType(layers::Layer::ID id, ghoul::Dictionary initDi
|
||||
_solidColor = initDict.value<glm::dvec3>(ColorInfo.identifier);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw ghoul::MissingCaseException();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -527,8 +517,6 @@ void Layer::addVisibleProperties() {
|
||||
case layers::Layer::ID::SolidColor:
|
||||
addProperty(_solidColor);
|
||||
break;
|
||||
default:
|
||||
throw ghoul::MissingCaseException();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -126,8 +126,6 @@ void LayerAdjustment::setValuesFromDictionary(const ghoul::Dictionary& adjustmen
|
||||
case Parameters::Type::TransferFunction:
|
||||
_typeOption = static_cast<int>(layers::Adjustment::ID::TransferFunction);
|
||||
break;
|
||||
default:
|
||||
throw ghoul::MissingCaseException();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -88,8 +88,7 @@ struct Layer {
|
||||
TileProviderByLevel,
|
||||
SolidColor,
|
||||
SpoutImageProvider,
|
||||
VideoTileProvider,
|
||||
Unknown
|
||||
VideoTileProvider
|
||||
};
|
||||
|
||||
ID id;
|
||||
@@ -206,9 +205,15 @@ constexpr openspace::globebrowsing::layers::Layer::ID from_string(std::string_vi
|
||||
return li.identifier == string;
|
||||
}
|
||||
);
|
||||
return it != openspace::globebrowsing::layers::Layers.end() ?
|
||||
it->id :
|
||||
openspace::globebrowsing::layers::Layer::ID::Unknown;
|
||||
|
||||
if (it != openspace::globebrowsing::layers::Layers.end()) {
|
||||
return it->id;
|
||||
}
|
||||
else {
|
||||
throw ghoul::RuntimeError(fmt::format(
|
||||
"Could not find Layer of type '{}'", string
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
template <>
|
||||
@@ -221,9 +226,15 @@ constexpr openspace::globebrowsing::layers::Group::ID from_string(std::string_vi
|
||||
return gi.identifier == string;
|
||||
}
|
||||
);
|
||||
return it != openspace::globebrowsing::layers::Groups.end() ?
|
||||
it->id :
|
||||
openspace::globebrowsing::layers::Group::ID::Unknown;
|
||||
|
||||
if (it != openspace::globebrowsing::layers::Groups.end()) {
|
||||
return it->id;
|
||||
}
|
||||
else {
|
||||
throw ghoul::RuntimeError(fmt::format(
|
||||
"Could not find Group of type '{}'", string
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
template <>
|
||||
|
||||
@@ -109,9 +109,12 @@ GDALDataType toGDALDataType(GLenum glType) {
|
||||
case GL_DOUBLE:
|
||||
return GDT_Float64;
|
||||
default:
|
||||
LERRORC("GDALRawTileDataReader", fmt::format(
|
||||
"OpenGL data type unknown to GDAL: {}", static_cast<int>(glType)
|
||||
));
|
||||
LERRORC(
|
||||
"GDALRawTileDataReader",
|
||||
fmt::format(
|
||||
"OpenGL data type unknown to GDAL: {}", static_cast<int>(glType)
|
||||
)
|
||||
);
|
||||
throw ghoul::MissingCaseException();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -452,7 +452,8 @@ DefaultTileProvider* TemporalTileProvider::retrieveTileProvider(const Time& t) {
|
||||
);
|
||||
return std::string_view(it->second);
|
||||
}
|
||||
default: throw ghoul::MissingCaseException();
|
||||
default:
|
||||
throw ghoul::MissingCaseException();
|
||||
};
|
||||
}();
|
||||
|
||||
@@ -650,7 +651,8 @@ TileProvider* TemporalTileProvider::tileProvider(const Time& time) {
|
||||
return tileProvider<Mode::Folder, true>(time);
|
||||
case Mode::Prototype:
|
||||
return tileProvider<Mode::Prototype, true>(time);
|
||||
default: throw ghoul::MissingCaseException();
|
||||
default:
|
||||
throw ghoul::MissingCaseException();
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -659,7 +661,8 @@ TileProvider* TemporalTileProvider::tileProvider(const Time& time) {
|
||||
return tileProvider<Mode::Folder, false>(time);
|
||||
case Mode::Prototype:
|
||||
return tileProvider<Mode::Prototype, false>(time);
|
||||
default: throw ghoul::MissingCaseException();
|
||||
default:
|
||||
throw ghoul::MissingCaseException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,10 +73,6 @@ TileProviderByIndex::TileProviderByIndex(const ghoul::Dictionary& dictionary) {
|
||||
if (p.defaultProvider.hasValue<std::string>("Type")) {
|
||||
std::string type = p.defaultProvider.value<std::string>("Type");
|
||||
typeID = ghoul::from_string<layers::Layer::ID>(type);
|
||||
|
||||
if (typeID == layers::Layer::ID::Unknown) {
|
||||
throw ghoul::RuntimeError("Unknown layer type: " + type);
|
||||
}
|
||||
}
|
||||
|
||||
_defaultTileProvider = createFromDictionary(typeID, p.defaultProvider);
|
||||
@@ -92,10 +88,6 @@ TileProviderByIndex::TileProviderByIndex(const ghoul::Dictionary& dictionary) {
|
||||
if (ip.tileProvider.hasValue<std::string>("Type")) {
|
||||
std::string type = ip.tileProvider.value<std::string>("Type");
|
||||
providerID = ghoul::from_string<layers::Layer::ID>(type);
|
||||
|
||||
if (providerID == layers::Layer::ID::Unknown) {
|
||||
throw ghoul::RuntimeError("Unknown layer type: " + type);
|
||||
}
|
||||
}
|
||||
|
||||
std::unique_ptr<TileProvider> stp = createFromDictionary(
|
||||
|
||||
@@ -67,10 +67,6 @@ TileProviderByLevel::TileProviderByLevel(const ghoul::Dictionary& dictionary) {
|
||||
if (tileProviderDict.hasValue<std::string>("Type")) {
|
||||
std::string type = tileProviderDict.value<std::string>("Type");
|
||||
typeID = ghoul::from_string<layers::Layer::ID>(type);
|
||||
|
||||
if (typeID == layers::Layer::ID::Unknown) {
|
||||
throw ghoul::RuntimeError("Unknown layer type: " + type);
|
||||
}
|
||||
}
|
||||
|
||||
std::unique_ptr<TileProvider> tp = createFromDictionary(typeID, tileProviderDict);
|
||||
|
||||
@@ -39,7 +39,6 @@ size_t numberOfRasters(ghoul::opengl::Texture::Format format) {
|
||||
case ghoul::opengl::Texture::Format::BGRA:
|
||||
return 4;
|
||||
default:
|
||||
ghoul_assert(false, "Unknown format");
|
||||
throw ghoul::MissingCaseException();
|
||||
}
|
||||
}
|
||||
@@ -56,7 +55,6 @@ size_t numberOfBytes(GLenum glType) {
|
||||
case GL_FLOAT: return sizeof(GLfloat);
|
||||
case GL_DOUBLE: return sizeof(GLdouble);
|
||||
default:
|
||||
ghoul_assert(false, "Unknown data type");
|
||||
throw ghoul::MissingCaseException();
|
||||
}
|
||||
}
|
||||
@@ -151,9 +149,8 @@ TileTextureInitData tileTextureInitData(layers::Group::ID id,
|
||||
ghoul::opengl::Texture::Format::BGRA
|
||||
);
|
||||
}
|
||||
default: {
|
||||
default:
|
||||
throw ghoul::MissingCaseException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -101,8 +101,6 @@ void EngineModeTopic::sendJsonData() {
|
||||
case OpenSpaceEngine::Mode::CameraPath:
|
||||
modeString = "camera_path";
|
||||
break;
|
||||
default:
|
||||
throw ghoul::MissingCaseException();
|
||||
}
|
||||
stateJson["mode"] = modeString;
|
||||
|
||||
|
||||
@@ -92,8 +92,8 @@ std::string constructHorizonsUrl(HorizonsType type, const std::string& target,
|
||||
case HorizonsType::Observer:
|
||||
url = ObserverUrl;
|
||||
break;
|
||||
default:
|
||||
throw ghoul::MissingCaseException();
|
||||
case HorizonsType::Invalid:
|
||||
break;
|
||||
}
|
||||
|
||||
url += fmt::format(
|
||||
|
||||
@@ -756,8 +756,6 @@ std::vector<Parameters> readFile(std::filesystem::path file, Format format) {
|
||||
case Format::SBDB:
|
||||
res = readSbdbFile(file);
|
||||
break;
|
||||
default:
|
||||
throw ghoul::MissingCaseException();
|
||||
}
|
||||
|
||||
LINFO(fmt::format("Saving cache {} for Kepler file {}", cachedFile, file));
|
||||
|
||||
@@ -266,15 +266,12 @@ VideoPlayer::VideoPlayer(const ghoul::Dictionary& dictionary)
|
||||
|
||||
if (p.playbackMode.has_value()) {
|
||||
switch (*p.playbackMode) {
|
||||
case Parameters::PlaybackMode::RealTimeLoop:
|
||||
_playbackMode = PlaybackMode::RealTimeLoop;
|
||||
break;
|
||||
case Parameters::PlaybackMode::MapToSimulationTime:
|
||||
_playbackMode = PlaybackMode::MapToSimulationTime;
|
||||
break;
|
||||
default:
|
||||
LERROR("Missing playback mode in VideoTileProvider");
|
||||
throw ghoul::MissingCaseException();
|
||||
case Parameters::PlaybackMode::RealTimeLoop:
|
||||
_playbackMode = PlaybackMode::RealTimeLoop;
|
||||
break;
|
||||
case Parameters::PlaybackMode::MapToSimulationTime:
|
||||
_playbackMode = PlaybackMode::MapToSimulationTime;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -107,7 +107,8 @@ void log(int i, const EventCameraFocusTransition& e) {
|
||||
return "Receding";
|
||||
case EventCameraFocusTransition::Transition::Exiting:
|
||||
return "Exiting";
|
||||
default: throw ghoul::MissingCaseException();
|
||||
default:
|
||||
throw ghoul::MissingCaseException();
|
||||
}
|
||||
}(e.transition);
|
||||
|
||||
@@ -349,8 +350,6 @@ ghoul::Dictionary toParameter(const Event& e) {
|
||||
case EventParallelConnection::State::HostshipLost:
|
||||
d.setValue("State", "HostshipLost"s);
|
||||
break;
|
||||
default:
|
||||
throw ghoul::MissingCaseException();
|
||||
}
|
||||
break;
|
||||
case Event::Type::ApplicationShutdown:
|
||||
@@ -400,8 +399,6 @@ ghoul::Dictionary toParameter(const Event& e) {
|
||||
case EventCameraFocusTransition::Transition::Exiting:
|
||||
d.setValue("Transition", "Exiting"s);
|
||||
break;
|
||||
default:
|
||||
throw ghoul::MissingCaseException();
|
||||
}
|
||||
break;
|
||||
case Event::Type::PlanetEclipsed:
|
||||
@@ -592,11 +589,12 @@ void logAllEvents(const Event* e) {
|
||||
case Event::Type::CameraPathFinished:
|
||||
log(i, *static_cast<const EventCameraPathFinished*>(e));
|
||||
break;
|
||||
case Event::Type::CameraMovedPosition:
|
||||
log(i, *static_cast<const EventCameraMovedPosition*>(e));
|
||||
break;
|
||||
case Event::Type::Custom:
|
||||
log(i, *static_cast<const CustomEvent*>(e));
|
||||
break;
|
||||
default:
|
||||
throw ghoul::MissingCaseException();
|
||||
}
|
||||
|
||||
i++;
|
||||
|
||||
@@ -1634,14 +1634,10 @@ void OrbitalNavigator::rotateAroundAnchorUp(double deltaTime, double speedScale,
|
||||
{
|
||||
const glm::dvec3 axis = [](UpDirectionChoice upAxis) {
|
||||
switch (upAxis) {
|
||||
case UpDirectionChoice::XAxis:
|
||||
return glm::dvec3(1.0, 0.0, 0.0);
|
||||
case UpDirectionChoice::YAxis:
|
||||
return glm::dvec3(0.0, 1.0, 0.0);
|
||||
case UpDirectionChoice::ZAxis:
|
||||
return glm::dvec3(0.0, 0.0, 1.0);
|
||||
default:
|
||||
throw ghoul::MissingCaseException();
|
||||
case UpDirectionChoice::XAxis: return glm::dvec3(1.0, 0.0, 0.0);
|
||||
case UpDirectionChoice::YAxis: return glm::dvec3(0.0, 1.0, 0.0);
|
||||
case UpDirectionChoice::ZAxis: return glm::dvec3(0.0, 0.0, 1.0);
|
||||
default: throw ghoul::MissingCaseException();
|
||||
}
|
||||
}(UpDirectionChoice(_upToUseForRotation.value()));
|
||||
|
||||
|
||||
+13
-11
@@ -96,9 +96,10 @@ namespace {
|
||||
|
||||
namespace openspace::interaction {
|
||||
|
||||
Path::Path(Waypoint start, Waypoint end, Type type,
|
||||
std::optional<double> duration)
|
||||
: _start(start), _end(end), _type(type)
|
||||
Path::Path(Waypoint start, Waypoint end, Type type, std::optional<double> duration)
|
||||
: _start(start)
|
||||
, _end(end)
|
||||
, _type(type)
|
||||
{
|
||||
switch (_type) {
|
||||
case Type::AvoidCollision:
|
||||
@@ -111,9 +112,6 @@ Path::Path(Waypoint start, Waypoint end, Type type,
|
||||
case Type::ZoomOutOverview:
|
||||
_curve = std::make_unique<ZoomOutOverviewCurve>(_start, _end);
|
||||
break;
|
||||
default:
|
||||
LERROR("Could not create curve. Type does not exist");
|
||||
throw ghoul::MissingCaseException();
|
||||
}
|
||||
|
||||
_prevPose = _start.pose();
|
||||
@@ -133,11 +131,17 @@ Path::Path(Waypoint start, Waypoint end, Type type,
|
||||
}
|
||||
}
|
||||
|
||||
Waypoint Path::startPoint() const { return _start; }
|
||||
Waypoint Path::startPoint() const {
|
||||
return _start;
|
||||
}
|
||||
|
||||
Waypoint Path::endPoint() const { return _end; }
|
||||
Waypoint Path::endPoint() const {
|
||||
return _end;
|
||||
}
|
||||
|
||||
double Path::pathLength() const { return _curve->length(); }
|
||||
double Path::pathLength() const {
|
||||
return _curve->length();
|
||||
}
|
||||
|
||||
std::vector<glm::dvec3> Path::controlPoints() const {
|
||||
return _curve->points();
|
||||
@@ -570,8 +574,6 @@ Path createPathFromDictionary(const ghoul::Dictionary& dictionary,
|
||||
waypoints = { computeWaypointFromNodeInfo(info, startPoint, isLinear) };
|
||||
break;
|
||||
}
|
||||
default:
|
||||
throw ghoul::MissingCaseException();
|
||||
}
|
||||
|
||||
// @TODO (emmbr) Allow for an instruction to represent a list of multiple waypoints
|
||||
|
||||
@@ -952,8 +952,6 @@ void TimeManager::setTimeFromProfile(const Profile& p) {
|
||||
case Profile::Time::Type::Absolute:
|
||||
_currentTime.data() = Time(p.time->value);
|
||||
break;
|
||||
default:
|
||||
throw ghoul::MissingCaseException();
|
||||
}
|
||||
|
||||
setPause(p.time->startPaused);
|
||||
|
||||
@@ -28,6 +28,11 @@ function (set_openspace_compile_settings target)
|
||||
set(MSVC_WARNINGS
|
||||
"/MP" # Multi-threading support
|
||||
"/W4" # Highest warning level
|
||||
"/w44062" # missing case label
|
||||
"/w44289" # using for-loop variable outside of loop
|
||||
"/w44296" # expression is always true/false
|
||||
"/w45041" # out-of-line definition for constexpr data is deprecated
|
||||
"/w45204" # virtual class has non-virtual trivial destructor
|
||||
"/wd4127" # conditional expression is constant [raised by: websocketpp]
|
||||
"/wd4201" # nonstandard extension used : nameless struct/union [raised by: GLM]
|
||||
"/wd5030" # attribute 'attribute' is not recognized [raised by: codegen]
|
||||
@@ -185,10 +190,13 @@ function (set_openspace_compile_settings target)
|
||||
target_compile_options(${target} PRIVATE ${MSVC_WARNINGS})
|
||||
|
||||
# Boost as of 1.64 still uses unary_function unless we define this
|
||||
target_compile_definitions(${target} PRIVATE "_HAS_AUTO_PTR_ETC")
|
||||
target_compile_definitions(${target} PRIVATE "NOMINMAX")
|
||||
target_compile_definitions(${target} PRIVATE "WIN32_LEAN_AND_MEAN")
|
||||
target_compile_definitions(${target} PRIVATE "VC_EXTRALEAN")
|
||||
target_compile_definitions(${target}
|
||||
PRIVATE "_HAS_AUTO_PTR_ETC"
|
||||
PUBLIC "_CRT_SECURE_NO_WARNINGS"
|
||||
PRIVATE "NOMINMAX"
|
||||
PRIVATE "WIN32_LEAN_AND_MEAN"
|
||||
PRIVATE "VC_EXTRALEAN"
|
||||
)
|
||||
elseif (NOT LINUX AND CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
# Apple has "deprecated" OpenGL and offers nothing but warnings instead
|
||||
target_compile_definitions(${target} PRIVATE "GL_SILENCE_DEPRECATION")
|
||||
|
||||
+1
-1
Submodule support/coding/codegen updated: 4c174e8c13...abe1b74019
Reference in New Issue
Block a user