|
From: <br...@us...> - 2008-11-03 08:12:24
|
Revision: 3760
http://openvrml.svn.sourceforge.net/openvrml/?rev=3760&view=rev
Author: braden
Date: 2008-11-03 08:12:19 +0000 (Mon, 03 Nov 2008)
Log Message:
-----------
Only render a node if the scene pointer is nonnull (i.e., the node has been initialized).
Modified Paths:
--------------
branches/0.17/ChangeLog
branches/0.17/src/libopenvrml/openvrml/node.cpp
Modified: branches/0.17/ChangeLog
===================================================================
--- branches/0.17/ChangeLog 2008-11-03 07:57:59 UTC (rev 3759)
+++ branches/0.17/ChangeLog 2008-11-03 08:12:19 UTC (rev 3760)
@@ -1,5 +1,24 @@
2008-11-03 Braden McDaniel <br...@en...>
+ Only render a node if the scene pointer is nonnull (i.e., the node
+ has been initialized).
+
+ * src/libopenvrml/openvrml/node.cpp
+ (openvrml::appearance_node::render_appearance(viewer &,
+ rendering_context)): Check that the scene pointer is nonnull.
+ (openvrml::child_node::render_child(viewer &, rendering_context)):
+ Check that the scene pointer is nonnull.
+ (openvrml::geometry_node::render_geometry(viewer &,
+ rendering_context)): Check that the scene pointer is nonnull.
+ (openvrml::scoped_light_node::render_scoped_light(viewer &)):
+ Check that the scene pointer is nonnull.
+ (openvrml::texture_node::render_texture(viewer &)): Check that the
+ scene pointer is nonnull.
+ (openvrml::texture_transform_node::render_texture_transform(viewer&)):
+ Check that the scene pointer is nonnull.
+
+2008-11-03 Braden McDaniel <br...@en...>
+
* src/libopenvrml/openvrml/vrml97node.cpp
(image_texture_node::update_texture()): Assert that the scene
pointer is nonnull (i.e., the node has been initialized).
Modified: branches/0.17/src/libopenvrml/openvrml/node.cpp
===================================================================
--- branches/0.17/src/libopenvrml/openvrml/node.cpp 2008-11-03 07:57:59 UTC (rev 3759)
+++ branches/0.17/src/libopenvrml/openvrml/node.cpp 2008-11-03 08:12:19 UTC (rev 3760)
@@ -3091,8 +3091,10 @@
void openvrml::appearance_node::render_appearance(viewer & v,
rendering_context context)
{
- this->do_render_appearance(v, context);
- this->modified(false);
+ if (this->scene()) {
+ this->do_render_appearance(v, context);
+ this->modified(false);
+ }
}
/**
@@ -3356,8 +3358,10 @@
void openvrml::child_node::render_child(viewer & v,
const rendering_context context)
{
- this->do_render_child(v, context);
- this->modified(false);
+ if (this->scene()) {
+ this->do_render_child(v, context);
+ this->modified(false);
+ }
}
/**
@@ -3716,20 +3720,23 @@
openvrml::geometry_node::render_geometry(viewer & v,
rendering_context context)
{
- boost::mutex::scoped_lock lock(this->geometry_reference_mutex_);
+ if (this->scene()) {
+ boost::mutex::scoped_lock lock(this->geometry_reference_mutex_);
- if (this->geometry_reference != 0 && this->modified()) {
- v.remove_object(this->geometry_reference);
- this->geometry_reference = 0;
- }
+ if (this->geometry_reference != 0 && this->modified()) {
+ v.remove_object(this->geometry_reference);
+ this->geometry_reference = 0;
+ }
- if (this->geometry_reference != 0) {
- v.insert_reference(this->geometry_reference);
- } else {
- this->geometry_reference = this->do_render_geometry(v, context);
- this->modified(false);
+ if (this->geometry_reference != 0) {
+ v.insert_reference(this->geometry_reference);
+ } else {
+ this->geometry_reference = this->do_render_geometry(v, context);
+ this->modified(false);
+ }
+ return this->geometry_reference;
}
- return this->geometry_reference;
+ return 0;
}
/**
@@ -4323,7 +4330,9 @@
*/
void openvrml::scoped_light_node::render_scoped_light(viewer & v)
{
- this->do_render_scoped_light(v);
+ if (this->scene()) {
+ this->do_render_scoped_light(v);
+ }
}
/**
@@ -4439,21 +4448,24 @@
openvrml::viewer::texture_object_t
openvrml::texture_node::render_texture(viewer & v)
{
- boost::mutex::scoped_lock lock(this->texture_reference_mutex_);
+ if (this->scene()) {
+ boost::mutex::scoped_lock lock(this->texture_reference_mutex_);
- if (this->texture_reference != 0 && this->modified()) {
- v.remove_texture_object(this->texture_reference);
- this->texture_reference = 0;
- }
+ if (this->texture_reference != 0 && this->modified()) {
+ v.remove_texture_object(this->texture_reference);
+ this->texture_reference = 0;
+ }
- if (this->texture_reference != 0) {
- v.insert_texture_reference(this->texture_reference,
- this->image().comp());
- } else {
- this->texture_reference = this->do_render_texture(v);
- this->modified(false);
+ if (this->texture_reference != 0) {
+ v.insert_texture_reference(this->texture_reference,
+ this->image().comp());
+ } else {
+ this->texture_reference = this->do_render_texture(v);
+ this->modified(false);
+ }
+ return this->texture_reference;
}
- return this->texture_reference;
+ return 0;
}
/**
@@ -4586,8 +4598,10 @@
*/
void openvrml::texture_transform_node::render_texture_transform(viewer & v)
{
- this->do_render_texture_transform(v);
- this->modified(false);
+ if (this->scene()) {
+ this->do_render_texture_transform(v);
+ this->modified(false);
+ }
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|