From: <rob...@us...> - 2009-02-11 13:19:15
|
Revision: 353 http://colladamaya.svn.sourceforge.net/colladamaya/?rev=353&view=rev Author: robertwuerfel Date: 2009-02-11 13:19:06 +0000 (Wed, 11 Feb 2009) Log Message: ----------- add information about revision and platform to dae files exported add camera to framework and loader (still incomplete) Modified Paths: -------------- branches/nextgen/COLLADAFramework/include/COLLADAFWIWriter.h branches/nextgen/COLLADAFramework/scripts/COLLADAFramework.vcproj branches/nextgen/COLLADAMax/BUILD branches/nextgen/COLLADAMax/include/COLLADAMaxDocumentExporter.h branches/nextgen/COLLADAMax/include/COLLADAMaxDocumentImporter.h branches/nextgen/COLLADAMax/scripts/COLLADAMax.vcproj branches/nextgen/COLLADAMax/src/COLLADAMaxDocumentExporter.cpp branches/nextgen/COLLADAMax/src/COLLADAMaxDocumentImporter.cpp branches/nextgen/COLLADASaxFrameworkLoader/include/COLLADASaxFWLFileLoader.h branches/nextgen/COLLADASaxFrameworkLoader/scripts/COLLADASaxFrameworkLoader.vcproj branches/nextgen/COLLADASaxFrameworkLoader/src/COLLADASaxFWLFileLoader.cpp Added Paths: ----------- branches/nextgen/COLLADAFramework/include/COLLADAFWCamera.h branches/nextgen/COLLADAFramework/src/COLLADAFWCamera.cpp branches/nextgen/COLLADASaxFrameworkLoader/include/COLLADASaxFWLLibraryCamerasLoader.h branches/nextgen/COLLADASaxFrameworkLoader/src/COLLADASaxFWLLibraryCamerasLoader.cpp Property Changed: ---------------- branches/nextgen/COLLADAMax/include/ Added: branches/nextgen/COLLADAFramework/include/COLLADAFWCamera.h =================================================================== --- branches/nextgen/COLLADAFramework/include/COLLADAFWCamera.h (rev 0) +++ branches/nextgen/COLLADAFramework/include/COLLADAFWCamera.h 2009-02-11 13:19:06 UTC (rev 353) @@ -0,0 +1,134 @@ +/* + Copyright (c) 2008 NetAllied Systems GmbH + + This file is part of COLLADAFramework. + + Licensed under the MIT Open Source License, + for details please see LICENSE file or the website + http://www.opensource.org/licenses/mit-license.php +*/ + +#ifndef __COLLADAFW_CAMERA_H__ +#define __COLLADAFW_CAMERA_H__ + +#include "COLLADAFWPrerequisites.h" +#include "COLLADAFWObject.h" + + +namespace COLLADAFW +{ + + /** Camera class. The camera is either a perspective or an orthographic camera. + The CameraType indicates of which type the camera is which. + For perspective cameras mXFovOrXMag and mYFovOrYMag store the horizontal or vertical field of view, + for perspective cameras mXFovOrXMag and mYFovOrYMag store the horizontal or vertical magnification of the view.*/ + class Camera : public ObjectTemplate < COLLADA_TYPE::CAMERA > + { + public: + /** The type of the camera.*/ + enum CameraType + { + UNDEFINED_CAMERATYPE, + ORTHOGRAPHIC, + PERSPECTIVE + }; + + /** Defines which values are used to describe the perspective camera.*/ + enum DescriptionType + { + UNDEFINED, //!< The perspective camera object is invalid + SINGLE_X, //!< Only xfov or xmag, respectively describes the camera + SINGLE_Y, //!< Only yfov or ymag, respectively describes the camera + X_AND_Y, //!< xfov and yfov or xmag and ymag, respectively describe the camera + ASPECTRATIO_AND_X, //!< aspect ratio and xfov or xmag, respectively describe the camera + ASPECTRATIO_AND_Y, //!< aspect ratio and yfov or <mag, respectivelydescribe the camera + }; + + + + private: + /** The name of the camera*/ + String mName; + + /** The type of the camera*/ + CameraType mCameraType; + + /** The type of description used to define the perspective camera.*/ + DescriptionType mDescriptionType; + + /** The horizontal field of view or magnification of the view.*/ + double mXFovOrXMag; + + /** The vertical field of view or magnification of the view.*/ + double mYFovOrYMag; + + + /** The aspect ratio.*/ + double mAspectRatio; + + /** The near clipping plane.*/ + double mNearClippingPlane; + + /** The far clipping plane.*/ + double mFarClippingPlane; + public: + /** + @param objectId The object id of the camera.*/ + Camera( ObjectId objectId ); + + /** Destructor. */ + virtual ~Camera(); + + /** Returns the name of the camera.*/ + const COLLADAFW::String& getName() const { return mName; } + + /** Sets the name of the camera.*/ + void setName(const COLLADAFW::String& name) { mName = name; } + + /** Returns the type of the camera.*/ + CameraType getCameraType() const { return mCameraType; } + + /** Sets the type of the camera.*/ + void setCameraType( CameraType cameraType) { mCameraType = cameraType; } + + /** Returns the type of description used to define the perspective camera.*/ + DescriptionType getDescriptionType() const { return mDescriptionType; } + + /** sets the type of description used to define the perspective camera.*/ + void setDescriptionType(DescriptionType descriptionType) { mDescriptionType = descriptionType; } + + /** Returns the horizontal field of view or magnification of the view.*/ + double getXFovOrXMag() const { return mXFovOrXMag; } + + /** Sets the horizontal field of view or magnification of the view.*/ + void setXFovOrXMag(double xFov) { mXFovOrXMag = xFov; } + + /** Returns the vertical field of view or magnification of the view.*/ + double getYFovOrYMag() const { return mYFovOrYMag; } + + /** Sets the vertical field of view or magnification of the view.*/ + void setYFovOrYMag(double yFov) { mYFovOrYMag = yFov; } + + /** Returns the aspect ratio.*/ + double getAspectRatio() const { return mAspectRatio; } + + /** Sets the aspect ratio.*/ + void setAspectRatio(double aspectRatio) { mAspectRatio = aspectRatio; } + + /** Returns the near clipping plane.*/ + double getNearClippingPlane() const { return mNearClippingPlane; } + + /** Sets the near clipping plane.*/ + void setNearClippingPlane(double nearClippingPlane) { mNearClippingPlane = nearClippingPlane; } + + /** Returns the far clipping plane.*/ + double getFarClippingPlane() const { return mFarClippingPlane; } + + /** Sets the far clipping plane.*/ + void setFarClippingPlane(double farClippingPlane) { mFarClippingPlane = farClippingPlane; } + + }; + +} // namespace COLLADAFW + +#endif // __COLLADAFW_CAMERA_H__ Modified: branches/nextgen/COLLADAFramework/include/COLLADAFWIWriter.h =================================================================== --- branches/nextgen/COLLADAFramework/include/COLLADAFWIWriter.h 2009-02-11 11:00:27 UTC (rev 352) +++ branches/nextgen/COLLADAFramework/include/COLLADAFWIWriter.h 2009-02-11 13:19:06 UTC (rev 353) @@ -22,6 +22,7 @@ class LibraryNodes; class Material; class Effect; + class Camera; /** Class that needs to be implemented by a writer. @@ -75,6 +76,10 @@ @return The writer should return true, if writing succeeded, false otherwise.*/ virtual bool writeEffect( const Effect* effect ) = 0; + /** When this method is called, the writer must write the camera. + @return The writer should return true, if writing succeeded, false otherwise.*/ + virtual bool writeCamera( const Camera* camera ) = 0; + private: /** Disable default copy ctor. */ Modified: branches/nextgen/COLLADAFramework/scripts/COLLADAFramework.vcproj =================================================================== --- branches/nextgen/COLLADAFramework/scripts/COLLADAFramework.vcproj 2009-02-11 11:00:27 UTC (rev 352) +++ branches/nextgen/COLLADAFramework/scripts/COLLADAFramework.vcproj 2009-02-11 13:19:06 UTC (rev 353) @@ -296,6 +296,10 @@ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" > <File + RelativePath="..\src\COLLADAFWCamera.cpp" + > + </File> + <File RelativePath="..\src\COLLADAFWColor.cpp" > </File> @@ -438,6 +442,10 @@ > </File> <File + RelativePath="..\include\COLLADAFWCamera.h" + > + </File> + <File RelativePath="..\include\COLLADAFWCode.h" > </File> Added: branches/nextgen/COLLADAFramework/src/COLLADAFWCamera.cpp =================================================================== --- branches/nextgen/COLLADAFramework/src/COLLADAFWCamera.cpp (rev 0) +++ branches/nextgen/COLLADAFramework/src/COLLADAFWCamera.cpp 2009-02-11 13:19:06 UTC (rev 353) @@ -0,0 +1,36 @@ +/* + Copyright (c) 2008 NetAllied Systems GmbH + + This file is part of COLLADAFramework. + + Licensed under the MIT Open Source License, + for details please see LICENSE file or the website + http://www.opensource.org/licenses/mit-license.php +*/ + +#include "COLLADAFWStableHeaders.h" +#include "COLLADAFWCamera.h" + + +namespace COLLADAFW +{ + + //------------------------------ + Camera::Camera( ObjectId objectId) + : ObjectTemplate< COLLADA_TYPE::CAMERA >(objectId) + , mCameraType(UNDEFINED_CAMERATYPE) + , mDescriptionType( UNDEFINED ) + , mXFovOrXMag(0) + , mYFovOrYMag(0) + , mAspectRatio(0) + , mNearClippingPlane(0) + , mFarClippingPlane(0) + { + } + + //------------------------------ + Camera::~Camera() + { + } + +} // namespace COLLADAFW Modified: branches/nextgen/COLLADAMax/BUILD =================================================================== --- branches/nextgen/COLLADAMax/BUILD 2009-02-11 11:00:27 UTC (rev 352) +++ branches/nextgen/COLLADAMax/BUILD 2009-02-11 13:19:06 UTC (rev 353) @@ -15,7 +15,11 @@ - MS Visual Studio 2005. +- SVN comand line tool, especially svnversion (optional) + Available at http://subversion.tigris.org/ + svnversion must be in your path + Building: --------- Before you can start to build you need to set three environment variables. The MAX_PATH* variable Property changes on: branches/nextgen/COLLADAMax/include ___________________________________________________________________ Added: svn:ignore + COLLADAMaxVersionInfo.h Modified: branches/nextgen/COLLADAMax/include/COLLADAMaxDocumentExporter.h =================================================================== --- branches/nextgen/COLLADAMax/include/COLLADAMaxDocumentExporter.h 2009-02-11 11:00:27 UTC (rev 352) +++ branches/nextgen/COLLADAMax/include/COLLADAMaxDocumentExporter.h 2009-02-11 13:19:06 UTC (rev 353) @@ -88,6 +88,8 @@ /** The id of the @a \<scene\> element.*/ static const String SCENE_ID; + static const String AUTHORING_TOOL; + /** A map, that hold all already exported objects with their ids*/ ObjectExportNodeMap mExportedObjects; Modified: branches/nextgen/COLLADAMax/include/COLLADAMaxDocumentImporter.h =================================================================== --- branches/nextgen/COLLADAMax/include/COLLADAMaxDocumentImporter.h 2009-02-11 11:00:27 UTC (rev 352) +++ branches/nextgen/COLLADAMax/include/COLLADAMaxDocumentImporter.h 2009-02-11 13:19:06 UTC (rev 353) @@ -40,6 +40,7 @@ class UniqueId; class LibraryNodes; class Node; + class Camera; } namespace COLLADAMax @@ -210,6 +211,11 @@ @return True on succeeded, false otherwise.*/ virtual bool writeEffect( const COLLADAFW::Effect* effect ); + /** Writes the camera. + @return True on succeeded, false otherwise.*/ + virtual bool writeCamera( const COLLADAFW::Camera* camera ); + + private: /** Disable default copy ctor. */ Modified: branches/nextgen/COLLADAMax/scripts/COLLADAMax.vcproj =================================================================== --- branches/nextgen/COLLADAMax/scripts/COLLADAMax.vcproj 2009-02-11 11:00:27 UTC (rev 352) +++ branches/nextgen/COLLADAMax/scripts/COLLADAMax.vcproj 2009-02-11 13:19:06 UTC (rev 353) @@ -27,6 +27,7 @@ > <Tool Name="VCPreBuildEventTool" + CommandLine="echo off

