Revision: 569
http://python-ogre.svn.sourceforge.net/python-ogre/?rev=569&view=rev
Author: andy_miller
Date: 2008-02-15 17:41:26 -0800 (Fri, 15 Feb 2008)
Log Message:
-----------
ThirdParty cleanups
Added Paths:
-----------
trunk/python-ogre/ThirdParty/ogreal/OgreALMemberFunctionPointer.h
Removed Paths:
-------------
trunk/python-ogre/ThirdParty/caelum/EarthSunPositionModel.cpp
trunk/python-ogre/ThirdParty/caelum/EarthSunPositionModel.h
trunk/python-ogre/ThirdParty/caelum/SimpleSunPositionModel.cpp
trunk/python-ogre/ThirdParty/caelum/SimpleSunPositionModel.h
trunk/python-ogre/ThirdParty/caelum/SunPositionModel.h
trunk/python-ogre/ThirdParty/quickgui/QuickGUIPrerequisites.h
trunk/python-ogre/ThirdParty/quickgui/QuickGUIUtility.cpp
trunk/python-ogre/ThirdParty/quickgui/QuickGUIUtility.h
Deleted: trunk/python-ogre/ThirdParty/caelum/EarthSunPositionModel.cpp
===================================================================
--- trunk/python-ogre/ThirdParty/caelum/EarthSunPositionModel.cpp 2008-02-16 01:38:02 UTC (rev 568)
+++ trunk/python-ogre/ThirdParty/caelum/EarthSunPositionModel.cpp 2008-02-16 01:41:26 UTC (rev 569)
@@ -1,88 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum
-
-Copyright (c) 2006-2007 Caelum team. See Contributors.txt for details.
-
-Caelum 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.
-
-Caelum 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 Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "CaelumPrecompiled.h"
-#include "EarthSunPositionModel.h"
-
-namespace caelum {
-
-EarthSunPositionModel::EarthSunPositionModel (const Ogre::Radian lat, const Ogre::Real date) {
- setLatitude (lat);
- setJulianDate (date);
-}
-
-void EarthSunPositionModel::setLatitude (const Ogre::Radian lat) {
- mLatitude = lat;
-}
-
-Ogre::Radian EarthSunPositionModel::getLatitude () const {
- return mLatitude;
-}
-
-void EarthSunPositionModel::setJulianDate (const Ogre::Real date) {
- mJulianDate = date;
-}
-
-Ogre::Real EarthSunPositionModel::getJulianDate () const {
- return mJulianDate;
-}
-
-Ogre::Vector3 EarthSunPositionModel::update (const float time) {
- Ogre::Radian declination, zenith, azimuth; // Variables
- Ogre::Real x, y, sinL, sinDelta, sinTime, cosL, cosDelta, cosTime, twoPi; // Recurrent values (speed up calculations)
-
- twoPi = 2 * Ogre::Math::PI;
-
- declination = Ogre::Radian (0.4093 * Ogre::Math::Sin ((twoPi * (mJulianDate * 365 - 81)) / 368.0));
-
- sinL = Ogre::Math::Sin (mLatitude);
- cosL = Ogre::Math::Cos (mLatitude);
- sinDelta = Ogre::Math::Sin (declination);
- cosDelta = Ogre::Math::Cos (declination);
- sinTime = Ogre::Math::Sin (twoPi * time);
- cosTime = Ogre::Math::Cos (twoPi * time);
-
- x = (cosL * sinDelta - sinL * cosDelta * cosTime);
- y = -cosDelta * sinTime;
-
- zenith = Ogre::Radian (Ogre::Math::PI * 0.5) - Ogre::Math::ASin (sinL * sinDelta + cosL * cosDelta * cosTime);
- azimuth = Ogre::Math::ATan (y / x);
-
- if (x < 0)
- azimuth += Ogre::Radian (Ogre::Math::PI);
- else if (y < 0 && x > 0)
- azimuth += Ogre::Radian (twoPi);
-
- Ogre::Vector3 dir = Ogre::Vector3::UNIT_Y;
- Ogre::Quaternion rotZen, rotAzi;
-
- rotZen = Ogre::Quaternion (zenith, Ogre::Vector3::UNIT_X);
- rotAzi = Ogre::Quaternion (azimuth, Ogre::Vector3::UNIT_Y);
-
- dir = rotAzi * (rotZen * dir);
-
- mSunPosition = dir.normalisedCopy () * -1;
-
- mSunPosition.z *= -1;
-
- return mSunPosition;
-}
-
-} // namespace caelum
Deleted: trunk/python-ogre/ThirdParty/caelum/EarthSunPositionModel.h
===================================================================
--- trunk/python-ogre/ThirdParty/caelum/EarthSunPositionModel.h 2008-02-16 01:38:02 UTC (rev 568)
+++ trunk/python-ogre/ThirdParty/caelum/EarthSunPositionModel.h 2008-02-16 01:41:26 UTC (rev 569)
@@ -1,80 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum
-
-Copyright (c) 2006-2007 Caelum team. See Contributors.txt for details.
-
-Caelum 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.
-
-Caelum 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 Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef EARTHSUNPOSITIONMODEL_H
-#define EARTHSUNPOSITIONMODEL_H
-
-#include "CaelumPrerequisites.h"
-#include "SunPositionModel.h"
-
-namespace caelum {
-
-/** The simplified Sun position model for the earth.
- Based on experimental data and some simplifications (forumlas taken from the paper
- "A Practical Analytic Model for Daylight", by Preetham et al.)
- @author Jesús Alonso Abad.
- */
-class DllExport EarthSunPositionModel : public SunPositionModel {
-// Attributes -----------------------------------------------------------------
- protected:
- /// Latitude
- Ogre::Radian mLatitude;
-
- /// Julian date
- Ogre::Real mJulianDate;
-
-// Methods --------------------------------------------------------------------
- public:
- /** Basic constructor.
- * @param lat The latitude (in radians).
- * @param date The Julian date in the range [0, 1] (Jan 1st - Dec 31st respectively).
- * Values above will be wrapped and below will be treated as positive.
- */
- EarthSunPositionModel (const Ogre::Radian lat, const Ogre::Real date);
-
- /** Changes the current latitude.
- * @param lat The new latitude in radians.
- */
- void setLatitude (const Ogre::Radian lat);
-
- /** Gets the current latitude.
- * @return The latitude in radians.
- */
- Ogre::Radian getLatitude () const;
-
- /** Changes the Julian date.
- * @param date The current Julian date in the range [0, 1] (Jan 1st - Dec 31st Respectively).
- * Values above will be wrapped and below will be treated as positive.
- */
- void setJulianDate (const Ogre::Real date);
-
- /** Gets the Julian date.
- * @return The Julian date in the range [0, 1].
- */
- Ogre::Real getJulianDate () const;
-
- /** @copydoc SunPositionModel::update().
- */
- Ogre::Vector3 update (const float time);
-};
-
-} // namespace caelum
-
-#endif // EARTHSUNPOSITIONMODEL_H
Deleted: trunk/python-ogre/ThirdParty/caelum/SimpleSunPositionModel.cpp
===================================================================
--- trunk/python-ogre/ThirdParty/caelum/SimpleSunPositionModel.cpp 2008-02-16 01:38:02 UTC (rev 568)
+++ trunk/python-ogre/ThirdParty/caelum/SimpleSunPositionModel.cpp 2008-02-16 01:41:26 UTC (rev 569)
@@ -1,52 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum
-
-Copyright (c) 2006-2007 Caelum team. See Contributors.txt for details.
-
-Caelum 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.
-
-Caelum 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 Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "CaelumPrecompiled.h"
-#include "SimpleSunPositionModel.h"
-
-namespace caelum {
-
-SimpleSunPositionModel::SimpleSunPositionModel (Ogre::Degree inc) {
- setInclination (inc);
-}
-
-void SimpleSunPositionModel::setInclination (Ogre::Degree inc) {
- mInclination = inc;
-}
-
-Ogre::Degree SimpleSunPositionModel::getInclination () const {
- return mInclination;
-}
-
-Ogre::Vector3 SimpleSunPositionModel::update (const float time) {
- // Get the inclinated axis
- Ogre::Vector3 axis = Ogre::Vector3::UNIT_Z;
- axis = Ogre::Quaternion (mInclination, Ogre::Vector3::UNIT_X) * axis;
-
- // Get the inclinated light direction, according to the day time
- Ogre::Vector3 dir = Ogre::Vector3::UNIT_Y;
- dir = Ogre::Quaternion (Ogre::Radian (time * 2 * Ogre::Math::PI), axis) * dir;
-
- mSunPosition = dir.normalisedCopy () * -1;
-
- return mSunPosition * -1;
-}
-
-} // namespace caelum
Deleted: trunk/python-ogre/ThirdParty/caelum/SimpleSunPositionModel.h
===================================================================
--- trunk/python-ogre/ThirdParty/caelum/SimpleSunPositionModel.h 2008-02-16 01:38:02 UTC (rev 568)
+++ trunk/python-ogre/ThirdParty/caelum/SimpleSunPositionModel.h 2008-02-16 01:41:26 UTC (rev 569)
@@ -1,64 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum
-
-Copyright (c) 2006-2007 Caelum team. See Contributors.txt for details.
-
-Caelum 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.
-
-Caelum 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 Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef SIMPLESUNPOSITIONMODEL_H
-#define SIMPLESUNPOSITIONMODEL_H
-
-#include "CaelumPrerequisites.h"
-#include "SunPositionModel.h"
-
-namespace caelum {
-
-/** A simple circular sun position model.
- It just creates an inclinated circular orbit.
- @author Jesús Alonso Abad.
- */
-class DllExport SimpleSunPositionModel : public SunPositionModel {
-// Attributes -----------------------------------------------------------------
- protected:
- /** The sun trajectory inclination. This is similar to the earth's rotation axis inclination.
- */
- Ogre::Degree mInclination;
-
-// Methods --------------------------------------------------------------------
- public:
- /** Basic constructor.
- @param inc The orbit inclination.
- */
- SimpleSunPositionModel (Ogre::Degree inc);
-
- /** Changes the orbit inclination.
- @param inc The inclination in degrees.
- */
- void setInclination (Ogre::Degree inc);
-
- /** Gets the orbit inclination.
- @return The orbit inclination in degrees.
- */
- Ogre::Degree getInclination () const;
-
- /** @copydoc SunPositionModel::update().
- */
- Ogre::Vector3 update (const float time);
-};
-
-} // namespace caelum
-
-#endif // SIMPLESUNPOSITIONMODEL_H
Deleted: trunk/python-ogre/ThirdParty/caelum/SunPositionModel.h
===================================================================
--- trunk/python-ogre/ThirdParty/caelum/SunPositionModel.h 2008-02-16 01:38:02 UTC (rev 568)
+++ trunk/python-ogre/ThirdParty/caelum/SunPositionModel.h 2008-02-16 01:41:26 UTC (rev 569)
@@ -1,56 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum
-
-Copyright (c) 2006-2007 Caelum team. See Contributors.txt for details.
-
-Caelum 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.
-
-Caelum 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 Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef SUNPOSITIONMODEL_H
-#define SUNPOSITIONMODEL_H
-
-#include "CaelumPrerequisites.h"
-
-namespace caelum {
-
-/** Interface for all the sun positioning models.
- A sun position model is a configurable utility/model that will return sun's sky coordinates (direction/azimuth in the
- form of a normalised vector) depending on various parameters.
- These models can range from a simple circular (sin/cos) oscillation, to complex equations for accurate positioning.
- @author Jesús Alonso Abad.
- */
-class DllExport SunPositionModel {
-// Attributes -----------------------------------------------------------------
- protected:
- /** The last calculated sun position.
- */
- Ogre::Vector3 mSunPosition;
-
-// Methods --------------------------------------------------------------------
- public:
- /** Destructor
- */
- virtual ~SunPositionModel () {};
-
- /** Updates the sun position.
- @param time Local time.
- @return The sun light direction (or the negated sun position).
- */
- virtual Ogre::Vector3 update (const float time) = 0;
-};
-
-} // namespace caelum
-
-#endif // SUNPOSITIONMODEL_H
Added: trunk/python-ogre/ThirdParty/ogreal/OgreALMemberFunctionPointer.h
===================================================================
--- trunk/python-ogre/ThirdParty/ogreal/OgreALMemberFunctionPointer.h (rev 0)
+++ trunk/python-ogre/ThirdParty/ogreal/OgreALMemberFunctionPointer.h 2008-02-16 01:41:26 UTC (rev 569)
@@ -0,0 +1,45 @@
+#ifndef _OGREAL_MEMBER_FUNCTION_POINTER_H_
+#define _OGREAL_MEMBER_FUNCTION_POINTER_H_
+
+#include "OgreALPrereqs.h"
+
+namespace OgreAL {
+ // Predeclare so we don't need to include OgreALSound.h
+ class Sound;
+
+ class OgreAL_Export MemberFunctionSlot
+ {
+ public:
+ virtual ~MemberFunctionSlot(){};
+ virtual void execute(Sound* source) = 0;
+ };
+
+ template<typename T>
+ class MemberFunctionPointer : public MemberFunctionSlot
+ {
+ public:
+ typedef void (T::*MemberFunction)(Sound* source);
+
+ MemberFunctionPointer() : mUndefined(true){}
+
+ MemberFunctionPointer(MemberFunction func, T* obj) :
+ mFunction(func),
+ mObject(obj),
+ mUndefined(false)
+ {}
+
+ virtual ~MemberFunctionPointer(){}
+
+ void execute(Sound* source)
+ {
+ if(!mUndefined)
+ (mObject->*mFunction)(source);
+ }
+
+ protected:
+ MemberFunction mFunction;
+ T* mObject;
+ bool mUndefined;
+ };
+} // Namespace
+#endif
Deleted: trunk/python-ogre/ThirdParty/quickgui/QuickGUIPrerequisites.h
===================================================================
--- trunk/python-ogre/ThirdParty/quickgui/QuickGUIPrerequisites.h 2008-02-16 01:38:02 UTC (rev 568)
+++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIPrerequisites.h 2008-02-16 01:41:26 UTC (rev 569)
@@ -1,88 +0,0 @@
-#ifndef __QUICKPREQUISITES_H
-#define __QUICKPREQUISITES_H
-
-#include "Ogre.h"
-#include "QuickGUIExportDLL.h"
-
-namespace QuickGUI
-{
- ////////////DRAWING/////////////
- #define VERTICES_PER_QUAD 6
-
- class Rect;
- class Point;
- class Size;
-
- struct Vertex;
- class VertexBuffer;
- class QuadContainer;
- class Quad;
-
- // Stores the Texture of a quad, and the index of the first quad following it with a different texture.
- typedef std::pair<Ogre::String,unsigned int > TextureQuadIndex;
- typedef std::vector<TextureQuadIndex > TextureChangeList;
-
- typedef std::list<Quad*> QuadList;
- typedef std::vector<Quad*> QuadArray;
-
- typedef std::list<QuadContainer*> QuadContainerList;
-
- ////////////EVENTS/////////////
- class MemberFunctionSlot;
- class EventArgs;
- class WidgetEventArgs;
- class MouseEventArgs;
-
- typedef std::vector<MemberFunctionSlot*> EventHandlerArray;
-
- ////////////UTILS/////////////
- class MouseCursor;
- class Utility;
- class ConfigScriptLoader;
-
- ////////////Handlers/////////////
- class GUIManager;
- class Sheet;
- class SkinSet;
-
- ////////////Effects/////////////
- class Effect;
- class AlphaEffect;
- class MoveEffect;
- class SizeEffect;
-
- ////////////Widgets/////////////
- class Widget;
- typedef std::vector<Widget*> WidgetArray;
-
- class Window;
-
- class Image;
- class Panel;
- class Border;
- class ScrollPane;
- class Button;
- class NStateButton;
-
- class Text;
- class Label;
- class MenuLabel;
- class LabelArea;
- class TextBox;
- class Console;
- class TextArea;
- class TextBox;
-
- class List;
- class ComboBox;
- class TitleBar;
- class Tree;
-
- class ProgressBar;
- class HorizontalTrackBar;
- class VerticalTrackBar;
- class VerticalScrollBar;
- class HorizontalScrollBar;
-
-}
-#endif //__QUICKPREQUISITES_H
Deleted: trunk/python-ogre/ThirdParty/quickgui/QuickGUIUtility.cpp
===================================================================
--- trunk/python-ogre/ThirdParty/quickgui/QuickGUIUtility.cpp 2008-02-16 01:38:02 UTC (rev 568)
+++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIUtility.cpp 2008-02-16 01:41:26 UTC (rev 569)
@@ -1,88 +0,0 @@
-#include "QuickGUIPrecompiledHeaders.h"
-
-#include "QuickGUIUtility.h"
-
-namespace QuickGUI
-{
- Utility::Utility()
- {
- }
-
- Utility::~Utility()
- {
- }
-
- Ogre::Vector4 Utility::getImageBounds(const Ogre::Image& i)
- {
- size_t left = i.getWidth();
- size_t right = 0;
- size_t top = i.getHeight();
- size_t bottom = 0;
-
- const Ogre::PixelBox& pb = i.getPixelBox();
-
- // Pointers to the pixel data of the bar, and the destination image
- Ogre::uint8* ptr = static_cast<Ogre::uint8*>(pb.data);
-
- // iterate through pixel by pixel, to determine the min/max bar bounds.
- for( size_t row = 0; row < i.getHeight(); ++row )
- {
- for( size_t col = 0; col < i.getWidth(); col++ )
- {
- // skip R,B,G channels
- ptr += 3;
- // check for non zero alpha value
- if(*ptr++ > 0)
- {
- if( col < left )
- left = col;
- if( col > right )
- right = col;
- if( row < top )
- top = row;
- if( row > bottom )
- bottom = row;
- }
- }
- }
-
- return Ogre::Vector4(left,top,right,bottom);
- }
-
- bool Utility::isImageFile(const Ogre::String& fileName)
- {
- Ogre::String::size_type index = fileName.find_last_of('.');
- if( index != Ogre::String::npos )
- {
- Ogre::String extension = fileName.substr(index + 1);
- Ogre::StringUtil::toLowerCase(extension);
-
- Ogre::StringVector supportedImageCodecs = Ogre::Codec::getExtensions();
-
- return (std::find(supportedImageCodecs.begin(),supportedImageCodecs.end(),extension) != supportedImageCodecs.end());
- }
-
- return false;
- }
-
- bool Utility::textureExistsOnDisk(const Ogre::String& textureName)
- {
- if(textureName.empty())
- return false;
-
- if(!isImageFile(textureName))
- return false;
-
- Ogre::ResourceGroupManager* rgm = Ogre::ResourceGroupManager::getSingletonPtr();
-
- Ogre::StringVector resourceGroups = rgm->getResourceGroups();
- Ogre::StringVector::iterator it;
- for( it = resourceGroups.begin(); it != resourceGroups.end(); ++it )
- {
- if(rgm->resourceExists((*it),textureName))
- return true;
- }
-
- return false;
- }
-}
Deleted: trunk/python-ogre/ThirdParty/quickgui/QuickGUIUtility.h
===================================================================
--- trunk/python-ogre/ThirdParty/quickgui/QuickGUIUtility.h 2008-02-16 01:38:02 UTC (rev 568)
+++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIUtility.h 2008-02-16 01:41:26 UTC (rev 569)
@@ -1,35 +0,0 @@
-#ifndef QUICKGUIUTILITY_H
-#define QUICKGUIUTILITY_H
-
-#include "OgreCodec.h"
-#include "OgreHardwarePixelBuffer.h"
-#include "OgreImage.h"
-#include "OgreResourceGroupManager.h"
-#include "OgreVector4.h"
-
-#include "QuickGUIPrerequisites.h"
-#include "QuickGUIExportDLL.h"
-
-namespace QuickGUI
-{
- class _QuickGUIExport Utility
- {
- public:
- Utility();
- ~Utility();
-
- static Ogre::Vector4 getImageBounds(const Ogre::Image& i);
-
- static bool isImageFile(const Ogre::String& fileName);
-
- /*
- * Returns true if the textureName represents an image file on disk. (ie *.png, *.jpg, etc)
- */
- static bool textureExistsOnDisk(const Ogre::String& textureName);
-
- protected:
- static Ogre::StringVector mSupportedImageCodecs;
- };
-}
-
-#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|