|
From: <br...@us...> - 2009-04-22 05:22:17
|
Revision: 3893
http://openvrml.svn.sourceforge.net/openvrml/?rev=3893&view=rev
Author: braden
Date: 2009-04-22 05:22:14 +0000 (Wed, 22 Apr 2009)
Log Message:
-----------
Apply the nonvirtual interface idiom to openvrml::node::modified.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/libopenvrml/openvrml/node.cpp
trunk/src/libopenvrml/openvrml/node.h
trunk/src/node/vrml97/abstract_indexed_set.h
trunk/src/node/vrml97/appearance.cpp
trunk/src/node/vrml97/cad_layer.cpp
trunk/src/node/vrml97/collision.cpp
trunk/src/node/vrml97/elevation_grid.cpp
trunk/src/node/vrml97/grouping_node_base.h
trunk/src/node/vrml97/indexed_face_set.cpp
trunk/src/node/vrml97/lod.cpp
trunk/src/node/vrml97/point_set.cpp
trunk/src/node/vrml97/shape.cpp
trunk/src/node/vrml97/switch.cpp
trunk/src/node/vrml97/text.cpp
trunk/src/node/x3d-cad-geometry/cad_face.cpp
trunk/src/node/x3d-cad-geometry/indexed_quad_set.cpp
trunk/src/node/x3d-geometry2d/arc2d.cpp
trunk/src/node/x3d-geometry2d/arc_close2d.cpp
trunk/src/node/x3d-geometry2d/circle2d.cpp
trunk/src/node/x3d-geometry2d/disk2d.cpp
trunk/src/node/x3d-geometry2d/polypoint2d.cpp
trunk/src/node/x3d-geometry2d/rectangle2d.cpp
trunk/src/node/x3d-geometry2d/triangle_set2d.cpp
trunk/src/node/x3d-geospatial/geo_elevation_grid.cpp
trunk/src/node/x3d-grouping/static_group.cpp
trunk/src/node/x3d-nurbs/nurbs_curve.cpp
trunk/src/node/x3d-nurbs/nurbs_patch_surface.cpp
trunk/src/node/x3d-nurbs/nurbs_swept_surface.cpp
trunk/src/node/x3d-nurbs/nurbs_swung_surface.cpp
trunk/src/node/x3d-nurbs/nurbs_trimmed_surface.cpp
trunk/src/node/x3d-rendering/indexed_triangle_fan_set.cpp
trunk/src/node/x3d-rendering/indexed_triangle_set.cpp
trunk/src/node/x3d-rendering/triangle_fan_set.cpp
trunk/src/node/x3d-rendering/triangle_set.cpp
trunk/src/node/x3d-rendering/triangle_strip_set.cpp
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2009-04-17 05:17:31 UTC (rev 3892)
+++ trunk/ChangeLog 2009-04-22 05:22:14 UTC (rev 3893)
@@ -1,3 +1,87 @@
+2009-04-21 Braden McDaniel <br...@en...>
+
+ Apply the nonvirtual interface idiom to openvrml::node::modified.
+
+ * src/libopenvrml/openvrml/node.cpp
+ (openvrml::node::modified(bool)): Added exception specification
+ noting that boost::thread_resource_error can be thrown; call
+ do_modified.
+ (openvrml::node::do_modified() const): Added function; this base
+ class implementation always returns false.
+ * src/libopenvrml/openvrml/node.h
+ (openvrml::node): Made modified function nonvirtual; added private
+ virtual function do_modified.
+ * src/node/vrml97/abstract_indexed_set.h
+ (openvrml_node_vrml97::abstract_indexed_set<Derived>): Override
+ do_modified instead of modified.
+ * src/node/vrml97/appearance.cpp
+ (appearance): Override do_modified instead of modified.
+ * src/node/vrml97/cad_layer.cpp
+ (cad_layer): Override do_modified instead of modified.
+ * src/node/vrml97/collision.cpp
+ (collision): Override do_modified instead of modified.
+ * src/node/vrml97/elevation_grid.cpp
+ (elevation_grid): Override do_modified instead of modified.
+ * src/node/vrml97/grouping_node_base.h
+ (openvrml_node_vrml97::grouping_node_base<Derived>): Override
+ do_modified instead of modified.
+ * src/node/vrml97/indexed_face_set.cpp
+ (indexed_face_set): Override do_modified instead of modified.
+ * src/node/vrml97/lod.cpp
+ (lod): Override do_modified instead of modified.
+ * src/node/vrml97/point_set.cpp
+ (point_set): Override do_modified instead of modified.
+ * src/node/vrml97/shape.cpp
+ (shape): Override do_modified instead of modified.
+ * src/node/vrml97/switch.cpp
+ (switch): Override do_modified instead of modified.
+ * src/node/vrml97/text.cpp
+ (text): Override do_modified instead of modified.
+ * src/node/x3d-cad-geometry/cad_face.cpp
+ (cad_face): Override do_modified instead of modified.
+ * src/node/x3d-cad-geometry/indexed_quad_set.cpp
+ (indexed_quad_set): Override do_modified instead of modified.
+ * src/node/x3d-geometry2d/arc2d.cpp
+ (arc2d): Removed unnecessary override of modified.
+ * src/node/x3d-geometry2d/arc_close2d.cpp
+ (arc_close2d): Removed unnecessary override of modified.
+ * src/node/x3d-geometry2d/circle2d.cpp
+ (circle2d): Removed unnecessary override of modified.
+ * src/node/x3d-geometry2d/disk2d.cpp
+ (disk2d): Removed unnecessary override of modified.
+ * src/node/x3d-geometry2d/polypoint2d.cpp
+ (polypoint2d): Removed unnecessary override of modified.
+ * src/node/x3d-geometry2d/rectangle2d.cpp
+ (rectangle2d): Removed unnecessary override of modified.
+ * src/node/x3d-geometry2d/triangle_set2d.cpp
+ (triangle_set2d): Removed unnecessary override of modified.
+ * src/node/x3d-geospatial/geo_elevation_grid.cpp
+ (geo_elevation_grid): Override do_modified instead of modified.
+ * src/node/x3d-grouping/static_group.cpp
+ (static_group): Override do_modified instead of modified.
+ * src/node/x3d-nurbs/nurbs_curve.cpp
+ (nurbs_curve): Override do_modified instead of modified.
+ * src/node/x3d-nurbs/nurbs_patch_surface.cpp
+ (nurbs_patch_surface): Override do_modified instead of modified.
+ * src/node/x3d-nurbs/nurbs_swept_surface.cpp
+ (nurbs_swept_surface): Override do_modified instead of modified.
+ * src/node/x3d-nurbs/nurbs_swung_surface.cpp
+ (nurbs_swung_surface): Override do_modified instead of modified.
+ * src/node/x3d-nurbs/nurbs_trimmed_surface.cpp
+ (nurbs_trimmed_surface): Override do_modified instead of modified.
+ * src/node/x3d-rendering/indexed_triangle_fan_set.cpp
+ (indexed_triangle_fan_set): Override do_modified instead of
+ modified.
+ * src/node/x3d-rendering/indexed_triangle_set.cpp
+ (indexed_triangle_set): Override do_modified instead of modified.
+ * src/node/x3d-rendering/triangle_fan_set.cpp
+ (indexed_triangle_fan_set): Override do_modified instead of
+ modified.
+ * src/node/x3d-rendering/triangle_set.cpp
+ (triangle_set): Override do_modified instead of modified.
+ * src/node/x3d-rendering/triangle_strip_set.cpp
+ (triangle_strip_set): Override do_modified instead of modified.
+
2009-04-17 Braden McDaniel <br...@en...>
* src/libopenvrml/openvrml/local/component.cpp
Modified: trunk/src/libopenvrml/openvrml/node.cpp
===================================================================
--- trunk/src/libopenvrml/openvrml/node.cpp 2009-04-17 05:17:31 UTC (rev 3892)
+++ trunk/src/libopenvrml/openvrml/node.cpp 2009-04-22 05:22:14 UTC (rev 3893)
@@ -2683,8 +2683,12 @@
* Indicates the node needs to be revisited for rendering.
*
* @param[in] value
+ *
+ * @exception boost::thread_resource_error if @c #modified_mutex_ cannot be
+ * locked.
*/
void openvrml::node::modified(const bool value)
+ OPENVRML_THROW1(boost::thread_resource_error)
{
read_write_mutex::scoped_write_lock lock(this->modified_mutex_);
this->modified_ = value;
@@ -2699,14 +2703,35 @@
* return @c true if any of their children have been modified.
*
* @return @c true if the @c node has been modified; @c false otherwise.
+ *
+ * @exception boost::thread_resource_error if @c #modified_mutex_ cannot be
+ * locked.
*/
bool openvrml::node::modified() const
+ OPENVRML_THROW1(boost::thread_resource_error)
{
read_write_mutex::scoped_read_lock lock(this->modified_mutex_);
- return this->modified_;
+ return this->modified_ || this->do_modified();
}
/**
+ * @brief Determine whether the @c node has been modified.
+ *
+ * The default implementation returns @c false. Subclasses that can have
+ * child @c node%s should override this method and return @c true if any of
+ * their children has been modified.
+ *
+ * @return @c false.
+ *
+ * @exception boost::thread_resource_error if a mutex cannot be locked.
+ */
+bool openvrml::node::do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error)
+{
+ return false;
+}
+
+/**
* @brief Emit an event.
*
* @param[in,out] emitter an @c event_emitter.
Modified: trunk/src/libopenvrml/openvrml/node.h
===================================================================
--- trunk/src/libopenvrml/openvrml/node.h 2009-04-17 05:17:31 UTC (rev 3892)
+++ trunk/src/libopenvrml/openvrml/node.h 2009-04-22 05:22:14 UTC (rev 3893)
@@ -575,8 +575,8 @@
OPENVRML_THROW2(unsupported_interface, std::bad_cast);
void shutdown(double timestamp) OPENVRML_NOTHROW;
- virtual bool modified() const;
- void modified(bool value);
+ bool modified() const OPENVRML_THROW1(boost::thread_resource_error);
+ void modified(bool value) OPENVRML_THROW1(boost::thread_resource_error);
protected:
static void emit_event(openvrml::event_emitter & emitter,
@@ -606,6 +606,9 @@
OPENVRML_THROW1(unsupported_interface) = 0;
virtual void do_shutdown(double timestamp) OPENVRML_NOTHROW;
+ virtual bool do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error);
+
virtual script_node * to_script() OPENVRML_NOTHROW;
virtual appearance_node * to_appearance() OPENVRML_NOTHROW;
virtual bounded_volume_node * to_bounded_volume() OPENVRML_NOTHROW;
Modified: trunk/src/node/vrml97/abstract_indexed_set.h
===================================================================
--- trunk/src/node/vrml97/abstract_indexed_set.h 2009-04-17 05:17:31 UTC (rev 3892)
+++ trunk/src/node/vrml97/abstract_indexed_set.h 2009-04-22 05:22:14 UTC (rev 3893)
@@ -78,14 +78,15 @@
public:
virtual ~abstract_indexed_set_node() OPENVRML_NOTHROW = 0;
- virtual bool modified() const;
-
virtual const openvrml::color_node * do_color() const OPENVRML_NOTHROW;
protected:
abstract_indexed_set_node(
const openvrml::node_type & type,
const boost::shared_ptr<openvrml::scope> & scope);
+
+ virtual bool do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error);
};
/**
@@ -266,14 +267,11 @@
* @c false otherwise.
*/
template <typename Derived>
- bool abstract_indexed_set_node<Derived>::modified() const
+ bool abstract_indexed_set_node<Derived>::do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error)
{
- using openvrml::sfnode;
- return this->node::modified()
- || (this->color_.sfnode::value()
- && this->color_.sfnode::value()->modified())
- || (this->coord_.sfnode::value()
- && this->coord_.sfnode::value()->modified());
+ return (this->color_.value() && this->color_.value()->modified())
+ || (this->coord_.value() && this->coord_.value()->modified());
}
/**
Modified: trunk/src/node/vrml97/appearance.cpp
===================================================================
--- trunk/src/node/vrml97/appearance.cpp 2009-04-17 05:17:31 UTC (rev 3892)
+++ trunk/src/node/vrml97/appearance.cpp 2009-04-22 05:22:14 UTC (rev 3893)
@@ -48,9 +48,10 @@
const boost::shared_ptr<openvrml::scope> & scope);
virtual ~appearance_node() OPENVRML_NOTHROW;
- virtual bool modified() const;
-
private:
+ virtual bool do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error);
+
//
// appearance_node implementation
//
@@ -125,15 +126,13 @@
* @return @c true if the node or one of its children has been modified,
* @c false otherwise.
*/
- bool appearance_node::modified() const
+ bool appearance_node::do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error)
{
- return (this->node::modified()
- || (this->material_.sfnode::value()
- && this->material_.sfnode::value()->modified())
- || (this->texture_.sfnode::value()
- && this->texture_.sfnode::value()->modified())
- || (this->texture_transform_.sfnode::value()
- && this->texture_transform_.sfnode::value()->modified()));
+ return (this->material_.value() && this->material_.value()->modified())
+ || (this->texture_.value() && this->texture_.value()->modified())
+ || (this->texture_transform_.value()
+ && this->texture_transform_.value()->modified());
}
/**
Modified: trunk/src/node/vrml97/cad_layer.cpp
===================================================================
--- trunk/src/node/vrml97/cad_layer.cpp 2009-04-17 05:17:31 UTC (rev 3892)
+++ trunk/src/node/vrml97/cad_layer.cpp 2009-04-22 05:22:14 UTC (rev 3893)
@@ -61,9 +61,10 @@
const boost::shared_ptr<openvrml::scope> & scope);
virtual ~cad_layer_node() OPENVRML_NOTHROW;
- virtual bool modified() const;
-
private:
+ virtual bool do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error);
+
virtual
void do_children_event_side_effect(const openvrml::mfnode & choice,
double timestamp)
@@ -232,16 +233,14 @@
* @return @c true if the node or one of its children has been modified,
* @c false otherwise.
*/
- bool cad_layer_node::modified() const
+ bool cad_layer_node::do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error)
{
- if (this->node::modified()) { return true; }
-
- openvrml::mfnode::value_type::const_iterator iter =
- current_children_.value().begin();
- for (; iter != current_children_.value().end(); ++iter)
- {
- if ((*iter)->modified())
- return true;
+ for (openvrml::mfnode::value_type::const_iterator child =
+ current_children_.value().begin();
+ child != current_children_.value().end();
+ ++child) {
+ if ((*child)->modified()) { return true; }
}
return false;
}
Modified: trunk/src/node/vrml97/collision.cpp
===================================================================
--- trunk/src/node/vrml97/collision.cpp 2009-04-17 05:17:31 UTC (rev 3892)
+++ trunk/src/node/vrml97/collision.cpp 2009-04-22 05:22:14 UTC (rev 3893)
@@ -48,7 +48,9 @@
const boost::shared_ptr<openvrml::scope> & scope);
virtual ~collision_node() OPENVRML_NOTHROW;
- virtual bool modified() const;
+ private:
+ virtual bool do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error);
};
@@ -119,7 +121,8 @@
* @return @c true if the node or one of its children has been modified,
* @c false otherwise.
*/
- bool collision_node::modified() const
+ bool collision_node::do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error)
{
return (this->proxy_.value() && this->proxy_.value()->modified())
|| (this->openvrml_node_vrml97::grouping_node_base<collision_node>::
Modified: trunk/src/node/vrml97/elevation_grid.cpp
===================================================================
--- trunk/src/node/vrml97/elevation_grid.cpp 2009-04-17 05:17:31 UTC (rev 3892)
+++ trunk/src/node/vrml97/elevation_grid.cpp 2009-04-22 05:22:14 UTC (rev 3893)
@@ -69,9 +69,10 @@
const boost::shared_ptr<openvrml::scope> & scope);
virtual ~elevation_grid_node() OPENVRML_NOTHROW;
- virtual bool modified() const;
-
private:
+ virtual bool do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error);
+
virtual void do_render_geometry(openvrml::viewer & viewer,
openvrml::rendering_context context);
};
@@ -263,15 +264,13 @@
* @return @c true if the node or one of its children has been modified,
* @c false otherwise.
*/
- bool elevation_grid_node::modified() const
+ bool elevation_grid_node::do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error)
{
- return this->node::modified()
- || (this->color_.sfnode::value()
- && this->color_.sfnode::value()->modified())
- || (this->normal_.sfnode::value()
- && this->normal_.sfnode::value()->modified())
- || (this->tex_coord_.sfnode::value()
- && this->tex_coord_.sfnode::value()->modified());
+ return (this->color_.value() && this->color_.value()->modified())
+ || (this->normal_.value() && this->normal_.value()->modified())
+ || (this->tex_coord_.value()
+ && this->tex_coord_.value()->modified());
}
/**
Modified: trunk/src/node/vrml97/grouping_node_base.h
===================================================================
--- trunk/src/node/vrml97/grouping_node_base.h 2009-04-17 05:17:31 UTC (rev 3892)
+++ trunk/src/node/vrml97/grouping_node_base.h 2009-04-22 05:22:14 UTC (rev 3893)
@@ -103,9 +103,10 @@
const boost::shared_ptr<openvrml::scope> & scope);
virtual ~grouping_node_base() OPENVRML_NOTHROW;
- virtual bool modified() const;
-
protected:
+ virtual bool do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error);
+
virtual void do_render_child(openvrml::viewer & viewer,
openvrml::rendering_context context);
virtual const openvrml::bounding_volume &
@@ -448,19 +449,15 @@
/**
* @brief Determine whether the node has been modified.
*
- * @return @c true if the node or one of its children has been modified,
- * @c false otherwise.
+ * @return @c true if one of the node's children has been modified,
+ * @c false otherwise.
*/
template <typename Derived>
- bool grouping_node_base<Derived>::modified() const
+ bool grouping_node_base<Derived>::do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error)
{
- using namespace openvrml;
-
- if (this->node::modified()) { return true; }
- for (size_t i = 0; i < this->children_.mfnode::value().size(); ++i) {
- if (this->children_.mfnode::value()[i]->modified()) {
- return true;
- }
+ for (size_t i = 0; i < this->children_.value().size(); ++i) {
+ if (this->children_.value()[i]->modified()) { return true; }
}
return false;
}
Modified: trunk/src/node/vrml97/indexed_face_set.cpp
===================================================================
--- trunk/src/node/vrml97/indexed_face_set.cpp 2009-04-17 05:17:31 UTC (rev 3892)
+++ trunk/src/node/vrml97/indexed_face_set.cpp 2009-04-22 05:22:14 UTC (rev 3893)
@@ -84,9 +84,10 @@
const boost::shared_ptr<openvrml::scope> & scope);
virtual ~indexed_face_set_node() OPENVRML_NOTHROW;
- virtual bool modified() const;
-
private:
+ virtual bool do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error);
+
virtual const openvrml::bounding_volume & do_bounding_volume() const;
virtual void do_render_geometry(openvrml::viewer & viewer,
openvrml::rendering_context context);
@@ -318,17 +319,14 @@
* @return @c true if the node or one of its children has been modified,
* @c false otherwise.
*/
- bool indexed_face_set_node::modified() const
+ bool indexed_face_set_node::do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error)
{
- return this->node::modified()
- || (this->color_.sfnode::value()
- && this->color_.sfnode::value()->modified())
- || (this->coord_.sfnode::value()
- && this->coord_.sfnode::value()->modified())
- || (this->normal_.sfnode::value()
- && this->normal_.sfnode::value()->modified())
- || (this->tex_coord_.sfnode::value()
- && this->tex_coord_.sfnode::value()->modified());
+ return (this->color_.value() && this->color_.value()->modified())
+ || (this->coord_.value() && this->coord_.value()->modified())
+ || (this->normal_.value() && this->normal_.value()->modified())
+ || (this->tex_coord_.value()
+ && this->tex_coord_.value()->modified());
}
/**
Modified: trunk/src/node/vrml97/lod.cpp
===================================================================
--- trunk/src/node/vrml97/lod.cpp 2009-04-17 05:17:31 UTC (rev 3892)
+++ trunk/src/node/vrml97/lod.cpp 2009-04-22 05:22:14 UTC (rev 3893)
@@ -45,10 +45,11 @@
const boost::shared_ptr<openvrml::scope> & scope);
virtual ~lod_node() OPENVRML_NOTHROW;
- virtual bool modified() const;
-
private:
- virtual void do_render_child(openvrml::viewer & viewer,
+ virtual bool do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error);
+
+ virtual void do_render_child(openvrml::viewer & viewer,
openvrml::rendering_context context);
virtual const std::vector<boost::intrusive_ptr<openvrml::node> >
do_children() const OPENVRML_THROW1(std::bad_alloc);
@@ -116,15 +117,12 @@
* @return @c true if the node or one of its children has been modified,
* @c false otherwise.
*/
- bool lod_node::modified() const
+ bool lod_node::do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error)
{
- if (this->node::modified()) { return true; }
-
// This should really check which range is being rendered...
- for (size_t i = 0; i < this->children_.mfnode::value().size(); ++i) {
- if (this->children_.mfnode::value()[i]->modified()) {
- return true;
- }
+ for (size_t i = 0; i < this->children_.value().size(); ++i) {
+ if (this->children_.value()[i]->modified()) { return true; }
}
return false;
}
Modified: trunk/src/node/vrml97/point_set.cpp
===================================================================
--- trunk/src/node/vrml97/point_set.cpp 2009-04-17 05:17:31 UTC (rev 3892)
+++ trunk/src/node/vrml97/point_set.cpp 2009-04-22 05:22:14 UTC (rev 3893)
@@ -47,9 +47,10 @@
const boost::shared_ptr<openvrml::scope> & scope);
virtual ~point_set_node() OPENVRML_NOTHROW;
- virtual bool modified() const;
-
private:
+ virtual bool do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error);
+
virtual const openvrml::bounding_volume &
do_bounding_volume() const;
@@ -121,13 +122,11 @@
* @return @c true if the node or one of its children has been modified,
* @c false otherwise.
*/
- bool point_set_node::modified() const
+ bool point_set_node::do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error)
{
- return this->node::modified()
- || (this->color_.sfnode::value()
- && this->color_.sfnode::value()->modified())
- || (this->coord_.sfnode::value()
- && this->coord_.sfnode::value()->modified());
+ return (this->color_.value() && this->color_.value()->modified())
+ || (this->coord_.value() && this->coord_.value()->modified());
}
/**
Modified: trunk/src/node/vrml97/shape.cpp
===================================================================
--- trunk/src/node/vrml97/shape.cpp 2009-04-17 05:17:31 UTC (rev 3892)
+++ trunk/src/node/vrml97/shape.cpp 2009-04-22 05:22:14 UTC (rev 3893)
@@ -47,9 +47,10 @@
const boost::shared_ptr<openvrml::scope> & scope);
virtual ~shape_node() OPENVRML_NOTHROW;
- virtual bool modified() const;
+ private:
+ virtual bool do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error);
- private:
virtual const openvrml::bounding_volume & do_bounding_volume() const;
virtual void do_render_child(openvrml::viewer & viewer,
@@ -110,13 +111,12 @@
* @return @c true if the node or one of its children has been modified,
* @c false otherwise.
*/
- bool shape_node::modified() const
+ bool shape_node::do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error)
{
- return this->node::modified()
- || (this->geometry_.sfnode::value()
- && this->geometry_.sfnode::value()->modified())
- || (this->appearance_.sfnode::value()
- && this->appearance_.sfnode::value()->modified());
+ return (this->geometry_.value() && this->geometry_.value()->modified())
+ || (this->appearance_.value()
+ && this->appearance_.value()->modified());
}
OPENVRML_LOCAL void set_unlit_material(openvrml::viewer & v)
Modified: trunk/src/node/vrml97/switch.cpp
===================================================================
--- trunk/src/node/vrml97/switch.cpp 2009-04-17 05:17:31 UTC (rev 3892)
+++ trunk/src/node/vrml97/switch.cpp 2009-04-22 05:22:14 UTC (rev 3893)
@@ -58,9 +58,10 @@
const boost::shared_ptr<openvrml::scope> & scope);
virtual ~switch_node() OPENVRML_NOTHROW;
- virtual bool modified() const;
-
private:
+ virtual bool do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error);
+
virtual void do_children_event_side_effect(const openvrml::mfnode & choice,
double timestamp)
OPENVRML_THROW1(std::bad_alloc);
@@ -238,17 +239,15 @@
/**
* @brief Determine whether the node has been modified.
*
- * @return @c true if the node or one of its children has been modified,
- * @c false otherwise.
+ * @return @c true if one of the node's rendered children has been
+ * modified, @c false otherwise.
*/
- bool switch_node::modified() const
+ bool switch_node::do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error)
{
- if (this->node::modified()) { return true; }
-
- long w = this->which_choice_.sfint32::value();
-
- return w >= 0 && size_t(w) < this->children_.mfnode::value().size()
- && this->children_.mfnode::value()[w]->modified();
+ const openvrml::int32 w = this->which_choice_.value();
+ return w >= 0 && static_cast<size_t>(w) < this->children_.value().size()
+ && this->children_.value()[w]->modified();
}
/**
Modified: trunk/src/node/vrml97/text.cpp
===================================================================
--- trunk/src/node/vrml97/text.cpp 2009-04-17 05:17:31 UTC (rev 3892)
+++ trunk/src/node/vrml97/text.cpp 2009-04-22 05:22:14 UTC (rev 3893)
@@ -163,9 +163,10 @@
const boost::shared_ptr<openvrml::scope> & scope);
virtual ~text_node() OPENVRML_NOTHROW;
- virtual bool modified() const;
+ private:
+ virtual bool do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error);
- private:
virtual void do_render_geometry(openvrml::viewer & viewer,
openvrml::rendering_context context);
@@ -1093,11 +1094,11 @@
* @return @c true if the node or one of its children has been modified,
* @c false otherwise.
*/
- bool text_node::modified() const
+ bool text_node::do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error)
{
- return this->node::modified()
- || (this->font_style_.sfnode::value()
- && this->font_style_.sfnode::value()->modified());
+ return this->font_style_.value()
+ && this->font_style_.value()->modified();
}
/**
Modified: trunk/src/node/x3d-cad-geometry/cad_face.cpp
===================================================================
--- trunk/src/node/x3d-cad-geometry/cad_face.cpp 2009-04-17 05:17:31 UTC (rev 3892)
+++ trunk/src/node/x3d-cad-geometry/cad_face.cpp 2009-04-22 05:22:14 UTC (rev 3893)
@@ -50,9 +50,10 @@
const boost::shared_ptr<openvrml::scope> & scope);
virtual ~cad_face_node() OPENVRML_NOTHROW;
- virtual bool modified() const;
+ protected:
+ virtual bool do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error);
- protected:
virtual const openvrml::bounding_volume & do_bounding_volume() const;
virtual const std::vector<boost::intrusive_ptr<node> >
do_children() const OPENVRML_THROW1(std::bad_alloc);
@@ -105,11 +106,10 @@
* @return @c true if the node or it child has been modified
* @c false otherwise.
*/
- bool cad_face_node::modified() const
+ bool cad_face_node::do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error)
{
- if (this->node::modified()) { return true; }
- if (shape_.sfnode::value().get() == NULL) { return false; }
- return shape_.sfnode::value()->modified();
+ return this->shape_.value() && this->shape_.value()->modified();
}
/**
Modified: trunk/src/node/x3d-cad-geometry/indexed_quad_set.cpp
===================================================================
--- trunk/src/node/x3d-cad-geometry/indexed_quad_set.cpp 2009-04-17 05:17:31 UTC (rev 3892)
+++ trunk/src/node/x3d-cad-geometry/indexed_quad_set.cpp 2009-04-22 05:22:14 UTC (rev 3893)
@@ -71,9 +71,11 @@
virtual ~indexed_quad_set_node() OPENVRML_NOTHROW;
virtual const color_node * color() const OPENVRML_NOTHROW;
- virtual bool modified() const;
private:
+ virtual bool do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error);
+
virtual const openvrml::bounding_volume &
do_bounding_volume() const;
@@ -275,17 +277,14 @@
* @return @c true if the node or one of its children has been modified,
* @c false otherwise.
*/
- bool indexed_quad_set_node::modified() const
+ bool indexed_quad_set_node::do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error)
{
- return this->node::modified()
- || (this->color_.sfnode::value()
- && this->color_.sfnode::value()->modified())
- || (this->coord_.sfnode::value()
- && this->coord_.sfnode::value()->modified())
- || (this->normal_.sfnode::value()
- && this->normal_.sfnode::value()->modified())
- || (this->tex_coord_.sfnode::value()
- && this->tex_coord_.sfnode::value()->modified());
+ return (this->color_.value() && this->color_.value()->modified())
+ || (this->coord_.value() && this->coord_.value()->modified())
+ || (this->normal_.value() && this->normal_.value()->modified())
+ || (this->tex_coord_.value()
+ && this->tex_coord_.value()->modified());
}
}
Modified: trunk/src/node/x3d-geometry2d/arc2d.cpp
===================================================================
--- trunk/src/node/x3d-geometry2d/arc2d.cpp 2009-04-17 05:17:31 UTC (rev 3892)
+++ trunk/src/node/x3d-geometry2d/arc2d.cpp 2009-04-22 05:22:14 UTC (rev 3893)
@@ -49,7 +49,6 @@
const boost::shared_ptr<openvrml::scope> & scope);
virtual ~arc2d_node() OPENVRML_NOTHROW;
- virtual bool modified() const;
private:
virtual void do_render_geometry(openvrml::viewer & viewer,
rendering_context context);
@@ -97,17 +96,6 @@
/**
- * @brief Determine whether the node has been modified.
- *
- * @return @c true if the node or one of its children has been modified,
- * @c false otherwise.
- */
- bool arc2d_node::modified() const
- {
- return this->node::modified();
- }
-
- /**
* @brief Construct.
*
* @param type the @c node_type associated with this @c node.
Modified: trunk/src/node/x3d-geometry2d/arc_close2d.cpp
===================================================================
--- trunk/src/node/x3d-geometry2d/arc_close2d.cpp 2009-04-17 05:17:31 UTC (rev 3892)
+++ trunk/src/node/x3d-geometry2d/arc_close2d.cpp 2009-04-22 05:22:14 UTC (rev 3893)
@@ -53,7 +53,6 @@
const boost::shared_ptr<openvrml::scope> & scope);
virtual ~arc_close2d_node() OPENVRML_NOTHROW;
- virtual bool modified() const;
private:
virtual void do_render_geometry(openvrml::viewer & viewer,
rendering_context context);
@@ -111,19 +110,7 @@
const rendering_context /* context */)
{}
-
/**
- * @brief Determine whether the node has been modified.
- *
- * @return @c true if the node or one of its children has been modified,
- * @c false otherwise.
- */
- bool arc_close2d_node::modified() const
- {
- return this->node::modified();
- }
-
- /**
* @brief Construct.
*
* @param type the node_type associated with this node.
Modified: trunk/src/node/x3d-geometry2d/circle2d.cpp
===================================================================
--- trunk/src/node/x3d-geometry2d/circle2d.cpp 2009-04-17 05:17:31 UTC (rev 3892)
+++ trunk/src/node/x3d-geometry2d/circle2d.cpp 2009-04-22 05:22:14 UTC (rev 3893)
@@ -47,7 +47,6 @@
const boost::shared_ptr<openvrml::scope> & scope);
virtual ~circle2d_node() OPENVRML_NOTHROW;
- virtual bool modified() const;
private:
virtual void do_render_geometry(openvrml::viewer & viewer,
rendering_context context);
@@ -80,19 +79,7 @@
const rendering_context /* context */)
{}
-
/**
- * @brief Determine whether the node has been modified.
- *
- * @return @c true if the node or one of its children has been modified,
- * @c false otherwise.
- */
- bool circle2d_node::modified() const
- {
- return this->node::modified();
- }
-
- /**
* @brief Construct.
*
* @param type the node_type associated with this node.
Modified: trunk/src/node/x3d-geometry2d/disk2d.cpp
===================================================================
--- trunk/src/node/x3d-geometry2d/disk2d.cpp 2009-04-17 05:17:31 UTC (rev 3892)
+++ trunk/src/node/x3d-geometry2d/disk2d.cpp 2009-04-22 05:22:14 UTC (rev 3893)
@@ -49,7 +49,6 @@
const boost::shared_ptr<openvrml::scope> & scope);
virtual ~disk2d_node() OPENVRML_NOTHROW;
- virtual bool modified() const;
private:
virtual void do_render_geometry(openvrml::viewer & viewer,
rendering_context context);
@@ -95,17 +94,6 @@
{}
/**
- * @brief Determine whether the node has been modified.
- *
- * @return @c true if the node or one of its children has been modified,
- * @c false otherwise.
- */
- bool disk2d_node::modified() const
- {
- return this->node::modified();
- }
-
- /**
* @brief Construct.
*
* @param type the node_type associated with this node.
Modified: trunk/src/node/x3d-geometry2d/polypoint2d.cpp
===================================================================
--- trunk/src/node/x3d-geometry2d/polypoint2d.cpp 2009-04-17 05:17:31 UTC (rev 3892)
+++ trunk/src/node/x3d-geometry2d/polypoint2d.cpp 2009-04-22 05:22:14 UTC (rev 3893)
@@ -49,7 +49,6 @@
const boost::shared_ptr<openvrml::scope> & scope);
virtual ~polypoint2d_node() OPENVRML_NOTHROW;
- virtual bool modified() const;
private:
virtual void do_render_geometry(openvrml::viewer & viewer,
rendering_context context);
@@ -83,19 +82,7 @@
const rendering_context /* context */)
{}
-
/**
- * @brief Determine whether the node has been modified.
- *
- * @return @c true if the node or one of its children has been modified,
- * @c false otherwise.
- */
- bool polypoint2d_node::modified() const
- {
- return this->node::modified();
- }
-
- /**
* @brief Construct.
*
* @param type the node_type associated with this node.
Modified: trunk/src/node/x3d-geometry2d/rectangle2d.cpp
===================================================================
--- trunk/src/node/x3d-geometry2d/rectangle2d.cpp 2009-04-17 05:17:31 UTC (rev 3892)
+++ trunk/src/node/x3d-geometry2d/rectangle2d.cpp 2009-04-22 05:22:14 UTC (rev 3893)
@@ -50,7 +50,6 @@
const boost::shared_ptr<openvrml::scope> & scope);
virtual ~rectangle2d_node() OPENVRML_NOTHROW;
- virtual bool modified() const;
private:
virtual void do_render_geometry(openvrml::viewer & viewer,
rendering_context context);
@@ -90,19 +89,7 @@
const rendering_context /* context */)
{}
-
/**
- * @brief Determine whether the node has been modified.
- *
- * @return @c true if the node or one of its children has been modified,
- * @c false otherwise.
- */
- bool rectangle2d_node::modified() const
- {
- return this->node::modified();
- }
-
- /**
* @brief Construct.
*
* @param type the node_type associated with this node.
Modified: trunk/src/node/x3d-geometry2d/triangle_set2d.cpp
===================================================================
--- trunk/src/node/x3d-geometry2d/triangle_set2d.cpp 2009-04-17 05:17:31 UTC (rev 3892)
+++ trunk/src/node/x3d-geometry2d/triangle_set2d.cpp 2009-04-22 05:22:14 UTC (rev 3893)
@@ -50,7 +50,6 @@
const boost::shared_ptr<openvrml::scope> & scope);
virtual ~triangle_set2d_node() OPENVRML_NOTHROW;
- virtual bool modified() const;
private:
virtual void do_render_geometry(openvrml::viewer & viewer,
rendering_context context);
@@ -90,19 +89,7 @@
const rendering_context /* context */)
{}
-
/**
- * @brief Determine whether the node has been modified.
- *
- * @return @c true if the node or one of its children has been modified,
- * @c false otherwise.
- */
- bool triangle_set2d_node::modified() const
- {
- return this->node::modified();
- }
-
- /**
* @brief Construct.
*
* @param type the node_type associated with this node.
Modified: trunk/src/node/x3d-geospatial/geo_elevation_grid.cpp
===================================================================
--- trunk/src/node/x3d-geospatial/geo_elevation_grid.cpp 2009-04-17 05:17:31 UTC (rev 3892)
+++ trunk/src/node/x3d-geospatial/geo_elevation_grid.cpp 2009-04-22 05:22:14 UTC (rev 3893)
@@ -79,9 +79,12 @@
const boost::shared_ptr<openvrml::scope> & scope);
virtual ~geo_elevation_grid_node() OPENVRML_NOTHROW;
- virtual bool modified() const;
virtual const color_node * color() const OPENVRML_NOTHROW;
+
private:
+ virtual bool do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error);
+
virtual void do_render_geometry(openvrml::viewer & viewer,
rendering_context context);
};
@@ -246,9 +249,11 @@
* @return @c true if the node or one of its children has been modified,
* @c false otherwise.
*/
- bool geo_elevation_grid_node::modified() const
+ bool geo_elevation_grid_node::do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error)
{
- return this->node::modified();
+ return this->geo_origin_.value()
+ && this->geo_origin_.value()->modified();
}
/**
Modified: trunk/src/node/x3d-grouping/static_group.cpp
===================================================================
--- trunk/src/node/x3d-grouping/static_group.cpp 2009-04-17 05:17:31 UTC (rev 3892)
+++ trunk/src/node/x3d-grouping/static_group.cpp 2009-04-22 05:22:14 UTC (rev 3893)
@@ -54,10 +54,10 @@
const boost::shared_ptr<openvrml::scope> & scope);
virtual ~static_group_node() OPENVRML_NOTHROW;
-
- virtual bool modified() const;
-
protected:
+ virtual bool do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error);
+
virtual void do_render_child(openvrml::viewer & viewer,
rendering_context context);
virtual const openvrml::bounding_volume &
@@ -114,13 +114,11 @@
* @return @c true if the node or one of its children has been modified,
* @c false otherwise.
*/
- bool static_group_node::modified() const
+ bool static_group_node::do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error)
{
- if (this->node::modified()) { return true; }
- for (size_t i = 0; i < this->children_.mfnode::value().size(); ++i) {
- if (this->children_.mfnode::value()[i]->modified()) {
- return true;
- }
+ for (size_t i = 0; i < this->children_.value().size(); ++i) {
+ if (this->children_.value()[i]->modified()) { return true; }
}
return false;
}
Modified: trunk/src/node/x3d-nurbs/nurbs_curve.cpp
===================================================================
--- trunk/src/node/x3d-nurbs/nurbs_curve.cpp 2009-04-17 05:17:31 UTC (rev 3892)
+++ trunk/src/node/x3d-nurbs/nurbs_curve.cpp 2009-04-22 05:22:14 UTC (rev 3893)
@@ -54,8 +54,10 @@
const boost::shared_ptr<openvrml::scope> & scope);
virtual ~nurbs_curve_node() OPENVRML_NOTHROW;
- virtual bool modified() const;
private:
+ virtual bool do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error);
+
virtual void do_render_geometry(openvrml::viewer & viewer,
rendering_context context);
};
@@ -118,16 +120,17 @@
const rendering_context /* context */)
{}
-
/**
* @brief Determine whether the node has been modified.
*
* @return @c true if the node or one of its children has been modified,
* @c false otherwise.
*/
- bool nurbs_curve_node::modified() const
+ bool nurbs_curve_node::do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error)
{
- return this->node::modified();
+ return this->control_point_.value()
+ && this->control_point_.value()->modified();
}
/**
Modified: trunk/src/node/x3d-nurbs/nurbs_patch_surface.cpp
===================================================================
--- trunk/src/node/x3d-nurbs/nurbs_patch_surface.cpp 2009-04-17 05:17:31 UTC (rev 3892)
+++ trunk/src/node/x3d-nurbs/nurbs_patch_surface.cpp 2009-04-22 05:22:14 UTC (rev 3893)
@@ -63,8 +63,10 @@
const boost::shared_ptr<openvrml::scope> & scope);
virtual ~nurbs_patch_surface_node() OPENVRML_NOTHROW;
- virtual bool modified() const;
private:
+ virtual bool do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error);
+
virtual void do_render_geometry(openvrml::viewer & viewer,
rendering_context context);
};
@@ -182,9 +184,13 @@
* @return @c true if the node or one of its children has been modified,
* @c false otherwise.
*/
- bool nurbs_patch_surface_node::modified() const
+ bool nurbs_patch_surface_node::do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error)
{
- return this->node::modified();
+ return (this->control_point_.value()
+ && this->control_point_.value()->modified())
+ || (this->tex_coord_.value()
+ && this->tex_coord_.value()->modified());
}
/**
Modified: trunk/src/node/x3d-nurbs/nurbs_swept_surface.cpp
===================================================================
--- trunk/src/node/x3d-nurbs/nurbs_swept_surface.cpp 2009-04-17 05:17:31 UTC (rev 3892)
+++ trunk/src/node/x3d-nurbs/nurbs_swept_surface.cpp 2009-04-22 05:22:14 UTC (rev 3893)
@@ -53,8 +53,10 @@
const boost::shared_ptr<openvrml::scope> & scope);
virtual ~nurbs_swept_surface_node() OPENVRML_NOTHROW;
- virtual bool modified() const;
private:
+ virtual bool do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error);
+
virtual void do_render_geometry(openvrml::viewer & viewer,
rendering_context context);
};
@@ -105,16 +107,19 @@
const rendering_context /* context */)
{}
-
/**
* @brief Determine whether the node has been modified.
*
* @return @c true if the node or one of its children has been modified,
* @c false otherwise.
*/
- bool nurbs_swept_surface_node::modified() const
+ bool nurbs_swept_surface_node::do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error)
{
- return this->node::modified();
+ return (this->cross_section_curve_.value()
+ && this->cross_section_curve_.value()->modified())
+ || (this->trajectory_curve_.value()
+ && this->trajectory_curve_.value()->modified());
}
/**
Modified: trunk/src/node/x3d-nurbs/nurbs_swung_surface.cpp
===================================================================
--- trunk/src/node/x3d-nurbs/nurbs_swung_surface.cpp 2009-04-17 05:17:31 UTC (rev 3892)
+++ trunk/src/node/x3d-nurbs/nurbs_swung_surface.cpp 2009-04-22 05:22:14 UTC (rev 3893)
@@ -53,8 +53,10 @@
const boost::shared_ptr<openvrml::scope> & scope);
virtual ~nurbs_swung_surface_node() OPENVRML_NOTHROW;
- virtual bool modified() const;
private:
+ virtual bool do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error);
+
virtual void do_render_geometry(openvrml::viewer & viewer,
rendering_context context);
};
@@ -112,9 +114,13 @@
* @return @c true if the node or one of its children has been modified,
* @c false otherwise.
*/
- bool nurbs_swung_surface_node::modified() const
+ bool nurbs_swung_surface_node::do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error)
{
- return this->node::modified();
+ return (this->componentcurve_.value()
+ && this->componentcurve_.value()->modified())
+ || (this->trajectory_curve_.value()
+ && this->trajectory_curve_.value()->modified());
}
/**
Modified: trunk/src/node/x3d-nurbs/nurbs_trimmed_surface.cpp
===================================================================
--- trunk/src/node/x3d-nurbs/nurbs_trimmed_surface.cpp 2009-04-17 05:17:31 UTC (rev 3892)
+++ trunk/src/node/x3d-nurbs/nurbs_trimmed_surface.cpp 2009-04-22 05:22:14 UTC (rev 3893)
@@ -89,8 +89,10 @@
const boost::shared_ptr<openvrml::scope> & scope);
virtual ~nurbs_trimmed_surface_node() OPENVRML_NOTHROW;
- virtual bool modified() const;
private:
+ virtual bool do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error);
+
virtual void do_render_geometry(openvrml::viewer & viewer,
rendering_context context);
};
@@ -261,16 +263,27 @@
const rendering_context /* context */)
{}
-
/**
* @brief Determine whether the node has been modified.
*
* @return @c true if the node or one of its children has been modified,
* @c false otherwise.
*/
- bool nurbs_trimmed_surface_node::modified() const
+ bool nurbs_trimmed_surface_node::do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error)
{
- return this->node::modified();
+ if ((this->control_point_.value()
+ && this->control_point_.value()->modified())
+ || this->tex_coord_.value() && this->tex_coord_.value()->modified())
+ {
+ return true;
+ }
+
+ for (size_t i = 0; i < this->trimming_contour_.value().size(); ++i) {
+ if (this->trimming_contour_.value()[i]->modified()) { return true; }
+ }
+
+ return false;
}
/**
Modified: trunk/src/node/x3d-rendering/indexed_triangle_fan_set.cpp
===================================================================
--- trunk/src/node/x3d-rendering/indexed_triangle_fan_set.cpp 2009-04-17 05:17:31 UTC (rev 3892)
+++ trunk/src/node/x3d-rendering/indexed_triangle_fan_set.cpp 2009-04-22 05:22:14 UTC (rev 3893)
@@ -71,9 +71,12 @@
const boost::shared_ptr<openvrml::scope> & scope);
virtual ~indexed_triangle_fan_set_node() OPENVRML_NOTHROW;
- virtual bool modified() const;
virtual const color_node * color() const OPENVRML_NOTHROW;
+
private:
+ virtual bool do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error);
+
virtual void do_render_geometry(openvrml::viewer & viewer,
rendering_context context);
virtual const openvrml::bounding_volume & do_bounding_volume() const;
@@ -237,9 +240,14 @@
* @return @c true if the node or one of its children has been modified,
* @c false otherwise.
*/
- bool indexed_triangle_fan_set_node::modified() const
+ bool indexed_triangle_fan_set_node::do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error)
{
- return this->node::modified();
+ return (this->color_.value() && this->color_.value()->modified())
+ || (this->coord_.value() && this->coord_.value()->modified())
+ || (this->normal_.value() && this->normal_.value()->modified())
+ || (this->tex_coord_.value()
+ && this->tex_coord_.value()->modified());
}
/**
Modified: trunk/src/node/x3d-rendering/indexed_triangle_set.cpp
===================================================================
--- trunk/src/node/x3d-rendering/indexed_triangle_set.cpp 2009-04-17 05:17:31 UTC (rev 3892)
+++ trunk/src/node/x3d-rendering/indexed_triangle_set.cpp 2009-04-22 05:22:14 UTC (rev 3893)
@@ -75,9 +75,12 @@
const boost::shared_ptr<openvrml::scope> & scope);
virtual ~indexed_triangle_set_node() OPENVRML_NOTHROW;
- virtual bool modified() const;
virtual const color_node * color() const OPENVRML_NOTHROW;
+
private:
+ virtual bool do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error);
+
virtual void do_render_geometry(openvrml::viewer & viewer,
rendering_context context);
virtual const openvrml::bounding_volume &
@@ -235,9 +238,14 @@
* @return @c true if the node or one of its children has been modified,
* @c false otherwise.
*/
- bool indexed_triangle_set_node::modified() const
+ bool indexed_triangle_set_node::do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error)
{
- return this->node::modified();
+ return (this->color_.value() && this->color_.value()->modified())
+ || (this->coord_.value() && this->coord_.value()->modified())
+ || (this->normal_.value() && this->normal_.value()->modified())
+ || (this->tex_coord_.value()
+ && this->tex_coord_.value()->modified());
}
/**
Modified: trunk/src/node/x3d-rendering/triangle_fan_set.cpp
===================================================================
--- trunk/src/node/x3d-rendering/triangle_fan_set.cpp 2009-04-17 05:17:31 UTC (rev 3892)
+++ trunk/src/node/x3d-rendering/triangle_fan_set.cpp 2009-04-22 05:22:14 UTC (rev 3893)
@@ -60,9 +60,12 @@
const boost::shared_ptr<openvrml::scope> & scope);
virtual ~triangle_fan_set_node() OPENVRML_NOTHROW;
- virtual bool modified() const;
virtual const color_node * color() const OPENVRML_NOTHROW;
+
private:
+ virtual bool do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error);
+
virtual void do_render_geometry(openvrml::viewer & viewer,
rendering_context context);
virtual const openvrml::bounding_volume &
@@ -195,9 +198,14 @@
* @return @c true if the node or one of its children has been modified,
* @c false otherwise.
*/
- bool triangle_fan_set_node::modified() const
+ bool triangle_fan_set_node::do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error)
{
- return this->node::modified();
+ return (this->color_.value() && this->color_.value()->modified())
+ || (this->coord_.value() && this->coord_.value()->modified())
+ || (this->normal_.value() && this->normal_.value()->modified())
+ || (this->tex_coord_.value()
+ && this->tex_coord_.value()->modified());
}
/**
Modified: trunk/src/node/x3d-rendering/triangle_set.cpp
===================================================================
--- trunk/src/node/x3d-rendering/triangle_set.cpp 2009-04-17 05:17:31 UTC (rev 3892)
+++ trunk/src/node/x3d-rendering/triangle_set.cpp 2009-04-22 05:22:14 UTC (rev 3893)
@@ -58,9 +58,12 @@
const boost::shared_ptr<openvrml::scope> & scope);
virtual ~triangle_set_node() OPENVRML_NOTHROW;
- virtual bool modified() const;
virtual const color_node * color() const OPENVRML_NOTHROW;
+
private:
+ virtual bool do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error);
+
virtual void do_render_geometry(openvrml::viewer & viewer,
rendering_context context);
virtual const openvrml::bounding_volume &
@@ -187,9 +190,14 @@
* @return @c true if the node or one of its children has been modified,
* @c false otherwise.
*/
- bool triangle_set_node::modified() const
+ bool triangle_set_node::do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error)
{
- return this->node::modified();
+ return (this->color_.value() && this->color_.value()->modified())
+ || (this->coord_.value() && this->coord_.value()->modified())
+ || (this->normal_.value() && this->normal_.value()->modified())
+ || (this->tex_coord_.value()
+ && this->tex_coord_.value()->modified());
}
/**
Modified: trunk/src/node/x3d-rendering/triangle_strip_set.cpp
===================================================================
--- trunk/src/node/x3d-rendering/triangle_strip_set.cpp 2009-04-17 05:17:31 UTC (rev 3892)
+++ trunk/src/node/x3d-rendering/triangle_strip_set.cpp 2009-04-22 05:22:14 UTC (rev 3893)
@@ -60,9 +60,12 @@
const boost::shared_ptr<openvrml::scope> & scope);
virtual ~triangle_strip_set_node() OPENVRML_NOTHROW;
- virtual bool modified() const;
virtual const color_node * color() const OPENVRML_NOTHROW;
+
private:
+ virtual bool do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error);
+
virtual void do_render_geometry(openvrml::viewer & viewer,
rendering_context context);
virtual const openvrml::bounding_volume &
@@ -195,9 +198,14 @@
* @return @c true if the node or one of its children has been modified,
* @c false otherwise.
*/
- bool triangle_strip_set_node::modified() const
+ bool triangle_strip_set_node::do_modified() const
+ OPENVRML_THROW1(boost::thread_resource_error)
{
- return this->node::modified();
+ return (this->color_.value() && this->color_.value()->modified())
+ || (this->coord_.value() && this->coord_.value()->modified())
+ || (this->normal_.value() && this->normal_.value()->modified())
+ || (this->tex_coord_.value()
+ && this->tex_coord_.value()->modified());
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|