|
From: <br...@us...> - 2008-11-03 08:16:37
|
Revision: 3761
http://openvrml.svn.sourceforge.net/openvrml/?rev=3761&view=rev
Author: braden
Date: 2008-11-03 08:16:32 +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:
--------------
trunk/ChangeLog
trunk/src/libopenvrml/openvrml/node.cpp
trunk/src/node/vrml97/image_texture.cpp
Property Changed:
----------------
trunk/
trunk/src/libopenvrml/openvrml/bad_url.cpp
trunk/src/libopenvrml/openvrml/scene.cpp
trunk/src/libopenvrml/openvrml/scene.h
trunk/src/libopenvrml/openvrml/script.cpp
Property changes on: trunk
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/0.17:3713,3717,3719,3721,3725,3730,3732,3743,3746,3748,3750,3752,3754,3757
/branches/local:3677-3689
/branches/node-modules:3622-3623,3632-3635,3637-3638,3640-3641,3643-3644,3646-3647,3649-3650,3654-3655,3657-3658,3661-3662,3664-3665,3667-3668,3670-3671,3673-3674,3684-3685,3687-3688
+ /branches/0.17:3713,3717,3719,3721,3725,3730,3732,3743,3746,3748,3750,3752,3754,3757,3759-3760
/branches/local:3677-3689
/branches/node-modules:3622-3623,3632-3635,3637-3638,3640-3641,3643-3644,3646-3647,3649-3650,3654-3655,3657-3658,3661-3662,3664-3665,3667-3668,3670-3671,3673-3674,3684-3685,3687-3688
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-11-03 08:12:19 UTC (rev 3760)
+++ trunk/ChangeLog 2008-11-03 08:16:32 UTC (rev 3761)
@@ -1,5 +1,27 @@
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.
+ * src/node/vrml97/image_texture.cpp
+ (image_texture_node::update_texture()): Assert that the scene
+ pointer is nonnull (i.e., the node has been initialized).
+
+2008-11-03 Braden McDaniel <br...@en...>
+
* src/libopenvrml/openvrml/local/proto.cpp
(proto_node::do_shutdown(double)): Doc-comment fix.
Property changes on: trunk/src/libopenvrml/openvrml/bad_url.cpp
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/0.17/src/libopenvrml/openvrml/bad_url.cpp:3713,3717,3719,3721,3725,3730,3732,3743,3746,3748,3750,3752,3754,3757
+ /branches/0.17/src/libopenvrml/openvrml/bad_url.cpp:3713,3717,3719,3721,3725,3730,3732,3743,3746,3748,3750,3752,3754,3757,3759-3760
Modified: trunk/src/libopenvrml/openvrml/node.cpp
===================================================================
--- trunk/src/libopenvrml/openvrml/node.cpp 2008-11-03 08:12:19 UTC (rev 3760)
+++ trunk/src/libopenvrml/openvrml/node.cpp 2008-11-03 08:16:32 UTC (rev 3761)
@@ -3113,8 +3113,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);
+ }
}
/**
@@ -3378,8 +3380,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);
+ }
}
/**
@@ -3738,20 +3742,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;
}
/**
@@ -4345,7 +4352,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);
+ }
}
/**
@@ -4461,21 +4470,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;
}
/**
@@ -4608,8 +4620,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);
+ }
}
/**
Property changes on: trunk/src/libopenvrml/openvrml/scene.cpp
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/0.17/src/libopenvrml/openvrml/scene.cpp:3713,3717,3719,3721,3725,3730,3732,3743,3746,3748,3750,3752,3754,3757
+ /branches/0.17/src/libopenvrml/openvrml/scene.cpp:3713,3717,3719,3721,3725,3730,3732,3743,3746,3748,3750,3752,3754,3757,3759-3760
Property changes on: trunk/src/libopenvrml/openvrml/scene.h
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/0.17/src/libopenvrml/openvrml/scene.h:3713,3717,3719,3721,3725,3730,3732,3743,3746,3748,3750,3752,3754,3757
+ /branches/0.17/src/libopenvrml/openvrml/scene.h:3713,3717,3719,3721,3725,3730,3732,3743,3746,3748,3750,3752,3754,3757,3759-3760
Property changes on: trunk/src/libopenvrml/openvrml/script.cpp
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/0.17/src/libopenvrml/openvrml/script.cpp:3713,3717,3719,3721,3725,3730,3732,3743,3746,3748,3750,3752,3754,3757
+ /branches/0.17/src/libopenvrml/openvrml/script.cpp:3713,3717,3719,3721,3725,3730,3732,3743,3746,3748,3750,3752,3754,3757,3759-3760
Modified: trunk/src/node/vrml97/image_texture.cpp
===================================================================
--- trunk/src/node/vrml97/image_texture.cpp 2008-11-03 08:12:19 UTC (rev 3760)
+++ trunk/src/node/vrml97/image_texture.cpp 2008-11-03 08:16:32 UTC (rev 3761)
@@ -243,10 +243,7 @@
*/
void image_texture_node::update_texture()
{
- //
- // If the node hasn't been initialized yet, bail.
- //
- if (!this->scene()) { return; }
+ assert(this->scene());
if (this->texture_needs_update) {
using openvrml_node_vrml97::image_stream_listener;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|