From d9802310dc38232335f57bcb77249cf78c3d1ecf Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 13 Dec 2004 02:39:47 +0000 Subject: [PATCH] From Marco, fixes to osgIntrospection and related libs --- VisualStudio/VisualStudio.dsw | 2 +- .../example_osgintrospection.dsp | 106 ++++++++++++++++++ VisualStudio/osgWrappers/osg/wrapper_osg.dsp | 12 +- include/osgIntrospection/ReflectionMacros | 28 ++--- src/osgWrappers/osg/GNUmakefile | 2 + src/osgWrappers/osg/Vec2.cpp | 2 +- 6 files changed, 134 insertions(+), 18 deletions(-) create mode 100644 VisualStudio/examples/osgintrospection/example_osgintrospection.dsp diff --git a/VisualStudio/VisualStudio.dsw b/VisualStudio/VisualStudio.dsw index baf563f30..d1ad60437 100644 --- a/VisualStudio/VisualStudio.dsw +++ b/VisualStudio/VisualStudio.dsw @@ -834,7 +834,7 @@ Package=<4> ############################################################################### -Project: "Example osgintrospection"=.\examples\osgintrospection\osgintrospection.dsp - Package Owner=<4> +Project: "Example osgintrospection"=.\examples\osgintrospection\example_osgintrospection.dsp - Package Owner=<4> Package=<5> {{{ diff --git a/VisualStudio/examples/osgintrospection/example_osgintrospection.dsp b/VisualStudio/examples/osgintrospection/example_osgintrospection.dsp new file mode 100644 index 000000000..866f4f7f8 --- /dev/null +++ b/VisualStudio/examples/osgintrospection/example_osgintrospection.dsp @@ -0,0 +1,106 @@ +# Microsoft Developer Studio Project File - Name="Example osgintrospection" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=Example osgintrospection - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "osgintrospection.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "osgintrospection.mak" CFG="Example osgintrospection - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "Example osgintrospection - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "Example osgintrospection - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "Example osgintrospection - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +MTL=midl.exe +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GR /GX /O2 /I "../../../include" /I "../../../../OpenThreads/include" /I "../../../../Producer/include" /I "../../../../3rdParty/include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD BASE RSC /l 0x809 /d "NDEBUG" +# ADD RSC /l 0x809 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 OpenThreadsWin32.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../../../bin/osgintrospection.exe" /libpath:"../../../lib" /libpath:"../../../../OpenThreads/lib/win32" /libpath:"../../../../Producer/lib" /libpath:"../../../../3rdParty/lib" + +!ELSEIF "$(CFG)" == "Example osgintrospection - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +MTL=midl.exe +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /vd0 /GR /GX /Zi /Od /I "../../../include" /I "../../../../OpenThreads/include" /I "../../../../Producer/include" /I "../../../../3rdParty/include" /D "_CONSOLE" /D "_MBCS" /D "FL_DLL" /D "WIN32" /D "_DEBUG" /YX /FD /c +# SUBTRACT CPP /Fr +# ADD BASE RSC /l 0x809 /d "_DEBUG" +# ADD RSC /l 0x809 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 OpenThreadsWin32d.lib /nologo /subsystem:console /debug /machine:I386 /nodefaultlib:"libcmt" /out:"../../../bin/osgintrospectiond.exe" /pdbtype:sept /libpath:"../../../lib" /libpath:"../../../../OpenThreads/lib/win32" /libpath:"../../../../Producer/lib" /libpath:"../../../../3rdParty/lib" +# SUBTRACT LINK32 /incremental:no + +!ENDIF + +# Begin Target + +# Name "Example osgintrospection - Win32 Release" +# Name "Example osgintrospection - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\..\..\examples\osgintrospection\osgintrospection.cpp +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter ";h;hpp;hxx;hm;inl" +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "" +# End Group +# End Target +# End Project diff --git a/VisualStudio/osgWrappers/osg/wrapper_osg.dsp b/VisualStudio/osgWrappers/osg/wrapper_osg.dsp index fe4bc7b41..9ced8759b 100644 --- a/VisualStudio/osgWrappers/osg/wrapper_osg.dsp +++ b/VisualStudio/osgWrappers/osg/wrapper_osg.dsp @@ -54,7 +54,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 OpenThreadsWin32.lib /nologo /dll /pdb:none /machine:I386 /nodefaultlib:"LIBC" /out:"../../../bin/osgreflection_osg.dll" /libpath:"../../../lib" /libpath:"../../../../OpenThreads/lib/win32" /libpath:"../../../../Producer/lib" /libpath:"../../../../3rdParty/lib" +# ADD LINK32 OpenThreadsWin32.lib /nologo /dll /pdb:none /machine:I386 /nodefaultlib:"LIBC" /out:"../../../bin/osgwrapper_osg.dll" /libpath:"../../../lib" /libpath:"../../../../OpenThreads/lib/win32" /libpath:"../../../../Producer/lib" /libpath:"../../../../3rdParty/lib" # SUBTRACT LINK32 /nodefaultlib !ELSEIF "$(CFG)" == "osgWrapper osg - Win32 Debug" @@ -82,7 +82,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 OpenThreadsWin32d.lib /nologo /dll /debug /machine:I386 /nodefaultlib:"LIBC" /out:"../../../bin/osgreflection_osgd.dll" /pdbtype:sept /libpath:"../../../lib" /libpath:"../../../../OpenThreads/lib/win32" /libpath:"../../../../Producer/lib" /libpath:"../../../../3rdParty/lib" +# ADD LINK32 OpenThreadsWin32d.lib /nologo /dll /debug /machine:I386 /nodefaultlib:"LIBC" /out:"../../../bin/osgwrapper_osgd.dll" /pdbtype:sept /libpath:"../../../lib" /libpath:"../../../../OpenThreads/lib/win32" /libpath:"../../../../Producer/lib" /libpath:"../../../../3rdParty/lib" # SUBTRACT LINK32 /pdb:none /nodefaultlib !ENDIF @@ -138,6 +138,14 @@ SOURCE=..\..\..\src\osgWrappers\osg\StateSet.cpp SOURCE=..\..\..\src\osgWrappers\osg\Vec2.cpp # End Source File +# Begin Source File + +SOURCE=..\..\..\src\osgWrappers\osg\Vec3.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\osgWrappers\osg\Vec4.cpp +# End Source File # End Group # Begin Group "Header Files" diff --git a/include/osgIntrospection/ReflectionMacros b/include/osgIntrospection/ReflectionMacros index 48147d09c..445d58d2d 100644 --- a/include/osgIntrospection/ReflectionMacros +++ b/include/osgIntrospection/ReflectionMacros @@ -16,15 +16,15 @@ // QUICK REFLECTORS // -------------------------------------------------------------------------- -#define STD_VALUE_REFLECTOR(t) static osgIntrospection::StdValueReflector OSG_RM_LINEID(reflector) (#t); -#define VALUE_REFLECTOR_WITH_RW(t, rw) static osgIntrospection::ValueReflector OSG_RM_LINEID(reflector) (#t, new rw); -#define STD_PAIR_REFLECTOR(t) static osgIntrospection::StdPairReflector OSG_RM_LINEID(reflector) (#t); -#define STD_PAIR_REFLECTOR_WITH_TYPES(t, pt1, pt2) static osgIntrospection::StdPairReflector OSG_RM_LINEID(reflector) (#t); -#define ABSTRACT_OBJECT_REFLECTOR(t) static osgIntrospection::AbstractObjectReflector OSG_RM_LINEID(reflector) (#t); -#define STD_CONTAINER_REFLECTOR(t) static osgIntrospection::StdContainerReflector OSG_RM_LINEID(reflector) (#t); -#define STD_CONTAINER_REFLECTOR_WITH_TYPES(t, vt) static osgIntrospection::StdContainerReflector OSG_RM_LINEID(reflector) (#t); -#define STD_MAP_REFLECTOR(t) static osgIntrospection::StdMapReflector OSG_RM_LINEID(reflector) (#t); -#define STD_MAP_REFLECTOR_WITH_TYPES(t, it, vt) static osgIntrospection::StdMapReflector OSG_RM_LINEID(reflector) (#t); +#define STD_VALUE_REFLECTOR(t) namespace { osgIntrospection::StdValueReflector OSG_RM_LINEID(reflector) (#t); } +#define VALUE_REFLECTOR_WITH_RW(t, rw) namespace { osgIntrospection::ValueReflector OSG_RM_LINEID(reflector) (#t, new rw); } +#define STD_PAIR_REFLECTOR(t) namespace { osgIntrospection::StdPairReflector OSG_RM_LINEID(reflector) (#t); } +#define STD_PAIR_REFLECTOR_WITH_TYPES(t, pt1, pt2) namespace { osgIntrospection::StdPairReflector OSG_RM_LINEID(reflector) (#t); } +#define ABSTRACT_OBJECT_REFLECTOR(t) namespace { osgIntrospection::AbstractObjectReflector OSG_RM_LINEID(reflector) (#t); } +#define STD_CONTAINER_REFLECTOR(t) namespace { osgIntrospection::StdContainerReflector OSG_RM_LINEID(reflector) (#t); } +#define STD_CONTAINER_REFLECTOR_WITH_TYPES(t, vt) namespace { osgIntrospection::StdContainerReflector OSG_RM_LINEID(reflector) (#t); } +#define STD_MAP_REFLECTOR(t) namespace { osgIntrospection::StdMapReflector OSG_RM_LINEID(reflector) (#t); } +#define STD_MAP_REFLECTOR_WITH_TYPES(t, it, vt) namespace { osgIntrospection::StdMapReflector OSG_RM_LINEID(reflector) (#t); } // -------------------------------------------------------------------------- @@ -32,19 +32,19 @@ // -------------------------------------------------------------------------- #define BEGIN_ENUM_REFLECTOR(c) \ - static struct OSG_RM_LINEID(reflector): public osgIntrospection::EnumReflector { OSG_RM_LINEID(reflector)(): inherited(#c) { osgIntrospection::ParameterInfoList params; osgIntrospection::CustomAttributeProvider *cap = getType(); + namespace { struct OSG_RM_LINEID(reflector): public osgIntrospection::EnumReflector { OSG_RM_LINEID(reflector)(): inherited(#c) { osgIntrospection::ParameterInfoList params; osgIntrospection::CustomAttributeProvider *cap = getType(); #define BEGIN_VALUE_REFLECTOR(c) \ - static struct OSG_RM_LINEID(reflector): public osgIntrospection::ValueReflector { OSG_RM_LINEID(reflector)(): inherited(#c, 0) { osgIntrospection::ParameterInfoList params; osgIntrospection::CustomAttributeProvider *cap = getType(); + namespace { struct OSG_RM_LINEID(reflector): public osgIntrospection::ValueReflector { OSG_RM_LINEID(reflector)(): inherited(#c, 0) { osgIntrospection::ParameterInfoList params; osgIntrospection::CustomAttributeProvider *cap = getType(); #define BEGIN_OBJECT_REFLECTOR(c) \ - static struct OSG_RM_LINEID(reflector): public osgIntrospection::ObjectReflector { OSG_RM_LINEID(reflector)(): inherited(#c) { osgIntrospection::ParameterInfoList params; osgIntrospection::CustomAttributeProvider *cap = getType(); + namespace { struct OSG_RM_LINEID(reflector): public osgIntrospection::ObjectReflector { OSG_RM_LINEID(reflector)(): inherited(#c) { osgIntrospection::ParameterInfoList params; osgIntrospection::CustomAttributeProvider *cap = getType(); #define BEGIN_ABSTRACT_OBJECT_REFLECTOR(c) \ - static struct OSG_RM_LINEID(reflector): public osgIntrospection::AbstractObjectReflector { OSG_RM_LINEID(reflector)(): inherited(#c) { osgIntrospection::ParameterInfoList params; osgIntrospection::CustomAttributeProvider *cap = getType(); + namespace { struct OSG_RM_LINEID(reflector): public osgIntrospection::AbstractObjectReflector { OSG_RM_LINEID(reflector)(): inherited(#c) { osgIntrospection::ParameterInfoList params; osgIntrospection::CustomAttributeProvider *cap = getType(); #define END_REFLECTOR \ - } } OSG_RM_LINEID(reflector_instance); + } } OSG_RM_LINEID(reflector_instance); } // -------------------------------------------------------------------------- diff --git a/src/osgWrappers/osg/GNUmakefile b/src/osgWrappers/osg/GNUmakefile index 5f99d3239..b9c8c2bda 100644 --- a/src/osgWrappers/osg/GNUmakefile +++ b/src/osgWrappers/osg/GNUmakefile @@ -13,6 +13,8 @@ CXXFILES =\ StateAttribute.cpp\ StateSet.cpp\ Vec2.cpp\ + Vec3.cpp\ + Vec4.cpp\ LIBS += -losg -losgIntrospection $(OTHER_LIBS) diff --git a/src/osgWrappers/osg/Vec2.cpp b/src/osgWrappers/osg/Vec2.cpp index 7b277d2bc..1c4daf44b 100644 --- a/src/osgWrappers/osg/Vec2.cpp +++ b/src/osgWrappers/osg/Vec2.cpp @@ -2,7 +2,7 @@ #include #include -#include +#include using namespace osgIntrospection;