set F=..\include\COLLADAMaxVersionInfo.h


echo Generating %F% 


echo #ifndef __COLLADAMAX_VERSIONINFO_H__ > %F%
echo #define __COLLADAMAX_VERSIONINFO_H__ >> %F%

echo. >> %F%

echo #include "COLLADAMaxPrerequisites.h" >> %F%

echo. >> %F%

echo namespace COLLADAMax >> %F%

echo { >> %F%


FOR /f %%A in ('svnversion ..\..\ ') do set REVISION=%%A


echo const String CURRENT_REVISION = "%REVISION%"; >> %F%
echo const String CURRENT_PLATFORM = "$(PlatformName)"; >> %F%
echo const String CURRENT_CONFIGURATION = "$(ConfigurationName)"; >> %F%

echo } >> %F%

echo. >> %F%

echo #endif // __COLLADAMAX_VERSIONINFO_H__ >> %F%

" /> <Tool Name="VCCustomBuildTool" @@ -69,6 +70,7 @@ Name="VCLinkerTool" AdditionalDependencies="COLLADABaseUtils-d.lib COLLADAFramework-d.lib COLLADAStreamWriter-d.lib COLLADASaxFrameworkLoader-d.lib GeneratedSaxParser-d.lib maxutil.lib core.lib paramblk2.lib geom.lib bmm.lib mesh.lib mnmath.lib poly.lib" OutputFile="$(OutDir)\$(ProjectName)New.dle" + Version="0.8.3" LinkIncremental="2" AdditionalLibraryDirectories=""$(MAX_SDK_PATH9)/lib";"..\..\COLLADABaseUtils\lib\win\$(PlatformName)";"..\..\COLLADAFramework\lib\win\$(PlatformName)";"..\..\COLLADAStreamWriter\lib\win\$(PlatformName)";"..\..\GeneratedSaxParser\lib\win\$(PlatformName)";"..\..\COLLADASaxFrameworkLoader\lib\win\$(PlatformName)";"$(BOOST_LIB_PATH)"" IgnoreDefaultLibraryNames=" " @@ -111,6 +113,7 @@ > <Tool Name="VCPreBuildEventTool" + CommandLine="echo off

set F=..\include\COLLADAMaxVersionInfo.h


echo Generating %F% 


echo #ifndef __COLLADAMAX_VERSIONINFO_H__ > %F%
echo #define __COLLADAMAX_VERSIONINFO_H__ >> %F%

echo. >> %F%

echo #include "COLLADAMaxPrerequisites.h" >> %F%

echo. >> %F%

echo namespace COLLADAMax >> %F%

