mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-03-13 17:09:05 -05:00
Merge branch 'develop' of openspace.itn.liu.se:/openspace into develop
This commit is contained in:
@@ -75,7 +75,7 @@ protected:
|
||||
|
||||
private:
|
||||
properties::BoolProperty _enabled;
|
||||
|
||||
|
||||
PowerScaledScalar boundingSphere_;
|
||||
std::string _relativePath;
|
||||
};
|
||||
|
||||
@@ -86,7 +86,6 @@ RenderableModel::RenderableModel(const ghoul::Dictionary& dictionary)
|
||||
|
||||
|
||||
RenderableModel::~RenderableModel(){
|
||||
deinitialize();
|
||||
}
|
||||
|
||||
bool RenderableModel::isReady() const {
|
||||
|
||||
@@ -84,10 +84,14 @@ RenderablePlanet::RenderablePlanet(const ghoul::Dictionary& dictionary)
|
||||
|
||||
addProperty(_colorTexturePath);
|
||||
_colorTexturePath.onChange(std::bind(&RenderablePlanet::loadTexture, this));
|
||||
|
||||
std::string s = _colorTexturePath.description();
|
||||
ghoul::Dictionary d;
|
||||
ghoul::lua::loadDictionaryFromString(s, d);
|
||||
|
||||
}
|
||||
|
||||
RenderablePlanet::~RenderablePlanet() {
|
||||
deinitialize();
|
||||
}
|
||||
|
||||
bool RenderablePlanet::initialize() {
|
||||
|
||||
@@ -89,8 +89,7 @@ Renderable::Renderable(const ghoul::Dictionary& dictionary)
|
||||
addProperty(_enabled);
|
||||
}
|
||||
|
||||
Renderable::~Renderable()
|
||||
{
|
||||
Renderable::~Renderable() {
|
||||
}
|
||||
|
||||
void Renderable::setBoundingSphere(const PowerScaledScalar& boundingSphere)
|
||||
|
||||
@@ -87,7 +87,6 @@ RenderableFieldlines::RenderableFieldlines(const ghoul::Dictionary& dictionary)
|
||||
}
|
||||
|
||||
RenderableFieldlines::~RenderableFieldlines() {
|
||||
deinitialize();
|
||||
}
|
||||
|
||||
bool RenderableFieldlines::isReady() const {
|
||||
|
||||
@@ -90,7 +90,6 @@ void RenderableFov::fullYearSweep(){
|
||||
}
|
||||
|
||||
RenderableFov::~RenderableFov(){
|
||||
deinitialize();
|
||||
}
|
||||
|
||||
bool RenderableFov::isReady() const {
|
||||
|
||||
@@ -142,7 +142,6 @@ bool RenderablePath::fullYearSweep(){
|
||||
}
|
||||
|
||||
RenderablePath::~RenderablePath(){
|
||||
deinitialize();
|
||||
}
|
||||
|
||||
bool RenderablePath::isReady() const {
|
||||
|
||||
@@ -95,7 +95,6 @@ RenderablePlane::RenderablePlane(const ghoul::Dictionary& dictionary)
|
||||
}
|
||||
|
||||
RenderablePlane::~RenderablePlane() {
|
||||
deinitialize();
|
||||
}
|
||||
|
||||
bool RenderablePlane::isReady() const {
|
||||
|
||||
@@ -128,8 +128,6 @@ RenderableSphericalGrid::RenderableSphericalGrid(const ghoul::Dictionary& dictio
|
||||
}
|
||||
|
||||
RenderableSphericalGrid::~RenderableSphericalGrid(){
|
||||
deinitialize();
|
||||
|
||||
// Delete not done in deinitialize because new is done in constructor
|
||||
delete[] _varray;
|
||||
delete[] _iarray;
|
||||
|
||||
@@ -139,7 +139,6 @@ void RenderableTrail::fullYearSweep(){
|
||||
}
|
||||
|
||||
RenderableTrail::~RenderableTrail(){
|
||||
deinitialize();
|
||||
}
|
||||
|
||||
bool RenderableTrail::isReady() const {
|
||||
|
||||
@@ -160,7 +160,6 @@ RenderableVolumeGL::RenderableVolumeGL(const ghoul::Dictionary& dictionary)
|
||||
}
|
||||
|
||||
RenderableVolumeGL::~RenderableVolumeGL() {
|
||||
deinitialize();
|
||||
}
|
||||
|
||||
bool RenderableVolumeGL::isReady() const {
|
||||
|
||||
@@ -88,7 +88,6 @@ RenderableConstellationBounds::RenderableConstellationBounds(
|
||||
}
|
||||
|
||||
RenderableConstellationBounds::~RenderableConstellationBounds() {
|
||||
deinitialize();
|
||||
}
|
||||
|
||||
bool RenderableConstellationBounds::initialize() {
|
||||
|
||||
@@ -123,7 +123,6 @@ RenderableStars::RenderableStars(const ghoul::Dictionary& dictionary)
|
||||
}
|
||||
|
||||
RenderableStars::~RenderableStars() {
|
||||
deinitialize();
|
||||
}
|
||||
|
||||
bool RenderableStars::isReady() const {
|
||||
|
||||
@@ -290,8 +290,11 @@ void SceneGraph::scheduleLoadSceneFile(const std::string& sceneDescriptionFilePa
|
||||
|
||||
void SceneGraph::clearSceneGraph() {
|
||||
// deallocate the scene graph. Recursive deallocation will occur
|
||||
delete _root;
|
||||
_root = nullptr;
|
||||
if (_root) {
|
||||
_root->deinitialize();
|
||||
delete _root;
|
||||
_root = nullptr;
|
||||
}
|
||||
|
||||
_nodes.erase(_nodes.begin(), _nodes.end());
|
||||
_allNodes.erase(_allNodes.begin(), _allNodes.end());
|
||||
|
||||
@@ -140,10 +140,10 @@ SceneGraphNode::~SceneGraphNode()
|
||||
|
||||
bool SceneGraphNode::initialize()
|
||||
{
|
||||
if (_renderable != nullptr)
|
||||
if (_renderable)
|
||||
_renderable->initialize();
|
||||
|
||||
if (_ephemeris != nullptr)
|
||||
if (_ephemeris)
|
||||
_ephemeris->initialize();
|
||||
|
||||
return true;
|
||||
@@ -153,16 +153,21 @@ bool SceneGraphNode::deinitialize()
|
||||
{
|
||||
LDEBUG("Deinitialize: " << name());
|
||||
|
||||
if(_renderable)
|
||||
if (_renderable) {
|
||||
_renderable->deinitialize();
|
||||
delete _renderable;
|
||||
_renderable = nullptr;
|
||||
if(_ephemeris)
|
||||
delete _ephemeris;
|
||||
_ephemeris = nullptr;
|
||||
_renderable = nullptr;
|
||||
}
|
||||
|
||||
// deallocate the child nodes and delete them, iterate c++11 style
|
||||
for (SceneGraphNode* child : _children)
|
||||
delete child;
|
||||
if (_ephemeris) {
|
||||
delete _ephemeris;
|
||||
_ephemeris = nullptr;
|
||||
}
|
||||
|
||||
for (SceneGraphNode* child : _children) {
|
||||
child->deinitialize();
|
||||
delete child;
|
||||
}
|
||||
_children.clear();
|
||||
|
||||
// reset variables
|
||||
|
||||
Reference in New Issue
Block a user