You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(128) |
Dec
(65) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(48) |
Feb
(132) |
Mar
(95) |
Apr
(47) |
May
(54) |
Jun
(2) |
Jul
(57) |
Aug
(109) |
Sep
(131) |
Oct
(186) |
Nov
(105) |
Dec
(78) |
2007 |
Jan
(125) |
Feb
(105) |
Mar
(52) |
Apr
(104) |
May
(63) |
Jun
(116) |
Jul
(76) |
Aug
|
Sep
(18) |
Oct
(93) |
Nov
(110) |
Dec
(169) |
2008 |
Jan
(90) |
Feb
(64) |
Mar
(41) |
Apr
(23) |
May
(6) |
Jun
(18) |
Jul
(10) |
Aug
(61) |
Sep
(139) |
Oct
(50) |
Nov
(55) |
Dec
(2) |
2009 |
Jan
|
Feb
(1) |
Mar
(62) |
Apr
(22) |
May
(17) |
Jun
(19) |
Jul
(40) |
Aug
(21) |
Sep
|
Oct
(40) |
Nov
(23) |
Dec
|
2010 |
Jan
(14) |
Feb
(40) |
Mar
(9) |
Apr
(11) |
May
(19) |
Jun
(4) |
Jul
(10) |
Aug
(22) |
Sep
(15) |
Oct
|
Nov
(2) |
Dec
|
2011 |
Jan
(13) |
Feb
(10) |
Mar
|
Apr
(13) |
May
|
Jun
|
Jul
(2) |
Aug
(4) |
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
(33) |
May
(20) |
Jun
|
Jul
(8) |
Aug
(7) |
Sep
(2) |
Oct
|
Nov
|
Dec
|
From: Braden M. <br...@us...> - 2006-08-27 04:37:45
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18930 Modified Files: ChangeLog Log Message: Removed code to convert from sfvec2f to sfvec2d. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1316 retrieving revision 1.1317 diff -C2 -d -r1.1316 -r1.1317 *** ChangeLog 23 Aug 2006 15:02:01 -0000 1.1316 --- ChangeLog 27 Aug 2006 04:37:42 -0000 1.1317 *************** *** 1,2 **** --- 1,8 ---- + 2006-08-27 Braden McDaniel <br...@en...> + + * src/libopenvrml/openvrml/field_value.cpp + (openvrml::sfvec2d::do_assign(const field_value &)): Removed code + to convert from sfvec2f. + 2006-08-23 Braden McDaniel <br...@en...> |
From: Braden M. <br...@us...> - 2006-08-27 04:37:30
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18909/src/libopenvrml/openvrml Modified Files: Tag: OpenVRML-0_16-BRANCH field_value.cpp Log Message: Removed code to convert from sfvec2f to sfvec2d. Index: field_value.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/field_value.cpp,v retrieving revision 1.28 retrieving revision 1.28.2.1 diff -C2 -d -r1.28 -r1.28.2.1 *** field_value.cpp 4 Aug 2006 05:44:14 -0000 1.28 --- field_value.cpp 27 Aug 2006 04:37:26 -0000 1.28.2.1 *************** *** 3081,3092 **** OPENVRML_THROW1(std::bad_cast) { - //allow to convert from a float to a double - const sfvec2f * float_val = dynamic_cast<const sfvec2f *>(&value); - if (float_val != NULL) - { - this->value(vec2d(float_val->value()[0], float_val->value()[1])); - return *this; - } - return (*this = dynamic_cast<const sfvec2d &>(value)); } --- 3081,3084 ---- |
From: Braden M. <br...@us...> - 2006-08-27 04:37:29
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18909 Modified Files: Tag: OpenVRML-0_16-BRANCH ChangeLog Log Message: Removed code to convert from sfvec2f to sfvec2d. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1310.2.6 retrieving revision 1.1310.2.7 diff -C2 -d -r1.1310.2.6 -r1.1310.2.7 *** ChangeLog 23 Aug 2006 14:59:45 -0000 1.1310.2.6 --- ChangeLog 27 Aug 2006 04:37:25 -0000 1.1310.2.7 *************** *** 1,2 **** --- 1,8 ---- + 2006-08-27 Braden McDaniel <br...@en...> + + * src/libopenvrml/openvrml/field_value.cpp + (openvrml::sfvec2d::do_assign(const field_value &)): Removed code + to convert from sfvec2f. + 2006-08-23 Braden McDaniel <br...@en...> |
From: Braden M. <br...@us...> - 2006-08-23 15:02:11
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17045 Modified Files: ChangeLog Log Message: Initialize last_time_ to 0.0. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1315 retrieving revision 1.1316 diff -C2 -d -r1.1315 -r1.1316 *** ChangeLog 23 Aug 2006 06:41:27 -0000 1.1315 --- ChangeLog 23 Aug 2006 15:02:01 -0000 1.1316 *************** *** 1,4 **** --- 1,10 ---- 2006-08-23 Braden McDaniel <br...@en...> + * src/libopenvrml/openvrml/event.cpp + (openvrml::event_emitter::event_emitter(const field_value &)): + Initialize last_time_ to 0.0. + + 2006-08-23 Braden McDaniel <br...@en...> + Overloaded stream extraction operators for the fundamental types. |
From: Braden M. <br...@us...> - 2006-08-23 15:02:11
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17045/src/libopenvrml/openvrml Modified Files: event.cpp Log Message: Initialize last_time_ to 0.0. Index: event.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/event.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** event.cpp 25 Jul 2006 03:52:06 -0000 1.13 --- event.cpp 23 Aug 2006 15:02:04 -0000 1.14 *************** *** 435,439 **** openvrml::event_emitter::event_emitter(const field_value & value) OPENVRML_NOTHROW: ! value_(value) {} --- 435,440 ---- openvrml::event_emitter::event_emitter(const field_value & value) OPENVRML_NOTHROW: ! value_(value), ! last_time_(0.0) {} |
From: Braden M. <br...@us...> - 2006-08-23 15:00:39
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16132/src/libopenvrml/openvrml Modified Files: Tag: OpenVRML-0_16-BRANCH event.cpp Log Message: Initialize last_time_ to 0.0. Index: event.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/event.cpp,v retrieving revision 1.13 retrieving revision 1.13.2.1 diff -C2 -d -r1.13 -r1.13.2.1 *** event.cpp 25 Jul 2006 03:52:06 -0000 1.13 --- event.cpp 23 Aug 2006 14:59:45 -0000 1.13.2.1 *************** *** 435,439 **** openvrml::event_emitter::event_emitter(const field_value & value) OPENVRML_NOTHROW: ! value_(value) {} --- 435,440 ---- openvrml::event_emitter::event_emitter(const field_value & value) OPENVRML_NOTHROW: ! value_(value), ! last_time_(0.0) {} |
From: Braden M. <br...@us...> - 2006-08-23 14:59:53
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16132 Modified Files: Tag: OpenVRML-0_16-BRANCH ChangeLog Log Message: Initialize last_time_ to 0.0. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1310.2.5 retrieving revision 1.1310.2.6 diff -C2 -d -r1.1310.2.5 -r1.1310.2.6 *** ChangeLog 23 Aug 2006 06:49:49 -0000 1.1310.2.5 --- ChangeLog 23 Aug 2006 14:59:45 -0000 1.1310.2.6 *************** *** 1,4 **** --- 1,10 ---- 2006-08-23 Braden McDaniel <br...@en...> + * src/libopenvrml/openvrml/event.cpp + (openvrml::event_emitter::event_emitter(const field_value &)): + Initialize last_time_ to 0.0. + + 2006-08-23 Braden McDaniel <br...@en...> + Overloaded stream extraction operators for the fundamental types. |
From: Braden M. <br...@us...> - 2006-08-23 06:49:53
|
Update of /cvsroot/openvrml/openvrml/tests In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12380/tests Modified Files: Tag: OpenVRML-0_16-BRANCH Makefile.am Added Files: Tag: OpenVRML-0_16-BRANCH color.cpp image.cpp mat4f.cpp rotation.cpp Log Message: Overloaded stream extraction operators for the fundamental types. --- NEW FILE: color.cpp --- // -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 4; -*- // // Copyright 2006 Braden McDaniel // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // # include <sstream> # include <boost/test/unit_test.hpp> # include <openvrml/basetypes.h> using namespace std; using namespace openvrml; void stream_extraction_without_commas() { color c1(1.0, 1.0, 1.0), c2(0.5, 0.5, 0.5), c3, c4; string color_str = "1.0 1.0 1.0 0.5 0.5 0.5"; istringstream in(color_str); in >> c3 >> c4; BOOST_REQUIRE(in.good()); BOOST_REQUIRE_EQUAL(c1, c3); BOOST_REQUIRE_EQUAL(c2, c4); } void stream_extraction_with_commas() { color c1(1.0, 1.0, 1.0), c2(0.5, 0.5, 0.5), c3, c4; string color_str = "1.0, 1.0, 1.0, 0.5, 0.5, 0.5"; istringstream in(color_str); in >> c3 >> c4; BOOST_REQUIRE(in.good()); BOOST_REQUIRE_EQUAL(c1, c3); BOOST_REQUIRE_EQUAL(c2, c4); } void stream_extraction_fail_on_invalid_intensity() { color c; string color_str = "2.0 0.5 0.5"; istringstream in(color_str); in >> c; BOOST_REQUIRE(in.fail()); } boost::unit_test::test_suite * init_unit_test_suite(int, char * []) { using boost::unit_test::test_suite; test_suite * const suite = BOOST_TEST_SUITE("color"); suite->add(BOOST_TEST_CASE(&stream_extraction_without_commas)); suite->add(BOOST_TEST_CASE(&stream_extraction_with_commas)); suite->add(BOOST_TEST_CASE(&stream_extraction_fail_on_invalid_intensity)); return suite; } --- NEW FILE: image.cpp --- // -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 4; -*- // // Copyright 2006 Braden McDaniel // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // # include <sstream> # include <boost/array.hpp> # include <boost/test/unit_test.hpp> # include <openvrml/basetypes.h> using namespace std; using namespace openvrml; void stream_insertion() { const image img(2, 2, 1); const string image_str = "2 2 1 0x0 0x0 0x0 0x0"; ostringstream out; out << img; BOOST_REQUIRE(out.good()); BOOST_REQUIRE_EQUAL(out.str(), image_str); } void stream_extraction() { const boost::array<unsigned char, 4> pixels = { 0xFF, 0x00, 0xFF, 0x00 }; const image img1(2, 2, 1, pixels.begin(), pixels.end()); image img2; const string image_str = "2 2 1 0xFF 0x00 0xFF 0x00"; istringstream in(image_str); in >> img2; BOOST_REQUIRE(in.good()); BOOST_REQUIRE_EQUAL(img1, img2); } void stream_extraction_insufficient_pixel_values() { const string image_str = "2 2 1 0xFF 0x00 0xFF"; istringstream in(image_str); image img; in >> img; BOOST_REQUIRE(in.fail()); } boost::unit_test::test_suite * init_unit_test_suite(int, char * []) { using boost::unit_test::test_suite; test_suite * const suite = BOOST_TEST_SUITE("image"); suite->add(BOOST_TEST_CASE(&stream_insertion)); suite->add(BOOST_TEST_CASE(&stream_extraction)); suite->add(BOOST_TEST_CASE(&stream_extraction_insufficient_pixel_values)); return suite; } --- NEW FILE: mat4f.cpp --- // -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 4; -*- // // Copyright 2006 Braden McDaniel // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // # include <sstream> # include <boost/test/unit_test.hpp> # include <openvrml/basetypes.h> using namespace std; using namespace openvrml; void stream_insertion() { mat4f m; const string mat4f_str = "[1, 0, 0, 0], " "[0, 1, 0, 0], " "[0, 0, 1, 0], " "[0, 0, 0, 1]"; ostringstream out; out << m; BOOST_REQUIRE_EQUAL(out.str(), mat4f_str); } void stream_extraction_numbers_only() { const mat4f m1(1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 3, 0, 0, 0, 0, 4); mat4f m2; const string mat4f_str = "1 0 0 0 " "0 2 0 0 " "0 0 3 0 " "0 0 0 4"; istringstream in(mat4f_str); in >> m2; BOOST_REQUIRE_EQUAL(m1, m2); } void stream_extraction_numbers_with_commas() { const mat4f m1(1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 3, 0, 0, 0, 0, 4); mat4f m2; const string mat4f_str = "1, 0, 0, 0, " "0, 2, 0, 0, " "0, 0, 3, 0, " "0, 0, 0, 4"; istringstream in(mat4f_str); in >> m2; BOOST_REQUIRE_EQUAL(m1, m2); } boost::unit_test::test_suite * init_unit_test_suite(int, char * []) { using boost::unit_test::test_suite; test_suite * const suite = BOOST_TEST_SUITE("mat4f"); suite->add(BOOST_TEST_CASE(&stream_insertion)); suite->add(BOOST_TEST_CASE(&stream_extraction_numbers_only)); suite->add(BOOST_TEST_CASE(&stream_extraction_numbers_with_commas)); return suite; } Index: Makefile.am =================================================================== RCS file: /cvsroot/openvrml/openvrml/tests/Makefile.am,v retrieving revision 1.14 retrieving revision 1.14.2.1 diff -C2 -d -r1.14 -r1.14.2.1 *** Makefile.am 28 Jul 2006 07:11:10 -0000 1.14 --- Makefile.am 23 Aug 2006 06:49:49 -0000 1.14.2.1 *************** *** 6,10 **** TESTS_ENVIRONMENT = BOOST_TEST_REPORT_LEVEL=detailed ! TESTS = \ browser \ parse_anchor \ --- 6,13 ---- TESTS_ENVIRONMENT = BOOST_TEST_REPORT_LEVEL=detailed ! TESTS = color \ ! rotation \ ! mat4f \ ! image \ browser \ parse_anchor \ *************** *** 19,22 **** --- 22,45 ---- libtest_openvrml_la_LIBADD = $(top_builddir)/src/libopenvrml/libopenvrml.la + color_SOURCES = color.cpp + color_LDADD = \ + $(top_builddir)/src/libopenvrml/libopenvrml.la \ + -lboost_unit_test_framework + + rotation_SOURCES = rotation.cpp + rotation_LDADD = \ + $(top_builddir)/src/libopenvrml/libopenvrml.la \ + -lboost_unit_test_framework + + mat4f_SOURCES = mat4f.cpp + mat4f_LDADD = \ + $(top_builddir)/src/libopenvrml/libopenvrml.la \ + -lboost_unit_test_framework + + image_SOURCES = image.cpp + image_LDADD = \ + $(top_builddir)/src/libopenvrml/libopenvrml.la \ + -lboost_unit_test_framework + browser_SOURCES = browser.cpp browser_LDADD = libtest-openvrml.la -lboost_unit_test_framework -lboost_filesystem --- NEW FILE: rotation.cpp --- // -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 4; -*- // // Copyright 2006 Braden McDaniel // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // # include <sstream> # include <boost/test/unit_test.hpp> # include <openvrml/basetypes.h> using namespace std; using namespace openvrml; void stream_extraction_fail_on_nonnormalized_axis() { string rotation_str = "2.0 2.0 0.0 0.0"; istringstream in(rotation_str); rotation r; in >> r; BOOST_REQUIRE(in.fail()); } boost::unit_test::test_suite * init_unit_test_suite(int, char * []) { using boost::unit_test::test_suite; test_suite * const suite = BOOST_TEST_SUITE("rotation"); suite->add(BOOST_TEST_CASE(&stream_extraction_fail_on_nonnormalized_axis)); return suite; } |
From: Braden M. <br...@us...> - 2006-08-23 06:49:53
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12380 Modified Files: Tag: OpenVRML-0_16-BRANCH ChangeLog Log Message: Overloaded stream extraction operators for the fundamental types. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1310.2.4 retrieving revision 1.1310.2.5 diff -C2 -d -r1.1310.2.4 -r1.1310.2.5 *** ChangeLog 18 Aug 2006 20:03:26 -0000 1.1310.2.4 --- ChangeLog 23 Aug 2006 06:49:49 -0000 1.1310.2.5 *************** *** 1,2 **** --- 1,78 ---- + 2006-08-23 Braden McDaniel <br...@en...> + + Overloaded stream extraction operators for the fundamental types. + + * src/libopenvrml/openvrml/basetypes.cpp + (vrml97_space_parser): Added a Spirit character parser to treat + comma as a whitespace character. + (vrml97_space_p): Instance of vrml97_space_parser. + (intensity_parser): Added a Spirit parser (used with + boost::spirit::functor_parser) to parse floating point values + between 0.0 and 1.0 (e.g., color component values). + (intensity_p): Instance of intensity_parser. + (openvrml::operator>>(std::istream &, color &)): Added stream + extraction operator for openvrml::color. + (openvrml::operator>>(std::istream &, color_rgba &)): Added stream + extraction operator for openvrml::color_rgba. + (openvrml::operator>>(std::istream &, vec2f &)): Added stream + extraction operator for openvrml::vec2f. + (openvrml::operator>>(std::istream &, vec2d &)): Added stream + extraction operator for openvrml::vec2d. + (openvrml::operator>>(std::istream &, vec3f &)): Added stream + extraction operator for openvrml::vec3f. + (openvrml::operator>>(std::istream &, vec3d &)): Added stream + extraction operator for openvrml::vec3d. + (is_normalized): Function object to validate the axis component of + a rotation. + (openvrml::operator>>(std::istream &, rotation &)): Added stream + extraction operator for openvrml::rotation. + (openvrml::operator>>(std::istream &, mat4f &)): Added stream + extraction operator for openvrml::mat4f. + (openvrml::operator>>(std::istream &, quatf &)): Added stream + extraction operator for openvrml::quatf. + (set_pixel): Semantic action to set a pixel when parsing an image. + (resize_image): Semantic action to resize an image given pixel + dimensions and the number of components. + (int32_parser): A Spirit functor parser to parse VRML97-style + integers. + (int32_p): An instance of int32_parser. + (openvrml::operator>>(std::istream &, image &)): Added stream + extraction operator for openvrml::image. + * src/libopenvrml/openvrml/basetypes.h + (openvrml::operator>>(std::istream &, color &)): Added function + declaration. + (openvrml::color): Made operator>> a friend. + (openvrml::operator>>(std::istream &, color_rgba &)): Added + function declaration. + (openvrml::color_rgba): Made operator>> a friend. + (openvrml::operator>>(std::istream &, vec2f &)): Added function + declaration. + (openvrml::vec2f): Made operator>> a friend. + (openvrml::operator>>(std::istream &, vec2d &)): Added function + declaration. + (openvrml::vec2d): Made operator>> a friend. + (openvrml::operator>>(std::istream &, vec3f &)): Added function + declaration. + (openvrml::vec3f): Made operator>> a friend. + (openvrml::operator>>(std::istream &, vec3d &)): Added function + declaration. + (openvrml::vec3d): Made operator>> a friend. + (openvrml::operator>>(std::istream &, rotation &)): Added function + declaration. + (openvrml::operator>>(std::istream &, mat4f &)): Added function + declaration. + (openvrml::operator>>(std::istream &, quatf &)): Added function + declaration. + (openvrml::quatf): Made operator>> a friend. + (openvrml::operator>>(std::istream &, image &)): Added function + declaration. + * tests/Makefile.am: Added color, image, mat4f, and rotation + tests. + * tests/color.cpp: Added file; a test suite for openvrml::color. + * tests/image.cpp: Added file; a test suite for openvrml::image. + * tests/mat4f.cpp: Added file; a test suite for openvrml::mat4f. + * tests/rotation.cpp: Added file; a test suite for + openvrml::rotation. + 2006-08-18 Braden McDaniel <br...@en...> |
From: Braden M. <br...@us...> - 2006-08-23 06:49:53
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12380/src/libopenvrml/openvrml Modified Files: Tag: OpenVRML-0_16-BRANCH basetypes.cpp basetypes.h Log Message: Overloaded stream extraction operators for the fundamental types. Index: basetypes.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/basetypes.cpp,v retrieving revision 1.37 retrieving revision 1.37.2.1 diff -C2 -d -r1.37 -r1.37.2.1 *** basetypes.cpp 6 Aug 2006 02:34:38 -0000 1.37 --- basetypes.cpp 23 Aug 2006 06:49:49 -0000 1.37.2.1 *************** *** 4,8 **** // // Copyright 2001 S. K. Bose ! // Copyright 2003, 2004 Braden McDaniel // // This library is free software; you can redistribute it and/or --- 4,8 ---- // // Copyright 2001 S. K. Bose ! // Copyright 2003, 2004, 2005, 2006 Braden McDaniel // // This library is free software; you can redistribute it and/or *************** *** 23,26 **** --- 23,30 ---- # include <numeric> # include <ostream> + # include <boost/spirit.hpp> + # include <boost/spirit/actor.hpp> + # include <boost/spirit/dynamic.hpp> + # include <boost/spirit/phoenix.hpp> # include <private.h> # include "basetypes.h" *************** *** 108,112 **** * @brief A color. * ! * VRML colors are represented as three single precision floating point * components—red, green, and blue—ranging from 0.0 to 1.0. */ --- 112,116 ---- * @brief A color. * ! * VRML colors are represented as three single-precision floating point * components—red, green, and blue—ranging from 0.0 to 1.0. */ *************** *** 278,281 **** --- 282,399 ---- } + namespace { + struct OPENVRML_LOCAL vrml97_space_parser : + boost::spirit::char_parser<vrml97_space_parser> { + + typedef vrml97_space_parser self_t; + + template <typename CharT> + bool test(const CharT & c) const + { + return isspace(c) || c == ','; + } + }; + + const vrml97_space_parser vrml97_space_p = vrml97_space_parser(); + + typedef std::istream::char_type char_t; + typedef boost::spirit::multi_pass<std::istreambuf_iterator<char_t> > + iterator_t; + + typedef boost::spirit::skip_parser_iteration_policy<vrml97_space_parser> + iter_policy_t; + typedef boost::spirit::scanner_policies<iter_policy_t> scanner_policies_t; + typedef boost::spirit::scanner<iterator_t, scanner_policies_t> scanner_t; + + typedef boost::spirit::rule<scanner_t> rule_t; + + + struct OPENVRML_LOCAL intensity_parser { + + typedef double result_t; + + struct valid { + explicit valid(result_t & value): + value_(value) + {} + + bool operator()() const + { + return this->value_ >= 0.0 && this->value_ <= 1.0; + } + + private: + result_t & value_; + }; + + template <typename ScannerT> + std::ptrdiff_t operator()(const ScannerT & scan, + result_t & result) const + { + using boost::spirit::assign_a; + using boost::spirit::eps_p; + using boost::spirit::real_p; + using boost::spirit::match_result; + typedef typename match_result<ScannerT, result_t>::type match_t; + typedef typename boost::spirit::rule<ScannerT> rule_t; + + rule_t rule + = real_p[assign_a(result)] >> eps_p(valid(result)) + ; + match_t match = rule.parse(scan); + return match.length(); + } + }; + + const boost::spirit::functor_parser<intensity_parser> intensity_p; + } + + /** + * @brief Stream input. + * + * Consistent with the VRML97 convention, commas (“@c ,”) in the + * input are treated as whitespace. + * + * If any of the color components are outside the the range [0.0, 1.0], the + * @c failbit will be set on @p in and @p c will be left in an arbitrary + * state. + * + * @param[in,out] in input stream. + * @param[out] c a @c color. + * + * @return @p in. + */ + std::istream & openvrml::operator>>(std::istream & in, color & c) + { + using std::istreambuf_iterator; + using boost::spirit::make_multi_pass; + using boost::spirit::match; + using boost::spirit::real_p; + using boost::spirit::assign_a; + + iter_policy_t iter_policy(vrml97_space_p); + scanner_policies_t policies(iter_policy); + iterator_t + first(make_multi_pass(istreambuf_iterator<char_t>(in))), + last(make_multi_pass(istreambuf_iterator<char_t>())); + + scanner_t scan(first, last, policies); + + rule_t rule + = intensity_p[assign_a(c.rgb[0])] + >> intensity_p[assign_a(c.rgb[1])] + >> intensity_p[assign_a(c.rgb[2])] + ; + + match<> m = rule.parse(scan); + + if (!m) { + in.setstate(std::ios_base::failbit); + return in; + } + + return in; + } + /** * @relatesalso openvrml::color *************** *** 284,288 **** * * @param[in,out] out output stream. ! * @param[in] c a color. * * @return @p out. --- 402,406 ---- * * @param[in,out] out output stream. ! * @param[in] c a @c color. * * @return @p out. *************** *** 298,302 **** * @brief A color with alpha channel. * ! * VRML @c color_rgba%s are represented as four single precision floating * point components—red, green, blue, and alpha—ranging from 0.0 * to 1.0. For the alpha channel, 1.0 is opaque. --- 416,420 ---- * @brief A color with alpha channel. * ! * VRML @c color_rgba%s are represented as four single-precision floating * point components—red, green, blue, and alpha—ranging from 0.0 * to 1.0. For the alpha channel, 1.0 is opaque. *************** *** 496,499 **** --- 614,664 ---- /** + * @brief Stream input. + * + * Consistent with the VRML97 convention, commas (“@c ,”) in the + * input are treated as whitespace. + * + * If any of the color components are outside the the range [0.0, 1.0], the + * @c failbit will be set on @p in and @p c will be left in an arbitrary + * state. + * + * @param[in,out] in input stream. + * @param[out] c a @c color_rgba. + * + * @return @p in. + */ + std::istream & openvrml::operator>>(std::istream & in, color_rgba & c) + { + using std::istreambuf_iterator; + using boost::spirit::make_multi_pass; + using boost::spirit::match; + using boost::spirit::real_p; + using boost::spirit::assign_a; + + iter_policy_t iter_policy(vrml97_space_p); + scanner_policies_t policies(iter_policy); + iterator_t + first(make_multi_pass(istreambuf_iterator<char_t>(in))), + last(make_multi_pass(istreambuf_iterator<char_t>())); + + scanner_t scan(first, last, policies); + + rule_t rule + = intensity_p[assign_a(c.rgba[0])] + >> intensity_p[assign_a(c.rgba[1])] + >> intensity_p[assign_a(c.rgba[2])] + >> intensity_p[assign_a(c.rgba[3])]; + + match<> m = rule.parse(scan); + + if (!m) { + in.setstate(std::ios_base::failbit); + return in; + } + + return in; + } + + /** * @relatesalso openvrml::color_rgba * *************** *** 514,518 **** * @class openvrml::vec2f * ! * @brief Two-component single precision vector. */ --- 679,683 ---- * @class openvrml::vec2f * ! * @brief Two-component single-precision vector. */ *************** *** 855,858 **** --- 1020,1063 ---- /** + * @brief Stream input. + * + * Consistent with the VRML97 convention, commas (“@c ,”) in the + * input are treated as whitespace. + * + * @param[in,out] in input stream. + * @param[out] v a @c vec2f. + * + * @return @p in. + */ + std::istream & openvrml::operator>>(std::istream & in, vec2f & v) + { + using std::istreambuf_iterator; + using boost::spirit::make_multi_pass; + using boost::spirit::match; + using boost::spirit::real_p; + using boost::spirit::assign_a; + + iter_policy_t iter_policy(vrml97_space_p); + scanner_policies_t policies(iter_policy); + iterator_t + first(make_multi_pass(istreambuf_iterator<char_t>(in))), + last(make_multi_pass(istreambuf_iterator<char_t>())); + + scanner_t scan(first, last, policies); + + rule_t r + = real_p[assign_a(v.vec[0])] >> real_p[assign_a(v.vec[1])] + ; + + match<> m = r.parse(scan); + + if (!m) { + in.setstate(std::ios_base::failbit); + } + + return in; + } + + /** * @relatesalso openvrml::vec2f * *************** *** 873,877 **** * @class openvrml::vec2d * ! * @brief Two-component single precision vector. */ --- 1078,1082 ---- * @class openvrml::vec2d * ! * @brief Two-component double-precision vector. */ *************** *** 1214,1217 **** --- 1419,1462 ---- /** + * @brief Stream input. + * + * Consistent with the VRML97 convention, commas (“@c ,”) in the + * input are treated as whitespace. + * + * @param[in,out] in input stream. + * @param[out] v a @c vec2d. + * + * @return @p in. + */ + std::istream & openvrml::operator>>(std::istream & in, vec2d & v) + { + using std::istreambuf_iterator; + using boost::spirit::make_multi_pass; + using boost::spirit::match; + using boost::spirit::real_p; + using boost::spirit::assign_a; + + iter_policy_t iter_policy(vrml97_space_p); + scanner_policies_t policies(iter_policy); + iterator_t + first(make_multi_pass(istreambuf_iterator<char_t>(in))), + last(make_multi_pass(istreambuf_iterator<char_t>())); + + scanner_t scan(first, last, policies); + + rule_t r + = real_p[assign_a(v.vec[0])] >> real_p[assign_a(v.vec[1])] + ; + + match<> m = r.parse(scan); + + if (!m) { + in.setstate(std::ios_base::failbit); + } + + return in; + } + + /** * @relatesalso openvrml::vec2d * *************** *** 1232,1236 **** * @class openvrml::vec3f * ! * @brief Three-component single precision vector. */ --- 1477,1481 ---- * @class openvrml::vec3f * ! * @brief Three-component single-precision vector. */ *************** *** 1703,1706 **** --- 1948,1993 ---- /** + * @brief Stream input. + * + * Consistent with the VRML97 convention, commas (“@c ,”) in the + * input are treated as whitespace. + * + * @param[in,out] in input stream. + * @param[out] v a @c vec3f. + * + * @return @p in. + */ + std::istream & openvrml::operator>>(std::istream & in, vec3f & v) + { + using std::istreambuf_iterator; + using boost::spirit::make_multi_pass; + using boost::spirit::match; + using boost::spirit::real_p; + using boost::spirit::assign_a; + + iter_policy_t iter_policy(vrml97_space_p); + scanner_policies_t policies(iter_policy); + iterator_t + first(make_multi_pass(istreambuf_iterator<char_t>(in))), + last(make_multi_pass(istreambuf_iterator<char_t>())); + + scanner_t scan(first, last, policies); + + rule_t r + = real_p[assign_a(v.vec[0])] + >> real_p[assign_a(v.vec[1])] + >> real_p[assign_a(v.vec[2])] + ; + + match<> m = r.parse(scan); + + if (!m) { + in.setstate(std::ios_base::failbit); + } + + return in; + } + + /** * @relatesalso openvrml::vec3f * *************** *** 1721,1725 **** * @class openvrml::vec3d * ! * @brief Three-component single precision vector. */ --- 2008,2012 ---- * @class openvrml::vec3d * ! * @brief Three-component double-precision vector. */ *************** *** 2192,2195 **** --- 2479,2524 ---- /** + * @brief Stream input. + * + * Consistent with the VRML97 convention, commas (“@c ,”) in the + * input are treated as whitespace. + * + * @param[in,out] in input stream. + * @param[out] v a @c vec3d. + * + * @return @p in. + */ + std::istream & openvrml::operator>>(std::istream & in, vec3d & v) + { + using std::istreambuf_iterator; + using boost::spirit::make_multi_pass; + using boost::spirit::match; + using boost::spirit::real_p; + using boost::spirit::assign_a; + + iter_policy_t iter_policy(vrml97_space_p); + scanner_policies_t policies(iter_policy); + iterator_t + first(make_multi_pass(istreambuf_iterator<char_t>(in))), + last(make_multi_pass(istreambuf_iterator<char_t>())); + + scanner_t scan(first, last, policies); + + rule_t r + = real_p[assign_a(v.vec[0])] + >> real_p[assign_a(v.vec[1])] + >> real_p[assign_a(v.vec[2])] + ; + + match<> m = r.parse(scan); + + if (!m) { + in.setstate(std::ios_base::failbit); + } + + return in; + } + + /** * @relatesalso openvrml::vec3d * *************** *** 2212,2216 **** * @brief A rotation. * ! * VRML rotations are represented with four single precision floating point * components. The first three are an axis of rotation, and the last is * rotation in radians. --- 2541,2545 ---- * @brief A rotation. * ! * VRML rotations are represented with four single-precision floating point * components. The first three are an axis of rotation, and the last is * rotation in radians. *************** *** 2605,2608 **** --- 2934,3013 ---- } + namespace { + struct OPENVRML_LOCAL is_normalized { + is_normalized(float & x, float & y, float & z): + x_(x), + y_(y), + z_(z) + {} + + bool operator()() const + { + using openvrml::vec3f; + using openvrml_::fequal; + return fequal(vec3f(this->x_, this->y_, this->z_).length(), 1.0f); + } + + private: + float & x_, & y_, & z_; + }; + } + + /** + * @relatesalso openvrml::rotation + * + * @brief Stream input. + * + * Consistent with the VRML97 convention, commas (“@c ,”) in the + * input are treated as whitespace. + * + * If the axis components of the rotation do not represent a normalized + * vector, the @c failbit will be set on @p in and @p rot will not be + * modified. + * + * @param[in,out] in input stream. + * @param[out] rot a @c rotation. + * + * @return @p in. + */ + std::istream & openvrml::operator>>(std::istream & in, rotation & rot) + { + using std::istreambuf_iterator; + using boost::spirit::make_multi_pass; + using boost::spirit::match; + using boost::spirit::eps_p; + using boost::spirit::real_p; + using boost::spirit::assign_a; + + iter_policy_t iter_policy(vrml97_space_p); + scanner_policies_t policies(iter_policy); + iterator_t + first(make_multi_pass(istreambuf_iterator<char_t>(in))), + last(make_multi_pass(istreambuf_iterator<char_t>())); + + scanner_t scan(first, last, policies); + + float x, y, z, angle; + rule_t rule + = real_p[assign_a(x)] >> real_p[assign_a(y)] >> real_p[assign_a(z)] + >> eps_p(is_normalized(x, y, z)) + >> real_p[assign_a(angle)] + ; + + match<> m = rule.parse(scan); + + if (!m) { + in.setstate(std::ios_base::failbit); + return in; + } + + rot.x(x); + rot.y(y); + rot.z(z); + rot.angle(angle); + + return in; + } + /** * @relatesalso openvrml::rotation *************** *** 3422,3429 **** * @relatesalso openvrml::mat4f * * @brief Stream output. * * @param[in,out] out an output stream. ! * @param[in] mat a matrix. * * @return @p out. --- 3827,3911 ---- * @relatesalso openvrml::mat4f * + * @brief Stream input. + * + * Consistent with the VRML97 convention, commas (“@c ,”) in the + * input are treated as whitespace. + * + * Optionally, brackets may be used in the input to group the rows; i.e., the + * following syntaxes are accepted: + * + * - [ <var>f<sub>11</sub></var>, ... <var>f<sub>14</sub></var> ], ... [ <var>f<sub>41</sub></var>, ... <var>f<sub>44</sub></var> ] + * - <var>f<sub>11</sub></var>, <var>f<sub>12</sub></var>, ... <var>f<sub>44</sub></var> + * + * @param[in,out] in input stream. + * @param[out] m a matrix. + * + * @return @p in. + */ + std::istream & openvrml::operator>>(std::istream & in, mat4f & m) + { + using std::istreambuf_iterator; + using boost::spirit::make_multi_pass; + using boost::spirit::ch_p; + using boost::spirit::real_p; + using boost::spirit::assign_a; + using boost::spirit::increment_a; + using boost::spirit::decrement_a; + + iter_policy_t iter_policy(vrml97_space_p); + scanner_policies_t policies(iter_policy); + iterator_t + first(make_multi_pass(istreambuf_iterator<char_t>(in))), + last(make_multi_pass(istreambuf_iterator<char_t>())); + + scanner_t scan(first, last, policies); + + size_t row1_bracket_count = 0, row2_bracket_count = 0, row3_bracket_count = 0, + row4_bracket_count = 0; + + rule_t r + = !ch_p('[')[increment_a(row1_bracket_count)] + >> real_p[assign_a(m[0][0])] + >> real_p[assign_a(m[0][1])] + >> real_p[assign_a(m[0][2])] + >> real_p[assign_a(m[0][3])] + >> !ch_p(']')[decrement_a(row1_bracket_count)] + >> !ch_p('[')[increment_a(row2_bracket_count)] + >> real_p[assign_a(m[1][0])] + >> real_p[assign_a(m[1][1])] + >> real_p[assign_a(m[1][2])] + >> real_p[assign_a(m[1][3])] + >> !ch_p(']')[decrement_a(row2_bracket_count)] + >> !ch_p('[')[increment_a(row3_bracket_count)] + >> real_p[assign_a(m[2][0])] + >> real_p[assign_a(m[2][1])] + >> real_p[assign_a(m[2][2])] + >> real_p[assign_a(m[2][3])] + >> !ch_p(']')[decrement_a(row3_bracket_count)] + >> !ch_p('[')[increment_a(row4_bracket_count)] + >> real_p[assign_a(m[3][0])] + >> real_p[assign_a(m[3][1])] + >> real_p[assign_a(m[3][2])] + >> real_p[assign_a(m[3][3])] + >> !ch_p(']')[decrement_a(row4_bracket_count)] + ; + + boost::spirit::match<> match = r.parse(scan); + + if (!match || row1_bracket_count != 0 || row2_bracket_count != 0 + || row3_bracket_count != 0 || row4_bracket_count != 0) { + in.setstate(std::ios_base::failbit); + } + + return in; + } + + /** + * @relatesalso openvrml::mat4f + * * @brief Stream output. * * @param[in,out] out an output stream. ! * @param[in] mat a matrix. * * @return @p out. *************** *** 3431,3435 **** std::ostream & openvrml::operator<<(std::ostream & out, const mat4f & mat) { - out << '['; for (size_t i = 0; i < 4; i++) { out << '['; --- 3913,3916 ---- *************** *** 3441,3445 **** if (i != 3) { out << ", "; } } - out << ']'; return out; } --- 3922,3925 ---- *************** *** 3939,3942 **** --- 4419,4465 ---- /** + * @brief Stream input. + * + * Consistent with the VRML97 convention, commas (“@c ,”) in the + * input are treated as whitespace. + * + * @param[in,out] in input stream. + * @param[out] q a @c quatf. + * + * @return @p in. + */ + std::istream & openvrml::operator>>(std::istream & in, quatf & q) + { + using std::istreambuf_iterator; + using boost::spirit::make_multi_pass; + using boost::spirit::match; + using boost::spirit::real_p; + using boost::spirit::assign_a; + + iter_policy_t iter_policy(vrml97_space_p); + scanner_policies_t policies(iter_policy); + iterator_t + first(make_multi_pass(istreambuf_iterator<char_t>(in))), + last(make_multi_pass(istreambuf_iterator<char_t>())); + + scanner_t scan(first, last, policies); + + rule_t r + = real_p[assign_a(q.quat[0])] + >> real_p[assign_a(q.quat[1])] + >> real_p[assign_a(q.quat[2])] + >> real_p[assign_a(q.quat[3])] + ; + + match<> m = r.parse(scan); + + if (!m) { + in.setstate(std::ios_base::failbit); + } + + return in; + } + + /** * @relatesalso openvrml::quatf * *************** *** 4317,4320 **** --- 4840,4963 ---- } + namespace { + + struct OPENVRML_LOCAL set_pixel { + set_pixel(openvrml::image & img, size_t & index): + img_(&img), + index_(&index) + {} + + template <typename NumT> + void operator()(NumT val) const + { + this->img_->pixel(*this->index_, val); + } + + private: + openvrml::image * const img_; + size_t * const index_; + }; + + struct OPENVRML_LOCAL resize_image { + resize_image(openvrml::image & img, + size_t & x, size_t & y, size_t & comp): + img_(&img), + x_(&x), + y_(&y), + comp_(&comp) + {} + + template <typename IteratorT> + void operator()(IteratorT, IteratorT) const + { + openvrml::image temp(*this->x_, *this->y_, *this->comp_); + this->img_->swap(temp); + } + + private: + openvrml::image * const img_; + size_t * const x_, * const y_, * const comp_; + }; + + + struct OPENVRML_LOCAL int32_parser { + typedef openvrml::int32 result_t; + + template <typename ScannerT> + std::ptrdiff_t operator()(const ScannerT & scan, + result_t & result) const + { + using namespace boost::spirit; + using namespace phoenix; + typedef typename match_result<ScannerT, result_t>::type match_t; + match_t match + = ( lexeme_d[ + ch_p('0') >> chset_p("Xx") + >> hex_p[assign_a(result)] + ] + | int_p[assign_a(result)] + ).parse(scan); + return match.length(); + } + }; + + const boost::spirit::functor_parser<int32_parser> int32_p = int32_parser(); + } + + /** + * @brief Stream input. + * + * Consistent with the VRML97 convention, commas (“@c ,”) in the + * input are treated as whitespace. + * + * @param[in,out] in input stream. + * @param[out] img an @c image. + * + * @return @p in. + */ + std::istream & openvrml::operator>>(std::istream & in, image & img) + { + using std::istreambuf_iterator; + using boost::ref; + using boost::spirit::make_multi_pass; + using boost::spirit::match; + using boost::spirit::eps_p; + using boost::spirit::int_p; + using boost::spirit::repeat_p; + using boost::spirit::assign_a; + using boost::spirit::increment_a; + using phoenix::arg1; + using phoenix::var; + + iter_policy_t iter_policy(vrml97_space_p); + scanner_policies_t policies(iter_policy); + iterator_t + first(make_multi_pass(istreambuf_iterator<char_t>(in))), + last(make_multi_pass(istreambuf_iterator<char_t>())); + + scanner_t scan(first, last, policies); + + size_t x = 0, y = 0, comp = 0, pixels = 0, index = 0; + rule_t r + = int32_p[var(pixels) = arg1][assign_a(x)] + >> int32_p[var(pixels) *= arg1][assign_a(y)] + >> int32_p[assign_a(comp)] + // Just resize the image once we have the x, y, and comp values to + // avoid unnecessary reallocation. + >> eps_p[resize_image(img, x, y, comp)] + >> repeat_p(ref(pixels))[ + int32_p[set_pixel(img, index)][increment_a(index)] + ] + ; + + match<> m = r.parse(scan); + + if (!m) { + in.setstate(std::ios_base::failbit); + } + + return in; + } + /** * @relatesalso openvrml::image Index: basetypes.h =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/basetypes.h,v retrieving revision 1.23 retrieving revision 1.23.2.1 diff -C2 -d -r1.23 -r1.23.2.1 *** basetypes.h 20 Feb 2006 04:37:28 -0000 1.23 --- basetypes.h 23 Aug 2006 06:49:49 -0000 1.23.2.1 *************** *** 4,8 **** // // Copyright 2001 S. K. Bose ! // Copyright 2003, 2004 Braden McDaniel // // This library is free software; you can redistribute it and/or --- 4,8 ---- // // Copyright 2001 S. K. Bose ! // Copyright 2003, 2004, 2005, 2006 Braden McDaniel // // This library is free software; you can redistribute it and/or *************** *** 41,45 **** --- 41,52 ---- # endif + + class color; + + OPENVRML_API std::istream & operator>>(std::istream & in, color & c); + class OPENVRML_API color { + friend std::istream & operator>>(std::istream & in, color & c); + float rgb[3]; *************** *** 108,112 **** --- 115,125 ---- + class color_rgba; + + OPENVRML_API std::istream & operator>>(std::istream & in, color_rgba & c); + class OPENVRML_API color_rgba { + friend std::istream & operator>>(std::istream & in, color_rgba & c); + float rgba[4]; *************** *** 189,193 **** --- 202,212 ---- + class vec2f; + + OPENVRML_API std::istream & operator>>(std::istream & in, vec2f & v); + class OPENVRML_API vec2f { + friend std::istream & operator>>(std::istream & in, vec2f & v); + float vec[2]; *************** *** 273,277 **** --- 292,302 ---- + class vec2d; + + OPENVRML_API std::istream & operator>>(std::istream & in, vec2d & v); + class OPENVRML_API vec2d { + friend std::istream & operator>>(std::istream & in, vec2d & v); + double vec[2]; *************** *** 358,363 **** --- 383,393 ---- class mat4f; + class vec3f; + + OPENVRML_API std::istream & operator>>(std::istream & in, vec3f & v); class OPENVRML_API vec3f { + friend std::istream & operator>>(std::istream & in, vec3f & v); + float vec[3]; *************** *** 470,474 **** --- 500,510 ---- + class vec3d; + + OPENVRML_API std::istream & operator>>(std::istream & in, vec3d & v); + class OPENVRML_API vec3d { + friend std::istream & operator>>(std::istream & in, vec3d & v); + double vec[3]; *************** *** 623,626 **** --- 659,663 ---- OPENVRML_API bool operator!=(const rotation & lhs, const rotation & rhs) OPENVRML_NOTHROW; + OPENVRML_API std::istream & operator>>(std::istream & in, rotation & rot); OPENVRML_API std::ostream & operator<<(std::ostream & out, const rotation & r); *************** *** 730,738 **** --- 767,780 ---- OPENVRML_API const mat4f operator*(float scalar, const mat4f & mat) OPENVRML_NOTHROW; + OPENVRML_API std::istream & operator>>(std::istream & in, mat4f & mat); OPENVRML_API std::ostream & operator<<(std::ostream & out, const mat4f & mat); + OPENVRML_API std::istream & operator>>(std::istream & in, quatf & q); + class OPENVRML_API quatf { + friend std::istream & operator>>(std::istream & in, quatf & q); + float quat[4]; *************** *** 990,993 **** --- 1032,1036 ---- } + OPENVRML_API std::istream & operator>>(std::istream & in, image & img); OPENVRML_API std::ostream & operator<<(std::ostream & out, const image & img); |
From: Braden M. <br...@us...> - 2006-08-23 06:41:31
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9179 Modified Files: ChangeLog Log Message: Overloaded stream extraction operators for the fundamental types. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1314 retrieving revision 1.1315 diff -C2 -d -r1.1314 -r1.1315 *** ChangeLog 18 Aug 2006 20:04:37 -0000 1.1314 --- ChangeLog 23 Aug 2006 06:41:27 -0000 1.1315 *************** *** 1,2 **** --- 1,78 ---- + 2006-08-23 Braden McDaniel <br...@en...> + + Overloaded stream extraction operators for the fundamental types. + + * src/libopenvrml/openvrml/basetypes.cpp + (vrml97_space_parser): Added a Spirit character parser to treat + comma as a whitespace character. + (vrml97_space_p): Instance of vrml97_space_parser. + (intensity_parser): Added a Spirit parser (used with + boost::spirit::functor_parser) to parse floating point values + between 0.0 and 1.0 (e.g., color component values). + (intensity_p): Instance of intensity_parser. + (openvrml::operator>>(std::istream &, color &)): Added stream + extraction operator for openvrml::color. + (openvrml::operator>>(std::istream &, color_rgba &)): Added stream + extraction operator for openvrml::color_rgba. + (openvrml::operator>>(std::istream &, vec2f &)): Added stream + extraction operator for openvrml::vec2f. + (openvrml::operator>>(std::istream &, vec2d &)): Added stream + extraction operator for openvrml::vec2d. + (openvrml::operator>>(std::istream &, vec3f &)): Added stream + extraction operator for openvrml::vec3f. + (openvrml::operator>>(std::istream &, vec3d &)): Added stream + extraction operator for openvrml::vec3d. + (is_normalized): Function object to validate the axis component of + a rotation. + (openvrml::operator>>(std::istream &, rotation &)): Added stream + extraction operator for openvrml::rotation. + (openvrml::operator>>(std::istream &, mat4f &)): Added stream + extraction operator for openvrml::mat4f. + (openvrml::operator>>(std::istream &, quatf &)): Added stream + extraction operator for openvrml::quatf. + (set_pixel): Semantic action to set a pixel when parsing an image. + (resize_image): Semantic action to resize an image given pixel + dimensions and the number of components. + (int32_parser): A Spirit functor parser to parse VRML97-style + integers. + (int32_p): An instance of int32_parser. + (openvrml::operator>>(std::istream &, image &)): Added stream + extraction operator for openvrml::image. + * src/libopenvrml/openvrml/basetypes.h + (openvrml::operator>>(std::istream &, color &)): Added function + declaration. + (openvrml::color): Made operator>> a friend. + (openvrml::operator>>(std::istream &, color_rgba &)): Added + function declaration. + (openvrml::color_rgba): Made operator>> a friend. + (openvrml::operator>>(std::istream &, vec2f &)): Added function + declaration. + (openvrml::vec2f): Made operator>> a friend. + (openvrml::operator>>(std::istream &, vec2d &)): Added function + declaration. + (openvrml::vec2d): Made operator>> a friend. + (openvrml::operator>>(std::istream &, vec3f &)): Added function + declaration. + (openvrml::vec3f): Made operator>> a friend. + (openvrml::operator>>(std::istream &, vec3d &)): Added function + declaration. + (openvrml::vec3d): Made operator>> a friend. + (openvrml::operator>>(std::istream &, rotation &)): Added function + declaration. + (openvrml::operator>>(std::istream &, mat4f &)): Added function + declaration. + (openvrml::operator>>(std::istream &, quatf &)): Added function + declaration. + (openvrml::quatf): Made operator>> a friend. + (openvrml::operator>>(std::istream &, image &)): Added function + declaration. + * tests/Makefile.am: Added color, image, mat4f, and rotation + tests. + * tests/color.cpp: Added file; a test suite for openvrml::color. + * tests/image.cpp: Added file; a test suite for openvrml::image. + * tests/mat4f.cpp: Added file; a test suite for openvrml::mat4f. + * tests/rotation.cpp: Added file; a test suite for + openvrml::rotation. + 2006-08-18 Braden McDaniel <br...@en...> |
From: Braden M. <br...@us...> - 2006-08-23 06:41:31
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9179/src/libopenvrml/openvrml Modified Files: basetypes.cpp basetypes.h Log Message: Overloaded stream extraction operators for the fundamental types. Index: basetypes.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/basetypes.cpp,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** basetypes.cpp 6 Aug 2006 02:34:38 -0000 1.37 --- basetypes.cpp 23 Aug 2006 06:41:27 -0000 1.38 *************** *** 4,8 **** // // Copyright 2001 S. K. Bose ! // Copyright 2003, 2004 Braden McDaniel // // This library is free software; you can redistribute it and/or --- 4,8 ---- // // Copyright 2001 S. K. Bose ! // Copyright 2003, 2004, 2005, 2006 Braden McDaniel // // This library is free software; you can redistribute it and/or *************** *** 23,26 **** --- 23,30 ---- # include <numeric> # include <ostream> + # include <boost/spirit.hpp> + # include <boost/spirit/actor.hpp> + # include <boost/spirit/dynamic.hpp> + # include <boost/spirit/phoenix.hpp> # include <private.h> # include "basetypes.h" *************** *** 108,112 **** * @brief A color. * ! * VRML colors are represented as three single precision floating point * components—red, green, and blue—ranging from 0.0 to 1.0. */ --- 112,116 ---- * @brief A color. * ! * VRML colors are represented as three single-precision floating point * components—red, green, and blue—ranging from 0.0 to 1.0. */ *************** *** 278,281 **** --- 282,399 ---- } + namespace { + struct OPENVRML_LOCAL vrml97_space_parser : + boost::spirit::char_parser<vrml97_space_parser> { + + typedef vrml97_space_parser self_t; + + template <typename CharT> + bool test(const CharT & c) const + { + return isspace(c) || c == ','; + } + }; + + const vrml97_space_parser vrml97_space_p = vrml97_space_parser(); + + typedef std::istream::char_type char_t; + typedef boost::spirit::multi_pass<std::istreambuf_iterator<char_t> > + iterator_t; + + typedef boost::spirit::skip_parser_iteration_policy<vrml97_space_parser> + iter_policy_t; + typedef boost::spirit::scanner_policies<iter_policy_t> scanner_policies_t; + typedef boost::spirit::scanner<iterator_t, scanner_policies_t> scanner_t; + + typedef boost::spirit::rule<scanner_t> rule_t; + + + struct OPENVRML_LOCAL intensity_parser { + + typedef double result_t; + + struct valid { + explicit valid(result_t & value): + value_(value) + {} + + bool operator()() const + { + return this->value_ >= 0.0 && this->value_ <= 1.0; + } + + private: + result_t & value_; + }; + + template <typename ScannerT> + std::ptrdiff_t operator()(const ScannerT & scan, + result_t & result) const + { + using boost::spirit::assign_a; + using boost::spirit::eps_p; + using boost::spirit::real_p; + using boost::spirit::match_result; + typedef typename match_result<ScannerT, result_t>::type match_t; + typedef typename boost::spirit::rule<ScannerT> rule_t; + + rule_t rule + = real_p[assign_a(result)] >> eps_p(valid(result)) + ; + match_t match = rule.parse(scan); + return match.length(); + } + }; + + const boost::spirit::functor_parser<intensity_parser> intensity_p; + } + + /** + * @brief Stream input. + * + * Consistent with the VRML97 convention, commas (“@c ,”) in the + * input are treated as whitespace. + * + * If any of the color components are outside the the range [0.0, 1.0], the + * @c failbit will be set on @p in and @p c will be left in an arbitrary + * state. + * + * @param[in,out] in input stream. + * @param[out] c a @c color. + * + * @return @p in. + */ + std::istream & openvrml::operator>>(std::istream & in, color & c) + { + using std::istreambuf_iterator; + using boost::spirit::make_multi_pass; + using boost::spirit::match; + using boost::spirit::real_p; + using boost::spirit::assign_a; + + iter_policy_t iter_policy(vrml97_space_p); + scanner_policies_t policies(iter_policy); + iterator_t + first(make_multi_pass(istreambuf_iterator<char_t>(in))), + last(make_multi_pass(istreambuf_iterator<char_t>())); + + scanner_t scan(first, last, policies); + + rule_t rule + = intensity_p[assign_a(c.rgb[0])] + >> intensity_p[assign_a(c.rgb[1])] + >> intensity_p[assign_a(c.rgb[2])] + ; + + match<> m = rule.parse(scan); + + if (!m) { + in.setstate(std::ios_base::failbit); + return in; + } + + return in; + } + /** * @relatesalso openvrml::color *************** *** 284,288 **** * * @param[in,out] out output stream. ! * @param[in] c a color. * * @return @p out. --- 402,406 ---- * * @param[in,out] out output stream. ! * @param[in] c a @c color. * * @return @p out. *************** *** 298,302 **** * @brief A color with alpha channel. * ! * VRML @c color_rgba%s are represented as four single precision floating * point components—red, green, blue, and alpha—ranging from 0.0 * to 1.0. For the alpha channel, 1.0 is opaque. --- 416,420 ---- * @brief A color with alpha channel. * ! * VRML @c color_rgba%s are represented as four single-precision floating * point components—red, green, blue, and alpha—ranging from 0.0 * to 1.0. For the alpha channel, 1.0 is opaque. *************** *** 496,499 **** --- 614,664 ---- /** + * @brief Stream input. + * + * Consistent with the VRML97 convention, commas (“@c ,”) in the + * input are treated as whitespace. + * + * If any of the color components are outside the the range [0.0, 1.0], the + * @c failbit will be set on @p in and @p c will be left in an arbitrary + * state. + * + * @param[in,out] in input stream. + * @param[out] c a @c color_rgba. + * + * @return @p in. + */ + std::istream & openvrml::operator>>(std::istream & in, color_rgba & c) + { + using std::istreambuf_iterator; + using boost::spirit::make_multi_pass; + using boost::spirit::match; + using boost::spirit::real_p; + using boost::spirit::assign_a; + + iter_policy_t iter_policy(vrml97_space_p); + scanner_policies_t policies(iter_policy); + iterator_t + first(make_multi_pass(istreambuf_iterator<char_t>(in))), + last(make_multi_pass(istreambuf_iterator<char_t>())); + + scanner_t scan(first, last, policies); + + rule_t rule + = intensity_p[assign_a(c.rgba[0])] + >> intensity_p[assign_a(c.rgba[1])] + >> intensity_p[assign_a(c.rgba[2])] + >> intensity_p[assign_a(c.rgba[3])]; + + match<> m = rule.parse(scan); + + if (!m) { + in.setstate(std::ios_base::failbit); + return in; + } + + return in; + } + + /** * @relatesalso openvrml::color_rgba * *************** *** 514,518 **** * @class openvrml::vec2f * ! * @brief Two-component single precision vector. */ --- 679,683 ---- * @class openvrml::vec2f * ! * @brief Two-component single-precision vector. */ *************** *** 855,858 **** --- 1020,1063 ---- /** + * @brief Stream input. + * + * Consistent with the VRML97 convention, commas (“@c ,”) in the + * input are treated as whitespace. + * + * @param[in,out] in input stream. + * @param[out] v a @c vec2f. + * + * @return @p in. + */ + std::istream & openvrml::operator>>(std::istream & in, vec2f & v) + { + using std::istreambuf_iterator; + using boost::spirit::make_multi_pass; + using boost::spirit::match; + using boost::spirit::real_p; + using boost::spirit::assign_a; + + iter_policy_t iter_policy(vrml97_space_p); + scanner_policies_t policies(iter_policy); + iterator_t + first(make_multi_pass(istreambuf_iterator<char_t>(in))), + last(make_multi_pass(istreambuf_iterator<char_t>())); + + scanner_t scan(first, last, policies); + + rule_t r + = real_p[assign_a(v.vec[0])] >> real_p[assign_a(v.vec[1])] + ; + + match<> m = r.parse(scan); + + if (!m) { + in.setstate(std::ios_base::failbit); + } + + return in; + } + + /** * @relatesalso openvrml::vec2f * *************** *** 873,877 **** * @class openvrml::vec2d * ! * @brief Two-component single precision vector. */ --- 1078,1082 ---- * @class openvrml::vec2d * ! * @brief Two-component double-precision vector. */ *************** *** 1214,1217 **** --- 1419,1462 ---- /** + * @brief Stream input. + * + * Consistent with the VRML97 convention, commas (“@c ,”) in the + * input are treated as whitespace. + * + * @param[in,out] in input stream. + * @param[out] v a @c vec2d. + * + * @return @p in. + */ + std::istream & openvrml::operator>>(std::istream & in, vec2d & v) + { + using std::istreambuf_iterator; + using boost::spirit::make_multi_pass; + using boost::spirit::match; + using boost::spirit::real_p; + using boost::spirit::assign_a; + + iter_policy_t iter_policy(vrml97_space_p); + scanner_policies_t policies(iter_policy); + iterator_t + first(make_multi_pass(istreambuf_iterator<char_t>(in))), + last(make_multi_pass(istreambuf_iterator<char_t>())); + + scanner_t scan(first, last, policies); + + rule_t r + = real_p[assign_a(v.vec[0])] >> real_p[assign_a(v.vec[1])] + ; + + match<> m = r.parse(scan); + + if (!m) { + in.setstate(std::ios_base::failbit); + } + + return in; + } + + /** * @relatesalso openvrml::vec2d * *************** *** 1232,1236 **** * @class openvrml::vec3f * ! * @brief Three-component single precision vector. */ --- 1477,1481 ---- * @class openvrml::vec3f * ! * @brief Three-component single-precision vector. */ *************** *** 1703,1706 **** --- 1948,1993 ---- /** + * @brief Stream input. + * + * Consistent with the VRML97 convention, commas (“@c ,”) in the + * input are treated as whitespace. + * + * @param[in,out] in input stream. + * @param[out] v a @c vec3f. + * + * @return @p in. + */ + std::istream & openvrml::operator>>(std::istream & in, vec3f & v) + { + using std::istreambuf_iterator; + using boost::spirit::make_multi_pass; + using boost::spirit::match; + using boost::spirit::real_p; + using boost::spirit::assign_a; + + iter_policy_t iter_policy(vrml97_space_p); + scanner_policies_t policies(iter_policy); + iterator_t + first(make_multi_pass(istreambuf_iterator<char_t>(in))), + last(make_multi_pass(istreambuf_iterator<char_t>())); + + scanner_t scan(first, last, policies); + + rule_t r + = real_p[assign_a(v.vec[0])] + >> real_p[assign_a(v.vec[1])] + >> real_p[assign_a(v.vec[2])] + ; + + match<> m = r.parse(scan); + + if (!m) { + in.setstate(std::ios_base::failbit); + } + + return in; + } + + /** * @relatesalso openvrml::vec3f * *************** *** 1721,1725 **** * @class openvrml::vec3d * ! * @brief Three-component single precision vector. */ --- 2008,2012 ---- * @class openvrml::vec3d * ! * @brief Three-component double-precision vector. */ *************** *** 2192,2195 **** --- 2479,2524 ---- /** + * @brief Stream input. + * + * Consistent with the VRML97 convention, commas (“@c ,”) in the + * input are treated as whitespace. + * + * @param[in,out] in input stream. + * @param[out] v a @c vec3d. + * + * @return @p in. + */ + std::istream & openvrml::operator>>(std::istream & in, vec3d & v) + { + using std::istreambuf_iterator; + using boost::spirit::make_multi_pass; + using boost::spirit::match; + using boost::spirit::real_p; + using boost::spirit::assign_a; + + iter_policy_t iter_policy(vrml97_space_p); + scanner_policies_t policies(iter_policy); + iterator_t + first(make_multi_pass(istreambuf_iterator<char_t>(in))), + last(make_multi_pass(istreambuf_iterator<char_t>())); + + scanner_t scan(first, last, policies); + + rule_t r + = real_p[assign_a(v.vec[0])] + >> real_p[assign_a(v.vec[1])] + >> real_p[assign_a(v.vec[2])] + ; + + match<> m = r.parse(scan); + + if (!m) { + in.setstate(std::ios_base::failbit); + } + + return in; + } + + /** * @relatesalso openvrml::vec3d * *************** *** 2212,2216 **** * @brief A rotation. * ! * VRML rotations are represented with four single precision floating point * components. The first three are an axis of rotation, and the last is * rotation in radians. --- 2541,2545 ---- * @brief A rotation. * ! * VRML rotations are represented with four single-precision floating point * components. The first three are an axis of rotation, and the last is * rotation in radians. *************** *** 2605,2608 **** --- 2934,3013 ---- } + namespace { + struct OPENVRML_LOCAL is_normalized { + is_normalized(float & x, float & y, float & z): + x_(x), + y_(y), + z_(z) + {} + + bool operator()() const + { + using openvrml::vec3f; + using openvrml_::fequal; + return fequal(vec3f(this->x_, this->y_, this->z_).length(), 1.0f); + } + + private: + float & x_, & y_, & z_; + }; + } + + /** + * @relatesalso openvrml::rotation + * + * @brief Stream input. + * + * Consistent with the VRML97 convention, commas (“@c ,”) in the + * input are treated as whitespace. + * + * If the axis components of the rotation do not represent a normalized + * vector, the @c failbit will be set on @p in and @p rot will not be + * modified. + * + * @param[in,out] in input stream. + * @param[out] rot a @c rotation. + * + * @return @p in. + */ + std::istream & openvrml::operator>>(std::istream & in, rotation & rot) + { + using std::istreambuf_iterator; + using boost::spirit::make_multi_pass; + using boost::spirit::match; + using boost::spirit::eps_p; + using boost::spirit::real_p; + using boost::spirit::assign_a; + + iter_policy_t iter_policy(vrml97_space_p); + scanner_policies_t policies(iter_policy); + iterator_t + first(make_multi_pass(istreambuf_iterator<char_t>(in))), + last(make_multi_pass(istreambuf_iterator<char_t>())); + + scanner_t scan(first, last, policies); + + float x, y, z, angle; + rule_t rule + = real_p[assign_a(x)] >> real_p[assign_a(y)] >> real_p[assign_a(z)] + >> eps_p(is_normalized(x, y, z)) + >> real_p[assign_a(angle)] + ; + + match<> m = rule.parse(scan); + + if (!m) { + in.setstate(std::ios_base::failbit); + return in; + } + + rot.x(x); + rot.y(y); + rot.z(z); + rot.angle(angle); + + return in; + } + /** * @relatesalso openvrml::rotation *************** *** 3422,3429 **** * @relatesalso openvrml::mat4f * * @brief Stream output. * * @param[in,out] out an output stream. ! * @param[in] mat a matrix. * * @return @p out. --- 3827,3911 ---- * @relatesalso openvrml::mat4f * + * @brief Stream input. + * + * Consistent with the VRML97 convention, commas (“@c ,”) in the + * input are treated as whitespace. + * + * Optionally, brackets may be used in the input to group the rows; i.e., the + * following syntaxes are accepted: + * + * - [ <var>f<sub>11</sub></var>, ... <var>f<sub>14</sub></var> ], ... [ <var>f<sub>41</sub></var>, ... <var>f<sub>44</sub></var> ] + * - <var>f<sub>11</sub></var>, <var>f<sub>12</sub></var>, ... <var>f<sub>44</sub></var> + * + * @param[in,out] in input stream. + * @param[out] m a matrix. + * + * @return @p in. + */ + std::istream & openvrml::operator>>(std::istream & in, mat4f & m) + { + using std::istreambuf_iterator; + using boost::spirit::make_multi_pass; + using boost::spirit::ch_p; + using boost::spirit::real_p; + using boost::spirit::assign_a; + using boost::spirit::increment_a; + using boost::spirit::decrement_a; + + iter_policy_t iter_policy(vrml97_space_p); + scanner_policies_t policies(iter_policy); + iterator_t + first(make_multi_pass(istreambuf_iterator<char_t>(in))), + last(make_multi_pass(istreambuf_iterator<char_t>())); + + scanner_t scan(first, last, policies); + + size_t row1_bracket_count = 0, row2_bracket_count = 0, row3_bracket_count = 0, + row4_bracket_count = 0; + + rule_t r + = !ch_p('[')[increment_a(row1_bracket_count)] + >> real_p[assign_a(m[0][0])] + >> real_p[assign_a(m[0][1])] + >> real_p[assign_a(m[0][2])] + >> real_p[assign_a(m[0][3])] + >> !ch_p(']')[decrement_a(row1_bracket_count)] + >> !ch_p('[')[increment_a(row2_bracket_count)] + >> real_p[assign_a(m[1][0])] + >> real_p[assign_a(m[1][1])] + >> real_p[assign_a(m[1][2])] + >> real_p[assign_a(m[1][3])] + >> !ch_p(']')[decrement_a(row2_bracket_count)] + >> !ch_p('[')[increment_a(row3_bracket_count)] + >> real_p[assign_a(m[2][0])] + >> real_p[assign_a(m[2][1])] + >> real_p[assign_a(m[2][2])] + >> real_p[assign_a(m[2][3])] + >> !ch_p(']')[decrement_a(row3_bracket_count)] + >> !ch_p('[')[increment_a(row4_bracket_count)] + >> real_p[assign_a(m[3][0])] + >> real_p[assign_a(m[3][1])] + >> real_p[assign_a(m[3][2])] + >> real_p[assign_a(m[3][3])] + >> !ch_p(']')[decrement_a(row4_bracket_count)] + ; + + boost::spirit::match<> match = r.parse(scan); + + if (!match || row1_bracket_count != 0 || row2_bracket_count != 0 + || row3_bracket_count != 0 || row4_bracket_count != 0) { + in.setstate(std::ios_base::failbit); + } + + return in; + } + + /** + * @relatesalso openvrml::mat4f + * * @brief Stream output. * * @param[in,out] out an output stream. ! * @param[in] mat a matrix. * * @return @p out. *************** *** 3431,3435 **** std::ostream & openvrml::operator<<(std::ostream & out, const mat4f & mat) { - out << '['; for (size_t i = 0; i < 4; i++) { out << '['; --- 3913,3916 ---- *************** *** 3441,3445 **** if (i != 3) { out << ", "; } } - out << ']'; return out; } --- 3922,3925 ---- *************** *** 3939,3942 **** --- 4419,4465 ---- /** + * @brief Stream input. + * + * Consistent with the VRML97 convention, commas (“@c ,”) in the + * input are treated as whitespace. + * + * @param[in,out] in input stream. + * @param[out] q a @c quatf. + * + * @return @p in. + */ + std::istream & openvrml::operator>>(std::istream & in, quatf & q) + { + using std::istreambuf_iterator; + using boost::spirit::make_multi_pass; + using boost::spirit::match; + using boost::spirit::real_p; + using boost::spirit::assign_a; + + iter_policy_t iter_policy(vrml97_space_p); + scanner_policies_t policies(iter_policy); + iterator_t + first(make_multi_pass(istreambuf_iterator<char_t>(in))), + last(make_multi_pass(istreambuf_iterator<char_t>())); + + scanner_t scan(first, last, policies); + + rule_t r + = real_p[assign_a(q.quat[0])] + >> real_p[assign_a(q.quat[1])] + >> real_p[assign_a(q.quat[2])] + >> real_p[assign_a(q.quat[3])] + ; + + match<> m = r.parse(scan); + + if (!m) { + in.setstate(std::ios_base::failbit); + } + + return in; + } + + /** * @relatesalso openvrml::quatf * *************** *** 4317,4320 **** --- 4840,4963 ---- } + namespace { + + struct OPENVRML_LOCAL set_pixel { + set_pixel(openvrml::image & img, size_t & index): + img_(&img), + index_(&index) + {} + + template <typename NumT> + void operator()(NumT val) const + { + this->img_->pixel(*this->index_, val); + } + + private: + openvrml::image * const img_; + size_t * const index_; + }; + + struct OPENVRML_LOCAL resize_image { + resize_image(openvrml::image & img, + size_t & x, size_t & y, size_t & comp): + img_(&img), + x_(&x), + y_(&y), + comp_(&comp) + {} + + template <typename IteratorT> + void operator()(IteratorT, IteratorT) const + { + openvrml::image temp(*this->x_, *this->y_, *this->comp_); + this->img_->swap(temp); + } + + private: + openvrml::image * const img_; + size_t * const x_, * const y_, * const comp_; + }; + + + struct OPENVRML_LOCAL int32_parser { + typedef openvrml::int32 result_t; + + template <typename ScannerT> + std::ptrdiff_t operator()(const ScannerT & scan, + result_t & result) const + { + using namespace boost::spirit; + using namespace phoenix; + typedef typename match_result<ScannerT, result_t>::type match_t; + match_t match + = ( lexeme_d[ + ch_p('0') >> chset_p("Xx") + >> hex_p[assign_a(result)] + ] + | int_p[assign_a(result)] + ).parse(scan); + return match.length(); + } + }; + + const boost::spirit::functor_parser<int32_parser> int32_p = int32_parser(); + } + + /** + * @brief Stream input. + * + * Consistent with the VRML97 convention, commas (“@c ,”) in the + * input are treated as whitespace. + * + * @param[in,out] in input stream. + * @param[out] img an @c image. + * + * @return @p in. + */ + std::istream & openvrml::operator>>(std::istream & in, image & img) + { + using std::istreambuf_iterator; + using boost::ref; + using boost::spirit::make_multi_pass; + using boost::spirit::match; + using boost::spirit::eps_p; + using boost::spirit::int_p; + using boost::spirit::repeat_p; + using boost::spirit::assign_a; + using boost::spirit::increment_a; + using phoenix::arg1; + using phoenix::var; + + iter_policy_t iter_policy(vrml97_space_p); + scanner_policies_t policies(iter_policy); + iterator_t + first(make_multi_pass(istreambuf_iterator<char_t>(in))), + last(make_multi_pass(istreambuf_iterator<char_t>())); + + scanner_t scan(first, last, policies); + + size_t x = 0, y = 0, comp = 0, pixels = 0, index = 0; + rule_t r + = int32_p[var(pixels) = arg1][assign_a(x)] + >> int32_p[var(pixels) *= arg1][assign_a(y)] + >> int32_p[assign_a(comp)] + // Just resize the image once we have the x, y, and comp values to + // avoid unnecessary reallocation. + >> eps_p[resize_image(img, x, y, comp)] + >> repeat_p(ref(pixels))[ + int32_p[set_pixel(img, index)][increment_a(index)] + ] + ; + + match<> m = r.parse(scan); + + if (!m) { + in.setstate(std::ios_base::failbit); + } + + return in; + } + /** * @relatesalso openvrml::image Index: basetypes.h =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/basetypes.h,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** basetypes.h 20 Feb 2006 04:37:28 -0000 1.23 --- basetypes.h 23 Aug 2006 06:41:27 -0000 1.24 *************** *** 4,8 **** // // Copyright 2001 S. K. Bose ! // Copyright 2003, 2004 Braden McDaniel // // This library is free software; you can redistribute it and/or --- 4,8 ---- // // Copyright 2001 S. K. Bose ! // Copyright 2003, 2004, 2005, 2006 Braden McDaniel // // This library is free software; you can redistribute it and/or *************** *** 41,45 **** --- 41,52 ---- # endif + + class color; + + OPENVRML_API std::istream & operator>>(std::istream & in, color & c); + class OPENVRML_API color { + friend std::istream & operator>>(std::istream & in, color & c); + float rgb[3]; *************** *** 108,112 **** --- 115,125 ---- + class color_rgba; + + OPENVRML_API std::istream & operator>>(std::istream & in, color_rgba & c); + class OPENVRML_API color_rgba { + friend std::istream & operator>>(std::istream & in, color_rgba & c); + float rgba[4]; *************** *** 189,193 **** --- 202,212 ---- + class vec2f; + + OPENVRML_API std::istream & operator>>(std::istream & in, vec2f & v); + class OPENVRML_API vec2f { + friend std::istream & operator>>(std::istream & in, vec2f & v); + float vec[2]; *************** *** 273,277 **** --- 292,302 ---- + class vec2d; + + OPENVRML_API std::istream & operator>>(std::istream & in, vec2d & v); + class OPENVRML_API vec2d { + friend std::istream & operator>>(std::istream & in, vec2d & v); + double vec[2]; *************** *** 358,363 **** --- 383,393 ---- class mat4f; + class vec3f; + + OPENVRML_API std::istream & operator>>(std::istream & in, vec3f & v); class OPENVRML_API vec3f { + friend std::istream & operator>>(std::istream & in, vec3f & v); + float vec[3]; *************** *** 470,474 **** --- 500,510 ---- + class vec3d; + + OPENVRML_API std::istream & operator>>(std::istream & in, vec3d & v); + class OPENVRML_API vec3d { + friend std::istream & operator>>(std::istream & in, vec3d & v); + double vec[3]; *************** *** 623,626 **** --- 659,663 ---- OPENVRML_API bool operator!=(const rotation & lhs, const rotation & rhs) OPENVRML_NOTHROW; + OPENVRML_API std::istream & operator>>(std::istream & in, rotation & rot); OPENVRML_API std::ostream & operator<<(std::ostream & out, const rotation & r); *************** *** 730,738 **** --- 767,780 ---- OPENVRML_API const mat4f operator*(float scalar, const mat4f & mat) OPENVRML_NOTHROW; + OPENVRML_API std::istream & operator>>(std::istream & in, mat4f & mat); OPENVRML_API std::ostream & operator<<(std::ostream & out, const mat4f & mat); + OPENVRML_API std::istream & operator>>(std::istream & in, quatf & q); + class OPENVRML_API quatf { + friend std::istream & operator>>(std::istream & in, quatf & q); + float quat[4]; *************** *** 990,993 **** --- 1032,1036 ---- } + OPENVRML_API std::istream & operator>>(std::istream & in, image & img); OPENVRML_API std::ostream & operator<<(std::ostream & out, const image & img); |
From: Braden M. <br...@us...> - 2006-08-23 06:41:31
|
Update of /cvsroot/openvrml/openvrml/tests In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9179/tests Modified Files: Makefile.am Added Files: color.cpp image.cpp mat4f.cpp rotation.cpp Log Message: Overloaded stream extraction operators for the fundamental types. --- NEW FILE: color.cpp --- // -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 4; -*- // // Copyright 2006 Braden McDaniel // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // # include <sstream> # include <boost/test/unit_test.hpp> # include <openvrml/basetypes.h> using namespace std; using namespace openvrml; void stream_extraction_without_commas() { color c1(1.0, 1.0, 1.0), c2(0.5, 0.5, 0.5), c3, c4; string color_str = "1.0 1.0 1.0 0.5 0.5 0.5"; istringstream in(color_str); in >> c3 >> c4; BOOST_REQUIRE(in.good()); BOOST_REQUIRE_EQUAL(c1, c3); BOOST_REQUIRE_EQUAL(c2, c4); } void stream_extraction_with_commas() { color c1(1.0, 1.0, 1.0), c2(0.5, 0.5, 0.5), c3, c4; string color_str = "1.0, 1.0, 1.0, 0.5, 0.5, 0.5"; istringstream in(color_str); in >> c3 >> c4; BOOST_REQUIRE(in.good()); BOOST_REQUIRE_EQUAL(c1, c3); BOOST_REQUIRE_EQUAL(c2, c4); } void stream_extraction_fail_on_invalid_intensity() { color c; string color_str = "2.0 0.5 0.5"; istringstream in(color_str); in >> c; BOOST_REQUIRE(in.fail()); } boost::unit_test::test_suite * init_unit_test_suite(int, char * []) { using boost::unit_test::test_suite; test_suite * const suite = BOOST_TEST_SUITE("color"); suite->add(BOOST_TEST_CASE(&stream_extraction_without_commas)); suite->add(BOOST_TEST_CASE(&stream_extraction_with_commas)); suite->add(BOOST_TEST_CASE(&stream_extraction_fail_on_invalid_intensity)); return suite; } --- NEW FILE: image.cpp --- // -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 4; -*- // // Copyright 2006 Braden McDaniel // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // # include <sstream> # include <boost/array.hpp> # include <boost/test/unit_test.hpp> # include <openvrml/basetypes.h> using namespace std; using namespace openvrml; void stream_insertion() { const image img(2, 2, 1); const string image_str = "2 2 1 0x0 0x0 0x0 0x0"; ostringstream out; out << img; BOOST_REQUIRE(out.good()); BOOST_REQUIRE_EQUAL(out.str(), image_str); } void stream_extraction() { const boost::array<unsigned char, 4> pixels = { 0xFF, 0x00, 0xFF, 0x00 }; const image img1(2, 2, 1, pixels.begin(), pixels.end()); image img2; const string image_str = "2 2 1 0xFF 0x00 0xFF 0x00"; istringstream in(image_str); in >> img2; BOOST_REQUIRE(in.good()); BOOST_REQUIRE_EQUAL(img1, img2); } void stream_extraction_insufficient_pixel_values() { const string image_str = "2 2 1 0xFF 0x00 0xFF"; istringstream in(image_str); image img; in >> img; BOOST_REQUIRE(in.fail()); } boost::unit_test::test_suite * init_unit_test_suite(int, char * []) { using boost::unit_test::test_suite; test_suite * const suite = BOOST_TEST_SUITE("image"); suite->add(BOOST_TEST_CASE(&stream_insertion)); suite->add(BOOST_TEST_CASE(&stream_extraction)); suite->add(BOOST_TEST_CASE(&stream_extraction_insufficient_pixel_values)); return suite; } --- NEW FILE: mat4f.cpp --- // -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 4; -*- // // Copyright 2006 Braden McDaniel // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // # include <sstream> # include <boost/test/unit_test.hpp> # include <openvrml/basetypes.h> using namespace std; using namespace openvrml; void stream_insertion() { mat4f m; const string mat4f_str = "[1, 0, 0, 0], " "[0, 1, 0, 0], " "[0, 0, 1, 0], " "[0, 0, 0, 1]"; ostringstream out; out << m; BOOST_REQUIRE_EQUAL(out.str(), mat4f_str); } void stream_extraction_numbers_only() { const mat4f m1(1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 3, 0, 0, 0, 0, 4); mat4f m2; const string mat4f_str = "1 0 0 0 " "0 2 0 0 " "0 0 3 0 " "0 0 0 4"; istringstream in(mat4f_str); in >> m2; BOOST_REQUIRE_EQUAL(m1, m2); } void stream_extraction_numbers_with_commas() { const mat4f m1(1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 3, 0, 0, 0, 0, 4); mat4f m2; const string mat4f_str = "1, 0, 0, 0, " "0, 2, 0, 0, " "0, 0, 3, 0, " "0, 0, 0, 4"; istringstream in(mat4f_str); in >> m2; BOOST_REQUIRE_EQUAL(m1, m2); } boost::unit_test::test_suite * init_unit_test_suite(int, char * []) { using boost::unit_test::test_suite; test_suite * const suite = BOOST_TEST_SUITE("mat4f"); suite->add(BOOST_TEST_CASE(&stream_insertion)); suite->add(BOOST_TEST_CASE(&stream_extraction_numbers_only)); suite->add(BOOST_TEST_CASE(&stream_extraction_numbers_with_commas)); return suite; } Index: Makefile.am =================================================================== RCS file: /cvsroot/openvrml/openvrml/tests/Makefile.am,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Makefile.am 28 Jul 2006 07:11:10 -0000 1.14 --- Makefile.am 23 Aug 2006 06:41:27 -0000 1.15 *************** *** 6,10 **** TESTS_ENVIRONMENT = BOOST_TEST_REPORT_LEVEL=detailed ! TESTS = \ browser \ parse_anchor \ --- 6,13 ---- TESTS_ENVIRONMENT = BOOST_TEST_REPORT_LEVEL=detailed ! TESTS = color \ ! rotation \ ! mat4f \ ! image \ browser \ parse_anchor \ *************** *** 19,22 **** --- 22,45 ---- libtest_openvrml_la_LIBADD = $(top_builddir)/src/libopenvrml/libopenvrml.la + color_SOURCES = color.cpp + color_LDADD = \ + $(top_builddir)/src/libopenvrml/libopenvrml.la \ + -lboost_unit_test_framework + + rotation_SOURCES = rotation.cpp + rotation_LDADD = \ + $(top_builddir)/src/libopenvrml/libopenvrml.la \ + -lboost_unit_test_framework + + mat4f_SOURCES = mat4f.cpp + mat4f_LDADD = \ + $(top_builddir)/src/libopenvrml/libopenvrml.la \ + -lboost_unit_test_framework + + image_SOURCES = image.cpp + image_LDADD = \ + $(top_builddir)/src/libopenvrml/libopenvrml.la \ + -lboost_unit_test_framework + browser_SOURCES = browser.cpp browser_LDADD = libtest-openvrml.la -lboost_unit_test_framework -lboost_filesystem --- NEW FILE: rotation.cpp --- // -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 4; -*- // // Copyright 2006 Braden McDaniel // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // # include <sstream> # include <boost/test/unit_test.hpp> # include <openvrml/basetypes.h> using namespace std; using namespace openvrml; void stream_extraction_fail_on_nonnormalized_axis() { string rotation_str = "2.0 2.0 0.0 0.0"; istringstream in(rotation_str); rotation r; in >> r; BOOST_REQUIRE(in.fail()); } boost::unit_test::test_suite * init_unit_test_suite(int, char * []) { using boost::unit_test::test_suite; test_suite * const suite = BOOST_TEST_SUITE("rotation"); suite->add(BOOST_TEST_CASE(&stream_extraction_fail_on_nonnormalized_axis)); return suite; } |
From: Braden M. <br...@us...> - 2006-08-18 20:04:40
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28174/src/libopenvrml/openvrml Modified Files: browser.cpp Log Message: Initialize begin and end iterators for the various URI parts to the beginning of the string. Index: browser.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/browser.cpp,v retrieving revision 1.190 retrieving revision 1.191 diff -C2 -d -r1.190 -r1.191 *** browser.cpp 10 Aug 2006 23:10:56 -0000 1.190 --- browser.cpp 18 Aug 2006 20:04:37 -0000 1.191 *************** *** 3668,3677 **** } ! uri::uri() OPENVRML_THROW1(std::bad_alloc) {} uri::uri(const std::string & str) OPENVRML_THROW2(openvrml::invalid_url, std::bad_alloc): ! str_(str) { using std::string; --- 3668,3713 ---- } ! uri::uri() OPENVRML_THROW1(std::bad_alloc): ! scheme_begin(this->str_.begin()), ! scheme_end(this->str_.begin()), ! scheme_specific_part_begin(this->str_.begin()), ! scheme_specific_part_end(this->str_.begin()), ! authority_begin(this->str_.begin()), ! authority_end(this->str_.begin()), ! userinfo_begin(this->str_.begin()), ! userinfo_end(this->str_.begin()), ! host_begin(this->str_.begin()), ! host_end(this->str_.begin()), ! port_begin(this->str_.begin()), ! port_end(this->str_.begin()), ! path_begin(this->str_.begin()), ! path_end(this->str_.begin()), ! query_begin(this->str_.begin()), ! query_end(this->str_.begin()), ! fragment_begin(this->str_.begin()), ! fragment_end(this->str_.begin()) {} uri::uri(const std::string & str) OPENVRML_THROW2(openvrml::invalid_url, std::bad_alloc): ! str_(str), ! scheme_begin(this->str_.begin()), ! scheme_end(this->str_.begin()), ! scheme_specific_part_begin(this->str_.begin()), ! scheme_specific_part_end(this->str_.begin()), ! authority_begin(this->str_.begin()), ! authority_end(this->str_.begin()), ! userinfo_begin(this->str_.begin()), ! userinfo_end(this->str_.begin()), ! host_begin(this->str_.begin()), ! host_end(this->str_.begin()), ! port_begin(this->str_.begin()), ! port_end(this->str_.begin()), ! path_begin(this->str_.begin()), ! path_end(this->str_.begin()), ! query_begin(this->str_.begin()), ! query_end(this->str_.begin()), ! fragment_begin(this->str_.begin()), ! fragment_end(this->str_.begin()) { using std::string; |
From: Braden M. <br...@us...> - 2006-08-18 20:04:40
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28174 Modified Files: ChangeLog Log Message: Initialize begin and end iterators for the various URI parts to the beginning of the string. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1313 retrieving revision 1.1314 diff -C2 -d -r1.1313 -r1.1314 *** ChangeLog 17 Aug 2006 20:04:22 -0000 1.1313 --- ChangeLog 18 Aug 2006 20:04:37 -0000 1.1314 *************** *** 1,2 **** --- 1,11 ---- + 2006-08-18 Braden McDaniel <br...@en...> + + * src/libopenvrml/openvrml/browser.cpp + (uri::uri()): Initialize begin and end iterators for the various + URI parts to the beginning of the string. + (uri::uri(const std::string &)): Initialize begin and end + iterators for the various URI parts to the beginning of the + string. + 2006-08-17 Braden McDaniel <br...@en...> |
From: Braden M. <br...@us...> - 2006-08-18 20:03:31
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27722 Modified Files: Tag: OpenVRML-0_16-BRANCH ChangeLog Log Message: Initialize begin and end iterators for the various URI parts to the beginning of the string. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1310.2.3 retrieving revision 1.1310.2.4 diff -C2 -d -r1.1310.2.3 -r1.1310.2.4 *** ChangeLog 17 Aug 2006 20:03:06 -0000 1.1310.2.3 --- ChangeLog 18 Aug 2006 20:03:26 -0000 1.1310.2.4 *************** *** 1,2 **** --- 1,11 ---- + 2006-08-18 Braden McDaniel <br...@en...> + + * src/libopenvrml/openvrml/browser.cpp + (uri::uri()): Initialize begin and end iterators for the various + URI parts to the beginning of the string. + (uri::uri(const std::string &)): Initialize begin and end + iterators for the various URI parts to the beginning of the + string. + 2006-08-17 Braden McDaniel <br...@en...> |
From: Braden M. <br...@us...> - 2006-08-18 20:03:30
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27722/src/libopenvrml/openvrml Modified Files: Tag: OpenVRML-0_16-BRANCH browser.cpp Log Message: Initialize begin and end iterators for the various URI parts to the beginning of the string. Index: browser.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/browser.cpp,v retrieving revision 1.190 retrieving revision 1.190.2.1 diff -C2 -d -r1.190 -r1.190.2.1 *** browser.cpp 10 Aug 2006 23:10:56 -0000 1.190 --- browser.cpp 18 Aug 2006 20:03:27 -0000 1.190.2.1 *************** *** 3668,3677 **** } ! uri::uri() OPENVRML_THROW1(std::bad_alloc) {} uri::uri(const std::string & str) OPENVRML_THROW2(openvrml::invalid_url, std::bad_alloc): ! str_(str) { using std::string; --- 3668,3713 ---- } ! uri::uri() OPENVRML_THROW1(std::bad_alloc): ! scheme_begin(this->str_.begin()), ! scheme_end(this->str_.begin()), ! scheme_specific_part_begin(this->str_.begin()), ! scheme_specific_part_end(this->str_.begin()), ! authority_begin(this->str_.begin()), ! authority_end(this->str_.begin()), ! userinfo_begin(this->str_.begin()), ! userinfo_end(this->str_.begin()), ! host_begin(this->str_.begin()), ! host_end(this->str_.begin()), ! port_begin(this->str_.begin()), ! port_end(this->str_.begin()), ! path_begin(this->str_.begin()), ! path_end(this->str_.begin()), ! query_begin(this->str_.begin()), ! query_end(this->str_.begin()), ! fragment_begin(this->str_.begin()), ! fragment_end(this->str_.begin()) {} uri::uri(const std::string & str) OPENVRML_THROW2(openvrml::invalid_url, std::bad_alloc): ! str_(str), ! scheme_begin(this->str_.begin()), ! scheme_end(this->str_.begin()), ! scheme_specific_part_begin(this->str_.begin()), ! scheme_specific_part_end(this->str_.begin()), ! authority_begin(this->str_.begin()), ! authority_end(this->str_.begin()), ! userinfo_begin(this->str_.begin()), ! userinfo_end(this->str_.begin()), ! host_begin(this->str_.begin()), ! host_end(this->str_.begin()), ! port_begin(this->str_.begin()), ! port_end(this->str_.begin()), ! path_begin(this->str_.begin()), ! path_end(this->str_.begin()), ! query_begin(this->str_.begin()), ! query_end(this->str_.begin()), ! fragment_begin(this->str_.begin()), ! fragment_end(this->str_.begin()) { using std::string; |
From: Braden M. <br...@us...> - 2006-08-17 20:04:25
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9232 Modified Files: ChangeLog Log Message: Removed function-try-block; this still seems to confuse Microsoft cl 14.00.50727.42. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1312 retrieving revision 1.1313 diff -C2 -d -r1.1312 -r1.1313 *** ChangeLog 16 Aug 2006 19:29:16 -0000 1.1312 --- ChangeLog 17 Aug 2006 20:04:22 -0000 1.1313 *************** *** 1,2 **** --- 1,10 ---- + 2006-08-17 Braden McDaniel <br...@en...> + + * src/libopenvrml/openvrml/vrml97node.cpp + (update_texture(background_node &, boost::recursive_mutex &, const + openvrml::mfstring &, openvrml::image &)): Removed + function-try-block; this still seems to confuse Microsoft cl + 14.00.50727.42. + 2006-08-16 Braden McDaniel <br...@en...> |
From: Braden M. <br...@us...> - 2006-08-17 20:04:24
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9232/src/libopenvrml/openvrml Modified Files: vrml97node.cpp Log Message: Removed function-try-block; this still seems to confuse Microsoft cl 14.00.50727.42. Index: vrml97node.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/vrml97node.cpp,v retrieving revision 1.109 retrieving revision 1.110 diff -C2 -d -r1.109 -r1.110 *** vrml97node.cpp 16 Aug 2006 19:29:16 -0000 1.109 --- vrml97node.cpp 17 Aug 2006 20:04:22 -0000 1.110 *************** *** 7449,7471 **** openvrml::image & img) OPENVRML_THROW1(std::bad_alloc) ! try { ! using openvrml::image; ! if (url.value().empty()) { ! img = image(); ! } else { ! using std::auto_ptr; ! using openvrml::resource_istream; ! auto_ptr<resource_istream> in( ! node.scene()->get_resource(url.value())); ! auto_ptr<stream_listener> listener( ! new image_stream_listener(in->url(), ! img, ! node, ! node_mutex)); ! read_stream(in, listener); ! } ! } catch (const openvrml::no_alternative_url & ex) {} /** --- 7449,7473 ---- openvrml::image & img) OPENVRML_THROW1(std::bad_alloc) ! { ! try { ! using openvrml::image; ! if (url.value().empty()) { ! img = image(); ! } else { ! using std::auto_ptr; ! using openvrml::resource_istream; ! auto_ptr<resource_istream> in( ! node.scene()->get_resource(url.value())); ! auto_ptr<stream_listener> listener( ! new image_stream_listener(in->url(), ! img, ! node, ! node_mutex)); ! read_stream(in, listener); ! } ! } catch (const openvrml::no_alternative_url &) {} ! } /** |
From: Braden M. <br...@us...> - 2006-08-17 20:03:12
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8562 Modified Files: Tag: OpenVRML-0_16-BRANCH ChangeLog Log Message: Removed function-try-block; this still seems to confuse Microsoft cl 14.00.50727.42. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1310.2.2 retrieving revision 1.1310.2.3 diff -C2 -d -r1.1310.2.2 -r1.1310.2.3 *** ChangeLog 16 Aug 2006 19:28:16 -0000 1.1310.2.2 --- ChangeLog 17 Aug 2006 20:03:06 -0000 1.1310.2.3 *************** *** 1,2 **** --- 1,10 ---- + 2006-08-17 Braden McDaniel <br...@en...> + + * src/libopenvrml/openvrml/vrml97node.cpp + (update_texture(background_node &, boost::recursive_mutex &, const + openvrml::mfstring &, openvrml::image &)): Removed + function-try-block; this still seems to confuse Microsoft cl + 14.00.50727.42. + 2006-08-16 Braden McDaniel <br...@en...> |
From: Braden M. <br...@us...> - 2006-08-17 20:03:12
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8562/src/libopenvrml/openvrml Modified Files: Tag: OpenVRML-0_16-BRANCH vrml97node.cpp Log Message: Removed function-try-block; this still seems to confuse Microsoft cl 14.00.50727.42. Index: vrml97node.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/vrml97node.cpp,v retrieving revision 1.108.2.1 retrieving revision 1.108.2.2 diff -C2 -d -r1.108.2.1 -r1.108.2.2 *** vrml97node.cpp 16 Aug 2006 19:28:16 -0000 1.108.2.1 --- vrml97node.cpp 17 Aug 2006 20:03:08 -0000 1.108.2.2 *************** *** 7449,7471 **** openvrml::image & img) OPENVRML_THROW1(std::bad_alloc) ! try { ! using openvrml::image; ! if (url.value().empty()) { ! img = image(); ! } else { ! using std::auto_ptr; ! using openvrml::resource_istream; ! auto_ptr<resource_istream> in( ! node.scene()->get_resource(url.value())); ! auto_ptr<stream_listener> listener( ! new image_stream_listener(in->url(), ! img, ! node, ! node_mutex)); ! read_stream(in, listener); ! } ! } catch (const openvrml::no_alternative_url & ex) {} /** --- 7449,7473 ---- openvrml::image & img) OPENVRML_THROW1(std::bad_alloc) ! { ! try { ! using openvrml::image; ! if (url.value().empty()) { ! img = image(); ! } else { ! using std::auto_ptr; ! using openvrml::resource_istream; ! auto_ptr<resource_istream> in( ! node.scene()->get_resource(url.value())); ! auto_ptr<stream_listener> listener( ! new image_stream_listener(in->url(), ! img, ! node, ! node_mutex)); ! read_stream(in, listener); ! } ! } catch (const openvrml::no_alternative_url &) {} ! } /** |
From: Braden M. <br...@us...> - 2006-08-16 19:29:26
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22020/src/libopenvrml/openvrml Modified Files: Tag: OpenVRML-0_16-BRANCH vrml97node.cpp x3d_grouping.cpp Log Message: Replaced static_casts with boost::polymorphic_downcast. Index: x3d_grouping.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/x3d_grouping.cpp,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** x3d_grouping.cpp 18 May 2006 04:11:31 -0000 1.2 --- x3d_grouping.cpp 16 Aug 2006 19:28:17 -0000 1.2.2.1 *************** *** 280,288 **** { if (context.cull_flag != bounding_volume::inside) { ! assert(dynamic_cast<const bounding_sphere *> ! (&this->bounding_volume())); const bounding_sphere & bs = ! static_cast<const bounding_sphere &>( ! this->bounding_volume()); bounding_sphere bv_copy(bs); bv_copy.transform(context.matrix()); --- 280,287 ---- { if (context.cull_flag != bounding_volume::inside) { ! using boost::polymorphic_downcast; const bounding_sphere & bs = ! *polymorphic_downcast<const bounding_sphere *>( ! &this->bounding_volume()); bounding_sphere bv_copy(bs); bv_copy.transform(context.matrix()); Index: vrml97node.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/vrml97node.cpp,v retrieving revision 1.108 retrieving revision 1.108.2.1 diff -C2 -d -r1.108 -r1.108.2.1 *** vrml97node.cpp 2 Aug 2006 03:20:02 -0000 1.108 --- vrml97node.cpp 16 Aug 2006 19:28:16 -0000 1.108.2.1 *************** *** 2075,2079 **** OPENVRML_THROW1(std::bad_alloc) { ! grouping_node_base<Derived> & group = dynamic_cast<grouping_node_base<Derived> &>( this->node_event_listener::node()); --- 2075,2079 ---- OPENVRML_THROW1(std::bad_alloc) { ! grouping_node_base<Derived> & group = dynamic_cast<grouping_node_base<Derived> &>( this->node_event_listener::node()); *************** *** 2221,2229 **** { if (context.cull_flag != bounding_volume::inside) { ! assert(dynamic_cast<const bounding_sphere *> ! (&this->bounding_volume())); const bounding_sphere & bs = ! static_cast<const bounding_sphere &>( ! this->bounding_volume()); bounding_sphere bv_copy(bs); bv_copy.transform(context.matrix()); --- 2221,2228 ---- { if (context.cull_flag != bounding_volume::inside) { ! using boost::polymorphic_downcast; const bounding_sphere & bs = ! *polymorphic_downcast<const bounding_sphere *>( ! &this->bounding_volume()); bounding_sphere bv_copy(bs); bv_copy.transform(context.matrix()); *************** *** 6693,6702 **** void background_node::do_initialize(double) OPENVRML_NOTHROW { ! assert(dynamic_cast<const background_metatype *>( ! &this->type().metatype())); background_metatype & nodeClass = const_cast<background_metatype &>( ! static_cast<const background_metatype &>( ! this->type().metatype())); if (!nodeClass.has_first()) { nodeClass.set_first(*this); } } --- 6692,6700 ---- void background_node::do_initialize(double) OPENVRML_NOTHROW { ! using boost::polymorphic_downcast; background_metatype & nodeClass = const_cast<background_metatype &>( ! *polymorphic_downcast<const background_metatype *>( ! &this->type().metatype())); if (!nodeClass.has_first()) { nodeClass.set_first(*this); } } *************** *** 13488,13497 **** if (context.draw_bounding_spheres) { ! assert(dynamic_cast<const bounding_sphere *>( ! &this->bounding_volume())); const bounding_sphere & bs = ! static_cast<const bounding_sphere &>(this->bounding_volume()); ! viewer.draw_bounding_sphere(bs, ! static_cast<bounding_volume::intersection>(4)); } --- 13486,13496 ---- if (context.draw_bounding_spheres) { ! using boost::polymorphic_downcast; const bounding_sphere & bs = ! *polymorphic_downcast<const bounding_sphere *>( ! &this->bounding_volume()); ! viewer.draw_bounding_sphere( ! bs, ! static_cast<bounding_volume::intersection>(4)); } *************** *** 18202,18209 **** if (context.draw_bounding_spheres) { ! assert(dynamic_cast<const bounding_sphere *> ! (&this->bounding_volume())); const bounding_sphere & bs = ! static_cast<const bounding_sphere &>(this->bounding_volume()); viewer.draw_bounding_sphere(bs, bounding_volume::intersection(4)); } --- 18201,18208 ---- if (context.draw_bounding_spheres) { ! using boost::polymorphic_downcast; const bounding_sphere & bs = ! *polymorphic_downcast<const bounding_sphere *>( ! &this->bounding_volume()); viewer.draw_bounding_sphere(bs, bounding_volume::intersection(4)); } *************** *** 24182,24186 **** * @brief enabled exposedField implementation. */ ! /** * @brief Construct. --- 24181,24185 ---- * @brief enabled exposedField implementation. */ ! /** * @brief Construct. *************** *** 25716,25723 **** { if (context.cull_flag != bounding_volume::inside) { ! assert(dynamic_cast<const bounding_sphere *> ! (&this->bounding_volume())); const bounding_sphere & bs = ! static_cast<const bounding_sphere &>(this->bounding_volume()); bounding_sphere bv_copy(bs); bv_copy.transform(context.matrix()); --- 25715,25722 ---- { if (context.cull_flag != bounding_volume::inside) { ! using boost::polymorphic_downcast; const bounding_sphere & bs = ! *polymorphic_downcast<const bounding_sphere *>( ! &this->bounding_volume()); bounding_sphere bv_copy(bs); bv_copy.transform(context.matrix()); *************** *** 26615,26626 **** OPENVRML_NOTHROW { assert(this->scene()); this->scene()->browser().add_viewpoint(*this); - assert(dynamic_cast<const viewpoint_metatype *>( - &this->type().metatype())); viewpoint_metatype & nodeClass = const_cast<viewpoint_metatype &>( ! static_cast<const viewpoint_metatype &>( ! this->type().metatype())); if (!nodeClass.has_first()) { nodeClass.set_first(*this); } } --- 26614,26624 ---- OPENVRML_NOTHROW { + using boost::polymorphic_downcast; assert(this->scene()); this->scene()->browser().add_viewpoint(*this); viewpoint_metatype & nodeClass = const_cast<viewpoint_metatype &>( ! *polymorphic_downcast<const viewpoint_metatype *>( ! &this->type().metatype())); if (!nodeClass.has_first()) { nodeClass.set_first(*this); } } *************** *** 27202,27206 **** ! class OPENVRML_LOCAL cad_layer_node : public grouping_node_base<cad_layer_node> { --- 27200,27204 ---- ! class OPENVRML_LOCAL cad_layer_node : public grouping_node_base<cad_layer_node> { *************** *** 27230,27236 **** public: ! cad_layer_node(const node_type & type, const boost::shared_ptr<openvrml::scope> & scope); ! virtual ~cad_layer_node() throw (); virtual bool modified() const; --- 27228,27234 ---- public: ! cad_layer_node(const node_type & type, const boost::shared_ptr<openvrml::scope> & scope); ! virtual ~cad_layer_node() throw (); virtual bool modified() const; *************** *** 27312,27316 **** field_value::sfvec3f_id, "bboxSize") ! }; typedef node_type_impl<cad_layer_node> node_type_t; --- 27310,27314 ---- field_value::sfvec3f_id, "bboxSize") ! }; typedef node_type_impl<cad_layer_node> node_type_t; *************** *** 27466,27470 **** try { const std::vector<bool> & visible = this->visible_.mfbool::value(); ! const mfnode::value_type & all_children = this->children_.mfnode::value(); --- 27464,27468 ---- try { const std::vector<bool> & visible = this->visible_.mfbool::value(); ! const mfnode::value_type & all_children = this->children_.mfnode::value(); *************** *** 27575,27579 **** if (this->node::modified()) { return true; } ! mfnode::value_type::const_iterator iter = current_children_.value().begin(); for (; iter != current_children_.value().end(); ++iter) --- 27573,27577 ---- if (this->node::modified()) { return true; } ! mfnode::value_type::const_iterator iter = current_children_.value().begin(); for (; iter != current_children_.value().end(); ++iter) *************** *** 27598,27602 **** do_render_child(openvrml::viewer & viewer, const rendering_context context) { ! mfnode::value_type::const_iterator iter = current_children_.value().begin(); for (; iter != current_children_.value().end(); ++iter) --- 27596,27600 ---- do_render_child(openvrml::viewer & viewer, const rendering_context context) { ! mfnode::value_type::const_iterator iter = current_children_.value().begin(); for (; iter != current_children_.value().end(); ++iter) *************** *** 27627,27631 **** this->bsphere = bounding_sphere(); ! mfnode::value_type::const_iterator iter = current_children_.value().begin(); for (; iter != current_children_.value().end(); ++iter) --- 27625,27629 ---- this->bsphere = bounding_sphere(); ! mfnode::value_type::const_iterator iter = current_children_.value().begin(); for (; iter != current_children_.value().end(); ++iter) |
From: Braden M. <br...@us...> - 2006-08-16 19:29:24
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22424/src/libopenvrml/openvrml Modified Files: vrml97node.cpp x3d_grouping.cpp Log Message: Replaced static_casts with boost::polymorphic_downcast. Index: x3d_grouping.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/x3d_grouping.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** x3d_grouping.cpp 18 May 2006 04:11:31 -0000 1.2 --- x3d_grouping.cpp 16 Aug 2006 19:29:16 -0000 1.3 *************** *** 280,288 **** { if (context.cull_flag != bounding_volume::inside) { ! assert(dynamic_cast<const bounding_sphere *> ! (&this->bounding_volume())); const bounding_sphere & bs = ! static_cast<const bounding_sphere &>( ! this->bounding_volume()); bounding_sphere bv_copy(bs); bv_copy.transform(context.matrix()); --- 280,287 ---- { if (context.cull_flag != bounding_volume::inside) { ! using boost::polymorphic_downcast; const bounding_sphere & bs = ! *polymorphic_downcast<const bounding_sphere *>( ! &this->bounding_volume()); bounding_sphere bv_copy(bs); bv_copy.transform(context.matrix()); Index: vrml97node.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/vrml97node.cpp,v retrieving revision 1.108 retrieving revision 1.109 diff -C2 -d -r1.108 -r1.109 *** vrml97node.cpp 2 Aug 2006 03:20:02 -0000 1.108 --- vrml97node.cpp 16 Aug 2006 19:29:16 -0000 1.109 *************** *** 2075,2079 **** OPENVRML_THROW1(std::bad_alloc) { ! grouping_node_base<Derived> & group = dynamic_cast<grouping_node_base<Derived> &>( this->node_event_listener::node()); --- 2075,2079 ---- OPENVRML_THROW1(std::bad_alloc) { ! grouping_node_base<Derived> & group = dynamic_cast<grouping_node_base<Derived> &>( this->node_event_listener::node()); *************** *** 2221,2229 **** { if (context.cull_flag != bounding_volume::inside) { ! assert(dynamic_cast<const bounding_sphere *> ! (&this->bounding_volume())); const bounding_sphere & bs = ! static_cast<const bounding_sphere &>( ! this->bounding_volume()); bounding_sphere bv_copy(bs); bv_copy.transform(context.matrix()); --- 2221,2228 ---- { if (context.cull_flag != bounding_volume::inside) { ! using boost::polymorphic_downcast; const bounding_sphere & bs = ! *polymorphic_downcast<const bounding_sphere *>( ! &this->bounding_volume()); bounding_sphere bv_copy(bs); bv_copy.transform(context.matrix()); *************** *** 6693,6702 **** void background_node::do_initialize(double) OPENVRML_NOTHROW { ! assert(dynamic_cast<const background_metatype *>( ! &this->type().metatype())); background_metatype & nodeClass = const_cast<background_metatype &>( ! static_cast<const background_metatype &>( ! this->type().metatype())); if (!nodeClass.has_first()) { nodeClass.set_first(*this); } } --- 6692,6700 ---- void background_node::do_initialize(double) OPENVRML_NOTHROW { ! using boost::polymorphic_downcast; background_metatype & nodeClass = const_cast<background_metatype &>( ! *polymorphic_downcast<const background_metatype *>( ! &this->type().metatype())); if (!nodeClass.has_first()) { nodeClass.set_first(*this); } } *************** *** 13488,13497 **** if (context.draw_bounding_spheres) { ! assert(dynamic_cast<const bounding_sphere *>( ! &this->bounding_volume())); const bounding_sphere & bs = ! static_cast<const bounding_sphere &>(this->bounding_volume()); ! viewer.draw_bounding_sphere(bs, ! static_cast<bounding_volume::intersection>(4)); } --- 13486,13496 ---- if (context.draw_bounding_spheres) { ! using boost::polymorphic_downcast; const bounding_sphere & bs = ! *polymorphic_downcast<const bounding_sphere *>( ! &this->bounding_volume()); ! viewer.draw_bounding_sphere( ! bs, ! static_cast<bounding_volume::intersection>(4)); } *************** *** 18202,18209 **** if (context.draw_bounding_spheres) { ! assert(dynamic_cast<const bounding_sphere *> ! (&this->bounding_volume())); const bounding_sphere & bs = ! static_cast<const bounding_sphere &>(this->bounding_volume()); viewer.draw_bounding_sphere(bs, bounding_volume::intersection(4)); } --- 18201,18208 ---- if (context.draw_bounding_spheres) { ! using boost::polymorphic_downcast; const bounding_sphere & bs = ! *polymorphic_downcast<const bounding_sphere *>( ! &this->bounding_volume()); viewer.draw_bounding_sphere(bs, bounding_volume::intersection(4)); } *************** *** 24182,24186 **** * @brief enabled exposedField implementation. */ ! /** * @brief Construct. --- 24181,24185 ---- * @brief enabled exposedField implementation. */ ! /** * @brief Construct. *************** *** 25716,25723 **** { if (context.cull_flag != bounding_volume::inside) { ! assert(dynamic_cast<const bounding_sphere *> ! (&this->bounding_volume())); const bounding_sphere & bs = ! static_cast<const bounding_sphere &>(this->bounding_volume()); bounding_sphere bv_copy(bs); bv_copy.transform(context.matrix()); --- 25715,25722 ---- { if (context.cull_flag != bounding_volume::inside) { ! using boost::polymorphic_downcast; const bounding_sphere & bs = ! *polymorphic_downcast<const bounding_sphere *>( ! &this->bounding_volume()); bounding_sphere bv_copy(bs); bv_copy.transform(context.matrix()); *************** *** 26615,26626 **** OPENVRML_NOTHROW { assert(this->scene()); this->scene()->browser().add_viewpoint(*this); - assert(dynamic_cast<const viewpoint_metatype *>( - &this->type().metatype())); viewpoint_metatype & nodeClass = const_cast<viewpoint_metatype &>( ! static_cast<const viewpoint_metatype &>( ! this->type().metatype())); if (!nodeClass.has_first()) { nodeClass.set_first(*this); } } --- 26614,26624 ---- OPENVRML_NOTHROW { + using boost::polymorphic_downcast; assert(this->scene()); this->scene()->browser().add_viewpoint(*this); viewpoint_metatype & nodeClass = const_cast<viewpoint_metatype &>( ! *polymorphic_downcast<const viewpoint_metatype *>( ! &this->type().metatype())); if (!nodeClass.has_first()) { nodeClass.set_first(*this); } } *************** *** 27202,27206 **** ! class OPENVRML_LOCAL cad_layer_node : public grouping_node_base<cad_layer_node> { --- 27200,27204 ---- ! class OPENVRML_LOCAL cad_layer_node : public grouping_node_base<cad_layer_node> { *************** *** 27230,27236 **** public: ! cad_layer_node(const node_type & type, const boost::shared_ptr<openvrml::scope> & scope); ! virtual ~cad_layer_node() throw (); virtual bool modified() const; --- 27228,27234 ---- public: ! cad_layer_node(const node_type & type, const boost::shared_ptr<openvrml::scope> & scope); ! virtual ~cad_layer_node() throw (); virtual bool modified() const; *************** *** 27312,27316 **** field_value::sfvec3f_id, "bboxSize") ! }; typedef node_type_impl<cad_layer_node> node_type_t; --- 27310,27314 ---- field_value::sfvec3f_id, "bboxSize") ! }; typedef node_type_impl<cad_layer_node> node_type_t; *************** *** 27466,27470 **** try { const std::vector<bool> & visible = this->visible_.mfbool::value(); ! const mfnode::value_type & all_children = this->children_.mfnode::value(); --- 27464,27468 ---- try { const std::vector<bool> & visible = this->visible_.mfbool::value(); ! const mfnode::value_type & all_children = this->children_.mfnode::value(); *************** *** 27575,27579 **** if (this->node::modified()) { return true; } ! mfnode::value_type::const_iterator iter = current_children_.value().begin(); for (; iter != current_children_.value().end(); ++iter) --- 27573,27577 ---- if (this->node::modified()) { return true; } ! mfnode::value_type::const_iterator iter = current_children_.value().begin(); for (; iter != current_children_.value().end(); ++iter) *************** *** 27598,27602 **** do_render_child(openvrml::viewer & viewer, const rendering_context context) { ! mfnode::value_type::const_iterator iter = current_children_.value().begin(); for (; iter != current_children_.value().end(); ++iter) --- 27596,27600 ---- do_render_child(openvrml::viewer & viewer, const rendering_context context) { ! mfnode::value_type::const_iterator iter = current_children_.value().begin(); for (; iter != current_children_.value().end(); ++iter) *************** *** 27627,27631 **** this->bsphere = bounding_sphere(); ! mfnode::value_type::const_iterator iter = current_children_.value().begin(); for (; iter != current_children_.value().end(); ++iter) --- 27625,27629 ---- this->bsphere = bounding_sphere(); ! mfnode::value_type::const_iterator iter = current_children_.value().begin(); for (; iter != current_children_.value().end(); ++iter) |
From: Braden M. <br...@us...> - 2006-08-16 19:29:24
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22424 Modified Files: ChangeLog Log Message: Replaced static_casts with boost::polymorphic_downcast. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1311 retrieving revision 1.1312 diff -C2 -d -r1.1311 -r1.1312 *** ChangeLog 14 Aug 2006 05:43:16 -0000 1.1311 --- ChangeLog 16 Aug 2006 19:29:16 -0000 1.1312 *************** *** 1,2 **** --- 1,9 ---- + 2006-08-16 Braden McDaniel <br...@en...> + + Replaced static_casts with boost::polymorphic_downcast. + + * src/libopenvrml/openvrml/vrml97node.cpp + * src/libopenvrml/openvrml/x3d_grouping.cpp + 2006-08-14 Braden McDaniel <br...@en...> |
From: Braden M. <br...@us...> - 2006-08-16 19:29:05
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22020 Modified Files: Tag: OpenVRML-0_16-BRANCH ChangeLog Log Message: Replaced static_casts with boost::polymorphic_downcast. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1310.2.1 retrieving revision 1.1310.2.2 diff -C2 -d -r1.1310.2.1 -r1.1310.2.2 *** ChangeLog 14 Aug 2006 05:42:53 -0000 1.1310.2.1 --- ChangeLog 16 Aug 2006 19:28:16 -0000 1.1310.2.2 *************** *** 1,2 **** --- 1,9 ---- + 2006-08-16 Braden McDaniel <br...@en...> + + Replaced static_casts with boost::polymorphic_downcast. + + * src/libopenvrml/openvrml/vrml97node.cpp + * src/libopenvrml/openvrml/x3d_grouping.cpp + 2006-08-14 Braden McDaniel <br...@en...> |