echo { >> %F%


FOR /f %%A in ('svnversion ..\..\ ') do set REVISION=%%A


echo const String CURRENT_REVISION = "%REVISION%"; >> %F%
echo const String CURRENT_PLATFORM = "$(PlatformName)"; >> %F%
echo const String CURRENT_CONFIGURATION = "$(ConfigurationName)"; >> %F%

echo } >> %F%

echo. >> %F%

echo #endif // __COLLADAMAX_VERSIONINFO_H__ >> %F%

" /> <Tool Name="VCCustomBuildTool" @@ -154,6 +157,7 @@ Name="VCLinkerTool" AdditionalDependencies="COLLADABaseUtils-d.lib COLLADAFramework-d.lib COLLADAStreamWriter-d.lib COLLADASaxFrameworkLoader-d.lib GeneratedSaxParser-d.lib maxutil.lib core.lib paramblk2.lib geom.lib bmm.lib mesh.lib mnmath.lib poly.lib" OutputFile="$(OutDir)\$(ProjectName)New.dle" + Version="0.8.3" LinkIncremental="2" AdditionalLibraryDirectories=""$(MAX_SDK_PATH9)/x64/lib";"..\..\COLLADABaseUtils\lib\win\$(PlatformName)";"..\..\COLLADAFramework\lib\win\$(PlatformName)";"..\..\COLLADAStreamWriter\lib\win\$(PlatformName)";"..\..\GeneratedSaxParser\lib\win\$(PlatformName)";"..\..\COLLADASaxFrameworkLoader\lib\win\$(PlatformName)";"$(BOOST_LIB64_PATH)"" IgnoreDefaultLibraryNames=" " @@ -197,6 +201,7 @@ > <Tool Name="VCPreBuildEventTool" + CommandLine="echo off

set F=..\include\COLLADAMaxVersionInfo.h


echo Generating %F% 


echo #ifndef __COLLADAMAX_VERSIONINFO_H__ > %F%
echo #define __COLLADAMAX_VERSIONINFO_H__ >> %F%

echo. >> %F%

echo #include "COLLADAMaxPrerequisites.h" >> %F%

echo. >> %F%

echo namespace COLLADAMax >> %F%

echo { >> %F%


FOR /f %%A in ('svnversion ..\..\ ') do set REVISION=%%A


echo const String CURRENT_REVISION = "%REVISION%"; >> %F%
echo const String CURRENT_PLATFORM = "$(PlatformName)"; >> %F%
echo const String CURRENT_CONFIGURATION = "$(ConfigurationName)"; >> %F%

echo } >> %F%

echo. >> %F%

echo #endif // __COLLADAMAX_VERSIONINFO_H__ >> %F%

" /> <Tool Name="VCCustomBuildTool" @@ -239,6 +244,7 @@ Name="VCLinkerTool" AdditionalDependencies="COLLADABaseUtils.lib COLLADAFramework.lib COLLADAStreamWriter.lib COLLADASaxFrameworkLoader.lib GeneratedSaxParser.lib maxutil.lib core.lib paramblk2.lib geom.lib bmm.lib mesh.lib mnmath.lib poly.lib" OutputFile="$(OutDir)\$(ProjectName)New.dle" + Version="0.8.3" LinkIncremental="1" AdditionalLibraryDirectories=""$(MAX_SDK_PATH9)/lib";"..\..\COLLADABaseUtils\lib\win\$(PlatformName)";"..\..\COLLADAFramework\lib\win\$(PlatformName)";"..\..\COLLADAStreamWriter\lib\win\$(PlatformName)";"..\..\GeneratedSaxParser\lib\win\$(PlatformName)";"..\..\COLLADASaxFrameworkLoader\lib\win\$(PlatformName)";"$(BOOST_LIB_PATH)"" IgnoreDefaultLibraryNames=" " @@ -284,6 +290,7 @@ > <Tool Name="VCPreBuildEventTool" + CommandLine="echo off

set F=..\include\COLLADAMaxVersionInfo.h


echo Generating %F% 


echo #ifndef __COLLADAMAX_VERSIONINFO_H__ > %F%
echo #define __COLLADAMAX_VERSIONINFO_H__ >> %F%

echo. >> %F%

echo #include "COLLADAMaxPrerequisites.h" >> %F%

echo. >> %F%

echo namespace COLLADAMax >> %F%

echo { >> %F%


FOR /f %%A in ('svnversion ..\..\ ') do set REVISION=%%A


echo const String CURRENT_REVISION = "%REVISION%"; >> %F%
echo const String CURRENT_PLATFORM = "$(PlatformName)"; >> %F%
echo const String CURRENT_CONFIGURATION = "$(ConfigurationName)"; >> %F%

echo } >> %F%

echo. >> %F%

echo #endif // __COLLADAMAX_VERSIONINFO_H__ >> %F%

" /> <Tool Name="VCCustomBuildTool" @@ -327,6 +334,7 @@ Name="VCLinkerTool" AdditionalDependencies="COLLADABaseUtils.lib COLLADAFramework.lib COLLADAStreamWriter.lib COLLADASaxFrameworkLoader.lib GeneratedSaxParser.lib maxutil.lib core.lib paramblk2.lib geom.lib bmm.lib mesh.lib mnmath.lib poly.lib" OutputFile="$(OutDir)\$(ProjectName)New.dle" + Version="0.8.3" LinkIncremental="1" AdditionalLibraryDirectories=""$(MAX_SDK_PATH9)/x64/lib";"..\..\COLLADABaseUtils\lib\win\$(PlatformName)";"..\..\COLLADAFramework\lib\win\$(PlatformName)";"..\..\COLLADAStreamWriter\lib\win\$(PlatformName)";"..\..\GeneratedSaxParser\lib\win\$(PlatformName)";"..\..\COLLADASaxFrameworkLoader\lib\win\$(PlatformName)";"$(BOOST_LIB64_PATH)"" IgnoreDefaultLibraryNames=" " @@ -371,6 +379,7 @@ > <Tool Name="VCPreBuildEventTool" + CommandLine="echo off

set F=..\include\COLLADAMaxVersionInfo.h


echo Generating %F% 


echo #ifndef __COLLADAMAX_VERSIONINFO_H__ > %F%
echo #define __COLLADAMAX_VERSIONINFO_H__ >> %F%

echo. >> %F%

echo #include "COLLADAMaxPrerequisites.h" >> %F%

echo. >> %F%

echo namespace COLLADAMax >> %F%

echo { >> %F%


FOR /f %%A in ('svnversion ..\..\ ') do set REVISION=%%A


echo const String CURRENT_REVISION = "%REVISION%"; >> %F%
echo const String CURRENT_PLATFORM = "$(PlatformName)"; >> %F%
echo const String CURRENT_CONFIGURATION = "$(ConfigurationName)"; >> %F%

echo } >> %F%

echo. >> %F%

echo #endif // __COLLADAMAX_VERSIONINFO_H__ >> %F%

" /> <Tool Name="VCCustomBuildTool" @@ -413,6 +422,7 @@ Name="VCLinkerTool" AdditionalDependencies="COLLADABaseUtils-d.lib COLLADAFramework-d.lib COLLADAStreamWriter-d.lib COLLADASaxFrameworkLoader-d.lib GeneratedSaxParser-d.lib maxutil.lib core.lib paramblk2.lib geom.lib bmm.lib mesh.lib mnmath.lib poly.lib" OutputFile="$(OutDir)\$(ProjectName)New.dle" + Version="0.8.3" LinkIncremental="2" AdditionalLibraryDirectories=""$(MAX_SDK_PATH2009)/lib";"..\..\COLLADABaseUtils\lib\win\$(PlatformName)";"..\..\COLLADAFramework\lib\win\$(PlatformName)";"..\..\COLLADAStreamWriter\lib\win\$(PlatformName)";"..\..\GeneratedSaxParser\lib\win\$(PlatformName)";"..\..\COLLADASaxFrameworkLoader\lib\win\$(PlatformName)";"$(BOOST_LIB_PATH)"" IgnoreDefaultLibraryNames=" " @@ -455,6 +465,7 @@ > <Tool Name="VCPreBuildEventTool" + CommandLine="echo off

