From: <sv...@ww...> - 2005-02-05 10:16:27
|
Author: delta Date: 2005-02-05 02:16:18 -0800 (Sat, 05 Feb 2005) New Revision: 1460 Added: trunk/CSP/CSPSim/Tools/Layout/VisualStudio2003/ trunk/CSP/CSPSim/Tools/Layout/VisualStudio2003/Layout/ trunk/CSP/CSPSim/Tools/Layout/VisualStudio2003/Layout/Layout.vcproj trunk/CSP/CSPSim/Tools/Layout/VisualStudio2003/VisualStudio.sln Modified: trunk/CSP/CSPSim/Tools/Layout/LayoutNodes.h trunk/CSP/CSPSim/Tools/Layout/View.cpp Log: * Initial vs2003 project files. Builds Layout only for now. A few mods were needed, in particular the timespec struct and the nanosleep function are not known here and have been replaced by Sleep(1), protected behind #ifdef _MSC_VER. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1460 Modified: trunk/CSP/CSPSim/Tools/Layout/LayoutNodes.h =================================================================== --- trunk/CSP/CSPSim/Tools/Layout/LayoutNodes.h 2005-02-05 04:08:48 UTC (rev 1459) +++ trunk/CSP/CSPSim/Tools/Layout/LayoutNodes.h 2005-02-05 10:16:18 UTC (rev 1460) @@ -240,7 +240,7 @@ virtual void traverse(LayoutNodeVisitor &v) { } virtual bool isGroup() const { return false; } - virtual LayoutGroup *asGroup() { assert(0); } + virtual LayoutGroup *asGroup() { assert(0); return 0; } virtual void setModel(osg::ref_ptr<osg::Node> node) { _graph = node; rebind(); Modified: trunk/CSP/CSPSim/Tools/Layout/View.cpp =================================================================== --- trunk/CSP/CSPSim/Tools/Layout/View.cpp 2005-02-05 04:08:48 UTC (rev 1459) +++ trunk/CSP/CSPSim/Tools/Layout/View.cpp 2005-02-05 10:16:18 UTC (rev 1460) @@ -30,9 +30,20 @@ #undef _POSIX_C_SOURCE #endif -#include <Python.h> -#include <unistd.h> +#ifdef _MSC_VER + #ifdef _DEBUG + #undef _DEBUG + #include <Python.h> + #define _DEBUG + #else + #include <Python.h> + #endif +#else + #include <Python.h> + #include <unistd.h> +#endif + #include <osgUtil/Optimizer> #include <osgDB/ReadFile> #include <osgProducer/Viewer> @@ -51,6 +62,7 @@ #include <osg/Geometry> #include <osg/Drawable> #include <osg/ref_ptr> +#include <osg/Vec3> #include <iostream> #include <cstdio> @@ -138,9 +150,11 @@ void View::run() { if (!m_Viewer) return; m_Quit = false; +#ifndef _MSC_VER timespec sleeptime; sleeptime.tv_sec = 0; sleeptime.tv_nsec = 1000000; +#endif m_Viewer->realize(); while (!m_Viewer->done() && !m_Quit) { m_Viewer->sync(); @@ -148,7 +162,11 @@ m_Viewer->frame(); m_DynamicGrid->setLook(getCameraTarget(), getCameraPosition()); Py_BEGIN_ALLOW_THREADS; +#ifndef _MSC_VER nanosleep(&sleeptime, 0); +#else + Sleep(1); +#endif Py_END_ALLOW_THREADS; } //m_Viewer->sync(); @@ -249,12 +267,12 @@ } osg::Matrixd inverseMVPW; inverseMVPW.invert(vum); - osg::Vec3 near = osg::Vec3(rx, ry, -1.0) * inverseMVPW; - osg::Vec3 far = osg::Vec3(rx, ry, 1.0) * inverseMVPW; - osg::Vec3 ray = near - far; + osg::Vec3 near_ = osg::Vec3(rx, ry, -1.0) * inverseMVPW; + osg::Vec3 far_ = osg::Vec3(rx, ry, 1.0) * inverseMVPW; + osg::Vec3 ray = near_ - far_; if (ray.z() != 0) { - surface_x = near.x() - near.z() * (ray.x() / ray.z()); - surface_y = near.y() - near.z() * (ray.y() / ray.z()); + surface_x = near_.x() - near_.z() * (ray.x() / ray.z()); + surface_y = near_.y() - near_.z() * (ray.y() / ray.z()); } } } Added: trunk/CSP/CSPSim/Tools/Layout/VisualStudio2003/Layout/Layout.vcproj =================================================================== --- trunk/CSP/CSPSim/Tools/Layout/VisualStudio2003/Layout/Layout.vcproj 2005-02-05 04:08:48 UTC (rev 1459) +++ trunk/CSP/CSPSim/Tools/Layout/VisualStudio2003/Layout/Layout.vcproj 2005-02-05 10:16:18 UTC (rev 1460) @@ -0,0 +1,178 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="7.10" + Name="Layout" + ProjectGUID="{93A0D0F8-4393-42B1-9BB6-B8DB08952FB7}" + Keyword="MakeFileProj"> + <Platforms> + <Platform + Name="Win32"/> + </Platforms> + <Configurations> + <Configuration + Name="Debug|Win32" + OutputDirectory="Debug" + IntermediateDirectory="Debug" + ConfigurationType="2"> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + AdditionalIncludeDirectories="../../../../../SimData/Include;$(PYTHON_PATH)/include" + PreprocessorDefinitions="WIN32" + RuntimeLibrary="3" + RuntimeTypeInfo="TRUE" + WarningLevel="3"/> + <Tool + Name="VCCustomBuildTool"/> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="osgd.lib OpenThreadsWin32d.lib osgGAd.lib osgProducerd.lib osgDBd.lib Producerd.lib osgUtild.lib" + OutputFile="../../.bin/$(ProjectName)d.dll" + AdditionalLibraryDirectories="$(PYTHON_PATH)/libs" + OptimizeReferences="2" + ImportLibrary="$(OutDir)/$(TargetName).lib"/> + <Tool + Name="VCMIDLTool"/> + <Tool + Name="VCPostBuildEventTool"/> + <Tool + Name="VCPreBuildEventTool"/> + <Tool + Name="VCPreLinkEventTool"/> + <Tool + Name="VCResourceCompilerTool"/> + <Tool + Name="VCWebServiceProxyGeneratorTool"/> + <Tool + Name="VCXMLDataGeneratorTool"/> + <Tool + Name="VCWebDeploymentTool"/> + <Tool + Name="VCManagedWrapperGeneratorTool"/> + <Tool + Name="VCAuxiliaryManagedWrapperGeneratorTool"/> + </Configuration> + <Configuration + Name="Release|Win32" + OutputDirectory="Release" + IntermediateDirectory="Release" + ConfigurationType="2"> + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="../../../../../SimData/Include;$(PYTHON_PATH)/include" + PreprocessorDefinitions="WIN32" + RuntimeLibrary="2" + RuntimeTypeInfo="TRUE" + WarningLevel="3"/> + <Tool + Name="VCCustomBuildTool"/> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="osg.lib OpenThreadsWin32.lib osgGA.lib osgProducer.lib osgDB.lib Producer.lib osgUtil.lib" + OutputFile="../../.bin/$(ProjectName).dll" + AdditionalLibraryDirectories="$(PYTHON_PATH)/libs"/> + <Tool + Name="VCMIDLTool"/> + <Tool + Name="VCPostBuildEventTool"/> + <Tool + Name="VCPreBuildEventTool"/> + <Tool + Name="VCPreLinkEventTool"/> + <Tool + Name="VCResourceCompilerTool"/> + <Tool + Name="VCWebServiceProxyGeneratorTool"/> + <Tool + Name="VCXMLDataGeneratorTool"/> + <Tool + Name="VCWebDeploymentTool"/> + <Tool + Name="VCManagedWrapperGeneratorTool"/> + <Tool + Name="VCAuxiliaryManagedWrapperGeneratorTool"/> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <Filter + Name="Source Files" + Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx" + UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"> + <File + RelativePath="..\..\cLayout_wrap.cpp"> + <FileConfiguration + Name="Debug|Win32"> + <Tool + Name="VCCLCompilerTool" + WarningLevel="2" + UndefinePreprocessorDefinitions="_DEBUG"/> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32"> + <Tool + Name="VCCLCompilerTool" + WarningLevel="2"/> + </FileConfiguration> + </File> + <File + RelativePath="..\..\DynamicGrid.cpp"> + </File> + <File + RelativePath="..\..\FeatureGraph.cpp"> + </File> + <File + RelativePath="..\..\LayoutNodes.cpp"> + </File> + <File + RelativePath="..\..\PickHandler.cpp"> + </File> + <File + RelativePath="..\..\View.cpp"> + </File> + <File + RelativePath="..\..\ViewEventHandler.cpp"> + </File> + </Filter> + <Filter + Name="Header Files" + Filter="h;hpp;hxx;hm;inl;inc;xsd" + UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"> + <File + RelativePath="..\..\cLayout_wrap.h"> + </File> + <File + RelativePath="..\..\DynamicGrid.h"> + </File> + <File + RelativePath="..\..\FeatureGraph.h"> + </File> + <File + RelativePath="..\..\LayoutNodes.h"> + </File> + <File + RelativePath="..\..\PickHandler.h"> + </File> + <File + RelativePath="..\..\View.h"> + </File> + <File + RelativePath="..\..\ViewEventHandler.h"> + </File> + </Filter> + <File + RelativePath="..\..\cLayout.i"> + <FileConfiguration + Name="Release|Win32"> + <Tool + Name="VCCustomBuildTool" + CommandLine="$(SWIG_PATH)\swig -runtime -c++ -python -noexcept -I..\..\..\SimData\Include -I..\..\.. -o ..\..\$(InputName)_wrap.cpp ..\..\$(InputName).i" + Outputs="..\..\$(InputName)_wrap.cpp"/> + </FileConfiguration> + </File> + </Files> + <Globals> + </Globals> +</VisualStudioProject> Added: trunk/CSP/CSPSim/Tools/Layout/VisualStudio2003/VisualStudio.sln =================================================================== --- trunk/CSP/CSPSim/Tools/Layout/VisualStudio2003/VisualStudio.sln 2005-02-05 04:08:48 UTC (rev 1459) +++ trunk/CSP/CSPSim/Tools/Layout/VisualStudio2003/VisualStudio.sln 2005-02-05 10:16:18 UTC (rev 1460) @@ -0,0 +1,21 @@ +Microsoft Visual Studio Solution File, Format Version 8.00 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Layout", "Layout\Layout.vcproj", "{93A0D0F8-4393-42B1-9BB6-B8DB08952FB7}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + Debug = Debug + Release = Release + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {93A0D0F8-4393-42B1-9BB6-B8DB08952FB7}.Debug.ActiveCfg = Debug|Win32 + {93A0D0F8-4393-42B1-9BB6-B8DB08952FB7}.Debug.Build.0 = Debug|Win32 + {93A0D0F8-4393-42B1-9BB6-B8DB08952FB7}.Release.ActiveCfg = Release|Win32 + {93A0D0F8-4393-42B1-9BB6-B8DB08952FB7}.Release.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal |