|
From: <br...@us...> - 2009-04-03 07:15:29
|
Revision: 3881
http://openvrml.svn.sourceforge.net/openvrml/?rev=3881&view=rev
Author: braden
Date: 2009-04-03 07:15:23 +0000 (Fri, 03 Apr 2009)
Log Message:
-----------
Get rid of the last vestiges of openvrml::viewer::object_t.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/libopenvrml/openvrml/viewer.cpp
trunk/src/libopenvrml/openvrml/viewer.h
trunk/src/libopenvrml-gl/openvrml/gl/viewer.cpp
trunk/src/libopenvrml-gl/openvrml/gl/viewer.h
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2009-04-03 06:28:17 UTC (rev 3880)
+++ trunk/ChangeLog 2009-04-03 07:15:23 UTC (rev 3881)
@@ -1,5 +1,43 @@
2009-04-03 Braden McDaniel <br...@en...>
+ Get rid of the last vestiges of openvrml::viewer::object_t.
+
+ * src/libopenvrml/openvrml/viewer.cpp
+ (openvrml::viewer::begin_object(const char *, bool)): Return void.
+ (openvrml::viewer::insert_background(const std::vector<float> &,
+ const std::vector<color> &, const std::vector<float> &, const
+ std::vector<color> &, const texture_node &, const texture_node &,
+ const texture_node &, const texture_node &, const texture_node &,
+ const texture_node &)): Return void.
+ (openvrml::viewer::insert_dir_light(float, float, const color &,
+ const vec3f &)): Return void.
+ (openvrml::viewer::insert_point_light(float, const vec3f &, const
+ color &, float, const vec3f &, float)): Return void.
+ (openvrml::viewer::insert_spot_light(float, const vec3f &, float,
+ const color &, float, const vec3f &, float, const vec3f &,
+ float)): Return void.
+ * src/libopenvrml/openvrml/viewer.h
+ (openvrml::viewer): Removed object_t member typedef.
+ * src/libopenvrml-gl/openvrml/gl/viewer.cpp
+ (openvrml::gl::viewer::do_begin_object(const char *, bool)):
+ Return void.
+ (openvrml::gl::viewer::do_insert_background(const
+ std::vector<float> &, const std::vector<color> &, const
+ std::vector<float> &, const std::vector<color> &, const
+ texture_node &, const texture_node &, const texture_node &, const
+ texture_node &, const texture_node &, const texture_node &)):
+ Return void.
+ (openvrml::gl::viewer::do_insert_dir_light(float, float, const
+ color &, const vec3f &)): Return void.
+ (openvrml::gl::viewer::do_insert_point_light(float, const vec3f &,
+ const color &, float, const vec3f &, float)): Return void.
+ (openvrml::gl::viewer::do_insert_spot_light(float, const vec3f &,
+ float, const color &, float, const vec3f &, float, const vec3f &,
+ float)): Return void.
+ * src/libopenvrml-gl/openvrml/gl/viewer.h
+
+2009-04-03 Braden McDaniel <br...@en...>
+
Localize the management of display list and texture object
references inside the renderer.
Modified: trunk/src/libopenvrml/openvrml/viewer.cpp
===================================================================
--- trunk/src/libopenvrml/openvrml/viewer.cpp 2009-04-03 06:28:17 UTC (rev 3880)
+++ trunk/src/libopenvrml/openvrml/viewer.cpp 2009-04-03 07:15:23 UTC (rev 3881)
@@ -106,12 +106,6 @@
*/
/**
- * @typedef openvrml::viewer::object_t
- *
- * @brief An object handle.
- */
-
-/**
* @brief Construct.
*/
openvrml::viewer::viewer() OPENVRML_NOTHROW:
@@ -200,24 +194,19 @@
* @param[in] retain whether the object should be retained for reuse.
*
* This function delegates to @c viewer::do_begin_object.
- *
- * @return the display object identifier.
*/
-openvrml::viewer::object_t openvrml::viewer::begin_object(const char * id,
- bool retain)
+void openvrml::viewer::begin_object(const char * id, bool retain)
{
return this->do_begin_object(id, retain);
}
/**
- * @fn openvrml::viewer::object_t openvrml::viewer::do_begin_object(const char * id, bool retain)
+ * @fn void openvrml::viewer::do_begin_object(const char * id, bool retain)
*
* @brief Begin a display list.
*
* @param[in] id object identifier.
* @param[in] retain whether the object should be retained for reuse.
- *
- * @return the display object identifier.
*/
/**
@@ -251,10 +240,8 @@
* @param[in] right right texture.
* @param[in] top top texture.
* @param[in] bottom bottom texture.
- *
- * @return display object identifier.
*/
-openvrml::viewer::object_t
+void
openvrml::viewer::insert_background(const std::vector<float> & ground_angle,
const std::vector<color> & ground_color,
const std::vector<float> & sky_angle,
@@ -272,7 +259,7 @@
}
/**
- * @fn openvrml::viewer::object_t openvrml::viewer::do_insert_background(const std::vector<float> & ground_angle, const std::vector<color> & ground_color, const std::vector<float> & sky_angle, const std::vector<color> & sky_color, const texture_node & front, const texture_node & back, const texture_node & left, const texture_node & right, const texture_node & top, const texture_node & bottom)
+ * @fn void openvrml::viewer::do_insert_background(const std::vector<float> & ground_angle, const std::vector<color> & ground_color, const std::vector<float> & sky_angle, const std::vector<color> & sky_color, const texture_node & front, const texture_node & back, const texture_node & left, const texture_node & right, const texture_node & top, const texture_node & bottom)
*
* @brief Insert a background into a display list.
*
@@ -286,8 +273,6 @@
* @param[in] right right texture.
* @param[in] top top texture.
* @param[in] bottom bottom texture.
- *
- * @return display object identifier.
*/
/**
@@ -620,14 +605,11 @@
* @param[in] intensity intensity.
* @param[in] color color.
* @param[in] direction direction.
- *
- * @return display object identifier.
*/
-openvrml::viewer::object_t
-openvrml::viewer::insert_dir_light(const float ambient_intensity,
- const float intensity,
- const color & color,
- const vec3f & direction)
+void openvrml::viewer::insert_dir_light(const float ambient_intensity,
+ const float intensity,
+ const color & color,
+ const vec3f & direction)
{
return this->do_insert_dir_light(ambient_intensity,
intensity,
@@ -636,7 +618,7 @@
}
/**
- * @fn openvrml::viewer::object_t openvrml::viewer::do_insert_dir_light(float ambient_intensity, float intensity , const color & color, const vec3f & direction)
+ * @fn void openvrml::viewer::do_insert_dir_light(float ambient_intensity, float intensity , const color & color, const vec3f & direction)
*
* @brief Insert a directional light into a display list.
*
@@ -644,8 +626,6 @@
* @param[in] intensity intensity.
* @param[in] color color.
* @param[in] direction direction.
- *
- * @return display object identifier.
*/
/**
@@ -659,16 +639,13 @@
* @param[in] intensity intensity.
* @param[in] location location.
* @param[in] radius radius.
- *
- * @return display object identifier.
*/
-openvrml::viewer::object_t
-openvrml::viewer::insert_point_light(const float ambient_intensity,
- const vec3f & attenuation,
- const color & color,
- const float intensity,
- const vec3f & location,
- const float radius)
+void openvrml::viewer::insert_point_light(const float ambient_intensity,
+ const vec3f & attenuation,
+ const color & color,
+ const float intensity,
+ const vec3f & location,
+ const float radius)
{
return this->do_insert_point_light(ambient_intensity,
attenuation,
@@ -679,7 +656,7 @@
}
/**
- * @fn openvrml::viewer::object_t openvrml::viewer::do_insert_point_light(float ambient_intensity, const vec3f & attenuation, const color & color, float intensity, const vec3f & location, float radius)
+ * @fn void openvrml::viewer::do_insert_point_light(float ambient_intensity, const vec3f & attenuation, const color & color, float intensity, const vec3f & location, float radius)
*
* @brief Insert a point light into a display list.
*
@@ -689,8 +666,6 @@
* @param[in] intensity intensity.
* @param[in] location location.
* @param[in] radius radius.
- *
- * @return display object identifier.
*/
/**
@@ -707,19 +682,16 @@
* @param[in] intensity intensity.
* @param[in] location location.
* @param[in] radius radius.
- *
- * @return display object identifier.
*/
-openvrml::viewer::object_t
-openvrml::viewer::insert_spot_light(const float ambient_intensity,
- const vec3f & attenuation,
- const float beam_width,
- const color & color,
- const float cut_off_angle,
- const vec3f & direction,
- const float intensity,
- const vec3f & location,
- const float radius)
+void openvrml::viewer::insert_spot_light(const float ambient_intensity,
+ const vec3f & attenuation,
+ const float beam_width,
+ const color & color,
+ const float cut_off_angle,
+ const vec3f & direction,
+ const float intensity,
+ const vec3f & location,
+ const float radius)
{
return this->do_insert_spot_light(ambient_intensity,
attenuation,
@@ -733,7 +705,7 @@
}
/**
- * @fn openvrml::viewer::object_t openvrml::viewer::do_insert_spot_light(float ambient_intensity, const vec3f & attenuation, float beam_width, const color & color, float cut_off_angle, const vec3f & direction, float intensity, const vec3f & location, float radius)
+ * @fn void openvrml::viewer::do_insert_spot_light(float ambient_intensity, const vec3f & attenuation, float beam_width, const color & color, float cut_off_angle, const vec3f & direction, float intensity, const vec3f & location, float radius)
*
* @brief Insert a point light into a display list.
*
@@ -746,8 +718,6 @@
* @param[in] intensity intensity.
* @param[in] location location.
* @param[in] radius radius.
- *
- * @return display object identifier.
*/
/**
@@ -938,7 +908,7 @@
}
/**
- * @fn openvrml::viewer::texture_object_t openvrml::viewer::do_insert_texture(const texture_node & n, bool retainHint)
+ * @fn void openvrml::viewer::do_insert_texture(const texture_node & n, bool retainHint)
*
* @brief Create a texture object.
*
Modified: trunk/src/libopenvrml/openvrml/viewer.h
===================================================================
--- trunk/src/libopenvrml/openvrml/viewer.h 2009-04-03 06:28:17 UTC (rev 3880)
+++ trunk/src/libopenvrml/openvrml/viewer.h 2009-04-03 07:15:23 UTC (rev 3881)
@@ -59,8 +59,6 @@
pick_mode
};
- typedef long object_t;
-
virtual ~viewer() OPENVRML_NOTHROW = 0;
openvrml::browser * browser() const OPENVRML_NOTHROW;
@@ -69,19 +67,19 @@
double frame_rate();
void reset_user_navigation();
- object_t begin_object(const char * id, bool retain = false);
+ void begin_object(const char * id, bool retain = false);
void end_object();
- object_t insert_background(const std::vector<float> & ground_angle,
- const std::vector<color> & ground_color,
- const std::vector<float> & sky_angle,
- const std::vector<color> & sky_color,
- const texture_node & front,
- const texture_node & back,
- const texture_node & left,
- const texture_node & right,
- const texture_node & top,
- const texture_node & bottom);
+ void insert_background(const std::vector<float> & ground_angle,
+ const std::vector<color> & ground_color,
+ const std::vector<float> & sky_angle,
+ const std::vector<color> & sky_color,
+ const texture_node & front,
+ const texture_node & back,
+ const texture_node & left,
+ const texture_node & right,
+ const texture_node & top,
+ const texture_node & bottom);
void insert_box(const geometry_node & n, const vec3f & size);
void insert_cone(const geometry_node & n,
@@ -124,25 +122,25 @@
const std::vector<vec2f> & tex_coord,
const std::vector<int32> & tex_coord_index);
void insert_sphere(const geometry_node & n, float radius);
- object_t insert_dir_light(float ambient_intensity,
- float intensity,
- const color & color,
- const vec3f & direction);
- object_t insert_point_light(float ambient_intensity,
- const vec3f & attenuation,
- const color & color,
- float intensity,
- const vec3f & location,
- float radius);
- object_t insert_spot_light(float ambient_intensity,
- const vec3f & attenuation,
- float beam_width,
- const color & color,
- float cut_off_angle,
- const vec3f & direction,
- float intensity,
- const vec3f & location,
- float radius);
+ void insert_dir_light(float ambient_intensity,
+ float intensity,
+ const color & color,
+ const vec3f & direction);
+ void insert_point_light(float ambient_intensity,
+ const vec3f & attenuation,
+ const color & color,
+ float intensity,
+ const vec3f & location,
+ float radius);
+ void insert_spot_light(float ambient_intensity,
+ const vec3f & attenuation,
+ float beam_width,
+ const color & color,
+ float cut_off_angle,
+ const vec3f & direction,
+ float intensity,
+ const vec3f & location,
+ float radius);
void remove_object(const node & n);
@@ -213,12 +211,11 @@
virtual double do_frame_rate() = 0;
virtual void do_reset_user_navigation() = 0;
- virtual object_t do_begin_object(const char * id,
- bool retain = false) = 0;
+ virtual void do_begin_object(const char * id, bool retain = false) = 0;
virtual void do_end_object() = 0;
virtual
- object_t
+ void
do_insert_background(const std::vector<float> & ground_angle,
const std::vector<color> & ground_color,
const std::vector<float> & sky_angle,
@@ -279,26 +276,27 @@
const std::vector<int32> & tex_coord_index) = 0;
virtual
void do_insert_sphere(const geometry_node & n, float radius) = 0;
- virtual object_t do_insert_dir_light(float ambient_intensity,
- float intensity,
- const color & color,
- const vec3f & direction) = 0;
- virtual object_t do_insert_point_light(float ambient_intensity,
- const vec3f & attenuation,
- const color & color,
- float intensity,
- const vec3f & location,
- float radius) = 0;
- virtual object_t do_insert_spot_light(float ambient_intensity,
- const vec3f & attenuation,
- float beam_width,
- const color & color,
- float cut_off_angle,
- const vec3f & direction,
- float intensity,
- const vec3f & location,
- float radius) = 0;
+ virtual void do_insert_dir_light(float ambient_intensity,
+ float intensity,
+ const color & color,
+ const vec3f & direction) = 0;
+ virtual void do_insert_point_light(float ambient_intensity,
+ const vec3f & attenuation,
+ const color & color,
+ float intensity,
+ const vec3f & location,
+ float radius) = 0;
+ virtual void do_insert_spot_light(float ambient_intensity,
+ const vec3f & attenuation,
+ float beam_width,
+ const color & color,
+ float cut_off_angle,
+ const vec3f & direction,
+ float intensity,
+ const vec3f & location,
+ float radius) = 0;
+
virtual void do_remove_object(const node & ref) = 0;
virtual void do_enable_lighting(bool val) = 0;
Modified: trunk/src/libopenvrml-gl/openvrml/gl/viewer.cpp
===================================================================
--- trunk/src/libopenvrml-gl/openvrml/gl/viewer.cpp 2009-04-03 06:28:17 UTC (rev 3880)
+++ trunk/src/libopenvrml-gl/openvrml/gl/viewer.cpp 2009-04-03 07:15:23 UTC (rev 3881)
@@ -1004,11 +1004,8 @@
*
* @param[in] id not used.
* @param[in] retain not used.
- *
- * @return 0.
*/
-openvrml::gl::viewer::object_t
-openvrml::gl::viewer::do_begin_object(const char *, bool)
+void openvrml::gl::viewer::do_begin_object(const char *, bool)
{
// Finish setup stuff before first object
if (1 == ++this->objects) {
@@ -1026,7 +1023,6 @@
}
}
this->modelview_matrix_stack_.push();
- return 0;
}
/**
@@ -1133,10 +1129,8 @@
* @param[in] right right texture.
* @param[in] top top texture.
* @param[in] bottom bottom texture.
- *
- * @return display object identifier.
*/
-openvrml::gl::viewer::object_t
+void
openvrml::gl::viewer::
do_insert_background(const std::vector<float> & groundAngle,
const std::vector<color> & groundColor,
@@ -1399,8 +1393,6 @@
this->background.r(r);
this->background.g(g);
this->background.b(b);
-
- return object_t(glid);
}
/**
@@ -3292,14 +3284,11 @@
* @param[in] intensity intensity.
* @param[in] color color.
* @param[in] direction direction.
- *
- * @return display object identifier.
*/
-openvrml::gl::viewer::object_t
-openvrml::gl::viewer::do_insert_dir_light(const float ambientIntensity,
- const float intensity,
- const color & color,
- const vec3f & direction)
+void openvrml::gl::viewer::do_insert_dir_light(const float ambientIntensity,
+ const float intensity,
+ const color & color,
+ const vec3f & direction)
{
float amb[4] = { ambientIntensity * color.r(),
ambientIntensity * color.g(),
@@ -3316,7 +3305,7 @@
for (i = 0; i < max_lights; ++i) {
if (this->light_info_[i].type == viewer::light_unused) { break; }
}
- if (i == max_lights) { return 0; }
+ if (i == max_lights) { return; }
this->light_info_[i].type = viewer::light_directional;
this->light_info_[i].nesting_level = 0;
@@ -3334,8 +3323,6 @@
glLightf(light, GL_SPOT_CUTOFF, 180.0);
glLightf(light, GL_SPOT_EXPONENT, 0.0);
-
- return 0;
}
/**
@@ -3348,20 +3335,17 @@
* @param[in] location location.
* @param[in] radius radius.
*
- * @return display object identifier.
- *
* @todo Only objects within radius should be lit by each PointLight.
* Test each object drawn against each point light and enable
* the lights accordingly? Get light and geometry into consistent
* coordinates first.
*/
-openvrml::gl::viewer::object_t
-openvrml::gl::viewer::do_insert_point_light(const float ambientIntensity,
- const vec3f & attenuation,
- const color & color,
- const float intensity,
- const vec3f & location,
- const float radius)
+void openvrml::gl::viewer::do_insert_point_light(const float ambientIntensity,
+ const vec3f & attenuation,
+ const color & color,
+ const float intensity,
+ const vec3f & location,
+ const float radius)
{
float amb[4] = { ambientIntensity * color.r(),
ambientIntensity * color.g(),
@@ -3378,7 +3362,7 @@
for (i = 0; i < max_lights; ++i) {
if (this->light_info_[i].type == viewer::light_unused) { break; }
}
- if (i == max_lights) { return 0; }
+ if (i == max_lights) { return; }
this->light_info_[i].type = viewer::light_positional;
this->light_info_[i].location = location;
@@ -3399,8 +3383,6 @@
// Disable old spot settings
glLightf(light, GL_SPOT_CUTOFF, 180.0);
glLightf(light, GL_SPOT_EXPONENT, 0.0);
-
- return 0;
}
/**
@@ -3416,20 +3398,17 @@
* @param[in] location location.
* @param[in] radius radius.
*
- * @return 0.
- *
* @todo Same comments as for PointLight apply here.
*/
-openvrml::gl::viewer::object_t
-openvrml::gl::viewer::do_insert_spot_light(const float ambientIntensity,
- const vec3f & attenuation,
- const float beamWidth,
- const color & color,
- const float cutOffAngle,
- const vec3f & direction,
- const float intensity,
- const vec3f & location,
- const float radius)
+void openvrml::gl::viewer::do_insert_spot_light(const float ambientIntensity,
+ const vec3f & attenuation,
+ const float beamWidth,
+ const color & color,
+ const float cutOffAngle,
+ const vec3f & direction,
+ const float intensity,
+ const vec3f & location,
+ const float radius)
{
float amb[4] = { ambientIntensity * color.r(),
ambientIntensity * color.g(),
@@ -3447,7 +3426,7 @@
for (i = 0; i < max_lights; ++i) {
if (this->light_info_[i].type == viewer::light_unused) { break; }
}
- if (i == max_lights) { return 0; }
+ if (i == max_lights) { return; }
this->light_info_[i].type = viewer::light_positional;
this->light_info_[i].location = location;
@@ -3469,8 +3448,6 @@
glLightf(light, GL_SPOT_CUTOFF, GLfloat(cutOffAngle * 180.0 / pi));
// The exponential dropoff is not right/spec compliant...
glLightf(light, GL_SPOT_EXPONENT, beamWidth < cutOffAngle ? 1.0f : 0.0f);
-
- return 0;
}
/**
Modified: trunk/src/libopenvrml-gl/openvrml/gl/viewer.h
===================================================================
--- trunk/src/libopenvrml-gl/openvrml/gl/viewer.h 2009-04-03 06:28:17 UTC (rev 3880)
+++ trunk/src/libopenvrml-gl/openvrml/gl/viewer.h 2009-04-03 07:15:23 UTC (rev 3881)
@@ -188,12 +188,12 @@
virtual void do_reset_user_navigation();
// Scope dirlights, open/close display lists
- virtual object_t do_begin_object(const char * id, bool retain);
+ virtual void do_begin_object(const char * id, bool retain);
virtual void do_end_object();
// Insert objects into the display list
virtual
- object_t
+ void
do_insert_background(const std::vector<float> & groundAngle,
const std::vector<color> & groundColor,
const std::vector<float> & skyAngle,
@@ -266,25 +266,25 @@
float radius);
// Lights
- virtual object_t do_insert_dir_light(float ambientIntensity,
- float intensity,
- const color & color,
- const vec3f & direction);
- virtual object_t do_insert_point_light(float ambientIntensity,
- const vec3f & attenuation,
- const color & color,
- float intensity,
- const vec3f & location,
- float radius);
- virtual object_t do_insert_spot_light(float ambientIntensity,
- const vec3f & attenuation,
- float beamWidth,
- const color & color,
- float cutOffAngle,
- const vec3f & direction,
- float intensity,
- const vec3f & location,
- float radius);
+ virtual void do_insert_dir_light(float ambientIntensity,
+ float intensity,
+ const color & color,
+ const vec3f & direction);
+ virtual void do_insert_point_light(float ambientIntensity,
+ const vec3f & attenuation,
+ const color & color,
+ float intensity,
+ const vec3f & location,
+ float radius);
+ virtual void do_insert_spot_light(float ambientIntensity,
+ const vec3f & attenuation,
+ float beamWidth,
+ const color & color,
+ float cutOffAngle,
+ const vec3f & direction,
+ float intensity,
+ const vec3f & location,
+ float radius);
virtual void do_remove_object(const node & ref);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|