set F=..\include\COLLADAMaxVersionInfo.h


echo Generating %F% 


echo #ifndef __COLLADAMAX_VERSIONINFO_H__ > %F%
echo #define __COLLADAMAX_VERSIONINFO_H__ >> %F%

echo. >> %F%

echo #include "COLLADAMaxPrerequisites.h" >> %F%

echo. >> %F%

echo namespace COLLADAMax >> %F%

echo { >> %F%


FOR /f %%A in ('svnversion ..\..\ ') do set REVISION=%%A


echo const String CURRENT_REVISION = "%REVISION%"; >> %F%
echo const String CURRENT_PLATFORM = "$(PlatformName)"; >> %F%
echo const String CURRENT_CONFIGURATION = "$(ConfigurationName)"; >> %F%

echo } >> %F%

echo. >> %F%

echo #endif // __COLLADAMAX_VERSIONINFO_H__ >> %F%

" /> <Tool Name="VCCustomBuildTool" @@ -498,6 +509,7 @@ Name="VCLinkerTool" AdditionalDependencies="COLLADABaseUtils-d.lib COLLADAFramework-d.lib COLLADAStreamWriter-d.lib COLLADASaxFrameworkLoader-d.lib GeneratedSaxParser-d.lib maxutil.lib core.lib paramblk2.lib geom.lib bmm.lib mesh.lib mnmath.lib poly.lib" OutputFile="$(OutDir)\$(ProjectName)New.dle" + Version="0.8.3" LinkIncremental="2" AdditionalLibraryDirectories=""$(MAX_SDK_PATH2009)/x64/lib";"..\..\COLLADABaseUtils\lib\win\$(PlatformName)";"..\..\COLLADAFramework\lib\win\$(PlatformName)";"..\..\COLLADAStreamWriter\lib\win\$(PlatformName)";"..\..\GeneratedSaxParser\lib\win\$(PlatformName)";"..\..\COLLADASaxFrameworkLoader\lib\win\$(PlatformName)";"$(BOOST_LIB64_PATH)"" IgnoreDefaultLibraryNames=" " @@ -541,6 +553,7 @@ > <Tool Name="VCPreBuildEventTool" + CommandLine="echo off

set F=..\include\COLLADAMaxVersionInfo.h


echo Generating %F% 


echo #ifndef __COLLADAMAX_VERSIONINFO_H__ > %F%
echo #define __COLLADAMAX_VERSIONINFO_H__ >> %F%

echo. >> %F%

echo #include "COLLADAMaxPrerequisites.h" >> %F%

echo. >> %F%

echo namespace COLLADAMax >> %F%

echo { >> %F%


FOR /f %%A in ('svnversion ..\..\ ') do set REVISION=%%A


echo const String CURRENT_REVISION = "%REVISION%"; >> %F%
echo const String CURRENT_PLATFORM = "$(PlatformName)"; >> %F%
echo const String CURRENT_CONFIGURATION = "$(ConfigurationName)"; >> %F%

echo } >> %F%

echo. >> %F%

echo #endif // __COLLADAMAX_VERSIONINFO_H__ >> %F%

" /> <Tool Name="VCCustomBuildTool" @@ -583,6 +596,7 @@ Name="VCLinkerTool" AdditionalDependencies="COLLADABaseUtils.lib COLLADAFramework.lib COLLADAStreamWriter.lib COLLADASaxFrameworkLoader.lib GeneratedSaxParser.lib maxutil.lib core.lib paramblk2.lib geom.lib bmm.lib mesh.lib mnmath.lib poly.lib" OutputFile="$(OutDir)\$(ProjectName)New.dle" + Version="0.8.3" LinkIncremental="1" AdditionalLibraryDirectories=""$(MAX_SDK_PATH2009)/lib";"..\..\COLLADABaseUtils\lib\win\$(PlatformName)";"..\..\COLLADAFramework\lib\win\$(PlatformName)";"..\..\COLLADAStreamWriter\lib\win\$(PlatformName)";"..\..\GeneratedSaxParser\lib\win\$(PlatformName)";"..\..\COLLADASaxFrameworkLoader\lib\win\$(PlatformName)";"$(BOOST_LIB_PATH)"" IgnoreDefaultLibraryNames=" " @@ -628,6 +642,7 @@ > <Tool Name="VCPreBuildEventTool" + CommandLine="echo off

set F=..\include\COLLADAMaxVersionInfo.h


echo Generating %F% 


echo #ifndef __COLLADAMAX_VERSIONINFO_H__ > %F%
echo #define __COLLADAMAX_VERSIONINFO_H__ >> %F%

echo. >> %F%

echo #include "COLLADAMaxPrerequisites.h" >> %F%

echo. >> %F%

echo namespace COLLADAMax >> %F%

echo { >> %F%


FOR /f %%A in ('svnversion ..\..\ ') do set REVISION=%%A


echo const String CURRENT_REVISION = "%REVISION%"; >> %F%
echo const String CURRENT_PLATFORM = "$(PlatformName)"; >> %F%
echo const String CURRENT_CONFIGURATION = "$(ConfigurationName)"; >> %F%

echo } >> %F%

echo. >> %F%

echo #endif // __COLLADAMAX_VERSIONINFO_H__ >> %F%

" /> <Tool Name="VCCustomBuildTool" @@ -671,6 +686,7 @@ Name="VCLinkerTool" AdditionalDependencies="COLLADABaseUtils.lib COLLADAFramework.lib COLLADAStreamWriter.lib COLLADASaxFrameworkLoader.lib GeneratedSaxParser.lib maxutil.lib core.lib paramblk2.lib geom.lib bmm.lib mesh.lib mnmath.lib poly.lib" OutputFile="$(OutDir)\$(ProjectName)New.dle" + Version="0.8.3" LinkIncremental="1" AdditionalLibraryDirectories=""$(MAX_SDK_PATH2009)/x64/lib";"..\..\COLLADABaseUtils\lib\win\$(PlatformName)";"..\..\COLLADAFramework\lib\win\$(PlatformName)";"..\..\COLLADAStreamWriter\lib\win\$(PlatformName)";"..\..\GeneratedSaxParser\lib\win\$(PlatformName)";"..\..\COLLADASaxFrameworkLoader\lib\win\$(PlatformName)";"$(BOOST_LIB64_PATH)"" IgnoreDefaultLibraryNames=" " @@ -716,6 +732,7 @@ > <Tool Name="VCPreBuildEventTool" + CommandLine="echo off

set F=..\include\COLLADAMaxVersionInfo.h


echo Generating %F% 


echo #ifndef __COLLADAMAX_VERSIONINFO_H__ > %F%
echo #define __COLLADAMAX_VERSIONINFO_H__ >> %F%

echo. >> %F%

echo #include "COLLADAMaxPrerequisites.h" >> %F%

echo. >> %F%

echo namespace COLLADAMax >> %F%

echo { >> %F%


FOR /f %%A in ('svnversion ..\..\ ') do set REVISION=%%A


echo const String CURRENT_REVISION = "%REVISION%"; >> %F%
echo const String CURRENT_PLATFORM = "$(PlatformName)"; >> %F%
echo const String CURRENT_CONFIGURATION = "$(ConfigurationName)"; >> %F%

echo } >> %F%

echo. >> %F%

echo #endif // __COLLADAMAX_VERSIONINFO_H__ >> %F%

