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] |