Merge branch 'develop' of openspace.itn.liu.se:/openspace into develop

This commit is contained in:
Jonas Strandstedt
2014-12-16 11:38:15 +01:00
15 changed files with 27 additions and 27 deletions

View File

@@ -75,7 +75,7 @@ protected:
private:
properties::BoolProperty _enabled;
PowerScaledScalar boundingSphere_;
std::string _relativePath;
};

View File

@@ -86,7 +86,6 @@ RenderableModel::RenderableModel(const ghoul::Dictionary& dictionary)
RenderableModel::~RenderableModel(){
deinitialize();
}
bool RenderableModel::isReady() const {

View File

@@ -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() {

View File

@@ -89,8 +89,7 @@ Renderable::Renderable(const ghoul::Dictionary& dictionary)
addProperty(_enabled);
}
Renderable::~Renderable()
{
Renderable::~Renderable() {
}
void Renderable::setBoundingSphere(const PowerScaledScalar& boundingSphere)

View File

@@ -87,7 +87,6 @@ RenderableFieldlines::RenderableFieldlines(const ghoul::Dictionary& dictionary)
}
RenderableFieldlines::~RenderableFieldlines() {
deinitialize();
}
bool RenderableFieldlines::isReady() const {

View File

@@ -90,7 +90,6 @@ void RenderableFov::fullYearSweep(){
}
RenderableFov::~RenderableFov(){
deinitialize();
}
bool RenderableFov::isReady() const {

View File

@@ -142,7 +142,6 @@ bool RenderablePath::fullYearSweep(){
}
RenderablePath::~RenderablePath(){
deinitialize();
}
bool RenderablePath::isReady() const {

View File

@@ -95,7 +95,6 @@ RenderablePlane::RenderablePlane(const ghoul::Dictionary& dictionary)
}
RenderablePlane::~RenderablePlane() {
deinitialize();
}
bool RenderablePlane::isReady() const {

View File

@@ -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;

View File

@@ -139,7 +139,6 @@ void RenderableTrail::fullYearSweep(){
}
RenderableTrail::~RenderableTrail(){
deinitialize();
}
bool RenderableTrail::isReady() const {

View File

@@ -160,7 +160,6 @@ RenderableVolumeGL::RenderableVolumeGL(const ghoul::Dictionary& dictionary)
}
RenderableVolumeGL::~RenderableVolumeGL() {
deinitialize();
}
bool RenderableVolumeGL::isReady() const {

View File

@@ -88,7 +88,6 @@ RenderableConstellationBounds::RenderableConstellationBounds(
}
RenderableConstellationBounds::~RenderableConstellationBounds() {
deinitialize();
}
bool RenderableConstellationBounds::initialize() {

View File

@@ -123,7 +123,6 @@ RenderableStars::RenderableStars(const ghoul::Dictionary& dictionary)
}
RenderableStars::~RenderableStars() {
deinitialize();
}
bool RenderableStars::isReady() const {

View File

@@ -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());

View File

@@ -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