" /> <Tool Name="VCCustomBuildTool" @@ -758,6 +775,7 @@ Name="VCLinkerTool" AdditionalDependencies="COLLADABaseUtils.lib COLLADAFramework.lib COLLADAStreamWriter.lib COLLADASaxFrameworkLoader.lib GeneratedSaxParser.lib maxutil.lib core.lib paramblk2.lib geom.lib bmm.lib mesh.lib mnmath.lib poly.lib" OutputFile="$(OutDir)\$(ProjectName)New.dle" + Version="0.8.3" LinkIncremental="1" AdditionalLibraryDirectories=""$(MAX_SDK_PATH2008)/lib";"..\..\COLLADABaseUtils\lib\win\$(PlatformName)";"..\..\COLLADAFramework\lib\win\$(PlatformName)";"..\..\COLLADAStreamWriter\lib\win\$(PlatformName)";"..\..\GeneratedSaxParser\lib\win\$(PlatformName)";"..\..\COLLADASaxFrameworkLoader\lib\win\$(PlatformName)";"$(BOOST_LIB_PATH)"" IgnoreDefaultLibraryNames=" " @@ -803,6 +821,7 @@ > <Tool Name="VCPreBuildEventTool" + CommandLine="echo off

set F=..\include\COLLADAMaxVersionInfo.h


echo Generating %F% 


echo #ifndef __COLLADAMAX_VERSIONINFO_H__ > %F%
echo #define __COLLADAMAX_VERSIONINFO_H__ >> %F%

echo. >> %F%

echo #include "COLLADAMaxPrerequisites.h" >> %F%

echo. >> %F%

echo namespace COLLADAMax >> %F%

echo { >> %F%


FOR /f %%A in ('svnversion ..\..\ ') do set REVISION=%%A


echo const String CURRENT_REVISION = "%REVISION%"; >> %F%
echo const String CURRENT_PLATFORM = "$(PlatformName)"; >> %F%
echo const String CURRENT_CONFIGURATION = "$(ConfigurationName)"; >> %F%

echo } >> %F%

echo. >> %F%

echo #endif // __COLLADAMAX_VERSIONINFO_H__ >> %F%

" /> <Tool Name="VCCustomBuildTool" @@ -846,6 +865,7 @@ Name="VCLinkerTool" AdditionalDependencies="COLLADABaseUtils.lib COLLADAFramework.lib COLLADAStreamWriter.lib COLLADASaxFrameworkLoader.lib GeneratedSaxParser.lib maxutil.lib core.lib paramblk2.lib geom.lib bmm.lib mesh.lib mnmath.lib poly.lib" OutputFile="$(OutDir)\$(ProjectName)New.dle" + Version="0.8.3" LinkIncremental="1" AdditionalLibraryDirectories=""$(MAX_SDK_PATH2008)/x64/lib";"..\..\COLLADABaseUtils\lib\win\$(PlatformName)";"..\..\COLLADAFramework\lib\win\$(PlatformName)";"..\..\COLLADAStreamWriter\lib\win\$(PlatformName)";"..\..\GeneratedSaxParser\lib\win\$(PlatformName)";"..\..\COLLADASaxFrameworkLoader\lib\win\$(PlatformName)";"$(BOOST_LIB64_PATH)"" IgnoreDefaultLibraryNames=" " @@ -890,6 +910,7 @@ > <Tool Name="VCPreBuildEventTool" + CommandLine="echo off

set F=..\include\COLLADAMaxVersionInfo.h


echo Generating %F% 


echo #ifndef __COLLADAMAX_VERSIONINFO_H__ > %F%
echo #define __COLLADAMAX_VERSIONINFO_H__ >> %F%

echo. >> %F%

echo #include "COLLADAMaxPrerequisites.h" >> %F%

echo. >> %F%

echo namespace COLLADAMax >> %F%

echo { >> %F%


FOR /f %%A in ('svnversion ..\..\ ') do set REVISION=%%A


echo const String CURRENT_REVISION = "%REVISION%"; >> %F%
echo const String CURRENT_PLATFORM = "$(PlatformName)"; >> %F%
echo const String CURRENT_CONFIGURATION = "$(ConfigurationName)"; >> %F%

echo } >> %F%

echo. >> %F%

echo #endif // __COLLADAMAX_VERSIONINFO_H__ >> %F%

" /> <Tool Name="VCCustomBuildTool" @@ -932,6 +953,7 @@ Name="VCLinkerTool" AdditionalDependencies="COLLADABaseUtils-d.lib COLLADAFramework-d.lib COLLADAStreamWriter-d.lib COLLADASaxFrameworkLoader-d.lib GeneratedSaxParser-d.lib maxutil.lib core.lib paramblk2.lib geom.lib bmm.lib mesh.lib mnmath.lib poly.lib" OutputFile="$(OutDir)\$(ProjectName)New.dle" + Version="0.8.3" LinkIncremental="2" AdditionalLibraryDirectories=""$(MAX_SDK_PATH2008)/lib";"..\..\COLLADABaseUtils\lib\win\$(PlatformName)";"..\..\COLLADAFramework\lib\win\$(PlatformName)";"..\..\COLLADAStreamWriter\lib\win\$(PlatformName)";"..\..\GeneratedSaxParser\lib\win\$(PlatformName)";"..\..\COLLADASaxFrameworkLoader\lib\win\$(PlatformName)";"$(BOOST_LIB_PATH)"" IgnoreDefaultLibraryNames=" " @@ -974,6 +996,7 @@ > <Tool Name="VCPreBuildEventTool" + CommandLine="echo off

set F=..\include\COLLADAMaxVersionInfo.h


echo Generating %F% 


echo #ifndef __COLLADAMAX_VERSIONINFO_H__ > %F%
echo #define __COLLADAMAX_VERSIONINFO_H__ >> %F%

echo. >> %F%

echo #include "COLLADAMaxPrerequisites.h" >> %F%

echo. >> %F%

echo namespace COLLADAMax >> %F%

echo { >> %F%


FOR /f %%A in ('svnversion ..\..\ ') do set REVISION=%%A


echo const String CURRENT_REVISION = "%REVISION%"; >> %F%
echo const String CURRENT_PLATFORM = "$(PlatformName)"; >> %F%
echo const String CURRENT_CONFIGURATION = "$(ConfigurationName)"; >> %F%

echo } >> %F%

echo. >> %F%

echo #endif // __COLLADAMAX_VERSIONINFO_H__ >> %F%

" /> <Tool Name="VCCustomBuildTool" @@ -1017,6 +1040,7 @@ Name="VCLinkerTool" AdditionalDependencies="COLLADABaseUtils-d.lib COLLADAFramework-d.lib COLLADAStreamWriter-d.lib COLLADASaxFrameworkLoader-d.lib GeneratedSaxParser-d.lib maxutil.lib core.lib paramblk2.lib geom.lib bmm.lib mesh.lib mnmath.lib poly.lib" OutputFile="$(OutDir)\$(ProjectName)New.dle" + Version="0.8.3" LinkIncremental="2" AdditionalLibraryDirectories=""$(MAX_SDK_PATH2008)/x64/lib";"..\..\COLLADABaseUtils\lib\win\$(PlatformName)";"..\..\COLLADAFramework\lib\win\$(PlatformName)";"..\..\COLLADAStreamWriter\lib\win\$(PlatformName)";"..\..\GeneratedSaxParser\lib\win\$(PlatformName)";"..\..\COLLADASaxFrameworkLoader\lib\win\$(PlatformName)";"$(BOOST_LIB64_PATH)"" IgnoreDefaultLibraryNames=" " @@ -1059,6 +1083,7 @@ > <Tool Name="VCPreBuildEventTool" + CommandLine="echo off

set F=..\include\COLLADAMaxVersionInfo.h


echo Generating %F% 


echo #ifndef __COLLADAMAX_VERSIONINFO_H__ > %F%
echo #define __COLLADAMAX_VERSIONINFO_H__ >> %F%

echo. >> %F%

echo #include "COLLADAMaxPrerequisites.h" >> %F%

echo. >> %F%

echo namespace COLLADAMax >> %F%

echo { >> %F%


FOR /f %%A in ('svnversion ..\..\ ') do set REVISION=%%A


echo const String CURRENT_REVISION = "%REVISION%"; >> %F%
echo const String CURRENT_PLATFORM = "$(PlatformName)"; >> %F%
echo const String CURRENT_CONFIGURATION = "$(ConfigurationName)"; >> %F%

echo } >> %F%

echo. >> %F%

echo #endif // __COLLADAMAX_VERSIONINFO_H__ >> %F%

" /> <Tool Name="VCCustomBuildTool" @@ -1101,6 +1126,7 @@ Name="VCLinkerTool" AdditionalDependencies="COLLADABaseUtils-d.lib COLLADAFramework-d.lib COLLADAStreamWriter-d.lib COLLADASaxFrameworkLoader-d.lib GeneratedSaxParser-d.lib maxutil.lib core.lib paramblk2.lib geom.lib bmm.lib mesh.lib mnmath.lib poly.lib" OutputFile="$(OutDir)\$(ProjectName)New.dle" + Version="0.8.3" LinkIncremental="2" AdditionalLibraryDirectories=""$(MAX_SDK_PATH8)/lib";"..\..\COLLADABaseUtils\lib\win\$(PlatformName)";"..\..\COLLADAFramework\lib\win\$(PlatformName)";"..\..\COLLADAStreamWriter\lib\win\$(PlatformName)";"..\..\GeneratedSaxParser\lib\win\$(PlatformName)";"..\..\COLLADASaxFrameworkLoader\lib\win\$(PlatformName)";"$(BOOST_LIB_PATH)"" IgnoreDefaultLibraryNames=" " @@ -1143,6 +1169,7 @@ > <Tool Name="VCPreBuildEventTool" + CommandLine="echo off

set F=..\include\COLLADAMaxVersionInfo.h


echo Generating %F% 


echo #ifndef __COLLADAMAX_VERSIONINFO_H__ > %F%
echo #define __COLLADAMAX_VERSIONINFO_H__ >> %F%

echo. >> %F%

echo #include "COLLADAMaxPrerequisites.h" >> %F%

echo. >> %F%

echo namespace COLLADAMax >> %F%

echo { >> %F%


FOR /f %%A in ('svnversion ..\..\ ') do set REVISION=%%A


echo const String CURRENT_REVISION = "%REVISION%"; >> %F%
echo const String CURRENT_PLATFORM = "$(PlatformName)"; >> %F%
echo const String CURRENT_CONFIGURATION = "$(ConfigurationName)"; >> %F%

echo } >> %F%

echo. >> %F%

echo #endif // __COLLADAMAX_VERSIONINFO_H__ >> %F%

" /> <Tool Name="VCCustomBuildTool" @@ -1186,6 +1213,7 @@ Name="VCLinkerTool" AdditionalDependencies="COLLADABaseUtils-d.lib COLLADAFramework-d.lib COLLADAStreamWriter-d.lib COLLADASaxFrameworkLoader-d.lib GeneratedSaxParser-d.lib maxutil.lib core.lib paramblk2.lib geom.lib bmm.lib mesh.lib mnmath.lib poly.lib" OutputFile="$(OutDir)\$(ProjectName)New.dle" + Version="0.8.3" LinkIncremental="2" AdditionalLibraryDirectories=""$(MAX_SDK_PATH9)/x64/lib";"..\..\COLLADABaseUtils\lib\win\$(PlatformName)";"..\..\COLLADAFramework\lib\win\$(PlatformName)";"..\..\COLLADAStreamWriter\lib\win\$(PlatformName)";"..\..\GeneratedSaxParser\lib\win\$(PlatformName)";"..\..\COLLADASaxFrameworkLoader\lib\win\$(PlatformName)";"$(BOOST_LIB64_PATH)"" IgnoreDefaultLibraryNames=" " @@ -1229,6 +1257,7 @@ > <Tool Name="VCPreBuildEventTool" + CommandLine="echo off

set F=..\include\COLLADAMaxVersionInfo.h


echo Generating %F% 


echo #ifndef __COLLADAMAX_VERSIONINFO_H__ > %F%
echo #define __COLLADAMAX_VERSIONINFO_H__ >> %F%

echo. >> %F%

echo #include "COLLADAMaxPrerequisites.h" >> %F%

echo. >> %F%

echo namespace COLLADAMax >> %F%

echo { >> %F%


FOR /f %%A in ('svnversion ..\..\ ') do set REVISION=%%A


echo const String CURRENT_REVISION = "%REVISION%"; >> %F%
echo const String CURRENT_PLATFORM = "$(PlatformName)"; >> %F%
echo const String CURRENT_CONFIGURATION = "$(ConfigurationName)"; >> %F%

echo } >> %F%

echo. >> %F%

echo #endif // __COLLADAMAX_VERSIONINFO_H__ >> %F%

" /> <Tool Name="VCCustomBuildTool" @@ -1271,6 +1300,7 @@ Name="VCLinkerTool" AdditionalDependencies="COLLADABaseUtils.lib COLLADAFramework.lib COLLADAStreamWriter.lib COLLADASaxFrameworkLoader.lib GeneratedSaxParser.lib maxutil.lib core.lib paramblk2.lib geom.lib bmm.lib mesh.lib mnmath.lib poly.lib" OutputFile="$(OutDir)\$(ProjectName)New.dle" + Version="0.8.3" LinkIncremental="1" AdditionalLibraryDirectories=""$(MAX_SDK_PATH8)/lib";"..\..\COLLADABaseUtils\lib\win\$(PlatformName)";"..\..\COLLADAFramework\lib\win\$(PlatformName)";"..\..\COLLADAStreamWriter\lib\win\$(PlatformName)";"..\..\GeneratedSaxParser\lib\win\$(PlatformName)";"..\..\COLLADASaxFrameworkLoader\lib\win\$(PlatformName)";"$(BOOST_LIB_PATH)"" IgnoreDefaultLibraryNames=" " @@ -1316,6 +1346,7 @@ > <Tool Name="VCPreBuildEventTool" + CommandLine="echo off

set F=..\include\COLLADAMaxVersionInfo.h


echo Generating %F% 


echo #ifndef __COLLADAMAX_VERSIONINFO_H__ > %F%
echo #define __COLLADAMAX_VERSIONINFO_H__ >> %F%

echo. >> %F%

echo #include "COLLADAMaxPrerequisites.h" >> %F%

echo. >> %F%

echo namespace COLLADAMax >> %F%

echo { >> %F%


FOR /f %%A in ('svnversion ..\..\ ') do set REVISION=%%A


echo const String CURRENT_REVISION = "%REVISION%"; >> %F%
echo const String CURRENT_PLATFORM = "$(PlatformName)"; >> %F%
echo const String CURRENT_CONFIGURATION = "$(ConfigurationName)"; >> %F%

echo } >> %F%

echo. >> %F%

echo #endif // __COLLADAMAX_VERSIONINFO_H__ >> %F%

" /> <Tool Name="VCCustomBuildTool" @@ -1359,6 +1390,7 @@ Name="VCLinkerTool" AdditionalDependencies="COLLADABaseUtils.lib COLLADAFramework.lib COLLADAStreamWriter.lib COLLADASaxFrameworkLoader.lib GeneratedSaxParser.lib maxutil.lib core.lib paramblk2.lib geom.lib bmm.lib mesh.lib mnmath.lib poly.lib" OutputFile="$(OutDir)\$(ProjectName)New.dle" + Version="0.8.3" LinkIncremental="1" AdditionalLibraryDirectories=""$(MAX_SDK_PATH9)/x64/lib";"..\..\COLLADABaseUtils\lib\win\$(PlatformName)";"..\..\COLLADAFramework\lib\win\$(PlatformName)";"..\..\COLLADAStreamWriter\lib\win\$(PlatformName)";"..\..\GeneratedSaxParser\lib\win\$(PlatformName)";"..\..\COLLADASaxFrameworkLoader\lib\win\$(PlatformName)";"$(BOOST_LIB64_PATH)"" IgnoreDefaultLibraryNames=" " Modified: branches/nextgen/COLLADAMax/src/COLLADAMaxDocumentExporter.cpp =================================================================== --- branches/nextgen/COLLADAMax/src/COLLADAMaxDocumentExporter.cpp 2009-02-11 11:00:27 UTC (rev 352) +++ branches/nextgen/COLLADAMax/src/COLLADAMaxDocumentExporter.cpp 2009-02-11 13:19:06 UTC (rev 353) @@ -28,6 +28,7 @@ #include "COLLADAMaxImageExporter.h" #include "COLLADAMaxCameraExporter.h" #include "COLLADAMaxLightExporter.h" +#include "COLLADAMaxVersionInfo.h" #include "COLLADASWAsset.h" #include "COLLADASWScene.h" @@ -40,6 +41,12 @@ const String DocumentExporter::SCENE_ID = "MaxScene"; + const String DocumentExporter::AUTHORING_TOOL = String("COLLADAMax Next Gen") + + (CURRENT_REVISION.empty() ? "" : String("; Revision: ") + CURRENT_REVISION) + + String("; Platform: ") + CURRENT_PLATFORM + + String("; Configuration: ") + CURRENT_CONFIGURATION; + + //--------------------------------------------------------------- DocumentExporter::DocumentExporter ( Interface * i, const NativeString &filepath, COLLADABU::IDList& xRefExportFileNames ) : @@ -148,7 +155,7 @@ if ( !maxFileUri.getPathFile().empty() ) asset.getContributor().mSourceData = maxFileUri.getURIString(); - asset.getContributor().mAuthoringTool = "COLLADAMax"; + asset.getContributor().mAuthoringTool = AUTHORING_TOOL; // set *system* unit information Modified: branches/nextgen/COLLADAMax/src/COLLADAMaxDocumentImporter.cpp =================================================================== --- branches/nextgen/COLLADAMax/src/COLLADAMaxDocumentImporter.cpp 2009-02-11 11:00:27 UTC (rev 352) +++ branches/nextgen/COLLADAMax/src/COLLADAMaxDocumentImporter.cpp 2009-02-11 13:19:06 UTC (rev 353) @@ -108,4 +108,10 @@ return effectImporter.import(); } + //--------------------------------------------------------------- + bool DocumentImporter::writeCamera( const COLLADAFW::Camera* camera ) + { + return true; + } + } // namespace COLLADAMax Modified: branches/nextgen/COLLADASaxFrameworkLoader/include/COLLADASaxFWLFileLoader.h =================================================================== --- branches/nextgen/COLLADASaxFrameworkLoader/include/COLLADASaxFWLFileLoader.h 2009-02-11 11:00:27 UTC (rev 352) +++ branches/nextgen/COLLADASaxFrameworkLoader/include/COLLADASaxFWLFileLoader.h 2009-02-11 13:19:06 UTC (rev 353) @@ -103,6 +103,8 @@ /** Starts loading a library effects.*/ virtual bool begin__library_effects( const library_effects__AttributeData& attributeData ); + /** Starts loading a library cameras.*/ + virtual bool begin__library_cameras( const library_cameras__AttributeData& attributeData ); private: Added: branches/nextgen/COLLADASaxFrameworkLoader/include/COLLADASaxFWLLibraryCamerasLoader.h =================================================================== --- branches/nextgen/COLLADASaxFrameworkLoader/include/COLLADASaxFWLLibraryCamerasLoader.h (rev 0) +++ branches/nextgen/COLLADASaxFrameworkLoader/include/COLLADASaxFWLLibraryCamerasLoader.h 2009-02-11 13:19:06 UTC (rev 353) @@ -0,0 +1,155 @@ +/* + Copyright (c) 2008 NetAllied Systems GmbH + + This file is part of COLLADASaxFrameworkLoader. + + Licensed under the MIT Open Source License, + for details please see LICENSE file or the website + http://www.opensource.org/licenses/mit-license.php +*/ + +#ifndef __COLLADASAXFWL_LIBRARYCAMERASLOADER_H__ +#define __COLLADASAXFWL_LIBRARYCAMERASLOADER_H__ + +#include "COLLADASaxFWLPrerequisites.h" +#include "COLLADASaxFWLFilePartLoader.h" + +namespace COLLADAFW +{ + class Camera; +} + +namespace COLLADASaxFWL +{ + + /** Loads all the cameras in a library cameras. */ + class LibraryCamerasLoader : public FilePartLoader + { + private: + /** The current camera.*/ + COLLADAFW::Camera* mCurrentCamera; + + /** The current camera has xfov or xmag ( depending on optics ).*/ + bool mCurrentCameraHasX; + + /** The current camera has yfov or ymag ( depending on optics ).*/ + bool mCurrentCameraHasY; + + /** The current camera has apect ratio.*/ + bool mCurrentCameraHasAspectRatio; + + public: + + /** Constructor. */ + LibraryCamerasLoader( IFilePartLoader* callingFilePartLoader ); + + /** Destructor. */ + virtual ~LibraryCamerasLoader(); + + /** Resets all the variables used for the current camera.*/ + void resetCurrentValues(); + + /** Finishes loading a library effects.*/ + virtual bool end__library_cameras(); + + + /** Stores camera id and name.*/ + virtual bool begin__camera( const camera__AttributeData& attributeData ); + + /** Sends camera to the writer.*/ + virtual bool end__camera(); + + + /** We don't need to do anything here.*/ + virtual bool begin__optics(){return true;} + + /** We don't need to do anything here.*/ + virtual bool end__optics(){return true;} + + + /** We don't need to do anything here.*/ + virtual bool begin__optics__technique_common(){return true;} + + /** We don't need to do anything here.*/ + virtual bool end__optics__technique_common(){return true;} + + /** Create an orthographic camera. Not yet implemented.*/ + virtual bool begin__orthographic(){return true;} + virtual bool end__orthographic(){return true;} + + /** Create an orthographic camera.*/ + virtual bool begin__perspective(); + + /** We don't need to do anything here.*/ + virtual bool end__perspective(){return true;} + + + /** We don't need to do anything here.*/ + virtual bool begin__xfov( const xfov__AttributeData& attributeData ){return true;} + + /** We don't need to do anything here.*/ + virtual bool end__xfov(){return true;} + + /** Stores the xfov of the current camera.*/ + virtual bool data__xfov( double value ); + + + /** We don't need to do anything here.*/ + virtual bool begin__yfov( const yfov__AttributeData& attributeData ){return true;} + + /** We don't need to do anything here.*/ + virtual bool end__yfov(){return true;} + + /** Stores the yfov of the current camera.*/ + virtual bool data__yfov( double value ); + + + /** We don't need to do anything here.*/ + virtual bool begin__perspective__aspect_ratio( const aspect_ratio__AttributeData& attributeData ){return true;} + + /** We don't need to do anything here.*/ + virtual bool end__perspective__aspect_ratio(){return true;} + + /** Stores the aspect ratio of the current camera.*/ + virtual bool data__perspective__aspect_ratio( double value ); + + + /** We don't need to do anything here.*/ + virtual bool begin__perspective__znear( const znear__AttributeData& attributeData ){return true;} + + /** We don't need to do anything here.*/ + virtual bool end__perspective__znear(){return true;} + + /** Stores the near clipping plane of the current camera.*/ + virtual bool data__perspective__znear( double value ); + + + /** We don't need to do anything here.*/ + virtual bool begin__perspective__zfar( const zfar__AttributeData& attributeData ){return true;} + + /** We don't need to do anything here.*/ + virtual bool end__perspective__zfar(){return true;} + + /** Stores the far clipping plane of the current camera.*/ + virtual bool data__perspective__zfar( double value ); + + + /** We don't need to do anything here.*/ + virtual bool begin__imager(){return true;} + + /** We don't need to do anything here.*/ + virtual bool end__imager(){return true;} + + private: + + /** Disable default copy ctor. */ + LibraryCamerasLoader( const LibraryCamerasLoader& pre ); + + /** Disable default assignment operator. */ + const LibraryCamerasLoader& operator= ( const LibraryCamerasLoader& pre ); + + }; + +} // namespace COLLADASAXFWL + +#endif // __COLLADASAXFWL_LIBRARYCAMERASLOADER_H__ Modified: branches/nextgen/COLLADASaxFrameworkLoader/scripts/COLLADASaxFrameworkLoader.vcproj =================================================================== --- branches/nextgen/COLLADASaxFrameworkLoader/scripts/COLLADASaxFrameworkLoader.vcproj 2009-02-11 11:00:27 UTC (rev 352) +++ branches/nextgen/COLLADASaxFrameworkLoader/scripts/COLLADASaxFrameworkLoader.vcproj 2009-02-11 13:19:06 UTC (rev 353) @@ -348,6 +348,10 @@ > </File> <File + RelativePath="..\src\COLLADASaxFWLLibraryCamerasLoader.cpp" + > + </File> + <File RelativePath="..\src\COLLADASaxFWLLibraryEffectsLoader.cpp" > </File> @@ -466,6 +470,10 @@ > </File> <File + RelativePath="..\include\COLLADASaxFWLLibraryCamerasLoader.h" + > + </File> + <File RelativePath="..\include\COLLADASaxFWLLibraryEffectsLoader.h" > </File> Modified: branches/nextgen/COLLADASaxFrameworkLoader/src/COLLADASaxFWLFileLoader.cpp =================================================================== --- branches/nextgen/COLLADASaxFrameworkLoader/src/COLLADASaxFWLFileLoader.cpp 2009-02-11 11:00:27 UTC (rev 352) +++ branches/nextgen/COLLADASaxFrameworkLoader/src/COLLADASaxFWLFileLoader.cpp 2009-02-11 13:19:06 UTC (rev 353) @@ -16,6 +16,7 @@ #include "COLLADASaxFWLLibraryNodesLoader.h" #include "COLLADASaxFWLLibraryMaterialsLoader.h" #include "COLLADASaxFWLLibraryEffectsLoader.h" +#include "COLLADASaxFWLLibraryCamerasLoader.h" #include "COLLADASaxFWLMeshLoader.h" #include "COLLADASaxFWLGeometryLoader.h" #include "COLLADASaxFWLSaxParserErrorHandler.h" @@ -121,7 +122,7 @@ return true; } - //----------------------------- + //----------------------------- bool FileLoader::begin__library_effects( const library_effects__AttributeData& attributeData ) { deleteFilePartLoader(); @@ -132,6 +133,17 @@ return true; } + //----------------------------- + bool FileLoader::begin__library_cameras( const library_cameras__AttributeData& attributeData ) + { + deleteFilePartLoader(); + LibraryCamerasLoader* libraryCamerasLoader = new LibraryCamerasLoader(this); + + setPartLoader(libraryCamerasLoader); + setParser(libraryCamerasLoader); + return true; + } + //----------------------------- bool FileLoader::end__COLLADA () { Added: branches/nextgen/COLLADASaxFrameworkLoader/src/COLLADASaxFWLLibraryCamerasLoader.cpp =================================================================== --- branches/nextgen/COLLADASaxFrameworkLoader/src/COLLADASaxFWLLibraryCamerasLoader.cpp (rev 0) +++ branches/nextgen/COLLADASaxFrameworkLoader/src/COLLADASaxFWLLibraryCamerasLoader.cpp 2009-02-11 13:19:06 UTC (rev 353) @@ -0,0 +1,114 @@ +/* + Copyright (c) 2008 NetAllied Systems GmbH + + This file is part of COLLADASaxFrameworkLoader. + + Licensed under the MIT Open Source License, + for details please see LICENSE file or the website + http://www.opensource.org/licenses/mit-license.php +*/ + +#include "COLLADASaxFWLStableHeaders.h" +#include "COLLADASaxFWLLibraryCamerasLoader.h" + +#include "COLLADAFWIWriter.h" +#include "COLLADAFWCamera.h" + +namespace COLLADASaxFWL +{ + + //------------------------------ + LibraryCamerasLoader::LibraryCamerasLoader( IFilePartLoader* callingFilePartLoader ) + : FilePartLoader(callingFilePartLoader) + , mCurrentCamera(0) + , mCurrentCameraHasX(false) + , mCurrentCameraHasY(false) + , mCurrentCameraHasAspectRatio(false) + { + } + + //------------------------------ + LibraryCamerasLoader::~LibraryCamerasLoader() + { + } + + //------------------------------ + void LibraryCamerasLoader::resetCurrentValues() + { + mCurrentCamera = 0; + mCurrentCameraHasX = false; + mCurrentCameraHasY = false; + mCurrentCameraHasAspectRatio = false; + } + + //------------------------------ + bool LibraryCamerasLoader::end__library_cameras() + { + finish(); + return true; + } + + //------------------------------ + bool LibraryCamerasLoader::begin__camera( const camera__AttributeData& attributeData ) + { + mCurrentCamera = FW_NEW COLLADAFW::Camera( getUniqueIdFromId( attributeData.id, COLLADAFW::Camera::ID()).getObjectId() ); + + if ( attributeData.name ) + mCurrentCamera->setName( (const char*) attributeData.name ); + else if ( attributeData.id ) + mCurrentCamera->setName( (const char*) attributeData.id ); + + return true; + } + + //------------------------------ + bool LibraryCamerasLoader::end__camera() + { + bool success = writer()->writeCamera(mCurrentCamera); + FW_DELETE mCurrentCamera; + resetCurrentValues(); + return success; + } + + //------------------------------ + bool LibraryCamerasLoader::begin__perspective() + { + mCurrentCamera->setCameraType(COLLADAFW::Camera::PERSPECTIVE); + return true; + } + + //------------------------------ + bool LibraryCamerasLoader::data__xfov( double value ) + { + mCurrentCamera->setXFovOrXMag( value ); + return true; + } + + //------------------------------ + bool LibraryCamerasLoader::data__yfov( double value ) + { + mCurrentCamera->setYFovOrYMag( value ); + return true; + } + + //------------------------------ + bool LibraryCamerasLoader::data__perspective__aspect_ratio( double value ) + { + mCurrentCamera->setAspectRatio(value); + return true; + } + + bool LibraryCamerasLoader::data__perspective__znear( double value ) + { + mCurrentCamera->setNearClippingPlane(value); + return true; + } + + bool LibraryCamerasLoader::data__perspective__zfar( double value ) + { + mCurrentCamera->setFarClippingPlane(value); + return true; + } + + +} // namespace COLLADASaxFWL This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |