From: <br...@us...> - 2008-09-23 07:28:58
|
Revision: 3678 http://openvrml.svn.sourceforge.net/openvrml/?rev=3678&view=rev Author: braden Date: 2008-09-23 07:28:48 +0000 (Tue, 23 Sep 2008) Log Message: ----------- Removed stray debugging output. Modified Paths: -------------- trunk/ChangeLog trunk/src/libopenvrml/openvrml/browser.cpp Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-09-23 06:42:42 UTC (rev 3677) +++ trunk/ChangeLog 2008-09-23 07:28:48 UTC (rev 3678) @@ -1,3 +1,11 @@ +2008-09-23 Braden McDaniel <br...@en...> + + * src/libopenvrml/openvrml/browser.cpp + (openvrml::browser::vrml97_parse_actions::on_externproto_t::operator()(const + std::string &, const node_interface_set &, const + std::vector<std::string> &) const): Removed stray debugging + output. + 2008-09-22 Braden McDaniel <br...@en...> Moved X3D H-Anim node implementations into a convenience Modified: trunk/src/libopenvrml/openvrml/browser.cpp =================================================================== --- trunk/src/libopenvrml/openvrml/browser.cpp 2008-09-23 06:42:42 UTC (rev 3677) +++ trunk/src/libopenvrml/openvrml/browser.cpp 2008-09-23 07:28:48 UTC (rev 3678) @@ -7027,8 +7027,6 @@ using std::vector; using boost::shared_ptr; - std::cout << node_type_id << std::endl; - // // If we are parsing an "anonymous" stream--that is, one passed to // browser::create_vrml_from_stream--we cannot use the URI This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-09-24 06:45:26
|
Revision: 3686 http://openvrml.svn.sourceforge.net/openvrml/?rev=3686&view=rev Author: braden Date: 2008-09-24 06:45:08 +0000 (Wed, 24 Sep 2008) Log Message: ----------- Moved X3D NURBS node implementations into a convenience library. Modified Paths: -------------- trunk/ChangeLog trunk/ide-projects/Windows/VisualC9_0/OpenVRML/OpenVRML.sln trunk/src/Makefile.am trunk/src/libopenvrml/openvrml/x3d_nurbs.cpp Added Paths: ----------- trunk/ide-projects/Windows/VisualC9_0/OpenVRML/x3d-nurbs/ trunk/ide-projects/Windows/VisualC9_0/OpenVRML/x3d-nurbs/x3d-nurbs.vcproj trunk/src/node/x3d-nurbs/ trunk/src/node/x3d-nurbs/contour2d.cpp trunk/src/node/x3d-nurbs/contour2d.h trunk/src/node/x3d-nurbs/contour_polyline2d.cpp trunk/src/node/x3d-nurbs/contour_polyline2d.h trunk/src/node/x3d-nurbs/coordinate_double.cpp trunk/src/node/x3d-nurbs/coordinate_double.h trunk/src/node/x3d-nurbs/nurbs_curve.cpp trunk/src/node/x3d-nurbs/nurbs_curve.h trunk/src/node/x3d-nurbs/nurbs_curve2d.cpp trunk/src/node/x3d-nurbs/nurbs_curve2d.h trunk/src/node/x3d-nurbs/nurbs_orientation_interpolator.cpp trunk/src/node/x3d-nurbs/nurbs_orientation_interpolator.h trunk/src/node/x3d-nurbs/nurbs_patch_surface.cpp trunk/src/node/x3d-nurbs/nurbs_patch_surface.h trunk/src/node/x3d-nurbs/nurbs_position_interpolator.cpp trunk/src/node/x3d-nurbs/nurbs_position_interpolator.h trunk/src/node/x3d-nurbs/nurbs_set.cpp trunk/src/node/x3d-nurbs/nurbs_set.h trunk/src/node/x3d-nurbs/nurbs_surface_interpolator.cpp trunk/src/node/x3d-nurbs/nurbs_surface_interpolator.h trunk/src/node/x3d-nurbs/nurbs_swept_surface.cpp trunk/src/node/x3d-nurbs/nurbs_swept_surface.h trunk/src/node/x3d-nurbs/nurbs_swung_surface.cpp trunk/src/node/x3d-nurbs/nurbs_swung_surface.h trunk/src/node/x3d-nurbs/nurbs_texture_coordinate.cpp trunk/src/node/x3d-nurbs/nurbs_texture_coordinate.h trunk/src/node/x3d-nurbs/nurbs_trimmed_surface.cpp trunk/src/node/x3d-nurbs/nurbs_trimmed_surface.h Removed Paths: ------------- trunk/ide-projects/Windows/VisualC9_0/OpenVRML/x3d-nurbs/x3d-nurbs.vcproj trunk/src/node/x3d-nurbs/contour2d.cpp trunk/src/node/x3d-nurbs/contour2d.h trunk/src/node/x3d-nurbs/contour_polyline2d.cpp trunk/src/node/x3d-nurbs/contour_polyline2d.h trunk/src/node/x3d-nurbs/coordinate_double.cpp trunk/src/node/x3d-nurbs/coordinate_double.h trunk/src/node/x3d-nurbs/nurbs_curve.cpp trunk/src/node/x3d-nurbs/nurbs_curve.h trunk/src/node/x3d-nurbs/nurbs_curve2d.cpp trunk/src/node/x3d-nurbs/nurbs_curve2d.h trunk/src/node/x3d-nurbs/nurbs_orientation_interpolator.cpp trunk/src/node/x3d-nurbs/nurbs_orientation_interpolator.h trunk/src/node/x3d-nurbs/nurbs_patch_surface.cpp trunk/src/node/x3d-nurbs/nurbs_patch_surface.h trunk/src/node/x3d-nurbs/nurbs_position_interpolator.cpp trunk/src/node/x3d-nurbs/nurbs_position_interpolator.h trunk/src/node/x3d-nurbs/nurbs_set.cpp trunk/src/node/x3d-nurbs/nurbs_set.h trunk/src/node/x3d-nurbs/nurbs_surface_interpolator.cpp trunk/src/node/x3d-nurbs/nurbs_surface_interpolator.h trunk/src/node/x3d-nurbs/nurbs_swept_surface.cpp trunk/src/node/x3d-nurbs/nurbs_swept_surface.h trunk/src/node/x3d-nurbs/nurbs_swung_surface.cpp trunk/src/node/x3d-nurbs/nurbs_swung_surface.h trunk/src/node/x3d-nurbs/nurbs_texture_coordinate.cpp trunk/src/node/x3d-nurbs/nurbs_texture_coordinate.h trunk/src/node/x3d-nurbs/nurbs_trimmed_surface.cpp trunk/src/node/x3d-nurbs/nurbs_trimmed_surface.h Property Changed: ---------------- trunk/ trunk/src/node/x3d-core/metadata_double.cpp trunk/src/node/x3d-core/metadata_double.h trunk/src/node/x3d-core/metadata_float.cpp trunk/src/node/x3d-core/metadata_float.h trunk/src/node/x3d-core/metadata_integer.cpp trunk/src/node/x3d-core/metadata_integer.h trunk/src/node/x3d-core/metadata_set.cpp trunk/src/node/x3d-core/metadata_set.h trunk/src/node/x3d-core/metadata_string.cpp trunk/src/node/x3d-core/metadata_string.h trunk/src/node/x3d-dis/espdu_transform.cpp trunk/src/node/x3d-dis/espdu_transform.h trunk/src/node/x3d-dis/receiver_pdu.cpp trunk/src/node/x3d-dis/receiver_pdu.h trunk/src/node/x3d-dis/signal_pdu.cpp trunk/src/node/x3d-dis/signal_pdu.h trunk/src/node/x3d-dis/transmitter_pdu.cpp trunk/src/node/x3d-dis/transmitter_pdu.h trunk/src/node/x3d-environmental-effects/texture_background.cpp trunk/src/node/x3d-environmental-effects/texture_background.h trunk/src/node/x3d-event-utilities/boolean_filter.cpp trunk/src/node/x3d-event-utilities/boolean_filter.h trunk/src/node/x3d-event-utilities/boolean_sequencer.cpp trunk/src/node/x3d-event-utilities/boolean_sequencer.h trunk/src/node/x3d-event-utilities/boolean_toggle.cpp trunk/src/node/x3d-event-utilities/boolean_toggle.h trunk/src/node/x3d-event-utilities/boolean_trigger.cpp trunk/src/node/x3d-event-utilities/boolean_trigger.h trunk/src/node/x3d-event-utilities/integer_sequencer.cpp trunk/src/node/x3d-event-utilities/integer_sequencer.h trunk/src/node/x3d-event-utilities/integer_trigger.cpp trunk/src/node/x3d-event-utilities/integer_trigger.h trunk/src/node/x3d-event-utilities/time_trigger.cpp trunk/src/node/x3d-event-utilities/time_trigger.h trunk/src/node/x3d-geometry2d/arc2d.cpp trunk/src/node/x3d-geometry2d/arc2d.h trunk/src/node/x3d-geometry2d/arc_close2d.cpp trunk/src/node/x3d-geometry2d/arc_close2d.h trunk/src/node/x3d-geometry2d/circle2d.cpp trunk/src/node/x3d-geometry2d/circle2d.h trunk/src/node/x3d-geometry2d/disk2d.cpp trunk/src/node/x3d-geometry2d/disk2d.h trunk/src/node/x3d-geometry2d/polyline2d.cpp trunk/src/node/x3d-geometry2d/polyline2d.h trunk/src/node/x3d-geometry2d/polypoint2d.cpp trunk/src/node/x3d-geometry2d/polypoint2d.h trunk/src/node/x3d-geometry2d/rectangle2d.cpp trunk/src/node/x3d-geometry2d/rectangle2d.h trunk/src/node/x3d-geometry2d/triangle_set2d.cpp trunk/src/node/x3d-geometry2d/triangle_set2d.h trunk/src/node/x3d-geospatial/geo_coordinate.cpp trunk/src/node/x3d-geospatial/geo_coordinate.h trunk/src/node/x3d-geospatial/geo_elevation_grid.cpp trunk/src/node/x3d-geospatial/geo_elevation_grid.h trunk/src/node/x3d-geospatial/geo_location.cpp trunk/src/node/x3d-geospatial/geo_location.h trunk/src/node/x3d-geospatial/geo_lod.cpp trunk/src/node/x3d-geospatial/geo_lod.h trunk/src/node/x3d-geospatial/geo_metadata.cpp trunk/src/node/x3d-geospatial/geo_metadata.h trunk/src/node/x3d-geospatial/geo_origin.cpp trunk/src/node/x3d-geospatial/geo_origin.h trunk/src/node/x3d-geospatial/geo_position_interpolator.cpp trunk/src/node/x3d-geospatial/geo_position_interpolator.h trunk/src/node/x3d-geospatial/geo_touch_sensor.cpp trunk/src/node/x3d-geospatial/geo_touch_sensor.h trunk/src/node/x3d-geospatial/geo_viewpoint.cpp trunk/src/node/x3d-geospatial/geo_viewpoint.h trunk/src/node/x3d-grouping/static_group.cpp trunk/src/node/x3d-grouping/static_group.h trunk/src/node/x3d-h-anim/h_anim_displacer.cpp trunk/src/node/x3d-h-anim/h_anim_displacer.h trunk/src/node/x3d-h-anim/h_anim_humanoid.cpp trunk/src/node/x3d-h-anim/h_anim_humanoid.h trunk/src/node/x3d-h-anim/h_anim_joint.cpp trunk/src/node/x3d-h-anim/h_anim_joint.h trunk/src/node/x3d-h-anim/h_anim_segment.cpp trunk/src/node/x3d-h-anim/h_anim_segment.h trunk/src/node/x3d-h-anim/h_anim_site.cpp trunk/src/node/x3d-h-anim/h_anim_site.h trunk/src/node/x3d-interpolation/coordinate_interpolator2d.cpp trunk/src/node/x3d-interpolation/coordinate_interpolator2d.h trunk/src/node/x3d-interpolation/position_interpolator2d.cpp trunk/src/node/x3d-interpolation/position_interpolator2d.h trunk/src/node/x3d-key-device-sensor/key_sensor.cpp trunk/src/node/x3d-key-device-sensor/key_sensor.h trunk/src/node/x3d-key-device-sensor/string_sensor.cpp trunk/src/node/x3d-key-device-sensor/string_sensor.h trunk/src/node/x3d-networking/load_sensor.cpp trunk/src/node/x3d-networking/load_sensor.h trunk/src/node/x3d-rendering/color_rgba.cpp trunk/src/node/x3d-rendering/color_rgba.h trunk/src/node/x3d-rendering/indexed_triangle_fan_set.cpp trunk/src/node/x3d-rendering/indexed_triangle_fan_set.h trunk/src/node/x3d-rendering/indexed_triangle_set.cpp trunk/src/node/x3d-rendering/indexed_triangle_set.h trunk/src/node/x3d-rendering/indexed_triangle_strip_set.cpp trunk/src/node/x3d-rendering/indexed_triangle_strip_set.h trunk/src/node/x3d-rendering/triangle_fan_set.cpp trunk/src/node/x3d-rendering/triangle_fan_set.h trunk/src/node/x3d-rendering/triangle_set.cpp trunk/src/node/x3d-rendering/triangle_set.h trunk/src/node/x3d-rendering/triangle_strip_set.cpp trunk/src/node/x3d-rendering/triangle_strip_set.h trunk/src/node/x3d-shape/fill_properties.cpp trunk/src/node/x3d-shape/fill_properties.h trunk/src/node/x3d-shape/line_properties.cpp trunk/src/node/x3d-shape/line_properties.h trunk/src/node/x3d-texturing/multi_texture.cpp trunk/src/node/x3d-texturing/multi_texture.h trunk/src/node/x3d-texturing/multi_texture_coordinate.cpp trunk/src/node/x3d-texturing/multi_texture_coordinate.h trunk/src/node/x3d-texturing/multi_texture_transform.cpp trunk/src/node/x3d-texturing/multi_texture_transform.h trunk/src/node/x3d-texturing/texture_coordinate_generator.cpp trunk/src/node/x3d-texturing/texture_coordinate_generator.h Property changes on: trunk ___________________________________________________________________ Modified: svn:mergeinfo - /branches/node-modules:3622-3623,3632-3635,3637-3638,3640-3641,3643-3644,3646-3647,3649-3650,3654-3655,3657-3658,3661-3662,3664-3665,3667-3668,3670-3671,3673-3674 + /branches/node-modules:3622-3623,3632-3635,3637-3638,3640-3641,3643-3644,3646-3647,3649-3650,3654-3655,3657-3658,3661-3662,3664-3665,3667-3668,3670-3671,3673-3674,3684-3685 Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-09-24 06:17:56 UTC (rev 3685) +++ trunk/ChangeLog 2008-09-24 06:45:08 UTC (rev 3686) @@ -1,3 +1,44 @@ +2008-09-24 Braden McDaniel <br...@en...> + + Moved X3D NURBS node implementations into a convenience + library. + + * ide-projects/Windows/VisualC9_0/OpenVRML/OpenVRML.sln: Added + x3d-nurbs static library project. + * ide-projects/Windows/VisualC9_0/OpenVRML/x3d-nurbs/x3d-nurbs.vcproj + * src/Makefile.am: Added convenience library + node/x3d-nurbs/libx3d-nurbs.la. + * src/libopenvrml/openvrml/x3d_nurbs.cpp: Moved node + implementations to separate files. + * src/node/x3d-nurbs/contour2d.cpp + * src/node/x3d-nurbs/contour2d.h + * src/node/x3d-nurbs/contour_polyline2d.cpp + * src/node/x3d-nurbs/contour_polyline2d.h + * src/node/x3d-nurbs/coordinate_double.cpp + * src/node/x3d-nurbs/coordinate_double.h + * src/node/x3d-nurbs/nurbs_curve.cpp + * src/node/x3d-nurbs/nurbs_curve.h + * src/node/x3d-nurbs/nurbs_curve2d.cpp + * src/node/x3d-nurbs/nurbs_curve2d.h + * src/node/x3d-nurbs/nurbs_orientation_interpolator.cpp + * src/node/x3d-nurbs/nurbs_orientation_interpolator.h + * src/node/x3d-nurbs/nurbs_patch_surface.cpp + * src/node/x3d-nurbs/nurbs_patch_surface.h + * src/node/x3d-nurbs/nurbs_position_interpolator.cpp + * src/node/x3d-nurbs/nurbs_position_interpolator.h + * src/node/x3d-nurbs/nurbs_set.cpp + * src/node/x3d-nurbs/nurbs_set.h + * src/node/x3d-nurbs/nurbs_surface_interpolator.cpp + * src/node/x3d-nurbs/nurbs_surface_interpolator.h + * src/node/x3d-nurbs/nurbs_swept_surface.cpp + * src/node/x3d-nurbs/nurbs_swept_surface.h + * src/node/x3d-nurbs/nurbs_swung_surface.cpp + * src/node/x3d-nurbs/nurbs_swung_surface.h + * src/node/x3d-nurbs/nurbs_texture_coordinate.cpp + * src/node/x3d-nurbs/nurbs_texture_coordinate.h + * src/node/x3d-nurbs/nurbs_trimmed_surface.cpp + * src/node/x3d-nurbs/nurbs_trimmed_surface.h + 2008-09-23 Braden McDaniel <br...@en...> * src/libopenvrml/openvrml/browser.cpp @@ -18,16 +59,16 @@ node/x3d-h-anim/libx3d-h-anim.la. * src/libopenvrml/openvrml/x3d_hanim.cpp: Moved node implementations to separate files. + * src/node/x3d-h-anim/h_anim_displacer.cpp + * src/node/x3d-h-anim/h_anim_displacer.h + * src/node/x3d-h-anim/h_anim_humanoid.cpp + * src/node/x3d-h-anim/h_anim_humanoid.h * src/node/x3d-h-anim/h_anim_joint.cpp - * src/node/x3d-h-anim/h_anim_humanoid.cpp + * src/node/x3d-h-anim/h_anim_joint.h + * src/node/x3d-h-anim/h_anim_segment.cpp + * src/node/x3d-h-anim/h_anim_segment.h * src/node/x3d-h-anim/h_anim_site.cpp - * src/node/x3d-h-anim/h_anim_displacer.cpp - * src/node/x3d-h-anim/h_anim_segment.h - * src/node/x3d-h-anim/h_anim_joint.h - * src/node/x3d-h-anim/h_anim_humanoid.h * src/node/x3d-h-anim/h_anim_site.h - * src/node/x3d-h-anim/h_anim_displacer.h - * src/node/x3d-h-anim/h_anim_segment.cpp 2008-09-22 Braden McDaniel <br...@en...> Modified: trunk/ide-projects/Windows/VisualC9_0/OpenVRML/OpenVRML.sln =================================================================== --- trunk/ide-projects/Windows/VisualC9_0/OpenVRML/OpenVRML.sln 2008-09-24 06:17:56 UTC (rev 3685) +++ trunk/ide-projects/Windows/VisualC9_0/OpenVRML/OpenVRML.sln 2008-09-24 06:45:08 UTC (rev 3686) @@ -17,6 +17,7 @@ {3C7DA0E4-D769-4C8A-9911-BE5C2651ED30} = {3C7DA0E4-D769-4C8A-9911-BE5C2651ED30} {20B850E9-E417-49A2-A66C-38827401597B} = {20B850E9-E417-49A2-A66C-38827401597B} {1D32E4EB-6613-4270-8295-7113712BC6C5} = {1D32E4EB-6613-4270-8295-7113712BC6C5} + {D884D3FB-79C4-497A-AD7C-7D7877F9768E} = {D884D3FB-79C4-497A-AD7C-7D7877F9768E} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "openvrml-gl", "openvrml-gl\openvrml-gl.vcproj", "{141F90C2-6630-4D7A-834F-D5D57C6CFC24}" @@ -81,6 +82,8 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "x3d-h-anim", "x3d-h-anim\x3d-h-anim.vcproj", "{3DA77516-5D3A-42AA-8D99-BF87643A75A2}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "x3d-nurbs", "x3d-nurbs\x3d-nurbs.vcproj", "{D884D3FB-79C4-497A-AD7C-7D7877F9768E}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -175,6 +178,10 @@ {3DA77516-5D3A-42AA-8D99-BF87643A75A2}.Debug|Win32.Build.0 = Debug|Win32 {3DA77516-5D3A-42AA-8D99-BF87643A75A2}.Release|Win32.ActiveCfg = Release|Win32 {3DA77516-5D3A-42AA-8D99-BF87643A75A2}.Release|Win32.Build.0 = Release|Win32 + {D884D3FB-79C4-497A-AD7C-7D7877F9768E}.Debug|Win32.ActiveCfg = Debug|Win32 + {D884D3FB-79C4-497A-AD7C-7D7877F9768E}.Debug|Win32.Build.0 = Debug|Win32 + {D884D3FB-79C4-497A-AD7C-7D7877F9768E}.Release|Win32.ActiveCfg = Release|Win32 + {D884D3FB-79C4-497A-AD7C-7D7877F9768E}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE Property changes on: trunk/ide-projects/Windows/VisualC9_0/OpenVRML/x3d-nurbs ___________________________________________________________________ Added: svn:ignore + Debug Release x3d-nurbs.vcproj.*.user Deleted: trunk/ide-projects/Windows/VisualC9_0/OpenVRML/x3d-nurbs/x3d-nurbs.vcproj =================================================================== --- branches/node-modules/ide-projects/Windows/VisualC9_0/OpenVRML/x3d-nurbs/x3d-nurbs.vcproj 2008-09-24 06:17:56 UTC (rev 3685) +++ trunk/ide-projects/Windows/VisualC9_0/OpenVRML/x3d-nurbs/x3d-nurbs.vcproj 2008-09-24 06:45:08 UTC (rev 3686) @@ -1,283 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="9.00" - Name="x3d-nurbs" - ProjectGUID="{D884D3FB-79C4-497A-AD7C-7D7877F9768E}" - RootNamespace="x3dnurbs" - Keyword="Win32Proj" - TargetFrameworkVersion="196613" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="$(SolutionDir)$(ConfigurationName)" - IntermediateDirectory="$(ConfigurationName)" - ConfigurationType="4" - CharacterSet="1" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories="..\openvrml;..\..\..\..\..\src\libopenvrml" - PreprocessorDefinitions="WIN32;_DEBUG;_LIB;OPENVRML_BUILD_DLL" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="3" - UsePrecompiledHeader="0" - WarningLevel="3" - DebugInformationFormat="4" - DisableSpecificWarnings="4226;4250;4251;4275;4290;4355;4661;4800" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLibrarianTool" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory="$(SolutionDir)$(ConfigurationName)" - IntermediateDirectory="$(ConfigurationName)" - ConfigurationType="4" - CharacterSet="1" - WholeProgramOptimization="1" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - EnableIntrinsicFunctions="true" - AdditionalIncludeDirectories="..\openvrml;..\..\..\..\..\src\libopenvrml" - PreprocessorDefinitions="WIN32;NDEBUG;_LIB;OPENVRML_BUILD_DLL" - RuntimeLibrary="2" - EnableFunctionLevelLinking="true" - UsePrecompiledHeader="0" - WarningLevel="3" - DebugInformationFormat="3" - DisableSpecificWarnings="4226;4250;4251;4275;4290;4355;4661;4800" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLibrarianTool" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" - UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" - > - <File - RelativePath="..\..\..\..\..\src\node\x3d-nurbs\contour2d.cpp" - > - </File> - <File - RelativePath="..\..\..\..\..\src\node\x3d-nurbs\contour_polyline2d.cpp" - > - </File> - <File - RelativePath="..\..\..\..\..\src\node\x3d-nurbs\coordinate_double.cpp" - > - </File> - <File - RelativePath="..\..\..\..\..\src\node\x3d-nurbs\nurbs_curve.cpp" - > - </File> - <File - RelativePath="..\..\..\..\..\src\node\x3d-nurbs\nurbs_curve2d.cpp" - > - </File> - <File - RelativePath="..\..\..\..\..\src\node\x3d-nurbs\nurbs_orientation_interpolator.cpp" - > - </File> - <File - RelativePath="..\..\..\..\..\src\node\x3d-nurbs\nurbs_patch_surface.cpp" - > - </File> - <File - RelativePath="..\..\..\..\..\src\node\x3d-nurbs\nurbs_position_interpolator.cpp" - > - </File> - <File - RelativePath="..\..\..\..\..\src\node\x3d-nurbs\nurbs_set.cpp" - > - </File> - <File - RelativePath="..\..\..\..\..\src\node\x3d-nurbs\nurbs_surface_interpolator.cpp" - > - </File> - <File - RelativePath="..\..\..\..\..\src\node\x3d-nurbs\nurbs_swept_surface.cpp" - > - </File> - <File - RelativePath="..\..\..\..\..\src\node\x3d-nurbs\nurbs_swung_surface.cpp" - > - </File> - <File - RelativePath="..\..\..\..\..\src\node\x3d-nurbs\nurbs_texture_coordinate.cpp" - > - </File> - <File - RelativePath="..\..\..\..\..\src\node\x3d-nurbs\nurbs_trimmed_surface.cpp" - > - </File> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc;xsd" - UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" - > - <File - RelativePath="..\..\..\..\..\src\node\x3d-nurbs\contour2d.h" - > - </File> - <File - RelativePath="..\..\..\..\..\src\node\x3d-nurbs\contour_polyline2d.h" - > - </File> - <File - RelativePath="..\..\..\..\..\src\node\x3d-nurbs\coordinate_double.h" - > - </File> - <File - RelativePath="..\..\..\..\..\src\node\x3d-nurbs\nurbs_curve.h" - > - </File> - <File - RelativePath="..\..\..\..\..\src\node\x3d-nurbs\nurbs_curve2d.h" - > - </File> - <File - RelativePath="..\..\..\..\..\src\node\x3d-nurbs\nurbs_orientation_interpolator.h" - > - </File> - <File - RelativePath="..\..\..\..\..\src\node\x3d-nurbs\nurbs_patch_surface.h" - > - </File> - <File - RelativePath="..\..\..\..\..\src\node\x3d-nurbs\nurbs_position_interpolator.h" - > - </File> - <File - RelativePath="..\..\..\..\..\src\node\x3d-nurbs\nurbs_set.h" - > - </File> - <File - RelativePath="..\..\..\..\..\src\node\x3d-nurbs\nurbs_surface_interpolator.h" - > - </File> - <File - RelativePath="..\..\..\..\..\src\node\x3d-nurbs\nurbs_swept_surface.h" - > - </File> - <File - RelativePath="..\..\..\..\..\src\node\x3d-nurbs\nurbs_swung_surface.h" - > - </File> - <File - RelativePath="..\..\..\..\..\src\node\x3d-nurbs\nurbs_texture_coordinate.h" - > - </File> - <File - RelativePath="..\..\..\..\..\src\node\x3d-nurbs\nurbs_trimmed_surface.h" - > - </File> - </Filter> - <Filter - Name="Resource Files" - Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav" - UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" - > - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> Copied: trunk/ide-projects/Windows/VisualC9_0/OpenVRML/x3d-nurbs/x3d-nurbs.vcproj (from rev 3685, branches/node-modules/ide-projects/Windows/VisualC9_0/OpenVRML/x3d-nurbs/x3d-nurbs.vcproj) =================================================================== --- trunk/ide-projects/Windows/VisualC9_0/OpenVRML/x3d-nurbs/x3d-nurbs.vcproj (rev 0) +++ trunk/ide-projects/Windows/VisualC9_0/OpenVRML/x3d-nurbs/x3d-nurbs.vcproj 2008-09-24 06:45:08 UTC (rev 3686) @@ -0,0 +1,283 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="9.00" + Name="x3d-nurbs" + ProjectGUID="{D884D3FB-79C4-497A-AD7C-7D7877F9768E}" + RootNamespace="x3dnurbs" + Keyword="Win32Proj" + TargetFrameworkVersion="196613" + > + <Platforms> + <Platform + Name="Win32" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="Debug|Win32" + OutputDirectory="$(SolutionDir)$(ConfigurationName)" + IntermediateDirectory="$(ConfigurationName)" + ConfigurationType="4" + CharacterSet="1" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + AdditionalIncludeDirectories="..\openvrml;..\..\..\..\..\src\libopenvrml" + PreprocessorDefinitions="WIN32;_DEBUG;_LIB;OPENVRML_BUILD_DLL" + MinimalRebuild="true" + BasicRuntimeChecks="3" + RuntimeLibrary="3" + UsePrecompiledHeader="0" + WarningLevel="3" + DebugInformationFormat="4" + DisableSpecificWarnings="4226;4250;4251;4275;4290;4355;4661;4800" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Release|Win32" + OutputDirectory="$(SolutionDir)$(ConfigurationName)" + IntermediateDirectory="$(ConfigurationName)" + ConfigurationType="4" + CharacterSet="1" + WholeProgramOptimization="1" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="2" + EnableIntrinsicFunctions="true" + AdditionalIncludeDirectories="..\openvrml;..\..\..\..\..\src\libopenvrml" + PreprocessorDefinitions="WIN32;NDEBUG;_LIB;OPENVRML_BUILD_DLL" + RuntimeLibrary="2" + EnableFunctionLevelLinking="true" + UsePrecompiledHeader="0" + WarningLevel="3" + DebugInformationFormat="3" + DisableSpecificWarnings="4226;4250;4251;4275;4290;4355;4661;4800" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <Filter + Name="Source Files" + Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" + UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" + > + <File + RelativePath="..\..\..\..\..\src\node\x3d-nurbs\contour2d.cpp" + > + </File> + <File + RelativePath="..\..\..\..\..\src\node\x3d-nurbs\contour_polyline2d.cpp" + > + </File> + <File + RelativePath="..\..\..\..\..\src\node\x3d-nurbs\coordinate_double.cpp" + > + </File> + <File + RelativePath="..\..\..\..\..\src\node\x3d-nurbs\nurbs_curve.cpp" + > + </File> + <File + RelativePath="..\..\..\..\..\src\node\x3d-nurbs\nurbs_curve2d.cpp" + > + </File> + <File + RelativePath="..\..\..\..\..\src\node\x3d-nurbs\nurbs_orientation_interpolator.cpp" + > + </File> + <File + RelativePath="..\..\..\..\..\src\node\x3d-nurbs\nurbs_patch_surface.cpp" + > + </File> + <File + RelativePath="..\..\..\..\..\src\node\x3d-nurbs\nurbs_position_interpolator.cpp" + > + </File> + <File + RelativePath="..\..\..\..\..\src\node\x3d-nurbs\nurbs_set.cpp" + > + </File> + <File + RelativePath="..\..\..\..\..\src\node\x3d-nurbs\nurbs_surface_interpolator.cpp" + > + </File> + <File + RelativePath="..\..\..\..\..\src\node\x3d-nurbs\nurbs_swept_surface.cpp" + > + </File> + <File + RelativePath="..\..\..\..\..\src\node\x3d-nurbs\nurbs_swung_surface.cpp" + > + </File> + <File + RelativePath="..\..\..\..\..\src\node\x3d-nurbs\nurbs_texture_coordinate.cpp" + > + </File> + <File + RelativePath="..\..\..\..\..\src\node\x3d-nurbs\nurbs_trimmed_surface.cpp" + > + </File> + </Filter> + <Filter + Name="Header Files" + Filter="h;hpp;hxx;hm;inl;inc;xsd" + UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" + > + <File + RelativePath="..\..\..\..\..\src\node\x3d-nurbs\contour2d.h" + > + </File> + <File + RelativePath="..\..\..\..\..\src\node\x3d-nurbs\contour_polyline2d.h" + > + </File> + <File + RelativePath="..\..\..\..\..\src\node\x3d-nurbs\coordinate_double.h" + > + </File> + <File + RelativePath="..\..\..\..\..\src\node\x3d-nurbs\nurbs_curve.h" + > + </File> + <File + RelativePath="..\..\..\..\..\src\node\x3d-nurbs\nurbs_curve2d.h" + > + </File> + <File + RelativePath="..\..\..\..\..\src\node\x3d-nurbs\nurbs_orientation_interpolator.h" + > + </File> + <File + RelativePath="..\..\..\..\..\src\node\x3d-nurbs\nurbs_patch_surface.h" + > + </File> + <File + RelativePath="..\..\..\..\..\src\node\x3d-nurbs\nurbs_position_interpolator.h" + > + </File> + <File + RelativePath="..\..\..\..\..\src\node\x3d-nurbs\nurbs_set.h" + > + </File> + <File + RelativePath="..\..\..\..\..\src\node\x3d-nurbs\nurbs_surface_interpolator.h" + > + </File> + <File + RelativePath="..\..\..\..\..\src\node\x3d-nurbs\nurbs_swept_surface.h" + > + </File> + <File + RelativePath="..\..\..\..\..\src\node\x3d-nurbs\nurbs_swung_surface.h" + > + </File> + <File + RelativePath="..\..\..\..\..\src\node\x3d-nurbs\nurbs_texture_coordinate.h" + > + </File> + <File + RelativePath="..\..\..\..\..\src\node\x3d-nurbs\nurbs_trimmed_surface.h" + > + </File> + </Filter> + <Filter + Name="Resource Files" + Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav" + UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" + > + </Filter> + </Files> + <Globals> + </Globals> +</VisualStudioProject> Modified: trunk/src/Makefile.am =================================================================== --- trunk/src/Makefile.am 2008-09-24 06:17:56 UTC (rev 3685) +++ trunk/src/Makefile.am 2008-09-24 06:45:08 UTC (rev 3686) @@ -18,7 +18,8 @@ node/x3d-dis/libx3d-dis.la \ node/x3d-environmental-effects/libx3d-environmental-effects.la \ node/x3d-geospatial/libx3d-geospatial.la \ - node/x3d-h-anim/libx3d-h-anim.la + node/x3d-h-anim/libx3d-h-anim.la \ + node/x3d-nurbs/libx3d-nurbs.la if ENABLE_GL_RENDERER lib_LTLIBRARIES += libopenvrml-gl/libopenvrml-gl.la endif @@ -165,6 +166,7 @@ node/x3d-environmental-effects/libx3d-environmental-effects.la \ node/x3d-geospatial/libx3d-geospatial.la \ node/x3d-h-anim/libx3d-h-anim.la \ + node/x3d-nurbs/libx3d-nurbs.la \ -lboost_thread$(BOOST_LIB_SUFFIX) \ -lboost_filesystem$(BOOST_LIB_SUFFIX) \ -lltdl @@ -559,6 +561,41 @@ node/x3d-h-anim/h_anim_site.cpp \ node/x3d-h-anim/h_anim_site.h +node_x3d_nurbs_libx3d_nurbs_la_CPPFLAGS = \ + -I$(top_builddir)/src/libopenvrml \ + -I$(top_srcdir)/src/libopenvrml +node_x3d_nurbs_libx3d_nurbs_la_CXXFLAGS = \ + $(PTHREAD_CFLAGS) +node_x3d_nurbs_libx3d_nurbs_la_SOURCES = \ + node/x3d-nurbs/contour2d.cpp \ + node/x3d-nurbs/contour2d.h \ + node/x3d-nurbs/contour_polyline2d.cpp \ + node/x3d-nurbs/contour_polyline2d.h \ + node/x3d-nurbs/coordinate_double.cpp \ + node/x3d-nurbs/coordinate_double.h \ + node/x3d-nurbs/nurbs_curve.cpp \ + node/x3d-nurbs/nurbs_curve.h \ + node/x3d-nurbs/nurbs_curve2d.cpp \ + node/x3d-nurbs/nurbs_curve2d.h \ + node/x3d-nurbs/nurbs_orientation_interpolator.cpp \ + node/x3d-nurbs/nurbs_orientation_interpolator.h \ + node/x3d-nurbs/nurbs_patch_surface.cpp \ + node/x3d-nurbs/nurbs_patch_surface.h \ + node/x3d-nurbs/nurbs_position_interpolator.cpp \ + node/x3d-nurbs/nurbs_position_interpolator.h \ + node/x3d-nurbs/nurbs_set.cpp \ + node/x3d-nurbs/nurbs_set.h \ + node/x3d-nurbs/nurbs_surface_interpolator.cpp \ + node/x3d-nurbs/nurbs_surface_interpolator.h \ + node/x3d-nurbs/nurbs_swept_surface.cpp \ + node/x3d-nurbs/nurbs_swept_surface.h \ + node/x3d-nurbs/nurbs_swung_surface.cpp \ + node/x3d-nurbs/nurbs_swung_surface.h \ + node/x3d-nurbs/nurbs_texture_coordinate.cpp \ + node/x3d-nurbs/nurbs_texture_coordinate.h \ + node/x3d-nurbs/nurbs_trimmed_surface.cpp \ + node/x3d-nurbs/nurbs_trimmed_surface.h + libopenvrml_gl_libopenvrml_gl_la_CPPFLAGS = \ -I$(top_builddir)/src/libopenvrml \ -I$(top_srcdir)/src/libopenvrml \ Modified: trunk/src/libopenvrml/openvrml/x3d_nurbs.cpp =================================================================== --- trunk/src/libopenvrml/openvrml/x3d_nurbs.cpp 2008-09-24 06:17:56 UTC (rev 3685) +++ trunk/src/libopenvrml/openvrml/x3d_nurbs.cpp 2008-09-24 06:45:08 UTC (rev 3686) @@ -2,7 +2,7 @@ // // OpenVRML // -// Copyright 2006, 2007 Braden McDaniel +// Copyright 2006, 2007, 2008 Braden McDaniel // // This library is free software; you can redistribute it and/or modify it // under the terms of the GNU Lesser General Public License as published by @@ -18,282 +18,32 @@ // along with this library; if not, see <http://www.gnu.org/licenses/>. // +# include "browser.h" +# include "x3d_nurbs.h" +# include <x3d-nurbs/contour2d.h> +# include <x3d-nurbs/contour_polyline2d.h> +# include <x3d-nurbs/coordinate_double.h> +# include <x3d-nurbs/nurbs_curve.h> +# include <x3d-nurbs/nurbs_curve2d.h> +# include <x3d-nurbs/nurbs_orientation_interpolator.h> +# include <x3d-nurbs/nurbs_patch_surface.h> +# include <x3d-nurbs/nurbs_position_interpolator.h> +# include <x3d-nurbs/nurbs_set.h> +# include <x3d-nurbs/nurbs_surface_interpolator.h> +# include <x3d-nurbs/nurbs_swept_surface.h> +# include <x3d-nurbs/nurbs_swung_surface.h> +# include <x3d-nurbs/nurbs_texture_coordinate.h> +# include <x3d-nurbs/nurbs_trimmed_surface.h> + # ifdef HAVE_CONFIG_H # include <config.h> # endif -# include <boost/array.hpp> -# include <private.h> -# include "browser.h" -# include "node_impl_util.h" -# include "x3d_nurbs.h" - -using namespace openvrml; -using namespace openvrml::node_impl_util; -using namespace std; - -namespace { - - /** - * @brief Class object for Contour2D nodes. - */ - class OPENVRML_LOCAL contour2d_metatype : public node_metatype { - public: - static const char * const id; - - explicit contour2d_metatype(openvrml::browser & browser); - virtual ~contour2d_metatype() OPENVRML_NOTHROW; - - private: - virtual const boost::shared_ptr<node_type> - do_create_type(const std::string & id, - const node_interface_set & interfaces) const - OPENVRML_THROW2(unsupported_interface, std::bad_alloc); - }; - - - /** - * @brief Class object for ContourPolyline2D nodes. - */ - class OPENVRML_LOCAL contour_polyline2d_metatype : public node_metatype { - public: - static const char * const id; - - explicit contour_polyline2d_metatype(openvrml::browser & browser); - virtual ~contour_polyline2d_metatype() OPENVRML_NOTHROW; - - private: - virtual const boost::shared_ptr<node_type> - do_create_type(const std::string & id, - const node_interface_set & interfaces) const - OPENVRML_THROW2(unsupported_interface, std::bad_alloc); - }; - - - /** - * @brief Class object for CoordinateDouble nodes. - */ - class OPENVRML_LOCAL coordinate_double_metatype : public node_metatype { - public: - static const char * const id; - - explicit coordinate_double_metatype(openvrml::browser & browser); - virtual ~coordinate_double_metatype() OPENVRML_NOTHROW; - - private: - virtual const boost::shared_ptr<node_type> - do_create_type(const std::string & id, - const node_interface_set & interfaces) const - OPENVRML_THROW2(unsupported_interface, std::bad_alloc); - }; - - - /** - * @brief Class object for NurbsCurve nodes. - */ - class OPENVRML_LOCAL nurbs_curve_metatype : public node_metatype { - public: - static const char * const id; - - explicit nurbs_curve_metatype(openvrml::browser & browser); - virtual ~nurbs_curve_metatype() OPENVRML_NOTHROW; - - private: - virtual const boost::shared_ptr<node_type> - do_create_type(const std::string & id, - const node_interface_set & interfaces) const - OPENVRML_THROW2(unsupported_interface, std::bad_alloc); - }; - - - /** - * @brief Class object for NurbsCurve2D nodes. - */ - class OPENVRML_LOCAL nurbs_curve2d_metatype : public node_metatype { - public: - static const char * const id; - - explicit nurbs_curve2d_metatype(openvrml::browser & browser); - virtual ~nurbs_curve2d_metatype() OPENVRML_NOTHROW; - - private: - virtual const boost::shared_ptr<node_type> - do_create_type(const std::string & id, - const node_interface_set & interfaces) const - OPENVRML_THROW2(unsupported_interface, std::bad_alloc); - }; - - - /** - * @brief Class object for NurbsOrientationInterpolator nodes. - */ - class OPENVRML_LOCAL nurbs_orientation_interpolator_metatype : - public node_metatype { - public: - static const char * const id; - - explicit nurbs_orientation_interpolator_metatype( - openvrml::browser & browser); - virtual ~nurbs_orientation_interpolator_metatype() OPENVRML_NOTHROW; - - private: - virtual const boost::shared_ptr<node_type> - do_create_type(const std::string & id, - const node_interface_set & interfaces) const - OPENVRML_THROW2(unsupported_interface, std::bad_alloc); - }; - - - /** - * @brief Class object for NurbsPatchSurface nodes. - */ - class OPENVRML_LOCAL nurbs_patch_surface_metatype : public node_metatype { - public: - static const char * const id; - - explicit nurbs_patch_surface_metatype(openvrml::browser & browser); - virtual ~nurbs_patch_surface_metatype() OPENVRML_NOTHROW; - - private: - virtual const boost::shared_ptr<node_type> - do_create_type(const std::string & id, - const node_interface_set & interfaces) const - OPENVRML_THROW2(unsupported_interface, std::bad_alloc); - }; - - - /** - * @brief Class object for NurbsPositionInterpolator nodes. - */ - class OPENVRML_LOCAL nurbs_position_interpolator_metatype : - public node_metatype { - public: - static const char * const id; - - explicit nurbs_position_interpolator_metatype( - openvrml::browser & browser); - virtual ~nurbs_position_interpolator_metatype() OPENVRML_NOTHROW; - - private: - virtual const boost::shared_ptr<node_type> - do_create_type(const std::string & id, - const node_interface_set & interfaces) const - OPENVRML_THROW2(unsupported_interface, std::bad_alloc); - }; - - - /** - * @brief Class object for NurbsSet nodes. - */ - class OPENVRML_LOCAL nurbs_set_metatype : public node_metatype { - public: - static const char * const id; - - explicit nurbs_set_metatype(openvrml::browser & browser); - virtual ~nurbs_set_metatype() OPENVRML_NOTHROW; - - private: - virtual const boost::shared_ptr<node_type> - do_create_type(const std::string & id, - const node_interface_set & interfaces) const - OPENVRML_THROW2(unsupported_interface, std::bad_alloc); - }; - - - /** - * @brief Class object for NurbsSurfaceInterpolator nodes. - */ - class OPENVRML_LOCAL nurbs_surface_interpolator_metatype : public node_metatype { - public: - static const char * const id; - - explicit nurbs_surface_interpolator_metatype(openvrml::browser & browser); - virtual ~nurbs_surface_interpolator_metatype() OPENVRML_NOTHROW; - - private: - virtual const boost::shared_ptr<node_type> - do_create_type(const std::string & id, - const node_interface_set & interfaces) const - OPENVRML_THROW2(unsupported_interface, std::bad_alloc); - }; - - - /** - * @brief Class object for NurbsSweptSurface nodes. - */ - class OPENVRML_LOCAL nurbs_swept_surface_metatype : public node_metatype { - public: - static const char * const id; - - explicit nurbs_swept_surface_metatype(openvrml::browser & browser); - virtual ~nurbs_swept_surface_metatype() OPENVRML_NOTHROW; - - private: - virtual const boost::shared_ptr<node_type> - do_create_type(const std::string & id, - const node_interface_set & interfaces) const - OPENVRML_THROW2(unsupported_interface, std::bad_alloc); - }; - - - /** - * @brief Class object for NurbsSwungSurface nodes. - */ - class OPENVRML_LOCAL nurbs_swung_surface_metatype : public node_metatype { - public: - static const char * const id; - - explicit nurbs_swung_surface_metatype(openvrml::browser & browser); - virtual ~nurbs_swung_surface_metatype() OPENVRML_NOTHROW; - - private: - virtual const boost::shared_ptr<node_type> - do_create_type(const std::string & id, - const node_interface_set & interfaces) const - OPENVRML_THROW2(unsupported_interface, std::bad_alloc); - }; - - - /** - * @brief Class object for NurbsTextureCoordinate nodes. - */ - class OPENVRML_LOCAL nurbs_texture_coordinate_metatype : public node_metatype { - public: - static const char * const id; - - explicit nurbs_texture_coordinate_metatype(openvrml::browser & browser); - virtual ~nurbs_texture_coordinate_metatype() OPENVRML_NOTHROW; - - private: - virtual const boost::shared_ptr<node_type> - do_create_type(const std::string & id, - const node_interface_set & interfaces) const - OPENVRML_THROW2(unsupported_interface, std::bad_alloc); - }; - - - /** - * @brief Class object for NurbsTrimmedSurface nodes. - */ - class OPENVRML_LOCAL nurbs_trimmed_surface_metatype : public node_metatype { - public: - static const char * const id; - - explicit nurbs_trimmed_surface_metatype(openvrml::browser & browser); - virtual ~nurbs_trimmed_surface_metatype() OPENVRML_NOTHROW; - - private: - virtual const boost::shared_ptr<node_type> - do_create_type(const std::string & id, - const node_interface_set & interfaces) const - OPENVRML_THROW2(unsupported_interface, std::bad_alloc); - }; -} - void register_nurbs_node_metatypes(openvrml::browser & b) { using boost::shared_ptr; using openvrml::node_metatype; + using namespace openvrml_node_x3d_nurbs; b.add_node_metatype(contour2d_metatype::id, shared_ptr<node_metatype>(new contour2d_metatype(b))); b.add_node_metatype(contour_polyline2d_metatype::id, @@ -335,3588 +85,3 @@ shared_ptr<node_metatype>( new nurbs_trimmed_surface_metatype(b))); } - -namespace { - using namespace openvrml_; - - class OPENVRML_LOCAL contour2d_node : - public abstract_node<contour2d_node> { - - friend class contour2d_metatype; - - class add_children_listener : public event_listener_base<self_t>, - public mfnode_listener { - public: - explicit add_children_listener(self_t & node); - virtual ~add_children_listener() OPENVRML_NOTHROW; - - private: - virtual void do_process_event(const mfnode & fraction, - double timestamp) - OPENVRML_THROW1(std::bad_alloc); - }; - - class remove_children_listener : public event_listener_base<self_t>, - public mfnode_listener { - public: - explicit remove_children_listener(self_t & node); - virtual ~remove_children_listener() OPENVRML_NOTHROW; - - private: - virtual void do_process_event(const mfnode & fraction, - double timestamp) - OPENVRML_THROW1(std::bad_alloc); - }; - - add_children_listener add_children_listener_; - remove_children_listener remove_children_listener_; - exposedfield<mfnode> children_; - - public: - contour2d_node(const node_type & type, - const boost::shared_ptr<openvrml::scope> & scope); - virtual ~contour2d_node() OPENVRML_NOTHROW; - }; - - class OPENVRML_LOCAL contour_polyline2d_node : - public abstract_node<contour_polyline2d_node> { - - friend class contour_polyline2d_metatype; - - exposedfield<mfvec2f> point_; - - public: - contour_polyline2d_node( - const node_type & type, - const boost::shared_ptr<openvrml::scope> & scope); - virtual ~contour_polyline2d_node() OPENVRML_NOTHROW; - }; - - class OPENVRML_LOCAL coordinate_double_node : - public abstract_node<coordinate_double_node> { - - friend class coordinate_double_metatype; - - exposedfield<mfvec3d> point_; - - public: - coordinate_double_node( - const node_type & type, - const boost::shared_ptr<openvrml::scope> & scope); - virtual ~coordinate_double_node() OPENVRML_NOTHROW; - }; - - class OPENVRML_LOCAL nurbs_curve_node : - public abstract_node<nurbs_curve_node>, - public geometry_node, - public child_node { - - friend class nurbs_curve_metatype; - - exposedfield<sfnode> control_point_; - exposedfield<sfint32> tessellation_; - exposedfield<mfdouble> weight_; - sfbool closed_; - mfdouble knot_; - sfint32 order_; - - public: - nurbs_curve_node(const node_type & type, - const boost::shared_ptr<openvrml::scope> & scope); - virtual ~nurbs_curve_node() OPENVRML_NOTHROW; - - virtual bool modified() const; - private: - virtual viewer::object_t do_render_geometry(openvrml::viewer & viewer, - rendering_context context); - }; - - class OPENVRML_LOCAL nurbs_curve2d_node : - public abstract_node<nurbs_curve2d_node> { - - friend class nurbs_curve2d_metatype; - - exposedfield<mfvec2d> control_point_; - exposedfield<sfint32> tessellation_; - exposedfield<mfdouble> weight_; - sfbool closed_; - mfdouble knot_; - sfint32 order_; - - public: - nurbs_curve2d_node(const node_type & type, - const boost::shared_ptr<openvrml::scope> & scope); - virtual ~nurbs_curve2d_node() OPENVRML_NOTHROW; - }; - - class OPENVRML_LOCAL nurbs_orientation_interpolator_node : - public abstract_node<nurbs_orientation_interpolator_node>, - public child_node { - - friend class nurbs_orientation_interpolator_metatype; - - class set_fraction_listener : public event_listener_base<self_t>, - public sffloat_listener { - public: - explicit set_fraction_listener(self_t & node); - virtual ~set_fraction_listener() OPENVRML_NOTHROW; - - private: - virtual void do_process_event(const sffloat & fraction, - double timestamp) - OPENVRML_THROW1(std::bad_alloc); - }; - - set_fraction_listener set_fraction_listener_; - exposedfield<sfnode> control_points_; - exposedfield<mfdouble> knot_; - exposedfield<sfint32> order_; - exposedfield<mfdouble> weight_; - sfrotation value_changed_; - sfrotation_emitter value_changed_emitter_; - - public: - nurbs_orientation_interpolator_node( - const node_type & type, - const boost::shared_ptr<openvrml::scope> & scope); - - virtual ~nurbs_orientation_interpolator_node() OPENVRML_NOTHROW; - }; - - class OPENVRML_LOCAL nurbs_patch_surface_node : - public abstract_node<nurbs_patch_surface_node>, - public geometry_node, - public child_node { - - friend class nurbs_patch_surface_metatype; - - exposedfield<sfnode> control_point_; - exposedfield<sfnode> tex_coord_; - exposedfield<sfint32> u_tessellation_; - exposedfield<sfint32> v_tessellation_; - exposedfield<mfdouble> weight_; - sfbool solid_; - sfbool u_closed_; - sfint32 u_dimension_; - mfdouble u_knot_; - sfint32 u_order_; - sfbool v_closed_; - sfint32 v_dimension_; - mfdouble v_knot_; - sfint32 v_order_; - - public: - nurbs_patch_surface_node( - const node_type & type, - const boost::shared_ptr<openvrml::scope> & scope); - virtual ~nurbs_patch_surface_node() OPENVRML_NOTHROW; - - virtual bool modified() const; - private: - virtual viewer::object_t do_render_geometry(openvrml::viewer & viewer, - rendering_context context); - }; - - class OPENVRML_LOCAL nurbs_position_interpolator_node : - public abstract_node<nurbs_position_interpolator_node>, - public child_node { - - friend class nurbs_position_interpolator_metatype; - - class set_fraction_listener : public event_listener_base<self_t>, - public sffloat_listener { - public: - explicit set_fraction_listener(self_t & node); - virtual ~set_fraction_listener() OPENVRML_NOTHROW; - - private: - virtual void do_process_event(const sffloat & fraction, - double timestamp) - OPENVRML_THROW1(std::bad_alloc); - }; - - set_fraction_listener set_fraction_listener_; - exposedfield<sfnode> control_points_; - exposedfield<mfdouble> knot_; - exposedfield<sfint32> order_; - exposedfield<mfdouble> weight_; - sfvec3f value_changed_; - sfvec3f_emitter value_changed_emitter_; - - public: - nurbs_position_interpolator_node( - const node_type & type, - const boost::shared_ptr<openvrml::scope> & scope); - - virtual ~nurbs_position_interpolator_node() OPENVRML_NOTHROW; - }; - - class OPENVRML_LOCAL nurbs_set_node : - public abstract_node<nurbs_set_node>, - public child_node { - - friend class nurbs_set_metatype; - - class add_geometry_listener : public event_listener_base<self_t>, - public mfnode_listener { - public: - explicit add_geometry_listener(self_t & node); - virtual ~add_geometry_listener() OPENVRML_NOTHROW; - - private: - virtual void do_process_event(const mfnode & fraction, - double timestamp) - OPENVRML_THROW1(std::bad_alloc); - }; - - class remove_geometry_listener : - public event_listener_base<self_t>, - public mfnode_listener - { - public: - explicit remove_geometry_listener(self_t & node); - virtual ~remove_geometry_listener() OPENVRML_NOTHROW; - - private: - virtual void do_process_event(const mfnode & fraction, - double timestamp) - OPENVRML_THROW1(std::bad_alloc); - }; - - add_geometry_listener add_geometry_listener_; - remove_geometry_listener remove_geometry_listener_; - exposedfield<mfnode> geometry_; - exposedfield<sffloat> tessellation_scale_; - sfvec3f bbox_center_; - sfvec3f bbox_size_; - - public: - nurbs_set_node(const node_type & type, - const boost::shared_ptr<openvrml::scope> & scope); - virtual ~nurbs_set_node() OPENVRML_NOTHROW; - }; - - class OPENVRML_LOCAL nurbs_surface_interpolator_node : - public abstract_node<nurbs_surface_interpolator_node>, - public child_node { - - friend class nurbs_surface_interpolator_metatype; - - class set_fraction_listener : public event_listener_base<self_t>, - public sfvec2f_listener { - public: - explicit set_fraction_listener(self_t & node); - virtual ~set_fraction_listener() OPENVRML_NOTHROW; - - private: - virtual void do_process_event(const sfvec2f & fraction, - double timestamp) - OPENVRML_THROW1(std::bad_alloc); - }; - - set_fraction_listener set_fraction_listener_; - exposedfield<sfnode> control_points_; - exposedfield<mfdouble> weight_; - sfvec3f position_changed_; - sfvec3f_emitter position_changed_emitter_; - sfvec3f normal_changed_; - sfvec3f_emitter normal_changed_emitter_; - sfint32 u_dimension_; - mfdouble u_knot_; - sfint32 u_order_; - sfint32 v_dimension_; - mfdouble v_knot_; - sfint32 v_order_; - - public: - nurbs_surface_interpolator_node( - const node_type & type, - const boost::shared_ptr<openvrml::scope> & scope); - virtual ~nurbs_surface_interpolator_node() OPENVRML_NOTHROW; - }; - - class OPENVRML_LOCAL nurbs_swept_surface_node : - public abstract_node<nurbs_swept_surface_node>, - public geometry_node, - public child_node { - - friend class nurbs_swept_surface_metatype; - - exposedfield<sfnode> cross_section_curve_; - exposedfield<sfnode> trajectory_curve_; - sfbool ccw_; - sfbool solid_; - - public: - nurbs_swept_surface_node( - const node_type & type, - const boost::shared_ptr<openvrml::scope> & scope); - virtual ~nurbs_swept_surface_node() OPENVRML_NOTHROW; - - virtual bool modified() const; - private: - virtual viewer::object_t do_render_geometry(openvrml::viewer & viewer, - rendering_context context); - }; - - class OPENVRML_LOCAL nurbs_swung_surface_node : - public abstract_node<nurbs_swung_surface_node>, - public geometry_node, - public child_node { - - friend class nurbs_swung_surface_metatype; - - exposedfield<sfnode> componentcurve_; - exposedfield<sfnode> trajectory_curve_; - sfbool ccw_; - sfbool solid_; - - public: - nurbs_swung_surface_node( - const node_type & type, - const boost::shared_ptr<openvrml::scope> & scope); - virtual ~nurbs_swung_surface_node() OPENVRML_NOTHROW; - - virtual bool modified() const; - private: - virtual viewer::object_t do_render_geometry(openvrml::viewer & viewer, - rendering_context context); - }; - - class OPENVRML_LOCAL nurbs_texture_coordinate_node : - public abstract_node<nurbs_texture_coordinate_node> { - - friend class nurbs_texture_coordinate_metatype; - - exposedfield<mfvec2f> control_point_; - exposedfield<mffloat> weight_; - sfint32 u_dimension_; - mfdouble u_knot_; - sfint32 u_order_; - sfint32 v_dimension_; - mfdouble v_knot_; - sfint32 v_order_; - - public: - nurbs_texture_coordinate_node( - const node_type & type, - const boost::shared_ptr<openvrml::scope> & scope); - virtual ~nurbs_texture_coordinate_node() OPENVRML_NOTHROW; - }; - - class OPENVRML_LOCAL nurbs_trimmed_surface_node : - public abstract_node<nurbs_trimmed_surface_node>, - public geometry_node, - public child_node { - - friend class nurbs_trimmed_surface_metatype; - - class add_trimming_contour_listener : - public event_listener_base<self_t>, - public mfnode_listener { - public: - explicit add_trimming_contour_listener(self_t & node); - virtual ~add_trimming_contour_listener() OPENVRML_NOTHROW; - - private: - virtual void do_process_event(const mfnode & fraction, - double timestamp) - OPENVRML_THROW1(std::bad_alloc); - }; - - class remove_trimming_contour_listener : - public event_listener_base<self_t>, - public mfnode_listener { - public: - explicit remove_trimming_contour_listener(self_t & node); - virtual ~remove_trimming_contour_listener() OPENVRML_NOTHROW; - - private: - virtual void do_process_event(const mfnode & fraction, - double timestamp) - OPENVRML_THROW1(std::bad_alloc); - }; - - add_trimming_contour_listener add_trimming_contour_listener_; - remove_trimming_contour_listener remove_trimming_contour_listener_; - exposedfield<sfnode> control_point_; - exposedfield<sfnode> tex_coord_; - exposedfield<mfnode> trimming_contour_; - exposedfield<sfint32> u_tessellation_; - exposedfield<sfint32> v_tessellation_; - exposedfield<mfdouble> weight_; - sfbool solid_; - sfbool u_closed_; - sfint32 u_dimension_; - mfdouble u_knot_; - sfint32 u_order_; - sfbool v_closed_; - sfint32 v_dimension_; - mfdouble v_knot_; - sfint32 v_order_; - - public: - nurbs_trimmed_surface_node( - const node_type & type, - const boost::shared_ptr<openvrml::scope> & scope); - virtual ~nurbs_trimmed_surface_node() OPENVRML_NOTHROW; - - virtual bool modified() const; - private: - virtual viewer::object_t do_render_geometry(openvrml::viewer & viewer, - rendering_context context); - }; - - /** - * @brief @c node_metatype identifier. - */ - const char * const contour2d_metatype::id = "urn:X-openvrml:node:Contour2D"; - - /** - * @brief Construct. - * - * @param browser the @c browser associated with this @c contour2d_metatype. - */ - contour2d_metatype::contour2d_metatype(openvrml::browser & browser): - node_metatype(contour2d_metatype::id, browser) - {} - - /** - * @brief Destroy. - */ - contour2d_metatype::~contour2d_metatype() OPENVRML_NOTHROW - {} - - /** - * @brief Create a node_type. - * - * @param id the name for the new node_type. - * @param interfaces the interfaces for the new node_type. - * - * @return a @c node_type capable of creating Contour2D nodes. - * - * @exception unsupported_interface if @p interfaces includes an interface - * not supported by contour2d_metatype. - * @exception std::bad_alloc if memory allocation fails. - */ - const boost::shared_ptr<openvrml::node_type> - contour2d_metatype:: - do_create_type(const std::string & id, - const node_interface_set & interfaces) const - OPENVRML_THROW2(unsupported_interface, std::bad_alloc) - { - typedef boost::array<node_interface, 4> supported_interfaces_t; - static const supported_interfaces_t supported_interfaces = { - node_interface(node_interface::exposedfield_id, - field_value::sfnode_id, - "metadata"), - node_interface(node_interface::eventin_id, - field_value::mfnode_id, - "addChildren"), - node_interface(node_interface::eventin_id, - field_value::mfnode_id, - "removeChildren"), - node_interface(node_interface::exposedfield_id, - field_value::mfnode_id, - ... [truncated message content] |
From: <br...@us...> - 2008-09-24 07:32:55
|
Revision: 3689 http://openvrml.svn.sourceforge.net/openvrml/?rev=3689&view=rev Author: braden Date: 2008-09-24 07:32:39 +0000 (Wed, 24 Sep 2008) Log Message: ----------- Moved X3D CAD Geometry node implementations into a convenience library. Modified Paths: -------------- trunk/ChangeLog trunk/ide-projects/Windows/VisualC9_0/OpenVRML/OpenVRML.sln trunk/src/Makefile.am trunk/src/libopenvrml/openvrml/x3d_cad_geometry.cpp Added Paths: ----------- trunk/ide-projects/Windows/VisualC9_0/OpenVRML/x3d-cad-geometry/ trunk/ide-projects/Windows/VisualC9_0/OpenVRML/x3d-cad-geometry/x3d-cad-geometry.vcproj trunk/src/node/x3d-cad-geometry/ trunk/src/node/x3d-cad-geometry/cad_face.cpp trunk/src/node/x3d-cad-geometry/cad_face.h trunk/src/node/x3d-cad-geometry/indexed_quad_set.cpp trunk/src/node/x3d-cad-geometry/indexed_quad_set.h Removed Paths: ------------- trunk/ide-projects/Windows/VisualC9_0/OpenVRML/x3d-cad-geometry/x3d-cad-geometry.vcproj trunk/src/node/x3d-cad-geometry/cad_face.cpp trunk/src/node/x3d-cad-geometry/cad_face.h trunk/src/node/x3d-cad-geometry/indexed_quad_set.cpp trunk/src/node/x3d-cad-geometry/indexed_quad_set.h Property Changed: ---------------- trunk/ trunk/src/node/x3d-core/metadata_double.cpp trunk/src/node/x3d-core/metadata_double.h trunk/src/node/x3d-core/metadata_float.cpp trunk/src/node/x3d-core/metadata_float.h trunk/src/node/x3d-core/metadata_integer.cpp trunk/src/node/x3d-core/metadata_integer.h trunk/src/node/x3d-core/metadata_set.cpp trunk/src/node/x3d-core/metadata_set.h trunk/src/node/x3d-core/metadata_string.cpp trunk/src/node/x3d-core/metadata_string.h trunk/src/node/x3d-dis/espdu_transform.cpp trunk/src/node/x3d-dis/espdu_transform.h trunk/src/node/x3d-dis/receiver_pdu.cpp trunk/src/node/x3d-dis/receiver_pdu.h trunk/src/node/x3d-dis/signal_pdu.cpp trunk/src/node/x3d-dis/signal_pdu.h trunk/src/node/x3d-dis/transmitter_pdu.cpp trunk/src/node/x3d-dis/transmitter_pdu.h trunk/src/node/x3d-environmental-effects/texture_background.cpp trunk/src/node/x3d-environmental-effects/texture_background.h trunk/src/node/x3d-event-utilities/boolean_filter.cpp trunk/src/node/x3d-event-utilities/boolean_filter.h trunk/src/node/x3d-event-utilities/boolean_sequencer.cpp trunk/src/node/x3d-event-utilities/boolean_sequencer.h trunk/src/node/x3d-event-utilities/boolean_toggle.cpp trunk/src/node/x3d-event-utilities/boolean_toggle.h trunk/src/node/x3d-event-utilities/boolean_trigger.cpp trunk/src/node/x3d-event-utilities/boolean_trigger.h trunk/src/node/x3d-event-utilities/integer_sequencer.cpp trunk/src/node/x3d-event-utilities/integer_sequencer.h trunk/src/node/x3d-event-utilities/integer_trigger.cpp trunk/src/node/x3d-event-utilities/integer_trigger.h trunk/src/node/x3d-event-utilities/time_trigger.cpp trunk/src/node/x3d-event-utilities/time_trigger.h trunk/src/node/x3d-geometry2d/arc2d.cpp trunk/src/node/x3d-geometry2d/arc2d.h trunk/src/node/x3d-geometry2d/arc_close2d.cpp trunk/src/node/x3d-geometry2d/arc_close2d.h trunk/src/node/x3d-geometry2d/circle2d.cpp trunk/src/node/x3d-geometry2d/circle2d.h trunk/src/node/x3d-geometry2d/disk2d.cpp trunk/src/node/x3d-geometry2d/disk2d.h trunk/src/node/x3d-geometry2d/polyline2d.cpp trunk/src/node/x3d-geometry2d/polyline2d.h trunk/src/node/x3d-geometry2d/polypoint2d.cpp trunk/src/node/x3d-geometry2d/polypoint2d.h trunk/src/node/x3d-geometry2d/rectangle2d.cpp trunk/src/node/x3d-geometry2d/rectangle2d.h trunk/src/node/x3d-geometry2d/triangle_set2d.cpp trunk/src/node/x3d-geometry2d/triangle_set2d.h trunk/src/node/x3d-geospatial/geo_coordinate.cpp trunk/src/node/x3d-geospatial/geo_coordinate.h trunk/src/node/x3d-geospatial/geo_elevation_grid.cpp trunk/src/node/x3d-geospatial/geo_elevation_grid.h trunk/src/node/x3d-geospatial/geo_location.cpp trunk/src/node/x3d-geospatial/geo_location.h trunk/src/node/x3d-geospatial/geo_lod.cpp trunk/src/node/x3d-geospatial/geo_lod.h trunk/src/node/x3d-geospatial/geo_metadata.cpp trunk/src/node/x3d-geospatial/geo_metadata.h trunk/src/node/x3d-geospatial/geo_origin.cpp trunk/src/node/x3d-geospatial/geo_origin.h trunk/src/node/x3d-geospatial/geo_position_interpolator.cpp trunk/src/node/x3d-geospatial/geo_position_interpolator.h trunk/src/node/x3d-geospatial/geo_touch_sensor.cpp trunk/src/node/x3d-geospatial/geo_touch_sensor.h trunk/src/node/x3d-geospatial/geo_viewpoint.cpp trunk/src/node/x3d-geospatial/geo_viewpoint.h trunk/src/node/x3d-grouping/static_group.cpp trunk/src/node/x3d-grouping/static_group.h trunk/src/node/x3d-h-anim/h_anim_displacer.cpp trunk/src/node/x3d-h-anim/h_anim_displacer.h trunk/src/node/x3d-h-anim/h_anim_humanoid.cpp trunk/src/node/x3d-h-anim/h_anim_humanoid.h trunk/src/node/x3d-h-anim/h_anim_joint.cpp trunk/src/node/x3d-h-anim/h_anim_joint.h trunk/src/node/x3d-h-anim/h_anim_segment.cpp trunk/src/node/x3d-h-anim/h_anim_segment.h trunk/src/node/x3d-h-anim/h_anim_site.cpp trunk/src/node/x3d-h-anim/h_anim_site.h trunk/src/node/x3d-interpolation/coordinate_interpolator2d.cpp trunk/src/node/x3d-interpolation/coordinate_interpolator2d.h trunk/src/node/x3d-interpolation/position_interpolator2d.cpp trunk/src/node/x3d-interpolation/position_interpolator2d.h trunk/src/node/x3d-key-device-sensor/key_sensor.cpp trunk/src/node/x3d-key-device-sensor/key_sensor.h trunk/src/node/x3d-key-device-sensor/string_sensor.cpp trunk/src/node/x3d-key-device-sensor/string_sensor.h trunk/src/node/x3d-networking/load_sensor.cpp trunk/src/node/x3d-networking/load_sensor.h trunk/src/node/x3d-nurbs/contour2d.cpp trunk/src/node/x3d-nurbs/contour2d.h trunk/src/node/x3d-nurbs/contour_polyline2d.cpp trunk/src/node/x3d-nurbs/contour_polyline2d.h trunk/src/node/x3d-nurbs/coordinate_double.cpp trunk/src/node/x3d-nurbs/coordinate_double.h trunk/src/node/x3d-nurbs/nurbs_curve.cpp trunk/src/node/x3d-nurbs/nurbs_curve.h trunk/src/node/x3d-nurbs/nurbs_curve2d.cpp trunk/src/node/x3d-nurbs/nurbs_curve2d.h trunk/src/node/x3d-nurbs/nurbs_orientation_interpolator.cpp trunk/src/node/x3d-nurbs/nurbs_orientation_interpolator.h trunk/src/node/x3d-nurbs/nurbs_patch_surface.cpp trunk/src/node/x3d-nurbs/nurbs_patch_surface.h trunk/src/node/x3d-nurbs/nurbs_position_interpolator.cpp trunk/src/node/x3d-nurbs/nurbs_position_interpolator.h trunk/src/node/x3d-nurbs/nurbs_set.cpp trunk/src/node/x3d-nurbs/nurbs_set.h trunk/src/node/x3d-nurbs/nurbs_surface_interpolator.cpp trunk/src/node/x3d-nurbs/nurbs_surface_interpolator.h trunk/src/node/x3d-nurbs/nurbs_swept_surface.cpp trunk/src/node/x3d-nurbs/nurbs_swept_surface.h trunk/src/node/x3d-nurbs/nurbs_swung_surface.cpp trunk/src/node/x3d-nurbs/nurbs_swung_surface.h trunk/src/node/x3d-nurbs/nurbs_texture_coordinate.cpp trunk/src/node/x3d-nurbs/nurbs_texture_coordinate.h trunk/src/node/x3d-nurbs/nurbs_trimmed_surface.cpp trunk/src/node/x3d-nurbs/nurbs_trimmed_surface.h trunk/src/node/x3d-rendering/color_rgba.cpp trunk/src/node/x3d-rendering/color_rgba.h trunk/src/node/x3d-rendering/indexed_triangle_fan_set.cpp trunk/src/node/x3d-rendering/indexed_triangle_fan_set.h trunk/src/node/x3d-rendering/indexed_triangle_set.cpp trunk/src/node/x3d-rendering/indexed_triangle_set.h trunk/src/node/x3d-rendering/indexed_triangle_strip_set.cpp trunk/src/node/x3d-rendering/indexed_triangle_strip_set.h trunk/src/node/x3d-rendering/triangle_fan_set.cpp trunk/src/node/x3d-rendering/triangle_fan_set.h trunk/src/node/x3d-rendering/triangle_set.cpp trunk/src/node/x3d-rendering/triangle_set.h trunk/src/node/x3d-rendering/triangle_strip_set.cpp trunk/src/node/x3d-rendering/triangle_strip_set.h trunk/src/node/x3d-shape/fill_properties.cpp trunk/src/node/x3d-shape/fill_properties.h trunk/src/node/x3d-shape/line_properties.cpp trunk/src/node/x3d-shape/line_properties.h trunk/src/node/x3d-texturing/multi_texture.cpp trunk/src/node/x3d-texturing/multi_texture.h trunk/src/node/x3d-texturing/multi_texture_coordinate.cpp trunk/src/node/x3d-texturing/multi_texture_coordinate.h trunk/src/node/x3d-texturing/multi_texture_transform.cpp trunk/src/node/x3d-texturing/multi_texture_transform.h trunk/src/node/x3d-texturing/texture_coordinate_generator.cpp trunk/src/node/x3d-texturing/texture_coordinate_generator.h Property changes on: trunk ___________________________________________________________________ Modified: svn:mergeinfo - /branches/node-modules:3622-3623,3632-3635,3637-3638,3640-3641,3643-3644,3646-3647,3649-3650,3654-3655,3657-3658,3661-3662,3664-3665,3667-3668,3670-3671,3673-3674,3684-3685 + /branches/node-modules:3622-3623,3632-3635,3637-3638,3640-3641,3643-3644,3646-3647,3649-3650,3654-3655,3657-3658,3661-3662,3664-3665,3667-3668,3670-3671,3673-3674,3684-3685,3687-3688 Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-09-24 07:20:46 UTC (rev 3688) +++ trunk/ChangeLog 2008-09-24 07:32:39 UTC (rev 3689) @@ -1,5 +1,22 @@ 2008-09-24 Braden McDaniel <br...@en...> + Moved X3D CAD Geometry node implementations into a convenience + library. + + * ide-projects/Windows/VisualC9_0/OpenVRML/OpenVRML.sln: Added + x3d-cad-geometry static library project. + * ide-projects/Windows/VisualC9_0/OpenVRML/x3d-cad-geometry/x3d-cad-geometry. + * src/Makefile.am: Added convenience library + node/x3d-cad-geometry/libx3d-cad-geometry.la. + * src/libopenvrml/openvrml/x3d_cad_geometry.cpp: Moved node + implementations to separate files. + * src/node/x3d-cad-geometry/cad_face.cpp + * src/node/x3d-cad-geometry/cad_face.h + * src/node/x3d-cad-geometry/indexed_quad_set.cpp + * src/node/x3d-cad-geometry/indexed_quad_set.h + +2008-09-24 Braden McDaniel <br...@en...> + Moved X3D NURBS node implementations into a convenience library. Modified: trunk/ide-projects/Windows/VisualC9_0/OpenVRML/OpenVRML.sln =================================================================== --- trunk/ide-projects/Windows/VisualC9_0/OpenVRML/OpenVRML.sln 2008-09-24 07:20:46 UTC (rev 3688) +++ trunk/ide-projects/Windows/VisualC9_0/OpenVRML/OpenVRML.sln 2008-09-24 07:32:39 UTC (rev 3689) @@ -8,6 +8,7 @@ {E20E0E24-C0B6-4448-82E0-32CCDBA88957} = {E20E0E24-C0B6-4448-82E0-32CCDBA88957} {D5FF853A-6BD3-49AC-A5B6-ACA754C766F5} = {D5FF853A-6BD3-49AC-A5B6-ACA754C766F5} {430B1A48-8E64-43DF-8CC4-AD09C41BA735} = {430B1A48-8E64-43DF-8CC4-AD09C41BA735} + {D9D29F52-CFE0-42A1-A150-47CBAAE89030} = {D9D29F52-CFE0-42A1-A150-47CBAAE89030} {61A31C6F-23A1-4243-A338-EF749912592A} = {61A31C6F-23A1-4243-A338-EF749912592A} {12C5E485-59BD-40EB-9BE9-F856FBDC18B6} = {12C5E485-59BD-40EB-9BE9-F856FBDC18B6} {7DAC4CA0-9382-4ED0-A26E-A5F84776054C} = {7DAC4CA0-9382-4ED0-A26E-A5F84776054C} @@ -84,6 +85,8 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "x3d-nurbs", "x3d-nurbs\x3d-nurbs.vcproj", "{D884D3FB-79C4-497A-AD7C-7D7877F9768E}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "x3d-cad-geometry", "x3d-cad-geometry\x3d-cad-geometry.vcproj", "{D9D29F52-CFE0-42A1-A150-47CBAAE89030}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -182,6 +185,10 @@ {D884D3FB-79C4-497A-AD7C-7D7877F9768E}.Debug|Win32.Build.0 = Debug|Win32 {D884D3FB-79C4-497A-AD7C-7D7877F9768E}.Release|Win32.ActiveCfg = Release|Win32 {D884D3FB-79C4-497A-AD7C-7D7877F9768E}.Release|Win32.Build.0 = Release|Win32 + {D9D29F52-CFE0-42A1-A150-47CBAAE89030}.Debug|Win32.ActiveCfg = Debug|Win32 + {D9D29F52-CFE0-42A1-A150-47CBAAE89030}.Debug|Win32.Build.0 = Debug|Win32 + {D9D29F52-CFE0-42A1-A150-47CBAAE89030}.Release|Win32.ActiveCfg = Release|Win32 + {D9D29F52-CFE0-42A1-A150-47CBAAE89030}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE Property changes on: trunk/ide-projects/Windows/VisualC9_0/OpenVRML/x3d-cad-geometry ___________________________________________________________________ Added: svn:ignore + Debug Release x3d-cad-geometry.vcproj.*.user Deleted: trunk/ide-projects/Windows/VisualC9_0/OpenVRML/x3d-cad-geometry/x3d-cad-geometry.vcproj =================================================================== --- branches/node-modules/ide-projects/Windows/VisualC9_0/OpenVRML/x3d-cad-geometry/x3d-cad-geometry.vcproj 2008-09-24 07:20:46 UTC (rev 3688) +++ trunk/ide-projects/Windows/VisualC9_0/OpenVRML/x3d-cad-geometry/x3d-cad-geometry.vcproj 2008-09-24 07:32:39 UTC (rev 3689) @@ -1,187 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="9.00" - Name="x3d-cad-geometry" - ProjectGUID="{D9D29F52-CFE0-42A1-A150-47CBAAE89030}" - RootNamespace="x3dcadgeometry" - Keyword="Win32Proj" - TargetFrameworkVersion="196613" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="$(SolutionDir)$(ConfigurationName)" - IntermediateDirectory="$(ConfigurationName)" - ConfigurationType="4" - CharacterSet="1" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories="..\openvrml;..\..\..\..\..\src\libopenvrml" - PreprocessorDefinitions="WIN32;_DEBUG;_LIB;OPENVRML_BUILD_DLL" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="3" - UsePrecompiledHeader="0" - WarningLevel="3" - DebugInformationFormat="4" - DisableSpecificWarnings="4226;4250;4251;4275;4290;4355;4661;4800" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLibrarianTool" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory="$(SolutionDir)$(ConfigurationName)" - IntermediateDirectory="$(ConfigurationName)" - ConfigurationType="4" - CharacterSet="1" - WholeProgramOptimization="1" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - EnableIntrinsicFunctions="true" - AdditionalIncludeDirectories="..\openvrml;..\..\..\..\..\src\libopenvrml" - PreprocessorDefinitions="WIN32;NDEBUG;_LIB;OPENVRML_BUILD_DLL" - RuntimeLibrary="2" - EnableFunctionLevelLinking="true" - UsePrecompiledHeader="0" - WarningLevel="3" - DebugInformationFormat="3" - DisableSpecificWarnings="4226;4250;4251;4275;4290;4355;4661;4800" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLibrarianTool" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" - UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" - > - <File - RelativePath="..\..\..\..\..\src\node\x3d-cad-geometry\cad_face.cpp" - > - </File> - <File - RelativePath="..\..\..\..\..\src\node\x3d-cad-geometry\indexed_quad_set.cpp" - > - </File> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc;xsd" - UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" - > - <File - RelativePath="..\..\..\..\..\src\node\x3d-cad-geometry\cad_face.h" - > - </File> - <File - RelativePath="..\..\..\..\..\src\node\x3d-cad-geometry\indexed_quad_set.h" - > - </File> - </Filter> - <Filter - Name="Resource Files" - Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav" - UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" - > - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> Copied: trunk/ide-projects/Windows/VisualC9_0/OpenVRML/x3d-cad-geometry/x3d-cad-geometry.vcproj (from rev 3688, branches/node-modules/ide-projects/Windows/VisualC9_0/OpenVRML/x3d-cad-geometry/x3d-cad-geometry.vcproj) =================================================================== --- trunk/ide-projects/Windows/VisualC9_0/OpenVRML/x3d-cad-geometry/x3d-cad-geometry.vcproj (rev 0) +++ trunk/ide-projects/Windows/VisualC9_0/OpenVRML/x3d-cad-geometry/x3d-cad-geometry.vcproj 2008-09-24 07:32:39 UTC (rev 3689) @@ -0,0 +1,187 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="9.00" + Name="x3d-cad-geometry" + ProjectGUID="{D9D29F52-CFE0-42A1-A150-47CBAAE89030}" + RootNamespace="x3dcadgeometry" + Keyword="Win32Proj" + TargetFrameworkVersion="196613" + > + <Platforms> + <Platform + Name="Win32" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="Debug|Win32" + OutputDirectory="$(SolutionDir)$(ConfigurationName)" + IntermediateDirectory="$(ConfigurationName)" + ConfigurationType="4" + CharacterSet="1" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + AdditionalIncludeDirectories="..\openvrml;..\..\..\..\..\src\libopenvrml" + PreprocessorDefinitions="WIN32;_DEBUG;_LIB;OPENVRML_BUILD_DLL" + MinimalRebuild="true" + BasicRuntimeChecks="3" + RuntimeLibrary="3" + UsePrecompiledHeader="0" + WarningLevel="3" + DebugInformationFormat="4" + DisableSpecificWarnings="4226;4250;4251;4275;4290;4355;4661;4800" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Release|Win32" + OutputDirectory="$(SolutionDir)$(ConfigurationName)" + IntermediateDirectory="$(ConfigurationName)" + ConfigurationType="4" + CharacterSet="1" + WholeProgramOptimization="1" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="2" + EnableIntrinsicFunctions="true" + AdditionalIncludeDirectories="..\openvrml;..\..\..\..\..\src\libopenvrml" + PreprocessorDefinitions="WIN32;NDEBUG;_LIB;OPENVRML_BUILD_DLL" + RuntimeLibrary="2" + EnableFunctionLevelLinking="true" + UsePrecompiledHeader="0" + WarningLevel="3" + DebugInformationFormat="3" + DisableSpecificWarnings="4226;4250;4251;4275;4290;4355;4661;4800" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <Filter + Name="Source Files" + Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" + UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" + > + <File + RelativePath="..\..\..\..\..\src\node\x3d-cad-geometry\cad_face.cpp" + > + </File> + <File + RelativePath="..\..\..\..\..\src\node\x3d-cad-geometry\indexed_quad_set.cpp" + > + </File> + </Filter> + <Filter + Name="Header Files" + Filter="h;hpp;hxx;hm;inl;inc;xsd" + UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" + > + <File + RelativePath="..\..\..\..\..\src\node\x3d-cad-geometry\cad_face.h" + > + </File> + <File + RelativePath="..\..\..\..\..\src\node\x3d-cad-geometry\indexed_quad_set.h" + > + </File> + </Filter> + <Filter + Name="Resource Files" + Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav" + UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" + > + </Filter> + </Files> + <Globals> + </Globals> +</VisualStudioProject> Modified: trunk/src/Makefile.am =================================================================== --- trunk/src/Makefile.am 2008-09-24 07:20:46 UTC (rev 3688) +++ trunk/src/Makefile.am 2008-09-24 07:32:39 UTC (rev 3689) @@ -19,7 +19,8 @@ node/x3d-environmental-effects/libx3d-environmental-effects.la \ node/x3d-geospatial/libx3d-geospatial.la \ node/x3d-h-anim/libx3d-h-anim.la \ - node/x3d-nurbs/libx3d-nurbs.la + node/x3d-nurbs/libx3d-nurbs.la \ + node/x3d-cad-geometry/libx3d-cad-geometry.la if ENABLE_GL_RENDERER lib_LTLIBRARIES += libopenvrml-gl/libopenvrml-gl.la endif @@ -167,6 +168,7 @@ node/x3d-geospatial/libx3d-geospatial.la \ node/x3d-h-anim/libx3d-h-anim.la \ node/x3d-nurbs/libx3d-nurbs.la \ + node/x3d-cad-geometry/libx3d-cad-geometry.la \ -lboost_thread$(BOOST_LIB_SUFFIX) \ -lboost_filesystem$(BOOST_LIB_SUFFIX) \ -lltdl @@ -596,6 +598,17 @@ node/x3d-nurbs/nurbs_trimmed_surface.cpp \ node/x3d-nurbs/nurbs_trimmed_surface.h +node_x3d_cad_geometry_libx3d_cad_geometry_la_CPPFLAGS = \ + -I$(top_builddir)/src/libopenvrml \ + -I$(top_srcdir)/src/libopenvrml +node_x3d_cad_geometry_libx3d_cad_geometry_la_CXXFLAGS = \ + $(PTHREAD_CFLAGS) +node_x3d_cad_geometry_libx3d_cad_geometry_la_SOURCES = \ + node/x3d-cad-geometry/cad_face.cpp \ + node/x3d-cad-geometry/cad_face.h \ + node/x3d-cad-geometry/indexed_quad_set.cpp \ + node/x3d-cad-geometry/indexed_quad_set.h + libopenvrml_gl_libopenvrml_gl_la_CPPFLAGS = \ -I$(top_builddir)/src/libopenvrml \ -I$(top_srcdir)/src/libopenvrml \ Modified: trunk/src/libopenvrml/openvrml/x3d_cad_geometry.cpp =================================================================== --- trunk/src/libopenvrml/openvrml/x3d_cad_geometry.cpp 2008-09-24 07:20:46 UTC (rev 3688) +++ trunk/src/libopenvrml/openvrml/x3d_cad_geometry.cpp 2008-09-24 07:32:39 UTC (rev 3689) @@ -2,7 +2,7 @@ // // OpenVRML // -// Copyright 2006, 2007 Braden McDaniel +// Copyright 2006, 2007, 2008 Braden McDaniel // // This library is free software; you can redistribute it and/or modify it // under the terms of the GNU Lesser General Public License as published by @@ -18,691 +18,23 @@ // along with this library; if not, see <http://www.gnu.org/licenses/>. // +# include "browser.h" +# include "x3d_cad_geometry.h" +# include <x3d-cad-geometry/cad_face.h> +# include <x3d-cad-geometry/indexed_quad_set.h> + # ifdef HAVE_CONFIG_H # include <config.h> # endif -# include <boost/array.hpp> -# include <private.h> -# include "browser.h" -# include "node_impl_util.h" -# include "x3d_cad_geometry.h" - -using namespace openvrml; -using namespace openvrml::node_impl_util; -using namespace std; - -namespace { - - /** - * @brief Class object for CADFace nodes. - */ - class OPENVRML_LOCAL cad_face_metatype : public node_metatype { - public: - static const char * const id; - - explicit cad_face_metatype(openvrml::browser & browser); - virtual ~cad_face_metatype() OPENVRML_NOTHROW; - - private: - virtual const boost::shared_ptr<node_type> - do_create_type(const std::string & id, - const node_interface_set & interfaces) const - OPENVRML_THROW2(unsupported_interface, std::bad_alloc); - }; - - - /** - * @brief Class object for IndexedQuadSet and QuadSet nodes. - */ - class OPENVRML_LOCAL indexed_quad_set_metatype : public node_metatype { - public: - static const char * const id; - - explicit indexed_quad_set_metatype(openvrml::browser & browser); - virtual ~indexed_quad_set_metatype() OPENVRML_NOTHROW; - - private: - virtual const boost::shared_ptr<node_type> - do_create_type(const std::string & id, - const node_interface_set & interfaces) const - OPENVRML_THROW2(unsupported_interface, std::bad_alloc); - }; -} - void register_cad_geometry_node_metatypes(openvrml::browser & b) { using openvrml::node_metatype; using boost::shared_ptr; + using namespace openvrml_node_x3d_cad_geometry; b.add_node_metatype(cad_face_metatype::id, shared_ptr<node_metatype>(new cad_face_metatype(b))); b.add_node_metatype(indexed_quad_set_metatype::id, - shared_ptr<node_metatype>(new indexed_quad_set_metatype(b))); + shared_ptr<node_metatype>( + new indexed_quad_set_metatype(b))); } - -namespace { - using namespace openvrml_; - - class OPENVRML_LOCAL cad_face_node : public abstract_node<cad_face_node>, - public grouping_node { - friend class cad_face_metatype; - - exposedfield<sfstring> name_; - exposedfield<sfnode> shape_; - - //used by do_children to return the shape - std::vector<boost::intrusive_ptr<node> > children_; - - public: - cad_face_node(const node_type & type, - const boost::shared_ptr<openvrml::scope> & scope); - virtual ~cad_face_node() OPENVRML_NOTHROW; - - virtual bool modified() const; - - protected: - virtual const openvrml::bounding_volume & do_bounding_volume() const; - virtual const std::vector<boost::intrusive_ptr<node> > - do_children() const OPENVRML_THROW1(std::bad_alloc); - }; - - - class OPENVRML_LOCAL indexed_quad_set_node : - public abstract_node<indexed_quad_set_node>, - public geometry_node { - - friend class indexed_quad_set_metatype; - - class set_index_listener : public event_listener_base<self_t>, - public mfint32_listener { - public: - explicit set_index_listener(self_t & node); - virtual ~set_index_listener() OPENVRML_NOTHROW; - - private: - virtual void do_process_event(const mfint32 & fraction, - double timestamp) - OPENVRML_THROW1(std::bad_alloc); - }; - - set_index_listener set_index_listener_; - exposedfield<sfnode> color_; - exposedfield<sfnode> coord_; - exposedfield<sfnode> normal_; - exposedfield<sfnode> tex_coord_; - sfbool ccw_; - sfbool color_per_vertex_; - sfbool normal_per_vertex_; - sfbool solid_; - mfint32 index_; - bounding_sphere bsphere; - - public: - indexed_quad_set_node(const node_type & type, - const boost::shared_ptr<openvrml::scope> & scope); - virtual ~indexed_quad_set_node() OPENVRML_NOTHROW; - - virtual const color_node * color() const OPENVRML_NOTHROW; - virtual bool modified() const; - - private: - virtual const openvrml::bounding_volume & - do_bounding_volume() const; - - virtual viewer::object_t do_render_geometry(openvrml::viewer & viewer, - rendering_context context); - - void recalc_bsphere(); - }; - - - /** - * @brief @c node_metatype identifier. - */ - const char * const cad_face_metatype::id = "urn:X-openvrml:node:CADFace"; - - /** - * @brief Construct. - * - * @param browser the browser associated with this cad_face_metatype. - */ - cad_face_metatype::cad_face_metatype(openvrml::browser & browser): - node_metatype(cad_face_metatype::id, browser) - {} - - /** - * @brief Destroy. - */ - cad_face_metatype::~cad_face_metatype() OPENVRML_NOTHROW - {} - - /** - * @brief Create a node_type. - * - * @param id the name for the new node_type. - * @param interfaces the interfaces for the new node_type. - * - * @return a @c node_type capable of creating CADFace nodes. - * - * @exception unsupported_interface if @p interfaces includes an interface - * not supported by cad_face_metatype. - * @exception std::bad_alloc if memory allocation fails. - */ - const boost::shared_ptr<openvrml::node_type> - cad_face_metatype:: - do_create_type(const std::string & id, - const node_interface_set & interfaces) const - OPENVRML_THROW2(unsupported_interface, std::bad_alloc) - { - typedef boost::array<node_interface, 3> supported_interfaces_t; - static const supported_interfaces_t supported_interfaces = { - node_interface(node_interface::exposedfield_id, - field_value::sfnode_id, - "metadata"), - node_interface(node_interface::exposedfield_id, - field_value::sfstring_id, - "name"), - node_interface(node_interface::exposedfield_id, - field_value::sfnode_id, - "shape") - }; - typedef node_type_impl<cad_face_node> node_type_t; - - const boost::shared_ptr<node_type> type(new node_type_t(*this, id)); - node_type_t & the_node_type = static_cast<node_type_t &>(*type); - - for (node_interface_set::const_iterator interface_(interfaces.begin()); - interface_ != interfaces.end(); - ++interface_) { - supported_interfaces_t::const_iterator supported_interface = - supported_interfaces.begin() - 1; - if (*interface_ == *++supported_interface) { - the_node_type.add_exposedfield( - supported_interface->field_type, - supported_interface->id, - &cad_face_node::metadata); - } else if (*interface_ == *++supported_interface) { - the_node_type.add_exposedfield( - supported_interface->field_type, - supported_interface->id, - &cad_face_node::name_); - } else if (*interface_ == *++supported_interface) { - the_node_type.add_exposedfield( - supported_interface->field_type, - supported_interface->id, - &cad_face_node::shape_); - } else { - throw unsupported_interface(*interface_); - } - } - return type; - } - - - /** - * @brief @c node_metatype identifier. - */ - const char * const indexed_quad_set_metatype::id = - "urn:X-openvrml:node:IndexedQuadSet"; - - /** - * @brief Construct. - * - * @param browser the browser associated with this - * @c indexed_quad_set_metatype. - */ - indexed_quad_set_metatype:: - indexed_quad_set_metatype(openvrml::browser & browser): - node_metatype(cad_face_metatype::id, browser) - {} - - /** - * @brief Destroy. - */ - indexed_quad_set_metatype::~indexed_quad_set_metatype() OPENVRML_NOTHROW - {} - - /** - * @brief Create a node_type. - * - * @param id the name for the new node_type. - * @param interfaces the interfaces for the new node_type. - * - * @return a @c node_type capable of creating IndexedQuadSet nodes. - * - * @exception unsupported_interface if @p interfaces includes an interface - * not supported by indexed_quad_set_metatype. - * @exception std::bad_alloc if memory allocation fails. - */ - const boost::shared_ptr<openvrml::node_type> - indexed_quad_set_metatype:: - do_create_type(const std::string & id, - const node_interface_set & interfaces) const - OPENVRML_THROW2(unsupported_interface, std::bad_alloc) - { - typedef boost::array<node_interface, 11> supported_interfaces_t; - static const supported_interfaces_t supported_interfaces = { - node_interface(node_interface::eventin_id, - field_value::mfint32_id, - "set_index"), - node_interface(node_interface::exposedfield_id, - field_value::sfnode_id, - "color"), - node_interface(node_interface::exposedfield_id, - field_value::sfnode_id, - "coord"), - node_interface(node_interface::exposedfield_id, - field_value::sfnode_id, - "metadata"), - node_interface(node_interface::exposedfield_id, - field_value::sfnode_id, - "normal"), - node_interface(node_interface::exposedfield_id, - field_value::sfnode_id, - "texCoord"), - node_interface(node_interface::field_id, - field_value::sfbool_id, - "ccw"), - node_interface(node_interface::field_id, - field_value::sfbool_id, - "colorPerVertex"), - node_interface(node_interface::field_id, - field_value::sfbool_id, - "normalPerVertex"), - node_interface(node_interface::field_id, - field_value::sfbool_id, - "solid"), - node_interface(node_interface::field_id, - field_value::mfint32_id, - "index") - }; - typedef node_type_impl<indexed_quad_set_node> node_type_t; - - const boost::shared_ptr<node_type> type(new node_type_t(*this, id)); - node_type_t & the_node_type = static_cast<node_type_t &>(*type); - - for (node_interface_set::const_iterator interface_(interfaces.begin()); - interface_ != interfaces.end(); - ++interface_) { - supported_interfaces_t::const_iterator supported_interface = - supported_interfaces.begin() - 1; - if (*interface_ == *++supported_interface) { - the_node_type.add_eventin( - supported_interface->field_type, - supported_interface->id, - &indexed_quad_set_node::set_index_listener_); - } else if (*interface_ == *++supported_interface) { - the_node_type.add_exposedfield( - supported_interface->field_type, - supported_interface->id, - &indexed_quad_set_node::color_); - } else if (*interface_ == *++supported_interface) { - the_node_type.add_exposedfield( - supported_interface->field_type, - supported_interface->id, - &indexed_quad_set_node::coord_); - } else if (*interface_ == *++supported_interface) { - the_node_type.add_exposedfield( - supported_interface->field_type, - supported_interface->id, - &indexed_quad_set_node::metadata); - } else if (*interface_ == *++supported_interface) { - the_node_type.add_exposedfield( - supported_interface->field_type, - supported_interface->id, - &indexed_quad_set_node::normal_); - } else if (*interface_ == *++supported_interface) { - the_node_type.add_exposedfield( - supported_interface->field_type, - supported_interface->id, - &indexed_quad_set_node::tex_coord_); - } else if (*interface_ == *++supported_interface) { - the_node_type.add_field( - supported_interface->field_type, - supported_interface->id, - &indexed_quad_set_node::ccw_); - } else if (*interface_ == *++supported_interface) { - the_node_type.add_field( - supported_interface->field_type, - supported_interface->id, - &indexed_quad_set_node::color_per_vertex_); - } else if (*interface_ == *++supported_interface) { - the_node_type.add_field( - supported_interface->field_type, - supported_interface->id, - &indexed_quad_set_node::normal_per_vertex_); - } else if (*interface_ == *++supported_interface) { - the_node_type.add_field( - supported_interface->field_type, - supported_interface->id, - &indexed_quad_set_node::solid_); - } else if (*interface_ == *++supported_interface) { - the_node_type.add_field( - supported_interface->field_type, - supported_interface->id, - &indexed_quad_set_node::index_); - } else { - throw unsupported_interface(*interface_); - } - } - return type; - } - - /** - * @class cad_face_node - * - * @brief Represents CADFace node instances. - */ - - /** - * @var class cad_face_node::cad_face_metatype - * - * @brief Class object for CADFace nodes. - */ - - /** - * @var abstract_node<self_t>::exposedfield<sfstring> cad_face_node::name_ - * - * @brief name exposedField - */ - - /** - * @var abstract_node<self_t>::exposedfield<sfnode> cad_face_node::shape_ - * - * @brief shape exposedField - */ - - /** - * @brief Get the children in the scene graph. - * - * @return the child nodes in the scene graph. - * - * @exception std::bad_alloc if memory allocation fails. - */ - const std::vector<boost::intrusive_ptr<node> > - cad_face_node::do_children() const OPENVRML_THROW1(std::bad_alloc) - { - cad_face_node * me = const_cast<cad_face_node *>(this); - // if there is no child - if (!shape_.sfnode::value().get()) { - me->children_.clear(); - } else if (this->children_.empty() - || this->children_[0] != shape_.sfnode::value()) { - // if we have not set the child, or the child has changed. - me->children_.assign(1, shape_.sfnode::value()); - } - return children_; - } - - /** - * @brief Determine whether the node has been modified. - * - * @return @c true if the node or it child has been modified - * @c false otherwise. - */ - bool cad_face_node::modified() const - { - if (this->node::modified()) { return true; } - if (shape_.sfnode::value().get() == NULL) { return false; } - return shape_.sfnode::value()->modified(); - } - - /** - * @brief Get the bounding volume. - * - * @return the bounding volume associated with the node. - */ - const openvrml::bounding_volume & - cad_face_node::do_bounding_volume() const - { - static bounding_sphere empty_volume; - - //get the child as a bounded_volume_node - bounded_volume_node * node = - node_cast<bounded_volume_node *>(shape_.sfnode::value().get()); - - //return empty if there is not child - if (node == NULL) - return empty_volume; - - //return the child's bounded volume - return node->bounding_volume(); - } - - /** - * @brief Construct. - * - * @param type the node_type associated with this node. - * @param scope the scope to which the node belongs. - */ - cad_face_node:: - cad_face_node(const node_type & type, - const boost::shared_ptr<openvrml::scope> & scope): - node(type, scope), - bounded_volume_node(type, scope), - child_node(type, scope), - abstract_node<self_t>(type, scope), - grouping_node(type, scope), - name_(*this), - shape_(*this) - {} - - /** - * @brief Destroy. - */ - cad_face_node::~cad_face_node() OPENVRML_NOTHROW - {} - - /** - * @class indexed_quad_set_node - * - * @brief Represents IndexedQuadSet node instances. - */ - - /** - * @var class indexed_quad_set_node::indexed_quad_set_metatype - * - * @brief Class object for IndexedQuadSet nodes. - */ - - /** - * @var indexed_quad_set_node::set_index_listener indexed_quad_set_node::set_index_listener_ - * - * @brief set_index eventIn - */ - - /** - * @var abstract_node<indexed_quad_set_node>::exposedfield<openvrml::sfnode> indexed_quad_set_node::color_ - * - * @brief color exposedField - */ - - /** - * @var abstract_node<indexed_quad_set_node>::exposedfield<openvrml::sfnode> indexed_quad_set_node::coord_ - * - * @brief coord exposedField - */ - - /** - * @var abstract_node<indexed_quad_set_node>::exposedfield<openvrml::sfnode> indexed_quad_set_node::normal_ - * - * @brief normal exposedField - */ - - /** - * @var abstract_node<indexed_quad_set_node>::exposedfield<openvrml::sfnode> indexed_quad_set_node::tex_coord_ - * - * @brief tex_coord exposedField - */ - - /** - * @var openvrml::sfbool indexed_quad_set_node::ccw_ - * - * @brief ccw field - */ - - /** - * @var openvrml::sfbool indexed_quad_set_node::color_per_vertex_ - * - * @brief color_per_vertex field - */ - - /** - * @var openvrml::sfbool indexed_quad_set_node::normal_per_vertex_ - * - * @brief normal_per_vertex field - */ - - /** - * @var openvrml::sfbool indexed_quad_set_node::solid_ - * - * @brief solid field - */ - - /** - * @var openvrml::mfint32 indexed_quad_set_node::index_ - * - * @brief index field - */ - - /** - * @brief Construct. - * - * @param[in] node a @c indexed_quad_set_node. - */ - indexed_quad_set_node::set_index_listener:: - set_index_listener(self_t & node): - node_event_listener(node), - event_listener_base<self_t>(node), - mfint32_listener(node) - {} - - /** - * @brief Destroy. - */ - indexed_quad_set_node::set_index_listener:: - ~set_index_listener() OPENVRML_NOTHROW - {} - - /** - * @brief Process @c set_index event. - * - * @todo Needs implementation. - * - * @param[in] index coordinate indices. - * @param[in] timestamp the current time. - * - * @exception std::bad_alloc if memory allocation fails. - */ - void indexed_quad_set_node::set_index_listener:: - do_process_event(const mfint32 & /* index */, const double /* timestamp */) - OPENVRML_THROW1(std::bad_alloc) - {} - - /** - * @brief Construct. - * - * @param type the @c node_type associated with this node. - * @param scope the @c scope to which the node belongs. - */ - indexed_quad_set_node:: - indexed_quad_set_node(const node_type & type, - const boost::shared_ptr<openvrml::scope> & scope): - node(type, scope), - bounded_volume_node(type, scope), - abstract_node<self_t>(type, scope), - geometry_node(type, scope), - set_index_listener_(*this), - color_(*this), - coord_(*this), - normal_(*this), - tex_coord_(*this), - ccw_(true), - color_per_vertex_(true), - normal_per_vertex_(true), - solid_(true) - {} - - /** - * @brief Destroy. - */ - indexed_quad_set_node::~indexed_quad_set_node() OPENVRML_NOTHROW - {} - - /** - * @brief Get the bounding volume. - * - * @return the bounding volume associated with the node. - */ - const openvrml::bounding_volume & - indexed_quad_set_node::do_bounding_volume() const - { - if (this->bounding_volume_dirty()) { - const_cast<indexed_quad_set_node *>(this)->recalc_bsphere(); - } - return this->bsphere; - } - - /** - * @brief Recalculate the bounding volume. - */ - void indexed_quad_set_node::recalc_bsphere() - { - // take the bvolume of all the points. technically, we should figure - // out just which points are used by the index and just use those, - // but for a first pass this is fine (also: if we do it this way - // then we don't have to update the bvolume when the index - // changes). motto: always do it the simple way first... - // - openvrml::coordinate_node * const coordinateNode = - node_cast<openvrml::coordinate_node *>( - this->coord_.sfnode::value().get()); - if (coordinateNode) { - const std::vector<vec3f> & coord = coordinateNode->point(); - this->bsphere = bounding_sphere(); - this->bsphere.enclose(coord); - } - this->bounding_volume_dirty(false); - } - - const color_node * indexed_quad_set_node::color() const OPENVRML_NOTHROW - { - return node_cast<color_node *>(color_.sfnode::value().get()); - } - - /** - * @brief Insert this geometry into @p viewer's display list. - * - * @param viewer a Viewer. - * @param context the rendering context. - * - * @todo Implement this! - */ - openvrml::viewer::object_t - indexed_quad_set_node:: - do_render_geometry(openvrml::viewer & /* viewer */, - const rendering_context /* context */) - { - //TODO: Implement this! - return 0; - } - - /** - * @brief Determine whether the node has been modified. - * - * @return @c true if the node or one of its children has been modified, - * @c false otherwise. - */ - bool indexed_quad_set_node::modified() const - { - return this->node::modified() - || (this->color_.sfnode::value() - && this->color_.sfnode::value()->modified()) - || (this->coord_.sfnode::value() - && this->coord_.sfnode::value()->modified()) - || (this->normal_.sfnode::value() - && this->normal_.sfnode::value()->modified()) - || (this->tex_coord_.sfnode::value() - && this->tex_coord_.sfnode::value()->modified()); - } -} Deleted: trunk/src/node/x3d-cad-geometry/cad_face.cpp =================================================================== --- branches/node-modules/src/node/x3d-cad-geometry/cad_face.cpp 2008-09-24 07:20:46 UTC (rev 3688) +++ trunk/src/node/x3d-cad-geometry/cad_face.cpp 2008-09-24 07:32:39 UTC (rev 3689) @@ -1,246 +0,0 @@ -// -*- mode: c++; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 78 -*- -// -// OpenVRML -// -// Copyright 2006, 2007 Braden McDaniel -// -// This library is free software; you can redistribute it and/or modify it -// under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation; either version 3 of the License, or (at your -// option) any later version. -// -// This library 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 Lesser General Public -// License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this library; if not, see <http://www.gnu.org/licenses/>. -// - -# include "cad_face.h" -# include <openvrml/node_impl_util.h> -# include <boost/array.hpp> - -# ifdef HAVE_CONFIG_H -# include <config.h> -# endif - -using namespace openvrml; -using namespace openvrml::node_impl_util; -using namespace std; - -namespace { - - /** - * @brief Represents CADFace node instances. - */ - class OPENVRML_LOCAL cad_face_node : public abstract_node<cad_face_node>, - public grouping_node { - friend class openvrml_node_x3d_cad_geometry::cad_face_metatype; - - exposedfield<sfstring> name_; - exposedfield<sfnode> shape_; - - //used by do_children to return the shape - std::vector<boost::intrusive_ptr<node> > children_; - - public: - cad_face_node(const node_type & type, - const boost::shared_ptr<openvrml::scope> & scope); - virtual ~cad_face_node() OPENVRML_NOTHROW; - - virtual bool modified() const; - - protected: - virtual const openvrml::bounding_volume & do_bounding_volume() const; - virtual const std::vector<boost::intrusive_ptr<node> > - do_children() const OPENVRML_THROW1(std::bad_alloc); - }; - - - /** - * @var class cad_face_node::cad_face_metatype - * - * @brief Class object for CADFace nodes. - */ - - /** - * @var abstract_node<self_t>::exposedfield<sfstring> cad_face_node::name_ - * - * @brief name exposedField - */ - - /** - * @var abstract_node<self_t>::exposedfield<sfnode> cad_face_node::shape_ - * - * @brief shape exposedField - */ - - /** - * @brief Get the children in the scene graph. - * - * @return the child nodes in the scene graph. - * - * @exception std::bad_alloc if memory allocation fails. - */ - const std::vector<boost::intrusive_ptr<node> > - cad_face_node::do_children() const OPENVRML_THROW1(std::bad_alloc) - { - cad_face_node * me = const_cast<cad_face_node *>(this); - // if there is no child - if (!shape_.sfnode::value().get()) { - me->children_.clear(); - } else if (this->children_.empty() - || this->children_[0] != shape_.sfnode::value()) { - // if we have not set the child, or the child has changed. - me->children_.assign(1, shape_.sfnode::value()); - } - return children_; - } - - /** - * @brief Determine whether the node has been modified. - * - * @return @c true if the node or it child has been modified - * @c false otherwise. - */ - bool cad_face_node::modified() const - { - if (this->node::modified()) { return true; } - if (shape_.sfnode::value().get() == NULL) { return false; } - return shape_.sfnode::value()->modified(); - } - - /** - * @brief Get the bounding volume. - * - * @return the bounding volume associated with the node. - */ - const openvrml::bounding_volume & - cad_face_node::do_bounding_volume() const - { - static bounding_sphere empty_volume; - - //get the child as a bounded_volume_node - bounded_volume_node * node = - node_cast<bounded_volume_node *>(shape_.sfnode::value().get()); - - //return empty if there is not child - if (node == NULL) - return empty_volume; - - //return the child's bounded volume - return node->bounding_volume(); - } - - /** - * @brief Construct. - * - * @param type the node_type associated with this node. - * @param scope the scope to which the node belongs. - */ - cad_face_node:: - cad_face_node(const node_type & type, - const boost::shared_ptr<openvrml::scope> & scope): - node(type, scope), - bounded_volume_node(type, scope), - child_node(type, scope), - abstract_node<self_t>(type, scope), - grouping_node(type, scope), - name_(*this), - shape_(*this) - {} - - /** - * @brief Destroy. - */ - cad_face_node::~cad_face_node() OPENVRML_NOTHROW - {} -} - - -/** - * @brief @c node_metatype identifier. - */ -const char * const -openvrml_node_x3d_cad_geometry::cad_face_metatype::id = "urn:X-openvrml:node:CADFace"; - -/** - * @brief Construct. - * - * @param browser the browser associated with this cad_face_metatype. - */ -openvrml_node_x3d_cad_geometry::cad_face_metatype:: -cad_face_metatype(openvrml::browser & browser): - node_metatype(cad_face_metatype::id, browser) -{} - -/** - * @brief Destroy. - */ -openvrml_node_x3d_cad_geometry::cad_face_metatype::~cad_face_metatype() - OPENVRML_NOTHROW -{} - -/** - * @brief Create a @c node_type. - * - * @param id the name for the new @c node_type. - * @param interfaces the interfaces for the new @c node_type. - * - * @return a @c node_type capable of creating CADFace nodes. - * - * @exception unsupported_interface if @p interfaces includes an interface - * not supported by @c cad_face_metatype. - * @exception std::bad_alloc if memory allocation fails. - */ -const boost::shared_ptr<openvrml::node_type> -openvrml_node_x3d_cad_geometry::cad_face_metatype:: -do_create_type(const std::string & id, - const node_interface_set & interfaces) const - OPENVRML_THROW2(unsupported_interface, std::bad_alloc) -{ - typedef boost::array<node_interface, 3> supported_interfaces_t; - static const supported_interfaces_t supported_interfaces = { - node_interface(node_interface::exposedfield_id, - field_value::sfnode_id, - "metadata"), - node_interface(node_interface::exposedfield_id, - field_value::sfstring_id, - "name"), - node_interface(node_interface::exposedfield_id, - field_value::sfnode_id, - "shape") - }; - typedef node_type_impl<cad_face_node> node_type_t; - - const boost::shared_ptr<node_type> type(new node_type_t(*this, id)); - node_type_t & the_node_type = static_cast<node_type_t &>(*type); - - for (node_interface_set::const_iterator interface_(interfaces.begin()); - interface_ != interfaces.end(); - ++interface_) { - supported_interfaces_t::const_iterator supported_interface = - supported_interfaces.begin() - 1; - if (*interface_ == *++supported_interface) { - the_node_type.add_exposedfield( - supported_interface->field_type, - supported_interface->id, - &cad_face_node::metadata); - } else if (*interface_ == *++supported_interface) { - the_node_type.add_exposedfield( - supported_interface->field_type, - supported_interface->id, - &cad_face_node::name_); - } else if (*interface_ == *++supported_interface) { - the_node_type.add_exposedfield( - supported_interface->field_type, - supported_interface->id, - &cad_face_node::shape_); - } else { - throw unsupported_interface(*interface_); - } - } - return type; -} Copied: trunk/src/node/x3d-cad-geometry/cad_face.cpp (from rev 3688, branches/node-modules/src/node/x3d-cad-geometry/cad_face.cpp) =================================================================== --- trunk/src/node/x3d-cad-geometry/cad_face.cpp (rev 0) +++ trunk/src/node/x3d-cad-geometry/cad_face.cpp 2008-09-24 07:32:39 UTC (rev 3689) @@ -0,0 +1,246 @@ +// -*- mode: c++; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 78 -*- +// +// OpenVRML +// +// Copyright 2006, 2007 Braden McDaniel +// +// This library is free software; you can redistribute it and/or modify it +// under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 3 of the License, or (at your +// option) any later version. +// +// This library 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 Lesser General Public +// License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this library; if not, see <http://www.gnu.org/licenses/>. +// + +# include "cad_face.h" +# include <openvrml/node_impl_util.h> +# include <boost/array.hpp> + +# ifdef HAVE_CONFIG_H +# include <config.h> +# endif + +using namespace openvrml; +using namespace openvrml::node_impl_util; +using namespace std; + +namespace { + + /** + * @brief Represents CADFace node instances. + */ + class OPENVRML_LOCAL cad_face_node : public abstract_node<cad_face_node>, + public grouping_node { + friend class openvrml_node_x3d_cad_geometry::cad_face_metatype; + + exposedfield<sfstring> name_; + exposedfield<sfnode> shape_; + + //used by do_children to return the shape + std::vector<boost::intrusive_ptr<node> > children_; + + public: + cad_face_node(const node_type & type, + const boost::shared_ptr<openvrml::scope> & scope); + virtual ~cad_face_node() OPENVRML_NOTHROW; + + virtual bool modified() const; + + protected: + virtual const openvrml::bounding_volume & do_bounding_volume() const; + virtual const std::vector<boost::intrusive_ptr<node> > + do_children() const OPENVRML_THROW1(std::bad_alloc); + }; + + + /** + * @var class cad_face_node::cad_face_metatype + * + * @brief Class object for CADFace nodes. + */ + + /** + * @var abstract_node<self_t>::exposedfield<sfstring> cad_face_node::name_ + * + * @brief name exposedField + */ + + /** + * @var abstract_node<self_t>::exposedfield<sfnode> cad_face_node::shape_ + * + * @brief shape exposedField + */ + + /** + * @brief Get the children in the scene graph. + * + * @return the child nodes in the scene graph. + * + * @exception std::bad_alloc if memory allocation fails. + */ + const std::vector<boost::intrusive_ptr<node> > + cad_face_node::do_children() const OPENVRML_THROW1(std::bad_alloc) + { + cad_face_node * me = const_cast<cad_face_node *>(this); + // if there is no child + if (!shape_.sfnode::value().get()) { + me->children_.clear(); + } else if (this->children_.empty() + || this->children_[0] != shape_.sfnode::value()) { + // if we have not set the child, or the child has changed. + me->children_.assign(1, shape_.sfnode::value()); + } + return children_; + } + + /** + * @brief Determine whether the node ha... [truncated message content] |
From: <br...@us...> - 2008-09-24 23:32:38
|
Revision: 3691 http://openvrml.svn.sourceforge.net/openvrml/?rev=3691&view=rev Author: braden Date: 2008-09-24 23:32:24 +0000 (Wed, 24 Sep 2008) Log Message: ----------- Moved dlopen/LoadLibrary wrapper functions, the XML parser wrapper, and the uri class to the openvrml::local namespace. This facilitates breaking up browser.cpp a bit. openvrml::scene has been moved to its own header and implementation file and the openvrml::script implementation has been moved back to its own file. Modified Paths: -------------- trunk/ChangeLog trunk/src/Makefile.am trunk/src/libopenvrml/openvrml/browser.cpp trunk/src/libopenvrml/openvrml/browser.h trunk/src/libopenvrml/openvrml/node.cpp trunk/src/libopenvrml/openvrml/node.h trunk/src/libopenvrml/openvrml/script.h trunk/src/libopenvrml/private.h trunk/src/node/vrml97/anchor.cpp trunk/src/node/vrml97/audio_clip.cpp trunk/src/node/vrml97/background.cpp trunk/src/node/vrml97/image_texture.cpp trunk/src/node/vrml97/inline.cpp trunk/src/node/vrml97/movie_texture.cpp trunk/src/node/vrml97/point_light.cpp trunk/src/node/vrml97/spot_light.cpp trunk/src/node/vrml97/time_sensor.cpp trunk/src/node/vrml97/viewpoint.cpp trunk/src/script/java.cpp trunk/src/script/javascript.cpp Added Paths: ----------- trunk/src/libopenvrml/openvrml/bad_url.cpp trunk/src/libopenvrml/openvrml/bad_url.h trunk/src/libopenvrml/openvrml/local/ trunk/src/libopenvrml/openvrml/local/dl.cpp trunk/src/libopenvrml/openvrml/local/dl.h trunk/src/libopenvrml/openvrml/local/uri.cpp trunk/src/libopenvrml/openvrml/local/uri.h trunk/src/libopenvrml/openvrml/local/xml_reader.cpp trunk/src/libopenvrml/openvrml/local/xml_reader.h trunk/src/libopenvrml/openvrml/scene.cpp trunk/src/libopenvrml/openvrml/scene.h trunk/src/libopenvrml/openvrml/script.cpp Removed Paths: ------------- trunk/src/libopenvrml/openvrml/local/dl.cpp trunk/src/libopenvrml/openvrml/local/dl.h trunk/src/libopenvrml/openvrml/local/uri.cpp trunk/src/libopenvrml/openvrml/local/uri.h trunk/src/libopenvrml/openvrml/local/xml_reader.cpp trunk/src/libopenvrml/openvrml/local/xml_reader.h Property Changed: ---------------- trunk/ trunk/src/node/x3d-core/metadata_double.cpp trunk/src/node/x3d-core/metadata_double.h trunk/src/node/x3d-core/metadata_float.cpp trunk/src/node/x3d-core/metadata_float.h trunk/src/node/x3d-core/metadata_integer.cpp trunk/src/node/x3d-core/metadata_integer.h trunk/src/node/x3d-core/metadata_set.cpp trunk/src/node/x3d-core/metadata_set.h trunk/src/node/x3d-core/metadata_string.cpp trunk/src/node/x3d-core/metadata_string.h trunk/src/node/x3d-dis/espdu_transform.cpp trunk/src/node/x3d-dis/espdu_transform.h trunk/src/node/x3d-dis/receiver_pdu.cpp trunk/src/node/x3d-dis/receiver_pdu.h trunk/src/node/x3d-dis/signal_pdu.cpp trunk/src/node/x3d-dis/signal_pdu.h trunk/src/node/x3d-dis/transmitter_pdu.cpp trunk/src/node/x3d-dis/transmitter_pdu.h trunk/src/node/x3d-environmental-effects/texture_background.cpp trunk/src/node/x3d-environmental-effects/texture_background.h trunk/src/node/x3d-event-utilities/boolean_filter.cpp trunk/src/node/x3d-event-utilities/boolean_filter.h trunk/src/node/x3d-event-utilities/boolean_sequencer.cpp trunk/src/node/x3d-event-utilities/boolean_sequencer.h trunk/src/node/x3d-event-utilities/boolean_toggle.cpp trunk/src/node/x3d-event-utilities/boolean_toggle.h trunk/src/node/x3d-event-utilities/boolean_trigger.cpp trunk/src/node/x3d-event-utilities/boolean_trigger.h trunk/src/node/x3d-event-utilities/integer_sequencer.cpp trunk/src/node/x3d-event-utilities/integer_sequencer.h trunk/src/node/x3d-event-utilities/integer_trigger.cpp trunk/src/node/x3d-event-utilities/integer_trigger.h trunk/src/node/x3d-event-utilities/time_trigger.cpp trunk/src/node/x3d-event-utilities/time_trigger.h trunk/src/node/x3d-geometry2d/arc2d.cpp trunk/src/node/x3d-geometry2d/arc2d.h trunk/src/node/x3d-geometry2d/arc_close2d.cpp trunk/src/node/x3d-geometry2d/arc_close2d.h trunk/src/node/x3d-geometry2d/circle2d.cpp trunk/src/node/x3d-geometry2d/circle2d.h trunk/src/node/x3d-geometry2d/disk2d.cpp trunk/src/node/x3d-geometry2d/disk2d.h trunk/src/node/x3d-geometry2d/polyline2d.cpp trunk/src/node/x3d-geometry2d/polyline2d.h trunk/src/node/x3d-geometry2d/polypoint2d.cpp trunk/src/node/x3d-geometry2d/polypoint2d.h trunk/src/node/x3d-geometry2d/rectangle2d.cpp trunk/src/node/x3d-geometry2d/rectangle2d.h trunk/src/node/x3d-geometry2d/triangle_set2d.cpp trunk/src/node/x3d-geometry2d/triangle_set2d.h trunk/src/node/x3d-geospatial/geo_coordinate.cpp trunk/src/node/x3d-geospatial/geo_coordinate.h trunk/src/node/x3d-geospatial/geo_elevation_grid.cpp trunk/src/node/x3d-geospatial/geo_elevation_grid.h trunk/src/node/x3d-geospatial/geo_location.cpp trunk/src/node/x3d-geospatial/geo_location.h trunk/src/node/x3d-geospatial/geo_lod.cpp trunk/src/node/x3d-geospatial/geo_lod.h trunk/src/node/x3d-geospatial/geo_metadata.cpp trunk/src/node/x3d-geospatial/geo_metadata.h trunk/src/node/x3d-geospatial/geo_origin.cpp trunk/src/node/x3d-geospatial/geo_origin.h trunk/src/node/x3d-geospatial/geo_position_interpolator.cpp trunk/src/node/x3d-geospatial/geo_position_interpolator.h trunk/src/node/x3d-geospatial/geo_touch_sensor.cpp trunk/src/node/x3d-geospatial/geo_touch_sensor.h trunk/src/node/x3d-geospatial/geo_viewpoint.cpp trunk/src/node/x3d-geospatial/geo_viewpoint.h trunk/src/node/x3d-grouping/static_group.cpp trunk/src/node/x3d-grouping/static_group.h trunk/src/node/x3d-h-anim/h_anim_displacer.cpp trunk/src/node/x3d-h-anim/h_anim_displacer.h trunk/src/node/x3d-h-anim/h_anim_humanoid.cpp trunk/src/node/x3d-h-anim/h_anim_humanoid.h trunk/src/node/x3d-h-anim/h_anim_joint.cpp trunk/src/node/x3d-h-anim/h_anim_joint.h trunk/src/node/x3d-h-anim/h_anim_segment.cpp trunk/src/node/x3d-h-anim/h_anim_segment.h trunk/src/node/x3d-h-anim/h_anim_site.cpp trunk/src/node/x3d-h-anim/h_anim_site.h trunk/src/node/x3d-interpolation/coordinate_interpolator2d.cpp trunk/src/node/x3d-interpolation/coordinate_interpolator2d.h trunk/src/node/x3d-interpolation/position_interpolator2d.cpp trunk/src/node/x3d-interpolation/position_interpolator2d.h trunk/src/node/x3d-key-device-sensor/key_sensor.cpp trunk/src/node/x3d-key-device-sensor/key_sensor.h trunk/src/node/x3d-key-device-sensor/string_sensor.cpp trunk/src/node/x3d-key-device-sensor/string_sensor.h trunk/src/node/x3d-networking/load_sensor.cpp trunk/src/node/x3d-networking/load_sensor.h trunk/src/node/x3d-rendering/color_rgba.cpp trunk/src/node/x3d-rendering/color_rgba.h trunk/src/node/x3d-rendering/indexed_triangle_fan_set.cpp trunk/src/node/x3d-rendering/indexed_triangle_fan_set.h trunk/src/node/x3d-rendering/indexed_triangle_set.cpp trunk/src/node/x3d-rendering/indexed_triangle_set.h trunk/src/node/x3d-rendering/indexed_triangle_strip_set.cpp trunk/src/node/x3d-rendering/indexed_triangle_strip_set.h trunk/src/node/x3d-rendering/triangle_fan_set.cpp trunk/src/node/x3d-rendering/triangle_fan_set.h trunk/src/node/x3d-rendering/triangle_set.cpp trunk/src/node/x3d-rendering/triangle_set.h trunk/src/node/x3d-rendering/triangle_strip_set.cpp trunk/src/node/x3d-rendering/triangle_strip_set.h trunk/src/node/x3d-shape/fill_properties.cpp trunk/src/node/x3d-shape/fill_properties.h trunk/src/node/x3d-shape/line_properties.cpp trunk/src/node/x3d-shape/line_properties.h trunk/src/node/x3d-texturing/multi_texture.cpp trunk/src/node/x3d-texturing/multi_texture.h trunk/src/node/x3d-texturing/multi_texture_coordinate.cpp trunk/src/node/x3d-texturing/multi_texture_coordinate.h trunk/src/node/x3d-texturing/multi_texture_transform.cpp trunk/src/node/x3d-texturing/multi_texture_transform.h trunk/src/node/x3d-texturing/texture_coordinate_generator.cpp trunk/src/node/x3d-texturing/texture_coordinate_generator.h Property changes on: trunk ___________________________________________________________________ Modified: svn:mergeinfo - /branches/node-modules:3622-3623,3632-3635,3637-3638,3640-3641,3643-3644,3646-3647,3649-3650,3654-3655,3657-3658,3661-3662,3664-3665,3667-3668,3670-3671,3673-3674,3684-3685,3687-3688 + /branches/local:3677-3689 /branches/node-modules:3622-3623,3632-3635,3637-3638,3640-3641,3643-3644,3646-3647,3649-3650,3654-3655,3657-3658,3661-3662,3664-3665,3667-3668,3670-3671,3673-3674,3684-3685,3687-3688 Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-09-24 23:31:55 UTC (rev 3690) +++ trunk/ChangeLog 2008-09-24 23:32:24 UTC (rev 3691) @@ -1,5 +1,79 @@ 2008-09-24 Braden McDaniel <br...@en...> + Moved dlopen/LoadLibrary wrapper functions, the XML parser + wrapper, and the uri class to the openvrml::local namespace. This + facilitates breaking up browser.cpp a bit. openvrml::scene has + been moved to its own header and implementation file and the + openvrml::script implementation has been moved back to its own + file. + + * src/Makefile.am + (openvrml_include_HEADERS): Added libopenvrml/openvrml/bad_url.h + and libopenvrml/openvrml/scene.h. + (libopenvrml_libopenvrml_la_SOURCES): Added + libopenvrml/openvrml/bad_url.cpp, libopenvrml/openvrml/script.cpp, + libopenvrml/openvrml/scene.cpp, + libopenvrml/openvrml/local/dl.{cpp,h}, + libopenvrml/openvrml/uri.{cpp,h}, and + libopenvrml/openvrml/local/xml_reader.{cpp,h}. + * src/libopenvrml/private.h: Moved URI grammar to + libopenvrml/openvrml/local/uri.h. + * src/libopenvrml/openvrml/bad_url.cpp: Implementation of + openvrml::bad_url and derived exceptions; moved from browser.cpp. + * src/libopenvrml/openvrml/bad_url.h: openvrml::bad_url and + derived exceptions; moved from browser.h. + * src/libopenvrml/openvrml/browser.cpp: Moved dlopen/LoadLibrary + wrapper functions to libopenvrml/openvrml/local/dl.cpp; moved uri + class implementation to libopenvrml/openvrml/local/uri.cpp; moved + xml_reader class implementation to + libopenvrml/openvrml/local/xml_reader.cpp; moved script_node + implementation to libopenvrml/openvrml/script.cpp. + * src/libopenvrml/openvrml/browser.h: Moved openvrml::script_node + definition to libopenvrml/openvrml/script.h; moved definition of + openvrml::bad_url and derived exceptions to + libopenvrml/openvrml/bad_url.h. + * src/libopenvrml/openvrml/local/dl.cpp: Added; dlopen/LoadLibrary + wrapper function definitions. + * src/libopenvrml/openvrml/local/dl.h: Added; dlopen/LoadLibrary + wrapper function declarations (moved from + libopenvrml/openvrml/browser.cpp). + * src/libopenvrml/openvrml/local/uri.cpp: Added; uri class + implementation (moved from libopenvrml/openvrml/browser.cpp). + * src/libopenvrml/openvrml/local/uri.h: Added; uri class + definition and grammar definitions (moved from + libopenvrml/openvrml/browser.cpp and libopenvrml/private.h). + * src/libopenvrml/openvrml/local/xml_reader.cpp: Added; xml_reader + implementation (moved from libopenvrml/openvrml/browser.cpp). + * src/libopenvrml/openvrml/local/xml_reader.h: Added; xml_reader + class definition (moved from libopenvrml/openvrml/browser.cpp). + * src/libopenvrml/openvrml/node.cpp: Include scope.h here rather + than in node.h. + * src/libopenvrml/openvrml/node.h: Declare openvrml::scope rather + than include scope.h here. + * src/libopenvrml/openvrml/scene.cpp: Added; openvrml::scene + implementation (moved from libopenvrml/openvrml/browser.cpp). + * src/libopenvrml/openvrml/scene.h: Added; openvrml::scene + definition (moved from libopenvrml/openvrml/browser.h). + * src/libopenvrml/openvrml/script.cpp: Added; openvrml::script and + openvrml::script_node implementations (moved from + libopenvrml/openvrml/browser.cpp). + * src/libopenvrml/openvrml/script.h: Moved openvrml::script_node + definition here (from libopenvrml/openvrml/browser.h). + * src/node/vrml97/movie_texture.cpp: Include <openvrml/scene.h>. + * src/node/vrml97/audio_clip.cpp: Include <openvrml/scene.h>. + * src/node/vrml97/anchor.cpp: Include <openvrml/scene.h>. + * src/node/vrml97/inline.cpp: Include <openvrml/scene.h>. + * src/node/vrml97/time_sensor.cpp: Include <openvrml/scene.h>. + * src/node/vrml97/image_texture.cpp: Include <openvrml/scene.h>. + * src/node/vrml97/spot_light.cpp: Include <openvrml/scene.h>. + * src/node/vrml97/background.cpp: Include <openvrml/scene.h>. + * src/node/vrml97/point_light.cpp: Include <openvrml/scene.h>. + * src/node/vrml97/viewpoint.cpp: Include <openvrml/scene.h>. + * src/script/java.cpp: Include <openvrml/scene.h>. + * src/script/javascript.cpp: Include <openvrml/scene.h>. + +2008-09-24 Braden McDaniel <br...@en...> + Moved X3D CAD Geometry node implementations into a convenience library. Modified: trunk/src/Makefile.am =================================================================== --- trunk/src/Makefile.am 2008-09-24 23:31:55 UTC (rev 3690) +++ trunk/src/Makefile.am 2008-09-24 23:32:24 UTC (rev 3691) @@ -37,6 +37,7 @@ openvrml_includedir = $(pkgincludedir)/openvrml openvrml_include_HEADERS = \ + libopenvrml/openvrml/bad_url.h \ libopenvrml/openvrml/basetypes.h \ libopenvrml/openvrml/vrml97_grammar.h \ libopenvrml/openvrml/x3d_vrml_grammar.h \ @@ -48,6 +49,7 @@ libopenvrml/openvrml/node.h \ libopenvrml/openvrml/bounding_volume.h \ libopenvrml/openvrml/script.h \ + libopenvrml/openvrml/scene.h \ libopenvrml/openvrml/browser.h \ libopenvrml/openvrml/viewer.h \ libopenvrml/openvrml/rendering_context.h \ @@ -113,6 +115,7 @@ $(XML_CFLAGS) libopenvrml_libopenvrml_la_SOURCES = \ + libopenvrml/openvrml/bad_url.cpp \ libopenvrml/openvrml/vrml97_grammar.cpp \ libopenvrml/openvrml/x3d_vrml_grammar.cpp \ libopenvrml/openvrml/read_write_mutex.cpp \ @@ -122,7 +125,9 @@ libopenvrml/openvrml/exposedfield.cpp \ libopenvrml/openvrml/scope.cpp \ libopenvrml/openvrml/node.cpp \ + libopenvrml/openvrml/script.cpp \ libopenvrml/openvrml/bounding_volume.cpp \ + libopenvrml/openvrml/scene.cpp \ libopenvrml/openvrml/browser.cpp \ libopenvrml/openvrml/viewer.cpp \ libopenvrml/openvrml/rendering_context.cpp \ @@ -144,7 +149,13 @@ libopenvrml/openvrml/x3d_geospatial.cpp \ libopenvrml/openvrml/x3d_hanim.cpp \ libopenvrml/openvrml/x3d_nurbs.cpp \ - libopenvrml/openvrml/x3d_cad_geometry.cpp + libopenvrml/openvrml/x3d_cad_geometry.cpp \ + libopenvrml/openvrml/local/dl.cpp \ + libopenvrml/openvrml/local/dl.h \ + libopenvrml/openvrml/local/uri.cpp \ + libopenvrml/openvrml/local/uri.h \ + libopenvrml/openvrml/local/xml_reader.cpp \ + libopenvrml/openvrml/local/xml_reader.h libopenvrml_libopenvrml_la_LDFLAGS = \ -version-info $(LIBOPENVRML_LIBRARY_VERSION) \ Copied: trunk/src/libopenvrml/openvrml/bad_url.cpp (from rev 3689, branches/local/src/libopenvrml/openvrml/bad_url.cpp) =================================================================== --- trunk/src/libopenvrml/openvrml/bad_url.cpp (rev 0) +++ trunk/src/libopenvrml/openvrml/bad_url.cpp 2008-09-24 23:32:24 UTC (rev 3691) @@ -0,0 +1,136 @@ +// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 78 -*- +// +// OpenVRML +// +// Copyright 2008 Braden McDaniel +// +// This library is free software; you can redistribute it and/or modify it +// under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 3 of the License, or (at your +// option) any later version. +// +// This library 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 Lesser General Public +// License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this library; if not, see <http://www.gnu.org/licenses/>. +// + +# include "bad_url.h" + +# ifdef HAVE_CONFIG_H +# include <config.h> +# endif + +/** + * @file openvrml/bad_url.h + * + * @brief Exceptions indicating various types of resource retrieval failure. + */ + +/** + * @class openvrml::bad_url openvrml/bad_url.h + * + * @brief Thrown when there is a problem resolving a URI. + */ + +/** + * @brief Construct. + * + * @param[in] message Informative text. + */ +openvrml::bad_url::bad_url(const std::string & message): + std::runtime_error(message) +{} + +/** + * @brief Destroy. + */ +openvrml::bad_url::~bad_url() throw () +{} + + +/** + * @class openvrml::invalid_url openvrml/bad_url.h + * + * @brief Thrown when parsing a URI fails. + */ + +/** + * @brief Construct. + */ +openvrml::invalid_url::invalid_url(): + bad_url("invalid URI") +{} + +/** + * @brief Destroy. + */ +openvrml::invalid_url::~invalid_url() throw () +{} + + +/** + * @class openvrml::bad_media_type openvrml/bad_url.h + * + * @brief Thrown when an unexpected media type is received. + */ + +/** + * @brief Construct. + * + * @param[in] received_type the media type that was unexpectedly received. + */ +openvrml::bad_media_type::bad_media_type(const std::string & received_type) + OPENVRML_NOTHROW: + bad_url("unexpected media type \"" + received_type + "\"") +{} + +/** + * @brief Destroy. + */ +openvrml::bad_media_type::~bad_media_type() throw () +{} + + +/** + * @class openvrml::unreachable_url openvrml/browser.h + * + * @brief Thrown when a URI cannot be reached. + */ + +/** + * @brief Construct. + */ +openvrml::unreachable_url::unreachable_url(): + bad_url("unreachable URI") +{} + +/** + * @brief Destroy. + */ +openvrml::unreachable_url::~unreachable_url() throw () +{} + + +/** + * @class openvrml::no_alternative_url openvrml/bad_url.h + * + * @brief Exception thrown when no URI in an alternative URI list can be + * resolved. + */ + +/** + * @brief Construct. + */ +openvrml::no_alternative_url::no_alternative_url(): + bad_url("no alternative URI could be resolved") +{} + +/** + * @brief Destroy. + */ +openvrml::no_alternative_url::~no_alternative_url() throw () +{} Copied: trunk/src/libopenvrml/openvrml/bad_url.h (from rev 3689, branches/local/src/libopenvrml/openvrml/bad_url.h) =================================================================== --- trunk/src/libopenvrml/openvrml/bad_url.h (rev 0) +++ trunk/src/libopenvrml/openvrml/bad_url.h 2008-09-24 23:32:24 UTC (rev 3691) @@ -0,0 +1,66 @@ +// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 78 -*- +// +// OpenVRML +// +// Copyright 2008 Braden McDaniel +// +// This library is free software; you can redistribute it and/or modify it +// under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 3 of the License, or (at your +// option) any later version. +// +// This library 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 Lesser General Public +// License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this library; if not, see <http://www.gnu.org/licenses/>. +// + +# ifndef OPENVRML_BAD_URL_H +# define OPENVRML_BAD_URL_H + +# include <openvrml-common.h> +# include <stdexcept> +# include <string> + +namespace openvrml { + + class OPENVRML_API bad_url : public std::runtime_error { + public: + bad_url(const std::string & message); + virtual ~bad_url() throw (); + }; + + + class OPENVRML_API invalid_url : public bad_url { + public: + invalid_url(); + virtual ~invalid_url() throw (); + }; + + + class OPENVRML_API bad_media_type : public bad_url { + public: + explicit bad_media_type(const std::string & received_type) + OPENVRML_NOTHROW; + virtual ~bad_media_type() throw (); + }; + + + class OPENVRML_API unreachable_url : public bad_url { + public: + unreachable_url(); + virtual ~unreachable_url() throw (); + }; + + + class OPENVRML_API no_alternative_url : public bad_url { + public: + no_alternative_url(); + virtual ~no_alternative_url() throw (); + }; +} + +# endif // ifndef OPENVRML_BAD_URL_H Modified: trunk/src/libopenvrml/openvrml/browser.cpp =================================================================== --- trunk/src/libopenvrml/openvrml/browser.cpp 2008-09-24 23:31:55 UTC (rev 3690) +++ trunk/src/libopenvrml/openvrml/browser.cpp 2008-09-24 23:32:24 UTC (rev 3691) @@ -19,40 +19,9 @@ // along with this library; if not, see <http://www.gnu.org/licenses/>. // -# ifdef HAVE_CONFIG_H -# include <config.h> -# endif - -# include <cerrno> -# include <algorithm> -# include <functional> -# ifdef _WIN32 -# include <sys/timeb.h> -# include <direct.h> -# include <time.h> -# include <shlwapi.h> -# include <XmlLite.h> -# else -# include <sys/time.h> -# include <ltdl.h> -# include <libxml/xmlreader.h> -# endif -# include <boost/algorithm/string/predicate.hpp> -# include <boost/array.hpp> -# include <boost/bind.hpp> -# include <boost/enable_shared_from_this.hpp> -# include <boost/filesystem.hpp> -# include <boost/functional.hpp> -# include <boost/lexical_cast.hpp> -# include <boost/mpl/for_each.hpp> -# include <boost/multi_index/detail/scope_guard.hpp> -# include <boost/ptr_container/ptr_map.hpp> -# include <boost/thread/thread.hpp> -# include <boost/tokenizer.hpp> -# include <boost/utility.hpp> -# include <private.h> # include "browser.h" -# include "vrml97_grammar.h" +# include "scene.h" +# include "scope.h" # include "x3d_vrml_grammar.h" # include "vrml97node.h" # include "x3d_core.h" @@ -71,2999 +40,38 @@ # include "x3d_hanim.h" # include "x3d_nurbs.h" # include "x3d_cad_geometry.h" - -using namespace boost::multi_index::detail; // for scope_guard - -namespace { - - class OPENVRML_LOCAL uri { - class actions { - uri * uri_; - - public: - explicit actions(uri & uri_): - uri_(&uri_), - scheme(*this), - scheme_specific_part(*this), - authority(*this), - userinfo(*this), - host(*this), - port(*this), - path(*this), - query(*this), - fragment(*this) - {} - - struct scheme_action { - explicit scheme_action(actions & actions_): - actions_(&actions_) - {} - - template <typename Iterator> - void operator()(const Iterator & first, - const Iterator & last) const - { - this->actions_->uri_->scheme_begin = first; - this->actions_->uri_->scheme_end = last; - } - - private: - actions * actions_; - } scheme; - - struct scheme_specific_part_action { - explicit scheme_specific_part_action(actions & actions_): - actions_(&actions_) - {} - - template <typename Iterator> - void operator()(const Iterator & first, - const Iterator & last) const - { - this->actions_->uri_->scheme_specific_part_begin = first; - this->actions_->uri_->scheme_specific_part_end = last; - } - - private: - actions * actions_; - } scheme_specific_part; - - struct authority_action { - explicit authority_action(actions & actions_): - actions_(&actions_) - {} - - template <typename Iterator> - void operator()(const Iterator & first, - const Iterator & last) const - { - this->actions_->uri_->authority_begin = first; - this->actions_->uri_->authority_end = last; - } - - private: - actions * actions_; - } authority; - - struct userinfo_action { - explicit userinfo_action(actions & actions_): - actions_(&actions_) - {} - - template <typename Iterator> - void operator()(const Iterator & first, - const Iterator & last) const - { - this->actions_->uri_->userinfo_begin = first; - this->actions_->uri_->userinfo_end = last; - } - - private: - actions * actions_; - } userinfo; - - struct host_action { - explicit host_action(actions & actions_): - actions_(&actions_) - {} - - template <typename Iterator> - void operator()(const Iterator & first, - const Iterator & last) const - { - this->actions_->uri_->host_begin = first; - this->actions_->uri_->host_end = last; - } - - private: - actions * actions_; - } host; - - struct port_action { - explicit port_action(actions & actions_): - actions_(&actions_) - {} - - template <typename Iterator> - void operator()(const Iterator & first, - const Iterator & last) const - { - this->actions_->uri_->port_begin = first; - this->actions_->uri_->port_end = last; - } - - private: - actions * actions_; - } port; - - struct path_action { - explicit path_action(actions & actions_): - actions_(&actions_) - {} - - template <typename Iterator> - void operator()(const Iterator & first, - const Iterator & last) const - { - this->actions_->uri_->path_begin = first; - this->actions_->uri_->path_end = last; - } - - private: - actions * actions_; - } path; - - struct query_action { - explicit query_action(actions & actions_): - actions_(&actions_) - {} - - template <typename Iterator> - void operator()(const Iterator & first, - const Iterator & last) const - { - this->actions_->uri_->query_begin = first; - this->actions_->uri_->query_end = last; - } - - private: - actions * actions_; - } query; - - struct fragment_action { - explicit fragment_action(actions & actions_): - actions_(&actions_) - {} - - template <typename Iterator> - void operator()(const Iterator & first, - const Iterator & last) const - { - this->actions_->uri_->fragment_begin = first; - this->actions_->uri_->fragment_end = last; - } - - private: - actions * actions_; - } fragment; - }; - - std::string str_; - std::string::const_iterator scheme_begin, scheme_end; - std::string::const_iterator scheme_specific_part_begin, - scheme_specific_part_end; - std::string::const_iterator authority_begin, authority_end; - std::string::const_iterator userinfo_begin, userinfo_end; - std::string::const_iterator host_begin, host_end; - std::string::const_iterator port_begin, port_end; - std::string::const_iterator path_begin, path_end; - std::string::const_iterator query_begin, query_end; - std::string::const_iterator fragment_begin, fragment_end; - - public: - uri() OPENVRML_THROW1(std::bad_alloc); - explicit uri(const std::string & str) - OPENVRML_THROW2(openvrml::invalid_url, std::bad_alloc); - uri(const uri & id) OPENVRML_THROW1(std::bad_alloc); - - uri & operator=(const uri & id) OPENVRML_THROW1(std::bad_alloc); - - operator std::string() const OPENVRML_THROW1(std::bad_alloc); - - void swap(uri & id) OPENVRML_NOTHROW; - - const std::string scheme() const OPENVRML_THROW1(std::bad_alloc); - const std::string scheme_specific_part() const - OPENVRML_THROW1(std::bad_alloc); - const std::string authority() const OPENVRML_THROW1(std::bad_alloc); - const std::string userinfo() const OPENVRML_THROW1(std::bad_alloc); - const std::string host() const OPENVRML_THROW1(std::bad_alloc); - const std::string port() const OPENVRML_THROW1(std::bad_alloc); - const std::string path() const OPENVRML_THROW1(std::bad_alloc); - const std::string query() const OPENVRML_THROW1(std::bad_alloc); - const std::string fragment() const OPENVRML_THROW1(std::bad_alloc); - - const uri resolve_against(const uri & absolute_uri) const - OPENVRML_THROW1(std::bad_alloc); - }; - - OPENVRML_LOCAL inline bool relative(const uri & id) - { - return id.scheme().empty(); - } -} - - /** - * @file openvrml/script.h - * - * @brief Pluggable scripting engine support. - */ - -/** - * @class openvrml::script openvrml/script.h - * - * @brief Abstract class implemented by scripting language bindings. - * - * The runtime instantiates subclasses of script for each VRML97 Script node; - * and calls its methods appropriately to execute script code. - */ - -/** - * @internal - * - * @typedef openvrml::script::direct_output_map_t - * - * @brief Map of direct outputs. - */ - -/** - * @internal - * - * @var openvrml::script::direct_output_map_t openvrml::script::direct_output_map_ - * - * @brief Map of direct outputs. - */ - -/** - * @var openvrml::script_node & openvrml::script::node - * - * @brief A reference to the script_node that uses this script object. - */ - -/** - * @brief Construct. - * - * @param[in] node a reference to the script_node that uses this script object. - */ -openvrml::script::script(script_node & node): - node(node) -{} - -/** - * @brief Destroy. - */ -openvrml::script::~script() -{} - -/** - * @brief Initialize the Script node. - * - * Delegates to @c script::do_initialize. - * - * @param[in] timestamp the current time. - */ -void openvrml::script::initialize(double timestamp) -{ - this->do_initialize(timestamp); - this->process_direct_output(timestamp); -} - -/** - * @fn void openvrml::script::do_initialize(double timestamp) - * - * @brief Initialize the Script node. - * - * @param[in] timestamp the current time. - */ - -/** - * @brief Process an event. - * - * Delegates to @c script::do_process_event. - * - * @param[in] id eventIn identifier. - * @param[in] value event value. - * @param[in] timestamp the current time. - */ -void openvrml::script::process_event(const std::string & id, - const field_value & value, - double timestamp) -{ - this->do_process_event(id, value, timestamp); - this->process_direct_output(timestamp); -} - -/** - * @fn void openvrml::script::do_process_event(const std::string & id, const field_value & value, double timestamp) - * - * @brief Process an event. - * - * @param[in] id @c eventIn identifier. - * @param[in] value event value. - * @param[in] timestamp the current time. - */ - -/** - * @brief Execute script code after processing events. - * - * Delegates to @c script::do_events_processed. - * - * @param[in] timestamp the current time. - */ -void openvrml::script::events_processed(double timestamp) -{ - this->do_events_processed(timestamp); -} - -/** - * @fn void openvrml::script::do_events_processed(double timestamp) - * - * @brief Execute script code after processing events. - * - * @param[in] timestamp the current time. - */ - -/** - * @brief Shut down the Script node. - * - * Delegates to <code>script::do_shutdown</code>. - * - * @param[in] timestamp the current time. - */ -void openvrml::script::shutdown(double timestamp) -{ - this->do_shutdown(timestamp); - this->process_direct_output(timestamp); -} - -/** - * @fn void openvrml::script::do_shutdown(double timestamp) - * - * @brief Shut down the Script node. - * - * @param[in] timestamp the current time. - */ - -/** - * @brief Whether direct output is enabled for the Script node. - * - * @return @c true if direct output is enabled for the Script node; @c false - * otherwise. - */ -bool openvrml::script::direct_output() const OPENVRML_NOTHROW -{ - return this->node.direct_output.value(); -} - -/** - * @brief Whether the browser may delay sending input events to the script - * until its outputs are needed by the browser. - * - * @return @c true if the browser may delay sending input events to the script - * until its outputs are needed by the browser; @c false otherwise. - */ -bool openvrml::script::must_evaluate() const OPENVRML_NOTHROW -{ - return this->node.must_evaluate.value(); -} - -/** - * @brief Set the value of a field. - * - * @param[in] id field identifier. - * @param[in] value new value. - * - * @exception unsupported_interface if the Script node has no field @p id. - * @exception std::bad_cast if @p value is the wrong type. - * @exception std::bad_alloc if memory allocation fails. - */ -void openvrml::script::field(const std::string & id, const field_value & value) - OPENVRML_THROW3(unsupported_interface, std::bad_cast, std::bad_alloc) -{ - const script_node::field_value_map_t::iterator field = - this->node.field_value_map_.find(id); - if (field == this->node.field_value_map_.end()) { - throw unsupported_interface(this->node.type_, - node_interface::field_id, - id); - } - field->second->assign(value); // throws std::bad_cast, std::bad_alloc -} - -/** - * @brief Add an event for direct output processing at the end of script - * execution. - * - * @param[in] listener the @c event_listener to which the event should be - * sent. - * @param[in] value the value to send. - * - * @exception field_value_type_mismatch if @p listener is not the correct type - * to process events of @p value's type. - * @exception std::bad_alloc if memory allocation fails. - */ -void -openvrml::script::direct_output(event_listener & listener, - const boost::shared_ptr<field_value> & value) - OPENVRML_THROW2(field_value_type_mismatch, std::bad_alloc) -{ - assert(value); - if (listener.type() != value->type()) { - throw field_value_type_mismatch(); - } - this->direct_output_map_[&listener] = value; -} - -namespace { - struct OPENVRML_LOCAL direct_output_processor { - direct_output_processor(openvrml::event_listener & listener, - openvrml::field_value & value, - const double timestamp): - listener_(&listener), - value_(&value), - timestamp_(timestamp) - {} - - template <typename T> - void operator()(T) const - { - if (T::field_value_type_id == this->listener_->type()) { - using boost::polymorphic_downcast; - using openvrml::field_value_listener; - dynamic_cast<field_value_listener<T> &>(*this->listener_) - .process_event(*polymorphic_downcast<T *>(this->value_), - this->timestamp_); - } - } - - private: - openvrml::event_listener * listener_; - openvrml::field_value * value_; - double timestamp_; - }; -} - -/** - * @internal - * - * @brief Process direct outputs in @a script::direct_output_map_. - * - * This function is called at the end of initialization and processing normal - * events. - * - * @post <code>script::direct_output_map_.empty()</code> is @c true. - */ -void openvrml::script::process_direct_output(double timestamp) -{ - for (direct_output_map_t::const_iterator output = - this->direct_output_map_.begin(); - output != this->direct_output_map_.end(); - ++output) { - using boost::mpl::for_each; - using openvrml_::field_value_types; - for_each<field_value_types>(direct_output_processor(*output->first, - *output->second, - timestamp)); - } - this->direct_output_map_.clear(); -} - - -/** - * @class openvrml::script_factory - * - * @brief An abstract factory for @c script%s. - */ - -/** - * @brief Construct. - */ -openvrml::script_factory::script_factory() OPENVRML_NOTHROW -{} - -/** - * @brief Destroy. - */ -openvrml::script_factory::~script_factory() OPENVRML_NOTHROW -{} - -/** - * @fn std::auto_ptr<openvrml::script> openvrml::script_factory::create_script(script_node & node, const boost::shared_ptr<std::istream> & source) - * - * @brief Create a @c script. - * - * Implementations of this function are called in the implementation of - * @c script_node. A @c script instance is created to encapsulate scripting - * logic in a Script node instance. - */ - -/** - * @class openvrml::script_factory_registry - * - * @brief Registry of - * <code>@link script_factory script_factories@endlink</code>. - * - * In general there should be one @c script_factory registered per - * “scripting engine”; i.e., supported language in the Script - * node. An instance of the @c script_factory_registry is passed to - * @c openvrml_register_script_factory, which should be implemented by - * modules that add support for a scripting language. - */ - -/** - * @internal - * - * @var class script_factory_registry::script_node - * - * @brief @c script_node is the only class that should ever need to - * instantiate @c script_factory_registry. - */ - -namespace { - +# include <openvrml/local/uri.h> +# include <openvrml/local/xml_reader.h> +# include <private.h> +# include <boost/algorithm/string/predicate.hpp> +# include <boost/bind.hpp> +# include <boost/enable_shared_from_this.hpp> +# include <boost/filesystem.hpp> +# include <boost/functional.hpp> +# include <boost/lexical_cast.hpp> +# include <boost/mpl/for_each.hpp> +# include <boost/multi_index/detail/scope_guard.hpp> +# include <boost/ptr_container/ptr_map.hpp> +# include <boost/thread/thread.hpp> +# include <boost/utility.hpp> +# include <algorithm> +# include <functional> +# include <cerrno> # ifdef _WIN32 - const char pathsep_char = ';'; +# include <sys/timeb.h> +# include <direct.h> +# include <time.h> # else - const char pathsep_char = ':'; +# include <sys/time.h> # endif - OPENVRML_LOCAL int openvrml_dlinit() - { -# ifdef _WIN32 - return 0; -# else - return lt_dlinit(); +# ifdef HAVE_CONFIG_H +# include <config.h> # endif - } - OPENVRML_LOCAL int openvrml_dlexit() - { -# ifdef _WIN32 - return 0; -# else - return lt_dlexit(); -# endif - } +using namespace boost::multi_index::detail; // for scope_guard - struct OPENVRML_LOCAL win32_search_path_tokenizer { - win32_search_path_tokenizer() - {} - - template <typename Iterator, typename Token> - bool operator()(Iterator & next, Iterator end, Token & tok) - { - while (next != end) { - if (*next == ';') { - ++next; - break; - } - this->tok_.push_back(*next); - ++next; - } - if (!this->tok_.empty()) { - tok = this->tok_; - this->tok_.clear(); - return true; - } - return false; - } - - void reset() - { - this->tok_.clear(); - } - - private: - std::string tok_; - }; - - OPENVRML_LOCAL - int - openvrml_dlforeachfile(const char * search_path, - int (*func)(const char * filename, void * data), - void * data) - { -# ifdef _WIN32 - using boost::filesystem::path; - using boost::filesystem::directory_iterator; - typedef boost::tokenizer<win32_search_path_tokenizer> tokenizer_t; - - std::vector<path> search_dirs; - win32_search_path_tokenizer tokenizer_func; - std::string search_path_str(search_path); - tokenizer_t tokenizer(search_path_str, tokenizer_func); - for (tokenizer_t::const_iterator token = tokenizer.begin(); - token != tokenizer.end(); - ++token) { - search_dirs.push_back(path(*token)); - } - - int result = 0; - for (std::vector<path>::const_iterator dir = search_dirs.begin(); - dir != search_dirs.end(); - ++dir) try { - for (directory_iterator entry(*dir); - entry != directory_iterator(); - ++entry) { - result = (func)(entry->path().external_file_string().c_str(), - data); - if (result != 0) { return result; } - } - } catch (boost::filesystem::filesystem_error &) {} - return result; -# else - return lt_dlforeachfile(search_path, func, data); -# endif - } - -# ifdef _WIN32 - typedef HMODULE openvrml_dlhandle; -# else - typedef lt_dlhandle openvrml_dlhandle; -# endif - - OPENVRML_LOCAL openvrml_dlhandle openvrml_dlopen(const char * filename) - { -# ifdef _WIN32 - const char * last_dot = strrchr(filename, '.'); - if (strcmp(last_dot, ".dll") != 0) { return 0; } - return LoadLibrary(filename); -# else - return lt_dlopenext(filename); -# endif - } - - OPENVRML_LOCAL int openvrml_dlclose(openvrml_dlhandle handle) - { -# ifdef _WIN32 - return FreeLibrary(handle); -# else - return lt_dlclose(handle); -# endif - } - - OPENVRML_LOCAL void * openvrml_dlsym(openvrml_dlhandle handle, - const char * name) - { -# ifdef _WIN32 - return GetProcAddress(handle, name); -# else - return lt_dlsym(handle, name); -# endif - } -} - -extern "C" int openvrml_get_script_factory(const char * filename, void * data); - /** - * @internal - * - * @brief @c script_factory_registry implementation. - * - * @c script_factory_registry uses the p-impl idiom. - */ -class openvrml::script_factory_registry::impl : - boost::noncopyable { - - friend int (::openvrml_get_script_factory)(const char * filename, - void * data); - - typedef std::set<openvrml_dlhandle> module_handle_set; - module_handle_set module_handles_; - - typedef std::map<std::string, boost::shared_ptr<script_factory> > - factory_map; - factory_map media_type_map_; - factory_map uri_scheme_map_; - -public: - impl(); - ~impl() OPENVRML_NOTHROW; - - void register_factories(script_factory_registry & registry); - - bool register_factory( - const std::set<std::string> & media_types, - const std::set<std::string> & uri_schemes, - const boost::shared_ptr<script_factory> & factory) - OPENVRML_THROW2(std::bad_alloc, std::invalid_argument); - - const boost::shared_ptr<script_factory> - find_using_media_type(const std::string & media_type) const; - - const boost::shared_ptr<script_factory> - find_using_uri_scheme(const std::string & uri_scheme) const; -}; - -int openvrml_get_script_factory(const char * const filename, void * data) -{ - assert(data); - - using openvrml::script_factory_registry; - - script_factory_registry::impl & registry = - *static_cast<script_factory_registry::impl *>(data); - - const openvrml_dlhandle handle = openvrml_dlopen(filename); - if (!handle) { return 0; } // Ignore things we can't open. - scope_guard handle_guard = make_guard(openvrml_dlclose, handle); - - // - // Make sure the module has what we're looking for. - // - const void * sym = openvrml_dlsym(handle, - "openvrml_script_LTX_register_factory"); - if (!sym) { return 0; } // handle_guard will close the module. - - const bool succeeded = registry.module_handles_.insert(handle).second; - assert(succeeded); - handle_guard.dismiss(); - return 0; -} - -/** - * @internal - * - * @brief Construct. - */ -openvrml::script_factory_registry::impl::impl() -{ - int result = openvrml_dlinit(); - if (result != 0) { - throw std::runtime_error("dlinit failure"); - } - - std::ostringstream script_path; - script_path << OPENVRML_PKGLIBDIR_ "/script"; - const char * const script_path_env = getenv("OPENVRML_SCRIPT_PATH"); - if (script_path_env) { - script_path << pathsep_char << script_path_env; - } - - result = openvrml_dlforeachfile(script_path.str().c_str(), - openvrml_get_script_factory, - this); - assert(result == 0); // We always return 0 from the callback. -} - -/** - * @internal - * - * @brief Destroy. - */ -openvrml::script_factory_registry::impl::~impl() OPENVRML_NOTHROW -{ - std::for_each(this->module_handles_.begin(), this->module_handles_.end(), - openvrml_dlclose); - openvrml_dlexit(); // Don't care if this fails. What would we do? -} - -void -openvrml::script_factory_registry::impl:: -register_factories(script_factory_registry & registry) -{ - for (module_handle_set::const_iterator handle( - this->module_handles_.begin()); - handle != this->module_handles_.end(); - ++handle) { - void * sym = openvrml_dlsym(*handle, - "openvrml_script_LTX_register_factory"); - assert(sym); // We already made sure this would work. - void (* const register_factory)(script_factory_registry &) = - reinterpret_cast<void (*)(script_factory_registry &)>(sym); - register_factory(registry); - } -} - -namespace { - typedef std::map<std::string, boost::shared_ptr<openvrml::script_factory> > - factory_map_t; - - struct OPENVRML_LOCAL add_factory_entry : std::unary_function<std::string, - void> { - add_factory_entry( - const boost::shared_ptr<openvrml::script_factory> & factory, - factory_map_t & factory_map): - factory_(factory), - factory_map_(&factory_map) - {} - - void operator()(const std::string & id) const - { - const bool succeeded = - this->factory_map_->insert(make_pair(id, this->factory_)) - .second; - assert(succeeded); - } - - private: - const boost::shared_ptr<openvrml::script_factory> factory_; - factory_map_t * const factory_map_; - }; -} - -bool -openvrml::script_factory_registry::impl:: -register_factory(const std::set<std::string> & media_types, - const std::set<std::string> & uri_schemes, - const boost::shared_ptr<script_factory> & factory) - OPENVRML_THROW2(std::bad_alloc, std::invalid_argument) -{ - using std::invalid_argument; - using std::set; - using std::string; - - if (media_types.empty() && uri_schemes.empty()) { - throw invalid_argument("no media types or URI schemes specified"); - } - - if (!factory) { - throw invalid_argument("null script_factory pointer"); - } - - for (set<string>::const_iterator media_type = media_types.begin(); - media_type != media_types.end(); - ++media_type) { - const factory_map::const_iterator pos = - this->media_type_map_.find(*media_type); - if (pos != this->media_type_map_.end()) { return false; } - } - - for (set<string>::const_iterator uri_scheme = uri_schemes.begin(); - uri_scheme != uri_schemes.end(); - ++uri_scheme) { - const factory_map::const_iterator pos = - this->uri_scheme_map_.find(*uri_scheme); - if (pos != this->uri_scheme_map_.end()) { return false; } - } - - std::for_each(media_types.begin(), media_types.end(), - add_factory_entry(factory, this->media_type_map_)); - std::for_each(uri_schemes.begin(), uri_schemes.end(), - add_factory_entry(factory, this->uri_scheme_map_)); - return true; -} - -const boost::shared_ptr<openvrml::script_factory> -openvrml::script_factory_registry::impl:: -find_using_media_type(const std::string & media_type) const -{ - const factory_map::const_iterator pos = - this->media_type_map_.find(media_type); - return (pos != this->media_type_map_.end()) - ? pos->second - : boost::shared_ptr<script_factory>(); -} - -const boost::shared_ptr<openvrml::script_factory> -openvrml::script_factory_registry::impl:: -find_using_uri_scheme(const std::string & uri_scheme) const -{ - const factory_map::const_iterator pos = - this->uri_scheme_map_.find(uri_scheme); - return (pos != this->uri_scheme_map_.end()) - ? pos->second - : boost::shared_ptr<script_factory>(); -} - -/** - * @internal - * - * @brief Construct. - */ -openvrml::script_factory_registry::script_factory_registry(): - impl_(new impl) -{ - this->impl_->register_factories(*this); -} - -/** - * @internal - * - * @brief Destroy. - */ -openvrml::script_factory_registry::~script_factory_registry() -{} - -/** - * @brief Register a factory for creating concrete @c script%s. - * - * This function should be called in a script engine module's implementation - * of @c openvrml_script_LTX_register_factory. - * - * @param[in] media_types the set of MIME media types that identify scripts - * supported by the module. - * @param[in] uri_schemes the set of URI schemes that identify scripts - * supported by the module. - * @param[in] factory the factory. - * - * @return @c true if the factory was registered successfully; @c false - * otherwise - */ -bool -openvrml::script_factory_registry:: -register_factory(const std::set<std::string> & media_types, - const std::set<std::string> & uri_schemes, - const boost::shared_ptr<script_factory> & factory) - OPENVRML_THROW2(std::bad_alloc, std::invalid_argument) -{ - return this->impl_->register_factory(media_types, uri_schemes, factory); -} - -/** - * @class openvrml::script_node_metatype openvrml/script.h - * - * @brief Class object for @c script_node%s. - * - * There is one @c script_node_metatype per browser instance. - * - * @see browser::scriptNodeClass - */ - -/** - * @brief Construct. - * - * @param[in] browser the @c browser to be associated with the - * @c script_node_metatype. - */ -openvrml::script_node_metatype::script_node_metatype(openvrml::browser & browser): - node_metatype("urn:X-openvrml:node:Script", browser) -{} - -/** - * @brief Destroy. - */ -openvrml::script_node_metatype::~script_node_metatype() OPENVRML_NOTHROW -{} - -/** - * @brief Not implemented. - * - * This method is not implemented because the Script node implementation, - * unlike other node implementations, cannot provide the implementation of - * an @c EXTERNPROTO. It is an error to call this method. - */ -const boost::shared_ptr<openvrml::node_type> -openvrml::script_node_metatype::do_create_type(const std::string &, - const node_interface_set &) const - OPENVRML_NOTHROW -{ - assert(false); - return boost::shared_ptr<node_type>(); -} - - -/** - * @class openvrml::script_node openvrml/browser.h - * - * @brief Represents a VRML Script node. - */ - -/** - * @internal - * - * @var class openvrml::script_node::script - * - * @brief Abstract base class for script runtimes. - */ - -/** - * @internal - * - * @brief Registry of script engine modules. - */ -openvrml::script_factory_registry -openvrml::script_node::script_factory_registry_; - -/** - * @typedef openvrml::script_node::field_value_map_t - * - * @brief A @c std::map that keys field values on their field name. - */ - -/** - * @class openvrml::script_node::eventout openvrml/script.h - * - * @brief An @c event_emitter along with the emitted value. - */ - -/** - * @var openvrml::script_node & openvrml::script_node::eventout::node_ - * - * @brief The containing @c script_node. - */ - -/** - * @var boost::scoped_ptr<openvrml::field_value> openvrml::script_node::eventout::value_ - * - * @brief The value. - */ - -/** - * @var bool openvrml::script_node::eventout::modified_ - * - * @brief Flag to indicate whether @a value_ has been modified. - */ - -/** - * @var boost::scoped_ptr<openvrml::event_emitter> openvrml::script_node::eventout::emitter_ - * - * @brief Event emitter. - */ - -/** - * @brief Construct. - * - * @param[in] type field value type identifier. - * @param[in] node @c script_node. - * - * @exception std::bad_alloc if memory allocation fails. - */ -openvrml::script_node::eventout::eventout(const field_value::type_id type, - script_node & node) - OPENVRML_THROW1(std::bad_alloc): - node_(node), - value_(field_value::create(type)), - modified_(false), - emitter_(create_emitter(node, *this->value_)) -{} - -/** - * @brief The value that will be sent from the @c eventOut. - * - * @return the value that will be sent from the @c eventOut. - */ -const openvrml::field_value & openvrml::script_node::eventout::value() const - OPENVRML_NOTHROW -{ - return *this->value_; -} - -/** - * @brief Set the value that will be sent from the @c eventOut. - * - * After calling this function, modified will return @c true until - * @c emit_event is called. - * - * @param[in] val field value. - * - * @exception std::bad_alloc if memory allocation fails. - * @exception std::bad_cast if @p val is not the correct type. - */ -void openvrml::script_node::eventout::value(const field_value & val) - OPENVRML_THROW2(std::bad_alloc, std::bad_cast) -{ - using boost::polymorphic_downcast; - - if (this->value_->type() == field_value::sfnode_id) { - this->node_ - .assign_with_self_ref_check( - dynamic_cast<const sfnode &>(val), - *polymorphic_downcast<sfnode *>(this->value_.get())); - } else if (this->value_->type() == field_value::mfnode_id) { - this->node_ - .assign_with_self_ref_check( - dynamic_cast<const mfnode &>(val), - *polymorphic_downcast<mfnode *>(this->value_.get())); - } else { - this->value_->assign(val); // Throws std::bad_alloc, std::bad_cast. - } - this->modified_ = true; -} - -/** - * @brief Whether the value has been modified. - * - * @return @c true if the value has been changed since @c emit_event was last - * called; @c false otherwise. - */ -bool openvrml::script_node::eventout::modified() const OPENVRML_NOTHROW -{ - return this->modified_; -} - -/** - * @brief The @c event_emitter associated with the @c eventout. - * - * @return the @c event_emitter associated with the @c eventout. - */ -openvrml::event_emitter & openvrml::script_node::eventout::emitter() - OPENVRML_NOTHROW -{ - return *this->emitter_; -} - -/** - * @brief Cause the contained @c event_emitter to emit an event. - * - * Events should be emitted from Script nodes by calling this function instead - * of passing the @c event_emitter directly to @c node::emit_event. - * - * @param[in] timestamp the current time. - * - * @exception std::bad_alloc if memory allocation fails. - */ -void openvrml::script_node::eventout::emit_event(const double timestamp) - OPENVRML_THROW1(std::bad_alloc) -{ - node::emit_event(*this->emitter_, timestamp); - this->modified_ = false; -} - -/** - * @typedef openvrml::script_node::eventout_ptr - * - * @brief Reference-counted smart pointer to an @c eventout. - */ - -/** - * @typedef openvrml::script_node::eventout_map_t - * - * @brief Map of @c eventout instances. - */ - -/** - * @internal - * - * @class openvrml::script_node::script_node_type openvrml/script.h - * - * @brief Type objects for @c script_node%s. - * - * @see script_node::type_ - */ - -/** - * @var openvrml::node_interface_set openvrml::script_node::script_node_type::interfaces_ - * - * @brief Node interfaces. - */ - -namespace { - - // - // The order of the node_interfaces in this array is significant. This - // range is used with std::set_difference, so the elements *must* be in - // lexicographically increasing order according to their "id" member. - // - const boost::array<openvrml::node_interface, 4> - built_in_script_interfaces_ = { - openvrml::node_interface(openvrml::node_interface::field_id, - openvrml::field_value::sfbool_id, - "directOutput"), - openvrml::node_interface(openvrml::node_interface::exposedfield_id, - openvrml::field_value::sfnode_id, - "metadata"), - openvrml::node_interface(openvrml::node_interface::field_id, - openvrml::field_value::sfbool_id, - "mustEvaluate"), - openvrml::node_interface(openvrml::node_interface::exposedfield_id, - openvrml::field_value::mfstring_id, - "url") - }; -} - -/** - * @brief Construct. - * - * @param[in] class_ the @c node_metatype for @c script_node%s. - */ -openvrml::script_node::script_node_type:: -script_node_type(script_node_metatype & class_): - node_type(class_, "Script") -{ - for (size_t i = 0; i < built_in_script_interfaces_.size(); ++i) { - bool succeeded = - this->interfaces_.insert(built_in_script_interfaces_[i]).second; - assert(succeeded); - } -} - -/** - * @brief Destroy. - */ -openvrml::script_node::script_node_type::~script_node_type() OPENVRML_NOTHROW -{} - -/** - * @brief Add an interface. - * - * @param[in] interface - * - * @exception std::bad_alloc if memory allocation fails. - * @exception std::invalid_argument if the @c script_node_type already has an - * interface that conflicts with @p interface. - */ -void -openvrml::script_node::script_node_type:: -add_interface(const node_interface & interface_) - OPENVRML_THROW2(std::bad_alloc, std::invalid_argument) -{ - bool succeeded = this->interfaces_.insert(interface_).second; - if (!succeeded) { - throw std::invalid_argument("Interface conflicts with an interface " - "already in this set."); - } -} - -/** - * @brief Get the interfaces for the @c node. - * - * @return the interfaces for the @c node. - */ -const openvrml::node_interface_set & -openvrml::script_node::script_node_type::do_interfaces() const - OPENVRML_NOTHROW -{ - return this->interfaces_; -} - -/** - * @brief Clone... [truncated message content] |
From: <br...@us...> - 2008-09-26 04:14:15
|
Revision: 3693 http://openvrml.svn.sourceforge.net/openvrml/?rev=3693&view=rev Author: braden Date: 2008-09-26 04:14:04 +0000 (Fri, 26 Sep 2008) Log Message: ----------- Moved PROTO implementation classes to the openvrml::local namespace and out of browser.cpp. Modified Paths: -------------- trunk/ChangeLog trunk/src/Makefile.am trunk/src/libopenvrml/openvrml/browser.cpp trunk/src/libopenvrml/openvrml/node.h Added Paths: ----------- trunk/src/libopenvrml/openvrml/local/proto.cpp trunk/src/libopenvrml/openvrml/local/proto.h Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-09-25 02:08:05 UTC (rev 3692) +++ trunk/ChangeLog 2008-09-26 04:14:04 UTC (rev 3693) @@ -1,3 +1,16 @@ +2008-09-26 Braden McDaniel <br...@en...> + + Moved PROTO implementation classes to the openvrml::local + namespace and out of browser.cpp. + + * src/Makefile.am + (libopenvrml_libopenvrml_la_SOURCES): Added + libopenvrml/openvrml/local/proto.{cpp,h}. + * src/libopenvrml/openvrml/browser.cpp + * src/libopenvrml/openvrml/local/proto.cpp + * src/libopenvrml/openvrml/local/proto.h + * src/libopenvrml/openvrml/node.h + 2008-09-24 Braden McDaniel <br...@en...> Moved dlopen/LoadLibrary wrapper functions, the XML parser Modified: trunk/src/Makefile.am =================================================================== --- trunk/src/Makefile.am 2008-09-25 02:08:05 UTC (rev 3692) +++ trunk/src/Makefile.am 2008-09-26 04:14:04 UTC (rev 3693) @@ -155,7 +155,9 @@ libopenvrml/openvrml/local/uri.cpp \ libopenvrml/openvrml/local/uri.h \ libopenvrml/openvrml/local/xml_reader.cpp \ - libopenvrml/openvrml/local/xml_reader.h + libopenvrml/openvrml/local/xml_reader.h \ + libopenvrml/openvrml/local/proto.cpp \ + libopenvrml/openvrml/local/proto.h libopenvrml_libopenvrml_la_LDFLAGS = \ -version-info $(LIBOPENVRML_LIBRARY_VERSION) \ Modified: trunk/src/libopenvrml/openvrml/browser.cpp =================================================================== --- trunk/src/libopenvrml/openvrml/browser.cpp 2008-09-25 02:08:05 UTC (rev 3692) +++ trunk/src/libopenvrml/openvrml/browser.cpp 2008-09-26 04:14:04 UTC (rev 3693) @@ -42,6 +42,7 @@ # include "x3d_cad_geometry.h" # include <openvrml/local/uri.h> # include <openvrml/local/xml_reader.h> +# include <openvrml/local/proto.h> # include <private.h> # include <boost/algorithm/string/predicate.hpp> # include <boost/bind.hpp> @@ -107,2221 +108,6 @@ const initial_value_map & initial_values) const OPENVRML_NOTHROW; }; - - - class proto_node; - class proto_node_type; - class proto_impl_cloner; - - /** - * @internal - * - * @brief @c node_metatype for @c PROTO%s. - * - * The @c proto_node_metatype is OpenVRML's in-memory representation of a - * @c PROTO (as opposed to a @c PROTO instance). Through the - * @c proto_node_type intermediary, it facilitates spawning any number of - * @c proto_node instances. - */ - class OPENVRML_LOCAL proto_node_metatype : public node_metatype { - friend class proto_node; - friend class proto_node_type; - friend class proto_impl_cloner; - - public: - class is_target { - public: - node * impl_node; - std::string impl_node_interface; - - is_target(node & impl_node, - const std::string & impl_node_interface); - }; - - typedef std::multimap<std::string, is_target> is_map_t; - - class route { - public: - node * from; - std::string eventout; - node * to; - std::string eventin; - - route(node & from, const std::string & eventout, - node & to, const std::string & eventin); - }; - - typedef std::vector<route> routes_t; - - typedef std::map<std::string, boost::shared_ptr<field_value> > - default_value_map_t; - - private: - node_interface_set interfaces; - default_value_map_t default_value_map; - std::vector<boost::intrusive_ptr<node> > impl_nodes; - routes_t routes; - is_map_t is_map; - - public: - proto_node_metatype( - const node_metatype_id & id, - openvrml::browser & browser, - const node_interface_set & interfaces, - const default_value_map_t & default_value_map, - const std::vector<boost::intrusive_ptr<node> > & impl_nodes, - const is_map_t & is_map, - const routes_t & routes); - virtual ~proto_node_metatype() OPENVRML_NOTHROW; - - virtual const boost::shared_ptr<node_type> - do_create_type(const std::string & id, - const node_interface_set & interfaces) const - OPENVRML_THROW2(unsupported_interface, std::bad_alloc); - }; - - - /** - * @internal - * - * @brief @c node_type for @c PROTO node instances. - */ - class OPENVRML_LOCAL proto_node_type : public node_type { - node_interface_set interfaces_; - - public: - proto_node_type(const proto_node_metatype & node_metatype, - const std::string & id, - const node_interface_set & interfaces) - OPENVRML_THROW2(unsupported_interface, std::bad_alloc); - virtual ~proto_node_type() OPENVRML_NOTHROW; - - private: - virtual const node_interface_set & do_interfaces() const - OPENVRML_NOTHROW; - virtual const boost::intrusive_ptr<node> - do_create_node(const boost::shared_ptr<openvrml::scope> & scope, - const initial_value_map & initial_values) const - OPENVRML_THROW1(std::bad_alloc); - }; - - - class OPENVRML_LOCAL abstract_proto_node : public openvrml::node { - public: - virtual ~abstract_proto_node() OPENVRML_NOTHROW = 0; - - protected: - template <typename FieldValue> - class proto_eventin : public node_field_value_listener<FieldValue> { - typedef std::set<field_value_listener<FieldValue> *> listeners; - listeners listeners_; - - public: - typedef FieldValue field_value_type; - typedef field_value_listener<FieldValue> event_listener_type; - - explicit proto_eventin(abstract_proto_node & node); - virtual ~proto_eventin() OPENVRML_NOTHROW; - - bool is(event_listener_type & listener) - OPENVRML_THROW1(std::bad_alloc); - - protected: - virtual void do_process_event(const FieldValue & value, - double timestamp) - OPENVRML_THROW1(std::bad_alloc); - - private: - virtual const std::string do_eventin_id() const OPENVRML_NOTHROW; - }; - - struct proto_eventin_creator { - proto_eventin_creator( - const openvrml::field_value::type_id type, - abstract_proto_node & node, - boost::shared_ptr<openvrml::event_listener> & listener): - type_(type), - node_(&node), - listener_(&listener) - {} - - template <typename T> - void operator()(T) const - { - if (T::field_value_type_id == this->type_) { - this->listener_->reset(new proto_eventin<T>(*this->node_)); - } - } - - private: - openvrml::field_value::type_id type_; - abstract_proto_node * node_; - boost::shared_ptr<openvrml::event_listener> * listener_; - }; - - static boost::shared_ptr<openvrml::event_listener> - create_eventin(field_value::type_id, abstract_proto_node & node) - OPENVRML_THROW1(std::bad_alloc); - - struct eventin_is { - eventin_is(const field_value::type_id field_type, - openvrml::event_listener & impl_eventin, - openvrml::event_listener & interface_eventin): - type_(field_type), - impl_eventin_(&impl_eventin), - interface_eventin_(&interface_eventin) - {} - - template <typename T> - void operator()(T) const - { - if (T::field_value_type_id == this->type_) { - dynamic_cast<proto_eventin<T> &>(*interface_eventin_).is( - dynamic_cast<field_value_listener<T> &>( - *impl_eventin_)); - } - } - - private: - field_value::type_id type_; - openvrml::event_listener * impl_eventin_; - openvrml::event_listener * interface_eventin_; - }; - - template <typename FieldValue> - class proto_eventout : public field_value_emitter<FieldValue> { - protected: - class listener_t : public node_field_value_listener<FieldValue> { - proto_eventout & emitter; - - public: - abstract_proto_node & node; - FieldValue value; - - listener_t(proto_eventout & emitter, - abstract_proto_node & node, - const FieldValue & initial_value); - virtual ~listener_t() OPENVRML_NOTHROW; - - private: - virtual const std::string do_eventin_id() const - OPENVRML_NOTHROW; - virtual void do_process_event(const FieldValue & value, - double timestamp) - OPENVRML_THROW1(std::bad_alloc); - } listener; - - public: - typedef FieldValue field_value_type; - typedef field_value_emitter<FieldValue> event_emitter_type; - typedef field_value_listener<FieldValue> event_listener_type; - - proto_eventout( - abstract_proto_node & node, - const FieldValue & initial_value = FieldValue()); - virtual ~proto_eventout() OPENVRML_NOTHROW; - - bool is(event_emitter_type & emitter) - OPENVRML_THROW1(std::bad_alloc); - - private: - const std::string do_eventout_id() const OPENVRML_NOTHROW; - }; - - struct proto_eventout_creator { - proto_eventout_creator( - const openvrml::field_value::type_id type, - abstract_proto_node & node, - boost::shared_ptr<openvrml::event_emitter> & emitter): - type_(type), - node_(&node), - emitter_(&emitter) - {} - - template <typename T> - void operator()(T) const - { - if (T::field_value_type_id == this->type_) { - this->emitter_->reset(new proto_eventout<T>(*this->node_)); - } - } - - private: - openvrml::field_value::type_id type_; - abstract_proto_node * node_; - boost::shared_ptr<openvrml::event_emitter> * emitter_; - }; - - static boost::shared_ptr<openvrml::event_emitter> - create_eventout(field_value::type_id, abstract_proto_node & node) - OPENVRML_THROW1(std::bad_alloc); - - struct eventout_is { - eventout_is(const field_value::type_id field_type, - openvrml::event_emitter & impl_eventout, - openvrml::event_emitter & interface_eventout): - type_(field_type), - impl_eventout_(&impl_eventout), - interface_eventout_(&interface_eventout) - {} - - template <typename T> - void operator()(T) const - { - if (T::field_value_type_id == this->type_) { - dynamic_cast<proto_eventout<T> &>(*interface_eventout_).is( - dynamic_cast<field_value_emitter<T> &>( - *impl_eventout_)); - } - } - - private: - field_value::type_id type_; - openvrml::event_emitter * impl_eventout_; - openvrml::event_emitter * interface_eventout_; - }; - - typedef boost::shared_ptr<openvrml::event_listener> eventin_ptr; - typedef std::map<std::string, eventin_ptr> eventin_map_t; - - struct proto_eventin_equal_to : - std::unary_function<eventin_map_t::value_type, bool> { - - explicit proto_eventin_equal_to( - const openvrml::event_listener & listener): - listener_(&listener) - {} - - bool operator()(const eventin_map_t::value_type & arg) const - { - return this->listener_ == arg.second.get(); - } - - private: - const openvrml::event_listener * listener_; - }; - - eventin_map_t eventin_map; - - typedef boost::shared_ptr<openvrml::event_emitter> eventout_ptr; - typedef std::map<std::string, eventout_ptr> eventout_map_t; - - struct proto_eventout_equal_to : - std::unary_function<eventout_map_t::value_type, bool> { - - explicit proto_eventout_equal_to( - const openvrml::event_emitter & emitter): - emitter_(&emitter) - {} - - bool operator()(const eventout_map_t::value_type & arg) const - { - return this->emitter_ == arg.second.get(); - } - - private: - const openvrml::event_emitter * emitter_; - }; - - eventout_map_t eventout_map; - - abstract_proto_node(const openvrml::node_type & type, - const boost::shared_ptr<openvrml::scope> & scope) - OPENVRML_NOTHROW; - }; - - abstract_proto_node::abstract_proto_node( - const openvrml::node_type & type, - const boost::shared_ptr<openvrml::scope> & scope) - OPENVRML_NOTHROW: - openvrml::node(type, scope) - {} - - abstract_proto_node::~abstract_proto_node() OPENVRML_NOTHROW - {} - - - /** - * @internal - * - * @brief A @c PROTO instance node. - * - * Like a typical node implementation, @c proto_node%s have a many-to-one - * relationship with the @c proto_node_type instance that creates them. - * And @c proto_node_type has, in turn, a many-to-one relationship with - * the @c proto_node_metatype instance that creates them. Unlike a - * typical node implementation, there will very likely be more than one - * @c proto_node_metatype instance known to the @c browser instance; there - * will be one for each @c PROTO known to the @c browser. - * - * As the @c proto_node_metatype encodes the data in a @c PROTO, the - * @c proto_node_type can be seen as modeling @c EXTERNPROTO. Each - * @c EXTERNPROTO will spawn a new @c proto_node_type from the - * @c proto_node_metatype that corresponds to the @c PROTO to which the - * @c EXTERNPROTO refers. Recall that an @c EXTERNPROTO provides a subset - * of the interfaces defined for a @c PROTO; thus, for a @c PROTO with - * <var>n</var> interfaces, there are <var>n</var>! possible unique - * @c EXTERNPROTO%s (and thus unique @c proto_node_type instances). - * - * Structurally, the implementation of @c proto_node is very similar to - * that of @c proto_node_metatype. The difference is that event pathways - * for @c ROUTE%s and @c IS mappings are actually created in the - * @c proto_node. The @c proto_node_metatype, on the other hand, includes - * metadata about how these event pathways @e should be created. - */ - class OPENVRML_LOCAL proto_node : public abstract_proto_node { - friend class externproto_node; - - template <typename FieldValue> - class proto_exposedfield : public proto_eventin<FieldValue>, - public proto_eventout<FieldValue> { - public: - proto_exposedfield(abstract_proto_node & node, - const FieldValue & initial_value); - virtual ~proto_exposedfield() OPENVRML_NOTHROW; - - private: - virtual void do_process_event(const FieldValue & value, - double timestamp) - OPENVRML_THROW1(std::bad_alloc); - }; - - struct proto_exposedfield_creator { - proto_exposedfield_creator( - const field_value & initial_value, - proto_node & node, - boost::shared_ptr<openvrml::event_listener> & exposedfield): - initial_value_(&initial_value), - node_(&node), - exposedfield_(&exposedfield) - {} - - template <typename T> - void operator()(T) const - { - if (T::field_value_type_id == this->initial_value_->type()) { - using boost::polymorphic_downcast; - this->exposedfield_->reset( - new proto_exposedfield<T>( - *this->node_, - *polymorphic_downcast<const T *>( - this->initial_value_))); - } - } - - private: - const openvrml::field_value * initial_value_; - proto_node * node_; - boost::shared_ptr<openvrml::event_listener> * exposedfield_; - }; - - static boost::shared_ptr<openvrml::event_listener> - create_exposedfield(const field_value & initial_value, - proto_node & node) - OPENVRML_THROW1(std::bad_alloc); - - boost::shared_ptr<openvrml::scope> proto_scope; - std::vector<boost::intrusive_ptr<node> > impl_nodes; - - public: - proto_node(const node_type & type, - const boost::shared_ptr<openvrml::scope> & scope, - const initial_value_map & initial_values) - OPENVRML_THROW1(std::bad_alloc); - virtual ~proto_node() OPENVRML_NOTHROW; - - virtual bool modified() const; - - private: - virtual void do_initialize(double timestamp) - OPENVRML_THROW1(std::bad_alloc); - - virtual const field_value & do_field(const std::string & id) const - OPENVRML_THROW1(unsupported_interface); - virtual openvrml::event_listener & - do_event_listener(const std::string & id) - OPENVRML_THROW1(unsupported_interface); - virtual openvrml::event_emitter & - do_event_emitter(const std::string & id) - OPENVRML_THROW1(unsupported_interface); - - virtual void do_shutdown(double timestamp) OPENVRML_NOTHROW; - - virtual script_node * to_script() OPENVRML_NOTHROW; - virtual appearance_node * to_appearance() OPENVRML_NOTHROW; - virtual bounded_volume_node * to_bounded_volume() OPENVRML_NOTHROW; - virtual child_node * to_child() OPENVRML_NOTHROW; - virtual color_node * to_color() OPENVRML_NOTHROW; - virtual color_rgba_node * to_color_rgba() OPENVRML_NOTHROW; - virtual coordinate_node * to_coordinate() OPENVRML_NOTHROW; - virtual font_style_node * to_font_style() OPENVRML_NOTHROW ; - virtual geometry_node * to_geometry() OPENVRML_NOTHROW; - virtual grouping_node * to_grouping() OPENVRML_NOTHROW; - virtual light_node * to_light() OPENVRML_NOTHROW; - virtual material_node * to_material() OPENVRML_NOTHROW; - virtual navigation_info_node * to_navigation_info() OPENVRML_NOTHROW; - virtual normal_node * to_normal() OPENVRML_NOTHROW; - virtual pointing_device_sensor_node * to_pointing_device_sensor() - OPENVRML_NOTHROW; - virtual scoped_light_node * to_scoped_light() OPENVRML_NOTHROW; - virtual sound_source_node * to_sound_source() OPENVRML_NOTHROW; - virtual texture_node * to_texture() OPENVRML_NOTHROW; - virtual texture_coordinate_node * to_texture_coordinate() - OPENVRML_NOTHROW; - virtual texture_transform_node * to_texture_transform() - OPENVRML_NOTHROW; - virtual time_dependent_node * to_time_dependent() OPENVRML_NOTHROW; - virtual transform_node * to_transform() OPENVRML_NOTHROW; - virtual viewpoint_node * to_viewpoint() OPENVRML_NOTHROW; - }; - - - class OPENVRML_LOCAL node_path_element { - public: - std::vector<boost::intrusive_ptr<node> >::size_type index; - field_value::type_id field_type; - std::string field_id; - - node_path_element(); - }; - - node_path_element::node_path_element(): - index(0), - field_type(field_value::invalid_type_id) - {} - - /** - * @brief A @c node path is used to store the path to a @c node for the - * purpose of duplicating a route in a cloned @c node hierarchy. - */ - typedef std::list<node_path_element> node_path_t; - - class OPENVRML_LOCAL path_getter : boost::noncopyable { - const node & objective; - node_path_t & node_path; - bool found; - - public: - path_getter(const node & objective, node_path_t & node_path) - OPENVRML_NOTHROW; - - void get_path_from(const boost::intrusive_ptr<node> & node) - OPENVRML_THROW1(std::bad_alloc); - void get_path_from( - const std::vector<boost::intrusive_ptr<node> > & nodes) - OPENVRML_THROW1(std::bad_alloc); - - private: - void traverse_children(node & n) OPENVRML_THROW1(std::bad_alloc); - }; - - path_getter::path_getter(const node & objective, node_path_t & node_path) - OPENVRML_NOTHROW: - objective(objective), - node_path(node_path), - found(false) - {} - - void path_getter::get_path_from(const boost::intrusive_ptr<node> & node) - OPENVRML_THROW1(std::bad_alloc) - { - if (node) { - this->node_path.push_back(node_path_element()); - if (node.get() == &objective) { - this->found = true; - return; - } - this->traverse_children(*node); - if (!this->found) { this->node_path.pop_back(); } - } - } - - void path_getter::get_path_from( - const std::vector<boost::intrusive_ptr<node> > & nodes) - OPENVRML_THROW1(std::bad_alloc) - { - this->node_path.push_back(node_path_element()); - node_path_element & back = this->node_path.back(); - while (back.index < nodes.size()) { - assert(&back == &this->node_path.back()); - if (nodes[back.index].get() == &this->objective) { - this->found = true; - return; - } - if (nodes[back.index].get()) { - this->traverse_children(*nodes[back.index]); - } - // - // We need to bail early to avoid incrementing the counter. - // - if (this->found) { return; } - ++back.index; - } - if (!this->found) { this->node_path.pop_back(); } - } - - void path_getter::traverse_children(node & n) - OPENVRML_THROW1(std::bad_alloc) - { - const node_interface_set & interfaces = n.type().interfaces(); - node_path_element & back = this->node_path.back(); - for (node_interface_set::const_iterator interface_ = interfaces.begin(); - !this->found && interface_ != interfaces.end(); - ++interface_) { - assert(&back == &this->node_path.back()); - if (interface_->type == node_interface::field_id - || interface_->type == node_interface::exposedfield_id) { - if (interface_->field_type == field_value::sfnode_id) { - back.field_type = field_value::sfnode_id; - back.field_id = interface_->id; - try { - const sfnode value = n.field<sfnode>(interface_->id); - this->get_path_from(value.value()); - } catch (unsupported_interface & ex) { - OPENVRML_PRINT_EXCEPTION_(ex); - } - } else if (interface_->field_type == field_value::mfnode_id) { - back.field_type = field_value::mfnode_id; - back.field_id = interface_->id; - try { - const mfnode value = n.field<mfnode>(interface_->id); - this->get_path_from(value.value()); - } catch (unsupported_interface & ex) { - OPENVRML_PRINT_EXCEPTION_(ex); - } - } - } - } - } - - /** - * @internal - * - * @brief Get the path to a node. - * - * @return the path to a node. - */ - OPENVRML_LOCAL const node_path_t - get_path(const std::vector<boost::intrusive_ptr<node> > & root, - const node & objective) - OPENVRML_THROW1(std::bad_alloc) - { - node_path_t path; - path_getter(objective, path).get_path_from(root); - return path; - } - - /** - * @internal - * - * @brief Resolve a node path against a node hierarchy. - * - * @return a pointer to the objective node in the node hierarchy - * designated by @p root. - */ - OPENVRML_LOCAL node * - resolve_node_path(const node_path_t & path, - const std::vector<boost::intrusive_ptr<node> > & root) - { - using boost::next; - using boost::prior; - assert(!path.empty()); - node * result = root[path.front().index].get(); - const node_path_t::const_iterator before_end = prior(path.end()); - for (node_path_t::const_iterator path_element = path.begin(); - path_element != before_end; - ++path_element) { - assert(result); - try { - if (path_element->field_type == field_value::sfnode_id) { - result = result->field<sfnode>(path_element->field_id) - .value().get(); - } else if (path_element->field_type == field_value::mfnode_id) - { - result = result->field<mfnode>(path_element->field_id) - .value()[next(path_element)->index].get(); - } else { - assert(!"invalid path_element->field_type"); - } - } catch (unsupported_interface & ex) { - OPENVRML_PRINT_EXCEPTION_(ex); - } - } - return result; - } - - class OPENVRML_LOCAL field_value_cloner { - protected: - const boost::shared_ptr<openvrml::scope> & target_scope; - std::set<node *> traversed_nodes; - - public: - explicit field_value_cloner( - const boost::shared_ptr<openvrml::scope> & target_scope): - target_scope(target_scope) - { - assert(target_scope); - } - - virtual ~field_value_cloner() - {} - - void clone_field_value(const boost::intrusive_ptr<node> & src_node, - const field_value & src, - field_value & dest) - OPENVRML_THROW1(std::bad_alloc) - { - assert(src.type() == dest.type()); - const field_value::type_id type = src.type(); - if (type == field_value::sfnode_id) { - this->clone_sfnode(src_node, - static_cast<const sfnode &>(src), - static_cast<sfnode &>(dest)); - } else if (type == field_value::mfnode_id) { - this->clone_mfnode(src_node, - static_cast<const mfnode &>(src), - static_cast<mfnode &>(dest)); - } else { - // - // Do a shallow copy for other types. - // - dest.assign(src); - } - } - - private: - virtual const boost::intrusive_ptr<node> - clone_node(const boost::intrusive_ptr<node> & n) - OPENVRML_THROW1(std::bad_alloc) - { - using std::set; - using boost::intrusive_ptr; - - assert(this->target_scope); - - intrusive_ptr<node> result; - - if (!n) { return result; } - - const bool already_traversed = - (this->traversed_nodes.find(n.get()) - != this->traversed_nodes.end()); - - if (already_traversed) { - result = intrusive_ptr<node>( - this->target_scope->find_node(n->id())); - assert(result); - } else { - initial_value_map initial_values; - const node_interface_set & interfaces = - n->type().interfaces(); - for (node_interface_set::const_iterator interface_ = - interfaces.begin(); - interface_ != interfaces.end(); - ++interface_) { - using std::string; - const node_interface::type_id type = interface_->type; - const string & id = interface_->id; - if (type == node_interface::exposedfield_id - || type == node_interface::field_id) { - using std::auto_ptr; - using boost::shared_ptr; - auto_ptr<field_value> src = n->field(id); - auto_ptr<field_value> dest = - field_value::create(interface_->field_type); - assert(src->type() == dest->type()); - this->clone_field_value(n, *src, *dest); - bool succeeded = - initial_values.insert( - make_pair(id, shared_ptr<field_value>(dest))) - .second; - assert(succeeded); - } - } - result = n->type().create_node(this->target_scope, - initial_values); - if (!n->id().empty()) { result->id(n->id()); } - } - return result; - } - - void clone_sfnode(const boost::intrusive_ptr<node> & src_node, - const sfnode & src, - sfnode & dest) - OPENVRML_THROW1(std::bad_alloc) - { - dest.value((src.value() == src_node) - ? node::self_tag - : this->clone_node(src.value())); - } - - void clone_mfnode(const boost::intrusive_ptr<node> & src_node, - const mfnode & src, - mfnode & dest) - OPENVRML_THROW1(std::bad_alloc) - { - using std::swap; - using std::vector; - std::vector<boost::intrusive_ptr<node> > result( - src.value().size()); - for (vector<boost::intrusive_ptr<node> >::size_type i = 0; - i < src.value().size(); - ++i) { - result[i] = (src.value()[i] == src_node) - ? node::self_tag - : this->clone_node(src.value()[i]); - } - dest.value(result); - } - }; - - // - // Clone the implementation nodes. - // - class OPENVRML_LOCAL proto_impl_cloner : public field_value_cloner { - const proto_node_metatype & node_metatype; - const initial_value_map & initial_values_; - - public: - proto_impl_cloner( - const proto_node_metatype & node_metatype, - const initial_value_map & initial_values, - const boost::shared_ptr<openvrml::scope> & target_scope): - field_value_cloner(target_scope), - node_metatype(node_metatype), - initial_values_(initial_values) - {} - - const std::vector<boost::intrusive_ptr<node> > clone() - OPENVRML_THROW1(std::bad_alloc) - { - using std::vector; - - vector<boost::intrusive_ptr<node> > result( - this->node_metatype.impl_nodes.size()); - - for (vector<boost::intrusive_ptr<node> >::size_type i = 0; - i < this->node_metatype.impl_nodes.size(); - ++i) { - result[i] = this->clone_node(this->node_metatype.impl_nodes[i]); - assert(result[i]); - } - return result; - } - - private: - struct matches_is_target : - std::unary_function<proto_node_metatype::is_map_t::value_type, - bool> { - - explicit matches_is_target( - const proto_node_metatype::is_target & is_target): - is_target(is_target) - {} - - result_type operator()(const argument_type & is_map_value) const - { - return (is_map_value.second.impl_node - == this->is_target.impl_node) - && (is_map_value.second.impl_node_interface - == this->is_target.impl_node_interface); - } - - private: - const proto_node_metatype::is_target & is_target; - }; - - virtual const boost::intrusive_ptr<node> - clone_node(const boost::intrusive_ptr<node> & n) - OPENVRML_THROW1(std::bad_alloc) - { - using std::set; - using boost::intrusive_ptr; - - assert(this->target_scope); - - intrusive_ptr<node> result; - - if (!n) { return result; } - - const bool already_traversed = - (this->traversed_nodes.find(n.get()) - != this->traversed_nodes.end()); - - if (already_traversed) { - result = intrusive_ptr<node>( - this->target_scope->find_node(n->id())); - assert(result); - } else { - initial_value_map initial_values; - const node_interface_set & interfaces = - n->type().interfaces(); - for (node_interface_set::const_iterator interface_ = - interfaces.begin(); - interface_ != interfaces.end(); - ++interface_) { - using std::string; - const node_interface::type_id type = interface_->type; - const string & id = interface_->id; - if (type == node_interface::exposedfield_id - || type == node_interface::field_id) { - using std::auto_ptr; - using std::find_if; - using boost::shared_ptr; - auto_ptr<const field_value> src_val; - auto_ptr<field_value> dest_val; - - // - // If the field/exposedField is IS'd, get the value - // from the initial_values_, or alternatively the - // default_values_. - // - typedef proto_node_metatype::is_target is_target; - typedef proto_node_metatype::is_map_t is_map; - typedef proto_node_metatype::default_value_map_t - default_value_map; - - is_map::const_iterator is_mapping = - find_if(this->node_metatype.is_map.begin(), - this->node_metatype.is_map.end(), - matches_is_target( - is_target(*n, interface_->id))); - if (is_mapping != this->node_metatype.is_map.end()) { - using boost::bind; - using std::logical_or; - // - // If an exposedField in the implementation is IS'd - // to an eventIn or an eventOut in the interface, - // we'll still get here. So if the implementation - // node interface is an exposedField, we need to - // check to see if the PROTO interface is an - // eventIn or an eventOut. - // - node_interface_set::const_iterator - proto_interface = - find_if(this->node_metatype.interfaces.begin(), - this->node_metatype.interfaces.end(), - bind(logical_or<bool>(), - bind(node_interface_matches_exposedfield(), - _1, - is_mapping->first), - bind(node_interface_matches_field(), - _1, - is_mapping->first))); - - if (proto_interface - != this->node_metatype.interfaces.end()) { - initial_value_map::const_iterator - initial_value = - this->initial_values_.find( - is_mapping->first); - if (initial_value - != this->initial_values_.end()) { - dest_val = initial_value->second->clone(); - } else { - default_value_map::const_iterator - default_value = - this->node_metatype.default_value_map - .find(is_mapping->first); - assert(default_value - != this->node_metatype - .default_value_map.end()); - src_val = default_value->second->clone(); - } - } else { - src_val = n->field(id); - } - } else { - src_val = n->field(id); - } - - // - // See above logic; we don't clone subtrees from the - // initial_values; just ones from the default values - // and the PROTO definition body. - // - if (src_val.get()) { - assert(!dest_val.get()); - dest_val = - field_value::create(interface_->field_type); - this->clone_field_value(n, *src_val, *dest_val); - } - - assert(dest_val.get()); - - bool succeeded = - initial_values.insert( - make_pair(id, - shared_ptr<field_value>(dest_val))) - .second; - assert(succeeded); - } - } - result = n->type().create_node(this->target_scope, - initial_values); - if (!n->id().empty()) { result->id(n->id()); } - } - return result; - } - - void clone_sfnode(const sfnode & src, sfnode & dest) - OPENVRML_THROW1(std::bad_alloc) - { - dest.value(this->clone_node(src.value())); - } - - void clone_mfnode(const mfnode & src, mfnode & dest) - OPENVRML_THROW1(std::bad_alloc) - { - using std::swap; - using std::vector; - vector<boost::intrusive_ptr<node> > result(src.value().size()); - for (vector<boost::intrusive_ptr<node> >::size_type i = 0; - i < src.value().size(); - ++i) { - result[i] = this->clone_node(src.value()[i]); - } - dest.value(result); - } - }; - - /** - * @brief Construct. - * - * @param[in] impl_node a node in the @c PROTO implementation. - * @param[in] impl_node_interface an interface of @p impl_node. - */ - proto_node_metatype:: - is_target::is_target(node & impl_node, - const std::string & impl_node_interface): - impl_node(&impl_node), - impl_node_interface(impl_node_interface) - {} - - /** - * @brief Construct. - * - * @param[in] from event source @c node. - * @param[in] eventout @c eventOut of @p from. - * @param[in] to event destination @c node. - * @param[in] eventin @c eventIn of @p to. - */ - proto_node_metatype::route::route(node & from, - const std::string & eventout, - node & to, - const std::string & eventin): - from(&from), - eventout(eventout), - to(&to), - eventin(eventin) - {} - - /** - * @brief Construct. - * - * @param[in] node_metatype the proto_node_metatype that spawned the - * @c proto_node_type. - * @param[in] id @c node_type identifier. - * @param[in] interfaces a subset of the interfaces supported by the - * @p node_metatype. - * - * @exception unsupported_interface if an interface in @p interfaces is not - * supported by the @p node_metatype. - * @exception std::bad_alloc if memory allocation fails. - */ - proto_node_type::proto_node_type(const proto_node_metatype & node_metatype, - const std::string & id, - const node_interface_set & interfaces) - OPENVRML_THROW2(unsupported_interface, std::bad_alloc): - node_type(node_metatype, id) - { - using std::find; - using std::invalid_argument; - for (node_interface_set::const_iterator interface_ = interfaces.begin(); - interface_ != interfaces.end(); - ++interface_) { - node_interface_set::const_iterator pos = - find(node_metatype.interfaces.begin(), - node_metatype.interfaces.end(), - *interface_); - if (pos == node_metatype.interfaces.end()) { - throw unsupported_interface(*interface_); - } - const bool succeeded = this->interfaces_.insert(*interface_).second; - assert(succeeded); - } - } - - /** - * @brief Destroy. - */ - proto_node_type::~proto_node_type() OPENVRML_NOTHROW - {} - - /** - * @brief Interfaces. - * - * @return the interfaces. - */ - const node_interface_set & - proto_node_type::do_interfaces() const OPENVRML_NOTHROW - { - return this->interfaces_; - } - - const boost::intrusive_ptr<node> - proto_node_type:: - do_create_node(const boost::shared_ptr<openvrml::scope> & scope, - const initial_value_map & initial_values) const - OPENVRML_THROW1(std::bad_alloc) - { - return boost::intrusive_ptr<node>( - new proto_node(*this, scope, initial_values)); - } - - /** - * @internal - * - * @class abstract_proto_node::proto_eventin - * - * @brief @c PROTO @c eventIn handler class template. - */ - - /** - * @typedef abstract_proto_node::proto_eventin::listeners - * - * @brief Set of event listeners. - */ - - /** - * @var abstract_proto_node::proto_eventin::listeners abstract_proto_node::proto_eventin::listeners_ - * - * @brief Set of event listeners to which events are delegated for - * processing. - */ - - /** - * @typedef abstract_proto_node::proto_eventin::field_value_type - * - * @brief Field value type. - */ - - /** - * @typedef abstract_proto_node::proto_eventin::event_listener_type - * - * @brief Type of event listeners to which the instance delegates. - */ - - /** - * @brief Construct. - * - * @param[in] node abstract_proto_node. - */ - template <typename FieldValue> - abstract_proto_node::proto_eventin<FieldValue>:: - proto_eventin(abstract_proto_node & node): - node_event_listener(node), - node_field_value_listener<FieldValue>(node) - {} - - /** - * @brief Destroy. - */ - template <typename FieldValue> - abstract_proto_node::proto_eventin<FieldValue>::~proto_eventin() - OPENVRML_NOTHROW - {} - - /** - * @brief Process event. - * - * @param[in] value field value. - * @param[in] timestamp the current time. - * - * @exception std::bad_alloc if memory allocation fails. - */ - template <typename FieldValue> - void - abstract_proto_node::proto_eventin<FieldValue>:: - do_process_event(const FieldValue & value, const double timestamp) - OPENVRML_THROW1(std::bad_alloc) - { - for (typename listeners::const_iterator listener = - this->listeners_.begin(); - listener != this->listeners_.end(); - ++listener) { - (*listener)->process_event(value, timestamp); - } - } - - /** - * @brief The name of the associated @c eventIn. - * - * @return the name of the associated @c eventIn. - */ - template <typename FieldValue> - const std::string - abstract_proto_node::proto_eventin<FieldValue>::do_eventin_id() const - OPENVRML_NOTHROW - { - using boost::polymorphic_downcast; - proto_node & n = *polymorphic_downcast<proto_node *>(&this->node()); - eventin_map_t::const_iterator pos = - std::find_if(n.eventin_map.begin(), n.eventin_map.end(), - proto_eventin_equal_to(*this)); - assert(pos != n.eventin_map.end()); - return pos->first; - } - - /** - * @brief Add a listener to delegate to. Corresponds to an @c IS statement. - * - * @param[in] listener an @c event_listener to delegate to. - * - * @return @c true if @p listener is added successfully; @c false - * otherwise (if it already exists in the list of delegates). - * - * @exception std::bad_alloc if memory allocation fails. - */ - template <typename FieldValue> - bool - abstract_proto_node::proto_eventin<FieldValue>:: - is(event_listener_type & listener) - OPENVRML_THROW1(std::bad_alloc) - { - return this->listeners_.insert(&listener).second; - } - - /** - * @brief Factory function for @c proto_eventin<FieldValue> instances. - * - * @param[in] type @c field_value::type_id. - * @param[in] node @c proto_node. - * - * @return a @c boost::shared_ptr to a @c proto_eventin<FieldValue> - * instance. - * - * @exception std::bad_alloc if memory allocation fails. - */ - boost::shared_ptr<event_listener> - abstract_proto_node::create_eventin(const field_value::type_id type, - abstract_proto_node & node) - OPENVRML_THROW1(std::bad_alloc) - { - using boost::mpl::for_each; - using openvrml_::field_value_types; - - boost::shared_ptr<openvrml::event_listener> result; - for_each<field_value_types>(proto_eventin_creator(type, node, result)); - assert(result); - return result; - } - - /** - * @internal - * - * @class abstract_proto_node::proto_eventout - * - * @brief @c PROTO @c eventOut handler class template. - */ - - /** - * @internal - * - * @class abstract_proto_node::proto_eventout::listener_t - * - * @brief Listens for events emitted from @c node%s in the @c PROTO - * implementation in order to propagate them out of the @c PROTO - * instance. - */ - - /** - * @var abstract_proto_node::proto_eventout & abstract_proto_node::proto_eventout::listener_t::emitter - * - * @brief Reference to the outer @c proto_eventout class. - * - * @todo It's annoying that we need to carry this around. Should - * investigate the possibility of promoting all this stuff to - * @c proto_eventout and have @c proto_eventout privately inherit - * @c field_value_listener<FieldValue>. - */ - - /** - * @var abstract_proto_node & abstract_proto_node::proto_eventout::listener_t::node - * - * @brief Reference to the @c abstract_proto_node instance. - */ - - /** - * @var FieldValue abstract_proto_node::proto_eventout::listener_t::value - * - * @brief The value of the most recently emitted event. - */ - - /** - * @brief Construct. - * - * @param[in] emitter @c proto_eventout. - * @param[in] node @c abstract_proto_node. - * @param[in] initial_value initial value (used for @c exposedFields). - */ - template <typename FieldValue> - abstract_proto_node::proto_eventout<FieldValue>::listener_t:: - listener_t(proto_eventout & emitter, - abstract_proto_node & node, - const FieldValue & initial_value): - node_event_listener(node), - node_field_value_listener<FieldValue>(node), - emitter(emitter), - node(node), - value(initial_value) - {} - - /** - * @brief Destroy. - */ - template <typename FieldValue> - abstract_proto_node::proto_eventout<FieldValue>::listener_t::~listener_t() - OPENVRML_NOTHROW - {} - - /** - * @brief Get the associated @c eventIn identifier. - */ - template <typename FieldValue> - const std::string - abstract_proto_node::proto_eventout<FieldValue>::listener_t:: - do_eventin_id() const - OPENVRML_NOTHROW - { - return "<proto_node::proto_eventout::listener_t>"; - } - - /** - * @brief Process event. - * - * @param[in] value new value. - * @param[in] timestamp the current time. - * - * @exception std::bad_alloc if memory allocation fails. - */ - template<typename FieldValue> - void - abstract_proto_node::proto_eventout<FieldValue>::listener_t:: - do_process_event(const FieldValue & value, const double timestamp) - OPENVRML_THROW1(std::bad_alloc) - { - if (timestamp > this->emitter.last_time()) { - this->value = value; - node::emit_event(this->emitter, timestamp); - } - } - - /** - * @var abstract_proto_node::proto_eventout::listener_t abstract_proto_node::proto_eventout::listener - * - * @brief Listens for events emitted from nodes in the @c PROTO - * implementation in order to propagate them out of the @c PROTO - * instance. - */ - - /** - * @typedef abstract_proto_node::proto_eventout<FieldValue>::field_value_type - * - * @brief Field value type. - */ - - /** - * @typedef abstract_proto_node::proto_eventout<FieldValue>::event_emitter_type - * - * @brief Event emitter type. - */ - - /** - * @typedef abstract_proto_node::proto_eventout<FieldValue>::event_listener_type - * - * @brief Event listener type. - */ - - /** - * @brief Construct. - * - * @param[in] node @c abstract_proto_node. - * @param[in] initial_value initial value. This is used by - * @c proto_exposedfield<FieldValue> - */ - template <typename FieldValue> - abstract_proto_node::proto_eventout<FieldValue>:: - proto_eventout(abstract_proto_node & node, - const FieldValue & initial_value): - openvrml::event_emitter(this->listener.value), - field_value_emitter<FieldValue>(this->listener.value), - listener(*this, node, initial_value) - {} - - /** - * @brief Destroy. - */ - template <typename FieldValue> - abstract_proto_node::proto_eventout<FieldValue>::~proto_eventout() - OPENVRML_NOTHROW - {} - - /** - * @brief Create an @c IS mapping. - * - * @param[in,out] emitter the @c event_emitter from a node in the @c PROTO - * implementation. - * - * @return @c true if the @c IS mapping is created successfully; @c false - * otherwise (i.e., if it already exists). - * - * @exception std::bad_alloc if memory allocation fails. - */ - template <typename FieldValue> - bool - abstract_proto_node::proto_eventout<FieldValue>:: - is(event_emitter_type & emitter) OPENVRML_THROW1(std::bad_alloc) - { - return emitter.add(this->listener); - } - - /** - * @brief The name of the associated @c eventOut. - * - * @return the name of the associated @c eventOut. - */ - template <typename FieldValue> - const std::string - abstract_proto_node::proto_eventout<FieldValue>::do_eventout_id() const - OPENVRML_NOTHROW - { - abstract_proto_node & n = this->listener.node; - eventout_map_t::const_iterator pos = - std::find_if(n.eventout_map.begin(), n.eventout_map.end(), - proto_eventout_equal_to(*this)); - assert(pos != n.eventout_map.end()); - return pos->first; - } - - /** - * @brief Factory function for @c proto_eventout<FieldValue> instances. - * - * @param[in] type @c field_value::type_id. - * @param[in] node @c abstract_proto_node. - * - * @return a @c boost::shared_ptr to a @c proto_eventout<FieldValue> - * instance. - * - * @exception std::bad_alloc if memory allocation fails. - */ - boost::shared_ptr<event_emitter> - abstract_proto_node::create_eventout(const field_value::type_id type, - abstract_proto_node & node) - OPENVRML_THROW1(std::bad_alloc) - { - using boost::mpl::for_each; - using openvrml_::field_value_types; - - boost::shared_ptr<openvrml::event_emitter> result; - for_each<field_value_types>( - proto_eventout_creator(type, node, result)); - assert(result); - return result; - } - - /** - * @internal - * - * @class proto_node::proto_exposedfield - * - * @brief @c PROTO @c exposedField handler class template. - */ - - /** - * @brief Construct. - * - * @param[in] node proto_node. - * @param[in] initial_value initial value. - */ - template <typename FieldValue> - proto_node::proto_exposedfield<FieldValue>:: - proto_exposedfield(abstract_proto_node & node, - const FieldValue & initial_value): - node_event_listener(node), - openvrml::event_emitter(this->listener.value), - proto_eventin<FieldValue>(node), - proto_eventout<FieldValue>(node, initial_value) - {} - - /** - * @brief Destroy. - */ - template <typename FieldValue> - proto_node::proto_exposedfield<FieldValue>::~proto_exposedfield() - OPENVRML_NOTHROW - {} - - /** - * @brief Process an event. - * - * @param[in] value event value. - * @param[in] timestamp the current time. - * - * @exception std::bad_alloc if memory allocation fails. - */ - template <typename FieldValue> - void - proto_node::proto_exposedfield<FieldValue>:: - do_process_event(const FieldValue & value, const double timestamp) - OPENVRML_THROW1(std::bad_alloc) - { - this->proto_eventin<FieldValue>::do_process_event(value, timestamp); - this->listener.value = value; - node::emit_event(*this, timestamp); - } - - /** - * @brief Factory function for @c proto_exposedfield<FieldValue> instances. - * - * @param[in] type @c field_value::type_id. - * @param[in] node @c proto_node. - * - * @return a @c boost::shared_ptr to a @c proto_exposedfield<FieldValue> - * instance. - * - * @exception std::bad_alloc if memory allocation fails. - */ - boost::shared_ptr<event_listener> - proto_node::create_exposedfield(const field_value & initial_value, - proto_node & node) - OPENVRML_THROW1(std::bad_alloc) - { - using boost::mpl::for_each; - using openvrml_::field_value_types; - - boost::shared_ptr<openvrml::event_listener> result; - for_each<field_value_types>(proto_exposedfield_creator(initial_value, - node, - result)); - assert(result.get()); - return result; - } - - /** - * @brief Construct. - * - * @param[in] type @c node_type. - * @param[in] scope @c scope. - * - * @exception std::bad_alloc if memory allocation fails. - */ - proto_node::proto_node(const node_type & type, - const boost::shared_ptr<openvrml::scope> & scope, - const initial_value_map & initial_values) - OPENVRML_THROW1(std::bad_alloc): - abstract_proto_node(type, scope), - proto_scope(scope) - { - const proto_node_metatype & node_metatype = - static_cast<const proto_node_metatype &>(type.metatype()); - - this->impl_nodes = proto_impl_cloner(node_metatype, - initial_values, - this->proto_scope).clone(); - - // - // Establish routes. - // - typedef proto_node_metatype::routes_t routes_t; - for (routes_t::const_iterator route = node_metatype.routes.begin(); - route != node_metatype.routes.end(); - ++route) { - // XXX - // XXX It would be better to store the node_paths along with the - // XXX route instead of rebuilding them every time we instantiate - // XXX the PROTO. - // XXX - node_path_t path_to_from; - assert(!node_metatype.impl_nodes.empty()); - path_getter(*route->from, path_to_from) - .get_path_from(node_metatype.impl_nodes); - assert(!path_to_from.empty()); - node * const from_node = resolve_node_path(path_to_from, - this->impl_nodes); - assert(from_node); - - node_path_t path_to_to; - path_getter(*route->to, path_to_to) - .get_path_from(node_metatype.impl_nodes); - node * const to_node = resolve_node_path(path_to_to, - this->impl_nodes); - assert(to_node); - - try { - add_route(*from_node, route->eventout, - *to_node, route->eventin); - } catch (unsupported_interface & ex) { - OPENVRML_PRINT_EXCEPTION_(ex); - } catch (field_v... [truncated message content] |
From: <br...@us...> - 2008-09-26 21:57:24
|
Revision: 3696 http://openvrml.svn.sourceforge.net/openvrml/?rev=3696&view=rev Author: braden Date: 2008-09-26 21:57:13 +0000 (Fri, 26 Sep 2008) Log Message: ----------- Moved proto_node class from an inner class of openvrml::local::proto_node_metatype to the openvrml::local namespace. proto_node needs access to the private parts of openvrml::node; and gcc 4.0 requires us to grant friendship to proto_node specifically (rather than granting friendship to proto_node_metatype when proto_node is an inner class of it). We need to be able to forward-declare proto_node (the public header node.h cannot include the private proto.h); and to accommodate that, proto_node cannot be an inner class. Modified Paths: -------------- trunk/ChangeLog trunk/src/libopenvrml/openvrml/local/proto.cpp trunk/src/libopenvrml/openvrml/local/proto.h trunk/src/libopenvrml/openvrml/node.h Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-09-26 15:00:32 UTC (rev 3695) +++ trunk/ChangeLog 2008-09-26 21:57:13 UTC (rev 3696) @@ -1,5 +1,21 @@ 2008-09-26 Braden McDaniel <br...@en...> + Moved proto_node class from an inner class of + openvrml::local::proto_node_metatype to the openvrml::local + namespace. proto_node needs access to the private parts of + openvrml::node; and gcc 4.0 requires us to grant friendship to + proto_node specifically (rather than granting friendship to + proto_node_metatype when proto_node is an inner class of it). We + need to be able to forward-declare proto_node (the public header + node.h cannot include the private proto.h); and to accommodate + that, proto_node cannot be an inner class. + + * src/libopenvrml/openvrml/local/proto.cpp + * src/libopenvrml/openvrml/local/proto.h + * src/libopenvrml/openvrml/node.h + +2008-09-26 Braden McDaniel <br...@en...> + Moved PROTO implementation classes to the openvrml::local namespace and out of browser.cpp. Modified: trunk/src/libopenvrml/openvrml/local/proto.cpp =================================================================== --- trunk/src/libopenvrml/openvrml/local/proto.cpp 2008-09-26 15:00:32 UTC (rev 3695) +++ trunk/src/libopenvrml/openvrml/local/proto.cpp 2008-09-26 21:57:13 UTC (rev 3696) @@ -55,141 +55,159 @@ OPENVRML_THROW1(std::bad_alloc); }; +namespace openvrml { -/** - * @internal - * - * @brief A @c PROTO instance node. - * - * Like a typical node implementation, @c proto_node%s have a many-to-one - * relationship with the @c proto_node_type instance that creates them. - * And @c proto_node_type has, in turn, a many-to-one relationship with - * the @c proto_node_metatype instance that creates them. Unlike a - * typical node implementation, there will very likely be more than one - * @c proto_node_metatype instance known to the @c browser instance; there - * will be one for each @c PROTO known to the @c browser. - * - * As the @c proto_node_metatype encodes the data in a @c PROTO, the - * @c proto_node_type can be seen as modeling @c EXTERNPROTO. Each - * @c EXTERNPROTO will spawn a new @c proto_node_type from the - * @c proto_node_metatype that corresponds to the @c PROTO to which the - * @c EXTERNPROTO refers. Recall that an @c EXTERNPROTO provides a subset - * of the interfaces defined for a @c PROTO; thus, for a @c PROTO with - * <var>n</var> interfaces, there are <var>n</var>! possible unique - * @c EXTERNPROTO%s (and thus unique @c proto_node_type instances). - * - * Structurally, the implementation of @c proto_node is very similar to - * that of @c proto_node_metatype. The difference is that event pathways - * for @c ROUTE%s and @c IS mappings are actually created in the - * @c proto_node. The @c proto_node_metatype, on the other hand, includes - * metadata about how these event pathways @e should be created. - */ -class OPENVRML_LOCAL openvrml::local::proto_node_metatype::proto_node : - public openvrml::local::abstract_proto_node { + namespace local { - template <typename FieldValue> - class proto_exposedfield : public proto_eventin<FieldValue>, - public proto_eventout<FieldValue> { - public: - proto_exposedfield(abstract_proto_node & node, - const FieldValue & initial_value); - virtual ~proto_exposedfield() OPENVRML_NOTHROW; + /** + * @internal + * + * @brief A @c PROTO instance node. + * + * Like a typical node implementation, @c proto_node%s have a + * many-to-one relationship with the @c proto_node_type instance that + * creates them. And @c proto_node_type has, in turn, a many-to-one + * relationship with the @c proto_node_metatype instance that creates + * them. Unlike a typical node implementation, there will very likely + * be more than one @c proto_node_metatype instance known to the + * @c browser instance; there will be one for each @c PROTO known to + * the @c browser. + * + * As the @c proto_node_metatype encodes the data in a @c PROTO, the + * @c proto_node_type can be seen as modeling @c EXTERNPROTO. Each + * @c EXTERNPROTO will spawn a new @c proto_node_type from the + * @c proto_node_metatype that corresponds to the @c PROTO to which the + * @c EXTERNPROTO refers. Recall that an @c EXTERNPROTO provides a + * subset of the interfaces defined for a @c PROTO; thus, for a + * @c PROTO with <var>n</var> interfaces, there are <var>n</var>! + * possible unique @c EXTERNPROTO%s (and thus unique + * @c proto_node_type instances). + * + * Structurally, the implementation of @c proto_node is very similar + * to that of @c proto_node_metatype. The difference is that event + * pathways for @c ROUTE%s and @c IS mappings are actually created in + * the @c proto_node. The @c proto_node_metatype, on the other hand, + * includes metadata about how these event pathways @e should be + * created. + */ + class OPENVRML_LOCAL proto_node : public abstract_proto_node { - private: - virtual void do_process_event(const FieldValue & value, - double timestamp) - OPENVRML_THROW1(std::bad_alloc); - }; + template <typename FieldValue> + class proto_exposedfield : public proto_eventin<FieldValue>, + public proto_eventout<FieldValue> { + public: + proto_exposedfield(abstract_proto_node & node, + const FieldValue & initial_value); + virtual ~proto_exposedfield() OPENVRML_NOTHROW; - struct proto_exposedfield_creator { - proto_exposedfield_creator( - const openvrml::field_value & initial_value, - proto_node & node, - boost::shared_ptr<openvrml::event_listener> & exposedfield): - initial_value_(&initial_value), - node_(&node), - exposedfield_(&exposedfield) - {} + private: + virtual void do_process_event(const FieldValue & value, + double timestamp) + OPENVRML_THROW1(std::bad_alloc); + }; - template <typename T> - void operator()(T) const - { - if (T::field_value_type_id == this->initial_value_->type()) { - using boost::polymorphic_downcast; - this->exposedfield_->reset( - new proto_exposedfield<T>( - *this->node_, - *polymorphic_downcast<const T *>( - this->initial_value_))); + struct proto_exposedfield_creator { + proto_exposedfield_creator( + const openvrml::field_value & initial_value, + proto_node & node, + boost::shared_ptr<openvrml::event_listener> & exposedfield): + initial_value_(&initial_value), + node_(&node), + exposedfield_(&exposedfield) + {} + + template <typename T> + void operator()(T) const + { + if (T::field_value_type_id == this->initial_value_->type()) + { + using boost::polymorphic_downcast; + this->exposedfield_->reset( + new proto_exposedfield<T>( + *this->node_, + *polymorphic_downcast<const T *>( + this->initial_value_))); + } } - } - private: - const openvrml::field_value * initial_value_; - proto_node * node_; - boost::shared_ptr<openvrml::event_listener> * exposedfield_; - }; + private: + const openvrml::field_value * initial_value_; + proto_node * node_; + boost::shared_ptr<openvrml::event_listener> * exposedfield_; + }; - static boost::shared_ptr<openvrml::event_listener> - create_exposedfield(const openvrml::field_value & initial_value, - proto_node & node) - OPENVRML_THROW1(std::bad_alloc); + static boost::shared_ptr<openvrml::event_listener> + create_exposedfield(const openvrml::field_value & initial_value, + proto_node & node) + OPENVRML_THROW1(std::bad_alloc); - boost::shared_ptr<openvrml::scope> proto_scope; - std::vector<boost::intrusive_ptr<node> > impl_nodes; + boost::shared_ptr<openvrml::scope> proto_scope; + std::vector<boost::intrusive_ptr<node> > impl_nodes; -public: - proto_node(const openvrml::node_type & type, - const boost::shared_ptr<openvrml::scope> & scope, - const openvrml::initial_value_map & initial_values) - OPENVRML_THROW1(std::bad_alloc); - virtual ~proto_node() OPENVRML_NOTHROW; + public: + proto_node(const openvrml::node_type & type, + const boost::shared_ptr<openvrml::scope> & scope, + const openvrml::initial_value_map & initial_values) + OPENVRML_THROW1(std::bad_alloc); + virtual ~proto_node() OPENVRML_NOTHROW; - virtual bool modified() const; + virtual bool modified() const; -private: - virtual void do_initialize(double timestamp) - OPENVRML_THROW1(std::bad_alloc); + private: + virtual void do_initialize(double timestamp) + OPENVRML_THROW1(std::bad_alloc); - virtual - const openvrml::field_value & do_field(const std::string & id) const - OPENVRML_THROW1(openvrml::unsupported_interface); - virtual openvrml::event_listener & - do_event_listener(const std::string & id) - OPENVRML_THROW1(openvrml::unsupported_interface); - virtual openvrml::event_emitter & - do_event_emitter(const std::string & id) - OPENVRML_THROW1(openvrml::unsupported_interface); + virtual + const openvrml::field_value & do_field(const std::string & id) const + OPENVRML_THROW1(openvrml::unsupported_interface); + virtual openvrml::event_listener & + do_event_listener(const std::string & id) + OPENVRML_THROW1(openvrml::unsupported_interface); + virtual openvrml::event_emitter & + do_event_emitter(const std::string & id) + OPENVRML_THROW1(openvrml::unsupported_interface); - virtual void do_shutdown(double timestamp) OPENVRML_NOTHROW; + virtual void do_shutdown(double timestamp) OPENVRML_NOTHROW; - virtual openvrml::script_node * to_script() OPENVRML_NOTHROW; - virtual openvrml::appearance_node * to_appearance() OPENVRML_NOTHROW; - virtual openvrml::bounded_volume_node * to_bounded_volume() OPENVRML_NOTHROW; - virtual openvrml::child_node * to_child() OPENVRML_NOTHROW; - virtual openvrml::color_node * to_color() OPENVRML_NOTHROW; - virtual openvrml::color_rgba_node * to_color_rgba() OPENVRML_NOTHROW; - virtual openvrml::coordinate_node * to_coordinate() OPENVRML_NOTHROW; - virtual openvrml::font_style_node * to_font_style() OPENVRML_NOTHROW ; - virtual openvrml::geometry_node * to_geometry() OPENVRML_NOTHROW; - virtual openvrml::grouping_node * to_grouping() OPENVRML_NOTHROW; - virtual openvrml::light_node * to_light() OPENVRML_NOTHROW; - virtual openvrml::material_node * to_material() OPENVRML_NOTHROW; - virtual openvrml::navigation_info_node * to_navigation_info() OPENVRML_NOTHROW; - virtual openvrml::normal_node * to_normal() OPENVRML_NOTHROW; - virtual openvrml::pointing_device_sensor_node * to_pointing_device_sensor() - OPENVRML_NOTHROW; - virtual openvrml::scoped_light_node * to_scoped_light() OPENVRML_NOTHROW; - virtual openvrml::sound_source_node * to_sound_source() OPENVRML_NOTHROW; - virtual openvrml::texture_node * to_texture() OPENVRML_NOTHROW; - virtual openvrml::texture_coordinate_node * to_texture_coordinate() - OPENVRML_NOTHROW; - virtual openvrml::texture_transform_node * to_texture_transform() - OPENVRML_NOTHROW; - virtual openvrml::time_dependent_node * to_time_dependent() OPENVRML_NOTHROW; - virtual openvrml::transform_node * to_transform() OPENVRML_NOTHROW; - virtual openvrml::viewpoint_node * to_viewpoint() OPENVRML_NOTHROW; -}; + virtual openvrml::script_node * to_script() OPENVRML_NOTHROW; + virtual openvrml::appearance_node * to_appearance() + OPENVRML_NOTHROW; + virtual openvrml::bounded_volume_node * to_bounded_volume() + OPENVRML_NOTHROW; + virtual openvrml::child_node * to_child() OPENVRML_NOTHROW; + virtual openvrml::color_node * to_color() OPENVRML_NOTHROW; + virtual openvrml::color_rgba_node * to_color_rgba() + OPENVRML_NOTHROW; + virtual openvrml::coordinate_node * to_coordinate() + OPENVRML_NOTHROW; + virtual openvrml::font_style_node * to_font_style() + OPENVRML_NOTHROW ; + virtual openvrml::geometry_node * to_geometry() OPENVRML_NOTHROW; + virtual openvrml::grouping_node * to_grouping() OPENVRML_NOTHROW; + virtual openvrml::light_node * to_light() OPENVRML_NOTHROW; + virtual openvrml::material_node * to_material() OPENVRML_NOTHROW; + virtual openvrml::navigation_info_node * to_navigation_info() + OPENVRML_NOTHROW; + virtual openvrml::normal_node * to_normal() OPENVRML_NOTHROW; + virtual + openvrml::pointing_device_sensor_node * to_pointing_device_sensor() + OPENVRML_NOTHROW; + virtual openvrml::scoped_light_node * to_scoped_light() + OPENVRML_NOTHROW; + virtual openvrml::sound_source_node * to_sound_source() + OPENVRML_NOTHROW; + virtual openvrml::texture_node * to_texture() OPENVRML_NOTHROW; + virtual openvrml::texture_coordinate_node * to_texture_coordinate() + OPENVRML_NOTHROW; + virtual openvrml::texture_transform_node * to_texture_transform() + OPENVRML_NOTHROW; + virtual openvrml::time_dependent_node * to_time_dependent() + OPENVRML_NOTHROW; + virtual openvrml::transform_node * to_transform() OPENVRML_NOTHROW; + virtual openvrml::viewpoint_node * to_viewpoint() OPENVRML_NOTHROW; + }; + } +} namespace { @@ -952,7 +970,7 @@ * @param[in] initial_value initial value. */ template <typename FieldValue> -openvrml::local::proto_node_metatype::proto_node:: +openvrml::local::proto_node:: proto_exposedfield<FieldValue>:: proto_exposedfield(abstract_proto_node & node, const FieldValue & initial_value): @@ -966,7 +984,7 @@ * @brief Destroy. */ template <typename FieldValue> -openvrml::local::proto_node_metatype::proto_node:: +openvrml::local::proto_node:: proto_exposedfield<FieldValue>::~proto_exposedfield() OPENVRML_NOTHROW {} @@ -981,7 +999,7 @@ */ template <typename FieldValue> void -openvrml::local::proto_node_metatype::proto_node:: +openvrml::local::proto_node:: proto_exposedfield<FieldValue>:: do_process_event(const FieldValue & value, const double timestamp) OPENVRML_THROW1(std::bad_alloc) @@ -1003,7 +1021,7 @@ * @exception std::bad_alloc if memory allocation fails. */ boost::shared_ptr<openvrml::event_listener> -openvrml::local::proto_node_metatype::proto_node:: +openvrml::local::proto_node:: create_exposedfield(const openvrml::field_value & initial_value, proto_node & node) OPENVRML_THROW1(std::bad_alloc) @@ -1027,7 +1045,7 @@ * * @exception std::bad_alloc if memory allocation fails. */ -openvrml::local::proto_node_metatype::proto_node:: +openvrml::local::proto_node:: proto_node(const openvrml::node_type & type, const boost::shared_ptr<openvrml::scope> & scope, const openvrml::initial_value_map & initial_values) @@ -1038,9 +1056,10 @@ const proto_node_metatype & node_metatype = static_cast<const proto_node_metatype &>(type.metatype()); - this->impl_nodes = proto_impl_cloner(node_metatype, - initial_values, - this->proto_scope).clone(); + this->impl_nodes = + proto_node_metatype::proto_impl_cloner(node_metatype, + initial_values, + this->proto_scope).clone(); // // Establish routes. @@ -1236,7 +1255,7 @@ /** * @brief Destroy. */ -openvrml::local::proto_node_metatype::proto_node::~proto_node() OPENVRML_NOTHROW +openvrml::local::proto_node::~proto_node() OPENVRML_NOTHROW {} /** @@ -1245,7 +1264,7 @@ * @return @c true if the node has changed and needs to be rerendered; * @c false otherwise. */ -bool openvrml::local::proto_node_metatype::proto_node::modified() const +bool openvrml::local::proto_node::modified() const { return !this->impl_nodes.empty() ? this->impl_nodes.front()->modified() @@ -1259,7 +1278,7 @@ * * @exception std::bad_alloc if memory allocation fails. */ -void openvrml::local::proto_node_metatype::proto_node:: +void openvrml::local::proto_node:: do_initialize(const double timestamp) OPENVRML_THROW1(std::bad_alloc) { @@ -1285,7 +1304,7 @@ * @todo Make this function handle @c exposedFields. */ const openvrml::field_value & -openvrml::local::proto_node_metatype::proto_node:: +openvrml::local::proto_node:: do_field(const std::string & id) const OPENVRML_THROW1(unsupported_interface) { @@ -1340,7 +1359,7 @@ * @exception unsupported_interface if the node has no @c eventIn @p id. */ openvrml::event_listener & -openvrml::local::proto_node_metatype::proto_node:: +openvrml::local::proto_node:: do_event_listener(const std::string & id) OPENVRML_THROW1(unsupported_interface) { @@ -1366,7 +1385,7 @@ * @exception unsupported_interface if the node has no @c eventOut @p id. */ openvrml::event_emitter & -openvrml::local::proto_node_metatype::proto_node:: +openvrml::local::proto_node:: do_event_emitter(const std::string & id) OPENVRML_THROW1(unsupported_interface) { @@ -1388,7 +1407,7 @@ * @param[in] timestamp the current time. */ void -openvrml::local::proto_node_metatype::proto_node:: +openvrml::local::proto_node:: do_shutdown(const double timestamp) OPENVRML_NOTHROW { @@ -1408,7 +1427,7 @@ * is a @c script_node, or 0 otherwise. */ openvrml::script_node * -openvrml::local::proto_node_metatype::proto_node::to_script() OPENVRML_NOTHROW +openvrml::local::proto_node::to_script() OPENVRML_NOTHROW { assert(!this->impl_nodes.empty()); assert(this->impl_nodes[0]); @@ -1422,7 +1441,7 @@ * is an @c appearance_node, or 0 otherwise. */ openvrml::appearance_node * -openvrml::local::proto_node_metatype::proto_node::to_appearance() +openvrml::local::proto_node::to_appearance() OPENVRML_NOTHROW { assert(!this->impl_nodes.empty()); @@ -1437,7 +1456,7 @@ * is a @c bounded_volume_node, or 0 otherwise. */ openvrml::bounded_volume_node * -openvrml::local::proto_node_metatype::proto_node::to_bounded_volume() +openvrml::local::proto_node::to_bounded_volume() OPENVRML_NOTHROW { assert(!this->impl_nodes.empty()); @@ -1452,7 +1471,7 @@ * is a @c child_node, or 0 otherwise. */ openvrml::child_node * -openvrml::local::proto_node_metatype::proto_node::to_child() +openvrml::local::proto_node::to_child() OPENVRML_NOTHROW { assert(!this->impl_nodes.empty()); @@ -1467,7 +1486,7 @@ * is a @c color_node, or 0 otherwise. */ openvrml::color_node * -openvrml::local::proto_node_metatype::proto_node::to_color() +openvrml::local::proto_node::to_color() OPENVRML_NOTHROW { assert(!this->impl_nodes.empty()); @@ -1482,7 +1501,7 @@ * is a @c color_rgba_node, or 0 otherwise. */ openvrml::color_rgba_node * -openvrml::local::proto_node_metatype::proto_node::to_color_rgba() +openvrml::local::proto_node::to_color_rgba() OPENVRML_NOTHROW { assert(!this->impl_nodes.empty()); @@ -1497,7 +1516,7 @@ * is a @c coordinate_node, or 0 otherwise. */ openvrml::coordinate_node * -openvrml::local::proto_node_metatype::proto_node::to_coordinate() +openvrml::local::proto_node::to_coordinate() OPENVRML_NOTHROW { assert(!this->impl_nodes.empty()); @@ -1512,7 +1531,7 @@ * is a @c font_style_node, or 0 otherwise. */ openvrml::font_style_node * -openvrml::local::proto_node_metatype::proto_node::to_font_style() +openvrml::local::proto_node::to_font_style() OPENVRML_NOTHROW { assert(!this->impl_nodes.empty()); @@ -1527,7 +1546,7 @@ * is a @c geometry_node, or 0 otherwise. */ openvrml::geometry_node * -openvrml::local::proto_node_metatype::proto_node::to_geometry() +openvrml::local::proto_node::to_geometry() OPENVRML_NOTHROW { assert(!this->impl_nodes.empty()); @@ -1542,7 +1561,7 @@ * is a @c grouping_node, or 0 otherwise. */ openvrml::grouping_node * -openvrml::local::proto_node_metatype::proto_node::to_grouping() +openvrml::local::proto_node::to_grouping() OPENVRML_NOTHROW { assert(!this->impl_nodes.empty()); @@ -1557,7 +1576,7 @@ * is a @c light_node, or 0 otherwise. */ openvrml::light_node * -openvrml::local::proto_node_metatype::proto_node::to_light() +openvrml::local::proto_node::to_light() OPENVRML_NOTHROW { assert(!this->impl_nodes.empty()); @@ -1572,7 +1591,7 @@ * is a @c material_node, or 0 otherwise. */ openvrml::material_node * -openvrml::local::proto_node_metatype::proto_node::to_material() +openvrml::local::proto_node::to_material() OPENVRML_NOTHROW { assert(!this->impl_nodes.empty()); @@ -1587,7 +1606,7 @@ * is a @c navigation_info_node, or 0 otherwise. */ openvrml::navigation_info_node * -openvrml::local::proto_node_metatype::proto_node::to_navigation_info() +openvrml::local::proto_node::to_navigation_info() OPENVRML_NOTHROW { assert(!this->impl_nodes.empty()); @@ -1602,7 +1621,7 @@ * is a @c normal_node, or 0 otherwise. */ openvrml::normal_node * -openvrml::local::proto_node_metatype::proto_node::to_normal() +openvrml::local::proto_node::to_normal() OPENVRML_NOTHROW { assert(!this->impl_nodes.empty()); @@ -1617,7 +1636,7 @@ * is a @c pointing_device_sensor_node, or 0 otherwise. */ openvrml::pointing_device_sensor_node * -openvrml::local::proto_node_metatype::proto_node::to_pointing_device_sensor() +openvrml::local::proto_node::to_pointing_device_sensor() OPENVRML_NOTHROW { assert(!this->impl_nodes.empty()); @@ -1633,7 +1652,7 @@ * is a @c scoped_light_node, or 0 otherwise. */ openvrml::scoped_light_node * -openvrml::local::proto_node_metatype::proto_node::to_scoped_light() +openvrml::local::proto_node::to_scoped_light() OPENVRML_NOTHROW { assert(!this->impl_nodes.empty()); @@ -1648,7 +1667,7 @@ * is a @c sound_source_node, or 0 otherwise. */ openvrml::sound_source_node * -openvrml::local::proto_node_metatype::proto_node::to_sound_source() +openvrml::local::proto_node::to_sound_source() OPENVRML_NOTHROW { assert(!this->impl_nodes.empty()); @@ -1663,7 +1682,7 @@ * is a @c texture_node, or 0 otherwise. */ openvrml::texture_node * -openvrml::local::proto_node_metatype::proto_node::to_texture() +openvrml::local::proto_node::to_texture() OPENVRML_NOTHROW { assert(!this->impl_nodes.empty()); @@ -1678,7 +1697,7 @@ * is a @c texture_coordinate_node, or 0 otherwise. */ openvrml::texture_coordinate_node * -openvrml::local::proto_node_metatype::proto_node::to_texture_coordinate() +openvrml::local::proto_node::to_texture_coordinate() OPENVRML_NOTHROW { assert(!this->impl_nodes.empty()); @@ -1693,7 +1712,7 @@ * is a @c texture_transform_node, or 0 otherwise. */ openvrml::texture_transform_node * -openvrml::local::proto_node_metatype::proto_node::to_texture_transform() +openvrml::local::proto_node::to_texture_transform() OPENVRML_NOTHROW { assert(!this->impl_nodes.empty()); @@ -1708,7 +1727,7 @@ * is a @c time_dependent_node, or 0 otherwise. */ openvrml::time_dependent_node * -openvrml::local::proto_node_metatype::proto_node::to_time_dependent() +openvrml::local::proto_node::to_time_dependent() OPENVRML_NOTHROW { assert(!this->impl_nodes.empty()); @@ -1723,7 +1742,7 @@ * is a @c transform_node, or 0 otherwise. */ openvrml::transform_node * -openvrml::local::proto_node_metatype::proto_node::to_transform() +openvrml::local::proto_node::to_transform() OPENVRML_NOTHROW { assert(!this->impl_nodes.empty()); @@ -1738,7 +1757,7 @@ * is a @c viewpoint_node, or 0 otherwise. */ openvrml::viewpoint_node * -openvrml::local::proto_node_metatype::proto_node::to_viewpoint() +openvrml::local::proto_node::to_viewpoint() OPENVRML_NOTHROW { assert(!this->impl_nodes.empty()); Modified: trunk/src/libopenvrml/openvrml/local/proto.h =================================================================== --- trunk/src/libopenvrml/openvrml/local/proto.h 2008-09-26 15:00:32 UTC (rev 3695) +++ trunk/src/libopenvrml/openvrml/local/proto.h 2008-09-26 21:57:13 UTC (rev 3696) @@ -29,6 +29,8 @@ namespace local { + class proto_node; + /** * @internal * @@ -40,7 +42,8 @@ * of @c proto_node instances. */ class OPENVRML_LOCAL proto_node_metatype : public node_metatype { - class proto_node; + friend class proto_node; + class proto_node_type; class proto_impl_cloner; Modified: trunk/src/libopenvrml/openvrml/node.h =================================================================== --- trunk/src/libopenvrml/openvrml/node.h 2008-09-26 15:00:32 UTC (rev 3695) +++ trunk/src/libopenvrml/openvrml/node.h 2008-09-26 21:57:13 UTC (rev 3696) @@ -364,11 +364,11 @@ template <typename FieldValue> class exposedfield; namespace local { - class proto_node_metatype; + class proto_node; }; class OPENVRML_API node : boost::noncopyable { - friend class local::proto_node_metatype; + friend class local::proto_node; friend class externproto_node; friend OPENVRML_API std::ostream & operator<<(std::ostream & out, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-09-27 07:43:15
|
Revision: 3697 http://openvrml.svn.sourceforge.net/openvrml/?rev=3697&view=rev Author: braden Date: 2008-09-27 07:43:08 +0000 (Sat, 27 Sep 2008) Log Message: ----------- Fixes for Windows. Modified Paths: -------------- trunk/ChangeLog trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml/openvrml.vcproj trunk/src/libopenvrml/openvrml/local/dl.cpp trunk/src/libopenvrml/openvrml/local/uri.cpp trunk/src/libopenvrml/openvrml/local/xml_reader.cpp Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-09-26 21:57:13 UTC (rev 3696) +++ trunk/ChangeLog 2008-09-27 07:43:08 UTC (rev 3697) @@ -1,3 +1,12 @@ +2008-09-27 Braden McDaniel <br...@en...> + + Fixes for the Visual C++ build. + + * ide-projects/Windows/VisualC9_0/OpenVRML/openvrml/openvrml.vcproj + * src/libopenvrml/openvrml/local/dl.cpp + * src/libopenvrml/openvrml/local/uri.cpp + * src/libopenvrml/openvrml/local/xml_reader.cpp + 2008-09-26 Braden McDaniel <br...@en...> Moved proto_node class from an inner class of Modified: trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml/openvrml.vcproj =================================================================== --- trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml/openvrml.vcproj 2008-09-26 21:57:13 UTC (rev 3696) +++ trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml/openvrml.vcproj 2008-09-27 07:43:08 UTC (rev 3697) @@ -191,6 +191,10 @@ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm" > <File + RelativePath="..\..\..\..\..\src\libopenvrml\openvrml\bad_url.cpp" + > + </File> + <File RelativePath="..\..\..\..\..\src\libopenvrml\openvrml\basetypes.cpp" > <FileConfiguration @@ -220,6 +224,10 @@ </FileConfiguration> </File> <File + RelativePath="..\..\..\..\..\src\libopenvrml\openvrml\local\dl.cpp" + > + </File> + <File RelativePath="..\..\..\..\..\src\libopenvrml\openvrml\event.cpp" > </File> @@ -244,6 +252,10 @@ > </File> <File + RelativePath="..\..\..\..\..\src\libopenvrml\openvrml\local\proto.cpp" + > + </File> + <File RelativePath="..\..\..\..\..\src\libopenvrml\openvrml\read_write_mutex.cpp" > </File> @@ -252,10 +264,22 @@ > </File> <File + RelativePath="..\..\..\..\..\src\libopenvrml\openvrml\scene.cpp" + > + </File> + <File RelativePath="..\..\..\..\..\src\libopenvrml\openvrml\scope.cpp" > </File> <File + RelativePath="..\..\..\..\..\src\libopenvrml\openvrml\script.cpp" + > + </File> + <File + RelativePath="..\..\..\..\..\src\libopenvrml\openvrml\local\uri.cpp" + > + </File> + <File RelativePath="..\..\..\..\..\src\libopenvrml\openvrml\viewer.cpp" > </File> @@ -351,12 +375,20 @@ RelativePath="..\..\..\..\..\src\libopenvrml\openvrml\x3d_texturing.cpp" > </File> + <File + RelativePath="..\..\..\..\..\src\libopenvrml\openvrml\local\xml_reader.cpp" + > + </File> </Filter> <Filter Name="Header Files" Filter="h;hpp;hxx;hm;inl;inc" > <File + RelativePath="..\..\..\..\..\src\libopenvrml\openvrml\bad_url.h" + > + </File> + <File RelativePath="..\..\..\..\..\src\libopenvrml\openvrml\basetypes.h" > </File> @@ -373,6 +405,10 @@ > </File> <File + RelativePath="..\..\..\..\..\src\libopenvrml\openvrml\local\dl.h" + > + </File> + <File RelativePath="..\..\..\..\..\src\libopenvrml\openvrml\event.h" > </File> @@ -409,6 +445,10 @@ > </File> <File + RelativePath="..\..\..\..\..\src\libopenvrml\openvrml\local\proto.h" + > + </File> + <File RelativePath="..\..\..\..\..\src\libopenvrml\openvrml\read_write_mutex.h" > </File> @@ -417,6 +457,10 @@ > </File> <File + RelativePath="..\..\..\..\..\src\libopenvrml\openvrml\scene.h" + > + </File> + <File RelativePath="..\..\..\..\..\src\libopenvrml\openvrml\scope.h" > </File> @@ -425,6 +469,10 @@ > </File> <File + RelativePath="..\..\..\..\..\src\libopenvrml\openvrml\local\uri.h" + > + </File> + <File RelativePath="..\..\..\..\..\src\libopenvrml\openvrml\viewer.h" > </File> @@ -504,6 +552,10 @@ RelativePath="..\..\..\..\..\src\libopenvrml\openvrml\x3d_vrml_grammar.h" > </File> + <File + RelativePath="..\..\..\..\..\src\libopenvrml\openvrml\local\xml_reader.h" + > + </File> </Filter> <Filter Name="Resource Files" Modified: trunk/src/libopenvrml/openvrml/local/dl.cpp =================================================================== --- trunk/src/libopenvrml/openvrml/local/dl.cpp 2008-09-26 21:57:13 UTC (rev 3696) +++ trunk/src/libopenvrml/openvrml/local/dl.cpp 2008-09-27 07:43:08 UTC (rev 3697) @@ -20,10 +20,9 @@ # include "dl.h" # include <string> +# include <boost/filesystem.hpp> +# include <boost/tokenizer.hpp> -namespace { -} - int openvrml::local::dl::init() { # ifdef _WIN32 Modified: trunk/src/libopenvrml/openvrml/local/uri.cpp =================================================================== --- trunk/src/libopenvrml/openvrml/local/uri.cpp 2008-09-26 21:57:13 UTC (rev 3696) +++ trunk/src/libopenvrml/openvrml/local/uri.cpp 2008-09-27 07:43:08 UTC (rev 3697) @@ -21,6 +21,10 @@ # include "uri.h" # include <list> # include <cerrno> +# ifdef _WIN32 +# include <boost/multi_index/detail/scope_guard.hpp> +using namespace boost::multi_index::detail; // for scope_guard +# endif openvrml::local::uri::uri() OPENVRML_THROW1(std::bad_alloc): scheme_begin(this->str_.begin()), Modified: trunk/src/libopenvrml/openvrml/local/xml_reader.cpp =================================================================== --- trunk/src/libopenvrml/openvrml/local/xml_reader.cpp 2008-09-26 21:57:13 UTC (rev 3696) +++ trunk/src/libopenvrml/openvrml/local/xml_reader.cpp 2008-09-27 07:43:08 UTC (rev 3697) @@ -21,6 +21,8 @@ # include "xml_reader.h" # ifdef _WIN32 # include <shlwapi.h> +# include <boost/multi_index/detail/scope_guard.hpp> +using namespace boost::multi_index::detail; // for scope_guard # endif /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-09-28 04:45:01
|
Revision: 3702 http://openvrml.svn.sourceforge.net/openvrml/?rev=3702&view=rev Author: braden Date: 2008-09-28 04:44:49 +0000 (Sun, 28 Sep 2008) Log Message: ----------- More documentation improvements. Modified Paths: -------------- trunk/ChangeLog trunk/doc/Makefile.am trunk/src/libopenvrml/openvrml/viewer.cpp Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-09-28 04:35:32 UTC (rev 3701) +++ trunk/ChangeLog 2008-09-28 04:44:49 UTC (rev 3702) @@ -1,3 +1,11 @@ +2008-09-28 Braden McDaniel <br...@en...> + + More documentation improvements. + + * src/libopenvrml/openvrml/viewer.cpp + * doc/Makefile.am + (CUSTOMIZED_IMAGES): Added x3d-white-on-black.png. + 2008-09-27 Braden McDaniel <br...@en...> Documentation improvements. No longer use the Doxygen default Modified: trunk/doc/Makefile.am =================================================================== --- trunk/doc/Makefile.am 2008-09-28 04:35:32 UTC (rev 3701) +++ trunk/doc/Makefile.am 2008-09-28 04:44:49 UTC (rev 3702) @@ -72,6 +72,7 @@ CUSTOMIZED_IMAGES = \ $(srcdir)/manual/OGL_sm_wht.png \ + $(srcdir)/manual/x3d-white-on-black.png \ $(srcdir)/manual/tab_b-openvrml.png \ $(srcdir)/manual/tab_l-openvrml.png \ $(srcdir)/manual/tab_r-openvrml.png Modified: trunk/src/libopenvrml/openvrml/viewer.cpp =================================================================== --- trunk/src/libopenvrml/openvrml/viewer.cpp 2008-09-28 04:35:32 UTC (rev 3701) +++ trunk/src/libopenvrml/openvrml/viewer.cpp 2008-09-28 04:44:49 UTC (rev 3702) @@ -35,7 +35,7 @@ /** * @class openvrml::viewer openvrml/viewer.h * - * @brief Map the scene graph to the underlying graphics library. + * @brief Map the %scene graph to the underlying graphics library. */ /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-09-28 21:15:45
|
Revision: 3704 http://openvrml.svn.sourceforge.net/openvrml/?rev=3704&view=rev Author: braden Date: 2008-09-28 21:15:33 +0000 (Sun, 28 Sep 2008) Log Message: ----------- Updated version to 0.17.99. Modified Paths: -------------- trunk/ChangeLog trunk/configure.ac trunk/doc/Doxyfile trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml/openvrml.rc trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml/openvrml.vcproj trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml-gl/openvrml-gl.rc trunk/mozilla-plugin/configure.ac Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-09-28 04:46:39 UTC (rev 3703) +++ trunk/ChangeLog 2008-09-28 21:15:33 UTC (rev 3704) @@ -1,5 +1,16 @@ 2008-09-28 Braden McDaniel <br...@en...> + Updated version to 0.17.99. + + * configure.ac + * doc/Doxyfile + * ide-projects/Windows/VisualC9_0/OpenVRML/openvrml-gl/openvrml-gl.rc + * ide-projects/Windows/VisualC9_0/OpenVRML/openvrml/openvrml.vcproj + * ide-projects/Windows/VisualC9_0/OpenVRML/openvrml/openvrml.rc + * mozilla-plugin/configure.ac + +2008-09-28 Braden McDaniel <br...@en...> + More documentation improvements. * src/libopenvrml/openvrml/viewer.cpp Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2008-09-28 04:46:39 UTC (rev 3703) +++ trunk/configure.ac 2008-09-28 21:15:33 UTC (rev 3704) @@ -1,4 +1,4 @@ -AC_INIT([OpenVRML], [0.17.8], [ope...@li...]) +AC_INIT([OpenVRML], [0.17.99], [ope...@li...]) AC_PREREQ([2.59]) AC_COPYRIGHT([Portions copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Braden McDaniel]) AC_CONFIG_MACRO_DIR([m4]) Modified: trunk/doc/Doxyfile =================================================================== --- trunk/doc/Doxyfile 2008-09-28 04:46:39 UTC (rev 3703) +++ trunk/doc/Doxyfile 2008-09-28 21:15:33 UTC (rev 3704) @@ -5,7 +5,7 @@ #--------------------------------------------------------------------------- DOXYFILE_ENCODING = UTF-8 PROJECT_NAME = OpenVRML -PROJECT_NUMBER = 0.17.8 +PROJECT_NUMBER = 0.17.99 OUTPUT_DIRECTORY = CREATE_SUBDIRS = NO OUTPUT_LANGUAGE = English Modified: trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml/openvrml.rc =================================================================== --- trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml/openvrml.rc 2008-09-28 04:46:39 UTC (rev 3703) +++ trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml/openvrml.rc 2008-09-28 21:15:33 UTC (rev 3704) @@ -12,7 +12,7 @@ VS_VERSION_INFO VERSIONINFO FILEVERSION 8,6,0,0 - PRODUCTVERSION 0,17,8,0 + PRODUCTVERSION 0,17,99,0 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -33,7 +33,7 @@ VALUE "LegalCopyright", "Copyright (C) 2008" VALUE "OriginalFilename", "openvrml.dll" VALUE "ProductName", "OpenVRML Library" - VALUE "ProductVersion", "0.17.8" + VALUE "ProductVersion", "0.17.99" END END BLOCK "VarFileInfo" Modified: trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml/openvrml.vcproj =================================================================== --- trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml/openvrml.vcproj 2008-09-28 04:46:39 UTC (rev 3703) +++ trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml/openvrml.vcproj 2008-09-28 21:15:33 UTC (rev 3704) @@ -42,7 +42,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories=".;..\..\..\..\..\src\libopenvrml;..\..\..\..\..\src\node" - PreprocessorDefinitions="NOMINMAX;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;PACKAGE_VERSION=\"0.17.8\";BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS;BOOST_MPL_LIMIT_VECTOR_SIZE=30;OPENVRML_BUILD_DLL;OPENVRML_PKGDATADIR_=\"\";OPENVRML_PKGLIBDIR_=\"\"" + PreprocessorDefinitions="NOMINMAX;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;PACKAGE_VERSION=\"0.17.99\";BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS;BOOST_MPL_LIMIT_VECTOR_SIZE=30;OPENVRML_BUILD_DLL;OPENVRML_PKGDATADIR_=\"\";OPENVRML_PKGLIBDIR_=\"\"" MinimalRebuild="false" BasicRuntimeChecks="0" RuntimeLibrary="3" @@ -127,7 +127,7 @@ InlineFunctionExpansion="1" OmitFramePointers="true" AdditionalIncludeDirectories=".;..\..\..\..\..\src\libopenvrml;..\..\..\..\..\src\node" - PreprocessorDefinitions="NOMINMAX;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;PACKAGE_VERSION=\"0.17.8\";BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS;BOOST_MPL_LIMIT_VECTOR_SIZE=30;OPENVRML_BUILD_DLL;OPENVRML_PKGDATADIR_=\"\";OPENVRML_PKGLIBDIR_=\"\";NDEBUG" + PreprocessorDefinitions="NOMINMAX;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;PACKAGE_VERSION=\"0.17.99\";BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS;BOOST_MPL_LIMIT_VECTOR_SIZE=30;OPENVRML_BUILD_DLL;OPENVRML_PKGDATADIR_=\"\";OPENVRML_PKGLIBDIR_=\"\";NDEBUG" StringPooling="true" RuntimeLibrary="2" EnableFunctionLevelLinking="true" Modified: trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml-gl/openvrml-gl.rc =================================================================== --- trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml-gl/openvrml-gl.rc 2008-09-28 04:46:39 UTC (rev 3703) +++ trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml-gl/openvrml-gl.rc 2008-09-28 21:15:33 UTC (rev 3704) @@ -12,7 +12,7 @@ VS_VERSION_INFO VERSIONINFO FILEVERSION 7,2,0,0 - PRODUCTVERSION 0,17,8,0 + PRODUCTVERSION 0,17,99,0 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -33,7 +33,7 @@ VALUE "LegalCopyright", "Copyright (C) 2008" VALUE "OriginalFilename", "openvrml-gl.dll" VALUE "ProductName", "OpenVRML Library" - VALUE "ProductVersion", "0.17.8" + VALUE "ProductVersion", "0.17.99" END END BLOCK "VarFileInfo" Modified: trunk/mozilla-plugin/configure.ac =================================================================== --- trunk/mozilla-plugin/configure.ac 2008-09-28 04:46:39 UTC (rev 3703) +++ trunk/mozilla-plugin/configure.ac 2008-09-28 21:15:33 UTC (rev 3704) @@ -1,5 +1,5 @@ AC_PREREQ([2.53]) -AC_INIT([OpenVRML Mozilla Plugin], [0.17.8], +AC_INIT([OpenVRML Mozilla Plugin], [0.17.99], [ope...@li...]) AC_COPYRIGHT([Portions copyright 2004, 2005, 2006, 2007, 2008 Braden McDaniel]) AC_CONFIG_FILES([Makefile] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-09-30 22:05:50
|
Revision: 3705 http://openvrml.svn.sourceforge.net/openvrml/?rev=3705&view=rev Author: braden Date: 2008-09-30 22:05:34 +0000 (Tue, 30 Sep 2008) Log Message: ----------- Moved openvrml::local::uri::resolve_against to openvrml::local::resolve_against (i.e., made it a nonmember function). Modified Paths: -------------- trunk/ChangeLog trunk/src/libopenvrml/openvrml/browser.cpp trunk/src/libopenvrml/openvrml/local/uri.cpp trunk/src/libopenvrml/openvrml/local/uri.h trunk/src/libopenvrml/openvrml/scene.cpp trunk/src/libopenvrml/openvrml/script.cpp Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-09-28 21:15:33 UTC (rev 3704) +++ trunk/ChangeLog 2008-09-30 22:05:34 UTC (rev 3705) @@ -1,3 +1,15 @@ +2008-09-30 Braden McDaniel <br...@en...> + + Moved openvrml::local::uri::resolve_against to + openvrml::local::resolve_against (i.e., made it a nonmember + function). + + * src/libopenvrml/openvrml/local/uri.cpp + * src/libopenvrml/openvrml/local/uri.h + * src/libopenvrml/openvrml/scene.cpp + * src/libopenvrml/openvrml/browser.cpp + * src/libopenvrml/openvrml/script.cpp + 2008-09-28 Braden McDaniel <br...@en...> Updated version to 0.17.99. Modified: trunk/src/libopenvrml/openvrml/browser.cpp =================================================================== --- trunk/src/libopenvrml/openvrml/browser.cpp 2008-09-28 21:15:33 UTC (rev 3704) +++ trunk/src/libopenvrml/openvrml/browser.cpp 2008-09-30 22:05:34 UTC (rev 3705) @@ -1099,7 +1099,7 @@ resource_id != uri_list.end(); ++resource_id) { const uri absolute_uri = relative(uri(*resource_id)) - ? uri(*resource_id).resolve_against(base_uri) + ? resolve_against(uri(*resource_id), base_uri) : uri(*resource_id); const shared_ptr<openvrml::node_metatype> node_metatype = this->actions_.scene_.browser().node_metatype( @@ -1132,7 +1132,7 @@ resource_id != uri_list.end(); ++resource_id) { const uri absolute_uri = relative(uri(*resource_id)) - ? uri(*resource_id).resolve_against(base_uri) + ? resolve_against(uri(*resource_id), base_uri) : uri(*resource_id); this->actions_.scene_.browser() .add_node_metatype(node_metatype_id(absolute_uri), @@ -2478,7 +2478,8 @@ scope_guard guard = make_obj_guard( *this->externproto_node_metatype_, - &externproto_node_metatype::clear_externproto_node_types); + &externproto_node_metatype:: + clear_externproto_node_types); boost::ignore_unused_variable_warning(guard); auto_ptr<resource_istream> in = @@ -2506,16 +2507,17 @@ ? uri(*alt_uri) : this->scene_->url().empty() ? create_file_url(uri(*alt_uri)) - : uri(*alt_uri).resolve_against( - uri(this->scene_->url())); + : resolve_against(uri(*alt_uri), + uri(this->scene_->url())); const shared_ptr<openvrml::node_metatype> node_metatype = this->scene_->browser().node_metatype( node_metatype_id(absolute_uri)); proto_node_metatype = - dynamic_pointer_cast<openvrml::local::proto_node_metatype>( - node_metatype); + dynamic_pointer_cast< + openvrml::local::proto_node_metatype>( + node_metatype); } if (!proto_node_metatype) { Modified: trunk/src/libopenvrml/openvrml/local/uri.cpp =================================================================== --- trunk/src/libopenvrml/openvrml/local/uri.cpp 2008-09-28 21:15:33 UTC (rev 3704) +++ trunk/src/libopenvrml/openvrml/local/uri.cpp 2008-09-30 22:05:34 UTC (rev 3705) @@ -27,7 +27,7 @@ # endif openvrml::local::uri::uri() OPENVRML_THROW1(std::bad_alloc): -scheme_begin(this->str_.begin()), + scheme_begin(this->str_.begin()), scheme_end(this->str_.begin()), scheme_specific_part_begin(this->str_.begin()), scheme_specific_part_end(this->str_.begin()), @@ -339,22 +339,23 @@ } const openvrml::local::uri -openvrml::local::uri::resolve_against(const uri & absolute_uri) const +openvrml::local::resolve_against(const uri & relative_uri, + const uri & absolute_uri) OPENVRML_THROW1(std::bad_alloc) { using std::list; using std::string; using std::ostringstream; - assert(relative(*this)); + assert(relative(relative_uri)); assert(!relative(absolute_uri)); ostringstream result; result.unsetf(ostringstream::skipws); result << absolute_uri.scheme() << ':'; - if (!this->authority().empty()) { - result << this->scheme_specific_part(); + if (!relative_uri.authority().empty()) { + result << relative_uri.scheme_specific_part(); return uri(result.str()); } else { result << "//" << absolute_uri.authority(); @@ -376,7 +377,7 @@ // // Append the relative path. // - path << this->path(); + path << relative_uri.path(); // // Put the path segments in a list to process them. @@ -431,14 +432,14 @@ // // End in a slash? // - if (*(this->path().end() - 1) == '/') { path << '/'; } + if (*(relative_uri.path().end() - 1) == '/') { path << '/'; } result << path.str(); - const string query = this->query(); + const string query = relative_uri.query(); if (!query.empty()) { result << '?' << query; } - const string fragment = this->fragment(); + const string fragment = relative_uri.fragment(); if (!fragment.empty()) { result << '#' << fragment; } uri result_uri; @@ -514,7 +515,7 @@ base_uri << '/'; } - const uri result = relative_uri.resolve_against(uri(base_uri.str())); + const uri result = resolve_against(relative_uri, uri(base_uri.str())); return result; } Modified: trunk/src/libopenvrml/openvrml/local/uri.h =================================================================== --- trunk/src/libopenvrml/openvrml/local/uri.h 2008-09-28 21:15:33 UTC (rev 3704) +++ trunk/src/libopenvrml/openvrml/local/uri.h 2008-09-30 22:05:34 UTC (rev 3705) @@ -45,7 +45,7 @@ actor_(actor), begin_(begin), end_(end) - {} + {} template <typename T> struct result { @@ -55,9 +55,9 @@ template <typename Tuple> typename phoenix::actor_result<this_type, Tuple>::type eval(Tuple) const - { + { this->actor_(this->begin_(), this->end_()); - } + } }; template <typename SpiritActor, typename Iterator1, typename Iterator2> @@ -79,7 +79,7 @@ struct null_action { template <typename Iterator> void operator()(const Iterator &, const Iterator &) const - {} + {} }; null_action scheme, scheme_specific_part, userinfo, host, port, @@ -838,11 +838,12 @@ const std::string path() const OPENVRML_THROW1(std::bad_alloc); const std::string query() const OPENVRML_THROW1(std::bad_alloc); const std::string fragment() const OPENVRML_THROW1(std::bad_alloc); - - const uri resolve_against(const uri & absolute_uri) const - OPENVRML_THROW1(std::bad_alloc); }; + OPENVRML_LOCAL const uri resolve_against(const uri & relative_uri, + const uri & absolute_uri) + OPENVRML_THROW1(std::bad_alloc); + OPENVRML_LOCAL inline bool relative(const uri & id) { return id.scheme().empty(); Modified: trunk/src/libopenvrml/openvrml/scene.cpp =================================================================== --- trunk/src/libopenvrml/openvrml/scene.cpp 2008-09-28 21:15:33 UTC (rev 3704) +++ trunk/src/libopenvrml/openvrml/scene.cpp 2008-09-30 22:05:34 UTC (rev 3705) @@ -349,7 +349,7 @@ using std::string; using local::uri; return (this->parent_ && !this->url_.empty() && relative(uri(this->url_))) - ? string(uri(this->url_).resolve_against(uri(this->parent_->url()))) + ? string(resolve_against(uri(this->url_), uri(this->parent_->url()))) : this->url_; } @@ -553,7 +553,7 @@ const uri urlElement(url[i]); const string value = relative(urlElement) - ? urlElement.resolve_against(uri(this->url())) + ? resolve_against(urlElement, uri(this->url())) : urlElement; absoluteURIs[i] = value; } catch (invalid_url & ex) { @@ -607,7 +607,7 @@ ? test_uri : (!this->parent() && this->url().empty()) ? create_file_url(test_uri) - : test_uri.resolve_against(uri(this->url())); + : resolve_against(test_uri, uri(this->url())); in = this->browser().fetcher_.get_resource(absolute_uri); } catch (invalid_url &) { std::ostringstream msg; Modified: trunk/src/libopenvrml/openvrml/script.cpp =================================================================== --- trunk/src/libopenvrml/openvrml/script.cpp 2008-09-28 21:15:33 UTC (rev 3704) +++ trunk/src/libopenvrml/openvrml/script.cpp 2008-09-30 22:05:34 UTC (rev 3705) @@ -2503,7 +2503,8 @@ : (!this->scene()->parent() && this->scene()->url().empty()) ? create_file_url(test_uri) - : test_uri.resolve_against(uri(this->scene()->url())); + : resolve_against(test_uri, + uri(this->scene()->url())); in = this->scene()->browser().fetcher_.get_resource(absolute_uri); } catch (invalid_url &) { std::ostringstream msg; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-09-30 22:25:56
|
Revision: 3706 http://openvrml.svn.sourceforge.net/openvrml/?rev=3706&view=rev Author: braden Date: 2008-09-30 22:25:43 +0000 (Tue, 30 Sep 2008) Log Message: ----------- In the spirit of not returning mutable instances by value, change uri's std::string conversion operator to convert to a const std::string. Modified Paths: -------------- trunk/ChangeLog trunk/src/libopenvrml/openvrml/local/uri.cpp trunk/src/libopenvrml/openvrml/local/uri.h Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-09-30 22:05:34 UTC (rev 3705) +++ trunk/ChangeLog 2008-09-30 22:25:43 UTC (rev 3706) @@ -1,5 +1,14 @@ 2008-09-30 Braden McDaniel <br...@en...> + In the spirit of not returning mutable instances by value, change + uri's std::string conversion operator to convert to a const + std::string. + + * src/libopenvrml/openvrml/local/uri.cpp + * src/libopenvrml/openvrml/local/uri.h + +2008-09-30 Braden McDaniel <br...@en...> + Moved openvrml::local::uri::resolve_against to openvrml::local::resolve_against (i.e., made it a nonmember function). Modified: trunk/src/libopenvrml/openvrml/local/uri.cpp =================================================================== --- trunk/src/libopenvrml/openvrml/local/uri.cpp 2008-09-30 22:05:34 UTC (rev 3705) +++ trunk/src/libopenvrml/openvrml/local/uri.cpp 2008-09-30 22:25:43 UTC (rev 3706) @@ -133,7 +133,7 @@ return *this; } -openvrml::local::uri::operator std::string() const +openvrml::local::uri::operator const std::string() const OPENVRML_THROW1(std::bad_alloc) { return this->str_; Modified: trunk/src/libopenvrml/openvrml/local/uri.h =================================================================== --- trunk/src/libopenvrml/openvrml/local/uri.h 2008-09-30 22:05:34 UTC (rev 3705) +++ trunk/src/libopenvrml/openvrml/local/uri.h 2008-09-30 22:25:43 UTC (rev 3706) @@ -824,7 +824,7 @@ uri & operator=(const uri & id) OPENVRML_THROW1(std::bad_alloc); - operator std::string() const OPENVRML_THROW1(std::bad_alloc); + operator const std::string() const OPENVRML_THROW1(std::bad_alloc); void swap(uri & id) OPENVRML_NOTHROW; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-10-03 03:38:41
|
Revision: 3709 http://openvrml.svn.sourceforge.net/openvrml/?rev=3709&view=rev Author: braden Date: 2008-10-03 03:38:38 +0000 (Fri, 03 Oct 2008) Log Message: ----------- Use jlong in JNI function signatures to ensure consistency with javah output. Modified Paths: -------------- trunk/ChangeLog trunk/src/script/java.cpp Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-10-02 07:05:06 UTC (rev 3708) +++ trunk/ChangeLog 2008-10-03 03:38:38 UTC (rev 3709) @@ -1,5 +1,16 @@ 2008-10-02 Braden McDaniel <br...@en...> + Use jlong in JNI function signatures to ensure consistency with + javah output. + + * src/script/java.cpp + (Java_vrml_field_SFString_createPeer(JNIEnv *, jclass, jstring)): + Use jlong for the return type. + (Java_vrml_field_SFTime_createPeer(JNIEnv *, jclass, jdouble)): + Use jlong for the return type. + +2008-10-02 Braden McDaniel <br...@en...> + Keep track of host instances in openvrml-xembed and shut down when the last one terminates. Modified: trunk/src/script/java.cpp =================================================================== --- trunk/src/script/java.cpp 2008-10-02 07:05:06 UTC (rev 3708) +++ trunk/src/script/java.cpp 2008-10-03 03:38:38 UTC (rev 3709) @@ -3236,9 +3236,9 @@ return 0; } -long JNICALL Java_vrml_field_SFString_createPeer(JNIEnv * const env, - jclass, - const jstring jstr) +jlong JNICALL Java_vrml_field_SFString_createPeer(JNIEnv * const env, + jclass, + const jstring jstr) { std::auto_ptr<openvrml::field_value> peer; try { @@ -3317,9 +3317,9 @@ return 0.0; } -long JNICALL Java_vrml_field_SFTime_createPeer(JNIEnv * const env, - jclass, - const jdouble time) +jlong JNICALL Java_vrml_field_SFTime_createPeer(JNIEnv * const env, + jclass, + const jdouble time) { std::auto_ptr<openvrml::sftime> peer;; try { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-10-03 17:32:47
|
Revision: 3710 http://openvrml.svn.sourceforge.net/openvrml/?rev=3710&view=rev Author: braden Date: 2008-10-03 17:32:36 +0000 (Fri, 03 Oct 2008) Log Message: ----------- Can't safely use builddir for relative paths; and we don't need it anyway. Modified Paths: -------------- trunk/ChangeLog trunk/src/Makefile.am Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-10-03 03:38:38 UTC (rev 3709) +++ trunk/ChangeLog 2008-10-03 17:32:36 UTC (rev 3710) @@ -1,3 +1,9 @@ +2008-10-03 Braden McDaniel <br...@en...> + + * src/Makefile.am + (openvrml_player_openvrml_player_CPPFLAGS): Can't safely use + builddir for relative paths; and we don't need it anyway. + 2008-10-02 Braden McDaniel <br...@en...> Use jlong in JNI function signatures to ensure consistency with Modified: trunk/src/Makefile.am =================================================================== --- trunk/src/Makefile.am 2008-10-03 03:38:38 UTC (rev 3709) +++ trunk/src/Makefile.am 2008-10-03 17:32:36 UTC (rev 3710) @@ -709,8 +709,8 @@ -DGNOME_DISABLE_DEPRECATED \ -DOPENVRML_PLAYER_PKGDATADIR_=\"$(datadir)/openvrml-player\" \ -DOPENVRML_LIBEXECDIR_=\"$(libexecdir)\" \ - -I$(builddir)/openvrml-player \ - -I$(builddir)/libopenvrml \ + -Iopenvrml-player \ + -Ilibopenvrml \ -I$(srcdir)/libopenvrml openvrml_player_openvrml_player_CXXFLAGS = \ $(DBUS_G_CFLAGS) \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-09-28 02:40:50
|
Revision: 3698 http://openvrml.svn.sourceforge.net/openvrml/?rev=3698&view=rev Author: braden Date: 2008-09-28 02:40:43 +0000 (Sun, 28 Sep 2008) Log Message: ----------- Documentation improvements. No longer use the Doxygen default style sheet at all. Also, added X3D link to the page footer. Modified Paths: -------------- trunk/ChangeLog trunk/doc/Doxyfile trunk/doc/doxygen-footer trunk/doc/doxygen-header trunk/src/libopenvrml/openvrml/browser.cpp trunk/src/libopenvrml/openvrml/local/proto.cpp trunk/src/libopenvrml/openvrml/local/proto.h trunk/src/libopenvrml/openvrml/node.cpp trunk/src/libopenvrml/openvrml/script.cpp Added Paths: ----------- trunk/doc/manual/x3d-white-on-black.png Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-09-27 07:43:08 UTC (rev 3697) +++ trunk/ChangeLog 2008-09-28 02:40:43 UTC (rev 3698) @@ -1,5 +1,20 @@ 2008-09-27 Braden McDaniel <br...@en...> + Documentation improvements. No longer use the Doxygen default + style sheet at all. Also, added X3D link to the page footer. + + * doc/Doxyfile + * doc/doxygen-footer + * doc/doxygen-header + * doc/manual/x3d-white-on-black.png + * src/libopenvrml/openvrml/local/proto.cpp + * src/libopenvrml/openvrml/local/proto.h + * src/libopenvrml/openvrml/node.cpp + * src/libopenvrml/openvrml/browser.cpp + * src/libopenvrml/openvrml/script.cpp + +2008-09-27 Braden McDaniel <br...@en...> + Fixes for the Visual C++ build. * ide-projects/Windows/VisualC9_0/OpenVRML/openvrml/openvrml.vcproj Modified: trunk/doc/Doxyfile =================================================================== --- trunk/doc/Doxyfile 2008-09-27 07:43:08 UTC (rev 3697) +++ trunk/doc/Doxyfile 2008-09-28 02:40:43 UTC (rev 3698) @@ -93,7 +93,7 @@ FILE_PATTERNS = *.cpp \ *.h RECURSIVE = YES -EXCLUDE = +EXCLUDE = ../src/libopenvrml/openvrml/local EXCLUDE_SYMLINKS = NO EXCLUDE_SYMBOLS = EXAMPLE_PATH = ../examples Modified: trunk/doc/doxygen-footer =================================================================== --- trunk/doc/doxygen-footer 2008-09-27 07:43:08 UTC (rev 3697) +++ trunk/doc/doxygen-footer 2008-09-28 02:40:43 UTC (rev 3698) @@ -1,5 +1,5 @@ </div> -<address class="footer"><span class="images"><a href="http://opengl.org"><img src="OGL_sm_wht.png" width="68" height="32" border="0" alt="OpenGL"></a><a href="http://sourceforge.net"><img src="http://sourceforge.net/sflogo.php?group_id=7151&type=3" width="125" height="37" border="0" alt="SourceForge.net"></a></span><a href="http://sourceforge.net/tracker/?func=add&group_id=7151&atid=107151">Report error</a><br>Generated $datetime by Doxygen $doxygenversion</address> +<address class="footer"><span class="images"><a href="http://web3d.org/x3d/"><img src="x3d-white-on-black.png" width="43" height="32" border="0" alt="X3D"></a><a href="http://opengl.org"><img src="OGL_sm_wht.png" width="68" height="32" border="0" alt="OpenGL"></a><a href="http://sourceforge.net"><img src="http://sourceforge.net/sflogo.php?group_id=7151&type=3" width="125" height="37" border="0" alt="SourceForge.net"></a></span><a href="http://sourceforge.net/tracker/?func=add&group_id=7151&atid=107151">Report error</a><br>Generated $datetime by Doxygen $doxygenversion</address> <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script> <script type="text/javascript">_uacct = "UA-446379-2"; urchinTracker();</script> </body> Modified: trunk/doc/doxygen-header =================================================================== --- trunk/doc/doxygen-header 2008-09-27 07:43:08 UTC (rev 3697) +++ trunk/doc/doxygen-header 2008-09-28 02:40:43 UTC (rev 3698) @@ -12,18 +12,13 @@ <link rel="index" href="functions" title="OpenVRML Compound Members"> <link rel="appendix" href="conformance" title="Conformance Test Results"> <style type="text/css"> -@import url("doxygen.css"); @import url("tabs.css"); @import url("http://openvrml.org/openvrml.css"); -body, td { - font-size: 100%; +table { + width: 100%; } -p, center, td, th, ul, dl, div { - font-family: inherit; -} - h2 { border-bottom-style: solid; border-bottom-width: 1px; @@ -47,22 +42,22 @@ padding-bottom: 0.5em; } -div.nav a.el:link, div.nav a.el:visited, -div.navpath a.el:link, div.navpath a.el:visited { +div.nav :link, div.nav :visited, +div.navpath :link, div.navpath :visited { border-width: 1px; border-style: solid; border-color: silver; padding: 2px; } -div.nav a.el:link:hover, div.nav a.el:visited:hover, -div.navpath a.el:link:hover, div.navpath a.el:visited:hover { +div.nav :link:hover, div.nav :visited:hover, +div.navpath :link:hover, div.navpath :visited:hover { border-style: outset; border-color: gray; } -div.nav a.el:active, -div.navpath a.el:active { +div.nav :active, +div.navpath :active { border-style: inset; border-color: gray; } @@ -71,70 +66,26 @@ background-color: transparent; } -div.qindex { - background-color: transparent; - border: none; -} -a { - color: inherit; -} -a.qindex { +.el { text-decoration: inherit; - color: inherit; - padding: 0; -} -a.qindex:visited { - text-decoration: inherit; - font-weight: inherit; - color: inherit; - padding: 0; -} -a.qindex:hover { - text-decoration: inherit; - background-color: transparent; - padding: 0; -} -a.qindexHL { - text-decoration: inherit; - font-weight: inherit; - background-color: transparent; - color: inherit; - padding: 0; -} -a.qindexHL:hover { - text-decoration: inherit; - background-color: transparent; - color: inherit; - padding: 0; -} -a.qindexHL:visited { - text-decoration: inherit; - background-color: transparent; - color: inherit; -} -a.el { - text-decoration: inherit; font-weight: inherit } -a.elRef { +.elRef { font-weight: inherit } -a.code:link, a.code:visited { +.code:link, .code:visited { text-decoration: inherit; font-weight: inherit; color: inherit; } -a.codeRef:link { +.codeRef:link { font-weight: normal; color: inherit; } -a { - color: inherit; -} -a:visited { +:visited { color: silver; } -a:hover { +:link:hover { color: inherit; text-decoration: inherit; background-color: transparent; @@ -144,18 +95,6 @@ line-height: 1.2em; } -div.qindex { - font-size: smaller; -} - -div.qindex .qindex:link, div.qindex .qindex:visited { - font-weight: inherit; -} - -div.qindex .qindexHL:link, div.qindex .qindexHL:visited { - font-weight: bold; -} - td.memItemLeft, td.memItemRight, td.memTemplParams, td.memTemplItemLeft, td.memTemplItemRight, .memtemplate, .memname td { @@ -164,8 +103,30 @@ td.memItemLeft, td.memItemRight, td.mdescLeft, td.mdescRight { background-color: rgb(95%, 95%, 95%); + border-color: rgb(65%, 65%, 65%); + border-width: 1px; + font-size: smaller; } +.memItemLeft { + margin-top: 0.5em; + border-top-style: solid; +} +.mdescLeft { + border-bottom-style: solid; +} +.memItemRight { + border-top-style: solid; + margin-top: 0.5em; +} +.mdescRight { + border-bottom-style: solid; +} + +.mdescRight { + font-style: italic; +} + .mdTable { background-color: rgb(95%, 95%, 95%); } @@ -188,16 +149,41 @@ } .memitem { - background-color: rgb(95%, 95%, 95%); - border-color: rgb(80%, 80%, 80%); + padding: 0; } +.memitem table { + width: auto; +} + +.memproto, .memdoc { + border-width: 1px; + border-color: rgb(65%, 65%, 65%); +} + .memproto { background-color: rgb(90%, 90%, 90%); - border-color: rgb(65%, 65%, 65%); font-weight: inherit; + font-size: smaller; + border-top-style: solid; + border-left-style: solid; + border-right-style: solid; + -webkit-border-top-left-radius: 0.6em; + -webkit-border-top-right-radius: 0.6em; + -moz-border-radius-topleft: 0.6em; + -moz-border-radius-topright: 0.6em; } +.memdoc { + background-color: rgb(95%, 95%, 95%); + padding: 2px 5px; + border-style: solid; + -webkit-border-bottom-left-radius: 0.6em; + -webkit-border-bottom-right-radius: 0.6em; + -moz-border-radius-bottomleft: 0.6em; + -moz-border-radius-bottomright: 0.6em; +} + .memname { font-weight: inherit; } Property changes on: trunk/doc/manual/x3d-white-on-black.png ___________________________________________________________________ Added: svn:mime-type + image/png Modified: trunk/src/libopenvrml/openvrml/browser.cpp =================================================================== --- trunk/src/libopenvrml/openvrml/browser.cpp 2008-09-27 07:43:08 UTC (rev 3697) +++ trunk/src/libopenvrml/openvrml/browser.cpp 2008-09-28 02:40:43 UTC (rev 3698) @@ -54,7 +54,6 @@ # include <boost/multi_index/detail/scope_guard.hpp> # include <boost/ptr_container/ptr_map.hpp> # include <boost/thread/thread.hpp> -# include <boost/utility.hpp> # include <algorithm> # include <functional> # include <cerrno> Modified: trunk/src/libopenvrml/openvrml/local/proto.cpp =================================================================== --- trunk/src/libopenvrml/openvrml/local/proto.cpp 2008-09-27 07:43:08 UTC (rev 3697) +++ trunk/src/libopenvrml/openvrml/local/proto.cpp 2008-09-28 02:40:43 UTC (rev 3698) @@ -958,7 +958,7 @@ /** * @internal * - * @class proto_node::proto_exposedfield + * @class openvrml::local::proto_node::proto_exposedfield * * @brief @c PROTO @c exposedField handler class template. */ Modified: trunk/src/libopenvrml/openvrml/local/proto.h =================================================================== --- trunk/src/libopenvrml/openvrml/local/proto.h 2008-09-27 07:43:08 UTC (rev 3697) +++ trunk/src/libopenvrml/openvrml/local/proto.h 2008-09-28 02:40:43 UTC (rev 3698) @@ -347,32 +347,32 @@ /** * @internal * - * @class abstract_proto_node::proto_eventin + * @class openvrml::local::abstract_proto_node::proto_eventin * * @brief @c PROTO @c eventIn handler class template. */ /** - * @typedef abstract_proto_node::proto_eventin::listeners + * @typedef openvrml::local::abstract_proto_node::proto_eventin::listeners * * @brief Set of event listeners. */ /** - * @var abstract_proto_node::proto_eventin::listeners abstract_proto_node::proto_eventin::listeners_ + * @var openvrml::local::abstract_proto_node::proto_eventin::listeners openvrml::local::abstract_proto_node::proto_eventin::listeners_ * * @brief Set of event listeners to which events are delegated for * processing. */ /** - * @typedef abstract_proto_node::proto_eventin::field_value_type + * @typedef openvrml::local::abstract_proto_node::proto_eventin::field_value_type * * @brief Field value type. */ /** - * @typedef abstract_proto_node::proto_eventin::event_listener_type + * @typedef openvrml::local::abstract_proto_node::proto_eventin::event_listener_type * * @brief Type of event listeners to which the instance delegates. */ @@ -463,7 +463,7 @@ /** * @internal * - * @class abstract_proto_node::proto_eventout + * @class openvrml::local::abstract_proto_node::proto_eventout * * @brief @c PROTO @c eventOut handler class template. */ @@ -471,7 +471,7 @@ /** * @internal * - * @class abstract_proto_node::proto_eventout::listener_t + * @class openvrml::local::abstract_proto_node::proto_eventout::listener_t * * @brief Listens for events emitted from @c node%s in the @c PROTO * implementation in order to propagate them out of the @c PROTO @@ -479,7 +479,7 @@ */ /** - * @var abstract_proto_node::proto_eventout & abstract_proto_node::proto_eventout::listener_t::emitter + * @var openvrml::local::abstract_proto_node::proto_eventout & abstract_proto_node::proto_eventout::listener_t::emitter * * @brief Reference to the outer @c proto_eventout class. * @@ -490,13 +490,13 @@ */ /** - * @var abstract_proto_node & abstract_proto_node::proto_eventout::listener_t::node + * @var openvrml::local::abstract_proto_node & openvrml::local::abstract_proto_node::proto_eventout::listener_t::node * * @brief Reference to the @c abstract_proto_node instance. */ /** - * @var FieldValue abstract_proto_node::proto_eventout::listener_t::value + * @var FieldValue openvrml::local::abstract_proto_node::proto_eventout::listener_t::value * * @brief The value of the most recently emitted event. */ @@ -562,7 +562,7 @@ } /** - * @var abstract_proto_node::proto_eventout::listener_t abstract_proto_node::proto_eventout::listener + * @var openvrml::local::abstract_proto_node::proto_eventout::listener_t abstract_proto_node::proto_eventout::listener * * @brief Listens for events emitted from nodes in the @c PROTO * implementation in order to propagate them out of the @c PROTO @@ -570,19 +570,19 @@ */ /** - * @typedef abstract_proto_node::proto_eventout<FieldValue>::field_value_type + * @typedef openvrml::local::abstract_proto_node::proto_eventout<FieldValue>::field_value_type * * @brief Field value type. */ /** - * @typedef abstract_proto_node::proto_eventout<FieldValue>::event_emitter_type + * @typedef openvrml::local::abstract_proto_node::proto_eventout<FieldValue>::event_emitter_type * * @brief Event emitter type. */ /** - * @typedef abstract_proto_node::proto_eventout<FieldValue>::event_listener_type + * @typedef openvrml::local::abstract_proto_node::proto_eventout<FieldValue>::event_listener_type * * @brief Event listener type. */ Modified: trunk/src/libopenvrml/openvrml/node.cpp =================================================================== --- trunk/src/libopenvrml/openvrml/node.cpp 2008-09-27 07:43:08 UTC (rev 3697) +++ trunk/src/libopenvrml/openvrml/node.cpp 2008-09-28 02:40:43 UTC (rev 3698) @@ -543,6 +543,14 @@ /** + * @typedef openvrml::node_type_decls + * + * @brief A map of node type identifiers to their corresponding + * @c node_interface_set%s. + */ + + +/** * @class openvrml::node_metatype_id openvrml/node.h * * @brief Identifier for @c node_metatype%s. @@ -844,12 +852,12 @@ /** * @brief Create a new @c node_type. * - * @c node_type%s can be said to subset the master type provided by the @c - * node_metatype. Each @c node_metatype instance can support certain @c node - * interfaces; the @c node_interface_set passed to @c - * node_metatype::create_type must be a subset of those supported interfaces. + * @c node_type%s can be said to subset the master type provided by the + * @c node_metatype. Each @c node_metatype instance can support certain + * @c node interfaces; the @c node_interface_set passed to @c #create_type + * must be a subset of those supported interfaces. * - * This function delegates to @c node_metatype::do_create_type. + * This function delegates to @c #do_create_type. * * @param[in] id the name for the new @c node_type. * @param[in] interfaces a @c node_interface_set containing the @@ -888,7 +896,7 @@ * @p interfaces. * @exception std::bad_alloc if memory allocation fails. * - * @sa node_metatype::create_type + * @sa #create_type * @sa http://boost.org/libs/smart_ptr/shared_ptr.htm */ @@ -1281,8 +1289,10 @@ */ /** - * @var class openvrml::node::proto_node + * @internal * + * @var class openvrml::node::local::proto_node + * * @brief A @c PROTO instance. */ Modified: trunk/src/libopenvrml/openvrml/script.cpp =================================================================== --- trunk/src/libopenvrml/openvrml/script.cpp 2008-09-27 07:43:08 UTC (rev 3697) +++ trunk/src/libopenvrml/openvrml/script.cpp 2008-09-28 02:40:43 UTC (rev 3698) @@ -53,7 +53,7 @@ * @brief Abstract class implemented by scripting language bindings. * * The runtime instantiates subclasses of script for each VRML97 Script node; - * and calls its methods appropriately to execute script code. + * and calls its methods appropriately to execute %script code. */ /** @@ -75,13 +75,14 @@ /** * @var openvrml::script_node & openvrml::script::node * - * @brief A reference to the script_node that uses this script object. + * @brief A reference to the @c script_node that uses this @c script object. */ /** * @brief Construct. * - * @param[in] node a reference to the script_node that uses this script object. + * @param[in] node a reference to the @c script_node that uses this @c script + * object. */ openvrml::script::script(script_node & node): node(node) @@ -96,7 +97,7 @@ /** * @brief Initialize the Script node. * - * Delegates to @c script::do_initialize. + * Delegates to @c #do_initialize. * * @param[in] timestamp the current time. */ @@ -117,7 +118,7 @@ /** * @brief Process an event. * - * Delegates to @c script::do_process_event. + * Delegates to @c #do_process_event. * * @param[in] id eventIn identifier. * @param[in] value event value. @@ -142,9 +143,9 @@ */ /** - * @brief Execute script code after processing events. + * @brief Execute %script code after processing events. * - * Delegates to @c script::do_events_processed. + * Delegates to @c #do_events_processed. * * @param[in] timestamp the current time. */ @@ -156,7 +157,7 @@ /** * @fn void openvrml::script::do_events_processed(double timestamp) * - * @brief Execute script code after processing events. + * @brief Execute %script code after processing events. * * @param[in] timestamp the current time. */ @@ -164,7 +165,7 @@ /** * @brief Shut down the Script node. * - * Delegates to <code>script::do_shutdown</code>. + * Delegates to @c #do_shutdown. * * @param[in] timestamp the current time. */ @@ -194,11 +195,12 @@ } /** - * @brief Whether the browser may delay sending input events to the script - * until its outputs are needed by the browser. + * @brief Whether the @c browser may delay sending input events to the + * @c script until its outputs are needed by the browser. * - * @return @c true if the browser may delay sending input events to the script - * until its outputs are needed by the browser; @c false otherwise. + * @return @c true if the @c browser may delay sending input events to the + * @c script until its outputs are needed by the @c browser; @c false + * otherwise. */ bool openvrml::script::must_evaluate() const OPENVRML_NOTHROW { @@ -284,12 +286,12 @@ /** * @internal * - * @brief Process direct outputs in @a script::direct_output_map_. + * @brief Process direct outputs in @a #direct_output_map_. * * This function is called at the end of initialization and processing normal * events. * - * @post <code>script::direct_output_map_.empty()</code> is @c true. + * @post @c script::direct_output_map_.empty() is @c true. */ void openvrml::script::process_direct_output(double timestamp) { @@ -326,7 +328,7 @@ {} /** - * @fn std::auto_ptr<openvrml::script> openvrml::script_factory::create_script(script_node & node, const boost::shared_ptr<std::istream> & source) + * @fn std::auto_ptr<openvrml::script> openvrml::script_factory::create_script(script_node & node, const boost::shared_ptr<resource_istream> & source) * * @brief Create a @c script. * @@ -351,7 +353,7 @@ /** * @internal * - * @var class script_factory_registry::script_node + * @var class openvrml::script_factory_registry::script_node * * @brief @c script_node is the only class that should ever need to * instantiate @c script_factory_registry. @@ -630,7 +632,7 @@ * * @brief Class object for @c script_node%s. * - * There is one @c script_node_metatype per browser instance. + * There is one @c script_node_metatype per @c browser instance. * * @see browser::scriptNodeClass */ @@ -679,7 +681,7 @@ * * @var class openvrml::script_node::script * - * @brief Abstract base class for script runtimes. + * @brief Abstract base class for %script runtimes. */ /** @@ -1836,7 +1838,7 @@ /** * @internal * - * @var openvrml::script_node::event_listener_map_t openvrml::script_node::event_listener_map + * @var openvrml::script_node::event_listener_map_t openvrml::script_node::event_listener_map_ * * @brief Map of event listeners. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-10-02 07:02:10
|
Revision: 3707 http://openvrml.svn.sourceforge.net/openvrml/?rev=3707&view=rev Author: braden Date: 2008-10-02 07:02:02 +0000 (Thu, 02 Oct 2008) Log Message: ----------- Keep track of host instances in openvrml-xembed and shut down when the last one terminates. Modified Paths: -------------- trunk/ChangeLog trunk/src/openvrml-xembed/browser-factory.xml trunk/src/openvrml-xembed/browserfactory.cpp trunk/src/openvrml-xembed/browserfactory.h trunk/src/openvrml-xembed/main.cpp Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-09-30 22:25:43 UTC (rev 3706) +++ trunk/ChangeLog 2008-10-02 07:02:02 UTC (rev 3707) @@ -1,3 +1,65 @@ +2008-10-02 Braden McDaniel <br...@en...> + + Keep track of host instances in openvrml-xembed and shut down when + the last one terminates. + + * src/openvrml-xembed/browser-factory.xml: Added + "org.freedesktop.DBus.GLib.Async" annotation to CreateControl + method. This allows us to use DBusGMethodInvocation in the method + implementation. + * src/openvrml-xembed/browserfactory.cpp + (openvrml_xembed_error_quark()): GQuark for the GErrors we + generate. + (OpenvrmlXembedError): GError codes. + (intrusive_ptr_add_ref(GObject *)): Added so that + boost::intrusive_ptr can be used with GObject. + (intrusive_ptr_release(GObject *)): Added so that + boost::intrusive_ptr can be used with GObject. + (OpenvrmlXembedBrowserFactoryPrivate_): Moved + OpenvrmlXembedBrowserFactory data members to a private struct. + hosts is a map of the unique bus identifiers of hosts to a map of + the controls instantiated by the host. + (openvrml_xembed_browser_factory_constructor(GType, guint, + GObjectConstructParam *)): Instantiate the hosts map in the + constructor function. + (openvrml_xembed_browser_factory_finalize(GObject *)): Destroy the + hosts map and unref the DBus proxy. + (openvrml_xembed_browser_factory_init(OpenvrmlXembedBrowserFactory *)): + Use the DBus proxy associated with the + OpenvrmlXembedBrowserFactory instance; connect to the + org.freedesktop.DBus.NameOwnerChanged signal. + (openvrml_xembed_browser_factory_class_init(OpenvrmlXembedBrowserFactoryClass *)): + Set constructor and finalize functions; set up private data. + (on_host_shutdown_data): Added host_name to hold the unique bus + identifier of the host. + (delete_on_host_shutdown_data): on_host_shutdown_data now owns the + control_obj_path and host_name strings; free them. + (openvrml_xembed_browser_factory_create_control(OpenvrmlXembedBrowserFactory *, + const char *, const char *, guint, gboolean, + DBusGMethodInvocation *)): Get the host's unique bus identifier + and track it in the hosts map. + (openvrml_xembed_browser_factory_on_host_shutdown_event(DBusGProxy *, + gpointer)): Erase the shut down control from the hosts map. The + intrusive_ptr will unref it. + (openvrml_xembed_browser_factory_name_owner_changed(DBusGProxy *, + const gchar *, const gchar *, const gchar *, gpointer)): Erase the + host leaving the bus from the hosts map; this cleans up resources + associated with the host. Quit when the last host leaves. + * src/openvrml-xembed/browserfactory.h + (OPENVRML_XEMBED_BROWSER_FACTORY_CLASS): Fixed missing third + parameter to G_TYPE_CHECK_CLASS_CAST. + (OpenvrmlXembedBrowserFactory_): Moved data members to private + struct. + (openvrml_xembed_browser_factory_create_control(OpenvrmlXembedBrowserFactory *, + const char *, const char *, guint, gboolean, + DBusGMethodInvocation *)): Changed signature per + "org.freedesktop.DBus.GLib.Async" annotation. + * src/openvrml-xembed/main.cpp + (main(int, char *[])): Removed redundant name request; this is + taken care of in the OpenvrmlXembedBrowserFactory implementation. + Don't unref the browser_factory; this seems not to play well with + dbus_g_connection_register_g_object. + 2008-09-30 Braden McDaniel <br...@en...> In the spirit of not returning mutable instances by value, change Modified: trunk/src/openvrml-xembed/browser-factory.xml =================================================================== --- trunk/src/openvrml-xembed/browser-factory.xml 2008-09-30 22:25:43 UTC (rev 3706) +++ trunk/src/openvrml-xembed/browser-factory.xml 2008-10-02 07:02:02 UTC (rev 3707) @@ -3,6 +3,7 @@ <node name="/org/openvrml/BrowserFactory"> <interface name="org.openvrml.BrowserFactory"> <method name="CreateControl"> + <annotation name="org.freedesktop.DBus.GLib.Async" value="true" /> <arg type="s" name="host_name" direction="in" /> <arg type="o" name="host_object_path" direction="in" /> <arg type="t" name="host_id" direction="in" /> Modified: trunk/src/openvrml-xembed/browserfactory.cpp =================================================================== --- trunk/src/openvrml-xembed/browserfactory.cpp 2008-09-30 22:25:43 UTC (rev 3706) +++ trunk/src/openvrml-xembed/browserfactory.cpp 2008-10-02 07:02:02 UTC (rev 3707) @@ -19,9 +19,15 @@ // # include <boost/concept_check.hpp> +# include <boost/intrusive_ptr.hpp> # include <boost/multi_index/detail/scope_guard.hpp> # include <boost/ref.hpp> +# include <gtk/gtk.h> # include <dbus/dbus-glib-bindings.h> +# include <dbus/dbus-glib-lowlevel.h> +# include <map> +# include <memory> +# include <cstring> # include <cstdlib> # include "browserfactory.h" @@ -30,33 +36,132 @@ using namespace boost::multi_index::detail; // for scope_guard +# define OPENVRML_XEMBED_ERROR openvrml_xembed_error_quark() +GQuark openvrml_xembed_error_quark() +{ + return g_quark_from_static_string("openvrml-xembed-error-quark"); +} + +enum OpenvrmlXembedError { + OPENVRML_XEMBED_ERROR_FAILED, + OPENVRML_XEMBED_ERROR_NO_MEMORY +}; + G_DEFINE_TYPE(OpenvrmlXembedBrowserFactory, openvrml_xembed_browser_factory, G_TYPE_OBJECT); +namespace { + G_GNUC_INTERNAL void intrusive_ptr_add_ref(GObject * const obj) + { + g_object_ref(obj); + } + + G_GNUC_INTERNAL void intrusive_ptr_release(GObject * const obj) + { + g_object_unref(obj); + } +} + +// +// hosts maps the unique bus identifiers of hosts to a controls_map_t; a +// controls_map_t maps an object path to an OpenvrmlXembedBrowser instance. +// + +typedef std::map<std::string, boost::intrusive_ptr<GObject> > controls_map_t; +typedef std::map<std::string, controls_map_t > hosts_map_t; + +struct OpenvrmlXembedBrowserFactoryPrivate_ { + DBusGProxy * driver_proxy; + hosts_map_t * hosts; +}; + +# define OPENVRML_XEMBED_BROWSER_FACTORY_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), OPENVRML_XEMBED_TYPE_BROWSER_FACTORY, OpenvrmlXembedBrowserFactoryPrivate)) + +extern "C" +G_GNUC_INTERNAL +GObject * +openvrml_xembed_browser_factory_constructor( + const GType type, + const guint n_construct_properties, + GObjectConstructParam * const construct_properties) +{ + GObject * obj; + { + OpenvrmlXembedBrowserFactoryClass * const klass = + OPENVRML_XEMBED_BROWSER_FACTORY_CLASS( + g_type_class_peek(OPENVRML_XEMBED_TYPE_BROWSER_FACTORY)); + GObjectClass * const parent_class = + G_OBJECT_CLASS(g_type_class_peek_parent(klass)); + obj = parent_class->constructor(type, + n_construct_properties, + construct_properties); + } + + try { + using std::auto_ptr; + OpenvrmlXembedBrowserFactory * const browser_factory = + OPENVRML_XEMBED_BROWSER_FACTORY(obj); + auto_ptr<hosts_map_t> hosts(new hosts_map_t); + browser_factory->priv->hosts = hosts.release(); + } catch (std::bad_alloc &) { + return 0; + } + + return obj; +} + +extern "C" +G_GNUC_INTERNAL void +openvrml_xembed_browser_factory_finalize(GObject * const obj) +{ + OpenvrmlXembedBrowserFactory * browser_factory = + OPENVRML_XEMBED_BROWSER_FACTORY(obj); + delete browser_factory->priv->hosts; + g_object_unref(browser_factory->priv->driver_proxy); + + OpenvrmlXembedBrowserFactoryClass * const klass = + OPENVRML_XEMBED_BROWSER_FACTORY_CLASS( + g_type_class_peek(OPENVRML_XEMBED_TYPE_BROWSER_FACTORY)); + GObjectClass * const parent_class = + G_OBJECT_CLASS(g_type_class_peek_parent(klass)); + parent_class->finalize(obj); +} + + +extern "C" +G_GNUC_INTERNAL +gboolean +openvrml_xembed_browser_factory_name_owner_changed(DBusGProxy * proxy, + const gchar * name, + const gchar * old_owner, + const gchar * new_owner, + gpointer user_data); +void openvrml_xembed_browser_factory_init( - OpenvrmlXembedBrowserFactory * control_factory) + OpenvrmlXembedBrowserFactory * const browser_factory) { + browser_factory->priv = + OPENVRML_XEMBED_BROWSER_FACTORY_GET_PRIVATE(browser_factory); + GError * error = 0; scope_guard error_guard = make_guard(g_error_free, boost::ref(error)); - OpenvrmlXembedBrowserFactoryClass * control_factory_class = - OPENVRML_XEMBED_BROWSER_FACTORY_GET_CLASS(control_factory); + OpenvrmlXembedBrowserFactoryClass * browser_factory_class = + OPENVRML_XEMBED_BROWSER_FACTORY_GET_CLASS(browser_factory); - dbus_g_connection_register_g_object(control_factory_class->connection, + dbus_g_connection_register_g_object(browser_factory_class->connection, "/org/openvrml/BrowserFactory", - G_OBJECT(control_factory)); + G_OBJECT(browser_factory)); - DBusGProxy * driver_proxy = - dbus_g_proxy_new_for_name(control_factory_class->connection, + browser_factory->priv->driver_proxy = + dbus_g_proxy_new_for_name(browser_factory_class->connection, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS); - scope_guard driver_proxy_guard = make_guard(g_object_unref, driver_proxy); - boost::ignore_unused_variable_warning(driver_proxy_guard); guint request_ret; - if (!org_freedesktop_DBus_request_name(driver_proxy, + if (!org_freedesktop_DBus_request_name(browser_factory->priv->driver_proxy, "org.openvrml.BrowserControl", 0, &request_ret, &error)) { @@ -65,9 +170,18 @@ return; } - control_factory->controls = - g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_object_unref); + dbus_g_proxy_add_signal(browser_factory->priv->driver_proxy, + "NameOwnerChanged", + G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, + G_TYPE_INVALID); + dbus_g_proxy_connect_signal( + browser_factory->priv->driver_proxy, + "NameOwnerChanged", + G_CALLBACK(openvrml_xembed_browser_factory_name_owner_changed), + browser_factory, + 0); + error_guard.dismiss(); } @@ -75,6 +189,11 @@ openvrml_xembed_browser_factory_class_init( OpenvrmlXembedBrowserFactoryClass * klass) { + G_OBJECT_CLASS(klass)->constructor = + openvrml_xembed_browser_factory_constructor; + G_OBJECT_CLASS(klass)->finalize = + openvrml_xembed_browser_factory_finalize; + GError * error = 0; scope_guard error_guard = make_guard(g_error_free, boost::ref(error)); @@ -84,6 +203,10 @@ return; } + + g_type_class_add_private(G_OBJECT_CLASS(klass), + sizeof (OpenvrmlXembedBrowserFactoryPrivate)); + dbus_g_object_type_install_info( OPENVRML_XEMBED_TYPE_BROWSER_FACTORY, &dbus_glib_openvrml_xembed_browser_factory_object_info); @@ -100,6 +223,7 @@ namespace { struct on_host_shutdown_data { OpenvrmlXembedBrowserFactory * factory; + gchar * host_name; gchar * control_obj_path; }; } @@ -108,18 +232,25 @@ G_GNUC_INTERNAL void delete_on_host_shutdown_data(gpointer data, GClosure * /* closure */) { - delete static_cast<on_host_shutdown_data *>(data); + on_host_shutdown_data * const d = + static_cast<on_host_shutdown_data *>(data); + g_free(d->control_obj_path); + g_free(d->host_name); + delete d; } -char * +gboolean openvrml_xembed_browser_factory_create_control( OpenvrmlXembedBrowserFactory * const control_factory, const char * const host_name, const char * const host_obj_path, const guint host_id, const gboolean expect_initial_stream, - GError ** const error) + DBusGMethodInvocation * const context) { + GError * error = 0; + scope_guard error_guard = make_guard(g_error_free, boost::ref(error)); + DBusGProxy * host = dbus_g_proxy_new_for_name_owner( OPENVRML_XEMBED_BROWSER_FACTORY_GET_CLASS( @@ -127,15 +258,24 @@ host_name, host_obj_path, "org.openvrml.BrowserHost", - error); - if (!host) { return 0; } + &error); + if (!host) { + dbus_g_method_return_error(context, error); + return false; + } OpenvrmlXembedBrowser * const browser = OPENVRML_XEMBED_BROWSER( openvrml_xembed_browser_new(host, host_id, expect_initial_stream)); - g_return_val_if_fail(browser, 0); + if (!browser) { + error = g_error_new(OPENVRML_XEMBED_ERROR, + OPENVRML_XEMBED_ERROR_NO_MEMORY, + "out of memory"); + dbus_g_method_return_error(context, error); + return false; + } static size_t control_count = 0; char * control_obj_path = g_strdup_printf("/org/openvrml/Browser/%lu", @@ -145,12 +285,35 @@ control_obj_path, G_OBJECT(browser)); + char * const sender = dbus_g_method_get_sender(context); + scope_guard sender_guard = make_guard(g_free, sender); + boost::ignore_unused_variable_warning(sender_guard); + bool succeeded; + try { + using std::make_pair; + succeeded = + (*control_factory->priv->hosts)[sender].insert( + make_pair(control_obj_path, + boost::intrusive_ptr<GObject>(G_OBJECT(browser)))) + .second; + g_debug("inserted reference to %s", sender); + } catch (std::bad_alloc & ex) { + error = g_error_new(OPENVRML_XEMBED_ERROR, + OPENVRML_XEMBED_ERROR_NO_MEMORY, + "out of memory"); + dbus_g_method_return_error(context, error); + return false; + } + + g_return_val_if_fail(succeeded, false); + on_host_shutdown_data * const data = new on_host_shutdown_data; data->factory = control_factory; // - // Note that D-Bus frees the return value; so we need to strdup the one - // in the hash map. + // Note that D-Bus frees the return value; so we need to strdup one to + // keep. // + data->host_name = g_strdup(sender); data->control_obj_path = g_strdup(control_obj_path); dbus_g_proxy_add_signal(host, "Shutdown", G_TYPE_INVALID); @@ -162,10 +325,6 @@ data, delete_on_host_shutdown_data); - g_hash_table_insert(control_factory->controls, - data->control_obj_path, // was strdup'd above - g_object_ref(browser)); - // // The plug needs to be realized before it gets shown. Explicitly // realizing here seems like the most convenient way to ensure this @@ -174,7 +333,11 @@ gtk_widget_realize(GTK_WIDGET(browser)); gtk_widget_show_all(GTK_WIDGET(browser)); - return control_obj_path; + dbus_g_method_return(context, control_obj_path); + + error_guard.dismiss(); + + return true; } gboolean @@ -184,9 +347,41 @@ on_host_shutdown_data * const data = static_cast<on_host_shutdown_data *>(user_data); - gboolean removed = g_hash_table_remove(data->factory->controls, - data->control_obj_path); - g_assert(removed); + const hosts_map_t::iterator pos = + data->factory->priv->hosts->find(data->host_name); + g_return_val_if_fail(pos != data->factory->priv->hosts->end(), false); + const size_t erased = pos->second.erase(data->control_obj_path); + g_return_val_if_fail(erased > 0, false); + return false; } + +gboolean +openvrml_xembed_browser_factory_name_owner_changed( + DBusGProxy * /* proxy */, + const gchar * /* name */, + const gchar * const old_owner, + const gchar * const new_owner, + const gpointer user_data) +{ + OpenvrmlXembedBrowserFactory * const browser_factory = + OPENVRML_XEMBED_BROWSER_FACTORY(user_data); + + // + // If there's no new owner, the existing owner is simply leaving (i.e., + // terminating. Clean up resources associated with that host. If that + // was the last host, quit. + // + size_t erased = 0; + if (strlen(new_owner) == 0) { + erased = browser_factory->priv->hosts->erase(old_owner); + g_debug("erased references to %s", old_owner); + } + + if (erased > 0 && browser_factory->priv->hosts->empty()) { + gtk_main_quit(); + } + + return false; +} Modified: trunk/src/openvrml-xembed/browserfactory.h =================================================================== --- trunk/src/openvrml-xembed/browserfactory.h 2008-09-30 22:25:43 UTC (rev 3706) +++ trunk/src/openvrml-xembed/browserfactory.h 2008-10-02 07:02:02 UTC (rev 3707) @@ -25,7 +25,7 @@ # define OPENVRML_XEMBED_TYPE_BROWSER_FACTORY (openvrml_xembed_browser_factory_get_type()) # define OPENVRML_XEMBED_BROWSER_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), OPENVRML_XEMBED_TYPE_BROWSER_FACTORY, OpenvrmlXembedBrowserFactory)) -# define OPENVRML_XEMBED_BROWSER_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), OPENVRML_XEMBED_TYPE_BROWSER_FACTORY)) +# define OPENVRML_XEMBED_BROWSER_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), OPENVRML_XEMBED_TYPE_BROWSER_FACTORY, OpenvrmlXembedBrowserFactoryClass)) # define OPENVRML_XEMBED_IS_BROWSER_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), OPENVRML_XEMBED_TYPE_BROWSER_FACTORY)) # define OPENVRML_XEMBED_IS_BROWSER_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), OPENVRML_XEMBED_TYPE_BROWSER_FACTORY)) # define OPENVRML_XEMBED_BROWSER_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), OPENVRML_XEMBED_TYPE_BROWSER_FACTORY, OpenvrmlXembedBrowserFactoryClass)) @@ -33,13 +33,14 @@ G_BEGIN_DECLS typedef struct OpenvrmlXembedBrowserFactory_ OpenvrmlXembedBrowserFactory; +typedef struct OpenvrmlXembedBrowserFactoryPrivate_ OpenvrmlXembedBrowserFactoryPrivate; typedef struct OpenvrmlXembedBrowserFactoryClass_ OpenvrmlXembedBrowserFactoryClass; GType openvrml_xembed_browser_factory_get_type(); struct OpenvrmlXembedBrowserFactory_ { GObject parent; - GHashTable * controls; + OpenvrmlXembedBrowserFactoryPrivate * priv; }; struct OpenvrmlXembedBrowserFactoryClass_ { @@ -47,14 +48,14 @@ DBusGConnection * connection; }; -char * +gboolean openvrml_xembed_browser_factory_create_control( OpenvrmlXembedBrowserFactory * factory, const char * host_name, const char * host_obj_path, guint host_id, gboolean expect_initial_stream, - GError ** error); + DBusGMethodInvocation * context); G_END_DECLS Modified: trunk/src/openvrml-xembed/main.cpp =================================================================== --- trunk/src/openvrml-xembed/main.cpp 2008-09-30 22:25:43 UTC (rev 3706) +++ trunk/src/openvrml-xembed/main.cpp 2008-10-02 07:02:02 UTC (rev 3707) @@ -95,32 +95,16 @@ return EXIT_FAILURE; } - DBusGProxy * bus_proxy = dbus_g_proxy_new_for_name(bus, - "org.freedesktop.DBus", - "/org/freedesktop/DBus", - "org.freedesktop.DBus"); - - guint request_name_result; - if (!dbus_g_proxy_call(bus_proxy, "RequestName", &error, - G_TYPE_STRING, "org.openvrml.VrmlControlFactory", - G_TYPE_UINT, 0, - G_TYPE_INVALID, - G_TYPE_UINT, &request_name_result, - G_TYPE_INVALID)) { - g_printerr(error->message); - return EXIT_FAILURE; - } - - OpenvrmlXembedBrowserFactory * control_factory = + OpenvrmlXembedBrowserFactory * browser_factory = OPENVRML_XEMBED_BROWSER_FACTORY( g_object_new(OPENVRML_XEMBED_TYPE_BROWSER_FACTORY, 0)); - scope_guard control_factory_guard = - make_guard(g_object_unref, G_OBJECT(control_factory)); - boost::ignore_unused_variable_warning(control_factory_guard); +// scope_guard browser_factory_guard = +// make_guard(g_object_unref, G_OBJECT(browser_factory)); +// boost::ignore_unused_variable_warning(browser_factory_guard); dbus_g_connection_register_g_object(bus, "/BrowserFactory", - G_OBJECT(control_factory)); + G_OBJECT(browser_factory)); gdk_threads_enter(); gtk_main(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-10-05 04:28:21
|
Revision: 3714 http://openvrml.svn.sourceforge.net/openvrml/?rev=3714&view=rev Author: braden Date: 2008-10-05 04:27:46 +0000 (Sun, 05 Oct 2008) Log Message: ----------- If we set the absolute path of session_bus_servicesdir, the resulting Automake code is not DESTDIR-aware. While we could take care of this in install-local, it's probably safe to hard-code a relative path for this. Modified Paths: -------------- trunk/ChangeLog trunk/configure.ac trunk/src/Makefile.am Property Changed: ---------------- trunk/ trunk/src/libopenvrml/openvrml/bad_url.cpp trunk/src/libopenvrml/openvrml/scene.cpp trunk/src/libopenvrml/openvrml/scene.h trunk/src/libopenvrml/openvrml/script.cpp Property changes on: trunk ___________________________________________________________________ Modified: svn:mergeinfo - /branches/local:3677-3689 /branches/node-modules:3622-3623,3632-3635,3637-3638,3640-3641,3643-3644,3646-3647,3649-3650,3654-3655,3657-3658,3661-3662,3664-3665,3667-3668,3670-3671,3673-3674,3684-3685,3687-3688 + /branches/0.17:3713 /branches/local:3677-3689 /branches/node-modules:3622-3623,3632-3635,3637-3638,3640-3641,3643-3644,3646-3647,3649-3650,3654-3655,3657-3658,3661-3662,3664-3665,3667-3668,3670-3671,3673-3674,3684-3685,3687-3688 Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-10-04 04:43:41 UTC (rev 3713) +++ trunk/ChangeLog 2008-10-05 04:27:46 UTC (rev 3714) @@ -1,3 +1,14 @@ +2008-10-04 Braden McDaniel <br...@en...> + + If we set the absolute path of session_bus_servicesdir, the + resulting Automake code is not DESTDIR-aware. While we could take + care of this in install-local, it's probably safe to hard-code a + relative path for this. + + * configure.ac: Don't AC_SUBST session_bus_servicesdir. + * src/Makefile.am: Hard code the relative path of + session_bus_servicesdir. + 2008-10-03 Braden McDaniel <br...@en...> * src/Makefile.am Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2008-10-04 04:43:41 UTC (rev 3713) +++ trunk/configure.ac 2008-10-05 04:27:46 UTC (rev 3714) @@ -168,8 +168,6 @@ PKG_CHECK_MODULES([DBUS_G], [dbus-glib-1 glib-2.0 >= 2.6], , [have_dbus_glib=no]) AC_PATH_PROG([DBUS_BINDING_TOOL], [dbus-binding-tool]) -session_bus_servicesdir=`$PKG_CONFIG --variable=session_bus_services_dir dbus-1` -AC_SUBST([session_bus_servicesdir]) # # openvrml-player uses GtkBuilder, which was introduced in GTK+ 2.12. Modified: trunk/src/Makefile.am =================================================================== --- trunk/src/Makefile.am 2008-10-04 04:43:41 UTC (rev 3713) +++ trunk/src/Makefile.am 2008-10-05 04:27:46 UTC (rev 3714) @@ -637,6 +637,7 @@ if ENABLE_XEMBED libexec_PROGRAMS = openvrml-xembed/openvrml-xembed +session_bus_servicesdir = $(datadir)/dbus-1/services session_bus_services_DATA = openvrml-xembed/org.openvrml.BrowserControl.service BUILT_SOURCES += \ openvrml-xembed/browser-server-glue.h \ Property changes on: trunk/src/libopenvrml/openvrml/bad_url.cpp ___________________________________________________________________ Modified: svn:mergeinfo - + /branches/0.17/src/libopenvrml/openvrml/bad_url.cpp:3713 Property changes on: trunk/src/libopenvrml/openvrml/scene.cpp ___________________________________________________________________ Modified: svn:mergeinfo - + /branches/0.17/src/libopenvrml/openvrml/scene.cpp:3713 Property changes on: trunk/src/libopenvrml/openvrml/scene.h ___________________________________________________________________ Modified: svn:mergeinfo - + /branches/0.17/src/libopenvrml/openvrml/scene.h:3713 Property changes on: trunk/src/libopenvrml/openvrml/script.cpp ___________________________________________________________________ Modified: svn:mergeinfo - + /branches/0.17/src/libopenvrml/openvrml/script.cpp:3713 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-10-05 08:25:45
|
Revision: 3718 http://openvrml.svn.sourceforge.net/openvrml/?rev=3718&view=rev Author: braden Date: 2008-10-05 06:57:26 +0000 (Sun, 05 Oct 2008) Log Message: ----------- Need to use dbus_g_proxy_new_for_name rather than _new_for_name_owner in order for activation to work. Modified Paths: -------------- trunk/ChangeLog trunk/mozilla-plugin/src/openvrml.cpp trunk/src/openvrml-player/curlbrowserhost.cpp Property Changed: ---------------- trunk/ trunk/src/libopenvrml/openvrml/bad_url.cpp trunk/src/libopenvrml/openvrml/scene.cpp trunk/src/libopenvrml/openvrml/scene.h trunk/src/libopenvrml/openvrml/script.cpp Property changes on: trunk ___________________________________________________________________ Modified: svn:mergeinfo - /branches/0.17:3713 /branches/local:3677-3689 /branches/node-modules:3622-3623,3632-3635,3637-3638,3640-3641,3643-3644,3646-3647,3649-3650,3654-3655,3657-3658,3661-3662,3664-3665,3667-3668,3670-3671,3673-3674,3684-3685,3687-3688 + /branches/0.17:3713,3717 /branches/local:3677-3689 /branches/node-modules:3622-3623,3632-3635,3637-3638,3640-3641,3643-3644,3646-3647,3649-3650,3654-3655,3657-3658,3661-3662,3664-3665,3667-3668,3670-3671,3673-3674,3684-3685,3687-3688 Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-10-05 06:50:53 UTC (rev 3717) +++ trunk/ChangeLog 2008-10-05 06:57:26 UTC (rev 3718) @@ -1,3 +1,17 @@ +2008-10-05 Braden McDaniel <br...@en...> + + Need to use dbus_g_proxy_new_for_name rather than + _new_for_name_owner in order for activation to work. + + * mozilla-plugin/src/openvrml.cpp + (get_browser(DBusGConnection *, const char *, const char *, + guint64, GError **)): Use dbus_g_proxy_new_for_name to get the + org.openvrml.BrowserFactory proxy. + * src/openvrml-player/curlbrowserhost.cpp + (get_browser(DBusGConnection *, const char *, const char *, + guint64, GError **)): Use dbus_g_proxy_new_for_name to get the + org.openvrml.BrowserFactory proxy. + 2008-10-04 Braden McDaniel <br...@en...> If we set the absolute path of session_bus_servicesdir, the Modified: trunk/mozilla-plugin/src/openvrml.cpp =================================================================== --- trunk/mozilla-plugin/src/openvrml.cpp 2008-10-05 06:50:53 UTC (rev 3717) +++ trunk/mozilla-plugin/src/openvrml.cpp 2008-10-05 06:57:26 UTC (rev 3718) @@ -1160,11 +1160,10 @@ throw () { DBusGProxy * browser_factory = - dbus_g_proxy_new_for_name_owner(connection, - "org.openvrml.BrowserControl", - "/BrowserFactory", - "org.openvrml.BrowserFactory", - error); + dbus_g_proxy_new_for_name(connection, + "org.openvrml.BrowserControl", + "/BrowserFactory", + "org.openvrml.BrowserFactory"); g_return_val_if_fail(browser_factory, 0); scope_guard browser_factory_guard = make_guard(g_object_unref, G_OBJECT(browser_factory)); Property changes on: trunk/src/libopenvrml/openvrml/bad_url.cpp ___________________________________________________________________ Modified: svn:mergeinfo - /branches/0.17/src/libopenvrml/openvrml/bad_url.cpp:3713 + /branches/0.17/src/libopenvrml/openvrml/bad_url.cpp:3713,3717 Property changes on: trunk/src/libopenvrml/openvrml/scene.cpp ___________________________________________________________________ Modified: svn:mergeinfo - /branches/0.17/src/libopenvrml/openvrml/scene.cpp:3713 + /branches/0.17/src/libopenvrml/openvrml/scene.cpp:3713,3717 Property changes on: trunk/src/libopenvrml/openvrml/scene.h ___________________________________________________________________ Modified: svn:mergeinfo - /branches/0.17/src/libopenvrml/openvrml/scene.h:3713 + /branches/0.17/src/libopenvrml/openvrml/scene.h:3713,3717 Property changes on: trunk/src/libopenvrml/openvrml/script.cpp ___________________________________________________________________ Modified: svn:mergeinfo - /branches/0.17/src/libopenvrml/openvrml/script.cpp:3713 + /branches/0.17/src/libopenvrml/openvrml/script.cpp:3713,3717 Modified: trunk/src/openvrml-player/curlbrowserhost.cpp =================================================================== --- trunk/src/openvrml-player/curlbrowserhost.cpp 2008-10-05 06:50:53 UTC (rev 3717) +++ trunk/src/openvrml-player/curlbrowserhost.cpp 2008-10-05 06:57:26 UTC (rev 3718) @@ -853,11 +853,10 @@ throw () { DBusGProxy * browser_factory = - dbus_g_proxy_new_for_name_owner(connection, - "org.openvrml.BrowserControl", - "/BrowserFactory", - "org.openvrml.BrowserFactory", - error); + dbus_g_proxy_new_for_name(connection, + "org.openvrml.BrowserControl", + "/BrowserFactory", + "org.openvrml.BrowserFactory"); g_return_val_if_fail(browser_factory, 0); scope_guard browser_factory_guard = make_guard(g_object_unref, G_OBJECT(browser_factory)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-10-05 17:48:15
|
Revision: 3720 http://openvrml.svn.sourceforge.net/openvrml/?rev=3720&view=rev Author: braden Date: 2008-10-05 17:47:12 +0000 (Sun, 05 Oct 2008) Log Message: ----------- Updated to 20081005 release of Autoconf GL Macros. Modified Paths: -------------- trunk/ChangeLog trunk/m4/acx_pthread.m4 trunk/m4/ax_check_gl.m4 Property Changed: ---------------- trunk/ trunk/src/libopenvrml/openvrml/bad_url.cpp trunk/src/libopenvrml/openvrml/scene.cpp trunk/src/libopenvrml/openvrml/scene.h trunk/src/libopenvrml/openvrml/script.cpp Property changes on: trunk ___________________________________________________________________ Modified: svn:mergeinfo - /branches/0.17:3713,3717 /branches/local:3677-3689 /branches/node-modules:3622-3623,3632-3635,3637-3638,3640-3641,3643-3644,3646-3647,3649-3650,3654-3655,3657-3658,3661-3662,3664-3665,3667-3668,3670-3671,3673-3674,3684-3685,3687-3688 + /branches/0.17:3713,3717,3719 /branches/local:3677-3689 /branches/node-modules:3622-3623,3632-3635,3637-3638,3640-3641,3643-3644,3646-3647,3649-3650,3654-3655,3657-3658,3661-3662,3664-3665,3667-3668,3670-3671,3673-3674,3684-3685,3687-3688 Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-10-05 17:37:50 UTC (rev 3719) +++ trunk/ChangeLog 2008-10-05 17:47:12 UTC (rev 3720) @@ -1,5 +1,12 @@ 2008-10-05 Braden McDaniel <br...@en...> + Updated to 20081005 release of Autoconf GL Macros. + + * m4/acx_pthread.m4 + * m4/ax_check_gl.m4 + +2008-10-05 Braden McDaniel <br...@en...> + Need to use dbus_g_proxy_new_for_name rather than _new_for_name_owner in order for activation to work. Modified: trunk/m4/acx_pthread.m4 =================================================================== --- trunk/m4/acx_pthread.m4 2008-10-05 17:37:50 UTC (rev 3719) +++ trunk/m4/acx_pthread.m4 2008-10-05 17:47:12 UTC (rev 3720) @@ -1,4 +1,6 @@ -##### http://autoconf-archive.cryp.to/acx_pthread.html +# =========================================================================== +# http://autoconf-archive.cryp.to/acx_pthread.html +# =========================================================================== # # SYNOPSIS # @@ -6,82 +8,76 @@ # # DESCRIPTION # -# This macro figures out how to build C programs using POSIX threads. -# It sets the PTHREAD_LIBS output variable to the threads library and -# linker flags, and the PTHREAD_CFLAGS output variable to any special -# C compiler flags that are needed. (The user can also force certain -# compiler flags/libs to be tested by setting these environment -# variables.) +# This macro figures out how to build C programs using POSIX threads. It +# sets the PTHREAD_LIBS output variable to the threads library and linker +# flags, and the PTHREAD_CFLAGS output variable to any special C compiler +# flags that are needed. (The user can also force certain compiler +# flags/libs to be tested by setting these environment variables.) # # Also sets PTHREAD_CC to any special C compiler that is needed for -# multi-threaded programs (defaults to the value of CC otherwise). -# (This is necessary on AIX to use the special cc_r compiler alias.) +# multi-threaded programs (defaults to the value of CC otherwise). (This +# is necessary on AIX to use the special cc_r compiler alias.) # -# NOTE: You are assumed to not only compile your program with these -# flags, but also link it with them as well. e.g. you should link -# with $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS -# $LIBS +# NOTE: You are assumed to not only compile your program with these flags, +# but also link it with them as well. e.g. you should link with +# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS # -# If you are only building threads programs, you may wish to use -# these variables in your default LIBS, CFLAGS, and CC: +# If you are only building threads programs, you may wish to use these +# variables in your default LIBS, CFLAGS, and CC: # # LIBS="$PTHREAD_LIBS $LIBS" # CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # CC="$PTHREAD_CC" # -# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute -# constant has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to -# that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX). +# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant +# has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name +# (e.g. PTHREAD_CREATE_UNDETACHED on AIX). # -# ACTION-IF-FOUND is a list of shell commands to run if a threads -# library is found, and ACTION-IF-NOT-FOUND is a list of commands to -# run it if it is not found. If ACTION-IF-FOUND is not specified, the -# default action will define HAVE_PTHREAD. +# ACTION-IF-FOUND is a list of shell commands to run if a threads library +# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it +# is not found. If ACTION-IF-FOUND is not specified, the default action +# will define HAVE_PTHREAD. # -# Please let the authors know if this macro fails on any platform, or -# if you have any other suggestions or comments. This macro was based -# on work by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) -# (with help from M. Frigo), as well as ac_pthread and hb_pthread -# macros posted by Alejandro Forero Cuervo to the autoconf macro -# repository. We are also grateful for the helpful feedback of -# numerous users. +# Please let the authors know if this macro fails on any platform, or if +# you have any other suggestions or comments. This macro was based on work +# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help +# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by +# Alejandro Forero Cuervo to the autoconf macro repository. We are also +# grateful for the helpful feedback of numerous users. # # LAST MODIFICATION # -# 2007-07-29 +# 2008-04-12 # # COPYLEFT # -# Copyright (c) 2007 Steven G. Johnson <st...@al...> +# Copyright (c) 2008 Steven G. Johnson <st...@al...> # -# 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 3 of the -# License, or (at your option) any later version. +# 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 3 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. +# 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, see -# <http://www.gnu.org/licenses/>. +# You should have received a copy of the GNU General Public License along +# with this program. If not, see <http://www.gnu.org/licenses/>. # -# As a special exception, the respective Autoconf Macro's copyright -# owner gives unlimited permission to copy, distribute and modify the -# configure scripts that are the output of Autoconf when processing -# the Macro. You need not follow the terms of the GNU General Public -# License when using or distributing such scripts, even though -# portions of the text of the Macro appear in them. The GNU General -# Public License (GPL) does govern all other use of the material that -# constitutes the Autoconf Macro. +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. # -# This special exception to the GPL applies to versions of the -# Autoconf Macro released by the Autoconf Macro Archive. When you -# make and distribute a modified version of the Autoconf Macro, you -# may extend this special exception to the GPL to apply to your -# modified version as well. +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Macro Archive. When you make and +# distribute a modified version of the Autoconf Macro, you may extend this +# special exception to the GPL to apply to your modified version as well. AC_DEFUN([ACX_PTHREAD], [ AC_REQUIRE([AC_CANONICAL_HOST]) Modified: trunk/m4/ax_check_gl.m4 =================================================================== --- trunk/m4/ax_check_gl.m4 2008-10-05 17:37:50 UTC (rev 3719) +++ trunk/m4/ax_check_gl.m4 2008-10-05 17:47:12 UTC (rev 3720) @@ -10,7 +10,7 @@ dnl "OpenGL/gl.h" is found, HAVE_OPENGL_GL_H is defined. These preprocessor dnl definitions may not be mutually exclusive. dnl -dnl version: 2.0 +dnl version: 2.1 dnl author: Braden McDaniel <br...@en...> dnl dnl This program is free software; you can redistribute it and/or modify @@ -34,7 +34,8 @@ dnl License when using or distributing such scripts. dnl AC_DEFUN([AX_CHECK_GL], -[AC_REQUIRE([AC_PATH_X])dnl +[AC_REQUIRE([AC_CANONICAL_HOST]) +AC_REQUIRE([AC_PATH_X])dnl AC_REQUIRE([ACX_PTHREAD])dnl AC_LANG_PUSH([C]) @@ -75,6 +76,10 @@ AC_CACHE_CHECK([for OpenGL library], [ax_cv_check_gl_libgl], [ax_cv_check_gl_libgl="no" +case $host_cpu in + x86_64) ax_check_gl_libdir=lib64 ;; + *) ax_check_gl_libdir=lib ;; +esac ax_save_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${GL_CFLAGS} ${CPPFLAGS}" ax_save_LIBS="${LIBS}" @@ -85,13 +90,14 @@ [ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'`], [ax_try_lib="${ax_lib}"]) LIBS="${ax_try_lib} ${GL_LIBS} ${ax_save_LIBS}" - AC_LINK_IFELSE( -[AX_CHECK_GL_PROGRAM], -[ax_cv_check_gl_libgl="${ax_try_lib}"; break], -[ax_check_gl_dylib_flag='-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib' -LIBS="${ax_try_lib} ${ax_check_gl_dylib_flag} ${GL_LIBS} ${ax_save_LIBS}" AC_LINK_IFELSE([AX_CHECK_GL_PROGRAM], - [ax_cv_check_gl_libgl="${ax_try_lib} ${ax_check_gl_dylib_flag}"; break])]) + [ax_cv_check_gl_libgl="${ax_try_lib}"; break], + [ax_check_gl_nvidia_flags="-L/usr/${ax_check_gl_libdir}/nvidia -lGLcore" LIBS="${ax_try_lib} ${ax_check_gl_nvidia_flags} ${GL_LIBS} ${ax_save_LIBS}" +AC_LINK_IFELSE([AX_CHECK_GL_PROGRAM], + [ax_cv_check_gl_libgl="${ax_try_lib} ${ax_check_gl_nvidia_flags}"; break], + [ax_check_gl_dylib_flag='-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib' LIBS="${ax_try_lib} ${ax_check_gl_dylib_flag} ${GL_LIBS} ${ax_save_LIBS}" +AC_LINK_IFELSE([AX_CHECK_GL_PROGRAM], + [ax_cv_check_gl_libgl="${ax_try_lib} ${ax_check_gl_dylib_flag}"; break])])]) done AS_IF([test "X$ax_cv_check_gl_libgl" = Xno -a "X$no_x" = Xyes], Property changes on: trunk/src/libopenvrml/openvrml/bad_url.cpp ___________________________________________________________________ Modified: svn:mergeinfo - /branches/0.17/src/libopenvrml/openvrml/bad_url.cpp:3713,3717 + /branches/0.17/src/libopenvrml/openvrml/bad_url.cpp:3713,3717,3719 Property changes on: trunk/src/libopenvrml/openvrml/scene.cpp ___________________________________________________________________ Modified: svn:mergeinfo - /branches/0.17/src/libopenvrml/openvrml/scene.cpp:3713,3717 + /branches/0.17/src/libopenvrml/openvrml/scene.cpp:3713,3717,3719 Property changes on: trunk/src/libopenvrml/openvrml/scene.h ___________________________________________________________________ Modified: svn:mergeinfo - /branches/0.17/src/libopenvrml/openvrml/scene.h:3713,3717 + /branches/0.17/src/libopenvrml/openvrml/scene.h:3713,3717,3719 Property changes on: trunk/src/libopenvrml/openvrml/script.cpp ___________________________________________________________________ Modified: svn:mergeinfo - /branches/0.17/src/libopenvrml/openvrml/script.cpp:3713,3717 + /branches/0.17/src/libopenvrml/openvrml/script.cpp:3713,3717,3719 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-10-06 06:43:50
|
Revision: 3722 http://openvrml.svn.sourceforge.net/openvrml/?rev=3722&view=rev Author: braden Date: 2008-10-06 06:43:48 +0000 (Mon, 06 Oct 2008) Log Message: ----------- Updated to 20081006 release of Autoconf GL Macros. Modified Paths: -------------- trunk/ChangeLog trunk/m4/ax_check_gl.m4 Property Changed: ---------------- trunk/ Property changes on: trunk ___________________________________________________________________ Modified: svn:mergeinfo - /branches/0.17:3713,3717,3719 /branches/local:3677-3689 /branches/node-modules:3622-3623,3632-3635,3637-3638,3640-3641,3643-3644,3646-3647,3649-3650,3654-3655,3657-3658,3661-3662,3664-3665,3667-3668,3670-3671,3673-3674,3684-3685,3687-3688 + /branches/0.17:3713,3717,3719,3721 /branches/local:3677-3689 /branches/node-modules:3622-3623,3632-3635,3637-3638,3640-3641,3643-3644,3646-3647,3649-3650,3654-3655,3657-3658,3661-3662,3664-3665,3667-3668,3670-3671,3673-3674,3684-3685,3687-3688 Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-10-06 06:27:42 UTC (rev 3721) +++ trunk/ChangeLog 2008-10-06 06:43:48 UTC (rev 3722) @@ -1,3 +1,9 @@ +2008-10-06 Braden McDaniel <br...@en...> + + Updated to 20081006 release of Autoconf GL Macros. + + * m4/ax_check_gl.m4 + 2008-10-05 Braden McDaniel <br...@en...> Updated to 20081005 release of Autoconf GL Macros. Modified: trunk/m4/ax_check_gl.m4 =================================================================== --- trunk/m4/ax_check_gl.m4 2008-10-06 06:27:42 UTC (rev 3721) +++ trunk/m4/ax_check_gl.m4 2008-10-06 06:43:48 UTC (rev 3722) @@ -10,7 +10,7 @@ dnl "OpenGL/gl.h" is found, HAVE_OPENGL_GL_H is defined. These preprocessor dnl definitions may not be mutually exclusive. dnl -dnl version: 2.1 +dnl version: 2.2 dnl author: Braden McDaniel <br...@en...> dnl dnl This program is free software; you can redistribute it and/or modify @@ -92,7 +92,7 @@ LIBS="${ax_try_lib} ${GL_LIBS} ${ax_save_LIBS}" AC_LINK_IFELSE([AX_CHECK_GL_PROGRAM], [ax_cv_check_gl_libgl="${ax_try_lib}"; break], - [ax_check_gl_nvidia_flags="-L/usr/${ax_check_gl_libdir}/nvidia -lGLcore" LIBS="${ax_try_lib} ${ax_check_gl_nvidia_flags} ${GL_LIBS} ${ax_save_LIBS}" + [ax_check_gl_nvidia_flags="-L/usr/${ax_check_gl_libdir}/nvidia" LIBS="${ax_try_lib} ${ax_check_gl_nvidia_flags} ${GL_LIBS} ${ax_save_LIBS}" AC_LINK_IFELSE([AX_CHECK_GL_PROGRAM], [ax_cv_check_gl_libgl="${ax_try_lib} ${ax_check_gl_nvidia_flags}"; break], [ax_check_gl_dylib_flag='-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib' LIBS="${ax_try_lib} ${ax_check_gl_dylib_flag} ${GL_LIBS} ${ax_save_LIBS}" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-10-06 08:04:38
|
Revision: 3724 http://openvrml.svn.sourceforge.net/openvrml/?rev=3724&view=rev Author: braden Date: 2008-10-06 08:04:34 +0000 (Mon, 06 Oct 2008) Log Message: ----------- install/distcheck fixes for javadoc documentation. Modified Paths: -------------- trunk/ChangeLog trunk/doc/Makefile.am Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-10-06 06:44:41 UTC (rev 3723) +++ trunk/ChangeLog 2008-10-06 08:04:34 UTC (rev 3724) @@ -1,5 +1,10 @@ 2008-10-06 Braden McDaniel <br...@en...> + * doc/Makefile.am: install/distcheck fixes for javadoc + documentation. + +2008-10-06 Braden McDaniel <br...@en...> + Updated to 20081006 release of Autoconf GL Macros. * m4/ax_check_gl.m4 Modified: trunk/doc/Makefile.am =================================================================== --- trunk/doc/Makefile.am 2008-10-06 06:44:41 UTC (rev 3723) +++ trunk/doc/Makefile.am 2008-10-06 08:04:34 UTC (rev 3724) @@ -77,8 +77,36 @@ $(srcdir)/manual/tab_l-openvrml.png \ $(srcdir)/manual/tab_r-openvrml.png -EXTRA_DIST = $(DOCUMENTATION_FILES) $(DOXYGEN_OUTPUT_FILES) $(CUSTOMIZED_IMAGES) javadoc +JAVADOC_FILES = \ + $(srcdir)/javadoc/*.html \ + $(srcdir)/javadoc/package-list \ + $(srcdir)/javadoc/stylesheet.css +JAVADOC_RESOURCES_FILES = \ + $(srcdir)/javadoc/resources/inherit.gif + +JAVADOC_VRML_FILES = \ + $(srcdir)/javadoc/vrml/*.html + +JAVADOC_VRML_FIELD_FILES = \ + $(srcdir)/javadoc/vrml/field/*.html + +JAVADOC_VRML_NODE_FILES = \ + $(srcdir)/javadoc/vrml/node/*.html + +JAVADOC_OUTPUT_FILES = \ + $(JAVADOC_FILES) \ + $(JAVADOC_RESOURCES_FILES) \ + $(JAVADOC_VRML_FILES) \ + $(JAVADOC_VRML_FIELD_FILES) \ + $(JAVADOC_VRML_NODE_FILES) + +EXTRA_DIST = \ + $(DOCUMENTATION_FILES) \ + $(DOXYGEN_OUTPUT_FILES) \ + $(CUSTOMIZED_IMAGES) \ + $(JAVADOC_OUTPUT_FILES) + MAINTAINERCLEANFILES = $(DOXYGEN_OUTPUT_FILES) .PHONY: html-local doxygen-html javadoc-html @@ -89,16 +117,33 @@ javadoc-html: rm -rf $(srcdir)/javadoc - cd $(srcdir) && javadoc -sourcepath ../src/script/java -link $(datadir)/javadoc/java -d javadoc vrml vrml.field vrml.node + cd $(srcdir) \ + && javadoc -sourcepath ../src/script/java \ + -link $(javadocdir)/java \ + -d javadoc \ + vrml vrml.field vrml.node html-local: doxygen-html javadoc-html installdirs-local: - $(mkinstalldirs) $(DESTDIR)$(docdir)/manual $(DESTDIR)$(javadocdir)/vrml/node $(DESTDIR)$(javadocdir)/vrml/field + $(mkinstalldirs) $(DESTDIR)$(docdir)/manual \ + $(DESTDIR)$(javadocdir)/resources \ + $(DESTDIR)$(javadocdir)/vrml/node \ + $(DESTDIR)$(javadocdir)/vrml/field install-data-local: installdirs-local - $(INSTALL_DATA) $(DOXYGEN_OUTPUT_FILES) $(CUSTOMIZED_IMAGES) $(DESTDIR)$(docdir)/manual - $(INSTALL_DATA) $(srcdir)/javadoc/* $(DESTDIR)$(javadocdir) + $(INSTALL_DATA) $(DOXYGEN_OUTPUT_FILES) $(CUSTOMIZED_IMAGES) \ + $(DESTDIR)$(docdir)/manual + $(INSTALL_DATA) $(JAVADOC_FILES) \ + $(DESTDIR)$(javadocdir) + $(INSTALL_DATA) $(JAVADOC_RESOURCES_FILES) \ + $(DESTDIR)$(javadocdir)/resources + $(INSTALL_DATA) $(JAVADOC_VRML_FILES) \ + $(DESTDIR)$(javadocdir)/vrml + $(INSTALL_DATA) $(JAVADOC_VRML_FIELD_FILES) \ + $(DESTDIR)$(javadocdir)/vrml/field + $(INSTALL_DATA) $(JAVADOC_VRML_NODE_FILES) \ + $(DESTDIR)$(javadocdir)/vrml/node uninstall-local: - rm -rf $(DESTDIR)$(docdir)/manual + rm -rf $(DESTDIR)$(docdir)/manual $(DESTDIR)$(javadocdir) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-10-06 21:46:13
|
Revision: 3726 http://openvrml.svn.sourceforge.net/openvrml/?rev=3726&view=rev Author: braden Date: 2008-10-06 21:46:04 +0000 (Mon, 06 Oct 2008) Log Message: ----------- Process org.openvrml.BrowserControl.service.in with sed (rather than config.status) so that substitutions that expand to make macros get fully resolved. Modified Paths: -------------- trunk/ChangeLog trunk/configure.ac trunk/src/Makefile.am Property Changed: ---------------- trunk/ trunk/src/libopenvrml/openvrml/bad_url.cpp trunk/src/libopenvrml/openvrml/scene.cpp trunk/src/libopenvrml/openvrml/scene.h trunk/src/libopenvrml/openvrml/script.cpp Property changes on: trunk ___________________________________________________________________ Modified: svn:mergeinfo - /branches/0.17:3713,3717,3719,3721 /branches/local:3677-3689 /branches/node-modules:3622-3623,3632-3635,3637-3638,3640-3641,3643-3644,3646-3647,3649-3650,3654-3655,3657-3658,3661-3662,3664-3665,3667-3668,3670-3671,3673-3674,3684-3685,3687-3688 + /branches/0.17:3713,3717,3719,3721,3725 /branches/local:3677-3689 /branches/node-modules:3622-3623,3632-3635,3637-3638,3640-3641,3643-3644,3646-3647,3649-3650,3654-3655,3657-3658,3661-3662,3664-3665,3667-3668,3670-3671,3673-3674,3684-3685,3687-3688 Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-10-06 21:39:13 UTC (rev 3725) +++ trunk/ChangeLog 2008-10-06 21:46:04 UTC (rev 3726) @@ -1,5 +1,18 @@ 2008-10-06 Braden McDaniel <br...@en...> + Process org.openvrml.BrowserControl.service.in with sed (rather + than config.status) so that substitutions that expand to make + macros get fully resolved. + + * configure.ac: Removed + src/openvrml-xembed/org.openvrml.BrowserControl.service from + AC_CONFIG_FILES. + * src/Makefile.am: Added rules to create + org.openvrml.BrowserControl.service from + org.openvrml.BrowserControl.service.in. + +2008-10-06 Braden McDaniel <br...@en...> + * doc/Makefile.am: install/distcheck fixes for javadoc documentation. Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2008-10-06 21:39:13 UTC (rev 3725) +++ trunk/configure.ac 2008-10-06 21:46:04 UTC (rev 3726) @@ -10,7 +10,6 @@ [models/textures/Makefile] [lib/Makefile] [src/Makefile] - [src/openvrml-xembed/org.openvrml.BrowserControl.service] [src/libopenvrml/openvrml-config.h] [src/libopenvrml-gl/openvrml-gl-config.h] [src/script/Makefile] Modified: trunk/src/Makefile.am =================================================================== --- trunk/src/Makefile.am 2008-10-06 21:39:13 UTC (rev 3725) +++ trunk/src/Makefile.am 2008-10-06 21:46:04 UTC (rev 3726) @@ -698,6 +698,16 @@ --output=$@ \ $? +edit = sed -e 's|@libexecdir[@]|$(libexecdir)|g' + +openvrml-xembed/org.openvrml.BrowserControl.service: Makefile + rm -f $@ $@.tmp + $(edit) '$(srcdir)/$@.in' > $@.tmp + chmod a-w $@.tmp + mv $@.tmp $@ + +openvrml-xembed/org.openvrml.BrowserControl.service: $(srcdir)/openvrml-xembed/org.openvrml.BrowserControl.service.in + if ENABLE_PLAYER bin_PROGRAMS = openvrml-player/openvrml-player BUILT_SOURCES += \ Property changes on: trunk/src/libopenvrml/openvrml/bad_url.cpp ___________________________________________________________________ Modified: svn:mergeinfo - /branches/0.17/src/libopenvrml/openvrml/bad_url.cpp:3713,3717,3719,3721 + /branches/0.17/src/libopenvrml/openvrml/bad_url.cpp:3713,3717,3719,3721,3725 Property changes on: trunk/src/libopenvrml/openvrml/scene.cpp ___________________________________________________________________ Modified: svn:mergeinfo - /branches/0.17/src/libopenvrml/openvrml/scene.cpp:3713,3717,3719,3721 + /branches/0.17/src/libopenvrml/openvrml/scene.cpp:3713,3717,3719,3721,3725 Property changes on: trunk/src/libopenvrml/openvrml/scene.h ___________________________________________________________________ Modified: svn:mergeinfo - /branches/0.17/src/libopenvrml/openvrml/scene.h:3713,3717,3719,3721 + /branches/0.17/src/libopenvrml/openvrml/scene.h:3713,3717,3719,3721,3725 Property changes on: trunk/src/libopenvrml/openvrml/script.cpp ___________________________________________________________________ Modified: svn:mergeinfo - /branches/0.17/src/libopenvrml/openvrml/script.cpp:3713,3717,3719,3721 + /branches/0.17/src/libopenvrml/openvrml/script.cpp:3713,3717,3719,3721,3725 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-10-08 01:00:10
|
Revision: 3727 http://openvrml.svn.sourceforge.net/openvrml/?rev=3727&view=rev Author: braden Date: 2008-10-08 01:00:06 +0000 (Wed, 08 Oct 2008) Log Message: ----------- Removed redundant AC_ARG_VAR for JAVA_HOME. Modified Paths: -------------- trunk/ChangeLog trunk/configure.ac Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-10-06 21:46:04 UTC (rev 3726) +++ trunk/ChangeLog 2008-10-08 01:00:06 UTC (rev 3727) @@ -1,5 +1,9 @@ 2008-10-06 Braden McDaniel <br...@en...> + * configure.ac: Removed redundant AC_ARG_VAR for JAVA_HOME. + +2008-10-06 Braden McDaniel <br...@en...> + Process org.openvrml.BrowserControl.service.in with sed (rather than config.status) so that substitutions that expand to make macros get fully resolved. Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2008-10-06 21:46:04 UTC (rev 3726) +++ trunk/configure.ac 2008-10-08 01:00:06 UTC (rev 3727) @@ -325,7 +325,6 @@ AC_ARG_ENABLE([script-node-java], [AC_HELP_STRING([--disable-script-node-java], [disable Script node Java support])]) -AC_ARG_VAR([JAVA_HOME], [Java Runtime Environment (JRE) location]) case $target_cpu in x86_64) OPENVRML_JVM_ARCH=amd64 ;; i?86) OPENVRML_JVM_ARCH=i386 ;; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-10-08 06:14:22
|
Revision: 3728 http://openvrml.svn.sourceforge.net/openvrml/?rev=3728&view=rev Author: braden Date: 2008-10-08 06:14:06 +0000 (Wed, 08 Oct 2008) Log Message: ----------- Fail if dbus-glib isn't found. Modified Paths: -------------- trunk/ChangeLog trunk/configure.ac Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-10-08 01:00:06 UTC (rev 3727) +++ trunk/ChangeLog 2008-10-08 06:14:06 UTC (rev 3728) @@ -1,5 +1,9 @@ -2008-10-06 Braden McDaniel <br...@en...> +2008-10-08 Braden McDaniel <br...@en...> + * configure.ac: Fail if dbus-glib isn't found. + +2008-10-07 Braden McDaniel <br...@en...> + * configure.ac: Removed redundant AC_ARG_VAR for JAVA_HOME. 2008-10-06 Braden McDaniel <br...@en...> Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2008-10-08 01:00:06 UTC (rev 3727) +++ trunk/configure.ac 2008-10-08 06:14:06 UTC (rev 3728) @@ -166,6 +166,7 @@ # PKG_CHECK_MODULES([DBUS_G], [dbus-glib-1 glib-2.0 >= 2.6], , [have_dbus_glib=no]) +AC_ARG_VAR([DBUS_BINDING_TOOL], [Generate stub code for dbus-glib]) AC_PATH_PROG([DBUS_BINDING_TOOL], [dbus-binding-tool]) # @@ -373,7 +374,9 @@ [AC_HELP_STRING([--disable-xembed], [do not build the XEmbed control])]) AS_IF([test X$enable_xembed != Xno], - [AS_IF([test X$have_gtk = Xno], + [AS_IF([test X$have_dbus_glib = Xno], + [AC_MSG_FAILURE([D-Bus GLib bindings are required to build the XEmbed control])]) + AS_IF([test X$have_gtk = Xno], [AC_MSG_FAILURE([GTK+ is required to build the XEmbed control])]) AS_IF([test X$enable_gl_renderer = Xno], [AC_MSG_FAILURE([the XEmbed control cannot be built without the GL renderer])])]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-10-09 05:53:53
|
Revision: 3731 http://openvrml.svn.sourceforge.net/openvrml/?rev=3731&view=rev Author: braden Date: 2008-10-09 05:53:43 +0000 (Thu, 09 Oct 2008) Log Message: ----------- Removed obsolete texinfo documentation for openvrml-xembed. Modified Paths: -------------- trunk/ChangeLog trunk/doc/Makefile.am Removed Paths: ------------- trunk/doc/fdl.texi trunk/doc/openvrml-xembed.texi Property Changed: ---------------- trunk/ trunk/doc/ trunk/src/libopenvrml/openvrml/bad_url.cpp trunk/src/libopenvrml/openvrml/scene.cpp trunk/src/libopenvrml/openvrml/scene.h trunk/src/libopenvrml/openvrml/script.cpp Property changes on: trunk ___________________________________________________________________ Modified: svn:mergeinfo - /branches/0.17:3713,3717,3719,3721,3725 /branches/local:3677-3689 /branches/node-modules:3622-3623,3632-3635,3637-3638,3640-3641,3643-3644,3646-3647,3649-3650,3654-3655,3657-3658,3661-3662,3664-3665,3667-3668,3670-3671,3673-3674,3684-3685,3687-3688 + /branches/0.17:3713,3717,3719,3721,3725,3730 /branches/local:3677-3689 /branches/node-modules:3622-3623,3632-3635,3637-3638,3640-3641,3643-3644,3646-3647,3649-3650,3654-3655,3657-3658,3661-3662,3664-3665,3667-3668,3670-3671,3673-3674,3684-3685,3687-3688 Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-10-09 05:42:42 UTC (rev 3730) +++ trunk/ChangeLog 2008-10-09 05:53:43 UTC (rev 3731) @@ -1,3 +1,11 @@ +2008-10-09 Braden McDaniel <br...@en...> + + Removed obsolete texinfo documentation for openvrml-xembed. + + * doc/Makefile.am + * doc/openvrml-xembed.texi: Removed. + * doc/fdl.texi: Removed. + 2008-10-08 Braden McDaniel <br...@en...> * configure.ac: Fail if dbus-glib isn't found. Property changes on: trunk/doc ___________________________________________________________________ Modified: svn:ignore - *.info Makefile Makefile.in javadoc mdate-sh stamp-vti texinfo.tex version.texi + Makefile Makefile.in javadoc Modified: trunk/doc/Makefile.am =================================================================== --- trunk/doc/Makefile.am 2008-10-09 05:42:42 UTC (rev 3730) +++ trunk/doc/Makefile.am 2008-10-09 05:53:43 UTC (rev 3731) @@ -1,6 +1,3 @@ -info_TEXINFOS = openvrml-xembed.texi -openvrml_xembed_TEXINFOS = fdl.texi - docdir = $(datadir)/doc/@PACKAGE_TARNAME@-@PACKAGE_VERSION@ javadocdir = $(datadir)/javadoc/@PACKAGE_TARNAME@-@PACKAGE_VERSION@ Property changes on: trunk/src/libopenvrml/openvrml/bad_url.cpp ___________________________________________________________________ Modified: svn:mergeinfo - /branches/0.17/src/libopenvrml/openvrml/bad_url.cpp:3713,3717,3719,3721,3725 + /branches/0.17/src/libopenvrml/openvrml/bad_url.cpp:3713,3717,3719,3721,3725,3730 Property changes on: trunk/src/libopenvrml/openvrml/scene.cpp ___________________________________________________________________ Modified: svn:mergeinfo - /branches/0.17/src/libopenvrml/openvrml/scene.cpp:3713,3717,3719,3721,3725 + /branches/0.17/src/libopenvrml/openvrml/scene.cpp:3713,3717,3719,3721,3725,3730 Property changes on: trunk/src/libopenvrml/openvrml/scene.h ___________________________________________________________________ Modified: svn:mergeinfo - /branches/0.17/src/libopenvrml/openvrml/scene.h:3713,3717,3719,3721,3725 + /branches/0.17/src/libopenvrml/openvrml/scene.h:3713,3717,3719,3721,3725,3730 Property changes on: trunk/src/libopenvrml/openvrml/script.cpp ___________________________________________________________________ Modified: svn:mergeinfo - /branches/0.17/src/libopenvrml/openvrml/script.cpp:3713,3717,3719,3721,3725 + /branches/0.17/src/libopenvrml/openvrml/script.cpp:3713,3717,3719,3721,3725,3730 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-10-10 07:37:19
|
Revision: 3734 http://openvrml.svn.sourceforge.net/openvrml/?rev=3734&view=rev Author: braden Date: 2008-10-10 07:37:06 +0000 (Fri, 10 Oct 2008) Log Message: ----------- Updates for 0.17.9 release. Modified Paths: -------------- trunk/ChangeLog trunk/NEWS trunk/README trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml/openvrml.rc trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml-gl/openvrml-gl.rc trunk/src/Makefile.am Property Changed: ---------------- trunk/ trunk/src/libopenvrml/openvrml/bad_url.cpp trunk/src/libopenvrml/openvrml/scene.cpp trunk/src/libopenvrml/openvrml/scene.h trunk/src/libopenvrml/openvrml/script.cpp Property changes on: trunk ___________________________________________________________________ Modified: svn:mergeinfo - /branches/0.17:3713,3717,3719,3721,3725,3730 /branches/local:3677-3689 /branches/node-modules:3622-3623,3632-3635,3637-3638,3640-3641,3643-3644,3646-3647,3649-3650,3654-3655,3657-3658,3661-3662,3664-3665,3667-3668,3670-3671,3673-3674,3684-3685,3687-3688 + /branches/0.17:3713,3717,3719,3721,3725,3730,3732 /branches/local:3677-3689 /branches/node-modules:3622-3623,3632-3635,3637-3638,3640-3641,3643-3644,3646-3647,3649-3650,3654-3655,3657-3658,3661-3662,3664-3665,3667-3668,3670-3671,3673-3674,3684-3685,3687-3688 Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-10-09 06:14:51 UTC (rev 3733) +++ trunk/ChangeLog 2008-10-10 07:37:06 UTC (rev 3734) @@ -1,5 +1,17 @@ 2008-10-09 Braden McDaniel <br...@en...> + Updates for 0.17.9 release. + + * NEWS + * README + * doc/Doxyfile + * ide-projects/Windows/VisualC9_0/OpenVRML/openvrml/openvrml.rc + * ide-projects/Windows/VisualC9_0/OpenVRML/openvrml-gl/openvrml-gl.rc + * src/Makefile.am: Updated libopenvrml libtool library version to + 8:7:0; updated libopenvrml-gl libtool library version to 7:3:0. + +2008-10-09 Braden McDaniel <br...@en...> + Removed obsolete texinfo documentation for openvrml-xembed. * doc/Makefile.am Modified: trunk/NEWS =================================================================== --- trunk/NEWS 2008-10-09 06:14:51 UTC (rev 3733) +++ trunk/NEWS 2008-10-10 07:37:06 UTC (rev 3734) @@ -1,3 +1,9 @@ +Changes new in version 0.17.9, 9 October, 2008 +======================================================================== + +- Use D-Bus for communication with the OpenVRML XEmbed control. + + Changes new in version 0.17.8, 13 August, 2008 ======================================================================== Modified: trunk/README =================================================================== --- trunk/README 2008-10-09 06:14:51 UTC (rev 3733) +++ trunk/README 2008-10-10 07:37:06 UTC (rev 3734) @@ -1,4 +1,4 @@ -OpenVRML library version 0.17.8 +OpenVRML library version 0.17.9 Copyright 1998, 1999, 2000 Chris Morley <cm...@ve...> Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Braden McDaniel <br...@en...> Modified: trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml/openvrml.rc =================================================================== --- trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml/openvrml.rc 2008-10-09 06:14:51 UTC (rev 3733) +++ trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml/openvrml.rc 2008-10-10 07:37:06 UTC (rev 3734) @@ -11,7 +11,7 @@ // VS_VERSION_INFO VERSIONINFO - FILEVERSION 8,6,0,0 + FILEVERSION 8,7,0,0 PRODUCTVERSION 0,17,99,0 FILEFLAGSMASK 0x17L #ifdef _DEBUG @@ -28,7 +28,7 @@ BLOCK "040904b0" BEGIN VALUE "FileDescription", "OpenVRML Library" - VALUE "FileVersion", "8, 6, 0, 0" + VALUE "FileVersion", "8, 7, 0, 0" VALUE "InternalName", "openvrml" VALUE "LegalCopyright", "Copyright (C) 2008" VALUE "OriginalFilename", "openvrml.dll" Modified: trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml-gl/openvrml-gl.rc =================================================================== --- trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml-gl/openvrml-gl.rc 2008-10-09 06:14:51 UTC (rev 3733) +++ trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml-gl/openvrml-gl.rc 2008-10-10 07:37:06 UTC (rev 3734) @@ -11,7 +11,7 @@ // VS_VERSION_INFO VERSIONINFO - FILEVERSION 7,2,0,0 + FILEVERSION 7,3,0,0 PRODUCTVERSION 0,17,99,0 FILEFLAGSMASK 0x17L #ifdef _DEBUG @@ -28,7 +28,7 @@ BLOCK "040904b0" BEGIN VALUE "FileDescription", "OpenVRML OpenGL Renderer Library" - VALUE "FileVersion", "7, 2, 0, 0" + VALUE "FileVersion", "7, 3, 0, 0" VALUE "InternalName", "openvrml-gl" VALUE "LegalCopyright", "Copyright (C) 2008" VALUE "OriginalFilename", "openvrml-gl.dll" Modified: trunk/src/Makefile.am =================================================================== --- trunk/src/Makefile.am 2008-10-09 06:14:51 UTC (rev 3733) +++ trunk/src/Makefile.am 2008-10-10 07:37:06 UTC (rev 3734) @@ -84,8 +84,8 @@ openvrml-xembed/plugin_streambuf.h \ openvrml-player/filechooserdialog.h -LIBOPENVRML_LIBRARY_VERSION = 8:6:0 -LIBOPENVRML_GL_LIBRARY_VERSION = 7:2:0 +LIBOPENVRML_LIBRARY_VERSION = 8:7:0 +LIBOPENVRML_GL_LIBRARY_VERSION = 7:3:0 # | | | # +------+ | +---+ # | | | Property changes on: trunk/src/libopenvrml/openvrml/bad_url.cpp ___________________________________________________________________ Modified: svn:mergeinfo - /branches/0.17/src/libopenvrml/openvrml/bad_url.cpp:3713,3717,3719,3721,3725,3730 + /branches/0.17/src/libopenvrml/openvrml/bad_url.cpp:3713,3717,3719,3721,3725,3730,3732 Property changes on: trunk/src/libopenvrml/openvrml/scene.cpp ___________________________________________________________________ Modified: svn:mergeinfo - /branches/0.17/src/libopenvrml/openvrml/scene.cpp:3713,3717,3719,3721,3725,3730 + /branches/0.17/src/libopenvrml/openvrml/scene.cpp:3713,3717,3719,3721,3725,3730,3732 Property changes on: trunk/src/libopenvrml/openvrml/scene.h ___________________________________________________________________ Modified: svn:mergeinfo - /branches/0.17/src/libopenvrml/openvrml/scene.h:3713,3717,3719,3721,3725,3730 + /branches/0.17/src/libopenvrml/openvrml/scene.h:3713,3717,3719,3721,3725,3730,3732 Property changes on: trunk/src/libopenvrml/openvrml/script.cpp ___________________________________________________________________ Modified: svn:mergeinfo - /branches/0.17/src/libopenvrml/openvrml/script.cpp:3713,3717,3719,3721,3725,3730 + /branches/0.17/src/libopenvrml/openvrml/script.cpp:3713,3717,3719,3721,3725,3730,3732 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |