You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
(11) |
Apr
(47) |
May
(14) |
Jun
|
Jul
(73) |
Aug
(4) |
Sep
(2) |
Oct
(60) |
Nov
(48) |
Dec
(66) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
|
Feb
(1) |
Mar
(27) |
Apr
(82) |
May
(89) |
Jun
(91) |
Jul
(44) |
Aug
(53) |
Sep
(113) |
Oct
(20) |
Nov
(37) |
Dec
(10) |
2008 |
Jan
|
Feb
(2) |
Mar
|
Apr
(2) |
May
(21) |
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2009 |
Jan
(76) |
Feb
(89) |
Mar
(52) |
Apr
(11) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(27) |
2010 |
Jan
(11) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(9) |
Sep
|
Oct
|
Nov
|
Dec
(14) |
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(2) |
Sep
(11) |
Oct
(3) |
Nov
|
Dec
|
2013 |
Jan
(4) |
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <Ult...@us...> - 2009-01-11 20:54:43
|
Revision: 926 http://opengate.svn.sourceforge.net/opengate/?rev=926&view=rev Author: Ultrasick Date: 2009-01-11 20:54:34 +0000 (Sun, 11 Jan 2009) Log Message: ----------- trying to rename "GUI" to "gui" in several steps. can't do that in 1 step in windows Added Paths: ----------- templates/gui2/ templates/gui2/screens/station/content/ templates/gui2/screens/station/content/market/buttons/scrollbar.pspimage Removed Paths: ------------- templates/gui2/docked/click_data/ Copied: templates/gui2/screens/station/content/market/buttons/scrollbar.pspimage (from rev 925, templates/GUI/screens/station/content/market/buttons/scrollbar.pspimage) =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ult...@us...> - 2009-01-11 20:48:40
|
Revision: 925 http://opengate.svn.sourceforge.net/opengate/?rev=925&view=rev Author: Ultrasick Date: 2009-01-11 20:48:30 +0000 (Sun, 11 Jan 2009) Log Message: ----------- uploading another template file of a scrollbar for the gui Added Paths: ----------- templates/GUI/screens/station/content/market/buttons/scrollbar.pspimage Added: templates/GUI/screens/station/content/market/buttons/scrollbar.pspimage =================================================================== (Binary files differ) Property changes on: templates/GUI/screens/station/content/market/buttons/scrollbar.pspimage ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ult...@us...> - 2009-01-11 06:53:40
|
Revision: 924 http://opengate.svn.sourceforge.net/opengate/?rev=924&view=rev Author: Ultrasick Date: 2009-01-11 06:53:28 +0000 (Sun, 11 Jan 2009) Log Message: ----------- + removing directory "click_data" which was created by audacity and is not usefull + uploading a few template files for the gui Added Paths: ----------- templates/GUI/screens/station/content/ templates/GUI/screens/station/content/market/ templates/GUI/screens/station/content/market/backgrounds/ templates/GUI/screens/station/content/market/backgrounds/category_menu.pspimage templates/GUI/screens/station/content/market/backgrounds/infobox.pspimage templates/GUI/screens/station/content/market/backgrounds/private_cargo_hold.pspimage templates/GUI/screens/station/content/market/backgrounds/public_market.pspimage templates/GUI/screens/station/content/market/buttons/ templates/GUI/screens/station/content/market/buttons/category.pspimage templates/GUI/screens/station/content/market/buttons/item.pspimage Removed Paths: ------------- templates/GUI/docked/click_data/ Added: templates/GUI/screens/station/content/market/backgrounds/category_menu.pspimage =================================================================== (Binary files differ) Property changes on: templates/GUI/screens/station/content/market/backgrounds/category_menu.pspimage ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: templates/GUI/screens/station/content/market/backgrounds/infobox.pspimage =================================================================== (Binary files differ) Property changes on: templates/GUI/screens/station/content/market/backgrounds/infobox.pspimage ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: templates/GUI/screens/station/content/market/backgrounds/private_cargo_hold.pspimage =================================================================== (Binary files differ) Property changes on: templates/GUI/screens/station/content/market/backgrounds/private_cargo_hold.pspimage ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: templates/GUI/screens/station/content/market/backgrounds/public_market.pspimage =================================================================== (Binary files differ) Property changes on: templates/GUI/screens/station/content/market/backgrounds/public_market.pspimage ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: templates/GUI/screens/station/content/market/buttons/category.pspimage =================================================================== (Binary files differ) Property changes on: templates/GUI/screens/station/content/market/buttons/category.pspimage ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: templates/GUI/screens/station/content/market/buttons/item.pspimage =================================================================== (Binary files differ) Property changes on: templates/GUI/screens/station/content/market/buttons/item.pspimage ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spo...@us...> - 2009-01-10 15:23:31
|
Revision: 923 http://opengate.svn.sourceforge.net/opengate/?rev=923&view=rev Author: spom_spom Date: 2009-01-10 15:23:21 +0000 (Sat, 10 Jan 2009) Log Message: ----------- prepare restruct sectorobjects Modified Paths: -------------- trunk/src/BaseObject.cpp trunk/src/BaseObject.h trunk/src/Makefile.am trunk/src/OpcodeWrapper.cpp trunk/src/OpcodeWrapper.h trunk/src/Planet.h trunk/src/Projectile.cpp trunk/src/Sector.cpp trunk/src/Sector.h trunk/src/SectorObject.cpp trunk/src/SectorObject.h trunk/src/SectorObjectMoveable.cpp trunk/src/SectorObjectVessel.cpp trunk/src/Station.cpp Added Paths: ----------- trunk/src/Opengate.h Modified: trunk/src/BaseObject.cpp =================================================================== --- trunk/src/BaseObject.cpp 2009-01-10 13:45:44 UTC (rev 922) +++ trunk/src/BaseObject.cpp 2009-01-10 15:23:21 UTC (rev 923) @@ -19,10 +19,12 @@ ***************************************************************************/ #include "BaseObject.h" +#include "LogManager.h" +#include "OpcodeWrapper.h" #include "Sector.h" -#include "OpcodeWrapper.h" #include <OgreEntity.h> +#include <OgreSceneManager.h> #include <string> Modified: trunk/src/BaseObject.h =================================================================== --- trunk/src/BaseObject.h 2009-01-10 13:45:44 UTC (rev 922) +++ trunk/src/BaseObject.h 2009-01-10 15:23:21 UTC (rev 923) @@ -21,29 +21,71 @@ #ifndef _OPENGATE_BASEOBJECT__H #define _OPENGATE_BASEOBJECT__H -#include "common.h" +#include "Opengate.h" -#include <OgrePrerequisites.h> - -namespace OgreOpcode{ - class CollisionObject; +namespace Temporary{ + /*! Baseclass for Sectorobjects. All stuff that is shown in a sector is a SectorObject, Interaction, physics, collision, is done by SectorObjects , Each SectorObject provide a update function which is called by sector in each frame. */ + class SectorObject{ + }; + /*! Sectorobject with a mesh that provide collision. */ + class SectorCollisionObject : public SectorObject{ + }; + /*! Sectorobject that is assiciated to any parent SectorObject.*/ + class SectorChildObject : public SectorCollisionObject { + }; + /*! Sectorobject that represent space environment without collision*/ + class SectorEnvironmentObject : public SectorObject { + }; + /*! Special child SectorObject with collision*/ + class SectorPadObject : public SectorChildObject { + }; + class SectorProjectileObject : public SectorChildObject { + }; + class SectorStationPadObject : public SectorPadObject { + }; + class SectorBeaconPadObject : public SectorPadObject { + }; + /*! Sectorobject with a mesh that provide collision. */ + class SectorMeshObject : public SectorCollisionObject{ + }; + class SectorStationObject : public SectorMeshObject{ + }; + class SectorAsteroidObject : public SectorMeshObject{ + }; + class SectorBeaconObject : public SectorMeshObject{ + }; + class SectorUserObject : public SectorMeshObject { + }; + class SectorAnomalieObject : public SectorMeshObject{ + }; + + class SectorMovableObject : public SectorUserObject{ + }; + + class SectorMissileObject : public SectorMovableObject{ + }; + + class SectorVesselObject : public SectorMovableObject{ + }; + + class SectorAvatarObject : public SectorVesselObject{ + }; + + + class SectorPlanetObject : public SectorEnvironmentObject{ + }; + class SectorStarfieldObject : public SectorEnvironmentObject{ + }; + class SectorSpaceDustObject : public SectorEnvironmentObject{ + }; + class SectorSpaceDecorationObject : public SectorEnvironmentObject{ + }; + } - + + namespace OpenGate{ -#define SECTOROBJECTENVIRONMENT_RTTI 1000010 -#define PROJECTILE_RTTI 100001 -#define SECTOROBJECT_RTTI 100002 -#define SECTOROBJECTMOVABLE_RTTI 100003 -#define SECTOROBJECTVESSEL_RTTI 100004 -#define SECTOROBJECTMISSILE_RTTI 100005 -#define AVATAR_RTTI 100006 -#define DOCKPAD_RTTI 100007 -#define STATIONPAD_RTTI 100008 -#define STATION_RTTI 100009 - -class Sector; - class BaseObject{ public: BaseObject( const Ogre::String & name, Sector * sector, Uint32 userId = 0, Uint8 childId = 0, Ogre::SceneNode * parentNode = NULL ); Modified: trunk/src/Makefile.am =================================================================== --- trunk/src/Makefile.am 2009-01-10 13:45:44 UTC (rev 922) +++ trunk/src/Makefile.am 2009-01-10 15:23:21 UTC (rev 923) @@ -65,6 +65,7 @@ Moveable.cpp \ OpcodeWrapper.h \ OpcodeWrapper.cpp \ + Opengate.h \ OpenALSoundManager.h \ OpenALSoundManager.cpp \ Planet.h \ Modified: trunk/src/OpcodeWrapper.cpp =================================================================== --- trunk/src/OpcodeWrapper.cpp 2009-01-10 13:45:44 UTC (rev 922) +++ trunk/src/OpcodeWrapper.cpp 2009-01-10 15:23:21 UTC (rev 923) @@ -31,8 +31,6 @@ namespace OpenGate{ -// template<> OpcodeCollisionDetection * Ogre::Singleton< OpcodeCollisionDetection >::ms_Singleton = 0; - OpcodeCollisionDetection::OpcodeCollisionDetection( ResourceManager * resources ) : collisionManager_( NULL ){ } Modified: trunk/src/OpcodeWrapper.h =================================================================== --- trunk/src/OpcodeWrapper.h 2009-01-10 13:45:44 UTC (rev 922) +++ trunk/src/OpcodeWrapper.h 2009-01-10 15:23:21 UTC (rev 923) @@ -21,27 +21,13 @@ #ifndef _OPENGATE_OPCODEWRAPPER__H #define _OPENGATE_OPCODEWRAPPER__H -#include <OgreSingleton.h> -#include <OgrePrerequisites.h> -// #include <OgreOpcode.h> +#include "Opengate.h" -namespace OgreOpcode{ - class CollisionContext; - class CollisionManager; - class CollisionObject; -} - namespace OpenGate{ -class BaseObject; -class SectorObject; -class Projectile; -class ResourceManager; - -//class OpcodeCollisionDetection : public Ogre::Singleton< OpcodeCollisionDetection >{ class OpcodeCollisionDetection { public: - OpcodeCollisionDetection( ResourceManager * resources = NULL ); + OpcodeCollisionDetection( ResourceManager * resources = NULL ); ~OpcodeCollisionDetection(); Added: trunk/src/Opengate.h =================================================================== --- trunk/src/Opengate.h (rev 0) +++ trunk/src/Opengate.h 2009-01-10 15:23:21 UTC (rev 923) @@ -0,0 +1,88 @@ +/*************************************************************************** + * Copyright (C) 2009 by OpenGate development team * + * spo...@us... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifndef _OPENGATE_OPENGATE__H +#define _OPENGATE_OPENGATE__H + +#include <OgrePrerequisites.h> +#include "common.h" + +namespace OgreOpcode{ + class CollisionContext; + class CollisionManager; + class CollisionObject; +} + +namespace OpenGate{ + +#define SECTOROBJECTENVIRONMENT_RTTI 1000010 +#define PROJECTILE_RTTI 100001 +#define SECTOROBJECT_RTTI 100002 +#define SECTOROBJECTMOVABLE_RTTI 100003 +#define SECTOROBJECTVESSEL_RTTI 100004 +#define SECTOROBJECTMISSILE_RTTI 100005 +#define AVATAR_RTTI 100006 +#define DOCKPAD_RTTI 100007 +#define STATIONPAD_RTTI 100008 +#define STATION_RTTI 100009 + +class Avatar; +class BaseObject; +class DockedState; + +class Gun; + +class LogManager; + +class OpenALSoundSource; +class OpcodeCollisionDetection; +class Planet; +class Projectile; + +class ResourceManager; + +class Sector; +class SectorObject; +class SectorObjectAvatar; +class SectorObjectMissile; +class SectorObjectMoveable; +class SectorObjectVessel; + +class Station; +class StationObject; + +class MessageBodyShipAmmoHit; +class MessageBodyShipDied; +class MessageBodyShipDeRegister; +class MessageBodyShipMovement; +class MessageBodyShipProjectileFired; +class MessageBodyShipRegister; +class MessageBodyShipStatus; + +class Missile; +class Moveable; +class NetworkClient; + +class UnDockedState; +class Vessel; + +} // namespace OpenGate + +#endif // _OPENGATE_OPENGATE__H Modified: trunk/src/Planet.h =================================================================== --- trunk/src/Planet.h 2009-01-10 13:45:44 UTC (rev 922) +++ trunk/src/Planet.h 2009-01-10 15:23:21 UTC (rev 923) @@ -21,7 +21,7 @@ #ifndef _OPENGATE_PLANET__H #define _OPENGATE_PLANET__H -#include <OgrePrerequisites.h> +#include "Opengate.h" namespace OpenGate{ Modified: trunk/src/Projectile.cpp =================================================================== --- trunk/src/Projectile.cpp 2009-01-10 13:45:44 UTC (rev 922) +++ trunk/src/Projectile.cpp 2009-01-10 15:23:21 UTC (rev 923) @@ -19,16 +19,20 @@ ***************************************************************************/ #include "Projectile.h" -#include "Sector.h" -#include "OpcodeWrapper.h" + #include "Equipment.h" #include "GunObject.h" +#include "LogManager.h" +#include "OpcodeWrapper.h" +#include "ResourceManager.h" +#include "Sector.h" -#include <OgreVector3.h> -#include <OgreManualObject.h> #include <OgreBillboard.h> #include <OgreBillboardSet.h> +#include <OgreManualObject.h> #include <OgreRibbonTrail.h> +#include <OgreSceneManager.h> +#include <OgreVector3.h> namespace OpenGate{ Modified: trunk/src/Sector.cpp =================================================================== --- trunk/src/Sector.cpp 2009-01-10 13:45:44 UTC (rev 922) +++ trunk/src/Sector.cpp 2009-01-10 15:23:21 UTC (rev 923) @@ -19,13 +19,12 @@ ***************************************************************************/ #include "Sector.h" +#include "commonWithOgre.h" #include "AiObject.h" #include "Avatar.h" #include "EntityManager.h" #include "Equipment.h" -#include "common.h" -#include "commonWithOgre.h" #include "Missile.h" #include "networkClient.h" #include "OpcodeWrapper.h" @@ -37,6 +36,7 @@ #include "SectorObjectMoveable.h" #include "SectorObjectVessel.h" #include "Station.h" +#include "UnDockedState.h" #include "Vessel.h" #include "tinyxml/tinyxml.h" @@ -267,7 +267,7 @@ sceneMgr_->setSkyBox( true, name, 10000 ); } -void Sector::update( Ogre::Real elapsedTime ){ +bool Sector::update( Ogre::Real elapsedTime ){ if ( ResourceManager::getSingleton().collisionManager ) ResourceManager::getSingleton().collisionManager->update( elapsedTime ); @@ -361,6 +361,7 @@ } else ++it; } } + return true; } void Sector::avatarDied( ){ @@ -563,23 +564,23 @@ } void Sector::destructAvatarObject( ){ - for ( std::map< long, SectorObjectMissile * >::iterator it = localAiObjects_.begin(); - it != localAiObjects_.end(); it ++ ){ + for ( std::map< long, SectorObjectMissile * >::iterator it = localAiObjects_.begin(); + it != localAiObjects_.end(); it ++ ){ - if ( it->second->target() == avatar_ ){ - log_->warn( std::string( "ai object target: " ) + it->second->name() + " loose target." ); - it->second->setTarget( NULL ); + if ( it->second->target() == avatar_ ){ + log_->warn( std::string( "ai object target: " ) + it->second->name() + " loose target." ); + it->second->setTarget( NULL ); + } } - } - if ( avatar_ ){ - sendVesselDeRegister( avatar_ ); - movableObjects_.erase( avatar_->userID() ); - sectorObjects_.erase( avatar_ ); - delete avatar_; - } + if ( avatar_ ){ + sendVesselDeRegister( avatar_ ); + movableObjects_.erase( avatar_->userID() ); + sectorObjects_.erase( avatar_ ); + delete avatar_; + } - avatar_ = NULL; + avatar_ = NULL; } void Sector::selectNextTarget( ){ Modified: trunk/src/Sector.h =================================================================== --- trunk/src/Sector.h 2009-01-10 13:45:44 UTC (rev 922) +++ trunk/src/Sector.h 2009-01-10 15:23:21 UTC (rev 923) @@ -21,60 +21,47 @@ #ifndef _OPENGATE_SECTOR__H #define _OPENGATE_SECTOR__H -#include <OgrePrerequisites.h> +#include "Opengate.h" -#include "UnDockedState.h" -#include "LogManager.h" - namespace OpenGate{ -class Planet; - -class StationObject; -class SectorObjectAvatar; -class SectorObjectMissile; -class SectorObjectMoveable; -class SectorObjectVessel; - -class Station; -class Avatar; -class Missile; -class Moveable; -class Vessel; - -class MessageBodyShipDied; -class MessageBodyShipRegister; -class MessageBodyShipDeRegister; -class MessageBodyShipMovement; -class MessageBodyShipStatus; -class MessageBodyShipAmmoHit; -class MessageBodyShipProjectileFired; - +//! Sector manages all stuff related to the undocked gamestate +/*! Sector manages all stuff related to the undocked gamestate. I.e. ships, environment, etc. +*/ class Sector { public: + /*! Constructor */ + Sector( Ogre::SceneManager * sceneMgr, NetworkClient * network = NULL ); - Sector( Ogre::SceneManager * sceneMgr, NetworkClient * network = NULL ); + /*! Destructor */ + ~Sector( ); - ~Sector( ); + /*! Return the associated Ogre::SceneManager */ + Ogre::SceneManager * sceneManager() { return sceneMgr_; } - Ogre::SceneManager * sceneManager() { return sceneMgr_; } - - void populate( const std::string & fileName ); + void setListener( UnDockedState * listener ){ listener_ = listener; } + + UnDockedState * listener( ){ return listener_; } + + /*! Main update function, that will be called every frame from listener. These call update all associated objects. */ + bool update( Ogre::Real elapsedTime ); + + //** START creators + /*! Populate the sector with information from a xml-file, see data/misc/test.sector for an example */ + void populate( const std::string & fileName ); + + /*! Set the name of this sector */ + void setName( const std::string & name ) { name_ = name; } - void setSkyBox( const std::string & name ); - - void setListener( UnDockedState * listener ){ listener_ = listener; } + /*! Return the name of this sector. Set during population from xml-file */ + std::string name() const { return name_; } - UnDockedState * listener( ){ return listener_; } + /*! Define the skybox of the sector */ + void setSkyBox( const std::string & name ); + //** END creators - /*! Set the name of this sector */ - void setName( const std::string & name ) { name_ = name; } - - /*! Return the name of this sector. Set during population from xml-file */ - std::string name() const { return name_; } + - void update( Ogre::Real elapsedTime ); - SectorObject * createStaticObject( const Ogre::String & meshname, const Ogre::String & objectname, const Ogre::Vector3 & pos ); SectorObject * createStaticObject( const Ogre::String & meshname, const Ogre::String & objectname, @@ -90,12 +77,12 @@ SectorObjectMissile * createMissile( const Ogre::String & name, Uint32 userId, Uint8 childId, Missile & missile ); + void createCircle( ); + void createKoordAxis( ); + Ogre::SceneNode * koordAxis() { return koordAxisNode_; } + std::set< SectorObject * > sectorObjects() const { return sectorObjects_; } - void createCircle( ); - void createKoordAxis( ); - Ogre::SceneNode * koordAxis() { return koordAxisNode_; } - /*! ugly temporary function for python bindings until boost::indexing:suite_v2 works.*/ std::vector< SectorObject * > sectorObjectsTmp() { std::vector< SectorObject * > tmp; @@ -149,7 +136,7 @@ protected: - //** do not destruct objects manualy, let them send false during update loop + /*! do not destruct objects manualy, let them send false during update loop */ void destruct_( SectorObject * obj ); Ogre::SceneManager * sceneMgr_; Modified: trunk/src/SectorObject.cpp =================================================================== --- trunk/src/SectorObject.cpp 2009-01-10 13:45:44 UTC (rev 922) +++ trunk/src/SectorObject.cpp 2009-01-10 15:23:21 UTC (rev 923) @@ -18,14 +18,18 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include "Sector.h" #include "SectorObject.h" + +#include "LogManager.h" #include "OpcodeWrapper.h" +#include "ResourceManager.h" +#include "Sector.h" #include <OgreEntity.h> #include <OgreMeshManager.h> #include <OgreOverlayManager.h> #include <OgreOverlayElement.h> +#include <OgreSceneManager.h> #include <string> Modified: trunk/src/SectorObject.h =================================================================== --- trunk/src/SectorObject.h 2009-01-10 13:45:44 UTC (rev 922) +++ trunk/src/SectorObject.h 2009-01-10 15:23:21 UTC (rev 923) @@ -21,27 +21,18 @@ #ifndef _OPENGATE_SECTOROBJECT__H #define _OPENGATE_SECTOROBJECT__H -#include <OgrePrerequisites.h> -#include <OgreVector3.h> +#include "Opengate.h" -//#include <OgreSceneNode.h> - -#include "common.h" #include "BaseObject.h" +#include <OgreVector3.h> + namespace OgreOpcode{ class CollisionObject; } namespace OpenGate{ -class Sector; -class SectorObject; -class Gun; -class Projectile; -class OpcodeCollisionDetection; -class OpenALSoundSource; - class SectorObject : public BaseObject { public: /*! Constructor for the base class. The Object need an unique name and ptr to the sector */ Modified: trunk/src/SectorObjectMoveable.cpp =================================================================== --- trunk/src/SectorObjectMoveable.cpp 2009-01-10 13:45:44 UTC (rev 922) +++ trunk/src/SectorObjectMoveable.cpp 2009-01-10 15:23:21 UTC (rev 923) @@ -19,22 +19,26 @@ ***************************************************************************/ #include "SectorObjectMoveable.h" -#include "SectorObjectMissile.h" #include "commonWithOgre.h" + +#include "LogManager.h" #include "Missile.h" -#include "Vessel.h" -#include "Sector.h" #include "OpcodeWrapper.h" #include "Projectile.h" +#include "Sector.h" +#include "SectorObjectMissile.h" +#include "ResourceManager.h" +#include "Vessel.h" +#include <OgreBillboardSet.h> +#include <OgreEntity.h> #include <OgreOverlayManager.h> #include <OgreOverlayElement.h> -#include <OgreEntity.h> -#include <OgreSubEntity.h> #include <OgreParticleSystem.h> #include <OgreParticleEmitter.h> -#include <OgreBillboardSet.h> +#include <OgreSceneManager.h> +#include <OgreSubEntity.h> #include <string> Modified: trunk/src/SectorObjectVessel.cpp =================================================================== --- trunk/src/SectorObjectVessel.cpp 2009-01-10 13:45:44 UTC (rev 922) +++ trunk/src/SectorObjectVessel.cpp 2009-01-10 15:23:21 UTC (rev 923) @@ -22,14 +22,14 @@ #include "SectorObjectMissile.h" #include "AiManager.h" +#include "Equipment.h" #include "GunObject.h" #include "EntityManager.h" +#include "Missile.h" +#include "Projectile.h" #include "OpcodeWrapper.h" +#include "ResourceManager.h" #include "Sector.h" - -#include "Equipment.h" -#include "Missile.h" -#include "Projectile.h" #include "Vessel.h" #include <OgreEntity.h> Modified: trunk/src/Station.cpp =================================================================== --- trunk/src/Station.cpp 2009-01-10 13:45:44 UTC (rev 922) +++ trunk/src/Station.cpp 2009-01-10 15:23:21 UTC (rev 923) @@ -19,11 +19,13 @@ ***************************************************************************/ #include "Station.h" + +#include "AiObject.h" +#include "GameStateManager.h" #include "Sector.h" -#include "GameStateManager.h" +#include "SectorObjectVessel.h" #include "OpcodeWrapper.h" -#include "AiObject.h" -#include "SectorObjectVessel.h" +#include "UnDockedState.h" #include <OgreString.h> #include <OgreMesh.h> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eg...@us...> - 2009-01-10 13:45:59
|
Revision: 922 http://opengate.svn.sourceforge.net/opengate/?rev=922&view=rev Author: egore Date: 2009-01-10 13:45:44 +0000 (Sat, 10 Jan 2009) Log Message: ----------- Fix GCC 4.3 warning and (hopefully) fix a thinko Modified Paths: -------------- trunk/src/tinyxml/tinyxmlparser.cpp Modified: trunk/src/tinyxml/tinyxmlparser.cpp =================================================================== --- trunk/src/tinyxml/tinyxmlparser.cpp 2009-01-10 11:39:53 UTC (rev 921) +++ trunk/src/tinyxml/tinyxmlparser.cpp 2009-01-10 13:45:44 UTC (rev 922) @@ -354,7 +354,7 @@ } else { - while ( *p && IsWhiteSpace( *p ) || *p == '\n' || *p =='\r' ) + while ( *p && (IsWhiteSpace( *p ) || *p == '\n' || *p =='\r' )) ++p; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eg...@us...> - 2009-01-10 12:18:43
|
Revision: 921 http://opengate.svn.sourceforge.net/opengate/?rev=921&view=rev Author: egore Date: 2009-01-10 11:39:53 +0000 (Sat, 10 Jan 2009) Log Message: ----------- Make proper use of svn:ignore Modified Paths: -------------- trunk/src/.svnignore Removed Paths: ------------- trunk/.svnignore Property Changed: ---------------- trunk/ trunk/data/ trunk/src/ Property changes on: trunk ___________________________________________________________________ Modified: svn:ignore - .anjuta .tm_project* .libs .deps .libs .*swp .nautilus-metafile.xml *.autosave *.pws *.bak *~ #*# *.gladep *.la *.lo *.log *.o *.class *.pyc aclocal.m4 autom4te.cache config.h config.h.in config.log config.status configure intltool-extract* intltool-merge* intltool-modules* intltool-update* libtool prepare.sh stamp-h* ltmain.sh mkinstalldirs opengate.depend config.guess config.sub Makefile Makefile.in + .anjuta .tm_project* .libs .deps .libs .*swp .nautilus-metafile.xml *.autosave *.pws *.bak *~ #*# *.gladep *.la *.lo *.log *.o *.class *.pyc aclocal.m4 autom4te.cache config.h config.h.in config.log config.status configure intltool-extract* intltool-merge* intltool-modules* intltool-update* libtool prepare.sh stamp-h* ltmain.sh mkinstalldirs opengate.depend config.guess config.sub Makefile Makefile.in ogre.cfg Deleted: trunk/.svnignore =================================================================== --- trunk/.svnignore 2009-01-10 11:28:31 UTC (rev 920) +++ trunk/.svnignore 2009-01-10 11:39:53 UTC (rev 921) @@ -1,40 +0,0 @@ -.anjuta -.tm_project* -.libs -.deps -.libs -.*swp -.nautilus-metafile.xml -*.autosave -*.pws -*.bak -*~ -#*# -*.gladep -*.la -*.lo -*.log -*.o -*.class -*.pyc -aclocal.m4 -autom4te.cache -config.h -config.h.in -config.log -config.status -configure -intltool-extract* -intltool-merge* -intltool-modules* -intltool-update* -libtool -prepare.sh -stamp-h* -ltmain.sh -mkinstalldirs -opengate.depend -config.guess -config.sub -Makefile -Makefile.in Property changes on: trunk/data ___________________________________________________________________ Added: svn:ignore + Makefile Makefile.in Property changes on: trunk/src ___________________________________________________________________ Modified: svn:ignore - .anjuta .tm_project* .libs .deps .libs .*swp .nautilus-metafile.xml *.autosave *.pws *.bak *~ #*# *.gladep *.la *.lo *.log *.o *.class *.pyc aclocal.m4 autom4te.cache config.h config.h.in config.log config.status configure intltool-extract* intltool-merge* intltool-modules* intltool-update* libtool prepare.sh stamp-h* ltmain.sh mkinstalldirs opengate.depend config.guess config.sub Makefile Makefile.in + .anjuta .tm_project* .libs .deps .libs .*swp .nautilus-metafile.xml *.autosave *.pws *.bak *~ #*# *.gladep *.la *.lo *.log *.o *.class *.pyc aclocal.m4 autom4te.cache config.h config.h.in config.log config.status configure intltool-extract* intltool-merge* intltool-modules* intltool-update* libtool prepare.sh stamp-h* ltmain.sh mkinstalldirs opengate.depend config.guess config.sub Makefile Makefile.in opengateserver opengateclient Modified: trunk/src/.svnignore =================================================================== --- trunk/src/.svnignore 2009-01-10 11:28:31 UTC (rev 920) +++ trunk/src/.svnignore 2009-01-10 11:39:53 UTC (rev 921) @@ -1,5 +1,43 @@ -opengateserver +.anjuta +.tm_project* +.libs .deps +.libs +.*swp +.nautilus-metafile.xml +*.autosave +*.pws +*.bak +*~ +#*# +*.gladep +*.la +*.lo +*.log +*.o +*.class +*.pyc +aclocal.m4 +autom4te.cache +config.h +config.h.in +config.log +config.status +configure +intltool-extract* +intltool-merge* +intltool-modules* +intltool-update* +libtool +prepare.sh +stamp-h* +ltmain.sh +mkinstalldirs +opengate.depend +config.guess +config.sub Makefile -testopenalmanager +Makefile.in + +opengateserver opengateclient This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eg...@us...> - 2009-01-10 11:28:38
|
Revision: 920 http://opengate.svn.sourceforge.net/opengate/?rev=920&view=rev Author: egore Date: 2009-01-10 11:28:31 +0000 (Sat, 10 Jan 2009) Log Message: ----------- Silence a warning from libtool by shipping the libtool files Added Paths: ----------- trunk/m4/ trunk/m4/libtool.m4 trunk/m4/ltoptions.m4 trunk/m4/ltsugar.m4 trunk/m4/ltversion.m4 trunk/m4/lt~obsolete.m4 Added: trunk/m4/libtool.m4 =================================================================== --- trunk/m4/libtool.m4 (rev 0) +++ trunk/m4/libtool.m4 2009-01-10 11:28:31 UTC (rev 920) @@ -0,0 +1,7370 @@ +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008 Free Software Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +m4_define([_LT_COPYING], [dnl +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008 Free Software Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +]) + +# serial 56 LT_INIT + + +# LT_PREREQ(VERSION) +# ------------------ +# Complain and exit if this libtool version is less that VERSION. +m4_defun([LT_PREREQ], +[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, + [m4_default([$3], + [m4_fatal([Libtool version $1 or higher is required], + 63)])], + [$2])]) + + +# _LT_CHECK_BUILDDIR +# ------------------ +# Complain if the absolute build directory name contains unusual characters +m4_defun([_LT_CHECK_BUILDDIR], +[case `pwd` in + *\ * | *\ *) + AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; +esac +]) + + +# LT_INIT([OPTIONS]) +# ------------------ +AC_DEFUN([LT_INIT], +[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +AC_BEFORE([$0], [LT_LANG])dnl +AC_BEFORE([$0], [LT_OUTPUT])dnl +AC_BEFORE([$0], [LTDL_INIT])dnl +m4_require([_LT_CHECK_BUILDDIR])dnl + +dnl Autoconf doesn't catch unexpanded LT_ macros by default: +m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl +m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl +dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 +dnl unless we require an AC_DEFUNed macro: +AC_REQUIRE([LTOPTIONS_VERSION])dnl +AC_REQUIRE([LTSUGAR_VERSION])dnl +AC_REQUIRE([LTVERSION_VERSION])dnl +AC_REQUIRE([LTOBSOLETE_VERSION])dnl +m4_require([_LT_PROG_LTMAIN])dnl + +dnl Parse OPTIONS +_LT_SET_OPTIONS([$0], [$1]) + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +_LT_SETUP + +# Only expand once: +m4_define([LT_INIT]) +])# LT_INIT + +# Old names: +AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) +AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PROG_LIBTOOL], []) +dnl AC_DEFUN([AM_PROG_LIBTOOL], []) + + +# _LT_CC_BASENAME(CC) +# ------------------- +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +m4_defun([_LT_CC_BASENAME], +[for cc_temp in $1""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +]) + + +# _LT_FILEUTILS_DEFAULTS +# ---------------------- +# It is okay to use these file commands and assume they have been set +# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. +m4_defun([_LT_FILEUTILS_DEFAULTS], +[: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} +])# _LT_FILEUTILS_DEFAULTS + + +# _LT_SETUP +# --------- +m4_defun([_LT_SETUP], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +_LT_DECL([], [host_alias], [0], [The host system])dnl +_LT_DECL([], [host], [0])dnl +_LT_DECL([], [host_os], [0])dnl +dnl +_LT_DECL([], [build_alias], [0], [The build system])dnl +_LT_DECL([], [build], [0])dnl +_LT_DECL([], [build_os], [0])dnl +dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +dnl +AC_REQUIRE([AC_PROG_LN_S])dnl +test -z "$LN_S" && LN_S="ln -s" +_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl +dnl +AC_REQUIRE([LT_CMD_MAX_LEN])dnl +_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl +_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl +dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_CMD_RELOAD])dnl +m4_require([_LT_CHECK_MAGIC_METHOD])dnl +m4_require([_LT_CMD_OLD_ARCHIVE])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl + +_LT_CONFIG_LIBTOOL_INIT([ +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi +]) +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +_LT_CHECK_OBJDIR + +m4_require([_LT_TAG_COMPILER])dnl +_LT_PROG_ECHO_BACKSLASH + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([["`\\]]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +_LT_CC_BASENAME([$compiler]) + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + _LT_PATH_MAGIC + fi + ;; +esac + +# Use C for the default configuration in the libtool script +LT_SUPPORTED_TAG([CC]) +_LT_LANG_C_CONFIG +_LT_LANG_DEFAULT_CONFIG +_LT_CONFIG_COMMANDS +])# _LT_SETUP + + +# _LT_PROG_LTMAIN +# --------------- +# Note that this code is called both from `configure', and `config.status' +# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, +# `config.status' has no value for ac_aux_dir unless we are using Automake, +# so we pass a copy along to make sure it has a sensible value anyway. +m4_defun([_LT_PROG_LTMAIN], +[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl +_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) +ltmain="$ac_aux_dir/ltmain.sh" +])# _LT_PROG_LTMAIN + + +## ------------------------------------- ## +## Accumulate code for creating libtool. ## +## ------------------------------------- ## + +# So that we can recreate a full libtool script including additional +# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS +# in macros and then make a single call at the end using the `libtool' +# label. + + +# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) +# ---------------------------------------- +# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL_INIT], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_INIT], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_INIT]) + + +# _LT_CONFIG_LIBTOOL([COMMANDS]) +# ------------------------------ +# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) + + +# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) +# ----------------------------------------------------- +m4_defun([_LT_CONFIG_SAVE_COMMANDS], +[_LT_CONFIG_LIBTOOL([$1]) +_LT_CONFIG_LIBTOOL_INIT([$2]) +]) + + +# _LT_FORMAT_COMMENT([COMMENT]) +# ----------------------------- +# Add leading comment marks to the start of each line, and a trailing +# full-stop to the whole comment if one is not present already. +m4_define([_LT_FORMAT_COMMENT], +[m4_ifval([$1], [ +m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], + [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) +)]) + + + +## ------------------------ ## +## FIXME: Eliminate VARNAME ## +## ------------------------ ## + + +# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) +# ------------------------------------------------------------------- +# CONFIGNAME is the name given to the value in the libtool script. +# VARNAME is the (base) name used in the configure script. +# VALUE may be 0, 1 or 2 for a computed quote escaped value based on +# VARNAME. Any other value will be used directly. +m4_define([_LT_DECL], +[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], + [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], + [m4_ifval([$1], [$1], [$2])]) + lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) + m4_ifval([$4], + [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) + lt_dict_add_subkey([lt_decl_dict], [$2], + [tagged?], [m4_ifval([$5], [yes], [no])])]) +]) + + +# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) +# -------------------------------------------------------- +m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) + + +# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_tag_varnames], +[_lt_decl_filter([tagged?], [yes], $@)]) + + +# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) +# --------------------------------------------------------- +m4_define([_lt_decl_filter], +[m4_case([$#], + [0], [m4_fatal([$0: too few arguments: $#])], + [1], [m4_fatal([$0: too few arguments: $#: $1])], + [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], + [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], + [lt_dict_filter([lt_decl_dict], $@)])[]dnl +]) + + +# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) +# -------------------------------------------------- +m4_define([lt_decl_quote_varnames], +[_lt_decl_filter([value], [1], $@)]) + + +# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_dquote_varnames], +[_lt_decl_filter([value], [2], $@)]) + + +# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_varnames_tagged], +[m4_assert([$# <= 2])dnl +_$0(m4_quote(m4_default([$1], [[, ]])), + m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), + m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) +m4_define([_lt_decl_varnames_tagged], +[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) + + +# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_all_varnames], +[_$0(m4_quote(m4_default([$1], [[, ]])), + m4_if([$2], [], + m4_quote(lt_decl_varnames), + m4_quote(m4_shift($@))))[]dnl +]) +m4_define([_lt_decl_all_varnames], +[lt_join($@, lt_decl_varnames_tagged([$1], + lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl +]) + + +# _LT_CONFIG_STATUS_DECLARE([VARNAME]) +# ------------------------------------ +# Quote a variable value, and forward it to `config.status' so that its +# declaration there will have the same value as in `configure'. VARNAME +# must have a single quote delimited value for this to work. +m4_define([_LT_CONFIG_STATUS_DECLARE], +[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`']) + + +# _LT_CONFIG_STATUS_DECLARATIONS +# ------------------------------ +# We delimit libtool config variables with single quotes, so when +# we write them to config.status, we have to be sure to quote all +# embedded single quotes properly. In configure, this macro expands +# each variable declared with _LT_DECL (and _LT_TAGDECL) into: +# +# <var>='`$ECHO "X$<var>" | $Xsed -e "$delay_single_quote_subst"`' +m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], +[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), + [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAGS +# ---------------- +# Output comment and list of tags supported by the script +m4_defun([_LT_LIBTOOL_TAGS], +[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl +available_tags="_LT_TAGS"dnl +]) + + +# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) +# ----------------------------------- +# Extract the dictionary values for VARNAME (optionally with TAG) and +# expand to a commented shell variable setting: +# +# # Some comment about what VAR is for. +# visible_name=$lt_internal_name +m4_define([_LT_LIBTOOL_DECLARE], +[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], + [description])))[]dnl +m4_pushdef([_libtool_name], + m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl +m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), + [0], [_libtool_name=[$]$1], + [1], [_libtool_name=$lt_[]$1], + [2], [_libtool_name=$lt_[]$1], + [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl +m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl +]) + + +# _LT_LIBTOOL_CONFIG_VARS +# ----------------------- +# Produce commented declarations of non-tagged libtool config variables +# suitable for insertion in the LIBTOOL CONFIG section of the `libtool' +# script. Tagged libtool config variables (even for the LIBTOOL CONFIG +# section) are produced by _LT_LIBTOOL_TAG_VARS. +m4_defun([_LT_LIBTOOL_CONFIG_VARS], +[m4_foreach([_lt_var], + m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAG_VARS(TAG) +# ------------------------- +m4_define([_LT_LIBTOOL_TAG_VARS], +[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) + + +# _LT_TAGVAR(VARNAME, [TAGNAME]) +# ------------------------------ +m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) + + +# _LT_CONFIG_COMMANDS +# ------------------- +# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of +# variables for single and double quote escaping we saved from calls +# to _LT_DECL, we can put quote escaped variables declarations +# into `config.status', and then the shell code to quote escape them in +# for loops in `config.status'. Finally, any additional code accumulated +# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. +m4_defun([_LT_CONFIG_COMMANDS], +[AC_PROVIDE_IFELSE([LT_OUTPUT], + dnl If the libtool generation code has been placed in $CONFIG_LT, + dnl instead of duplicating it all over again into config.status, + dnl then we will have config.status run $CONFIG_LT later, so it + dnl needs to know what name is stored there: + [AC_CONFIG_COMMANDS([libtool], + [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], + dnl If the libtool generation code is destined for config.status, + dnl expand the accumulated commands and init code now: + [AC_CONFIG_COMMANDS([libtool], + [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) +])#_LT_CONFIG_COMMANDS + + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], +[ + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +_LT_CONFIG_STATUS_DECLARATIONS +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# Quote evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_quote_varnames); do + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_dquote_varnames); do + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Fix-up fallback echo if it was mangled by the above quoting rules. +case \$lt_ECHO in +*'\\\[$]0 --fallback-echo"')dnl " + lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\` + ;; +esac + +_LT_OUTPUT_LIBTOOL_INIT +]) + + +# LT_OUTPUT +# --------- +# This macro allows early generation of the libtool script (before +# AC_OUTPUT is called), incase it is used in configure for compilation +# tests. +AC_DEFUN([LT_OUTPUT], +[: ${CONFIG_LT=./config.lt} +AC_MSG_NOTICE([creating $CONFIG_LT]) +cat >"$CONFIG_LT" <<_LTEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate a libtool stub with the current configuration. + +lt_cl_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AS_SHELL_SANITIZE +_AS_PREPARE + +exec AS_MESSAGE_FD>&1 +exec AS_MESSAGE_LOG_FD>>config.log +{ + echo + AS_BOX([Running $as_me.]) +} >&AS_MESSAGE_LOG_FD + +lt_cl_help="\ +\`$as_me' creates a local libtool stub from the current configuration, +for use in further configure time tests before the real libtool is +generated. + +Usage: $[0] [[OPTIONS]] + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + +Report bugs to <bug...@gn...>." + +lt_cl_version="\ +m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl +m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) +configured by $[0], generated by m4_PACKAGE_STRING. + +Copyright (C) 2008 Free Software Foundation, Inc. +This config.lt script is free software; the Free Software Foundation +gives unlimited permision to copy, distribute and modify it." + +while test $[#] != 0 +do + case $[1] in + --version | --v* | -V ) + echo "$lt_cl_version"; exit 0 ;; + --help | --h* | -h ) + echo "$lt_cl_help"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --quiet | --q* | --silent | --s* | -q ) + lt_cl_silent=: ;; + + -*) AC_MSG_ERROR([unrecognized option: $[1] +Try \`$[0] --help' for more information.]) ;; + + *) AC_MSG_ERROR([unrecognized argument: $[1] +Try \`$[0] --help' for more information.]) ;; + esac + shift +done + +if $lt_cl_silent; then + exec AS_MESSAGE_FD>/dev/null +fi +_LTEOF + +cat >>"$CONFIG_LT" <<_LTEOF +_LT_OUTPUT_LIBTOOL_COMMANDS_INIT +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AC_MSG_NOTICE([creating $ofile]) +_LT_OUTPUT_LIBTOOL_COMMANDS +AS_EXIT(0) +_LTEOF +chmod +x "$CONFIG_LT" + +# configure is writing to config.log, but config.lt does its own redirection, +# appending to config.log, which fails on DOS, as config.log is still kept +# open by configure. Here we exec the FD to /dev/null, effectively closing +# config.log, so it can be properly (re)opened and appended to by config.lt. +if test "$no_create" != yes; then + lt_cl_success=: + test "$silent" = yes && + lt_config_lt_args="$lt_config_lt_args --quiet" + exec AS_MESSAGE_LOG_FD>/dev/null + $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false + exec AS_MESSAGE_LOG_FD>>config.log + $lt_cl_success || AS_EXIT(1) +fi +])# LT_OUTPUT + + +# _LT_CONFIG(TAG) +# --------------- +# If TAG is the built-in tag, create an initial libtool script with a +# default configuration from the untagged config vars. Otherwise add code +# to config.status for appending the configuration named by TAG from the +# matching tagged config vars. +m4_defun([_LT_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_CONFIG_SAVE_COMMANDS([ + m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl + m4_if(_LT_TAG, [C], [ + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +_LT_COPYING +_LT_LIBTOOL_TAGS + +# ### BEGIN LIBTOOL CONFIG +_LT_LIBTOOL_CONFIG_VARS +_LT_LIBTOOL_TAG_VARS +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + _LT_PROG_LTMAIN + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + _LT_PROG_XSI_SHELLFNS + + sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +], +[cat <<_LT_EOF >> "$ofile" + +dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded +dnl in a comment (ie after a #). +# ### BEGIN LIBTOOL TAG CONFIG: $1 +_LT_LIBTOOL_TAG_VARS(_LT_TAG) +# ### END LIBTOOL TAG CONFIG: $1 +_LT_EOF +])dnl /m4_if +], +[m4_if([$1], [], [ + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile'], []) +])dnl /_LT_CONFIG_SAVE_COMMANDS +])# _LT_CONFIG + + +# LT_SUPPORTED_TAG(TAG) +# --------------------- +# Trace this macro to discover what tags are supported by the libtool +# --tag option, using: +# autoconf --trace 'LT_SUPPORTED_TAG:$1' +AC_DEFUN([LT_SUPPORTED_TAG], []) + + +# C support is built-in for now +m4_define([_LT_LANG_C_enabled], []) +m4_define([_LT_TAGS], []) + + +# LT_LANG(LANG) +# ------------- +# Enable libtool support for the given language if not already enabled. +AC_DEFUN([LT_LANG], +[AC_BEFORE([$0], [LT_OUTPUT])dnl +m4_case([$1], + [C], [_LT_LANG(C)], + [C++], [_LT_LANG(CXX)], + [Java], [_LT_LANG(GCJ)], + [Fortran 77], [_LT_LANG(F77)], + [Fortran], [_LT_LANG(FC)], + [Windows Resource], [_LT_LANG(RC)], + [m4_ifdef([_LT_LANG_]$1[_CONFIG], + [_LT_LANG($1)], + [m4_fatal([$0: unsupported language: "$1"])])])dnl +])# LT_LANG + + +# _LT_LANG(LANGNAME) +# ------------------ +m4_defun([_LT_LANG], +[m4_ifdef([_LT_LANG_]$1[_enabled], [], + [LT_SUPPORTED_TAG([$1])dnl + m4_append([_LT_TAGS], [$1 ])dnl + m4_define([_LT_LANG_]$1[_enabled], [])dnl + _LT_LANG_$1_CONFIG($1)])dnl +])# _LT_LANG + + +# _LT_LANG_DEFAULT_CONFIG +# ----------------------- +m4_defun([_LT_LANG_DEFAULT_CONFIG], +[AC_PROVIDE_IFELSE([AC_PROG_CXX], + [LT_LANG(CXX)], + [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) + +AC_PROVIDE_IFELSE([AC_PROG_F77], + [LT_LANG(F77)], + [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) + +AC_PROVIDE_IFELSE([AC_PROG_FC], + [LT_LANG(FC)], + [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) + +dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal +dnl pulling things in needlessly. +AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([LT_PROG_GCJ], + [LT_LANG(GCJ)], + [m4_ifdef([AC_PROG_GCJ], + [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([A][M_PROG_GCJ], + [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([LT_PROG_GCJ], + [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) + +AC_PROVIDE_IFELSE([LT_PROG_RC], + [LT_LANG(RC)], + [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) +])# _LT_LANG_DEFAULT_CONFIG + +# Obsolete macros: +AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) +AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) +AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) +AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_CXX], []) +dnl AC_DEFUN([AC_LIBTOOL_F77], []) +dnl AC_DEFUN([AC_LIBTOOL_FC], []) +dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) + + +# _LT_TAG_COMPILER +# ---------------- +m4_defun([_LT_TAG_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl +_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl +_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl +_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_TAG_COMPILER + + +# _LT_COMPILER_BOILERPLATE +# ------------------------ +# Check for compiler boilerplate output or warnings with +# the simple compiler test code. +m4_defun([_LT_COMPILER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* +])# _LT_COMPILER_BOILERPLATE + + +# _LT_LINKER_BOILERPLATE +# ---------------------- +# Check for linker boilerplate output or warnings with +# the simple link test code. +m4_defun([_LT_LINKER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* +])# _LT_LINKER_BOILERPLATE + +# _LT_REQUIRED_DARWIN_CHECKS +# ------------------------- +m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ + case $host_os in + rhapsody* | darwin*) + AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) + AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) + AC_CHECK_TOOL([LIPO], [lipo], [:]) + AC_CHECK_TOOL([OTOOL], [otool], [:]) + AC_CHECK_TOOL([OTOOL64], [otool64], [:]) + _LT_DECL([], [DSYMUTIL], [1], + [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) + _LT_DECL([], [NMEDIT], [1], + [Tool to change global to local symbols on Mac OS X]) + _LT_DECL([], [LIPO], [1], + [Tool to manipulate fat objects and archives on Mac OS X]) + _LT_DECL([], [OTOOL], [1], + [ldd/readelf like tool for Mach-O binaries on Mac OS X]) + _LT_DECL([], [OTOOL64], [1], + [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) + + AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], + [lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi]) + AC_CACHE_CHECK([for -exported_symbols_list linker flag], + [lt_cv_ld_exported_symbols_list], + [lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [lt_cv_ld_exported_symbols_list=yes], + [lt_cv_ld_exported_symbols_list=no]) + LDFLAGS="$save_LDFLAGS" + ]) + case $host_os in + rhapsody* | darwin1.[[012]]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[[012]]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac +]) + + +# _LT_DARWIN_LINKER_FEATURES +# -------------------------- +# Checks for linker and compiler features on darwin +m4_defun([_LT_DARWIN_LINKER_FEATURES], +[ + m4_require([_LT_REQUIRED_DARWIN_CHECKS]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_automatic, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_TAGVAR(whole_archive_flag_spec, $1)='' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=echo + _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + m4_if([$1], [CXX], +[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then + _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" + fi +],[]) + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi +]) + +# _LT_SYS_MODULE_PATH_AIX +# ----------------------- +# Links a minimal program and checks the executable +# for the system default hardcoded library path. In most cases, +# this is /usr/lib:/lib, but when the MPI compilers are used +# the location of the communication and MPI libs are included too. +# If we don't find anything, use the default library path according +# to the aix ld manual. +m4_defun([_LT_SYS_MODULE_PATH_AIX], +[m4_require([_LT_DECL_SED])dnl +AC_LINK_IFELSE(AC_LANG_PROGRAM,[ +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi],[]) +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +])# _LT_SYS_MODULE_PATH_AIX + + +# _LT_SHELL_INIT(ARG) +# ------------------- +m4_define([_LT_SHELL_INIT], +[ifdef([AC_DIVERSION_NOTICE], + [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], + [AC_DIVERT_PUSH(NOTICE)]) +$1 +AC_DIVERT_POP +])# _LT_SHELL_INIT + + +# _LT_PROG_ECHO_BACKSLASH +# ----------------------- +# Add some code to the start of the generated configure script which +# will find an echo command which doesn't interpret backslashes. +m4_defun([_LT_PROG_ECHO_BACKSLASH], +[_LT_SHELL_INIT([ +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$lt_ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` + ;; +esac + +ECHO=${lt_ECHO-echo} +if test "X[$]1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X[$]1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then + # Yippee, $ECHO works! + : +else + # Restart under the correct shell. + exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} +fi + +if test "X[$]1" = X--fallback-echo; then + # used as fallback echo + shift + cat <<_LT_EOF +[$]* +_LT_EOF + exit 0 +fi + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test -z "$lt_ECHO"; then + if test "X${echo_test_string+set}" != Xset; then + # find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if { echo_test_string=`eval $cmd`; } 2>/dev/null && + { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null + then + break + fi + done + fi + + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : + else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$ECHO" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + ECHO='print -r' + elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} + else + # Try using printf. + ECHO='printf %s\n' + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + ECHO="$CONFIG_SHELL [$]0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$CONFIG_SHELL [$]0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do + if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "[$]0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} + else + # Oops. We lost completely, so just stick with echo. + ECHO=echo + fi + fi + fi + fi + fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +lt_ECHO=$ECHO +if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then + lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" +fi + +AC_SUBST(lt_ECHO) +]) +_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) +_LT_DECL([], [ECHO], [1], + [An echo program that does not interpret backslashes]) +])# _LT_PROG_ECHO_BACKSLASH + + +# _LT_ENABLE_LOCK +# --------------- +m4_defun([_LT_ENABLE_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AS_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line __oline__ "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" +])# _LT_ENABLE_LOCK + + +# _LT_CMD_OLD_ARCHIVE +# ------------------- +m4_defun([_LT_CMD_OLD_ARCHIVE], +[AC_CHECK_TOOL(AR, ar, false) +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +_LT_DECL([], [AR], [1], [The archiver]) +_LT_DECL([], [AR_FLAGS], [1]) + +AC_CHECK_TOOL(STRIP, strip, :) +test -z "$STRIP" && STRIP=: +_LT_DECL([], [STRIP], [1], [A symbol stripping program]) + +AC_CHECK_TOOL(RANLIB, ranlib, :) +test -z "$RANLIB" && RANLIB=: +_LT_DECL([], [RANLIB], [1], + [Commands used to install an old-style archive]) + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi +_LT_DECL([], [old_postinstall_cmds], [2]) +_LT_DECL([], [old_postuninstall_cmds], [2]) +_LT_TAGDECL([], [old_archive_cmds], [2], + [Commands used to build an old-style archive]) +])# _LT_CMD_OLD_ARCHIVE + + +# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([_LT_COMPILER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $RM conftest* +]) + +if test x"[$]$2" = xyes; then + m4_if([$5], , :, [$5]) +else + m4_if([$6], , :, [$6]) +fi +])# _LT_COMPILER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) + + +# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------- +# Check whether the given linker option works +AC_DEFUN([_LT_LINKER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + else + $2=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" +]) + +if test x"[$]$2" = xyes; then + m4_if([$4], , :, [$4]) +else + m4_if([$5], , :, [$5]) +fi +])# _LT_LINKER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) + + +# LT_CMD_MAX_LEN +#--------------- +AC_DEFUN([LT_CMD_MAX_LEN], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +# find the maximum length of command line arguments +AC_MSG_CHECKING([the maximum length of command line arguments]) +AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ + = "XX$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac +]) +if test -n $lt_cv_sys_max_cmd_len ; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +else + AC_MSG_RESULT(none) +fi +max_cmd_len=$lt_cv_sys_max_cmd_len +_LT_DECL([], [max_cmd_len], [0], + [What is the maximum length of a command?]) +])# LT_CMD_MAX_LEN + +# Old name: +AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) + + +# _LT_HEADER_DLFCN +# ---------------- +m4_defun([_LT_HEADER_DLFCN], +[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl +])# _LT_HEADER_DLFCN + + +# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# ---------------------------------------------------------------- +m4_defun([_LT_TRY_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test "$cross_compiling" = yes; then : + [$4] +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +[#line __oline__ "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include <dlfcn.h> +#endif + +#include <stdio.h> + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +}] +_LT_EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_dlunknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_TRY_DLOPEN_SELF + + +# LT_SYS_DLOPEN_SELF +# ------------------ +AC_DEFUN([LT_SYS_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen="shl_load"], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], + [AC_CHECK_FUNC([dlopen], + [lt_cv_dlopen="dlopen"], + [AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [AC_CHECK_LIB([svld], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], + [AC_CHECK_LIB([dld], [dld_link], + [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) + ]) + ]) + ]) + ]) + ]) + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, + lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) + ]) + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi +_LT_DECL([dlopen_support], [enable_dlopen], [0], + [Whether dlopen is supported]) +_LT_DECL([dlopen_self], [enable_dlopen_self], [0], + [Whether dlopen of programs is supported]) +_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], + [Whether dlopen of statically linked programs is supported]) +])# LT_SYS_DLOPEN_SELF + +# Old name: +AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) + + +# _LT_COMPILER_C_O([TAGNAME]) +# --------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler. +# This macro does not hard code the compiler like AC_PROG_CC_C_O. +m4_defun([_LT_COMPILER_C_O], +[m4_require([_LT_D... [truncated message content] |
From: <eg...@us...> - 2009-01-10 11:24:15
|
Revision: 919 http://opengate.svn.sourceforge.net/opengate/?rev=919&view=rev Author: egore Date: 2009-01-10 11:23:58 +0000 (Sat, 10 Jan 2009) Log Message: ----------- Silence a warning from libtool by shipping the libtool files Modified Paths: -------------- trunk/Makefile.am trunk/configure.ac Modified: trunk/Makefile.am =================================================================== --- trunk/Makefile.am 2009-01-10 11:23:20 UTC (rev 918) +++ trunk/Makefile.am 2009-01-10 11:23:58 UTC (rev 919) @@ -3,6 +3,11 @@ SUBDIRS = src \ data +ACLOCAL_AMFLAGS = -I m4 + +EXTRA_DIST = \ + autogen.sh + distclean: maintainer-clean rm -rf *~ rm -rf autom4te.cache Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2009-01-10 11:23:20 UTC (rev 918) +++ trunk/configure.ac 2009-01-10 11:23:58 UTC (rev 919) @@ -6,6 +6,7 @@ AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION, [dist-bzip2]) AM_CONFIG_HEADER(config.h) +AC_CONFIG_MACRO_DIR([m4]) AM_MAINTAINER_MODE AM_INIT_AUTOMAKE(opengate, 0.0.1) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eg...@us...> - 2009-01-10 11:23:33
|
Revision: 918 http://opengate.svn.sourceforge.net/opengate/?rev=918&view=rev Author: egore Date: 2009-01-10 11:23:20 +0000 (Sat, 10 Jan 2009) Log Message: ----------- Simplyfy the autogen.sh script Modified Paths: -------------- trunk/autogen.sh Modified: trunk/autogen.sh =================================================================== --- trunk/autogen.sh 2009-01-10 04:46:25 UTC (rev 917) +++ trunk/autogen.sh 2009-01-10 11:23:20 UTC (rev 918) @@ -1,159 +1,4 @@ #!/bin/sh -# Run this to generate all the initial makefiles, etc. - -srcdir=`dirname $0` -test -z "$srcdir" && srcdir=. - -DIE=0 - -if [ -n "$GNOME2_DIR" ]; then - ACLOCAL_FLAGS="-I $GNOME2_DIR/share/aclocal $ACLOCAL_FLAGS" - LD_LIBRARY_PATH="$GNOME2_DIR/lib:$LD_LIBRARY_PATH" - PATH="$GNOME2_DIR/bin:$PATH" - export PATH - export LD_LIBRARY_PATH -fi - -(test -f $srcdir/configure.ac) || { - echo -n "**Error**: Directory "\`$srcdir\'" does not look like the" - echo " top-level package directory" - exit 1 -} - -(autoconf --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "**Error**: You must have \`autoconf' installed." - echo "Download the appropriate package for your distribution," - echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" - DIE=1 -} - -(grep "^IT_PROG_INTLTOOL" $srcdir/configure.ac >/dev/null) && { - (intltoolize --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "**Error**: You must have \`intltool' installed." - echo "You can get it from:" - echo " ftp://ftp.gnome.org/pub/GNOME/" - DIE=1 - } -} - -(grep "^AM_PROG_XML_I18N_TOOLS" $srcdir/configure.ac >/dev/null) && { - (xml-i18n-toolize --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "**Error**: You must have \`xml-i18n-toolize' installed." - echo "You can get it from:" - echo " ftp://ftp.gnome.org/pub/GNOME/" - DIE=1 - } -} - -(grep "^AM_PROG_LIBTOOL" $srcdir/configure.ac >/dev/null) && { - (libtool --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "**Error**: You must have \`libtool' installed." - echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/" - DIE=1 - } -} - -(grep "^AM_GLIB_GNU_GETTEXT" $srcdir/configure.ac >/dev/null) && { - (grep "sed.*POTFILES" $srcdir/configure.ac) > /dev/null || \ - (glib-gettextize --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "**Error**: You must have \`glib' installed." - echo "You can get it from: ftp://ftp.gtk.org/pub/gtk" - DIE=1 - } -} - -(automake --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "**Error**: You must have \`automake' installed." - echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/" - DIE=1 - NO_AUTOMAKE=yes -} - - -# if no automake, don't bother testing for aclocal -test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "**Error**: Missing \`aclocal'. The version of \`automake'" - echo "installed doesn't appear recent enough." - echo "You can get automake from ftp://ftp.gnu.org/pub/gnu/" - DIE=1 -} - -if test "$DIE" -eq 1; then - exit 1 -fi - -if test -z "$*"; then - echo "**Warning**: I am going to run \`configure' with no arguments." - echo "If you wish to pass any to it, please specify them on the" - echo \`$0\'" command line." - echo -fi - -case $CC in -xlc ) - am_opt=--include-deps;; -esac - -for coin in `find $srcdir -path $srcdir/CVS -prune -o -name configure.ac -print` -do - dr=`dirname $coin` - if test -f $dr/NO-AUTO-GEN; then - echo skipping $dr -- flagged as no auto-gen - else - echo processing $dr - ( cd $dr - - aclocalinclude="$ACLOCAL_FLAGS" - - if grep "^AM_GLIB_GNU_GETTEXT" configure.ac >/dev/null; then - echo "Creating $dr/aclocal.m4 ..." - test -r $dr/aclocal.m4 || touch $dr/aclocal.m4 - echo "Running glib-gettextize... Ignore non-fatal messages." - echo "no" | glib-gettextize --force --copy - echo "Making $dr/aclocal.m4 writable ..." - test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4 - fi - if grep "^IT_PROG_INTLTOOL" configure.ac >/dev/null; then - echo "Running intltoolize..." - intltoolize --copy --force --automake - fi - if grep "^AM_PROG_XML_I18N_TOOLS" configure.ac >/dev/null; then - echo "Running xml-i18n-toolize..." - xml-i18n-toolize --copy --force --automake - fi - if grep "^AM_PROG_LIBTOOL" configure.ac >/dev/null; then - if test -z "$NO_LIBTOOLIZE" ; then - echo "Running libtoolize..." - libtoolize --force --copy - fi - fi - echo "Running aclocal $aclocalinclude ..." - aclocal $aclocalinclude - if grep "^AM_CONFIG_HEADER" configure.ac >/dev/null; then - echo "Running autoheader..." - autoheader - fi - echo "Running automake --gnu $am_opt ..." - automake --add-missing --gnu $am_opt - echo "Running autoconf ..." - autoconf - ) - fi -done - -conf_flags="--enable-maintainer-mode" - -if test x$NOCONFIGURE = x; then - echo Running $srcdir/configure $conf_flags "$@" ... - $srcdir/configure $conf_flags "$@" \ - && echo Now type \`make\' to compile. || exit 1 -else - echo Skipping configure process. -fi +libtoolize && +autoreconf -i -f && +./configure $@ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ult...@us...> - 2009-01-10 04:46:38
|
Revision: 917 http://opengate.svn.sourceforge.net/opengate/?rev=917&view=rev Author: Ultrasick Date: 2009-01-10 04:46:25 +0000 (Sat, 10 Jan 2009) Log Message: ----------- removed hack (faction id = -1) Modified Paths: -------------- trunk/data/misc/ids.xml Modified: trunk/data/misc/ids.xml =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ult...@us...> - 2009-01-10 02:57:31
|
Revision: 916 http://opengate.svn.sourceforge.net/opengate/?rev=916&view=rev Author: Ultrasick Date: 2009-01-10 02:57:21 +0000 (Sat, 10 Jan 2009) Log Message: ----------- uploading a php script to create thouse rotating laser logos from a alpha map (black and white picture) Added Paths: ----------- templates/GUI/screens/ templates/GUI/screens/station/ templates/GUI/screens/station/create_a_laser_logo/ templates/GUI/screens/station/create_a_laser_logo/algorithmen/ templates/GUI/screens/station/create_a_laser_logo/algorithmen/bearbeiten.php templates/GUI/screens/station/create_a_laser_logo/algorithmen/functions.php templates/GUI/screens/station/create_a_laser_logo/algorithmen/laden.php templates/GUI/screens/station/create_a_laser_logo/datensaetze/ templates/GUI/screens/station/create_a_laser_logo/datensaetze/tauseti.png templates/GUI/screens/station/create_a_laser_logo/index.php templates/GUI/screens/station/create_a_laser_logo/test.htm Added: templates/GUI/screens/station/create_a_laser_logo/algorithmen/bearbeiten.php =================================================================== --- templates/GUI/screens/station/create_a_laser_logo/algorithmen/bearbeiten.php (rev 0) +++ templates/GUI/screens/station/create_a_laser_logo/algorithmen/bearbeiten.php 2009-01-10 02:57:21 UTC (rev 916) @@ -0,0 +1,43 @@ +<? +$x = 0; +$y = 0; + +while($y<>$Bild_H\xF6he){ + while($x<>$Bild_Breite){ + # Pixel einlesen + $Pixel = pixel_read($Bild_Vorgabe, $x, $y); + + $rot = $Pixel['red']; + $gr\xFCn = $Pixel['green']; + $blau = $Pixel['blue']; + $alpha = $Pixel['alpha']; + + # neuen Alphawert berechnen + $alpha = (($rot/255 + $gr\xFCn/255 + $blau/255) / 3) * 127; + + # neue Farbwerte festlegen + $rot = 255; + $gr\xFCn = 0; + $blau = 0; + + $x_Verarbeitet = sin(($Durchlauf/360)*2*$Pi) * (($Bild_Breite/2) - $x) + ($Bild_Breite/2) + 5; + + # Farbwerte abspeichern + pixel_write($Bild_Verarbeitet, $x_Verarbeitet - 1, $y, $rot, $gr\xFCn, $blau, $alpha); + pixel_write($Bild_Verarbeitet, $x_Verarbeitet, $y, $rot, $gr\xFCn, $blau, $alpha); + pixel_write($Bild_Verarbeitet, $x_Verarbeitet + 1, $y, $rot, $gr\xFCn, $blau, $alpha); + + # Auf der x-Achse 1 weiter springen + $x++; + } + + # x-Achse zur\xFCcksetzen + $x = 0; + + # Auf der y-Achse 1 weiter springen + $y++; +} + +# Bild abspeichern +ImagePNG($Bild_Verarbeitet, $Durchlauf . '.png'); +?> \ No newline at end of file Property changes on: templates/GUI/screens/station/create_a_laser_logo/algorithmen/bearbeiten.php ___________________________________________________________________ Added: svn:eol-style + native Added: templates/GUI/screens/station/create_a_laser_logo/algorithmen/functions.php =================================================================== --- templates/GUI/screens/station/create_a_laser_logo/algorithmen/functions.php (rev 0) +++ templates/GUI/screens/station/create_a_laser_logo/algorithmen/functions.php 2009-01-10 02:57:21 UTC (rev 916) @@ -0,0 +1,15 @@ +<? +# Pixel einladen [Start] + function pixel_read($Bild, $x, $y){ + # Pixel einlesen + return imagecolorsforindex($Bild, imagecolorat($Bild, $x, $y)); + } +# Pixel einladen [Ende] + +# Pixel speichern [Start] + function pixel_write($Bild, $x, $y, $rot, $gr\xFCn, $blau, $alpha){ + $Farbe = imagecolorallocatealpha($Bild, $rot, $gr\xFCn, $blau, $alpha); + ImageFilledRectangle($Bild, $x, $y, $x, $y, $Farbe); + } +# Pixel speichern [Ende] +?> \ No newline at end of file Property changes on: templates/GUI/screens/station/create_a_laser_logo/algorithmen/functions.php ___________________________________________________________________ Added: svn:eol-style + native Added: templates/GUI/screens/station/create_a_laser_logo/algorithmen/laden.php =================================================================== --- templates/GUI/screens/station/create_a_laser_logo/algorithmen/laden.php (rev 0) +++ templates/GUI/screens/station/create_a_laser_logo/algorithmen/laden.php 2009-01-10 02:57:21 UTC (rev 916) @@ -0,0 +1,21 @@ +<? +$Pi = 3.14159265; + +# Bilddimensionen abfragen (Breite und H\xF6he) [Start] + $Bild_Daten = getimagesize('datensaetze/' . $Datensatz . '.png'); + $Bild_Breite = $Bild_Daten[0]; + $Bild_H\xF6he = $Bild_Daten[1]; + unset($Bild_Daten); +# Bilddimensionen abfragen (Breite und H\xF6he) [Ende] + +# Vorgabebild in den Speicher laden +$Bild_Vorgabe = imageCreateFromPNG('datensaetze/' . $Datensatz . '.png'); + +# Leeres Bild f\xFCr Ausgabe im Speicher anlegen +$Bild_Verarbeitet = ImageCreateTrueColor($Bild_Breite + 10, $Bild_H\xF6he); +ImageSaveAlpha($Bild_Verarbeitet, true); + +# Bild mit Transparenz f\xFCllen +$Transparenz = imagecolorallocatealpha($Bild_Verarbeitet, 255, 0, 0, 127); +ImageFill($Bild_Verarbeitet, 0, 0, $Transparenz); +?> \ No newline at end of file Property changes on: templates/GUI/screens/station/create_a_laser_logo/algorithmen/laden.php ___________________________________________________________________ Added: svn:eol-style + native Added: templates/GUI/screens/station/create_a_laser_logo/datensaetze/tauseti.png =================================================================== (Binary files differ) Property changes on: templates/GUI/screens/station/create_a_laser_logo/datensaetze/tauseti.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: templates/GUI/screens/station/create_a_laser_logo/index.php =================================================================== --- templates/GUI/screens/station/create_a_laser_logo/index.php (rev 0) +++ templates/GUI/screens/station/create_a_laser_logo/index.php 2009-01-10 02:57:21 UTC (rev 916) @@ -0,0 +1,25 @@ +<? +$Durchlauf++; + +if($Durchlauf==361){ + exit; +} + +$Datensatz = 'tauseti'; + +# Seite neu laden +echo '<html><head><meta http-equiv=refresh content="0; URL=\'index.php?Durchlauf=' . $Durchlauf . '\'"></head><body>'; + +# Funktionen einladen +require('algorithmen/functions.php'); + +# Algorithmus: laden +require('algorithmen/laden.php'); + +# Algorithmus: bearbeiten +require('algorithmen/bearbeiten.php'); + +# Bild anzeigen +echo '<img src="' . $Durchlauf . '.png"></p>'; +?> +</body></html> \ No newline at end of file Property changes on: templates/GUI/screens/station/create_a_laser_logo/index.php ___________________________________________________________________ Added: svn:eol-style + native Added: templates/GUI/screens/station/create_a_laser_logo/test.htm =================================================================== --- templates/GUI/screens/station/create_a_laser_logo/test.htm (rev 0) +++ templates/GUI/screens/station/create_a_laser_logo/test.htm 2009-01-10 02:57:21 UTC (rev 916) @@ -0,0 +1,26 @@ +<html> +<head> + + <script language="JavaScript" type="text/javascript"><!-- + var Durchlauf = 0; + + function showit(){ + Durchlauf = eval(Durchlauf + 1); + + document.getElementById("Bild").src = Durchlauf + ".png"; + + if(Durchlauf==360){ + Durchlauf = 0; + } + + window.setTimeout("showit()", 15); + } + // --></script> + +</head> +<body onLoad="javascript:showit()" bgcolor=black> + + <img id=Bild> + +</body> +</html> \ No newline at end of file Property changes on: templates/GUI/screens/station/create_a_laser_logo/test.htm ___________________________________________________________________ Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ult...@us...> - 2009-01-10 02:49:26
|
Revision: 915 http://opengate.svn.sourceforge.net/opengate/?rev=915&view=rev Author: Ultrasick Date: 2009-01-10 02:49:16 +0000 (Sat, 10 Jan 2009) Log Message: ----------- Replaced the Tauseti logo by a more simplified one. Don't know but the old one was not really a logo to me. Modified Paths: -------------- templates/logos/tauseti/black_background.png templates/logos/tauseti/transparent_background.png Added Paths: ----------- templates/logos/tauseti/original.pspimage Removed Paths: ------------- templates/logos/tauseti/background.pspimage templates/logos/tauseti/original.blend Deleted: templates/logos/tauseti/background.pspimage =================================================================== (Binary files differ) Modified: templates/logos/tauseti/black_background.png =================================================================== (Binary files differ) Deleted: templates/logos/tauseti/original.blend =================================================================== (Binary files differ) Added: templates/logos/tauseti/original.pspimage =================================================================== (Binary files differ) Property changes on: templates/logos/tauseti/original.pspimage ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: templates/logos/tauseti/transparent_background.png =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ult...@us...> - 2009-01-10 02:38:03
|
Revision: 914 http://opengate.svn.sourceforge.net/opengate/?rev=914&view=rev Author: Ultrasick Date: 2009-01-10 02:37:55 +0000 (Sat, 10 Jan 2009) Log Message: ----------- forgot thouse 2 files. The meta server will tell the game servers which game server handels which sector instead of letting the game servers do that themselfs. Modified Paths: -------------- doc/network_model.odt doc/network_model.pdf Modified: doc/network_model.odt =================================================================== (Binary files differ) Modified: doc/network_model.pdf =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ult...@us...> - 2009-01-10 02:33:24
|
Revision: 913 http://opengate.svn.sourceforge.net/opengate/?rev=913&view=rev Author: Ultrasick Date: 2009-01-10 02:33:15 +0000 (Sat, 10 Jan 2009) Log Message: ----------- Rewrote the meta server. Now every interaction is done by the 2 commands "get" and "set". Uploading the new documentation. I am going to upload a new python based GUI in the next days. Just keep it in mind if you are planning to make bigger changes in this area, Carsten. Modified Paths: -------------- doc/meta_server/global_error_code_overview.odt doc/meta_server/global_error_code_overview.pdf Added Paths: ----------- doc/meta_server/get.odt doc/meta_server/get.pdf doc/meta_server/how_to_check_the_actuality_of_the_client_version.odt doc/meta_server/how_to_check_the_actuality_of_the_client_version.pdf doc/meta_server/how_to_login_the_client.odt doc/meta_server/how_to_login_the_client.pdf doc/meta_server/how_to_login_the_game_server.odt doc/meta_server/how_to_login_the_game_server.pdf doc/meta_server/how_to_logout_the_client.odt doc/meta_server/how_to_logout_the_client.pdf doc/meta_server/how_to_logout_the_game_server.odt doc/meta_server/how_to_logout_the_game_server.pdf doc/meta_server/how_to_request_a_faction_id.odt doc/meta_server/how_to_request_a_faction_id.pdf doc/meta_server/how_to_request_a_user_id.odt doc/meta_server/how_to_request_a_user_id.pdf doc/meta_server/how_to_request_the_game_server_ips.odt doc/meta_server/how_to_request_the_game_server_ips.pdf doc/meta_server/set.odt doc/meta_server/set.pdf Removed Paths: ------------- doc/meta_server/client/ doc/meta_server/game_server/ Added: doc/meta_server/get.odt =================================================================== (Binary files differ) Property changes on: doc/meta_server/get.odt ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: doc/meta_server/get.pdf =================================================================== (Binary files differ) Property changes on: doc/meta_server/get.pdf ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: doc/meta_server/global_error_code_overview.odt =================================================================== (Binary files differ) Modified: doc/meta_server/global_error_code_overview.pdf =================================================================== (Binary files differ) Added: doc/meta_server/how_to_check_the_actuality_of_the_client_version.odt =================================================================== (Binary files differ) Property changes on: doc/meta_server/how_to_check_the_actuality_of_the_client_version.odt ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: doc/meta_server/how_to_check_the_actuality_of_the_client_version.pdf =================================================================== (Binary files differ) Property changes on: doc/meta_server/how_to_check_the_actuality_of_the_client_version.pdf ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: doc/meta_server/how_to_login_the_client.odt =================================================================== (Binary files differ) Property changes on: doc/meta_server/how_to_login_the_client.odt ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: doc/meta_server/how_to_login_the_client.pdf =================================================================== (Binary files differ) Property changes on: doc/meta_server/how_to_login_the_client.pdf ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: doc/meta_server/how_to_login_the_game_server.odt =================================================================== (Binary files differ) Property changes on: doc/meta_server/how_to_login_the_game_server.odt ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: doc/meta_server/how_to_login_the_game_server.pdf =================================================================== (Binary files differ) Property changes on: doc/meta_server/how_to_login_the_game_server.pdf ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: doc/meta_server/how_to_logout_the_client.odt =================================================================== (Binary files differ) Property changes on: doc/meta_server/how_to_logout_the_client.odt ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: doc/meta_server/how_to_logout_the_client.pdf =================================================================== (Binary files differ) Property changes on: doc/meta_server/how_to_logout_the_client.pdf ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: doc/meta_server/how_to_logout_the_game_server.odt =================================================================== (Binary files differ) Property changes on: doc/meta_server/how_to_logout_the_game_server.odt ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: doc/meta_server/how_to_logout_the_game_server.pdf =================================================================== (Binary files differ) Property changes on: doc/meta_server/how_to_logout_the_game_server.pdf ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: doc/meta_server/how_to_request_a_faction_id.odt =================================================================== (Binary files differ) Property changes on: doc/meta_server/how_to_request_a_faction_id.odt ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: doc/meta_server/how_to_request_a_faction_id.pdf =================================================================== (Binary files differ) Property changes on: doc/meta_server/how_to_request_a_faction_id.pdf ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: doc/meta_server/how_to_request_a_user_id.odt =================================================================== (Binary files differ) Property changes on: doc/meta_server/how_to_request_a_user_id.odt ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: doc/meta_server/how_to_request_a_user_id.pdf =================================================================== (Binary files differ) Property changes on: doc/meta_server/how_to_request_a_user_id.pdf ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: doc/meta_server/how_to_request_the_game_server_ips.odt =================================================================== (Binary files differ) Property changes on: doc/meta_server/how_to_request_the_game_server_ips.odt ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: doc/meta_server/how_to_request_the_game_server_ips.pdf =================================================================== (Binary files differ) Property changes on: doc/meta_server/how_to_request_the_game_server_ips.pdf ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: doc/meta_server/set.odt =================================================================== (Binary files differ) Property changes on: doc/meta_server/set.odt ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: doc/meta_server/set.pdf =================================================================== (Binary files differ) Property changes on: doc/meta_server/set.pdf ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spo...@us...> - 2009-01-09 22:52:38
|
Revision: 912 http://opengate.svn.sourceforge.net/opengate/?rev=912&view=rev Author: spom_spom Date: 2009-01-09 22:52:25 +0000 (Fri, 09 Jan 2009) Log Message: ----------- add doxygen template, the inheritance diagram for OpenGate::BaseObject enlighted me to make heavy reconstruction in the next time Modified Paths: -------------- trunk/src/AiManager.cpp trunk/src/BaseObject.h trunk/src/GameStateManager.cpp trunk/src/Sector.cpp trunk/src/Sector.h trunk/src/SectorObject.h trunk/src/UnDockedState.h trunk/src/commonWithOgre.cpp trunk/src/commonWithOgre.h trunk/src/opengateclient.cpp Added Paths: ----------- trunk/doc/ trunk/doc/Doxyfile Added: trunk/doc/Doxyfile =================================================================== --- trunk/doc/Doxyfile (rev 0) +++ trunk/doc/Doxyfile 2009-01-09 22:52:25 UTC (rev 912) @@ -0,0 +1,1310 @@ +# Doxyfile 1.5.4 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project +# +# All text after a hash (#) is considered a comment and will be ignored +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" ") + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file that +# follow. The default is UTF-8 which is also the encoding used for all text before +# the first occurrence of this tag. Doxygen uses libiconv (or the iconv built into +# libc) for the transcoding. See http://www.gnu.org/software/libiconv for the list of +# possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. + +PROJECT_NAME = OpenGate + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hungarian, +# Italian, Japanese, Japanese-en (Japanese with English messages), Korean, +# Korean-en, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian, +# Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = YES + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful is your file systems +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the DETAILS_AT_TOP tag is set to YES then Doxygen +# will output the detailed description near the top, like JavaDoc. +# If set to NO, the detailed description appears after the member +# documentation. + +DETAILS_AT_TOP = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 8 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for Java. +# For instance, namespaces will be presented as packages, qualified scopes +# will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to +# include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = YES + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct (or union) is +# documented as struct with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code where the coding convention is that all structs are +# typedef'ed and only the typedef is referenced never the struct's name. + +TYPEDEF_HIDES_STRUCT = NO + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = YES + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be extracted +# and appear in the documentation as a namespace called 'anonymous_namespace{file}', +# where file will be replaced with the base name of the file that contains the anonymous +# namespace. By default anonymous namespace are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or define consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and defines in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. The default is NO. + +SHOW_DIRECTORIES = NO + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from the +# version control system). Doxygen will invoke the program by executing (via +# popen()) the command <command> <input-file>, where <command> is the value of +# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be abled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = ../src + +# This tag can be used to specify the character encoding of the source files that +# doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default +# input encoding. Doxygen uses libiconv (or the iconv built into libc) for the transcoding. +# See http://www.gnu.org/software/libiconv for the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx +# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 + +FILE_PATTERNS = + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = NO + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# directories that are symbolic links (a Unix filesystem feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the output. +# The symbol name can be a fully qualified name, a word, or if the wildcard * is used, +# a substring. Examples: ANamespace, AClass, AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command <filter> <input-file>, where <filter> +# is the value of the INPUT_FILTER tag, and <input-file> is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER +# is applied to all files. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. If you have enabled CALL_GRAPH or CALLER_GRAPH +# then you must also enable this option. If you don't then doxygen will produce +# a warning and turn it on anyway + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES (the default) +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES (the default) +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = YES + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. Otherwise they will link to the documentstion. + +REFERENCES_LINK_SOURCE = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = NO + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). + +HTML_DYNAMIC_SECTIONS = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = NO + +# This tag can be used to set the number of enum values (range [1..20]) +# that doxygen will group on one line in the generated HTML documentation. + +ENUM_VALUES_PER_LINE = 4 + +# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be +# generated containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, +# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are +# probably better off using the HTML help feature. + +GENERATE_TREEVIEW = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = YES + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, a4wide, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = NO + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = NO + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. This is useful +# if you want to understand what is going on. On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# in the INCLUDE_PATH (see below) will be search if a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all function-like macros that are alone +# on a line, have an all uppercase name, and do not end with a semicolon. Such +# function macros are typically used for boiler-plate code, and will confuse +# the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option is superseded by the HAVE_DOT option below. This is only a +# fallback. It is recommended to install and use dot, since it yields more +# powerful graphs. + +CLASS_DIAGRAMS = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see http://www.mcternan.me.uk/mscgen/) to +# produce the chart and insert it in the documentation. The MSCGEN_PATH tag allows you to +# specify the directory where the mscgen tool resides. If left empty the tool is assumed to +# be found in the default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = NO + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will +# generate a call dependency graph for every global function or class method. +# Note that enabling this option will significantly increase the time of a run. +# So in most cases it will be better to enable call graphs for selected +# functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the CALLER_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will +# generate a caller dependency graph for every global function or class method. +# Note that enabling this option will significantly increase the time of a run. +# So in most cases it will be better to enable caller graphs for selected +# functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are png, jpg, or gif +# If left blank png will be used. + +DOT_IMAGE_FORMAT = png + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The MAX_DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the number +# of direct children of the root node in a graph is already larger than +# MAX_DOT_GRAPH_NOTES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + +DOT_GRAPH_MAX_NODES = 50 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. + +MAX_DOT_GRAPH_DEPTH = 0 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, which results in a white background. +# Warning: Depending on the platform used, enabling this option may lead to +# badly anti-aliased labels on the edges of a graph (i.e. they become hard to +# read). + +DOT_TRANSPARENT = YES + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = NO + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- + +# The SEARCHENGINE tag specifies whether or not a search engine should be +# used. If set to NO the values of all tags below this one will be ignored. + +SEARCHENGINE = NO Modified: trunk/src/AiManager.cpp =================================================================== --- trunk/src/AiManager.cpp 2008-12-12 19:21:38 UTC (rev 911) +++ trunk/src/AiManager.cpp 2009-01-09 22:52:25 UTC (rev 912) @@ -32,6 +32,7 @@ #include "Avatar.h" #include "Station.h" #include "OgreSceneNode.h" +#include "networkClient.h" #include <iostream> #include <iterator> Modified: trunk/src/BaseObject.h =================================================================== --- trunk/src/BaseObject.h 2008-12-12 19:21:38 UTC (rev 911) +++ trunk/src/BaseObject.h 2009-01-09 22:52:25 UTC (rev 912) @@ -31,6 +31,7 @@ namespace OpenGate{ +#define SECTOROBJECTENVIRONMENT_RTTI 1000010 #define PROJECTILE_RTTI 100001 #define SECTOROBJECT_RTTI 100002 #define SECTOROBJECTMOVABLE_RTTI 100003 Modified: trunk/src/GameStateManager.cpp =================================================================== --- trunk/src/GameStateManager.cpp 2008-12-12 19:21:38 UTC (rev 911) +++ trunk/src/GameStateManager.cpp 2009-01-09 22:52:25 UTC (rev 912) @@ -20,35 +20,34 @@ #include "GameStateManager.h" -#include <OgreGpuProgramManager.h> -#include <OgreRoot.h> -#include <OgreRenderWindow.h> -#include <OgreConfigFile.h> -#include <OgreEntity.h> -#include <OgreWindowEventUtilities.h> -#include <OgreRenderSystemCapabilities.h> -#include <OgreRenderSystem.h> -#include <OgreMesh.h> -#include <OgreMeshManager.h> -#include <OgreMaterialManager.h> - -#include "LogManager.h" -#include "Console.h" +#include "AiManager.h" #include "Avatar.h" -#include "Sector.h" +#include "ConfigDialog.h" +#include "Console.h" +#include "DockedState.h" +#include "EntityManager.h" #include "InputManager.h" -#include "AiManager.h" -#include "Vessel.h" -#include "OpenALSoundManager.h" +#include "networkClient.h" #include "OpcodeWrapper.h" +#include "OpenALSoundManager.h" +#include "LogManager.h" +#include "Sector.h" #include "UnDockedState.h" -#include "ConfigDialog.h" -#include "EntityManager.h" +#include "Vessel.h" -#include "DockedState.h" -#include "UnDockedState.h" - +#include <OgreConfigFile.h> +#include <OgreEntity.h> #include <OgreFrameListener.h> +#include <OgreGpuProgramManager.h> +#include <OgreMaterialManager.h> +#include <OgreMesh.h> +#include <OgreMeshManager.h> +#include <OgreRenderSystem.h> +#include <OgreRenderSystemCapabilities.h> +#include <OgreRenderWindow.h> +#include <OgreRoot.h> +#include <OgreWindowEventUtilities.h> + namespace OpenGate { class NetworkClient; Modified: trunk/src/Sector.cpp =================================================================== --- trunk/src/Sector.cpp 2008-12-12 19:21:38 UTC (rev 911) +++ trunk/src/Sector.cpp 2009-01-09 22:52:25 UTC (rev 912) @@ -19,38 +19,40 @@ ***************************************************************************/ #include "Sector.h" + +#include "AiObject.h" +#include "Avatar.h" +#include "EntityManager.h" +#include "Equipment.h" #include "common.h" -#include "Avatar.h" -#include "AiObject.h" +#include "commonWithOgre.h" +#include "Missile.h" +#include "networkClient.h" #include "OpcodeWrapper.h" +#include "Planet.h" +#include "Projectile.h" #include "ResourceManager.h" -#include "Projectile.h" +#include "SectorObjectAvatar.h" +#include "SectorObjectMissile.h" +#include "SectorObjectMoveable.h" +#include "SectorObjectVessel.h" #include "Station.h" -#include "Planet.h" -#include "Equipment.h" -#include "Missile.h" #include "Vessel.h" -#include "EntityManager.h" -#include "SectorObjectMoveable.h" -#include "SectorObjectAvatar.h" -#include "SectorObjectVessel.h" -#include "SectorObjectMissile.h" #include "tinyxml/tinyxml.h" ... [truncated message content] |
From: <spo...@us...> - 2008-06-15 12:14:11
|
Revision: 910 http://opengate.svn.sourceforge.net/opengate/?rev=910&view=rev Author: spom_spom Date: 2008-06-15 05:14:18 -0700 (Sun, 15 Jun 2008) Log Message: ----------- change xml-format for sector description, it can be saved by ogeditor and loaded by the client Modified Paths: -------------- branches/ogEditor/generate_code.py branches/ogEditor/ogEditor.py branches/ogEditor/ogtest.py branches/ogEditor/python_opengate.h trunk/plugins.cfg trunk/src/Sector.cpp trunk/src/Sector.h trunk/src/SectorObject.h trunk/src/SectorObjectMoveable.cpp trunk/src/Station.cpp trunk/src/common.h trunk/src/commonWithOgre.h Added Paths: ----------- branches/ogEditor/src/OpenGateSpecs.py trunk/data/misc/test.sector Modified: branches/ogEditor/generate_code.py =================================================================== --- branches/ogEditor/generate_code.py 2008-06-11 21:08:31 UTC (rev 909) +++ branches/ogEditor/generate_code.py 2008-06-15 12:14:18 UTC (rev 910) @@ -135,10 +135,13 @@ #mb.class_( '::std::set < ::std::string >' ).alias = 'stringSet'; excludeClass( mb, [ 'deletePtr' - ,'GameStateListener' + ,'AiManager' + ,'GameStateListener' ,'GameStateManager' ,'Message' ,'MessageBodyBase' + ,'MessageBodyShipAmmoHit' + ,'MessageBodyShipDeRegister' ,'OpenALSoundSource' ] ) Modified: branches/ogEditor/ogEditor.py =================================================================== --- branches/ogEditor/ogEditor.py 2008-06-11 21:08:31 UTC (rev 909) +++ branches/ogEditor/ogEditor.py 2008-06-15 12:14:18 UTC (rev 910) @@ -14,18 +14,12 @@ import wx.lib.customtreectrl as CT -from ObjectInspectorPanels import * -from ResourceTreePane import * +from ObjectInspectorPanels import * +from ResourceTreePane import * -from OgreWindowWx import * +from OgreWindowWx import * +from SectorXMLWriter import * -try: - import opengate as og - haveOpenGatePlugin = True -except: - haveOpenGatePlugin = False - pass - ID_MB_FILE_EXIT = wx.NewId() ID_MB_VIEW_SCENETREE = wx.NewId() ID_MB_VIEW_OBJECT = wx.NewId() @@ -45,69 +39,10 @@ activeResource = None; def __init__(self): Pass - -class Opengate: - resourceManager_ = None - - def __init__( self, OgreWindow ): - self.resourceManager_ = og.ResourceManager() - self.resourceManager_.logManager = og.LogManager() - self.resourceManager_.entityManager = og.EntityManager( ) - self.resourceManager_.ogreRoot = OgreWindow.ogreRoot - self.resourceManager_.renderWindow = OgreWindow.renderWindow +from OpenGateSpecs import * - OgreWindow.AddResources( "opengate-resources.cfg" ) - ogre.ResourceGroupManager.getSingleton().initialiseResourceGroup( "Opengate" ) - - for res in OgreWindow.resourceLocations: - self.resourceManager_.addResourceLocation( res[0], res[1] ) - - def initOpenGateResources_( self ): - self.resourceManager_.loadGlobalIDs( "ids.xml" ) - entityManager = self.resourceManager_.entityManager - entityManager.load( self.resourceManager_.resourceLocations( "Opengate" ), "commodities" ); - entityManager.load( self.resourceManager_.resourceLocations( "Opengate" ), "engines" ); - entityManager.load( self.resourceManager_.resourceLocations( "Opengate" ), "capacitors" ); - entityManager.load( self.resourceManager_.resourceLocations( "Opengate" ), "radars" ); - entityManager.load( self.resourceManager_.resourceLocations( "Opengate" ), "shields" ); - entityManager.load( self.resourceManager_.resourceLocations( "Opengate" ), "ecms" ); - entityManager.load( self.resourceManager_.resourceLocations( "Opengate" ), "power_plants" ); - entityManager.load( self.resourceManager_.resourceLocations( "Opengate" ), "guns" ); - entityManager.load( self.resourceManager_.resourceLocations( "Opengate" ), "missiles" ); - entityManager.load( self.resourceManager_.resourceLocations( "Opengate" ), "ships" ); - entityManager.load( self.resourceManager_.resourceLocations( "Opengate" ), "stations" ); - - def getName( self ): - return "Opengate" - - def fillProperties( self, objectInspectorPanel ): - objectInspectorPanel.typeStaticText.SetLabel( "Opengate" ) - shaderSchemes = ( "Default", "vpOnly", "vpfp" ) - vp = self.resourceManager_.renderWindow.getViewport( 0 ) - self.interpolModeChosser = objectInspectorPanel.propertyGrid.appendRowItemChoice( "shader scheme", - value = "Default", - itemList = shaderSchemes, - cback = vp.setMaterialScheme ) - - def AddToResourcesTree( self, tree, node): - - if self.resourceManager_: - ogResManNode = tree.AppendItem( node, "OpenGate resource manager" ) - - if self.resourceManager_.entityManager: - ogEntityManagerNode = tree.AppendItem( ogResManNode, "Entity manager" ) - categories = self.resourceManager_.entityManager.categories(); - - for category in categories: - categoryNode = tree.AppendItem( ogEntityManagerNode, category ) - - - def AddToSceneGraph( self, tree, node ): - opengateNode = tree.AppendItem( node, "Opengate" ) - tree.SetPyData( opengateNode, self ) - class DropData(wx.CustomDataObject): def __init__(self): wx.CustomDataObject.__init__(self, wx.CustomDataFormat("MyDropData")) @@ -230,8 +165,8 @@ ws = WorkSpace self.allPanes = [] self.allPanes.append( OGEditorPane( ID_MB_VIEW_SCENETREE, NAME_SCENETREE, "\tF1", None, True ) ) - self.allPanes.append( OGEditorPane( ID_MB_VIEW_OBJECT, NAME_OBJECT , "\tF2", None, False ) ) - self.allPanes.append( OGEditorPane( ID_MB_VIEW_RESOURCE, NAME_RESOURCE , "\tF3", None, True ) ) + self.allPanes.append( OGEditorPane( ID_MB_VIEW_OBJECT, NAME_OBJECT , "\tF2", None, True ) ) + self.allPanes.append( OGEditorPane( ID_MB_VIEW_RESOURCE, NAME_RESOURCE , "\tF3", None, False ) ) self.allPanes.append( OGEditorPane( ID_MB_VIEW_MATERIAL, NAME_MATERIAL , "\tF4", None, False ) ) self.allPanes.append( OGEditorPane( ID_MB_VIEW_PYCRUST, NAME_PYCRUST , "\tF9", None, False ) ) @@ -379,9 +314,9 @@ self.resourceTree = ResourceTreePane( self, -1, wx.Point( 0, 0 ), wx.Size( 160, 250 ), wx.TR_DEFAULT_STYLE | wx.NO_BORDER ); self.Bind( wx.EVT_TREE_SEL_CHANGED, self.doSelectTreeObject, self.resourceTree ) - self.resourceTree.Bind( wx.EVT_TREE_BEGIN_DRAG, self.OnBeginDrag ) - self.resourceTree.Bind( wx.EVT_TREE_BEGIN_RDRAG, self.OnBeginRDrag ) - self.resourceTree.Bind( wx.EVT_TREE_END_DRAG, self.OnEndDrag ) + self.resourceTree.Bind( wx.EVT_TREE_BEGIN_DRAG, self.OnBeginDrag ) + self.resourceTree.Bind( wx.EVT_TREE_BEGIN_RDRAG, self.OnBeginRDrag ) + self.resourceTree.Bind( wx.EVT_TREE_END_DRAG, self.OnEndDrag ) return self.resourceTree def setDefaultProperties_( self ): Modified: branches/ogEditor/ogtest.py =================================================================== --- branches/ogEditor/ogtest.py 2008-06-11 21:08:31 UTC (rev 909) +++ branches/ogEditor/ogtest.py 2008-06-15 12:14:18 UTC (rev 910) @@ -33,18 +33,21 @@ global ogResourceManager - self.ogreRenderWindow = OgreWindow( self, ID = -1, ogResourceMan = ogResourceManager ) + self.ogreRenderWindow = OgreWindow( self, ID = -1 ) + self.ogreRenderWindow.AddResources( "opengate-resources.cfg" ) + ogre.ResourceGroupManager.getSingleton().initialiseResourceGroup( "Opengate" ) - mops = og.Mops(); - print mops.name() - print mops.getVec() - ogLog = og.LogManager(); ogResourceManager.logManager = ogLog + + + for res in self.ogreRenderWindow.resourceLocations: + ogResourceManager.addResourceLocation( res[0], res[1] ) + ogResourceManager.loadGlobalIDs( "ids.xml" ); entityManager = og.EntityManager( ) ogResourceManager.entityManager = entityManager - entityManager.load( ogResourceManager.resourceLocations( "General" ), "commodities" ); + entityManager.load( ogResourceManager.resourceLocations( "Opengate" ), "commodities" ); self.SetMenuBar( self.mb ) self.Bind( wx.EVT_MENU, self.doExit, id = wx.ID_EXIT ) Modified: branches/ogEditor/python_opengate.h =================================================================== --- branches/ogEditor/python_opengate.h 2008-06-11 21:08:31 UTC (rev 909) +++ branches/ogEditor/python_opengate.h 2008-06-15 12:14:18 UTC (rev 910) @@ -47,21 +47,6 @@ // #include "networkClient.h" //#include "networkProtocol.h" -namespace OpenGate{ - class Mops{ - public: - Mops(){} - std::string name(){ return "Mops";} - Ogre::Vector3 getVec(){ return pos_;} - void * voidPtr(){ return NULL; } - void vec( const Ogre::Vector3 & pos ){ - std::cout << pos << std::endl; - } - private: - Ogre::Vector3 pos_; - }; -} - //First we create a magic namespace to hold all our aliases namespace pyplusplus { namespace aliases { #include "python_opengate_aliases.h" Added: branches/ogEditor/src/OpenGateSpecs.py =================================================================== --- branches/ogEditor/src/OpenGateSpecs.py (rev 0) +++ branches/ogEditor/src/OpenGateSpecs.py 2008-06-15 12:14:18 UTC (rev 910) @@ -0,0 +1,222 @@ +import sys +from OgreWindowWx import * + +try: + import opengate as og + haveOpenGatePlugin = True +except: + haveOpenGatePlugin = False + pass + +class Opengate: + resourceManager_ = None + sceneTree_ = None + + def __init__( self, OgreWindow ): + + self.resourceManager_ = og.ResourceManager() + self.resourceManager_.logManager = og.LogManager() + self.resourceManager_.entityManager = og.EntityManager( ) + self.resourceManager_.ogreRoot = OgreWindow.ogreRoot + self.resourceManager_.renderWindow = OgreWindow.renderWindow + + OgreWindow.AddResources( "opengate-resources.cfg" ) + ogre.ResourceGroupManager.getSingleton().initialiseResourceGroup( "Opengate" ) + + for res in OgreWindow.resourceLocations: + self.resourceManager_.addResourceLocation( res[0], res[1] ) + + def initOpenGateResources_( self ): + self.resourceManager_.loadGlobalIDs( "ids.xml" ) + entityManager = self.resourceManager_.entityManager + entityManager.load( self.resourceManager_.resourceLocations( "Opengate" ), "commodities" ); + entityManager.load( self.resourceManager_.resourceLocations( "Opengate" ), "engines" ); + entityManager.load( self.resourceManager_.resourceLocations( "Opengate" ), "capacitors" ); + entityManager.load( self.resourceManager_.resourceLocations( "Opengate" ), "radars" ); + entityManager.load( self.resourceManager_.resourceLocations( "Opengate" ), "shields" ); + entityManager.load( self.resourceManager_.resourceLocations( "Opengate" ), "ecms" ); + entityManager.load( self.resourceManager_.resourceLocations( "Opengate" ), "power_plants" ); + entityManager.load( self.resourceManager_.resourceLocations( "Opengate" ), "guns" ); + entityManager.load( self.resourceManager_.resourceLocations( "Opengate" ), "missiles" ); + entityManager.load( self.resourceManager_.resourceLocations( "Opengate" ), "ships" ); + entityManager.load( self.resourceManager_.resourceLocations( "Opengate" ), "stations" ); + + def getName( self ): + return "Opengate" + + def fillProperties( self, objectInspectorPanel ): + objectInspectorPanel.typeStaticText.SetLabel( "Opengate" ) + shaderSchemes = ( "Default", "vpOnly", "vpfp" ) + vp = self.resourceManager_.renderWindow.getViewport( 0 ) + self.interpolModeChosser = objectInspectorPanel.propertyGrid.appendRowItemChoice( "shader scheme", + value = "Default", + itemList = shaderSchemes, + cback = vp.setMaterialScheme ) + objectInspectorPanel.propertyGrid.appendRowItemFileSelect("Load sector", cback = self.LoadSectorScene, + toolTip = "Load sector", wildcard = "*.sector") + objectInspectorPanel.propertyGrid.appendRowItemFileSelect("Save sector", cback = self.SaveSectorScene, + toolTip = "Save scene", wildcard = "*.sector") + + def AddToResourcesTree( self, tree, node): + self.sceneTree_ = tree; + if self.resourceManager_: + ogResManNode = tree.AppendItem( node, "OpenGate resource manager" ) + + if self.resourceManager_.entityManager: + ogEntityManagerNode = tree.AppendItem( ogResManNode, "Entity manager" ) + categories = self.resourceManager_.entityManager.categories(); + + for category in categories: + categoryNode = tree.AppendItem( ogEntityManagerNode, category ) + + + def AddToSceneGraph( self, tree, node ): + opengateNode = tree.AppendItem( node, "Opengate" ) + tree.SetPyData( opengateNode, self ) + + def SaveSectorScene( self, name ): + out = open( name, 'w') + #out = sys.stdout + sectorWriter = SectorXMLWriter( out, 'utf-8') + sectorWriter.writeEnvironment( self.sector.sceneManager() ) + #sectorWriter.writeStation("test-station") + #sectorWriter.writeNode("test") + + for obj in self.sector.sectorObjects(): + sectorWriter.writeObject( obj ) + + sectorWriter.close() + print "save sector", name + + def LoadSectorScene( self, name ): + print "load sector", name + +from xml.sax import saxexts, saxlib, saxutils +from xml.sax.saxutils import XMLGenerator +from xml.sax.xmlreader import AttributesImpl +from xml.sax.xmlreader import AttributesNSImpl +import string + +class SectorXMLWriter(): + def __init__( self, output, encoding): + + self.logger_ = XMLGenerator( output, encoding ) + self.logger_.startDocument() + attrs = AttributesImpl({ + u'name': 'testsector' + }) + self.logger_.startElement( u'sector',attrs) + self.logger_.characters("\n") + + def writeEnvironment( self, sceneManager ): + attrs = AttributesImpl({ u'skybox': "OpenGate/SimpleSkyBox3" }) + self.logger_.startElement( u'environment', attrs) + self.logger_.characters("\n") + self.writeColour( u'ambient', sceneManager.getAmbientLight() ) + self.logger_.endElement( u'environment' ) + self.logger_.characters("\n") + + def writeObject( self, obj ): + if type( obj ) == og.StationObject: + self.writeStation( obj ) + elif type( obj ) == og.BeaconObject: + self.writeBeacon( obj ) + else: + self.writeSectorObject( obj ) + + def writeStation( self, obj ): + attrs = AttributesImpl({ u'name': obj.name() }) + self.logger_.startElement( u'station', attrs) + self.logger_.characters("\n") + self.writeVec3( u'position', obj.mainNode().getWorldPosition() ) + #self.writeVec3( u'direction', obj.mainNode().getDirection() ) + #self.writeVec3( u'scale', obj.mainNode().getScale() ) + #self.writeEntity( u'mesh.mesh' ) + self.logger_.endElement( u'station' ) + self.logger_.characters("\n") + + def writeBeacon( self, obj ): + attrs = AttributesImpl({}) + self.logger_.startElement( u'beacon', attrs) + self.logger_.characters("\n") + self.writeVec3( u'position', obj.mainNode().getWorldPosition() ) + #self.writeVec3( u'direction', obj.mainNode().getDirection() ) + #self.writeVec3( u'scale', obj.mainNode().getScale() ) + self.logger_.endElement( u'beacon') + self.logger_.characters("\n") + + def writeSectorObject( self, obj ): + attrs = AttributesImpl({u'name': obj.name() }) + self.logger_.startElement( u'sectorobject', attrs) + self.logger_.characters("\n") + self.writeVec3( u'position', obj.mainNode().getWorldPosition() ) + #self.writeVec3( u'direction', obj.mainNode().getDirection() ) + self.writeVec3( u'scale', obj.scaleNode().getScale() ) + self.writeEntity( obj.entity() ) + self.logger_.endElement( u'sectorobject') + self.logger_.characters("\n") + + def writeNode( self, name ): + + attrs = AttributesImpl({ + u'name': name }) + + self.logger_.startElement( u'node', attrs) + self.logger_.characters("\n") + self.writeVec3( u'position', [0,0,0] ) + self.writeVec3( u'scale', [1.0, 1.1, 1.0] ) + self.writeQuat( u'rotation', [0.0, 0.0, 0.0, 1.0] ) + #self.writeEntity( u'mesh.mesh' ) + #self.logger_.characters("msg") + self.logger_.endElement( u'node' ) + self.logger_.characters("\n") + + def writeVec3( self, name, vec): + attrs = AttributesImpl({ + u'x': "%g"%vec[0], + u'y': "%g"%vec[1], + u'z': "%g"%vec[2] + }) + self._writeElement( name, attrs ) + + def writeQuat( self, name, quat): + attrs = AttributesImpl({ + u'x': "%g"%quat[0], + u'y': "%g"%quat[1], + u'z': "%g"%quat[2], + u'w': "%g"%quat[3] + }) + self._writeElement( name, attrs ) + + def writeColour( self, name, quat): + attrs = AttributesImpl({ + u'r': "%g"%quat[0], + u'g': "%g"%quat[1], + u'b': "%g"%quat[2], + u'a': "%g"%quat[3] + }) + self._writeElement( name, attrs ) + + def writeEntity( self, entity): + nSubEnt= entity.getNumSubEntities() + atts = { + u'meshFile': entity.getMesh().getName(), + u'numSubEntities': "%d"%nSubEnt + } + + for i in range(0,nSubEnt): + atts[u'material-%d'%i] = entity.getSubEntity( i ).getMaterialName() + + attrs = AttributesImpl( atts ) + + self._writeElement( "entity", attrs ) + + def _writeElement( self, name, attrs ): + self.logger_.startElement( name, attrs) + self.logger_.endElement( name) + self.logger_.characters("\n") + + def close( self ): + self.logger_.endElement( u'sector') + self.logger_.characters("\n") + self.logger_.endDocument() \ No newline at end of file Added: trunk/data/misc/test.sector =================================================================== --- trunk/data/misc/test.sector (rev 0) +++ trunk/data/misc/test.sector 2008-06-15 12:14:18 UTC (rev 910) @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="utf-8"?> +<sector name="testsector"> +<environment skybox="OpenGate/SimpleSkyBox3"> +<ambient a="1" r="0.1" b="0.1" g="0.1"></ambient> +</environment> +<station name="Tauseti Wake"> +<position y="0" x="0" z="-1480"></position> +</station> +<sectorobject name="ring"> +<position y="100" x="-650" z="800"></position> +<scale y="35" x="35" z="35"></scale> +<entity meshFile="ring.mesh" material-0="ring/main" numSubEntities="1"></entity> +</sectorobject> +<beacon> +<position y="0" x="-650" z="800"></position> +</beacon> +<sectorobject name="astro with bump"> +<position y="0" x="-250" z="440"></position> +<scale y="20" x="20" z="20"></scale> +<entity meshFile="asteroid01.mesh" material-0="Asteroid/BumpMapping" numSubEntities="1"></entity> +</sectorobject> +<sectorobject name="astro without bump"> +<position y="0" x="-250" z="500"></position> +<scale y="20" x="20" z="20"></scale> +<entity meshFile="asteroid01.mesh" material-0="Asteroid" numSubEntities="1"></entity> +</sectorobject> +</sector> Modified: trunk/plugins.cfg =================================================================== --- trunk/plugins.cfg 2008-06-11 21:08:31 UTC (rev 909) +++ trunk/plugins.cfg 2008-06-15 12:14:18 UTC (rev 910) @@ -6,5 +6,5 @@ # Define D3D rendering implementation plugin Plugin=RenderSystem_GL.so Plugin=Plugin_ParticleFX.so -#Plugin=Plugin_CgProgramManager.so +Plugin=Plugin_CgProgramManager.so Modified: trunk/src/Sector.cpp =================================================================== --- trunk/src/Sector.cpp 2008-06-11 21:08:31 UTC (rev 909) +++ trunk/src/Sector.cpp 2008-06-15 12:14:18 UTC (rev 910) @@ -42,6 +42,7 @@ #include <OgreOverlayManager.h> #include <OgreOverlayContainer.h> #include <OgreSceneNode.h> +#include <OgreSubEntity.h> #include <OgreEntity.h> #include <OgreRoot.h> #include <OgreRenderSystemCapabilities.h> @@ -125,12 +126,12 @@ //*** end starfield test 2; - Ogre::Light * mainLight = sceneMgr_->createLight("MainLight" ); - mainLight->setDiffuseColour( 0.1, 0.1, 0.1 ); - mainLight->setSpecularColour( 0.4, 0.4, 0.4 ); - mainLight->setPosition(-50000, 0, -40000 ); +// Ogre::Light * mainLight = sceneMgr_->createLight("MainLight" ); +// mainLight->setDiffuseColour( 0.1, 0.1, 0.1 ); +// mainLight->setSpecularColour( 0.4, 0.4, 0.4 ); +// mainLight->setPosition(-50000, 0, -40000 ); - sceneMgr_->setAmbientLight( Ogre::ColourValue( 0.1, 0.1, 0.1 ) ); + // sceneMgr_->setAmbientLight( Ogre::ColourValue( 0.1, 0.1, 0.1 ) ); if ( 1 ) { // planet_ = new Planet( "planet", sceneMgr_, Ogre::Vector3( 20000.0, 10000.0, 40000 ), 15000.0f, 32 ); @@ -139,7 +140,7 @@ } - populate( "testsector.xml" ); + populate( "test.sector" ); createKoordAxis( ); } @@ -181,41 +182,110 @@ } void Sector::populate( const std::string & fileName ){ - TiXmlDocument doc( ResourceManager::getSingleton().findFullFileName( fileName ) ); - bool loadOkay = doc.LoadFile(); + TiXmlDocument doc( ResourceManager::getSingleton().findFullFileName( fileName ) ); + bool loadOkay = doc.LoadFile(); - if ( !loadOkay ) { - log_->fatal( std::string( "Failed to load sector file: " + fileName ) ); - return; - } + if ( !loadOkay ) { + log_->fatal( std::string( "Failed to load sector file: " + fileName ) ); + return; + } - TiXmlHandle docHandle( &doc ); - TiXmlElement *pElem, *pSubElem; - TiXmlHandle hRoot( 0 ); + TiXmlHandle docHandle( &doc ); + TiXmlElement *pElem, *pSubElem; + TiXmlHandle hRoot( 0 ); - pElem = docHandle.FirstChildElement().Element(); - hRoot = TiXmlHandle( pElem ); + pElem = docHandle.FirstChildElement().Element(); + hRoot = TiXmlHandle( pElem ); - if ( !pElem ) { - log_->fatal( fileName + " cannot read first node." ); - return; - } + if ( !pElem ) { + log_->fatal( fileName + " cannot read first node." ); + return; + } - if ( strcmp( "sector", pElem->Value() ) != 0 ) { - log_->fatal( fileName + " is no sector description" ); + if ( strcmp( "sector", pElem->Value() ) != 0 ) { + log_->fatal( fileName + " is no sector description" ); + return; + } + readXMLAttribute< std::string >( pElem, "name_en name", this, &OpenGate::Sector::setName, false ); + + pElem = hRoot.ChildElement( "environment", 0 ).Element(); + if ( pElem ){ + readXMLAttribute< std::string >( pElem, "skybox", this, &OpenGate::Sector::setSkyBox, false ); + readXMLColourElement( pElem, "ambient", sceneMgr_, &Ogre::SceneManager::setAmbientLight, false ); + } + + pElem = hRoot.ChildElement( "station", 0 ).Element(); + if ( pElem ){ + std::string name; readXMLAttribute < std::string >( pElem, "name", name ); + Ogre::Vector3 pos( readXMLVec3Element( pElem, "position" ) ); + SectorObject *obj = createStation( name, pos ); + } + + pElem = hRoot.ChildElement( "beacon", 0 ).Element(); + if ( pElem ){ + Ogre::Vector3 pos( readXMLVec3Element( pElem, "position" ) ); + Ogre::Vector3 dir( readXMLVec3Element( pElem, "direction" ) ); + SectorObject * obj = createBeacon( pos ); + obj->mainNode()->setDirection( dir ); + } + + for ( pElem = hRoot.FirstChild( "sectorobject" ).Element(); pElem != 0; pElem = pElem->NextSiblingElement("sectorobject") ) { + std::string name; readXMLAttribute < std::string >( pElem, "name", name ); + Ogre::Vector3 pos( readXMLVec3Element( pElem, "position" ) ); + Ogre::Vector3 scale( readXMLVec3Element( pElem, "scale" ) ); + + TiXmlElement * pElemChild = pElem->FirstChildElement( "entity" ); + + if ( pElemChild ){ + std::string mesh; readXMLAttribute < std::string >( pElemChild, "meshFile", mesh ); + SectorObject * obj = createStaticObject( mesh, name, pos ); + if ( scale != Ogre::Vector3::ZERO ){ + obj->scale( scale ); + } + int nSubEnt = 0; readXMLAttribute < int >( pElemChild, "numSubEntities", nSubEnt ); + + for ( int i = 0; i < nSubEnt; i ++ ){ + std::string matName; readXMLAttribute < std::string >( pElemChild, "material-"+toStr( i ), matName ); + obj->entity()->getSubEntity( i )->setMaterialName( matName ); + } + + } else{ + std::cerr << "no entity found for sectorobject: " << name << std::endl; + } + } + return; - } - readXMLNode< std::string >( hRoot, "name_en name", this, &OpenGate::Sector::setName, false ); - pElem = hRoot.ChildElement( "skybox", 0 ).Element(); - if ( pElem ){ - sceneMgr_->setSkyBox( true, pElem->FirstChild()->Value(), 10000 ); - } else{ - sceneMgr_->setSkyBox( true, "OpenGate/SimpleSkyBox1" ); - } - -// pElem = hRoot.ChildElement( "vesselschool", 0 ).Element(); +// for ( pElem = hRoot.FirstChild( "station" ).Element(); pElem != 0; pElem = pElem->NextSiblingElement("station") ) { +// std::string name; +// pSubElem = pElem->FirstChildElement( "name" ); +// if ( pSubElem ){ +// name = pSubElem->FirstChild()->Value(); +// } else { +// log_->warn( "missing name for station " ); +// continue; +// } +// Ogre::Vector3 pos( 0.0, 0.0, 0.0); +// pSubElem = pElem->FirstChildElement( "position" ); +// if ( pSubElem ){ +// pos = Ogre::Vector3( &toVector3( pSubElem->FirstChild()->Value(), ',' )[ 0 ] ); +// } else { +// log_->warn( "missing pos for station " + name ); +// continue; +// } +// SectorObject *obj = createStation( name, pos ); +// +// Ogre::Vector3 targetDirection( 0.0, 0.0, 0.0); +// pSubElem = pElem->FirstChildElement( "direction" ); +// if ( pSubElem ){ +// targetDirection = Ogre::Vector3( &toVector3( pSubElem->FirstChild()->Value(), ',' )[0]); +// Ogre::Quaternion rot = ( obj->mainNode()->getOrientation().zAxis()* -1.0).getRotationTo( targetDirection ); +// obj->mainNode()->rotate( rot ); +// } +// } + + // pElem = hRoot.ChildElement( "vesselschool", 0 ).Element(); // if ( pElem ){ // std::string schoolclass( pElem->FirstChild()->Value() ); // @@ -241,34 +311,8 @@ // } //** Load stations - for ( pElem = hRoot.FirstChild( "station" ).Element(); pElem != 0; pElem = pElem->NextSiblingElement("station") ) { - std::string name; - pSubElem = pElem->FirstChildElement( "name" ); - if ( pSubElem ){ - name = pSubElem->FirstChild()->Value(); - } else { - log_->warn( "missing name for station " ); - continue; - } - Ogre::Vector3 pos( 0.0, 0.0, 0.0); - pSubElem = pElem->FirstChildElement( "position" ); - if ( pSubElem ){ - pos = Ogre::Vector3( &toVector3( pSubElem->FirstChild()->Value(), ',' )[ 0 ] ); - } else { - log_->warn( "missing pos for station " + name ); - continue; - } - SectorObject *obj = createStation( name, pos ); - - Ogre::Vector3 targetDirection( 0.0, 0.0, 0.0); - pSubElem = pElem->FirstChildElement( "direction" ); - if ( pSubElem ){ - targetDirection = Ogre::Vector3( &toVector3( pSubElem->FirstChild()->Value(), ',' )[0]); - Ogre::Quaternion rot = ( obj->mainNode()->getOrientation().zAxis()* -1.0).getRotationTo( targetDirection ); - obj->mainNode()->rotate( rot ); - } - } + //** load beacon pElem = hRoot.FirstChild( "beacon" ).Element(); if ( pElem ){ @@ -374,6 +418,10 @@ } } +void Sector::setSkyBox( const std::string & name ){ + sceneMgr_->setSkyBox( true, name, 10000 ); +} + void Sector::update( Ogre::Real elapsedTime ){ if ( ResourceManager::getSingleton().collisionManager ) ResourceManager::getSingleton().collisionManager->update( elapsedTime ); Modified: trunk/src/Sector.h =================================================================== --- trunk/src/Sector.h 2008-06-11 21:08:31 UTC (rev 909) +++ trunk/src/Sector.h 2008-06-15 12:14:18 UTC (rev 910) @@ -53,8 +53,10 @@ void populate( const std::string & fileName ); + void setSkyBox( const std::string & name ); + void setListener( UnDockedState * listener ){ listener_ = listener; } - + UnDockedState * listener( ){ return listener_; } /*! Set the name of this sector */ @@ -80,6 +82,8 @@ SectorObjectMissile * createMissile( const Ogre::String & name, Uint32 userId, Uint8 childId, Missile & missile ); + std::set< SectorObject * > sectorObjects() const { return sectorObjects_; } + void createAvatarObject( Avatar & avatar ); SectorObjectAvatar * avatarObject() { return avatar_; } Modified: trunk/src/SectorObject.h =================================================================== --- trunk/src/SectorObject.h 2008-06-11 21:08:31 UTC (rev 909) +++ trunk/src/SectorObject.h 2008-06-15 12:14:18 UTC (rev 910) @@ -55,8 +55,10 @@ /*! Return pointer to the active sector.*/ Sector * sector() { return sector_; } - Ogre::SceneNode * rotnode() { return mainNodeEntityRot_;} + Ogre::SceneNode * rotNode() { return mainNodeEntityRot_;} + Ogre::SceneNode * scaleNode() { return mainNodeEntityScale_;} + virtual bool update( Ogre::Real elapsedTime ){ return true; } void setShape( const Ogre::String & meshname ); Modified: trunk/src/SectorObjectMoveable.cpp =================================================================== --- trunk/src/SectorObjectMoveable.cpp 2008-06-11 21:08:31 UTC (rev 909) +++ trunk/src/SectorObjectMoveable.cpp 2008-06-15 12:14:18 UTC (rev 910) @@ -397,7 +397,7 @@ int nEmits = thrusterParticles_->getNumEmitters( ); // Ogre::Real thrustRate = 0.0; // if ( maxThrust() > 0 ) thrustRate = (float)thrust_ / maxThrust_ * 100.0; - std::cout << "SectorObjectMoveable::updateThruster()" << name_ << " " << thrustRate_ << " " << nEmits << std::endl; + //std::cout << "SectorObjectMoveable::updateThruster()" << name_ << " " << thrustRate_ << " " << nEmits << std::endl; for ( int i = 0; i < nEmits; i ++ ){ Ogre::ParticleEmitter * pEmit; Modified: trunk/src/Station.cpp =================================================================== --- trunk/src/Station.cpp 2008-06-11 21:08:31 UTC (rev 909) +++ trunk/src/Station.cpp 2008-06-15 12:14:18 UTC (rev 910) @@ -77,7 +77,7 @@ } Pad::Pad( const std::string & name, SectorObject * parent, Ogre::SubEntity * padSubEntity ) - : BaseObject( name, parent->sector(), 0, 0, parent->rotnode() ), parent_( parent ){ + : BaseObject( name, parent->sector(), 0, 0, parent->rotNode() ), parent_( parent ){ padManualObject_ = sceneMgr_->createManualObject( mainNode_->getName() + "/ManualObject" ); Modified: trunk/src/common.h =================================================================== --- trunk/src/common.h 2008-06-11 21:08:31 UTC (rev 909) +++ trunk/src/common.h 2008-06-15 12:14:18 UTC (rev 910) @@ -282,10 +282,47 @@ return results.size(); } -struct deletePtr{ - template < typename T > void operator()( T * p ) { delete p; p = NULL; } -}; +struct deletePtr{ template < typename T > void operator()( T * p ) { delete p; p = NULL; } }; +template < class ValueType > +bool readXMLAttribute( TiXmlElement * pElem, const std::string & name, ValueType & val ){ + std::vector < std::string > names( getSubstrings( name ) ); + for ( uint i = 0; i < names.size(); i ++ ) { + if ( pElem->Attribute( names[ i ] ) ){ + val = to< ValueType >( *pElem->Attribute( names[ i ] ) ); + return true; + } + } + return false; +} + +/*! Read a single xml-element with a given key and fill associated object properties. +If the mandatory flag is set, a std::invalid_argument exception is thrown when the node can not be found.*/ +template < class ValueType, class Class, class Method > +bool readXMLAttribute( TiXmlElement * pElem, const std::string & name, Class * obj, Method method, bool mandatory ){ + +// std::vector < std::string > names( getSubstrings( name ) ); +// +// for ( uint i = 0; i < names.size(); i ++ ) { +// if ( pElem->Attribute( names[ i ] ) ){ +// (obj->*method)( to< ValueType >( *pElem->Attribute( names[ i ] ) ) ); +// return true; +// } +// } + + ValueType val; + bool ret = readXMLAttribute< ValueType >( pElem, name, val ); + if ( ret ){ + (obj->*method)( val ); + return true; + } + + if ( mandatory ){ + throw std::invalid_argument( "Missing mandatory xml node " + name + " for entity " + obj->name() ); + } + return false; +} + /*! Read a single xml-node with a given key and fill associated object properties. If the mandatory flag is set, a std::invalid_argument exception is thrown when the node can not be found.*/ template < class ValueType, class Class, class Method > Modified: trunk/src/commonWithOgre.h =================================================================== --- trunk/src/commonWithOgre.h 2008-06-11 21:08:31 UTC (rev 909) +++ trunk/src/commonWithOgre.h 2008-06-15 12:14:18 UTC (rev 910) @@ -32,12 +32,14 @@ #ifndef _OPENGATE_COMMONWITHOGRE__H #define _OPENGATE_COMMONWITHOGRE__H +#include "tinyxml/tinyxml.h" #include "common.h" #include "networkProtocol.h" #include <OgrePrerequisites.h> #include <OgreVector3.h> #include <OgreQuaternion.h> +#include <OgreColourValue.h> namespace OpenGate{ @@ -54,7 +56,46 @@ /*! For debugging purposes dump scene node tree to a string */ std::string dumpSceneNodes( Ogre::Node * n ); + + +/*! Specialization of readXMLAttribute.*/ +template < class Class, class Method > +bool readXMLColourElement( TiXmlElement * pElem, const std::string & name, Class * obj, Method method, bool mandatory ){ + std::vector < std::string > names( getSubstrings( name ) ); + + TiXmlElement * pElemChild = pElem->FirstChildElement( name ); + if ( pElemChild ){ + if ( pElemChild->Attribute( "r" ) && pElemChild->Attribute( "g" ) && + pElemChild->Attribute( "b" ) && pElemChild->Attribute( "a" ) ){ + Ogre::ColourValue col( to< float >( pElemChild->Attribute( "r" ) ), to< float >( pElemChild->Attribute( "g" ) ), + to< float >( pElemChild->Attribute( "b" ) ), to< float >( pElemChild->Attribute( "a" ) ) ); + (obj->*method)( col ); + return true; + } + } + if ( mandatory ){ + throw std::invalid_argument( "Missing mandatory xml node " + name + " for " ); + } + return false; +} +inline Ogre::Vector3 readXMLVec3Element( TiXmlElement * pElem, const std::string & name, bool mandatory = false ){ + + TiXmlElement * pElemChild = pElem->FirstChildElement( name ); + if ( pElemChild ){ + if ( pElemChild->Attribute( "x" ) && pElemChild->Attribute( "y" ) && pElemChild->Attribute( "z" ) ){ + Ogre::Vector3 vec( to< float >( pElemChild->Attribute( "x" ) ), to< float >( pElemChild->Attribute( "y" ) ), + to< float >( pElemChild->Attribute( "z" ) ) ); + return vec; + } + } + + if ( mandatory ){ + throw std::invalid_argument( "Missing mandatory xml node " + name ); + } + return Ogre::Vector3::ZERO; +} + } // namespace OpenGate #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eg...@us...> - 2008-06-11 21:08:44
|
Revision: 909 http://opengate.svn.sourceforge.net/opengate/?rev=909&view=rev Author: egore Date: 2008-06-11 14:08:31 -0700 (Wed, 11 Jun 2008) Log Message: ----------- Add a nice little .gitignore Added Paths: ----------- trunk/.gitignore Added: trunk/.gitignore =================================================================== --- trunk/.gitignore (rev 0) +++ trunk/.gitignore 2008-06-11 21:08:31 UTC (rev 909) @@ -0,0 +1,21 @@ +*.o +Makefile +Makefile.in +*.log +config.guess +config.h +config.h.in +config.status +config.sub +configure +stamp-h1 +.deps +aclocal.m4 +autom4te.cache +.anjuta +*.cache +libtool +ltmain.sh +TODO.tasks +opengateclient +opengateserver This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eg...@us...> - 2008-06-11 21:07:35
|
Revision: 908 http://opengate.svn.sourceforge.net/opengate/?rev=908&view=rev Author: egore Date: 2008-06-11 14:07:06 -0700 (Wed, 11 Jun 2008) Log Message: ----------- Fix compilation with GCC 4.3.1 Modified Paths: -------------- trunk/src/KeyMap.h trunk/src/LogManagerBase.cpp Modified: trunk/src/KeyMap.h =================================================================== --- trunk/src/KeyMap.h 2008-05-31 21:57:05 UTC (rev 907) +++ trunk/src/KeyMap.h 2008-06-11 21:07:06 UTC (rev 908) @@ -22,6 +22,7 @@ #define _OPENGATE_KEYMAP__H #include <map> +#include <sys/types.h> //#include "InputManager.h" namespace OIS{ Modified: trunk/src/LogManagerBase.cpp =================================================================== --- trunk/src/LogManagerBase.cpp 2008-05-31 21:57:05 UTC (rev 907) +++ trunk/src/LogManagerBase.cpp 2008-06-11 21:07:06 UTC (rev 908) @@ -19,6 +19,7 @@ ***************************************************************************/ #include "LogManagerBase.h" +#include <ctime> namespace OpenGate{ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spo...@us...> - 2008-05-31 21:57:03
|
Revision: 907 http://opengate.svn.sourceforge.net/opengate/?rev=907&view=rev Author: spom_spom Date: 2008-05-31 14:57:05 -0700 (Sat, 31 May 2008) Log Message: ----------- Add Drag&Drop for resources, e.g. you can add an object to the scene by dragging a mesh from resource tree to a node on the scene tree, Fix camera movement Modified Paths: -------------- branches/ogEditor/ogEditor.py branches/ogEditor/plugins.cfg branches/ogEditor/propgridtest.py branches/ogEditor/resources.cfg branches/ogEditor/src/ObjectInspectorPanels.py branches/ogEditor/src/OgreWindowWx.py branches/ogEditor/src/PropertyGrid.py branches/ogEditor/src/ResourceTreePane.py Modified: branches/ogEditor/ogEditor.py =================================================================== --- branches/ogEditor/ogEditor.py 2008-05-25 14:21:26 UTC (rev 906) +++ branches/ogEditor/ogEditor.py 2008-05-31 21:57:05 UTC (rev 907) @@ -108,7 +108,109 @@ opengateNode = tree.AppendItem( node, "Opengate" ) tree.SetPyData( opengateNode, self ) +class DropData(wx.CustomDataObject): + def __init__(self): + wx.CustomDataObject.__init__(self, wx.CustomDataFormat("MyDropData")) + #self.setObject(None) + + def setObject(self, obj): + print "drag data: ", obj +# global val is weird maybee using pyPickle/cpickle or something smarter + global dndObj__ + dndObj__=obj + self.SetData( "dndObj" ) + def getObject(self): + print "drop data: ", dndObj__ + return dndObj__ + +class MyDropTarget(wx.PyDropTarget): + def __init__(self, tree): + wx.PyDropTarget.__init__(self) + self._makeObjects() + self.tree = tree + self.selections=[] + + def _makeObjects(self): + self.data = DropData() + self.fileObject = wx.FileDataObject() + comp = wx.DataObjectComposite() + comp.Add(self.data) + comp.Add(self.fileObject) + self.comp = comp + self.SetDataObject(comp) + + def _saveSelection(self): + self.selections = self.tree.GetSelections() + self.tree.UnselectAll() + + def _restoreSelection(self): + self.tree.UnselectAll() + for i in self.selections: + self.tree.SelectItem(i) + self.selections=[] + + def OnEnter(self, x, y, d): + self._saveSelection() + return d + + def OnLeave(self): + self._restoreSelection() + + def OnDrop(self, x, y): + self._restoreSelection() + #item, flags = self.tree.HitTest((x, y)) + + print "got an drop event at", x, y + return True + + def OnDragOver(self, x, y, d): + # provide visual feedback by selecting the item the mouse is over + print x ,y, d + item, flags = self.tree.HitTest(wx.Point(x,y)) + print item, flags + selections = self.tree.GetSelections() + if item: + if selections != [item]: + self.tree.UnselectAll() + self.tree.SelectItem(item) + elif selections: + self.tree.UnselectAll() + + # The value returned here tells the source what kind of visual + # feedback to give. For example, if wxDragCopy is returned then + # only the copy cursor will be shown, even if the source allows + # moves. You can use the passed in (x,y) to determine what kind + # of feedback to give. In this case we return the suggested value + # which is based on whether the Ctrl key is pressed. + return d + + # Called when OnDrop returns True. We need to get the data and + # do something with it. + def OnData(self, x, y, d): + if self.GetData(): + obj = self.data.getObject() + + if obj: + print "item: ", obj, + + item, flags = self.tree.HitTest(wx.Point(x,y)) + if item: + print "dropped on item:", self.tree.GetItemText(item) + #print type( self.tree.GetPyData( item ) ) + #print type( obj ) + if ( type( self.tree.GetPyData( item ) ) == ogre.SceneNode ) and ( type( obj ) == ogre.Mesh ): + print "add mesh" + self.tree.parent_.createObject( obj.getName(), obj.getName(), self.tree.GetPyData( item ) ) + else: + print "dropped nowhere" + + self._makeObjects() # reset data objects.. + + return d # what is returned signals the source what to do + # with the original data (move, copy, etc.) In this + # case we just return the suggested value given to us. + class OGEditorPane: def __init__( self, ID, Name, mbShortcut, creator, defaultCheck ): self.ID_ = ID @@ -128,9 +230,9 @@ ws = WorkSpace self.allPanes = [] self.allPanes.append( OGEditorPane( ID_MB_VIEW_SCENETREE, NAME_SCENETREE, "\tF1", None, True ) ) - self.allPanes.append( OGEditorPane( ID_MB_VIEW_OBJECT, NAME_OBJECT , "\tF2", None, True ) ) - self.allPanes.append( OGEditorPane( ID_MB_VIEW_RESOURCE, NAME_RESOURCE , "\tF3", None, False ) ) - self.allPanes.append( OGEditorPane( ID_MB_VIEW_MATERIAL, NAME_MATERIAL , "\tF4", None, True ) ) + self.allPanes.append( OGEditorPane( ID_MB_VIEW_OBJECT, NAME_OBJECT , "\tF2", None, False ) ) + self.allPanes.append( OGEditorPane( ID_MB_VIEW_RESOURCE, NAME_RESOURCE , "\tF3", None, True ) ) + self.allPanes.append( OGEditorPane( ID_MB_VIEW_MATERIAL, NAME_MATERIAL , "\tF4", None, False ) ) self.allPanes.append( OGEditorPane( ID_MB_VIEW_PYCRUST, NAME_PYCRUST , "\tF9", None, False ) ) self.initMenuBar_() @@ -249,7 +351,7 @@ CT.TR_HAS_VARIABLE_ROW_HEIGHT | wx.WANTS_CHARS | wx.TR_TWIST_BUTTONS ) self.sceneTree.SetConnectionPen( wx.Pen( wx.Colour(100,100,100), 1, wx.SOLID) ) #self.sceneTree.SetFont( wx.Font( 8, wx.FONTFAMILY_DEFAULT, wx.TR_DEFAULT_STYLE, wx.FONTWEIGHT_NORMAL ) ) - #self.sceneTree.SetFont( wx.Font( 8, wx.FONTFAMILY_DEFAULT, wx.FONTWEIGHT_NORMAL ) ) + self.sceneTree.SetFont( wx.Font( 8, wx.FONTFAMILY_DEFAULT, wx.FONTFAMILY_DEFAULT, wx.FONTWEIGHT_NORMAL ) ) il = wx.ImageList(12, 12) self.SceneNodeIconID = il.Add( wx.ArtProvider_GetBitmap( wx.ART_GO_FORWARD, wx.ART_TOOLBAR, ( 12, 12 ) ) ) @@ -257,7 +359,9 @@ self.SceneUnknownIconID = il.Add( wx.ArtProvider_GetBitmap( wx.ART_QUESTION, wx.ART_TOOLBAR, ( 12, 12 ) ) ) self.sceneTree.AssignImageList( il ) - + + self.sceneTree.SetDropTarget( MyDropTarget( self.sceneTree ) ) + self.Bind( wx.EVT_TREE_SEL_CHANGED, self.doSelectTreeObject, self.sceneTree ) self.Bind( CT.EVT_TREE_ITEM_CHECKED, self.doCheckTreeObject, self.sceneTree ) #EVT_TREE_ITEM_CHECKING @@ -275,6 +379,9 @@ self.resourceTree = ResourceTreePane( self, -1, wx.Point( 0, 0 ), wx.Size( 160, 250 ), wx.TR_DEFAULT_STYLE | wx.NO_BORDER ); self.Bind( wx.EVT_TREE_SEL_CHANGED, self.doSelectTreeObject, self.resourceTree ) + self.resourceTree.Bind( wx.EVT_TREE_BEGIN_DRAG, self.OnBeginDrag ) + self.resourceTree.Bind( wx.EVT_TREE_BEGIN_RDRAG, self.OnBeginRDrag ) + self.resourceTree.Bind( wx.EVT_TREE_END_DRAG, self.OnEndDrag ) return self.resourceTree def setDefaultProperties_( self ): @@ -318,12 +425,49 @@ self.auiMgr.Update() event.Skip() + + def OnBeginDrag( self, event = None ): + print "OnBeginDrag", event + obj = event.GetEventObject().GetPyData( event.GetEventObject().GetSelection() ) + if obj: + dd=DropData() + dd.setObject( obj ) + comp = wx.DataObjectComposite() + comp.Add( dd ) + dropSource = wx.DropSource(self) + dropSource.SetData( comp ) + result = dropSource.DoDragDrop(wx.Drag_AllowMove) + else: + print "this is not dragable" + def OnBeginRDrag( self, event = None ): + print "OnBeginRDrag", event + print item.GetWindow() + if item: + event.Allow() + + def OnEndDrag( self, event = None ): + print "OnEndDrag", event + #event.GetEventObject().Layout() + event.GetEventObject().RefreshSubtree( event.GetEventObject().root_ ) + #print item + def doSelectTreeObject( self, event ): obj = event.GetEventObject().GetPyData( event.GetEventObject().GetSelection() ) if type( obj ) == ogre.SceneNode: - self.ogreRenderWindow.camera.lookAt( obj.getWorldPosition() ) + #targetDir = ( obj.getWorldPosition()- self.ogreRenderWindow.sceneEntities.cameraNode.getWorldPosition() ).normalisedCopy() + #camDir = self.ogreRenderWindow.sceneEntities.cameraNode.getWorldOrientation() * ogre.Vector3.NEGATIVE_UNIT_Z + #camDir.normalise() + #rot = camDir.getRotationTo( targetDir ); + #rot.normalise() + #self.ogreRenderWindow.sceneEntities.cameraNode.rotate( rot ) + #print targetDir, camDir + #print self.ogreRenderWindow.sceneEntities.cameraNode.getWorldOrientation() * ogre.Vector3.NEGATIVE_UNIT_Z + #quat = self.ogreRenderWindow.sceneEntities.cameraNode.getOrientation() + #print (quat * rot)*ogre.Vector3.NEGATIVE_UNIT_Z + self.ogreRenderWindow.sceneEntities.cameraNode.lookAt( obj.getWorldPosition(), ogre.Node.TS_WORLD ); + #self.ogreRenderWindow.camera.setDirection( targetDir ) if type( obj ) == ogre.Material: self.materialInspector.showData( obj ); @@ -353,9 +497,14 @@ # utils ################################################################################# - def createObject( self, name, meshname ): + def createObject( self, name, meshname, rootNode = None ): sceneManager = self.ogreRenderWindow.sceneManager; - node = sceneManager.getRootSceneNode().createChildSceneNode( name ); + + if not rootNode: + node = sceneManager.getRootSceneNode().createChildSceneNode( name ); + else: + node = rootNode.createChildSceneNode( name ); + entity = sceneManager.createEntity( name, meshname ); node.attachObject( entity ); self.UpdateSceneGraphEvent(); Modified: branches/ogEditor/plugins.cfg =================================================================== --- branches/ogEditor/plugins.cfg 2008-05-25 14:21:26 UTC (rev 906) +++ branches/ogEditor/plugins.cfg 2008-05-31 21:57:05 UTC (rev 907) @@ -2,18 +2,18 @@ ## Use this for Windows # Define plugin folder -PluginFolder=c:\PythonOgre/plugins -Plugin=RenderSystem_GL.dll -Plugin=RenderSystem_Direct3D9.dll -Plugin=Plugin_ParticleFX.dll +#PluginFolder=c:\PythonOgre/plugins +#Plugin=RenderSystem_GL.dll +#Plugin=RenderSystem_Direct3D9.dll +#Plugin=Plugin_ParticleFX.dll #Plugin=Plugin_BSPSceneManager.dll #Plugin=Plugin_OctreeSceneManager.dll -Plugin=Plugin_CgProgramManager.dll +#Plugin=Plugin_CgProgramManager.dll ## NOTE use this for MacOS or Linux -#PluginFolder=/usr/lib/OGRE -#Plugin=RenderSystem_GL -#Plugin=Plugin_ParticleFX +PluginFolder=/usr/lib/OGRE +Plugin=RenderSystem_GL +Plugin=Plugin_ParticleFX #Plugin=Plugin_BSPSceneManager #Plugin=Plugin_OctreeSceneManager -#Plugin=Plugin_CgProgramManager +Plugin=Plugin_CgProgramManager Modified: branches/ogEditor/propgridtest.py =================================================================== --- branches/ogEditor/propgridtest.py 2008-05-25 14:21:26 UTC (rev 906) +++ branches/ogEditor/propgridtest.py 2008-05-31 21:57:05 UTC (rev 907) @@ -34,6 +34,8 @@ self.propertyGrid.appendRowItemSlider( "slider", cback = test.printValue, toolTip = "toolTip" ) self.propertyGrid.appendRowItemColourSelect( "Colour", cback = test.printValue, toolTip = "toolTip" ) + self.propertyGrid.appendRowItemVector3( "scale", cback = test.printValue, toolTip = "vector3 property " ) + collpane = self.propertyGrid.createAndAppendPane( "Child 1", toolTip = "toolTip" ) collpane.appendRowItemName( "Child 1 A", "name", toolTip = "toolTip" ) collpane.appendRowItemName( "Child 1 B", "name", toolTip = "toolTip" ) Modified: branches/ogEditor/resources.cfg =================================================================== --- branches/ogEditor/resources.cfg 2008-05-25 14:21:26 UTC (rev 906) +++ branches/ogEditor/resources.cfg 2008-05-31 21:57:05 UTC (rev 907) @@ -1,28 +1,28 @@ +#[Bootstrap] +#Zip=c:\PythonOgre/demos/media/packs/OgreCore.zip + +#[General] +#FileSystem=c:\PythonOgre/demos/models +#FileSystem=c:\PythonOgre/demos/media +#FileSystem=c:\PythonOgre/demos/media/fonts +#FileSystem=c:\PythonOgre/demos/media/materials/programs +#FileSystem=c:\PythonOgre/demos/media/materials/scripts +#FileSystem=c:\PythonOgre/demos/media/materials/textures +#FileSystem=c:\PythonOgre/demos/media/models +#FileSystem=c:\PythonOgre/demos/media/overlays +#FileSystem=c:\PythonOgre/demos/media/particle +#FileSystem=c:\PythonOgre/demos/media/gui [Bootstrap] -Zip=c:\PythonOgre/demos/media/packs/OgreCore.zip - +Zip=../../../../local/python-ogre/python-ogre/demos/media/packs/OgreCore.zip +# [General] -FileSystem=c:\PythonOgre/demos/models -FileSystem=c:\PythonOgre/demos/media -FileSystem=c:\PythonOgre/demos/media/fonts -FileSystem=c:\PythonOgre/demos/media/materials/programs -FileSystem=c:\PythonOgre/demos/media/materials/scripts -FileSystem=c:\PythonOgre/demos/media/materials/textures -FileSystem=c:\PythonOgre/demos/media/models -FileSystem=c:\PythonOgre/demos/media/overlays -FileSystem=c:\PythonOgre/demos/media/particle -FileSystem=c:\PythonOgre/demos/media/gui -#[Bootstrap] -#Zip=../../../../local/python-ogre/python-ogre/demos/media/packs/OgreCore.zip -# -#[General] -#FileSystem=../../../../local/python-ogre/python-ogre/demos/imemodels -#FileSystem=../../../../local/python-ogre/python-ogre/demos/media -#FileSystem=../../../../local/python-ogre/python-ogre/demos/media/fonts -#FileSystem=../../../../local/python-ogre/python-ogre/demos/media/materials/programs -#FileSystem=../../../../local/python-ogre/python-ogre/demos/media/materials/scripts -#FileSystem=../../../../local/python-ogre/python-ogre/demos/media/materials/textures -#FileSystem=../../../../local/python-ogre/python-ogre/demos/media/models -#FileSystem=../../../../local/python-ogre/python-ogre/demos/media/overlays -#FileSystem=../../../../local/python-ogre/python-ogre/demos/media/particle -#FileSystem=../../../../local/python-ogre/python-ogre/demos/media/gui +FileSystem=../../../../local/python-ogre/python-ogre/demos/imemodels +FileSystem=../../../../local/python-ogre/python-ogre/demos/media +FileSystem=../../../../local/python-ogre/python-ogre/demos/media/fonts +FileSystem=../../../../local/python-ogre/python-ogre/demos/media/materials/programs +FileSystem=../../../../local/python-ogre/python-ogre/demos/media/materials/scripts +FileSystem=../../../../local/python-ogre/python-ogre/demos/media/materials/textures +FileSystem=../../../../local/python-ogre/python-ogre/demos/media/models +FileSystem=../../../../local/python-ogre/python-ogre/demos/media/overlays +FileSystem=../../../../local/python-ogre/python-ogre/demos/media/particle +FileSystem=../../../../local/python-ogre/python-ogre/demos/media/gui Modified: branches/ogEditor/src/ObjectInspectorPanels.py =================================================================== --- branches/ogEditor/src/ObjectInspectorPanels.py 2008-05-25 14:21:26 UTC (rev 906) +++ branches/ogEditor/src/ObjectInspectorPanels.py 2008-05-31 21:57:05 UTC (rev 907) @@ -102,7 +102,7 @@ wx.Panel.__init__(self, *args, **kwds) self.parent_ = parent self.typeStaticText = wx.StaticText(self, -1, "Type") - self.propertyGrid = PropertyMainGrid( self, -1, style=wx.SIMPLE_BORDER ) + self.propertyGrid = PropertyMainGrid( self ) self.__set_properties() self.__do_layout() @@ -205,13 +205,52 @@ def showSceneNode( self, data ): self.typeStaticText.SetLabel( "SceneNode" ) self.showName( data ) - self.propertyGrid.appendRowItemInfo( "world AABB min %s" % toStr( data._getWorldAABB().getMinimum() ) ) + + info1 = self.propertyGrid.appendRowItemInfo( ) + info2 = self.propertyGrid.appendRowItemInfo( ) + info3 = self.propertyGrid.appendRowItemInfo( ) + info4 = self.propertyGrid.appendRowItemInfo( ) + info5 = self.propertyGrid.appendRowItemInfo( ) + + def updateInfo(): + info1.setInfo( "world AABB min %s" % toStr( data._getWorldAABB().getMinimum() ) ) + info2.setInfo( "world AABB max %s" % toStr( data._getWorldAABB().getMaximum() ) ) + info3.setInfo( "world size %s" % toStr(data._getWorldAABB().getMaximum()-data._getWorldAABB().getMinimum() ) ) + info4.setInfo( "world position %s" % toStr(data.getWorldPosition() ) ) + info5.setInfo( "scale %s" % toStr( data.getScale() ) ) + + + updateInfo() - self.propertyGrid.appendRowItemInfo( "world AABB max %s" % toStr( data._getWorldAABB().getMaximum() ) ) - self.propertyGrid.appendRowItemInfo( "world size %s" % toStr(data._getWorldAABB().getMaximum()-data._getWorldAABB().getMinimum() ) ) + #self.propertyGrid.appendRowItemSlider( "yaw", start = -180, end = 180, format = FORMAT_INT, cback = yaw ) + #self.propertyGrid.appendRowItemSlider( "pitch", cback = data.pitch ) + #self.propertyGrid.appendRowItemSlider( "roll", cback = data.roll ) - self.propertyGrid.appendRowItemInfo( "world position %s" % toStr(data.getWorldPosition() ) ) - self.propertyGrid.appendRowItemInfo( "scale %s" % toStr( data.getScale() ) ) + def getPosition( ): + val = [0.0, 0.0, 0.0] + val[0] = data.getPosition().x; + val[1] = data.getPosition().y; + val[2] = data.getPosition().z; + return val + + def setPosition( val ): + data.setPosition( val[0], val[1], val[2] ); + updateInfo() + + self.propertyGrid.appendRowItemVector3( "position", minVal = -65500, maxVal = 65500, cfront = getPosition, cback = setPosition ) + + def getScale( ): + scale = [1.0, 1.0, 1.0] + scale[0] = data.getScale().x; + scale[1] = data.getScale().y; + scale[2] = data.getScale().z; + return scale + + def setScale( val ): + data.setScale( val[0], val[1], val[2] ); + updateInfo() + + self.propertyGrid.appendRowItemVector3( "scale", minVal = 0, maxVal = 65500, cfront = getScale, cback = setScale ) #getWorldOrientation #getOrientation @@ -268,6 +307,11 @@ else: print "data is no material", data + def save( self, filename ): + matSerializer = ogre.MaterialSerializer(); + matSerializer.exportMaterial( self.material_, filename ) + #, bool exportDefaults=false, const bool includeProgDef=false, const String &programFilename="") + def showPass( self, data, parenpane ): collpane = parenpane.createAndAppendPane( "Pass " + data.getName() ) @@ -411,8 +455,12 @@ self.showPass( data.getPass( i ), collpane ) def showMaterial( self, data ): + self.material_ = data; + self.typeStaticText.SetLabel( "Material" ) self.showResource( data ) - self.typeStaticText.SetLabel( "Material" ) + self.propertyGrid.appendRowItemFileSelect("save", cback= self.save, toolTip = "Save the material script" , + wildcard = "*.material" ) + nTechniques = data.getNumTechniques() for i in range(0,nTechniques): self.showTechnique( data.getTechnique( i ) ) \ No newline at end of file Modified: branches/ogEditor/src/OgreWindowWx.py =================================================================== --- branches/ogEditor/src/OgreWindowWx.py 2008-05-25 14:21:26 UTC (rev 906) +++ branches/ogEditor/src/OgreWindowWx.py 2008-05-31 21:57:05 UTC (rev 907) @@ -111,7 +111,7 @@ self.ogreRoot.initialise(False) # tempory condition until code cleaning - tmpLinux = False; + tmpLinux = True; if tmpLinux: lastValid = self.parent parent = lastValid @@ -209,12 +209,10 @@ # create the camera nodes & attach camera cameraNode = self.sceneManager.getRootSceneNode().createChildSceneNode( self.camera.getName(), ogre.Vector3( 0, 0, 0 ) ) - pitchNode = cameraNode.createChildSceneNode( cameraNode.getName() + "/PitchNode" ) - pitchNode.attachObject( self.camera ) + cameraNode.attachObject( self.camera ) self.sceneEntities.camera = self.camera self.sceneEntities.cameraNode = cameraNode - self.sceneEntities.cameraPitchNode = pitchNode def _CreateViewport(self): "create a Viewport" @@ -274,5 +272,5 @@ self.sceneEntities.cameraNode.yaw( ogre.Degree( dx / 5.0 ), ogre.Node.TS_LOCAL ) self.sceneEntities.cameraNode.pitch( ogre.Degree( dy / 5.0 ), ogre.Node.TS_LOCAL ) - #self.sceneEntities.cameraPitchNode.pitch( ogre.Degree( dy / 3.0 ), ogre.Node.TS_LOCAL ) + event.Skip() Modified: branches/ogEditor/src/PropertyGrid.py =================================================================== --- branches/ogEditor/src/PropertyGrid.py 2008-05-25 14:21:26 UTC (rev 906) +++ branches/ogEditor/src/PropertyGrid.py 2008-05-31 21:57:05 UTC (rev 907) @@ -2,7 +2,10 @@ import string import wx.combo import wx.lib.colourselect as csel +import wx.lib.scrolledpanel as scrolled +import PyCollapsiblePane as PCP + FORMAT_INT=0 FORMAT_FLOAT=1 FORMAT_LOG10=2 @@ -213,8 +216,7 @@ self.parent_ = parent self.sizer_ = wx.BoxSizer( wx.HORIZONTAL ) - self.labelTextCtrl_ = wx.TextCtrl( parent, -1, name, - style = wx.NO_BORDER | wx.ALIGN_LEFT ) + self.labelTextCtrl_ = wx.TextCtrl( parent, -1, name, style = wx.NO_BORDER | wx.ALIGN_LEFT ) if toolTip: self.labelTextCtrl_.SetToolTip( wx.ToolTip( toolTip ) ) @@ -243,6 +245,9 @@ self.labelTextCtrl_.SetEditable( False ) self.sizer_.Add( self.labelTextCtrl_, 1, wx.EXPAND | wx.ALIGN_RIGHT ) + def setInfo( self, txt ): + self.labelTextCtrl_.SetValue( txt ) + class PropertyRowItemName( PropertyRowItem ): valueTextCtrl_ = None format_ = None @@ -342,7 +347,7 @@ self.fileSelectButton.Bind( wx.EVT_BUTTON, self.OnButton ) def OnButton( self, event): - dlg = wx.FileDialog( self.parent, message="Choose a file", + dlg = wx.FileDialog( self.parent_, message="Choose a file", defaultDir=os.getcwd(), defaultFile="", wildcard=self.wildcard, @@ -488,6 +493,57 @@ if self.cback_ != None: self.cback_( self.value ) +class PropertyRowItemVector3( PropertyRowItem ): + def __init__( self, parent, name, value = [ 0.0, 0.0, 0.0 ], minVal = 0, maxVal = 100, cfront = None, cback = None, toolTip = None ): + PropertyRowItem.__init__( self, parent, name, cback = cback, toolTip = toolTip ) + self.cfront_ = cfront + + self.value_ = value + if self.cfront_: + self.value_ = self.cfront_() + + self.spinX_ = wx.SpinCtrl( parent, -1, size = (50, self.rowHeight_), style = wx.NO_BORDER | wx.NO_3D | wx.TAB_TRAVERSAL ) + self.spinX_.SetRange( minVal, maxVal ) + self.spinX_.SetValue( self.value_[ 0 ] ); + + self.spinY_ = wx.SpinCtrl( parent, -1, size = (50, self.rowHeight_), style = wx.NO_BORDER | wx.NO_3D | wx.TAB_TRAVERSAL ) + self.spinY_.SetRange( minVal, maxVal ) + self.spinY_.SetValue( self.value_[ 1 ] ); + + self.spinZ_ = wx.SpinCtrl( parent, -1, size = (50, self.rowHeight_), style = wx.NO_BORDER | wx.NO_3D | wx.TAB_TRAVERSAL ) + self.spinZ_.SetRange( minVal, maxVal ) + self.spinZ_.SetValue( self.value_[ 2 ] ); + + #self.spin.SetRange(1, 100) + #self.spin.SetValue(1) + self.sizer_.Add( self.spinX_, 1, wx.EXPAND | wx.ALIGN_LEFT ) + self.sizer_.Add( self.spinY_, 1, wx.EXPAND | wx.ALIGN_LEFT ) + self.sizer_.Add( self.spinZ_, 1, wx.EXPAND | wx.ALIGN_LEFT ) + + self.spinX_.Bind(wx.EVT_SPINCTRL, self.OnSpinX ) + self.spinY_.Bind(wx.EVT_SPINCTRL, self.OnSpinY ) + self.spinZ_.Bind(wx.EVT_SPINCTRL, self.OnSpinZ ) + + def OnSpinX( self, event = None): + if event: + self.value_[ 0 ] = event.GetInt() + self.applyValue( True ) + + def OnSpinY( self, event = None): + if event: + self.value_[ 1 ] = event.GetInt() + self.applyValue( True ) + + def OnSpinZ( self, event = None): + if event: + self.value_[ 2 ] = event.GetInt() + self.applyValue( True ) + + def applyValue( self, update = True ): + if update: + if self.cback_: + self.cback_( self.value_ ) + class PropertyRowItemChoice( PropertyRowItem ): def __init__( self, parent, name, value = None, itemList = None, itemMap = None, cback = None, toolTip = None): PropertyRowItem.__init__( self, parent, name, cback = cback, toolTip = toolTip ) @@ -605,7 +661,7 @@ rowsizer.Add( row.sizer_, 1, wx.EXPAND ) self.sizer_.Add( rowsizer, 0, wx.EXPAND ) - def appendRowItemInfo(self, name, toolTip = None): + def appendRowItemInfo(self, name = "Not assigned", toolTip = None): item = PropertyRowItemInfo( self.pane, name, toolTip = toolTip ) self.appendRow( item ) return item @@ -645,6 +701,12 @@ self.appendRow( item ) return item + def appendRowItemVector3( self, name, value = [ 0.0, 0.0, 0.0 ], minVal = 0, maxVal = 100, + cfront = None, cback = None, toolTip = None ): + item = PropertyRowItemVector3( self.pane, name, value = value, minVal = minVal, maxVal = maxVal, cfront = cfront, cback = cback, toolTip = toolTip ) + self.appendRow( item ) + return item + def appendRowItemColourSelect( self, name, cback = None, toolTip = None ): item = PropertyRowItemColourSelect( self.pane, name, cback = cback, toolTip = toolTip ) self.appendRow( item ) @@ -669,16 +731,20 @@ return pane -#class PropertyPaneItem( wx.Panel, PropertyGrid ): class PropertyPaneItem( wx.CollapsiblePane, PropertyGrid ): +#class PropertyPaneItem( PCP.PyCollapsiblePane, PropertyGrid ): def __init__(self, parent, name, toolTip = None): - self.parent_ = parent + self.name_ = name + self.parent_ = parent if issubclass( type( parent ), PropertyPaneItem ): parentWin = self.parent_.GetPane() else: parentWin = self.parent_ - wx.CollapsiblePane.__init__( self, parentWin, -1, name, style = wx.CP_DEFAULT_STYLE | wx.CP_NO_TLW_RESIZE ) + wx.CollapsiblePane.__init__( self, parentWin, -1, name, style = wx.CP_DEFAULT_STYLE | + wx.CP_NO_TLW_RESIZE ) + #PCP.PyCollapsiblePane.__init__( self, parentWin, -1, name, style = wx.CP_DEFAULT_STYLE | + #wx.CP_NO_TLW_RESIZE | PCP.CP_GTK_EXPANDER ) #wx.Panel.__init__( self, parent, -1 ) if toolTip: self.SetToolTip( wx.ToolTip( toolTip ) ) @@ -698,10 +764,13 @@ def OnPaneChanged(self, event = None): if ( issubclass( type( self.parent_ ), PropertyPaneItem ) ): + print self.parent_.name_ self.parent_.Collapse( ) +# self.parent_.Layout() self.parent_.Expand( ) + # self.parent_.Layout() - self.GetParent().Layout() + self.GetParent().GetParent().GetParent().Layout() class PropertyPaneItemColour( PropertyPaneItem ): @@ -750,17 +819,23 @@ self.cback( map(lambda x: x / self.scale, self.value) ) -class PropertyMainGrid( wx.Panel, PropertyGrid ): - def __init__(self, *argc, **argv): - argv["style"] = wx.TAB_TRAVERSAL - wx.Panel.__init__(self, *argc, **argv) +class PropertyMainGrid( wx.PyScrolledWindow, PropertyGrid ): + def __init__(self, parent, id = -1, pos = (0,0), size= wx.DefaultSize): + #argv["style"] = wx.TAB_TRAVERSAL|wx.HSCROLL|wx.VSCROLL + + wx.PyScrolledWindow.__init__( self, parent, id, pos, size, style = wx.SUNKEN_BORDER | wx.HSCROLL | wx.VSCROLL | wx.TAB_TRAVERSAL) + + self.SetVirtualSize( (30,20)) + self.SetScrollRate(20,20) + + #wx.PyScrolledWindow.__init__(self, parent, id, pos, size, style|wx.HSCROLL|wx.VSCROLL, name) PropertyGrid.__init__(self) self.SetSizer( self.sizer_ ) self.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "")) #self.SetBackgroundColour( wx.Colour(200, 200, 200) ) - self.pane = self + self.pane = self def clean( self ): self.sizer_.Clear( True ) Modified: branches/ogEditor/src/ResourceTreePane.py =================================================================== --- branches/ogEditor/src/ResourceTreePane.py 2008-05-25 14:21:26 UTC (rev 906) +++ branches/ogEditor/src/ResourceTreePane.py 2008-05-31 21:57:05 UTC (rev 907) @@ -7,6 +7,7 @@ def __init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.TR_DEFAULT_STYLE, ctstyle=0, validator=wx.DefaultValidator, name="MyCustomTreeCtrl"): + self.parent_ = parent CT.CustomTreeCtrl.__init__(self, parent, id, pos, size, style, ctstyle, validator, name) def OnInternalIdle(self): @@ -14,14 +15,15 @@ CT.CustomTreeCtrl.OnInternalIdle( self ) -class ResourceTreePane( MyCustomTree ): +class ResourceTreePane( CT.CustomTreeCtrl ): def __init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.TR_DEFAULT_STYLE, ctstyle=0, validator=wx.DefaultValidator, name="MyCustomTreeCtrl"): + self.parent_ = parent CT.CustomTreeCtrl.__init__(self, parent, id, pos, size, style, ctstyle, validator, name) CT.CustomTreeCtrl.SetConnectionPen( self, wx.Pen( wx.Colour(100,100,100), 1, wx.SOLID) ) - #CT.CustomTreeCtrl.SetFont( self, wx.Font( 8, wx.FONTFAMILY_DEFAULT, wx.TR_DEFAULT_STYLE, wx.FONTWEIGHT_NORMAL ) ) + CT.CustomTreeCtrl.SetFont( self, wx.Font( 8, wx.FONTFAMILY_DEFAULT, wx.FONTFAMILY_DEFAULT, wx.FONTWEIGHT_NORMAL ) ) def OnInternalIdle(self): wx.PyScrolledWindow.OnInternalIdle( self ) @@ -53,7 +55,8 @@ resManIter.getNext() - + + ## Insert resources sorted by resource groups resGroupManNode = self.addItem( root, "Ogre resource groups", ogreResourceGroupManager ) resGroups = ogreResourceGroupManager.getResourceGroups( ) @@ -64,7 +67,21 @@ for i in range( 0, len( resGroups ) ): resGroupName = resGroups[ i ] resGroupNode = self.addItem( resGroupManNode, resGroupName, None ) + + resManIter = ogreResourceGroupManager.getResourceManagerIterator() + while resManIter.hasMoreElements(): + resManNodeIter = self.addItem( resGroupNode, resManIter.peekNextKey(), resManIter.peekNextValue() ) + resIter = resManIter.peekNextValue().getResourceIterator() + + while resIter.hasMoreElements(): + if resIter.peekNextValue().getGroup() == resGroupName: + self.addItem( resManNodeIter, resIter.peekNextValue().getName(), resIter.peekNextValue() ) + + resIter.getNext() + resManIter.getNext() + + #ogResourceManager = og.ResourceManager.getSingleton() #if ogResourceManager: #resLocNode = self.addItem( resGroupNode, "Resource group locations", None ) @@ -75,11 +92,11 @@ #self.addItem( resLocNode, resLocation, None ) ## Insert resources for each groups - resNameNode = self.addItem( resGroupNode, "Resources", None ) - resNameList = ogre.ResourceGroupManager.getSingleton().listResourceNames( resGroupName ) - for j in range( 0, len( resNameList ) ): - res = resNameList[ j ] - self.addItem( resNameNode, res, None ); + #resNameNode = self.addItem( resGroupNode, "Resources", None ) + #resNameList = ogre.ResourceGroupManager.getSingleton().listResourceNames( resGroupName ) + #for j in range( 0, len( resNameList ) ): + #res = resNameList[ j ] + #self.addItem( resNameNode, res, None ); # insert Opengate specific resources This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spo...@us...> - 2008-05-25 14:21:19
|
Revision: 906 http://opengate.svn.sourceforge.net/opengate/?rev=906&view=rev Author: spom_spom Date: 2008-05-25 07:21:26 -0700 (Sun, 25 May 2008) Log Message: ----------- ogEditor: win compatibility commit, Propertygrid looks totally weird Modified Paths: -------------- branches/ogEditor/ogEditor.py branches/ogEditor/plugins.cfg branches/ogEditor/propgridtest.py branches/ogEditor/resources.cfg branches/ogEditor/src/OgreWindowWx.py branches/ogEditor/src/ResourceTreePane.py Modified: branches/ogEditor/ogEditor.py =================================================================== --- branches/ogEditor/ogEditor.py 2008-05-25 11:51:13 UTC (rev 905) +++ branches/ogEditor/ogEditor.py 2008-05-25 14:21:26 UTC (rev 906) @@ -5,9 +5,9 @@ import sys import wx -sys.path.append( './packages_2.5/' ) +sys.path.append( './packages_2.5' ) sys.path.append( '../' ) -sys.path.append( './src/' ) +sys.path.append( './src' ) import wx.aui import wx.py as py @@ -150,6 +150,7 @@ self.og.AddToResourcesTree( self.resourceTree, self.resourceTree.root_ ) else: + print "no default plugin found: start fallback" ohNode = self.createObject( "ogreMesh", "ogrehead.mesh" ) ohNode.translate( ogre.Vector3( 0.0, 0.0, -100 ) ); @@ -247,7 +248,8 @@ style=wx.SUNKEN_BORDER | CT.TR_HAS_BUTTONS | CT.TR_HAS_VARIABLE_ROW_HEIGHT | wx.WANTS_CHARS | wx.TR_TWIST_BUTTONS ) self.sceneTree.SetConnectionPen( wx.Pen( wx.Colour(100,100,100), 1, wx.SOLID) ) - self.sceneTree.SetFont( wx.Font( 8, wx.FONTFAMILY_DEFAULT, wx.TR_DEFAULT_STYLE, wx.FONTWEIGHT_NORMAL ) ) + #self.sceneTree.SetFont( wx.Font( 8, wx.FONTFAMILY_DEFAULT, wx.TR_DEFAULT_STYLE, wx.FONTWEIGHT_NORMAL ) ) + #self.sceneTree.SetFont( wx.Font( 8, wx.FONTFAMILY_DEFAULT, wx.FONTWEIGHT_NORMAL ) ) il = wx.ImageList(12, 12) self.SceneNodeIconID = il.Add( wx.ArtProvider_GetBitmap( wx.ART_GO_FORWARD, wx.ART_TOOLBAR, ( 12, 12 ) ) ) Modified: branches/ogEditor/plugins.cfg =================================================================== --- branches/ogEditor/plugins.cfg 2008-05-25 11:51:13 UTC (rev 905) +++ branches/ogEditor/plugins.cfg 2008-05-25 14:21:26 UTC (rev 906) @@ -2,18 +2,18 @@ ## Use this for Windows # Define plugin folder -PluginFolder=/usr/lib/OGRE -#Plugin=RenderSystem_GL.dll -#Plugin=RenderSystem_Direct3D9.dll -#Plugin=Plugin_ParticleFX.dll -#Plugin=Plugin_BSPSceneManager.dll -#Plugin=Plugin_OctreeSceneManager.dll -#Plugin=Plugin_CgProgramManager.dll - -## +PluginFolder=c:\PythonOgre/plugins +Plugin=RenderSystem_GL.dll +Plugin=RenderSystem_Direct3D9.dll +Plugin=Plugin_ParticleFX.dll +#Plugin=Plugin_BSPSceneManager.dll +#Plugin=Plugin_OctreeSceneManager.dll +Plugin=Plugin_CgProgramManager.dll + ## NOTE use this for MacOS or Linux -Plugin=RenderSystem_GL -Plugin=Plugin_ParticleFX +#PluginFolder=/usr/lib/OGRE +#Plugin=RenderSystem_GL +#Plugin=Plugin_ParticleFX #Plugin=Plugin_BSPSceneManager #Plugin=Plugin_OctreeSceneManager -Plugin=Plugin_CgProgramManager +#Plugin=Plugin_CgProgramManager Modified: branches/ogEditor/propgridtest.py =================================================================== --- branches/ogEditor/propgridtest.py 2008-05-25 11:51:13 UTC (rev 905) +++ branches/ogEditor/propgridtest.py 2008-05-25 14:21:26 UTC (rev 906) @@ -4,8 +4,9 @@ import sys import wx -sys.path.append( './src/' ) +sys.path.append( './src' ) + from PropertyGrid import * @@ -24,8 +25,11 @@ self.propertyGrid = PropertyMainGrid( self, -1, wx.DefaultPosition, wx.DefaultSize ) self.propertyGrid.appendRowItemName( "Main", "name", toolTip = "toolTip" ) - self.propertyGrid.appendRowItemName( "float", value = 10.1, format = FORMAT_FLOAT, cback = test.printValue, toolTip = "toolTip" ) - self.propertyGrid.appendRowItemName( "int", value = 10, format = FORMAT_INT, cback = test.printValue, toolTip = "toolTip" ) + self.propertyGrid.appendRowItemName( "float", value = 10.1, format = FORMAT_FLOAT, + cback = test.printValue, toolTip = "toolTip" ) + + self.propertyGrid.appendRowItemName( "int", value = 10, format = FORMAT_INT, + cback = test.printValue, toolTip = "toolTip" ) self.propertyGrid.appendRowItemSlider( "slider", cback = test.printValue, toolTip = "toolTip" ) self.propertyGrid.appendRowItemColourSelect( "Colour", cback = test.printValue, toolTip = "toolTip" ) Modified: branches/ogEditor/resources.cfg =================================================================== --- branches/ogEditor/resources.cfg 2008-05-25 11:51:13 UTC (rev 905) +++ branches/ogEditor/resources.cfg 2008-05-25 14:21:26 UTC (rev 906) @@ -1,14 +1,28 @@ [Bootstrap] -Zip=../../../../local/python-ogre/python-ogre/demos/media/packs/OgreCore.zip +Zip=c:\PythonOgre/demos/media/packs/OgreCore.zip [General] -FileSystem=../../../../local/python-ogre/python-ogre/demos/imemodels -FileSystem=../../../../local/python-ogre/python-ogre/demos/media -FileSystem=../../../../local/python-ogre/python-ogre/demos/media/fonts -FileSystem=../../../../local/python-ogre/python-ogre/demos/media/materials/programs -FileSystem=../../../../local/python-ogre/python-ogre/demos/media/materials/scripts -FileSystem=../../../../local/python-ogre/python-ogre/demos/media/materials/textures -FileSystem=../../../../local/python-ogre/python-ogre/demos/media/models -FileSystem=../../../../local/python-ogre/python-ogre/demos/media/overlays -FileSystem=../../../../local/python-ogre/python-ogre/demos/media/particle -FileSystem=../../../../local/python-ogre/python-ogre/demos/media/gui +FileSystem=c:\PythonOgre/demos/models +FileSystem=c:\PythonOgre/demos/media +FileSystem=c:\PythonOgre/demos/media/fonts +FileSystem=c:\PythonOgre/demos/media/materials/programs +FileSystem=c:\PythonOgre/demos/media/materials/scripts +FileSystem=c:\PythonOgre/demos/media/materials/textures +FileSystem=c:\PythonOgre/demos/media/models +FileSystem=c:\PythonOgre/demos/media/overlays +FileSystem=c:\PythonOgre/demos/media/particle +FileSystem=c:\PythonOgre/demos/media/gui +#[Bootstrap] +#Zip=../../../../local/python-ogre/python-ogre/demos/media/packs/OgreCore.zip +# +#[General] +#FileSystem=../../../../local/python-ogre/python-ogre/demos/imemodels +#FileSystem=../../../../local/python-ogre/python-ogre/demos/media +#FileSystem=../../../../local/python-ogre/python-ogre/demos/media/fonts +#FileSystem=../../../../local/python-ogre/python-ogre/demos/media/materials/programs +#FileSystem=../../../../local/python-ogre/python-ogre/demos/media/materials/scripts +#FileSystem=../../../../local/python-ogre/python-ogre/demos/media/materials/textures +#FileSystem=../../../../local/python-ogre/python-ogre/demos/media/models +#FileSystem=../../../../local/python-ogre/python-ogre/demos/media/overlays +#FileSystem=../../../../local/python-ogre/python-ogre/demos/media/particle +#FileSystem=../../../../local/python-ogre/python-ogre/demos/media/gui Modified: branches/ogEditor/src/OgreWindowWx.py =================================================================== --- branches/ogEditor/src/OgreWindowWx.py 2008-05-25 11:51:13 UTC (rev 905) +++ branches/ogEditor/src/OgreWindowWx.py 2008-05-25 14:21:26 UTC (rev 906) @@ -2,8 +2,12 @@ import ogre.renderer.OGRE as ogre import os import os.path +import string -import wxogre_util as wxHandle +try: + import wxogre_util as wxHandle +except: + pass #try : #import psyco #use psyco if available (JIT compiler) @@ -36,7 +40,7 @@ class OgreWindow( wx.PyWindow ): """wx.Frame subclass to embed an Ogre window in wxPython It is somewhat inspired from SampleFramework.py""" - + #all animation states included in this dictionary will be automatically updated at each render animStates = {} #the values have to be (AnimationState, SpeedFactor) tuples @@ -78,72 +82,65 @@ self.resourceLocations.append( (path, section_name ) ) def _OgreInit(self,size,renderSystem): - #Root creation + #Root creation + self.ogreRoot = ogre.Root( getPluginPath(), "ogre.cfg" ) - + # setup resources self.AddResources( "resources.cfg" ); - + + renList = self.ogreRoot.getAvailableRenderers() + + bFound = False + for r in renList: + print r.getName() + if string.find(r.getName(),renderSystem) != -1 and bFound==False: + self.ogreRoot.setRenderSystem ( r ) + bFound = True + if os.path.exists( "ogre.cfg" ): self.ogreRoot.restoreConfig() else: + print "create ogre.cfg" carryOn = self.ogreRoot.showConfigDialog() if not carryOn: sys.exit('Quit from Config Dialog') + - #The following section tries to avoid showing the configuration dilaog. -# rsList = root.getAvailableRenderers() #Gets the available RenderSystems -# rs = None -# CouldNotFindRequestedRenderer = False -# for i in rsList: -# print i - -# if renderSystem in i.name: #Tries to locate the requested render system -# rs=i -# if rs is not None : -# root.renderSystem=rs -# rs.setConfigOption("Full Screen","No") -# try : -# rs.setConfigOption("Video Mode","800 x 600 @ 16-bit colour") -# except : -# CouldNotFindRequestedRenderer=True -# else : -# CouldNotFindRequestedRenderer=True -# -# if CouldNotFindRequestedRenderer: #Calls Ogre's default Config dialog if failed -# carryOn = root.showConfigDialog() -# if not carryOn: -# sys.exit('Quit from Config Dialog') - -# carryOn = root.showConfigDialog() -# if not carryOn: -# sys.exit('Quit from Config Dialog') - #get the topmost window and make it visible, otherwise we cant get a valid windowhandle + self.ogreRoot.initialise(False) - lastValid = self.parent - parent = lastValid - while parent != None: - lastValid = parent - parent = lastValid.GetParent() - lastValid.Show( True ) + # tempory condition until code cleaning + tmpLinux = False; + if tmpLinux: + lastValid = self.parent + parent = lastValid + while parent != None: + lastValid = parent + parent = lastValid.GetParent() + lastValid.Show( True ) - self.ogreRoot.initialise(False) - renderParameters = ogre.NameValuePairList() - handle = wxHandle.get_window_handle_str( self ) - if handle == "No window found": - print handle - renderParameters = ogre.NameValuePairList(); + renderParameters = ogre.NameValuePairList() + handle = wxHandle.get_window_handle_str( self ) + if handle == "No window found": + print handle + renderParameters = ogre.NameValuePairList(); + else: + renderParameters['externalWindowHandle'] = handle + print handle, lastValid.GetHandle(), self.parent.GetHandle() else: - renderParameters['externalWindowHandle'] = handle - print handle, lastValid.GetHandle(), self.parent.GetHandle() + renderParameters = ogre.NameValuePairList() + renderParameters['externalWindowHandle'] = str(self.GetHandle()) + print str(self.GetHandle()) + #renderParameters['FSAA'] = "16" - renderWindow = self.ogreRoot.createRenderWindow('wxPython render window', size[ 0 ], size[ 1 ], False, renderParameters) - renderWindow.active = True - self.renderWindow = renderWindow - + self.renderWindow = self.ogreRoot.createRenderWindow('wxPython render window', size[ 0 ], + size[ 1 ], False, renderParameters) + self.renderWindow.active = True + ogre.ResourceGroupManager.getSingleton().initialiseAllResourceGroups() - + print "start OgreWindow4" + def _OnSize(self, event): if getattr(self, 'ogreRoot', None): self.UpdateRender() Modified: branches/ogEditor/src/ResourceTreePane.py =================================================================== --- branches/ogEditor/src/ResourceTreePane.py 2008-05-25 11:51:13 UTC (rev 905) +++ branches/ogEditor/src/ResourceTreePane.py 2008-05-25 14:21:26 UTC (rev 906) @@ -21,7 +21,7 @@ CT.CustomTreeCtrl.__init__(self, parent, id, pos, size, style, ctstyle, validator, name) CT.CustomTreeCtrl.SetConnectionPen( self, wx.Pen( wx.Colour(100,100,100), 1, wx.SOLID) ) - CT.CustomTreeCtrl.SetFont( self, wx.Font( 8, wx.FONTFAMILY_DEFAULT, wx.TR_DEFAULT_STYLE, wx.FONTWEIGHT_NORMAL ) ) + #CT.CustomTreeCtrl.SetFont( self, wx.Font( 8, wx.FONTFAMILY_DEFAULT, wx.TR_DEFAULT_STYLE, wx.FONTWEIGHT_NORMAL ) ) def OnInternalIdle(self): wx.PyScrolledWindow.OnInternalIdle( self ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spo...@us...> - 2008-05-25 11:51:07
|
Revision: 905 http://opengate.svn.sourceforge.net/opengate/?rev=905&view=rev Author: spom_spom Date: 2008-05-25 04:51:13 -0700 (Sun, 25 May 2008) Log Message: ----------- ogEditor: integrate opengate as module Modified Paths: -------------- branches/ogEditor/ogEditor.py branches/ogEditor/opengate-resources.cfg branches/ogEditor/resources.cfg branches/ogEditor/src/OgreWindowWx.py branches/ogEditor/src/ResourceTreePane.py trunk/resources.cfg trunk/src/Entity.cpp trunk/src/GameStateManager.cpp trunk/src/ResourceManager.cpp Modified: branches/ogEditor/ogEditor.py =================================================================== --- branches/ogEditor/ogEditor.py 2008-05-25 09:10:42 UTC (rev 904) +++ branches/ogEditor/ogEditor.py 2008-05-25 11:51:13 UTC (rev 905) @@ -21,6 +21,7 @@ try: import opengate as og + haveOpenGatePlugin = True except: haveOpenGatePlugin = False pass @@ -56,24 +57,27 @@ self.resourceManager_.ogreRoot = OgreWindow.ogreRoot self.resourceManager_.renderWindow = OgreWindow.renderWindow + OgreWindow.AddResources( "opengate-resources.cfg" ) + ogre.ResourceGroupManager.getSingleton().initialiseResourceGroup( "Opengate" ) + + for res in OgreWindow.resourceLocations: self.resourceManager_.addResourceLocation( res[0], res[1] ) - def initOpenGateResources_( self ): self.resourceManager_.loadGlobalIDs( "ids.xml" ) entityManager = self.resourceManager_.entityManager - entityManager.load( self.resourceManager_.resourceLocations( "General" ), "commodities" ); - entityManager.load( self.resourceManager_.resourceLocations( "General" ), "engines" ); - entityManager.load( self.resourceManager_.resourceLocations( "General" ), "capacitors" ); - entityManager.load( self.resourceManager_.resourceLocations( "General" ), "radars" ); - entityManager.load( self.resourceManager_.resourceLocations( "General" ), "shields" ); - entityManager.load( self.resourceManager_.resourceLocations( "General" ), "ecms" ); - entityManager.load( self.resourceManager_.resourceLocations( "General" ), "power_plants" ); - entityManager.load( self.resourceManager_.resourceLocations( "General" ), "guns" ); - entityManager.load( self.resourceManager_.resourceLocations( "General" ), "missiles" ); - entityManager.load( self.resourceManager_.resourceLocations( "General" ), "ships" ); - entityManager.load( self.resourceManager_.resourceLocations( "General" ), "stations" ); + entityManager.load( self.resourceManager_.resourceLocations( "Opengate" ), "commodities" ); + entityManager.load( self.resourceManager_.resourceLocations( "Opengate" ), "engines" ); + entityManager.load( self.resourceManager_.resourceLocations( "Opengate" ), "capacitors" ); + entityManager.load( self.resourceManager_.resourceLocations( "Opengate" ), "radars" ); + entityManager.load( self.resourceManager_.resourceLocations( "Opengate" ), "shields" ); + entityManager.load( self.resourceManager_.resourceLocations( "Opengate" ), "ecms" ); + entityManager.load( self.resourceManager_.resourceLocations( "Opengate" ), "power_plants" ); + entityManager.load( self.resourceManager_.resourceLocations( "Opengate" ), "guns" ); + entityManager.load( self.resourceManager_.resourceLocations( "Opengate" ), "missiles" ); + entityManager.load( self.resourceManager_.resourceLocations( "Opengate" ), "ships" ); + entityManager.load( self.resourceManager_.resourceLocations( "Opengate" ), "stations" ); def getName( self ): return "Opengate" @@ -140,7 +144,9 @@ self.og = Opengate( self.ogreRenderWindow ) self.og.initOpenGateResources_(); self.og.sector = og.Sector( self.ogreRenderWindow.sceneManager, None ) - self.og.AddToSceneGraph( self.sceneTree, self.sceneTree.root_ ) + self.resourceTree.buildResourceTree( ) + self.UpdateSceneGraphEvent() + self.og.AddToSceneGraph( self.sceneTree, self.sceneTree.GetRootItem() ) self.og.AddToResourcesTree( self.resourceTree, self.resourceTree.root_ ) else: Modified: branches/ogEditor/opengate-resources.cfg =================================================================== --- branches/ogEditor/opengate-resources.cfg 2008-05-25 09:10:42 UTC (rev 904) +++ branches/ogEditor/opengate-resources.cfg 2008-05-25 11:51:13 UTC (rev 905) @@ -1,14 +1,14 @@ -[General] +[Opengate] FileSystem=../../trunk/data/ FileSystem=../../trunk/data/capacitors FileSystem=../../trunk/data/commodities FileSystem=../../trunk/data/gui -FileSystem=../../trunk/data/gui/fonts -FileSystem=../../trunk/data/gui/layouts -FileSystem=../../trunk/data/gui/imagesets -FileSystem=../../trunk/data/gui/schemes -FileSystem=../../trunk/data/gui/looknfeel -FileSystem=../../trunk/data/gui/overlays +#FileSystem=../../trunk/data/gui/fonts +#FileSystem=../../trunk/data/gui/layouts +#FileSystem=../../trunk/data/gui/imagesets +#FileSystem=../../trunk/data/gui/schemes +#FileSystem=../../trunk/data/gui/looknfeel +#FileSystem=../../trunk/data/gui/overlays FileSystem=../../trunk/data/ecms FileSystem=../../trunk/data/engines FileSystem=../../trunk/data/guns @@ -29,5 +29,5 @@ Zip=../../trunk/data/skybox/simpleSkybox.zip -FileSystem=../../trunk/data/MediaFromOgre -FileSystem=../../trunk/data/MediaFromOgre/AdvancedMaterials +#FileSystem=../../trunk/data/MediaFromOgre +#FileSystem=../../trunk/data/MediaFromOgre/AdvancedMaterials Modified: branches/ogEditor/resources.cfg =================================================================== --- branches/ogEditor/resources.cfg 2008-05-25 09:10:42 UTC (rev 904) +++ branches/ogEditor/resources.cfg 2008-05-25 11:51:13 UTC (rev 905) @@ -1,15 +1,14 @@ [Bootstrap] -Zip=../../local/python-ogre/python-ogre/demos/media/packs/OgreCore.zip +Zip=../../../../local/python-ogre/python-ogre/demos/media/packs/OgreCore.zip [General] -FileSystem=../../local/python-ogre/python-ogre/demos/imemodels -FileSystem=../../local/python-ogre/python-ogre/demos/media -FileSystem=../../local/python-ogre/python-ogre/demos/media/fonts -FileSystem=../../local/python-ogre/python-ogre/demos/media/materials/programs -FileSystem=../../local/python-ogre/python-ogre/demos/media/materials/scripts -FileSystem=../../local/python-ogre/python-ogre/demos/media/materials/textures -FileSystem=../../local/python-ogre/python-ogre/demos/media/models -FileSystem=../../local/python-ogre/python-ogre/demos/media/overlays -FileSystem=../../local/python-ogre/python-ogre/demos/media/particle -FileSystem=../../local/python-ogre/python-ogre/demos/media/gui - +FileSystem=../../../../local/python-ogre/python-ogre/demos/imemodels +FileSystem=../../../../local/python-ogre/python-ogre/demos/media +FileSystem=../../../../local/python-ogre/python-ogre/demos/media/fonts +FileSystem=../../../../local/python-ogre/python-ogre/demos/media/materials/programs +FileSystem=../../../../local/python-ogre/python-ogre/demos/media/materials/scripts +FileSystem=../../../../local/python-ogre/python-ogre/demos/media/materials/textures +FileSystem=../../../../local/python-ogre/python-ogre/demos/media/models +FileSystem=../../../../local/python-ogre/python-ogre/demos/media/overlays +FileSystem=../../../../local/python-ogre/python-ogre/demos/media/particle +FileSystem=../../../../local/python-ogre/python-ogre/demos/media/gui Modified: branches/ogEditor/src/OgreWindowWx.py =================================================================== --- branches/ogEditor/src/OgreWindowWx.py 2008-05-25 09:10:42 UTC (rev 904) +++ branches/ogEditor/src/OgreWindowWx.py 2008-05-25 11:51:13 UTC (rev 905) @@ -63,14 +63,10 @@ self.SceneInitialisation() self.UpdateRender() self.SetFocus() #Gives KeyboardFocus - - def _OgreInit(self,size,renderSystem): - #Root creation - self.ogreRoot = ogre.Root( getPluginPath(), "ogre.cfg" ) - # setup resources + def AddResources( self, resourceFile ): config = ogre.ConfigFile() - config.load( 'resources.cfg' ) + config.load( resourceFile ) self.resourceLocations = [] section_iter = config.getSectionIterator() @@ -80,6 +76,13 @@ for key, path in settings: ogre.ResourceGroupManager.getSingleton().addResourceLocation( path, key, section_name, False) self.resourceLocations.append( (path, section_name ) ) + + def _OgreInit(self,size,renderSystem): + #Root creation + self.ogreRoot = ogre.Root( getPluginPath(), "ogre.cfg" ) + + # setup resources + self.AddResources( "resources.cfg" ); if os.path.exists( "ogre.cfg" ): self.ogreRoot.restoreConfig() Modified: branches/ogEditor/src/ResourceTreePane.py =================================================================== --- branches/ogEditor/src/ResourceTreePane.py 2008-05-25 09:10:42 UTC (rev 904) +++ branches/ogEditor/src/ResourceTreePane.py 2008-05-25 11:51:13 UTC (rev 905) @@ -33,6 +33,7 @@ return newNode def buildResourceTree( self ): + self.DeleteAllItems() self.root_ = root = self.AddRoot( "Resources" ) resManNode = self.AppendItem( root, "Ogre resource manager" ) Modified: trunk/resources.cfg =================================================================== --- trunk/resources.cfg 2008-05-25 09:10:42 UTC (rev 904) +++ trunk/resources.cfg 2008-05-25 11:51:13 UTC (rev 905) @@ -1,7 +1,7 @@ [Bootstrap] FileSystem=./data/startup -[General] +[Opengate] FileSystem=./data/ FileSystem=./data/commodities FileSystem=./data/capacitors Modified: trunk/src/Entity.cpp =================================================================== --- trunk/src/Entity.cpp 2008-05-25 09:10:42 UTC (rev 904) +++ trunk/src/Entity.cpp 2008-05-25 11:51:13 UTC (rev 905) @@ -105,7 +105,7 @@ CEGUI::Texture * texture = NULL; try { - texture = dynamic_cast< CEGUI::OgreCEGUIRenderer * >( ResourceManager::getSingleton().guiRenderer )->createTexture( imageName, "General"); + texture = dynamic_cast< CEGUI::OgreCEGUIRenderer * >( ResourceManager::getSingleton().guiRenderer )->createTexture( imageName, "Opengate"); } catch( CEGUI::Exception & e ){ if ( verbose ) LogManager::getSingleton().warn( e.getMessage().c_str() ); fail = true; @@ -201,7 +201,7 @@ meshName_ = meshName.substr( 0, meshName.rfind( ".mesh" ) ) + ".mesh" ; pMesh_ = Ogre::MeshManager::getSingleton().load( meshName_, - "General", + "Opengate", Ogre::HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY, Ogre::HardwareBuffer::HBU_STATIC_WRITE_ONLY, true, true); Modified: trunk/src/GameStateManager.cpp =================================================================== --- trunk/src/GameStateManager.cpp 2008-05-25 09:10:42 UTC (rev 904) +++ trunk/src/GameStateManager.cpp 2008-05-25 11:51:13 UTC (rev 905) @@ -268,17 +268,17 @@ bool GameStateManager::initialiseEntityManager(){ resources_.entityManager = new EntityManager( ); - resources_.entityManager->load( resources_.resourceLocations( "General" ), "commodities" ); - resources_.entityManager->load( resources_.resourceLocations( "General" ), "engines" ); - resources_.entityManager->load( resources_.resourceLocations( "General" ), "capacitors" ); - resources_.entityManager->load( resources_.resourceLocations( "General" ), "radars" ); - resources_.entityManager->load( resources_.resourceLocations( "General" ), "shields" ); - resources_.entityManager->load( resources_.resourceLocations( "General" ), "ecms" ); - resources_.entityManager->load( resources_.resourceLocations( "General" ), "power_plants" ); - resources_.entityManager->load( resources_.resourceLocations( "General" ), "guns" ); - resources_.entityManager->load( resources_.resourceLocations( "General" ), "missiles" ); - resources_.entityManager->load( resources_.resourceLocations( "General" ), "ships" ); - resources_.entityManager->load( resources_.resourceLocations( "General" ), "stations" ); + resources_.entityManager->load( resources_.resourceLocations( "Opengate" ), "commodities" ); + resources_.entityManager->load( resources_.resourceLocations( "Opengate" ), "engines" ); + resources_.entityManager->load( resources_.resourceLocations( "Opengate" ), "capacitors" ); + resources_.entityManager->load( resources_.resourceLocations( "Opengate" ), "radars" ); + resources_.entityManager->load( resources_.resourceLocations( "Opengate" ), "shields" ); + resources_.entityManager->load( resources_.resourceLocations( "Opengate" ), "ecms" ); + resources_.entityManager->load( resources_.resourceLocations( "Opengate" ), "power_plants" ); + resources_.entityManager->load( resources_.resourceLocations( "Opengate" ), "guns" ); + resources_.entityManager->load( resources_.resourceLocations( "Opengate" ), "missiles" ); + resources_.entityManager->load( resources_.resourceLocations( "Opengate" ), "ships" ); + resources_.entityManager->load( resources_.resourceLocations( "Opengate" ), "stations" ); return true; } @@ -352,9 +352,9 @@ } } - Ogre::ResourceGroupManager::getSingleton().initialiseResourceGroup( "General" ); - std::cout << "Ogre::ResourceGroupManager::getSingleton().initialiseResourceGroup( General ); " << std::endl; - Ogre::ResourceGroupManager::ResourceDeclarationList li = Ogre::ResourceGroupManager::getSingleton().getResourceDeclarationList( "General" ); + Ogre::ResourceGroupManager::getSingleton().initialiseResourceGroup( "Opengate" ); + std::cout << "Ogre::ResourceGroupManager::getSingleton().initialiseResourceGroup( Opengate ); " << std::endl; + Ogre::ResourceGroupManager::ResourceDeclarationList li = Ogre::ResourceGroupManager::getSingleton().getResourceDeclarationList( "Opengate" ); std::cout << li.size() << std::endl; for ( std::list<Ogre::ResourceGroupManager::ResourceDeclaration>::iterator it = li.begin(); it != li.end(); it ++ ){ std::cout << (*it).resourceName << std::endl; Modified: trunk/src/ResourceManager.cpp =================================================================== --- trunk/src/ResourceManager.cpp 2008-05-25 09:10:42 UTC (rev 904) +++ trunk/src/ResourceManager.cpp 2008-05-25 11:51:13 UTC (rev 905) @@ -134,11 +134,11 @@ std::string ResourceManager::findFullFileName( const std::string & fileName ){ - Ogre::FileSystemArchive pArch = Ogre::FileSystemArchive( (*resourceLocations_["General"].begin()), "FileSystem" ); + Ogre::FileSystemArchive pArch = Ogre::FileSystemArchive( (*resourceLocations_["Opengate"].begin()), "FileSystem" ); Ogre::StringVectorPtr file = pArch.find( fileName, true, false); if ( (*file).size() > 0 ){ - return (*resourceLocations_["General"].begin() ) + "/" + (*file)[ 0 ] ; + return (*resourceLocations_["Opengate"].begin() ) + "/" + (*file)[ 0 ] ; } // for ( unsigned int i = 0; i < (*file).size(); i ++ ){ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spo...@us...> - 2008-05-25 09:10:37
|
Revision: 904 http://opengate.svn.sourceforge.net/opengate/?rev=904&view=rev Author: spom_spom Date: 2008-05-25 02:10:42 -0700 (Sun, 25 May 2008) Log Message: ----------- separate opengate stuff from ogEditor base Modified Paths: -------------- branches/ogEditor/ogEditor.py branches/ogEditor/plugins.cfg branches/ogEditor/resources.cfg branches/ogEditor/src/OgreWindowWx.py branches/ogEditor/src/ResourceTreePane.py Added Paths: ----------- branches/ogEditor/opengate-resources.cfg Removed Paths: ------------- branches/ogEditor/ogEditor.sh branches/ogEditor/ogre.cfg Modified: branches/ogEditor/ogEditor.py =================================================================== --- branches/ogEditor/ogEditor.py 2008-05-24 17:26:37 UTC (rev 903) +++ branches/ogEditor/ogEditor.py 2008-05-25 09:10:42 UTC (rev 904) @@ -19,7 +19,11 @@ from OgreWindowWx import * -import opengate as og +try: + import opengate as og +except: + haveOpenGatePlugin = False + pass ID_MB_FILE_EXIT = wx.NewId() ID_MB_VIEW_SCENETREE = wx.NewId() @@ -83,6 +87,24 @@ itemList = shaderSchemes, cback = vp.setMaterialScheme ) + def AddToResourcesTree( self, tree, node): + + if self.resourceManager_: + ogResManNode = tree.AppendItem( node, "OpenGate resource manager" ) + + if self.resourceManager_.entityManager: + ogEntityManagerNode = tree.AppendItem( ogResManNode, "Entity manager" ) + categories = self.resourceManager_.entityManager.categories(); + + for category in categories: + categoryNode = tree.AppendItem( ogEntityManagerNode, category ) + + + def AddToSceneGraph( self, tree, node ): + opengateNode = tree.AppendItem( node, "Opengate" ) + tree.SetPyData( opengateNode, self ) + + class OGEditorPane: def __init__( self, ID, Name, mbShortcut, creator, defaultCheck ): self.ID_ = ID @@ -102,7 +124,7 @@ ws = WorkSpace self.allPanes = [] self.allPanes.append( OGEditorPane( ID_MB_VIEW_SCENETREE, NAME_SCENETREE, "\tF1", None, True ) ) - self.allPanes.append( OGEditorPane( ID_MB_VIEW_OBJECT, NAME_OBJECT , "\tF2", None, False ) ) + self.allPanes.append( OGEditorPane( ID_MB_VIEW_OBJECT, NAME_OBJECT , "\tF2", None, True ) ) self.allPanes.append( OGEditorPane( ID_MB_VIEW_RESOURCE, NAME_RESOURCE , "\tF3", None, False ) ) self.allPanes.append( OGEditorPane( ID_MB_VIEW_MATERIAL, NAME_MATERIAL , "\tF4", None, True ) ) self.allPanes.append( OGEditorPane( ID_MB_VIEW_PYCRUST, NAME_PYCRUST , "\tF9", None, False ) ) @@ -111,12 +133,21 @@ self.initToolBar_() self.initStatusBar_() self.initFrameManager_() + self.setDefaultProperties_(); - self.og = Opengate( self.ogreRenderWindow ) - self.og.initOpenGateResources_(); - self.og.sector = og.Sector( self.ogreRenderWindow.sceneManager, None ); + if haveOpenGatePlugin: + print "Found opengate plugin" + self.og = Opengate( self.ogreRenderWindow ) + self.og.initOpenGateResources_(); + self.og.sector = og.Sector( self.ogreRenderWindow.sceneManager, None ) + self.og.AddToSceneGraph( self.sceneTree, self.sceneTree.root_ ) + self.og.AddToResourcesTree( self.resourceTree, self.resourceTree.root_ ) + + else: + ohNode = self.createObject( "ogreMesh", "ogrehead.mesh" ) + ohNode.translate( ogre.Vector3( 0.0, 0.0, -100 ) ); - self.setDefaultProperties_(); + self.auiMgr.Update() def initMenuBar_( self ): @@ -145,7 +176,8 @@ self.tb.AddLabelTool( ID_TB_EXIT, "Exit", wx.ArtProvider_GetBitmap(wx.ART_QUIT), wx.NullBitmap, wx.ITEM_NORMAL, "", "") self.tb.AddLabelTool( ID_TB_TMP, "Up", wx.ArtProvider_GetBitmap(wx.ART_QUESTION), - wx.NullBitmap, wx.ITEM_NORMAL, "", "") + wx.NullBitmap, wx.ITEM_NORMAL, "tempary tool button to force scenegraph update", "") + self.Bind( wx.EVT_TOOL, self.doExit, id = ID_TB_EXIT ) self.Bind( wx.EVT_TOOL, self.UpdateSceneGraphEvent, id = ID_TB_TMP ) @@ -299,6 +331,7 @@ ws.activeResource = obj event.Skip() + self.auiMgr.Update() def doCheckTreeObject( self, event ): obj = event.GetEventObject().GetPyData( event.GetItem() ) @@ -317,8 +350,10 @@ node = sceneManager.getRootSceneNode().createChildSceneNode( name ); entity = sceneManager.createEntity( name, meshname ); node.attachObject( entity ); + self.UpdateSceneGraphEvent(); + return node - def UpdateSceneGraphEvent(self, event): + def UpdateSceneGraphEvent(self, event = None): self.sceneTree.DeleteAllItems() root = self.sceneTree.AddRoot( "SceneManager" ) self.sceneTree.SetPyData( root, self.ogreRenderWindow.sceneManager ) @@ -330,9 +365,6 @@ self.dumpSceneNode_( rootSceneNodeTreeNode, rootSceneNode ) self.sceneTree.Expand( root ) - opengateNode = self.sceneTree.AppendItem( root, "Opengate" ) - self.sceneTree.SetPyData( opengateNode, self.og ) - if event != None: event.Skip() Deleted: branches/ogEditor/ogEditor.sh =================================================================== --- branches/ogEditor/ogEditor.sh 2008-05-24 17:26:37 UTC (rev 903) +++ branches/ogEditor/ogEditor.sh 2008-05-25 09:10:42 UTC (rev 904) @@ -1,3 +0,0 @@ -export LD_LIBRARY_PATH=~/local/python-ogre.work/root/usr/lib -export PYTHONPATH=/home/carsten/local/python-ogre.work/root/usr/lib64/python2.5/site-packages -python ogEditor.py Deleted: branches/ogEditor/ogre.cfg =================================================================== --- branches/ogEditor/ogre.cfg 2008-05-24 17:26:37 UTC (rev 903) +++ branches/ogEditor/ogre.cfg 2008-05-25 09:10:42 UTC (rev 904) @@ -1,7 +0,0 @@ -Render System=OpenGL Rendering Subsystem - -[OpenGL Rendering Subsystem] -FSAA=0 -Full Screen=Yes -RTT Preferred Mode=FBO -Video Mode=800 x 600 Added: branches/ogEditor/opengate-resources.cfg =================================================================== --- branches/ogEditor/opengate-resources.cfg (rev 0) +++ branches/ogEditor/opengate-resources.cfg 2008-05-25 09:10:42 UTC (rev 904) @@ -0,0 +1,33 @@ +[General] +FileSystem=../../trunk/data/ +FileSystem=../../trunk/data/capacitors +FileSystem=../../trunk/data/commodities +FileSystem=../../trunk/data/gui +FileSystem=../../trunk/data/gui/fonts +FileSystem=../../trunk/data/gui/layouts +FileSystem=../../trunk/data/gui/imagesets +FileSystem=../../trunk/data/gui/schemes +FileSystem=../../trunk/data/gui/looknfeel +FileSystem=../../trunk/data/gui/overlays +FileSystem=../../trunk/data/ecms +FileSystem=../../trunk/data/engines +FileSystem=../../trunk/data/guns +FileSystem=../../trunk/data/materials +FileSystem=../../trunk/data/asteroids +FileSystem=../../trunk/data/misc +FileSystem=../../trunk/data/missiles +FileSystem=../../trunk/data/power_plants +FileSystem=../../trunk/data/radars +FileSystem=../../trunk/data/shields +FileSystem=../../trunk/data/ships/octavius/apteryx +FileSystem=../../trunk/data/ships/quantar/storm +FileSystem=../../trunk/data/ships/squadrok/squid +FileSystem=../../trunk/data/ships/tauseti/lady_kickstart +FileSystem=../../trunk/data/skybox +FileSystem=../../trunk/data/stations +FileSystem=../../trunk/data/textures + +Zip=../../trunk/data/skybox/simpleSkybox.zip + +FileSystem=../../trunk/data/MediaFromOgre +FileSystem=../../trunk/data/MediaFromOgre/AdvancedMaterials Modified: branches/ogEditor/plugins.cfg =================================================================== --- branches/ogEditor/plugins.cfg 2008-05-24 17:26:37 UTC (rev 903) +++ branches/ogEditor/plugins.cfg 2008-05-25 09:10:42 UTC (rev 904) @@ -2,7 +2,6 @@ ## Use this for Windows # Define plugin folder -#PluginFolder=/home/carsten/local/python-ogre.work/root/usr/lib/OGRE PluginFolder=/usr/lib/OGRE #Plugin=RenderSystem_GL.dll #Plugin=RenderSystem_Direct3D9.dll Modified: branches/ogEditor/resources.cfg =================================================================== --- branches/ogEditor/resources.cfg 2008-05-24 17:26:37 UTC (rev 903) +++ branches/ogEditor/resources.cfg 2008-05-25 09:10:42 UTC (rev 904) @@ -1,38 +1,15 @@ [Bootstrap] -#Zip=../../../python-ogre/python-ogre/demos/media/packs/OgreCore.zip -FileSystem=../../trunk/data/startup +Zip=../../local/python-ogre/python-ogre/demos/media/packs/OgreCore.zip -# Resource locations to be added to the default path [General] -FileSystem=../../trunk/data/ -FileSystem=../../trunk/data/capacitors -FileSystem=../../trunk/data/commodities -FileSystem=../../trunk/data/gui -FileSystem=../../trunk/data/gui/fonts -FileSystem=../../trunk/data/gui/layouts -FileSystem=../../trunk/data/gui/imagesets -FileSystem=../../trunk/data/gui/schemes -FileSystem=../../trunk/data/gui/looknfeel -FileSystem=../../trunk/data/gui/overlays -FileSystem=../../trunk/data/ecms -FileSystem=../../trunk/data/engines -FileSystem=../../trunk/data/guns -FileSystem=../../trunk/data/materials -FileSystem=../../trunk/data/asteroids -FileSystem=../../trunk/data/misc -FileSystem=../../trunk/data/missiles -FileSystem=../../trunk/data/power_plants -FileSystem=../../trunk/data/radars -FileSystem=../../trunk/data/shields -FileSystem=../../trunk/data/ships/octavius/apteryx -FileSystem=../../trunk/data/ships/quantar/storm -FileSystem=../../trunk/data/ships/squadrok/squid -FileSystem=../../trunk/data/ships/tauseti/lady_kickstart -FileSystem=../../trunk/data/skybox -FileSystem=../../trunk/data/stations -FileSystem=../../trunk/data/textures +FileSystem=../../local/python-ogre/python-ogre/demos/imemodels +FileSystem=../../local/python-ogre/python-ogre/demos/media +FileSystem=../../local/python-ogre/python-ogre/demos/media/fonts +FileSystem=../../local/python-ogre/python-ogre/demos/media/materials/programs +FileSystem=../../local/python-ogre/python-ogre/demos/media/materials/scripts +FileSystem=../../local/python-ogre/python-ogre/demos/media/materials/textures +FileSystem=../../local/python-ogre/python-ogre/demos/media/models +FileSystem=../../local/python-ogre/python-ogre/demos/media/overlays +FileSystem=../../local/python-ogre/python-ogre/demos/media/particle +FileSystem=../../local/python-ogre/python-ogre/demos/media/gui -Zip=../../trunk/data/skybox/simpleSkybox.zip - -FileSystem=../../trunk/data/MediaFromOgre -FileSystem=../../trunk/data/MediaFromOgre/AdvancedMaterials Modified: branches/ogEditor/src/OgreWindowWx.py =================================================================== --- branches/ogEditor/src/OgreWindowWx.py 2008-05-24 17:26:37 UTC (rev 903) +++ branches/ogEditor/src/OgreWindowWx.py 2008-05-25 09:10:42 UTC (rev 904) @@ -79,9 +79,6 @@ settings = section_iter.getNext() for key, path in settings: ogre.ResourceGroupManager.getSingleton().addResourceLocation( path, key, section_name, False) - #if self.ogResourceMan: - #self.ogResourceMan.addResourceLocation( path, section_name ) - self.resourceLocations.append( (path, section_name ) ) if os.path.exists( "ogre.cfg" ): @@ -141,7 +138,7 @@ renderWindow = self.ogreRoot.createRenderWindow('wxPython render window', size[ 0 ], size[ 1 ], False, renderParameters) renderWindow.active = True self.renderWindow = renderWindow - + ogre.ResourceGroupManager.getSingleton().initialiseAllResourceGroups() def _OnSize(self, event): Modified: branches/ogEditor/src/ResourceTreePane.py =================================================================== --- branches/ogEditor/src/ResourceTreePane.py 2008-05-24 17:26:37 UTC (rev 903) +++ branches/ogEditor/src/ResourceTreePane.py 2008-05-25 09:10:42 UTC (rev 904) @@ -1,6 +1,5 @@ import wx import wx.lib.customtreectrl as CT -import opengate as og import ogre.renderer.OGRE as ogre @@ -34,13 +33,12 @@ return newNode def buildResourceTree( self ): - root = self.AddRoot( "Resources" ) + self.root_ = root = self.AddRoot( "Resources" ) resManNode = self.AppendItem( root, "Ogre resource manager" ) ## Insert resources group managers (Material, Mesh, Texture etc. ) ogreResourceGroupManager = ogre.ResourceGroupManager.getSingleton() - ogResourceManager = og.ResourceManager.getSingleton() resManIter = ogreResourceGroupManager.getResourceManagerIterator() while resManIter.hasMoreElements(): @@ -66,13 +64,14 @@ resGroupName = resGroups[ i ] resGroupNode = self.addItem( resGroupManNode, resGroupName, None ) - if ogResourceManager: - resLocNode = self.addItem( resGroupNode, "Resource group locations", None ) + #ogResourceManager = og.ResourceManager.getSingleton() + #if ogResourceManager: + #resLocNode = self.addItem( resGroupNode, "Resource group locations", None ) - if not resGroupName == "Autodetect" and not resGroupName == "Internal": - resLocationList = ogResourceManager.resourceLocations( resGroupName ) - for resLocation in resLocationList: - self.addItem( resLocNode, resLocation, None ) + #if not resGroupName == "Autodetect" and not resGroupName == "Internal": + #resLocationList = ogResourceManager.resourceLocations( resGroupName ) + #for resLocation in resLocationList: + #self.addItem( resLocNode, resLocation, None ) ## Insert resources for each groups resNameNode = self.addItem( resGroupNode, "Resources", None ) @@ -83,19 +82,8 @@ # insert Opengate specific resources - if ogResourceManager: - ogResManNode = self.AppendItem( root, "OpenGate resource manager" ) - - - if ogResourceManager.entityManager: - ogEntityManagerNode = self.AppendItem( ogResManNode, "Entity manager" ) - entityManager = ogResourceManager.entityManager - categories = entityManager.categories(); + - for category in categories: - categoryNode = self.AppendItem( ogEntityManagerNode, category ) - - ## Insert resources group managers (Material, Mesh, Texture etc. ) # this fails ??? #fileInfoList = ogre.ResourceGroupManager.getSingleton().findResourceFileInfo( "General", "*.png") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spo...@us...> - 2008-05-24 17:26:34
|
Revision: 903 http://opengate.svn.sourceforge.net/opengate/?rev=903&view=rev Author: spom_spom Date: 2008-05-24 10:26:37 -0700 (Sat, 24 May 2008) Log Message: ----------- Add very basic ogre.material editor, properties can be changed on the fly but not yet stored. Modified Paths: -------------- branches/ogEditor/ogEditor.py branches/ogEditor/propgridtest.py branches/ogEditor/src/ObjectInspectorPanels.py branches/ogEditor/src/OgreWindowWx.py branches/ogEditor/src/PropertyGrid.py Modified: branches/ogEditor/ogEditor.py =================================================================== --- branches/ogEditor/ogEditor.py 2008-05-21 20:04:57 UTC (rev 902) +++ branches/ogEditor/ogEditor.py 2008-05-24 17:26:37 UTC (rev 903) @@ -21,22 +21,11 @@ import opengate as og -#class OGView3D( OgreWindow ): - #def _PopulateScene(self): - ##automatic called by parent init -## self.headEnt = self.sceneManager.createEntity("ogreHead", "athene.mesh") - ##self.headEnt = self.sceneManager.createEntity("ogreHead", "ogrehead.mesh") - ###self.headEnt = self.sceneManager.createEntity("ogreHead", "Firefly.mesh") - ##self.headNode = self.sceneManager.getRootSceneNode().createChildSceneNode( ) - ##self.headNode.attachObject( self.headEnt ) - ##self.sceneManager.setAmbientLight( (0.0, 0.0, 1.0, 1.0) ) - #sector = og.Sector( self.sceneManager, None ) - ##sector.populate("testsector") - ID_MB_FILE_EXIT = wx.NewId() ID_MB_VIEW_SCENETREE = wx.NewId() ID_MB_VIEW_OBJECT = wx.NewId() ID_MB_VIEW_RESOURCE = wx.NewId() +ID_MB_VIEW_MATERIAL = wx.NewId() ID_MB_VIEW_PYCRUST = wx.NewId() ID_TB_EXIT = wx.NewId() ID_TB_TMP = wx.NewId() @@ -44,6 +33,7 @@ NAME_SCENETREE = "Scene tree" NAME_OBJECT = "Property inspector" NAME_RESOURCE = "Resource browser" +NAME_MATERIAL = "Material editor" NAME_PYCRUST = "PyCrust" class WorkSpace: @@ -54,11 +44,18 @@ class Opengate: resourceManager_ = None - def __init__( self, ): + def __init__( self, OgreWindow ): + self.resourceManager_ = og.ResourceManager() self.resourceManager_.logManager = og.LogManager() self.resourceManager_.entityManager = og.EntityManager( ) + self.resourceManager_.ogreRoot = OgreWindow.ogreRoot + self.resourceManager_.renderWindow = OgreWindow.renderWindow + for res in OgreWindow.resourceLocations: + self.resourceManager_.addResourceLocation( res[0], res[1] ) + + def initOpenGateResources_( self ): self.resourceManager_.loadGlobalIDs( "ids.xml" ) entityManager = self.resourceManager_.entityManager @@ -85,8 +82,16 @@ value = "Default", itemList = shaderSchemes, cback = vp.setMaterialScheme ) - +class OGEditorPane: + def __init__( self, ID, Name, mbShortcut, creator, defaultCheck ): + self.ID_ = ID + self.name_ = Name + self.mbItem_ = None + self.mbShortcut_ = mbShortcut + self.creator_ = creator + self.defaultCheck_ = defaultCheck + class MainFrame(wx.Frame): def __init__(self, *args, **kwds): kwds["style"] = wx.DEFAULT_FRAME_STYLE @@ -95,14 +100,19 @@ global ws ws = WorkSpace + self.allPanes = [] + self.allPanes.append( OGEditorPane( ID_MB_VIEW_SCENETREE, NAME_SCENETREE, "\tF1", None, True ) ) + self.allPanes.append( OGEditorPane( ID_MB_VIEW_OBJECT, NAME_OBJECT , "\tF2", None, False ) ) + self.allPanes.append( OGEditorPane( ID_MB_VIEW_RESOURCE, NAME_RESOURCE , "\tF3", None, False ) ) + self.allPanes.append( OGEditorPane( ID_MB_VIEW_MATERIAL, NAME_MATERIAL , "\tF4", None, True ) ) + self.allPanes.append( OGEditorPane( ID_MB_VIEW_PYCRUST, NAME_PYCRUST , "\tF9", None, False ) ) - self.og = Opengate() - self.initMenuBar_() self.initToolBar_() self.initStatusBar_() self.initFrameManager_() + self.og = Opengate( self.ogreRenderWindow ) self.og.initOpenGateResources_(); self.og.sector = og.Sector( self.ogreRenderWindow.sceneManager, None ); @@ -117,24 +127,18 @@ self.mb.Append( self.mbFile, "&File" ) self.mbView = wx.Menu() - self.mbViewScenetree = wx.MenuItem( self.mbView, ID_MB_VIEW_SCENETREE, NAME_SCENETREE + "\tF1", "", wx.ITEM_CHECK) - self.mbViewObject = wx.MenuItem( self.mbView, ID_MB_VIEW_OBJECT, NAME_OBJECT + "\tF2", "", wx.ITEM_CHECK) - self.mbViewResource = wx.MenuItem( self.mbView, ID_MB_VIEW_RESOURCE, NAME_RESOURCE + "\tF3", "", wx.ITEM_CHECK) - self.mbViewPyCrust = wx.MenuItem( self.mbView, ID_MB_VIEW_PYCRUST, NAME_PYCRUST + "\tF9", "", wx.ITEM_CHECK) - self.mbView.AppendItem( self.mbViewScenetree ) - self.mbView.AppendItem( self.mbViewObject ) - self.mbView.AppendItem( self.mbViewResource ) - self.mbView.AppendItem( self.mbViewPyCrust ) + + for pane in self.allPanes: + pane.mbItem_ = wx.MenuItem( self.mbView, pane.ID_, pane.name_ + pane.mbShortcut_, "", wx.ITEM_CHECK) + self.mbView.AppendItem( pane.mbItem_ ) + self.Bind( wx.EVT_MENU, self.doSwitchViewPane, id = pane.ID_ ) + self.mb.Append( self.mbView, "&View") self.SetMenuBar( self.mb ) self.Bind( wx.EVT_MENU, self.doExit, id = wx.ID_EXIT ) - self.Bind( wx.EVT_MENU, self.doSwitchViewPane, id = ID_MB_VIEW_SCENETREE) - self.Bind( wx.EVT_MENU, self.doSwitchViewPane, id = ID_MB_VIEW_OBJECT) - self.Bind( wx.EVT_MENU, self.doSwitchViewPane, id = ID_MB_VIEW_RESOURCE) - self.Bind( wx.EVT_MENU, self.doSwitchViewPane, id = ID_MB_VIEW_PYCRUST) - + def initToolBar_( self ): self.tb = wx.ToolBar(self, -1) self.SetToolBar( self.tb ) @@ -177,6 +181,11 @@ BestSize( wx.Size( 250, 200 ) ).MinSize( wx.Size( 250, 200 ) ). Left().Layer( 1 ).Position( 2 ).CloseButton(True).MaximizeButton(True)) + self.auiMgr.AddPane( self.createMaterialInspector_(), + wx.aui.AuiPaneInfo().Name( NAME_MATERIAL ).Caption( NAME_MATERIAL ). + BestSize( wx.Size( 250, 200 ) ).MinSize( wx.Size( 250, 200 ) ). + Left().Layer( 1 ).Position( 4 ).CloseButton(True).MaximizeButton(True)) + self.auiMgr.AddPane( self.createResourceInspector_(), wx.aui.AuiPaneInfo().Name( NAME_RESOURCE ).Caption( NAME_RESOURCE ). BestSize( wx.Size( 250, 200 ) ).MinSize( wx.Size( 250, 200 ) ). @@ -188,7 +197,7 @@ ################################################################################# def createRenderWindow_( self ): - self.ogreRenderWindow = OgreWindow( self, -1, ogResourceMan = self.og.resourceManager_ ) + self.ogreRenderWindow = OgreWindow( self, -1 ) return self.ogreRenderWindow def createCrustWindow_( self ): @@ -210,11 +219,17 @@ self.sceneTree.AssignImageList( il ) self.Bind( wx.EVT_TREE_SEL_CHANGED, self.doSelectTreeObject, self.sceneTree ) + self.Bind( CT.EVT_TREE_ITEM_CHECKED, self.doCheckTreeObject, self.sceneTree ) + #EVT_TREE_ITEM_CHECKING return self.sceneTree def createObjectInspector_( self ): - self.objectInspector = ObjectInspectorPanel( self, -1, wx.Point(0, 0), wx.Size(160, 250) ) + self.objectInspector = ObjectInspectorPanel( self, self, -1, wx.Point(0, 0), wx.Size(160, 250) ) return self.objectInspector + + def createMaterialInspector_( self ): + self.materialInspector = MaterialInspectorPanel( self, self, -1, wx.Point(0, 0), wx.Size(160, 250) ) + return self.materialInspector def createResourceInspector_( self ): self.resourceTree = ResourceTreePane( self, -1, wx.Point( 0, 0 ), wx.Size( 160, 250 ), @@ -225,18 +240,13 @@ def setDefaultProperties_( self ): self.SetTitle("ogEditor") self.sb.SetStatusWidths([-1]) - - self.mbViewScenetree.Check( ) - self.auiMgr.GetPane( NAME_SCENETREE ).Show() - - self.mbViewObject.Check( ) - self.auiMgr.GetPane( NAME_OBJECT ).Show() - self.mbViewResource.Check( False ) - self.auiMgr.GetPane( NAME_RESOURCE ).Hide() - - self.mbViewPyCrust.Check( False ) - self.auiMgr.GetPane( NAME_PYCRUST ).Hide() + for pane in self.allPanes: + pane.mbItem_.Check( pane.defaultCheck_ ) + if pane.defaultCheck_: + self.auiMgr.GetPane( pane.name_ ).Show() + else: + self.auiMgr.GetPane( pane.name_ ).Hide() self.UpdateSceneGraphEvent( None ) self.resourceTree.buildResourceTree( ) @@ -251,29 +261,21 @@ def doClosePane( self, event ): caption = event.GetPane().caption - if caption == NAME_SCENETREE: - self.mb.Check( ID_MB_VIEW_SCENETREE, False ) - elif caption == NAME_OBJECT: - self.mb.Check( ID_MB_VIEW_OBJECT, False ) - elif caption == NAME_RESOURCE: - self.mb.Check( ID_MB_VIEW_RESOURCE, False ) - elif caption == NAME_PYCRUST: - self.mb.Check( ID_MB_VIEW_PYCRUST, False ) + for pane in self.allPanes: + if pane.name_ == caption: + self.mb.Check( pane.ID_, False ) + break def doSwitchViewPane( self, event ): - if event.GetId() == ID_MB_VIEW_SCENETREE: - pane = self.auiMgr.GetPane( NAME_SCENETREE ) - elif event.GetId() == ID_MB_VIEW_OBJECT: - pane = self.auiMgr.GetPane( NAME_OBJECT ) - elif event.GetId() == ID_MB_VIEW_RESOURCE: - pane = self.auiMgr.GetPane( NAME_RESOURCE ) - elif event.GetId() == ID_MB_VIEW_PYCRUST: - pane = self.auiMgr.GetPane( NAME_PYCRUST ) + for pane in self.allPanes: + if event.GetId() == pane.ID_: + auiPane = self.auiMgr.GetPane( pane.name_ ) + if event.IsChecked(): + auiPane.Show( ) + else: + auiPane.Hide() + break - if event.IsChecked(): - pane.Show( ) - else: - pane.Hide() self.auiMgr.Update() event.Skip() @@ -282,8 +284,12 @@ obj = event.GetEventObject().GetPyData( event.GetEventObject().GetSelection() ) if type( obj ) == ogre.SceneNode: self.ogreRenderWindow.camera.lookAt( obj.getWorldPosition() ) - self.objectInspector.showData( obj ); + if type( obj ) == ogre.Material: + self.materialInspector.showData( obj ); + else: + self.objectInspector.showData( obj ); + if ws.activeResource: if type( ws.activeResource ) == ogre.SceneNode: ws.activeResource.showBoundingBox( False ); @@ -294,6 +300,14 @@ ws.activeResource = obj event.Skip() + def doCheckTreeObject( self, event ): + obj = event.GetEventObject().GetPyData( event.GetItem() ) + checked = event.GetEventObject().IsItemChecked( event.GetItem() ); + obj.setVisible( checked ) + + event.GetEventObject().EnableChildren( event.GetItem(), checked) + event.Skip() + ################################################################################# # utils ################################################################################# @@ -345,11 +359,15 @@ object_it = scenenode.getAttachedObjectIterator() while object_it.hasMoreElements(): m = object_it.getNext() - item = self.sceneTree.AppendItem( treenode, m.getName() ) + item = self.sceneTree.AppendItem( treenode, m.getName(), 1 ) #item = self.sceneTree.AppendItem( treenode, m.getMovableType() + "-" + m.getName() ) if m.getMovableType() == "Entity": id = self.SceneEntityIconID + if m.getNumSubEntities() > 1: + for i in range( 0, m.getNumSubEntities() ): + subentNode = self.sceneTree.AppendItem( item, m.getSubEntity( i ).getMaterialName(), 1 ) + self.sceneTree.SetPyData( subentNode, m.getSubEntity( i ) ) else: id = self.SceneUnknownIconID Modified: branches/ogEditor/propgridtest.py =================================================================== --- branches/ogEditor/propgridtest.py 2008-05-21 20:04:57 UTC (rev 902) +++ branches/ogEditor/propgridtest.py 2008-05-24 17:26:37 UTC (rev 903) @@ -23,40 +23,61 @@ self.SetSize( wx.Size( 800, 600 ) ) self.propertyGrid = PropertyMainGrid( self, -1, wx.DefaultPosition, wx.DefaultSize ) - self.propertyGrid.appendRowItemName( "Main", "name" ) - self.propertyGrid.appendRowItemName( "float", value = 10.1, format = FORMAT_FLOAT, cback = test.printValue ) - self.propertyGrid.appendRowItemName( "int", value = 10, format = FORMAT_INT, cback = test.printValue ) + self.propertyGrid.appendRowItemName( "Main", "name", toolTip = "toolTip" ) + self.propertyGrid.appendRowItemName( "float", value = 10.1, format = FORMAT_FLOAT, cback = test.printValue, toolTip = "toolTip" ) + self.propertyGrid.appendRowItemName( "int", value = 10, format = FORMAT_INT, cback = test.printValue, toolTip = "toolTip" ) - self.propertyGrid.appendRowItemSlider( "slider", cback = test.printValue ) - self.propertyGrid.appendRowItemColourSelect( "Colour", cback = test.printValue ) + self.propertyGrid.appendRowItemSlider( "slider", cback = test.printValue, toolTip = "toolTip" ) + self.propertyGrid.appendRowItemColourSelect( "Colour", cback = test.printValue, toolTip = "toolTip" ) - pane = PropertyPaneItem( self.propertyGrid, "testPane " ) - self.propertyGrid.appendPane( pane ) + collpane = self.propertyGrid.createAndAppendPane( "Child 1", toolTip = "toolTip" ) + collpane.appendRowItemName( "Child 1 A", "name", toolTip = "toolTip" ) + collpane.appendRowItemName( "Child 1 B", "name", toolTip = "toolTip" ) + collpane.appendRowItemName( "Child 1 C", "name", toolTip = "toolTip" ) - text = PropertyRowItemName( pane.GetPane(), "Name", "Val") - pane.appendRow( text ) - pane.Layout() - pane.Show() + subPane = collpane.createAndAppendPane( "Child 1-1", toolTip = "toolTip" ) + subPane.appendRowItemName( "Child 1-1 A", "name", toolTip = "toolTip") + subPane.appendRowItemName( "Child 1-1 B", "name", toolTip = "toolTip") + subPane.appendRowItemName( "Child 1-1 C", "name", toolTip = "toolTip") + subPane.appendPaneColourSelect( "Colour", cback = test.printValue, toolTip = "toolTip" ); + + subPane = collpane.createAndAppendPane( "Child 1-2", toolTip = "toolTip" ) + subPane.appendRowItemName( "Child 1-2 A", "name", toolTip = "toolTip") + subPane.appendRowItemName( "Child 1-2 B", "name", toolTip = "toolTip") + subPane.appendRowItemName( "Child 1-2 C", "name", toolTip = "toolTip") + subPane.appendPaneColourSelect( "Colour", cback = test.printValue , toolTip = "toolTip"); + + collpane2 = self.propertyGrid.createAndAppendPane( "Child 2", toolTip = "toolTip" ) + collpane2.appendRowItemName( "Child 2 A", "name", toolTip = "toolTip" ) + collpane2.appendRowItemName( "Child 2 B", "name", toolTip = "toolTip" ) + collpane2.appendRowItemName( "Child 2 C", "name", toolTip = "toolTip" ) + + subPane2 = collpane2.createAndAppendPane( "Child 1-1", toolTip = "toolTip" ) + subPane2.appendRowItemName( "Child 2-1 A", "name", toolTip = "toolTip") + subPane2.appendRowItemName( "Child 2-1 B", "name", toolTip = "toolTip") + subPane2.appendRowItemName( "Child 2-1 C", "name", toolTip = "toolTip") + subPane2.appendRowItemColourSelect( "Colour", cback = test.printValue, toolTip = "toolTip" ); self.propertyGrid.appendRowItemSlider( "expDensity", 0.0001, 0.0002, format = FORMAT_LOG10, - cback = test.printValue ) + cback = test.printValue, toolTip = "toolTip" ) modes = ("one", "two", "three" ) self.propertyGrid.appendRowItemChoice( "Choice set", value = "one", - itemList = modes, cback = test.printValue ) + itemList = modes, cback = test.printValue , toolTip = "toolTip") dic = ( (1, "eins"), (2, "zwei"), (3, "drei")) self.propertyGrid.appendRowItemChoice( "Choice map", value = 1, - itemMap = dic, cback = test.printValue ) + itemMap = dic, cback = test.printValue , toolTip = "toolTip") - self.propertyGrid.appendRowItemFileSelect( "File", cback = test.printValue ) + self.propertyGrid.appendRowItemFileSelect( "File", cback = test.printValue, toolTip = "toolTip" ) self.propertyGrid.appendRowItemFileSelect( "Files", cback = test.printValue, - flag = wx.MULTIPLE ) + flag = wx.MULTIPLE, toolTip = "toolTip" ) - self.propertyGrid.appendRowItemButton( "Button", cback = test.printValue ) - self.propertyGrid.appendRowItemInfo( "here is a long an verbose text entry" ) + self.propertyGrid.appendRowItemButton( "Button", cback = test.printValue, toolTip = "toolTip" ) + self.propertyGrid.appendRowItemInfo( "here is a long an verbose text entry", toolTip = "toolTip" ) + self.propertyGrid.appendRowItemCheck( "Check button", cback = test.printValue , toolTip = "toolTip") if __name__ == "__main__": ogEditor = wx.PySimpleApp(0) Modified: branches/ogEditor/src/ObjectInspectorPanels.py =================================================================== --- branches/ogEditor/src/ObjectInspectorPanels.py 2008-05-21 20:04:57 UTC (rev 902) +++ branches/ogEditor/src/ObjectInspectorPanels.py 2008-05-24 17:26:37 UTC (rev 903) @@ -12,7 +12,24 @@ def toStr( vec ): return ("%g, %g, %g"%(vec.x, vec.y, vec.z)) + +ogreCompareFunctions = ((ogre.CMPF_ALWAYS_FAIL, "CMPF_ALWAYS_FAIL"), + (ogre.CMPF_ALWAYS_PASS, "CMPF_ALWAYS_PASS"), + (ogre.CMPF_LESS, "CMPF_LESS"), + (ogre.CMPF_LESS_EQUAL, "CMPF_LESS_EQUAL"), + (ogre.CMPF_EQUAL, "CMPF_EQUAL"), + (ogre.CMPF_NOT_EQUAL, "CMPF_NOT_EQUAL"), + (ogre.CMPF_GREATER_EQUAL, "CMPF_GREATER_EQUAL"), + (ogre.CMPF_GREATER, "CMPF_GREATER") ) +ogreCullingMode = (( ogre.CULL_NONE, "CULL_NONE"), # Hardware never culls triangles and renders everything it receives. + (ogre.CULL_CLOCKWISE, "CULL_CLOCKWISE" ), # Hardware culls triangles whose vertices are listed clockwise in the view (default). + (ogre.CULL_ANTICLOCKWISE, "CULL_ANTICLOCKWISE" ) )# Hardware culls triangles whose vertices are listed anticlockwise in the view. + +ogreShadeOptions = (( ogre.SO_FLAT , "SO_FLAT" ), + ( ogre.SO_GOURAUD, "SO_GOURAUD" ), + ( ogre.SO_PHONG, "SO_PHONG" ) ) + class PropertyCollapsibleOgreFogPane( PropertyPaneItem ): def __init__( self, parent, name, object = None ): PropertyPaneItem.__init__(self, parent, name) @@ -80,9 +97,10 @@ self.object.setFog(self.mode, col, self.expDensity, self.linearStart, self.linearEnd ) class ObjectInspectorPanel(wx.Panel): - def __init__(self, *args, **kwds): + def __init__(self, parent, *args, **kwds): kwds["style"] = wx.TAB_TRAVERSAL wx.Panel.__init__(self, *args, **kwds) + self.parent_ = parent self.typeStaticText = wx.StaticText(self, -1, "Type") self.propertyGrid = PropertyMainGrid( self, -1, style=wx.SIMPLE_BORDER ) @@ -121,6 +139,8 @@ self.showNone() if type( data ) == ogre.SceneNode: self.showSceneNode( data ) + elif type( data ) == ogre.SubEntity: + self.showSubEntity( data ) elif type( data ) == ogre.Entity: self.showEntity( data ) elif issubclass( type( data ), ogre.SceneManager): @@ -200,13 +220,20 @@ def showEntity( self, data ): self.typeStaticText.SetLabel( "ogre.Entity" ) self.showName( data ) + if data.getNumSubEntities() == 1: + self.propertyGrid.appendRowItemName( "Material", data.getSubEntity( 0 ).getMaterialName() ) + self.parent_.materialInspector.showData( data.getSubEntity( 0 ).getMaterial() ) + + def showSubEntity( self, data ): + self.typeStaticText.SetLabel( "ogre.SubEntity" ) + self.propertyGrid.appendRowItemName( "Material", data.getMaterialName() ) + self.parent_.materialInspector.showData( data.getMaterial() ) def showResource( self, data ): self.typeStaticText.SetLabel( "Resource: " + data.getCreator().getResourceType() ) self.showName( data ); self.propertyGrid.appendRowItemName( "Group", data.getGroup() ) self.propertyGrid.appendRowItemName( "Origin", data.getOrigin() ) - # params = data.getParameters() # if len( params ) > 0: # pane = self.propertyTree.createPane( "Parameters" ) @@ -216,7 +243,7 @@ # # if type( data ) == ogre.Texture: # print "Texture" - + def showMovableObject( self, data ): self.typeStaticText.SetLabel( "Movable object: " + data.getMovableType() ) self.showName( data ); @@ -233,5 +260,159 @@ # end of class ObjectInspectorPanel +class MaterialInspectorPanel( ObjectInspectorPanel ): + def showData( self, data ): + self.propertyGrid.clean() + if type( data ) == ogre.Material: + self.showMaterial( data ) + else: + print "data is no material", data + def showPass( self, data, parenpane ): + collpane = parenpane.createAndAppendPane( "Pass " + data.getName() ) + + collpane.appendRowItemInfo( "programmable %d" % data.isProgrammable(), + toolTip ="Returns true if this pass is programmable ie includes either a vertex or fragment program." ) + + collpane.appendRowItemInfo( "hasVertexProgram %d" % data.hasVertexProgram(), + toolTip ="Returns true if this pass uses a programmable vertex pipeline." ) + + collpane.appendRowItemInfo( "hasFragmentProgram %d" % data.hasFragmentProgram(), + toolTip ="Returns true if this pass uses a programmable fragment pipeline." ) + + + #Returns true if this pass uses a shadow caster vertex program. + #bool hasShadowCasterVertexProgram (void) const + + #Returns true if this pass uses a shadow receiver vertex program. + #bool hasShadowReceiverVertexProgram (void) const + + #Returns true if this pass uses a shadow receiver fragment program. + #bool hasShadowReceiverFragmentProgram (void) const + + collpane.appendPaneColourSelect( "setAmbient", cback = data.setAmbient, + toolTip = "Sets the ambient colour reflectance properties for every Pass in every Technique.") + + collpane.appendPaneColourSelect( "setDiffuse", cback = data.setDiffuse, + toolTip = "Sets the diffuse colour reflectance properties of every Pass in every Technique." ) + + collpane.appendPaneColourSelect( "setSpecular", cback = data.setSpecular, + toolTip = "Sets the specular colour reflectance properties of every Pass in every Technique." ) + + collpane.appendPaneColourSelect( "setSelfIllumination", cback = data.setSelfIllumination, + toolTip = "Sets the shininess properties of every Pass in every Technique." ) + + def showTechnique( self, data ): + collpane = self.propertyGrid.createAndAppendPane( "Technique " + data.getName() ) + + collpane.appendRowItemName( "scheme name ", cfront = data.getSchemeName, cback = data.setSchemeName, + toolTip = "Returns the scheme to which this technique is assigned." ) + collpane.appendRowItemInfo( "supported %d" % data.isSupported(), + toolTip ="Indicates if this technique is supported by the current graphics card." ) + + collpane.appendRowItemInfo( "transparent %d"% data.isTransparent(), + toolTip = "Indicates if this Technique involves transparency" ) + + collpane.appendRowItemInfo( "loaded %d"% data.isLoaded(), "technique.isLoaded()" ) + + collpane.appendPaneColourSelect( "setAmbient", cback = data.setAmbient, + toolTip = "Sets the ambient colour reflectance properties for every Pass in every Technique." ) + + collpane.appendPaneColourSelect( "setDiffuse", cback = data.setDiffuse, + toolTip = "Sets the diffuse colour reflectance properties of every Pass in every Technique." ) + + collpane.appendPaneColourSelect( "setSpecular", cback = data.setSpecular, + toolTip = "Sets the specular colour reflectance properties of every Pass in every Technique.") + + #void setShininess (Real val) + #Sets the shininess properties of every Pass in every Technique. + + collpane.appendPaneColourSelect( "setSelfIllumination", cback = data.setSelfIllumination, + toolTip = "Sets the shininess properties of every Pass in every Technique." ) + + collpane.appendRowItemCheck( "depth check", cfront = data.isDepthCheckEnabled, cback = data.setDepthCheckEnabled, + toolTip = "Sets whether or not each Pass renders with depth-buffer checking on or not." ) + + collpane.appendRowItemCheck( "depth write", cfront = data.isDepthWriteEnabled, cback = data.setDepthWriteEnabled, + toolTip = "Sets whether or not each Pass renders with depth-buffer writing on or not." ) + + collpane.appendRowItemChoice( "depth function", value = 1, itemMap = ogreCompareFunctions, cback = data.setDepthFunction, + toolTip = "Sets the function used to compare depth values when depth checking is on." ) + + collpane.appendRowItemChoice( "culling mode", value = 1, itemMap = ogreCullingMode, cback = data.setCullingMode, + toolTip = "Sets the culling mode for each pass based on the 'vertex winding'." ) + + collpane.appendRowItemCheck( "colour write", value = not data.hasColourWriteDisabled(), cback = data.setColourWriteEnabled, + toolTip = "Sets whether or not colour buffer writing is enabled for each Pass." ) + + collpane.appendRowItemCheck( "lighting", value = True, cback = data.setLightingEnabled, + toolTip = "Sets whether or not dynamic lighting is enabled for every Pass." ) + + collpane.appendRowItemChoice( "shading mode", value = 1, itemMap = ogreShadeOptions, cback = data.setShadingMode, + toolTip = "Sets the type of light shading required." ) + + #String _compile (bool autoManageTextureUnits) + #Internal compilation method; see Material::compile. + #void _compileIlluminationPasses (void) + #Internal method for splitting the passes into illumination passes. + #Pass * createPass (void) + #Creates a new Pass for this Technique. + #void removePass (unsigned short index) + #Removes the Pass with the given index. + #bool movePass (const unsigned short sourceIndex, const unsigned short destinationIndex) + #Move a pass from source index to destination index. + + #const IlluminationPassIterator getIlluminationPassIterator (void) + #Gets an iterator over the illumination-stage categorised passes. + + #void _notifyNeedsRecompile (void) + #Tells the technique that it needs recompilation. + #void setPointSize (Real ps) + #Sets the point size properties for every Pass in this Technique. + + #void setManualCullingMode (ManualCullingMode mode) + #Sets the manual culling mode, performed by CPU rather than hardware. + + #void setFog (bool overrideScene, FogMode mode=FOG_NONE, const ColourValue &colour=ColourValue::White, Real expDensity=0.001, Real linearStart=0.0, Real linearEnd=1.0) + #Sets the fogging mode applied to each pass. + #void setDepthBias (float constantBias, float slopeScaleBias) + #Sets the depth bias to be used for each Pass. + #void setTextureFiltering (TextureFilterOptions filterType) + #Set texture filtering for every texture unit in every Pass. + #void setTextureAnisotropy (unsigned int maxAniso) + #Sets the anisotropy level to be used for all textures. + #void setSceneBlending (const SceneBlendType sbt) + #Sets the kind of blending every pass has with the existing contents of the scene. + #void setSceneBlending (const SceneBlendFactor sourceFactor, const SceneBlendFactor destFactor) + #Allows very fine control of blending every Pass with the existing contents of the scene. + #void setLodIndex (unsigned short index) + #Assigns a level-of-detail (LOD) index to this Technique. + #unsigned short getLodIndex (void) const + #Gets the level-of-detail index assigned to this Technique. + + #void setSchemeName (const String &schemeName) + #Set the 'scheme name' for this technique. + #const String & getSchemeName (void) const + #Returns the scheme to which this technique is assigned. + #unsigned short _getSchemeIndex (void) const + #Internal method for getting the scheme index. + + #void setName (const String &name) + #Set the name of the technique. + #const String & getName (void) const + #Gets the name of the technique. + #bool applyTextureAliases (const AliasTextureNamePairList &aliasList, const bool apply=true) const + #Applies texture names to Texture Unit State with matching texture name aliases. + + + nPasses = data.getNumPasses() + for i in range(0,nPasses): + self.showPass( data.getPass( i ), collpane ) + + def showMaterial( self, data ): + self.showResource( data ) + self.typeStaticText.SetLabel( "Material" ) + nTechniques = data.getNumTechniques() + for i in range(0,nTechniques): + self.showTechnique( data.getTechnique( i ) ) \ No newline at end of file Modified: branches/ogEditor/src/OgreWindowWx.py =================================================================== --- branches/ogEditor/src/OgreWindowWx.py 2008-05-21 20:04:57 UTC (rev 902) +++ branches/ogEditor/src/OgreWindowWx.py 2008-05-24 17:26:37 UTC (rev 903) @@ -44,10 +44,10 @@ #if you don't like the idea sceneEntities = Struct() - def __init__( self, parent, ID, size = wx.Size( 800, 600 ), renderSystem = "OpenGL", ogResourceMan = None, **kwargs ): + def __init__( self, parent, ID, size = wx.Size( 800, 600 ), renderSystem = "OpenGL", **kwargs ): self.parent = parent wx.PyWindow.__init__( self, parent, ID, size = size, **kwargs ) - self.ogResourceMan = ogResourceMan + #Event bindings self.Bind( wx.EVT_CLOSE, self._OnCloseWindow) self.Bind( wx.EVT_SIZE, self._OnSize) @@ -67,21 +67,22 @@ def _OgreInit(self,size,renderSystem): #Root creation self.ogreRoot = ogre.Root( getPluginPath(), "ogre.cfg" ) - if self.ogResourceMan: - self.ogResourceMan.ogreRoot = self.ogreRoot # setup resources config = ogre.ConfigFile() config.load( 'resources.cfg' ) + self.resourceLocations = [] section_iter = config.getSectionIterator() while section_iter.hasMoreElements(): section_name = section_iter.peekNextKey() settings = section_iter.getNext() for key, path in settings: ogre.ResourceGroupManager.getSingleton().addResourceLocation( path, key, section_name, False) - if self.ogResourceMan: - self.ogResourceMan.addResourceLocation( path, section_name ) + #if self.ogResourceMan: + #self.ogResourceMan.addResourceLocation( path, section_name ) + + self.resourceLocations.append( (path, section_name ) ) if os.path.exists( "ogre.cfg" ): self.ogreRoot.restoreConfig() @@ -140,9 +141,6 @@ renderWindow = self.ogreRoot.createRenderWindow('wxPython render window', size[ 0 ], size[ 1 ], False, renderParameters) renderWindow.active = True self.renderWindow = renderWindow - - if self.ogResourceMan: - self.ogResourceMan.renderWindow = renderWindow ogre.ResourceGroupManager.getSingleton().initialiseAllResourceGroups() Modified: branches/ogEditor/src/PropertyGrid.py =================================================================== --- branches/ogEditor/src/PropertyGrid.py 2008-05-21 20:04:57 UTC (rev 902) +++ branches/ogEditor/src/PropertyGrid.py 2008-05-24 17:26:37 UTC (rev 903) @@ -200,19 +200,24 @@ return wx.combo.ComboPopup.LazyCreate(self) class PropertyRowItem( ): + cfront_ = None cback_ = None parent_ = None - size_ = None + sizer_ = None labelTextCtrl_ = None rowHeight_ = 10 - def __init__( self, parent, name, cback = None ): - self.cback_ = cback - self.parent_ = parent - self.sizer_ = wx.BoxSizer( wx.HORIZONTAL ) + def __init__( self, parent, name, cfront = None, cback = None, toolTip = None): + self.cfront_ = cfront + self.cback_ = cback + self.parent_ = parent + self.sizer_ = wx.BoxSizer( wx.HORIZONTAL ) self.labelTextCtrl_ = wx.TextCtrl( parent, -1, name, style = wx.NO_BORDER | wx.ALIGN_LEFT ) + if toolTip: + self.labelTextCtrl_.SetToolTip( wx.ToolTip( toolTip ) ) + self.rowHeight_ = self.labelTextCtrl_.GetSize()[ 1 ] self.labelTextCtrl_.SetEditable( False ) self.sizer_.Add( self.labelTextCtrl_, 0, wx.EXPAND | wx.ALIGN_RIGHT ) @@ -228,20 +233,25 @@ item.GetWindow().Enable( value ) class PropertyRowItemInfo( PropertyRowItem ): - def __init__( self, parent, name ): + def __init__( self, parent, name, toolTip = None ): self.sizer_ = wx.BoxSizer( wx.HORIZONTAL ) self.labelTextCtrl_ = wx.TextCtrl( parent, -1, name, style = wx.NO_BORDER | wx.ALIGN_LEFT ) + if toolTip: + self.labelTextCtrl_.SetToolTip( wx.ToolTip( toolTip ) ) + self.labelTextCtrl_.SetEditable( False ) self.sizer_.Add( self.labelTextCtrl_, 1, wx.EXPAND | wx.ALIGN_RIGHT ) class PropertyRowItemName( PropertyRowItem ): valueTextCtrl_ = None format_ = None - def __init__( self, parent, name, value = None, format = FORMAT_STRING, cback = None): - PropertyRowItem.__init__( self, parent, name, cback = cback ) + def __init__( self, parent, name, value = None, format = FORMAT_STRING, cfront = None, cback = None, toolTip = None ): + PropertyRowItem.__init__( self, parent, name, cfront = cfront, cback = cback, toolTip = toolTip ) self.format_ = format self.validator = MyValidator() + if cfront: + value = cfront() if format == FORMAT_INT: self.validator = MyValidator( DIGIT_ONLY ) @@ -250,6 +260,8 @@ size = wx.Size( 40, self.rowHeight_ ), style = wx.NO_BORDER | wx.ALIGN_LEFT | wx.EXPAND, validator = self.validator ) + if ( toolTip ): + self.valueTextCtrl_.SetToolTip( wx.ToolTip( toolTip ) ) if ( format == FORMAT_STRING ): self.valueTextCtrl_.SetValue( "%s" % value ); @@ -280,28 +292,33 @@ class PropertyRowItemButton( PropertyRowItem ): button_ = None - def __init__( self, parent, name, cback = None ): - PropertyRowItem.__init__( self, parent, name, cback = cback ) + def __init__( self, parent, name, cback = None, toolTip = None ): + PropertyRowItem.__init__( self, parent, name, cback = cback, toolTip = toolTip ) self.button_ = wx.Button( parent, -1, size = wx.Size( 40, self.rowHeight_ ), style = wx.NO_BORDER | wx.ALIGN_LEFT | wx.EXPAND) + if ( toolTip ): + self.button_.SetToolTip( wx.ToolTip( toolTip ) ) + self.sizer_.AddSpacer( 1 ) self.sizer_.Add( self.button_, 1, wx.EXPAND | wx.ALIGN_LEFT ) self.button_.Bind( wx.EVT_BUTTON, self.cback_ ) class PropertyRowItemFileSelect( PropertyRowItem ): - def __init__( self, parent, name, value = "", cback = None, flag = 0, + def __init__( self, parent, name, value = "", cback = None, flag = 0, toolTip = None, wildcard = "All files (*.*)|*.*" ): - PropertyRowItem.__init__( self, parent, name, cback = cback ) + PropertyRowItem.__init__( self, parent, name, cback = cback, toolTip = toolTip ) self.value = value self.filename = self.value self.paths = [] self.wildcard = wildcard self.flag = flag if self.flag == wx.MULTIPLE: - self.choice = wx.combo.ComboCtrl( parent, -1, + self.choice = wx.combo.ComboCtrl( parent, -1,#shortHelp = "PropertyRowItem", size = wx.Size( 100, self.rowHeight_ ), style = wx.NO_BORDER | wx.NO_3D | wx.CB_READONLY ) + + self.popup = ListCtrlComboPopup( cback = self.setFilenameIdx ) self.popup.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "")) self.choice.SetPopupControl( self.popup ) @@ -364,10 +381,19 @@ self.cback_( self.filename ) class PropertyRowItemCheck( PropertyRowItem ): - def __init__( self, parent, name, value = False, cback = None): - PropertyRowItem.__init__( self, parent, name, cback = cback ) - self.isChecked = value + def __init__( self, parent, name, value = False, cfront = None, cback = None, toolTip = None ): + PropertyRowItem.__init__( self, parent, name, cfront = cfront, cback = cback, toolTip = toolTip ) + + if self.cfront_: + self.isChecked = self.cfront_() + else: + self.isChecked = value + self.checkbox = wx.CheckBox( parent, -1 ) + + if ( toolTip ): + self.checkbox.SetToolTip( wx.ToolTip( toolTip ) ) + self.sizer_.AddSpacer( 1 ) self.sizer_.Add( self.checkbox, 1, wx.EXPAND | wx.ALIGN_LEFT ) self.checkbox.Bind( wx.EVT_CHECKBOX, self.onChecked ) @@ -384,8 +410,8 @@ class PropertyRowItemSlider( PropertyRowItem ): def __init__( self, parent, name, value = 0, start = 0, end = 100, - format = FORMAT_INT, cback = None ): - PropertyRowItem.__init__( self, parent, name, cback = cback ) + format = FORMAT_INT, cback = None, toolTip = None ): + PropertyRowItem.__init__( self, parent, name, cback = cback, toolTip = toolTip ) self.format = format self.value = value self.start = start @@ -412,9 +438,12 @@ size = wx.Size( 40, self.rowHeight_ ), style = wx.NO_BORDER | wx.ALIGN_LEFT | wx.EXPAND, validator = self.validator) + + if ( toolTip ): + self.valueTextCtrl.SetToolTip( wx.ToolTip( toolTip ) ) - self.slider = wx.Slider( parent, -1, self.sliderValue, self.sliderStart, self.sliderEnd, - size = wx.Size( 100, self.rowHeight_ ), + self.slider = wx.Slider( parent, -1, self.sliderValue, self.sliderStart, self.sliderEnd, + size = wx.Size( 100, self.rowHeight_ ),#shortHelp = "PropertyRowItemSlider", style = wx.NO_BORDER | wx.NO_3D ) self.sizer_.AddSpacer( 1 ) @@ -460,8 +489,8 @@ self.cback_( self.value ) class PropertyRowItemChoice( PropertyRowItem ): - def __init__( self, parent, name, value = None, itemList = None, itemMap = None, cback = None): - PropertyRowItem.__init__( self, parent, name, cback = cback ) + def __init__( self, parent, name, value = None, itemList = None, itemMap = None, cback = None, toolTip = None): + PropertyRowItem.__init__( self, parent, name, cback = cback, toolTip = toolTip ) self.value = "" @@ -527,14 +556,18 @@ self.cback_( self.value ) class PropertyRowItemColourSelect( PropertyRowItemName ): - def __init__( self, parent, name, cback = None ): - PropertyRowItemName.__init__( self, parent, name, cback = cback ) + def __init__( self, parent, name, cback = None, toolTip = None ): + PropertyRowItemName.__init__( self, parent, name, cback = cback, toolTip = toolTip ) self.value = wx.Colour(0,0,0) self.colourButton = csel.ColourSelect( parent, -1, "", colour = self.value, size = wx.Size( self.rowHeight_, self.rowHeight_ ), - style = wx.NO_BORDER ) + style = wx.NO_BORDER ) + + if ( toolTip ): + self.colourButton.SetToolTip( wx.ToolTip( toolTip ) ) + self.sizer_.AddSpacer( 1 ) self.sizer_.Add( self.colourButton, 0, wx.EXPAND ) @@ -559,80 +592,97 @@ class PropertyGrid( ): def __init__(self): self.sizer_ = wx.BoxSizer( wx.VERTICAL ) - self.SetSizer( self.sizer_ ) self.widthCol0 = 50 self.widthCol2 = 24 self.xOffset = 17 def appendRow(self, row ): self.sizer_.AddSpacer(1) - self.sizer_.Add( row.sizer_, 0, wx.EXPAND ) + #self.sizer_.Add( row.sizer_, 0, wx.EXPAND ) - def appendRowItemInfo(self, name ): - item = PropertyRowItemInfo( self.pane, name ) + rowsizer = wx.BoxSizer( wx.HORIZONTAL ) + rowsizer.AddSpacer( 17 ) + rowsizer.Add( row.sizer_, 1, wx.EXPAND ) + self.sizer_.Add( rowsizer, 0, wx.EXPAND ) + + def appendRowItemInfo(self, name, toolTip = None): + item = PropertyRowItemInfo( self.pane, name, toolTip = toolTip ) self.appendRow( item ) return item - def appendRowItemName(self, name, value = None, format = FORMAT_STRING, cback = None ): - item = PropertyRowItemName( self.pane, name, value, format, cback ) + def appendRowItemName(self, name, value = None, format = FORMAT_STRING, cfront = None, cback = None, toolTip = None ): + item = PropertyRowItemName( self.pane, name, value, format, cfront = cfront, cback = cback, toolTip = toolTip ) self.appendRow( item ) return item - def appendRowItemButton(self, name, cback = None ): + def appendRowItemButton(self, name, cback = None, toolTip = None ): item = PropertyRowItemButton( self.pane, name, cback = cback) self.appendRow( item ) return item - def appendRowItemCheck(self, name, value = False, cback = None ): - item = PropertyRowItemCheck( self.pane, name, value, cback = cback) + def appendRowItemCheck(self, name, value = False, cfront = None, cback = None, toolTip = None ): + item = PropertyRowItemCheck( self.pane, name, value, cfront = cfront, cback = cback, toolTip = toolTip) self.appendRow( item ) return item - def appendRowItemChoice(self, name, value = None, itemList = None, itemMap = None, cback = None ): - item = PropertyRowItemChoice( self.pane, name = name , value = value, itemList = itemList, itemMap = itemMap, cback = cback ) + def appendRowItemChoice(self, name, value = None, itemList = None, itemMap = None, cback = None, toolTip = None ): + item = PropertyRowItemChoice( self.pane, name = name , value = value, itemList = itemList, itemMap = itemMap, + cback = cback, toolTip = toolTip ) self.appendRow( item ) return item - def appendRowItemFileSelect(self, name, value = "", cback = None, flag = 0, + def appendRowItemFileSelect(self, name, value = "", cback = None, flag = 0, toolTip = None, wildcard = "All files (*.*)|*.*" ): item = PropertyRowItemFileSelect( self.pane, name, value = value, - cback = cback, flag = flag, + cback = cback, flag = flag, toolTip = toolTip, wildcard = wildcard ) self.appendRow( item ) return item def appendRowItemSlider( self, name, value = 0, start = 0, end = 100, - format = FORMAT_INT, cback = None ): - item = PropertyRowItemSlider( self.pane, name, value, start, end, format, cback ) + format = FORMAT_INT, cback = None, toolTip = None ): + item = PropertyRowItemSlider( self.pane, name, value, start, end, format, cback = cback, toolTip = toolTip ) self.appendRow( item ) return item - def appendRowItemColourSelect( self, name, cback = None ): - item = PropertyRowItemColourSelect( self.pane, name, cback = cback ) + def appendRowItemColourSelect( self, name, cback = None, toolTip = None ): + item = PropertyRowItemColourSelect( self.pane, name, cback = cback, toolTip = toolTip ) self.appendRow( item ) return item + def createAndAppendPane( self, name, toolTip = None): + pane = PropertyPaneItem( self, name, toolTip = toolTip ) + return self.appendPane( pane ) + def appendPane(self, pane ): - self.sizer_.AddSpacer( 1 ) + rowsizer = wx.BoxSizer( wx.HORIZONTAL ) + rowsizer.AddSpacer( 13 ) + rowsizer.Add( pane, 1, wx.EXPAND ) + self.sizer_.Add( rowsizer, 0, wx.EXPAND ) + return pane + #self.sizer_.AddSpacer( 1 ) #self.sizer_.Add( pane, 0, wx.EXPAND ) - self.sizer_.Add( pane, 0, wx.EXPAND ) - def appendPaneColourSelect( self, name, cfront = None, cback = None ): - pane = PropertyPaneItemColour( self.pane, name, cfront, cback ) + def appendPaneColourSelect( self, name, cfront = None, cback = None, toolTip = None): + pane = PropertyPaneItemColour( self, name, cfront = cfront, cback = cback, toolTip = toolTip ) self.appendPane( pane ) return pane #class PropertyPaneItem( wx.Panel, PropertyGrid ): class PropertyPaneItem( wx.CollapsiblePane, PropertyGrid ): - def __init__(self, parent, name): + def __init__(self, parent, name, toolTip = None): self.parent_ = parent - - wx.CollapsiblePane.__init__( self, parent, -1, name, - style = wx.CP_DEFAULT_STYLE - | wx.CP_NO_TLW_RESIZE - ) + if issubclass( type( parent ), PropertyPaneItem ): + parentWin = self.parent_.GetPane() + else: + parentWin = self.parent_ + + wx.CollapsiblePane.__init__( self, parentWin, -1, name, style = wx.CP_DEFAULT_STYLE | wx.CP_NO_TLW_RESIZE ) #wx.Panel.__init__( self, parent, -1 ) + if toolTip: + self.SetToolTip( wx.ToolTip( toolTip ) ) + PropertyGrid.__init__( self ) self.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "")) @@ -641,27 +691,22 @@ self.pane = self.GetPane() self.pane.SetFont( wx.Font( 8, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "" ) ) - self.sizer_ = wx.BoxSizer( wx.VERTICAL ) self.pane.SetSizer( self.sizer_ ) #def GetPane( self ): #return self.pane def OnPaneChanged(self, event = None): - if event: - if ( event.Collapsed ): - event.GetEventObject().GetPane().Hide() - else: - event.GetEventObject().GetPane().Show() - #self.pane.Show() - #self.Layout() - #self.parent_.Layout() + if ( issubclass( type( self.parent_ ), PropertyPaneItem ) ): + self.parent_.Collapse( ) + self.parent_.Expand( ) + self.GetParent().Layout() class PropertyPaneItemColour( PropertyPaneItem ): - def __init__( self, parent, name, cfront = None, cback = None ): - PropertyPaneItem.__init__(self, parent, name) + def __init__( self, parent, name, cfront = None, cback = None, toolTip = None ): + PropertyPaneItem.__init__(self, parent, name, toolTip = toolTip) self.cback = cback self.cfront = cfront self.value = [0, 0, 0, 0] @@ -710,6 +755,8 @@ argv["style"] = wx.TAB_TRAVERSAL wx.Panel.__init__(self, *argc, **argv) PropertyGrid.__init__(self) + self.SetSizer( self.sizer_ ) + self.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "")) #self.SetBackgroundColour( wx.Colour(200, 200, 200) ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spo...@us...> - 2008-05-21 20:06:12
|
Revision: 902 http://opengate.svn.sourceforge.net/opengate/?rev=902&view=rev Author: spom_spom Date: 2008-05-21 13:04:57 -0700 (Wed, 21 May 2008) Log Message: ----------- ogEditor loads and show the testsector identical to the client. Some refactoring and cleaning. Add a screenshot to the web site Modified Paths: -------------- branches/ogEditor/ogEditor.py branches/ogEditor/propgridtest.py branches/ogEditor/resources.cfg branches/ogEditor/src/ObjectInspectorPanels.py branches/ogEditor/src/OgreWindowWx.py branches/ogEditor/src/PropertyGrid.py trunk/plugins.cfg trunk/src/BaseObject.cpp trunk/src/BaseObject.h trunk/src/SectorObject.cpp trunk/src/Station.cpp trunk/src/Station.h Modified: branches/ogEditor/ogEditor.py =================================================================== --- branches/ogEditor/ogEditor.py 2008-05-20 21:26:54 UTC (rev 901) +++ branches/ogEditor/ogEditor.py 2008-05-21 20:04:57 UTC (rev 902) @@ -46,24 +46,66 @@ NAME_RESOURCE = "Resource browser" NAME_PYCRUST = "PyCrust" +class WorkSpace: + activeResource = None; + def __init__(self): + Pass + +class Opengate: + resourceManager_ = None + + def __init__( self, ): + self.resourceManager_ = og.ResourceManager() + self.resourceManager_.logManager = og.LogManager() + self.resourceManager_.entityManager = og.EntityManager( ) + + def initOpenGateResources_( self ): + self.resourceManager_.loadGlobalIDs( "ids.xml" ) + entityManager = self.resourceManager_.entityManager + entityManager.load( self.resourceManager_.resourceLocations( "General" ), "commodities" ); + entityManager.load( self.resourceManager_.resourceLocations( "General" ), "engines" ); + entityManager.load( self.resourceManager_.resourceLocations( "General" ), "capacitors" ); + entityManager.load( self.resourceManager_.resourceLocations( "General" ), "radars" ); + entityManager.load( self.resourceManager_.resourceLocations( "General" ), "shields" ); + entityManager.load( self.resourceManager_.resourceLocations( "General" ), "ecms" ); + entityManager.load( self.resourceManager_.resourceLocations( "General" ), "power_plants" ); + entityManager.load( self.resourceManager_.resourceLocations( "General" ), "guns" ); + entityManager.load( self.resourceManager_.resourceLocations( "General" ), "missiles" ); + entityManager.load( self.resourceManager_.resourceLocations( "General" ), "ships" ); + entityManager.load( self.resourceManager_.resourceLocations( "General" ), "stations" ); + + def getName( self ): + return "Opengate" + + def fillProperties( self, objectInspectorPanel ): + objectInspectorPanel.typeStaticText.SetLabel( "Opengate" ) + shaderSchemes = ( "Default", "vpOnly", "vpfp" ) + vp = self.resourceManager_.renderWindow.getViewport( 0 ) + self.interpolModeChosser = objectInspectorPanel.propertyGrid.appendRowItemChoice( "shader scheme", + value = "Default", + itemList = shaderSchemes, + cback = vp.setMaterialScheme ) + + class MainFrame(wx.Frame): def __init__(self, *args, **kwds): kwds["style"] = wx.DEFAULT_FRAME_STYLE wx.Frame.__init__(self, *args, **kwds) self.SetSize( wx.Size( 1024, 768 ) ) - self.ogResourceManager = og.ResourceManager() - self.ogResourceManager.logManager = og.LogManager() + global ws + ws = WorkSpace + self.og = Opengate() + self.initMenuBar_() self.initToolBar_() self.initStatusBar_() self.initFrameManager_() - self.initOpenGateResources_(); - self.sector = og.Sector( self.ogreRenderWindow.sceneManager, None ); + self.og.initOpenGateResources_(); + self.og.sector = og.Sector( self.ogreRenderWindow.sceneManager, None ); - self.setDefaultProperties_(); self.auiMgr.Update() @@ -146,7 +188,7 @@ ################################################################################# def createRenderWindow_( self ): - self.ogreRenderWindow = OgreWindow( self, -1, ogResourceMan = self.ogResourceManager ) + self.ogreRenderWindow = OgreWindow( self, -1, ogResourceMan = self.og.resourceManager_ ) return self.ogreRenderWindow def createCrustWindow_( self ): @@ -179,23 +221,6 @@ wx.TR_DEFAULT_STYLE | wx.NO_BORDER ); self.Bind( wx.EVT_TREE_SEL_CHANGED, self.doSelectTreeObject, self.resourceTree ) return self.resourceTree - - def initOpenGateResources_( self ): - self.ogResourceManager.loadGlobalIDs( "ids.xml" ) - entityManager = og.EntityManager( ) - self.ogResourceManager.entityManager = entityManager - - entityManager.load( self.ogResourceManager.resourceLocations( "General" ), "commodities" ); - entityManager.load( self.ogResourceManager.resourceLocations( "General" ), "engines" ); - entityManager.load( self.ogResourceManager.resourceLocations( "General" ), "capacitors" ); - entityManager.load( self.ogResourceManager.resourceLocations( "General" ), "radars" ); - entityManager.load( self.ogResourceManager.resourceLocations( "General" ), "shields" ); - entityManager.load( self.ogResourceManager.resourceLocations( "General" ), "ecms" ); - entityManager.load( self.ogResourceManager.resourceLocations( "General" ), "power_plants" ); - entityManager.load( self.ogResourceManager.resourceLocations( "General" ), "guns" ); - entityManager.load( self.ogResourceManager.resourceLocations( "General" ), "missiles" ); - entityManager.load( self.ogResourceManager.resourceLocations( "General" ), "ships" ); - entityManager.load( self.ogResourceManager.resourceLocations( "General" ), "stations" ); def setDefaultProperties_( self ): self.SetTitle("ogEditor") @@ -255,8 +280,18 @@ def doSelectTreeObject( self, event ): obj = event.GetEventObject().GetPyData( event.GetEventObject().GetSelection() ) - self.ogreRenderWindow.camera.lookAt( obj.getWorldPosition() ) + if type( obj ) == ogre.SceneNode: + self.ogreRenderWindow.camera.lookAt( obj.getWorldPosition() ) self.objectInspector.showData( obj ); + + if ws.activeResource: + if type( ws.activeResource ) == ogre.SceneNode: + ws.activeResource.showBoundingBox( False ); + + if type( obj ) == ogre.SceneNode: + obj.showBoundingBox( True ); + + ws.activeResource = obj event.Skip() ################################################################################# @@ -280,6 +315,10 @@ self.dumpSceneNode_( rootSceneNodeTreeNode, rootSceneNode ) self.sceneTree.Expand( root ) + + opengateNode = self.sceneTree.AppendItem( root, "Opengate" ) + self.sceneTree.SetPyData( opengateNode, self.og ) + if event != None: event.Skip() @@ -293,6 +332,12 @@ self.sceneTree.SetItemImage(nexttreenode, self.SceneNodeIconID, CT.TreeItemIcon_Selected) self.sceneTree.SetPyData( nexttreenode, nextnode ) + self.sceneTree.CheckItem( nexttreenode, True ); + #if nextnode.getAttachedObject( 0 ).isVisible(): + #self.sceneTree.CheckItem( nexttreenode, True ); + #else: + #self.sceneTree.CheckItem( nexttreenode, False ); + self.dumpAttachedMovableObjects_( nexttreenode, nextnode ) self.dumpSceneNode_( nexttreenode, nextnode ) Modified: branches/ogEditor/propgridtest.py =================================================================== --- branches/ogEditor/propgridtest.py 2008-05-20 21:26:54 UTC (rev 901) +++ branches/ogEditor/propgridtest.py 2008-05-21 20:04:57 UTC (rev 902) @@ -35,6 +35,8 @@ text = PropertyRowItemName( pane.GetPane(), "Name", "Val") pane.appendRow( text ) + pane.Layout() + pane.Show() self.propertyGrid.appendRowItemSlider( "expDensity", 0.0001, 0.0002, format = FORMAT_LOG10, @@ -47,12 +49,14 @@ dic = ( (1, "eins"), (2, "zwei"), (3, "drei")) self.propertyGrid.appendRowItemChoice( "Choice map", value = 1, itemMap = dic, cback = test.printValue ) + self.propertyGrid.appendRowItemFileSelect( "File", cback = test.printValue ) self.propertyGrid.appendRowItemFileSelect( "Files", cback = test.printValue, flag = wx.MULTIPLE ) self.propertyGrid.appendRowItemButton( "Button", cback = test.printValue ) self.propertyGrid.appendRowItemInfo( "here is a long an verbose text entry" ) + if __name__ == "__main__": ogEditor = wx.PySimpleApp(0) Modified: branches/ogEditor/resources.cfg =================================================================== --- branches/ogEditor/resources.cfg 2008-05-20 21:26:54 UTC (rev 901) +++ branches/ogEditor/resources.cfg 2008-05-21 20:04:57 UTC (rev 902) @@ -5,7 +5,6 @@ # Resource locations to be added to the default path [General] FileSystem=../../trunk/data/ -FileSystem=../../trunk/data/asteroids FileSystem=../../trunk/data/capacitors FileSystem=../../trunk/data/commodities FileSystem=../../trunk/data/gui @@ -19,6 +18,7 @@ FileSystem=../../trunk/data/engines FileSystem=../../trunk/data/guns FileSystem=../../trunk/data/materials +FileSystem=../../trunk/data/asteroids FileSystem=../../trunk/data/misc FileSystem=../../trunk/data/missiles FileSystem=../../trunk/data/power_plants Modified: branches/ogEditor/src/ObjectInspectorPanels.py =================================================================== --- branches/ogEditor/src/ObjectInspectorPanels.py 2008-05-20 21:26:54 UTC (rev 901) +++ branches/ogEditor/src/ObjectInspectorPanels.py 2008-05-21 20:04:57 UTC (rev 902) @@ -10,6 +10,9 @@ from PropertyGrid import * +def toStr( vec ): + return ("%g, %g, %g"%(vec.x, vec.y, vec.z)) + class PropertyCollapsibleOgreFogPane( PropertyPaneItem ): def __init__( self, parent, name, object = None ): PropertyPaneItem.__init__(self, parent, name) @@ -30,11 +33,11 @@ (ogre.FOG_EXP2, "FOG_EXP2"), (ogre.FOG_LINEAR,"FOG_LINEAR")) - self.m = self.appendRowItemChoice( "Mode", itemMap=modes, cback = self.setMode ) + self.m = self.appendRowItemChoice( "Mode", value = ogre.FOG_NONE, itemMap=modes, cback = self.setMode ) self.c = self.appendRowItemColourSelect( "Colour", cback = self.setRGBA ) - self.min = self.appendRowItemSlider( "linearStart", 0, 1, format = SLIDER_FLOAT, cback = self.setLinMin ) - self.max = self.appendRowItemSlider( "linearEnd", 0, 1, format = SLIDER_FLOAT, cback = self.setLinMax ) - self.exp = self.appendRowItemSlider( "expDensity", 0.0001, 0.01, format = SLIDER_LOG10, cback = self.setExpDens ) + self.min = self.appendRowItemSlider( "linearStart", 0, 1, format = FORMAT_FLOAT, cback = self.setLinMin ) + self.max = self.appendRowItemSlider( "linearEnd", 0, 1, format = FORMAT_FLOAT, cback = self.setLinMax ) + self.exp = self.appendRowItemSlider( "expDensity", 0.0001, 0.01, format = FORMAT_FLOAT, cback = self.setExpDens ) if object != None: mode = object.getFogMode() @@ -111,21 +114,26 @@ def showData( self, data ): self.propertyGrid.clean() - if type( data ) == None: - self.showNone() - if type( data ) == ogre.SceneNode: - self.showSceneNode( data ) - elif issubclass( type( data ), ogre.SceneManager): - self.showSceneManager( data ) - elif issubclass( type( data ), ogre.Resource ): - self.showResource( data ) - elif issubclass( type( data ), ogre.MovableObject ): - self.showMovableObject( data ) - elif issubclass( type( data ), ogre.ResourceManager ): - self.showResourceManager( data ) + if hasattr( data, "fillProperties" ): + data.fillProperties( self ) else: - self.showUnknown( data ) - self.propertyGrid.sizer.Layout() + if type( data ) == None: + self.showNone() + if type( data ) == ogre.SceneNode: + self.showSceneNode( data ) + elif type( data ) == ogre.Entity: + self.showEntity( data ) + elif issubclass( type( data ), ogre.SceneManager): + self.showSceneManager( data ) + elif issubclass( type( data ), ogre.Resource ): + self.showResource( data ) + elif issubclass( type( data ), ogre.MovableObject ): + self.showMovableObject( data ) + elif issubclass( type( data ), ogre.ResourceManager ): + self.showResourceManager( data ) + else: + self.showUnknown( data ) + self.propertyGrid.sizer_.Layout() def showNone( self ): self.typeStaticText.SetLabel( "None" ) @@ -177,9 +185,22 @@ def showSceneNode( self, data ): self.typeStaticText.SetLabel( "SceneNode" ) self.showName( data ) - print data.getWorldPosition() - self.propertyGrid.appendRowItemInfo( "world position (%g, %g, %g)"%(data.getWorldPosition().x, data.getWorldPosition().y, data.getWorldPosition().z) ) + self.propertyGrid.appendRowItemInfo( "world AABB min %s" % toStr( data._getWorldAABB().getMinimum() ) ) + self.propertyGrid.appendRowItemInfo( "world AABB max %s" % toStr( data._getWorldAABB().getMaximum() ) ) + self.propertyGrid.appendRowItemInfo( "world size %s" % toStr(data._getWorldAABB().getMaximum()-data._getWorldAABB().getMinimum() ) ) + + self.propertyGrid.appendRowItemInfo( "world position %s" % toStr(data.getWorldPosition() ) ) + self.propertyGrid.appendRowItemInfo( "scale %s" % toStr( data.getScale() ) ) + + #getWorldOrientation + #getOrientation + #_getWorldAABB + + def showEntity( self, data ): + self.typeStaticText.SetLabel( "ogre.Entity" ) + self.showName( data ) + def showResource( self, data ): self.typeStaticText.SetLabel( "Resource: " + data.getCreator().getResourceType() ) self.showName( data ); Modified: branches/ogEditor/src/OgreWindowWx.py =================================================================== --- branches/ogEditor/src/OgreWindowWx.py 2008-05-20 21:26:54 UTC (rev 901) +++ branches/ogEditor/src/OgreWindowWx.py 2008-05-21 20:04:57 UTC (rev 902) @@ -213,8 +213,7 @@ self.camera.setAutoAspectRatio( True ) # create the camera nodes & attach camera - cameraNode = self.sceneManager.getRootSceneNode().createChildSceneNode( self.camera.getName(), - ogre.Vector3( 0, 0, 250 ) ) + cameraNode = self.sceneManager.getRootSceneNode().createChildSceneNode( self.camera.getName(), ogre.Vector3( 0, 0, 0 ) ) pitchNode = cameraNode.createChildSceneNode( cameraNode.getName() + "/PitchNode" ) pitchNode.attachObject( self.camera ) @@ -278,7 +277,7 @@ dy = self.StartDragY -y self.StartDragX, self.StartDragY = x, y - self.sceneEntities.cameraNode.yaw( ogre.Degree( dx / 3.0 ), ogre.Node.TS_LOCAL ) - self.sceneEntities.cameraNode.pitch( ogre.Degree( dy / 3.0 ), ogre.Node.TS_LOCAL ) + self.sceneEntities.cameraNode.yaw( ogre.Degree( dx / 5.0 ), ogre.Node.TS_LOCAL ) + self.sceneEntities.cameraNode.pitch( ogre.Degree( dy / 5.0 ), ogre.Node.TS_LOCAL ) #self.sceneEntities.cameraPitchNode.pitch( ogre.Degree( dy / 3.0 ), ogre.Node.TS_LOCAL ) event.Skip() Modified: branches/ogEditor/src/PropertyGrid.py =================================================================== --- branches/ogEditor/src/PropertyGrid.py 2008-05-20 21:26:54 UTC (rev 901) +++ branches/ogEditor/src/PropertyGrid.py 2008-05-21 20:04:57 UTC (rev 902) @@ -278,16 +278,16 @@ self.cback_( self.value ) class PropertyRowItemButton( PropertyRowItem ): - button_ = None + button_ = None - def __init__( self, parent, name, cback = None ): - PropertyRowItem.__init__( self, parent, name, cback = cback ) - self.button_ = wx.Button( parent, -1, - size = wx.Size( 40, self.rowHeight_ ), - style = wx.NO_BORDER | wx.ALIGN_LEFT | wx.EXPAND) - self.sizer_.AddSpacer( 1 ) - self.sizer_.Add( self.button_, 1, wx.EXPAND | wx.ALIGN_LEFT ) - self.button_.Bind( wx.EVT_BUTTON, self.cback_ ) + def __init__( self, parent, name, cback = None ): + PropertyRowItem.__init__( self, parent, name, cback = cback ) + self.button_ = wx.Button( parent, -1, + size = wx.Size( 40, self.rowHeight_ ), + style = wx.NO_BORDER | wx.ALIGN_LEFT | wx.EXPAND) + self.sizer_.AddSpacer( 1 ) + self.sizer_.Add( self.button_, 1, wx.EXPAND | wx.ALIGN_LEFT ) + self.button_.Bind( wx.EVT_BUTTON, self.cback_ ) class PropertyRowItemFileSelect( PropertyRowItem ): def __init__( self, parent, name, value = "", cback = None, flag = 0, @@ -589,7 +589,7 @@ return item def appendRowItemChoice(self, name, value = None, itemList = None, itemMap = None, cback = None ): - item = PropertyRowItemChoice( self.pane, name, value, itemList, itemMap, cback ) + item = PropertyRowItemChoice( self.pane, name = name , value = value, itemList = itemList, itemMap = itemMap, cback = cback ) self.appendRow( item ) return item @@ -613,7 +613,8 @@ return item def appendPane(self, pane ): - self.sizer_.AddSpacer(1) + self.sizer_.AddSpacer( 1 ) + #self.sizer_.Add( pane, 0, wx.EXPAND ) self.sizer_.Add( pane, 0, wx.EXPAND ) def appendPaneColourSelect( self, name, cfront = None, cback = None ): @@ -622,29 +623,39 @@ return pane +#class PropertyPaneItem( wx.Panel, PropertyGrid ): class PropertyPaneItem( wx.CollapsiblePane, PropertyGrid ): def __init__(self, parent, name): + self.parent_ = parent wx.CollapsiblePane.__init__( self, parent, -1, name, style = wx.CP_DEFAULT_STYLE - | wx.CP_NO_TLW_RESIZE ) - PropertyGrid.__init__(self) + | wx.CP_NO_TLW_RESIZE + ) + #wx.Panel.__init__( self, parent, -1 ) + PropertyGrid.__init__( self ) - self.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "")) - self.Bind(wx.EVT_COLLAPSIBLEPANE_CHANGED, self.OnPaneChanged ) + self.Bind(wx.EVT_COLLAPSIBLEPANE_CHANGED, self.OnPaneChanged, self ) self.pane = self.GetPane() self.pane.SetFont( wx.Font( 8, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "" ) ) - self.sizer = wx.BoxSizer( wx.VERTICAL ) - self.pane.SetSizer( self.sizer ) + + self.sizer_ = wx.BoxSizer( wx.VERTICAL ) + self.pane.SetSizer( self.sizer_ ) + #def GetPane( self ): + #return self.pane + def OnPaneChanged(self, event = None): if event: if ( event.Collapsed ): event.GetEventObject().GetPane().Hide() else: event.GetEventObject().GetPane().Show() + #self.pane.Show() + #self.Layout() + #self.parent_.Layout() self.GetParent().Layout() @@ -657,10 +668,10 @@ self.scale = 255.0 self.c = self.appendRowItemColourSelect( "Colour", cback = self.setRGB ) - self.r = self.appendRowItemSlider( "red", 0, 255, cback = self.setRed ) - self.g = self.appendRowItemSlider( "green", 0, 255, cback = self.setGreen ) - self.b = self.appendRowItemSlider( "blue", 0, 255, cback = self.setBlue ) - self.a = self.appendRowItemSlider( "alpha", 0, 255, cback = self.setAlpha ) + self.r = self.appendRowItemSlider( "red", start = 0, end = 255, format = FORMAT_INT, cback = self.setRed ) + self.g = self.appendRowItemSlider( "green", start = 0, end = 255, format = FORMAT_INT, cback = self.setGreen ) + self.b = self.appendRowItemSlider( "blue", start = 0, end = 255, format = FORMAT_INT, cback = self.setBlue ) + self.a = self.appendRowItemSlider( "alpha", start = 0, end = 255, format = FORMAT_INT, cback = self.setAlpha ) if self.cfront != None: colour = self.cfront() Modified: trunk/plugins.cfg =================================================================== --- trunk/plugins.cfg 2008-05-20 21:26:54 UTC (rev 901) +++ trunk/plugins.cfg 2008-05-21 20:04:57 UTC (rev 902) @@ -6,5 +6,5 @@ # Define D3D rendering implementation plugin Plugin=RenderSystem_GL.so Plugin=Plugin_ParticleFX.so -Plugin=Plugin_CgProgramManager.so +#Plugin=Plugin_CgProgramManager.so Modified: trunk/src/BaseObject.cpp =================================================================== --- trunk/src/BaseObject.cpp 2008-05-20 21:26:54 UTC (rev 901) +++ trunk/src/BaseObject.cpp 2008-05-21 20:04:57 UTC (rev 902) @@ -28,13 +28,15 @@ namespace OpenGate{ -BaseObject::BaseObject( const Ogre::String & name, Sector * sector, Uint32 userID, Uint8 childID ) - : name_( name ), sector_( sector ), userID_( userID ), childID_( childID ), mainNode_( NULL ), collObj_( NULL ){ +BaseObject::BaseObject( const Ogre::String & name, Sector * sector, Uint32 userID, Uint8 childID, Ogre::SceneNode * parentNode ) + : name_( name ), sector_( sector ), userID_( userID ), childID_( childID ), mainNode_( NULL ), parentNode_( parentNode ), collObj_( NULL ){ globalID_ = createGlobalID( userID, childID ); sceneMgr_ = sector_->sceneManager(); + if ( !parentNode_ ) parentNode_ = sceneMgr_->getRootSceneNode(); + try{ - mainNode_ = sceneMgr_->getRootSceneNode()->createChildSceneNode( name ); + mainNode_ = parentNode_->createChildSceneNode( name_ ); } catch( Ogre::Exception & e ) { LogManager::getSingleton().fatal( e.getFullDescription() ); } @@ -46,7 +48,7 @@ } BaseObject::~BaseObject(){ - sceneMgr_->getRootSceneNode()->removeAndDestroyChild( mainNode_->getName() ); + parentNode_->removeAndDestroyChild( mainNode_->getName() ); } void BaseObject::setActive( bool activate ){ Modified: trunk/src/BaseObject.h =================================================================== --- trunk/src/BaseObject.h 2008-05-20 21:26:54 UTC (rev 901) +++ trunk/src/BaseObject.h 2008-05-21 20:04:57 UTC (rev 902) @@ -48,7 +48,7 @@ class BaseObject{ public: - BaseObject( const Ogre::String & name, Sector * sector, Uint32 userId = 0, Uint8 childId = 0 ); + BaseObject( const Ogre::String & name, Sector * sector, Uint32 userId = 0, Uint8 childId = 0, Ogre::SceneNode * parentNode = NULL ); virtual ~BaseObject(); @@ -119,6 +119,7 @@ Uint32 globalID_; Ogre::SceneNode * mainNode_; + Ogre::SceneNode * parentNode_; Ogre::SceneManager * sceneMgr_; Ogre::Real lifeTime_; Modified: trunk/src/SectorObject.cpp =================================================================== --- trunk/src/SectorObject.cpp 2008-05-20 21:26:54 UTC (rev 901) +++ trunk/src/SectorObject.cpp 2008-05-21 20:04:57 UTC (rev 902) @@ -125,10 +125,12 @@ void SectorObject::setBaseSize( const Ogre::Vector3 & size ){ if ( size == Ogre::Vector3::ZERO ) return; - Ogre::Vector3 oldSize( mainNodeEntityRot_->getOrientation() * ( + /* Ogre::Vector3 oldSize( mainNodeEntityRot_->getOrientation() * ( mainNodeEntityRot_->_getWorldAABB().getMaximum()- mainNodeEntityRot_->_getWorldAABB().getMinimum() ) ); - + */ + Ogre::Vector3 oldSize( entity_->getBoundingBox().getMaximum()- entity_->getBoundingBox().getMinimum() ); + Ogre::Vector3 scale( size / oldSize ); scale[ 0 ] = fabs( scale[ 0 ] ); @@ -145,24 +147,24 @@ scale[ 2 ] = scale[ 0 ]; scale[ 1 ] = scale[ 0 ]; } -// std::cout << name_ << std::endl; -// std::cout << "sol: " << size << std::endl; -// std::cout << "ist: " << oldSize << std::endl; -// std::cout << scale << std::endl; -// -// std::cout << mainNodeEntityRot_->_getWorldAABB().getMaximum() << " " << -// mainNodeEntityRot_->_getWorldAABB().getMinimum() << " " << -// mainNodeEntityRot_->_getWorldAABB().getMaximum()-mainNodeEntityRot_->_getWorldAABB().getMinimum() -// << std::endl; -// -// std::cout << entity_->getBoundingBox().getMaximum()- entity_->getBoundingBox().getMinimum() << std::endl; -// -// std::cout << mainNodeEntityRot_->getOrientation() * ( entity_->getBoundingBox().getMaximum()- -// entity_->getBoundingBox().getMinimum() ) << std::endl; -// -// std::cout << mainNode_->_getWorldAABB().getMaximum() - mainNode_->_getWorldAABB().getMinimum() << std::endl; -// std::cout << mainNode_->_getDerivedScale() << std::endl; + std::cout << name_ << std::endl; + std::cout << "sol: " << size << std::endl; + std::cout << "ist: " << oldSize << std::endl; + std::cout << scale << std::endl; + + std::cout << mainNodeEntityRot_->_getWorldAABB().getMaximum() << " " << + mainNodeEntityRot_->_getWorldAABB().getMinimum() << " " << + mainNodeEntityRot_->_getWorldAABB().getMaximum()-mainNodeEntityRot_->_getWorldAABB().getMinimum() + << std::endl; + std::cout << entity_->getBoundingBox().getMaximum()- entity_->getBoundingBox().getMinimum() << std::endl; + + std::cout << mainNodeEntityRot_->getOrientation() * ( entity_->getBoundingBox().getMaximum()- + entity_->getBoundingBox().getMinimum() ) << std::endl; + + std::cout << mainNode_->_getWorldAABB().getMaximum() - mainNode_->_getWorldAABB().getMinimum() << std::endl; + std::cout << mainNode_->_getDerivedScale() << std::endl; + mainNodeEntityScale_->scale( scale ); baseSize_ = size; baseScale_ = scale; Modified: trunk/src/Station.cpp =================================================================== --- trunk/src/Station.cpp 2008-05-20 21:26:54 UTC (rev 901) +++ trunk/src/Station.cpp 2008-05-21 20:04:57 UTC (rev 902) @@ -77,12 +77,9 @@ } Pad::Pad( const std::string & name, SectorObject * parent, Ogre::SubEntity * padSubEntity ) - : BaseObject( name, parent->sector() ), parent_( parent ){ + : BaseObject( name, parent->sector(), 0, 0, parent->rotnode() ), parent_( parent ){ - //** hier gibt es eine mainNode die nicht genutzt wird. C. - //** mach das sauber!! ersetzt getPosition, getDirection, padNode - padNode_ = parent_->rotnode()->createChildSceneNode( parent_->name() + "/" + name_ ); - padManualObject_ = sceneMgr_->createManualObject( padNode_->getName() + "/ManualObject" ); + padManualObject_ = sceneMgr_->createManualObject( mainNode_->getName() + "/ManualObject" ); std::vector < Ogre::Vector3 > verts; std::vector < Triangle > tris; @@ -120,16 +117,15 @@ padMesh_ = padManualObject_->convertToMesh( padManualObject_->getName() + "/Mesh" ); padEntity_ = sceneMgr_->createEntity( padMesh_->getName() + "/Entity", padMesh_->getName() ); - padNode_->attachObject( padEntity_ ); - padNode_->translate( direction_.normalisedCopy() * 0.1 ); + mainNode_->attachObject( padEntity_ ); + mainNode_->translate( direction_.normalisedCopy() * 0.1 ); } Pad::~Pad( ){ - padNode_->detachObject( padEntity_ ); + mainNode_->detachObject( padEntity_ ); sceneMgr_->destroyEntity( padEntity_ ); Ogre::MeshManager::getSingleton().remove( padMesh_->getName() ); sceneMgr_->destroyManualObject( padManualObject_ ); - parent_->rotnode()->removeAndDestroyChild( padNode_->getName() ); } StationPad::StationPad( const std::string & name, StationObject * station, Ogre::SubEntity * padSubEntity, @@ -167,33 +163,33 @@ StationObject::StationObject( Station & station, Sector * sector ) : SectorObject( station.name(), sector ), station_( &station ){ - dockPad_ = NULL; - flashLights_ = NULL; + dockPad_ = NULL; + flashLights_ = NULL; - setShape( station_->meshName() ); + setShape( station_->meshName() ); - for ( uint i = 0; i < entity()->getNumSubEntities(); i ++ ){ - std::cout << entity()->getSubEntity( i )->getMaterialName() << " Techniques: " - << entity()->getSubEntity( i )->getMaterial()->getNumTechniques() << " used: " - << entity()->getSubEntity( i )->getTechnique()->getName() << std::endl; + for ( uint i = 0; i < entity()->getNumSubEntities(); i ++ ){ + std::cout << entity()->getSubEntity( i )->getMaterialName() << " Techniques: " + << entity()->getSubEntity( i )->getMaterial()->getNumTechniques() << " used: " + << entity()->getSubEntity( i )->getTechnique()->getName() << std::endl; // for ( uint j = 0; j < entity()->getSubEntity( i )->getMaterial()->getNumTechniques(); j ++ ){ // std::cout << entity()->getSubEntity( i )->getMaterial()->getTechnique( j )->getName() << std::endl; // } - if ( entity()->getSubEntity( i )->getMaterialName() == "Flashlight/Red" ){ - createFlashLights( entity()->getSubEntity( i ) ); + if ( entity()->getSubEntity( i )->getMaterialName() == "Flashlight/Red" ){ + createFlashLights( entity()->getSubEntity( i ) ); + } + if ( entity()->getSubEntity( i )->getMaterialName() == "Station/DockPad" ){ + dockPad_ = new StationPad( name_ + "DockPad", this, entity()->getSubEntity( i ), true ); + } + if ( entity()->getSubEntity( i )->getMaterialName() == "Station/LaunchPad.001" ){ + launchPad_ = new StationPad( name_ + "LaunchPad", this, entity()->getSubEntity( i ), false ); + } } - if ( entity()->getSubEntity( i )->getMaterialName() == "Station/DockPad" ){ - dockPad_ = new StationPad( name_ + "DockPad", this, entity()->getSubEntity( i ), true ); - } - if ( entity()->getSubEntity( i )->getMaterialName() == "Station/LaunchPad.001" ){ - launchPad_ = new StationPad( name_ + "LaunchPad", this, entity()->getSubEntity( i ), false ); - } - } - setBaseRot( station_->baseYaw(), station_->basePitch(), station_->baseRoll() ); - setBaseSize( station_->baseSize() ); + setBaseRot( station_->baseYaw(), station_->basePitch(), station_->baseRoll() ); + setBaseSize( station_->baseSize() ); if ( dockPad_ ){ createRings( dockPad_->position(), dockPad_->radius(), dockPad_->direction() ); @@ -370,11 +366,11 @@ if ( ResourceManager::getSingleton().collisionManager ){ ResourceManager::getSingleton().collisionManager->detach( this ); } - padNode_->detachObject( padEntity_ ); + mainNode_->detachObject( padEntity_ ); sceneMgr_->destroyEntity( padEntity_ ); padEntity_ = sceneMgr_->createEntity( name_ + "/Entity", meshname ); - padNode_->attachObject( padEntity_ ); - padNode_->translate( position_ ); + mainNode_->attachObject( padEntity_ ); + mainNode_->translate( position_ ); if ( ResourceManager::getSingleton().collisionManager ){ ResourceManager::getSingleton().collisionManager->attach( this ); } Modified: trunk/src/Station.h =================================================================== --- trunk/src/Station.h 2008-05-20 21:26:54 UTC (rev 901) +++ trunk/src/Station.h 2008-05-21 20:04:57 UTC (rev 902) @@ -70,13 +70,13 @@ /*! Radius of the pad */ Ogre::Real radius() const { return radius_; } - Ogre::SceneNode * padNode(){ return padNode_; } + Ogre::SceneNode * padNode(){ return mainNode_; } virtual Ogre::Entity * entity( ) { return padEntity_; } protected: SectorObject * parent_; - Ogre::SceneNode * padNode_; + //Ogre::SceneNode * padNode_; Ogre::ManualObject * padManualObject_; Ogre::MeshPtr padMesh_; Ogre::Entity * padEntity_; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spo...@us...> - 2008-05-20 21:26:58
|
Revision: 901 http://opengate.svn.sourceforge.net/opengate/?rev=901&view=rev Author: spom_spom Date: 2008-05-20 14:26:54 -0700 (Tue, 20 May 2008) Log Message: ----------- ogEditor can now load and show the testsector and its content Modified Paths: -------------- branches/ogEditor/ogEditor.py branches/ogEditor/plugins.cfg branches/ogEditor/propgridtest.py branches/ogEditor/resources.cfg branches/ogEditor/src/ObjectInspectorPanels.py branches/ogEditor/src/OgreWindowWx.py branches/ogEditor/src/PropertyGrid.py trunk/data/misc/testsector.xml trunk/src/AiCommands.h trunk/src/BaseObject.cpp trunk/src/Entity.cpp trunk/src/Entity.h trunk/src/EntityManager.cpp trunk/src/EntityManager.h trunk/src/GameStateManager.cpp trunk/src/Moveable.cpp trunk/src/Moveable.h trunk/src/Planet.cpp trunk/src/ResourceManager.cpp trunk/src/ResourceManager.h trunk/src/Sector.cpp trunk/src/Sector.h trunk/src/SectorObject.cpp trunk/src/SectorObjectMoveable.cpp trunk/src/Station.cpp trunk/src/Station.h trunk/src/Vessel.cpp trunk/src/Vessel.h Modified: branches/ogEditor/ogEditor.py =================================================================== --- branches/ogEditor/ogEditor.py 2008-05-18 19:30:59 UTC (rev 900) +++ branches/ogEditor/ogEditor.py 2008-05-20 21:26:54 UTC (rev 901) @@ -21,15 +21,17 @@ import opengate as og -class OGView3D( OgreWindow ): - def _PopulateScene(self): - #automatic called by parent init -# self.headEnt = self.sceneManager.createEntity("ogreHead", "athene.mesh") - self.headEnt = self.sceneManager.createEntity("ogreHead", "ogrehead.mesh") - #self.headEnt = self.sceneManager.createEntity("ogreHead", "Firefly.mesh") - self.headNode = self.sceneManager.getRootSceneNode().createChildSceneNode( ) - self.headNode.attachObject( self.headEnt ) - #self.sceneManager.setAmbientLight( (0.0, 0.0, 1.0, 1.0) ) +#class OGView3D( OgreWindow ): + #def _PopulateScene(self): + ##automatic called by parent init +## self.headEnt = self.sceneManager.createEntity("ogreHead", "athene.mesh") + ##self.headEnt = self.sceneManager.createEntity("ogreHead", "ogrehead.mesh") + ###self.headEnt = self.sceneManager.createEntity("ogreHead", "Firefly.mesh") + ##self.headNode = self.sceneManager.getRootSceneNode().createChildSceneNode( ) + ##self.headNode.attachObject( self.headEnt ) + ##self.sceneManager.setAmbientLight( (0.0, 0.0, 1.0, 1.0) ) + #sector = og.Sector( self.sceneManager, None ) + ##sector.populate("testsector") ID_MB_FILE_EXIT = wx.NewId() ID_MB_VIEW_SCENETREE = wx.NewId() @@ -59,7 +61,9 @@ self.initFrameManager_() self.initOpenGateResources_(); + self.sector = og.Sector( self.ogreRenderWindow.sceneManager, None ); + self.setDefaultProperties_(); self.auiMgr.Update() @@ -142,7 +146,7 @@ ################################################################################# def createRenderWindow_( self ): - self.ogreRenderWindow = OGView3D( self, -1, ogResourceMan = self.ogResourceManager ) + self.ogreRenderWindow = OgreWindow( self, -1, ogResourceMan = self.ogResourceManager ) return self.ogreRenderWindow def createCrustWindow_( self ): @@ -191,6 +195,7 @@ entityManager.load( self.ogResourceManager.resourceLocations( "General" ), "guns" ); entityManager.load( self.ogResourceManager.resourceLocations( "General" ), "missiles" ); entityManager.load( self.ogResourceManager.resourceLocations( "General" ), "ships" ); + entityManager.load( self.ogResourceManager.resourceLocations( "General" ), "stations" ); def setDefaultProperties_( self ): self.SetTitle("ogEditor") @@ -248,14 +253,24 @@ event.Skip() def doSelectTreeObject( self, event ): - self.objectInspector.showData( event.GetEventObject().GetPyData( event.GetEventObject().GetSelection() ) ); + + obj = event.GetEventObject().GetPyData( event.GetEventObject().GetSelection() ) + self.ogreRenderWindow.camera.lookAt( obj.getWorldPosition() ) + self.objectInspector.showData( obj ); event.Skip() ################################################################################# # utils ################################################################################# + def createObject( self, name, meshname ): + sceneManager = self.ogreRenderWindow.sceneManager; + node = sceneManager.getRootSceneNode().createChildSceneNode( name ); + entity = sceneManager.createEntity( name, meshname ); + node.attachObject( entity ); + def UpdateSceneGraphEvent(self, event): + self.sceneTree.DeleteAllItems() root = self.sceneTree.AddRoot( "SceneManager" ) self.sceneTree.SetPyData( root, self.ogreRenderWindow.sceneManager ) @@ -285,7 +300,8 @@ object_it = scenenode.getAttachedObjectIterator() while object_it.hasMoreElements(): m = object_it.getNext() - item = self.sceneTree.AppendItem( treenode, m.getMovableType() + "-" + m.getName() ) + item = self.sceneTree.AppendItem( treenode, m.getName() ) + #item = self.sceneTree.AppendItem( treenode, m.getMovableType() + "-" + m.getName() ) if m.getMovableType() == "Entity": id = self.SceneEntityIconID Modified: branches/ogEditor/plugins.cfg =================================================================== --- branches/ogEditor/plugins.cfg 2008-05-18 19:30:59 UTC (rev 900) +++ branches/ogEditor/plugins.cfg 2008-05-20 21:26:54 UTC (rev 901) @@ -17,4 +17,4 @@ Plugin=Plugin_ParticleFX #Plugin=Plugin_BSPSceneManager #Plugin=Plugin_OctreeSceneManager -#Plugin=Plugin_CgProgramManager +Plugin=Plugin_CgProgramManager Modified: branches/ogEditor/propgridtest.py =================================================================== --- branches/ogEditor/propgridtest.py 2008-05-18 19:30:59 UTC (rev 900) +++ branches/ogEditor/propgridtest.py 2008-05-20 21:26:54 UTC (rev 901) @@ -1,11 +1,13 @@ - +#!/usr/bin/python import wxversion wxversion.ensureMinimal('2.8') +import sys +import wx +sys.path.append( './src/' ) + from PropertyGrid import * -import sys -import wx class testClass(): def printValue(self, value): @@ -22,8 +24,11 @@ self.propertyGrid = PropertyMainGrid( self, -1, wx.DefaultPosition, wx.DefaultSize ) self.propertyGrid.appendRowItemName( "Main", "name" ) + self.propertyGrid.appendRowItemName( "float", value = 10.1, format = FORMAT_FLOAT, cback = test.printValue ) + self.propertyGrid.appendRowItemName( "int", value = 10, format = FORMAT_INT, cback = test.printValue ) + self.propertyGrid.appendRowItemSlider( "slider", cback = test.printValue ) - self.propertyGrid.appendPaneColourSelect( "Colour", cback = test.printValue ) + self.propertyGrid.appendRowItemColourSelect( "Colour", cback = test.printValue ) pane = PropertyPaneItem( self.propertyGrid, "testPane " ) self.propertyGrid.appendPane( pane ) @@ -32,13 +37,22 @@ pane.appendRow( text ) self.propertyGrid.appendRowItemSlider( "expDensity", 0.0001, 0.0002, - format = SLIDER_LOG10, + format = FORMAT_LOG10, cback = test.printValue ) modes = ("one", "two", "three" ) - self.propertyGrid.appendRowItemChoice( "Choice", itemList = modes, cback = test.printValue ) + self.propertyGrid.appendRowItemChoice( "Choice set", value = "one", + itemList = modes, cback = test.printValue ) + dic = ( (1, "eins"), (2, "zwei"), (3, "drei")) - self.propertyGrid.appendRowItemChoice( "Choice", itemMap = dic, cback = test.printValue ) + self.propertyGrid.appendRowItemChoice( "Choice map", value = 1, + itemMap = dic, cback = test.printValue ) + self.propertyGrid.appendRowItemFileSelect( "File", cback = test.printValue ) + self.propertyGrid.appendRowItemFileSelect( "Files", cback = test.printValue, + flag = wx.MULTIPLE ) + + self.propertyGrid.appendRowItemButton( "Button", cback = test.printValue ) + self.propertyGrid.appendRowItemInfo( "here is a long an verbose text entry" ) if __name__ == "__main__": ogEditor = wx.PySimpleApp(0) Modified: branches/ogEditor/resources.cfg =================================================================== --- branches/ogEditor/resources.cfg 2008-05-18 19:30:59 UTC (rev 900) +++ branches/ogEditor/resources.cfg 2008-05-20 21:26:54 UTC (rev 901) @@ -5,32 +5,32 @@ # Resource locations to be added to the default path [General] FileSystem=../../trunk/data/ +FileSystem=../../trunk/data/asteroids +FileSystem=../../trunk/data/capacitors FileSystem=../../trunk/data/commodities -FileSystem=../../trunk/data/capacitors +FileSystem=../../trunk/data/gui +FileSystem=../../trunk/data/gui/fonts +FileSystem=../../trunk/data/gui/layouts +FileSystem=../../trunk/data/gui/imagesets +FileSystem=../../trunk/data/gui/schemes +FileSystem=../../trunk/data/gui/looknfeel +FileSystem=../../trunk/data/gui/overlays +FileSystem=../../trunk/data/ecms FileSystem=../../trunk/data/engines +FileSystem=../../trunk/data/guns +FileSystem=../../trunk/data/materials +FileSystem=../../trunk/data/misc +FileSystem=../../trunk/data/missiles +FileSystem=../../trunk/data/power_plants FileSystem=../../trunk/data/radars FileSystem=../../trunk/data/shields -FileSystem=../../trunk/data/ecms -FileSystem=../../trunk/data/power_plants -FileSystem=../../trunk/data/guns -FileSystem=../../trunk/data/missiles FileSystem=../../trunk/data/ships/octavius/apteryx FileSystem=../../trunk/data/ships/quantar/storm +FileSystem=../../trunk/data/ships/squadrok/squid FileSystem=../../trunk/data/ships/tauseti/lady_kickstart -FileSystem=../../trunk/data/ships/squadrok/squid FileSystem=../../trunk/data/skybox FileSystem=../../trunk/data/stations -FileSystem=../../trunk/data/materials FileSystem=../../trunk/data/textures -FileSystem=../../trunk/data/asteroids -FileSystem=../../trunk/data/misc -FileSystem=../../trunk/data/gui -FileSystem=../../trunk/data/gui/fonts -FileSystem=../../trunk/data/gui/layouts -FileSystem=../../trunk/data/gui/imagesets -FileSystem=../../trunk/data/gui/schemes -FileSystem=../../trunk/data/gui/looknfeel -FileSystem=../../trunk/data/gui/overlays Zip=../../trunk/data/skybox/simpleSkybox.zip Modified: branches/ogEditor/src/ObjectInspectorPanels.py =================================================================== --- branches/ogEditor/src/ObjectInspectorPanels.py 2008-05-18 19:30:59 UTC (rev 900) +++ branches/ogEditor/src/ObjectInspectorPanels.py 2008-05-20 21:26:54 UTC (rev 901) @@ -176,13 +176,15 @@ def showSceneNode( self, data ): self.typeStaticText.SetLabel( "SceneNode" ) - self.showName( data ); - + self.showName( data ) + print data.getWorldPosition() + self.propertyGrid.appendRowItemInfo( "world position (%g, %g, %g)"%(data.getWorldPosition().x, data.getWorldPosition().y, data.getWorldPosition().z) ) + def showResource( self, data ): self.typeStaticText.SetLabel( "Resource: " + data.getCreator().getResourceType() ) self.showName( data ); - self.appendRowItemName( "Group", data.getGroup() ) - self.appendRowItemName( "Origin", data.getOrigin() ) + self.propertyGrid.appendRowItemName( "Group", data.getGroup() ) + self.propertyGrid.appendRowItemName( "Origin", data.getOrigin() ) # params = data.getParameters() # if len( params ) > 0: Modified: branches/ogEditor/src/OgreWindowWx.py =================================================================== --- branches/ogEditor/src/OgreWindowWx.py 2008-05-18 19:30:59 UTC (rev 900) +++ branches/ogEditor/src/OgreWindowWx.py 2008-05-20 21:26:54 UTC (rev 901) @@ -207,26 +207,25 @@ def _CreateCamera(self): "create a Camera" - camera = self.sceneManager.createCamera('Camera') - camera.lookAt(ogre.Vector3(0, 0, 0)) - camera.nearClipDistance = 1 - camera.setAutoAspectRatio( True ) + self.camera = self.sceneManager.createCamera('Camera') + self.camera.lookAt(ogre.Vector3(0, 0, 0)) + self.camera.nearClipDistance = 1 + self.camera.setAutoAspectRatio( True ) - self.sceneEntities.camera = camera - # create the camera nodes & attach camera - cameraNode = self.sceneManager.getRootSceneNode().createChildSceneNode( camera.getName() + "/Node", + cameraNode = self.sceneManager.getRootSceneNode().createChildSceneNode( self.camera.getName(), ogre.Vector3( 0, 0, 250 ) ) pitchNode = cameraNode.createChildSceneNode( cameraNode.getName() + "/PitchNode" ) - pitchNode.attachObject( camera ) + pitchNode.attachObject( self.camera ) + self.sceneEntities.camera = self.camera self.sceneEntities.cameraNode = cameraNode self.sceneEntities.cameraPitchNode = pitchNode def _CreateViewport(self): "create a Viewport" renderWindow=self.renderWindow - viewport = renderWindow.addViewport( self.sceneEntities.camera, 0, 0.0, 0.0, 1.0, 1.0) + viewport = renderWindow.addViewport( self.camera, 0, 0.0, 0.0, 1.0, 1.0) viewport.backgroundColour = ogre.ColourValue(0, 0, 0) def _PopulateScene(self): @@ -236,21 +235,34 @@ def _MouseAndKeysBindings(self): "Some Additional mouse and keys bindings" d=10.0 #displacement for key strokes - self.ControlKeyDict={ wx.WXK_LEFT :ogre.Vector3( -d, 0.0, 0.0), - wx.WXK_RIGHT :ogre.Vector3( d, 0.0, 0.0), - wx.WXK_UP :ogre.Vector3( 0.0, 0.0, -d), - wx.WXK_DOWN :ogre.Vector3( 0.0, 0.0, d), - wx.WXK_PAGEUP :ogre.Vector3( 0.0, d, 0.0), - wx.WXK_PAGEDOWN :ogre.Vector3( 0.0, -d, 0.0)} + self.moveKeyDict={ ord('W') :ogre.Vector3( 0.0, 0.0, -d), + ord('S') :ogre.Vector3( 0.0, 0.0, d), + ord('A') :ogre.Vector3( -d, 0.0, 0.0), + ord('D') :ogre.Vector3( d, 0.0, 0.0), + ord('R') :ogre.Vector3( 0.0, d, 0.0), + ord('F') :ogre.Vector3( 0.0, -d, 0.0), + wx.WXK_LEFT :ogre.Vector3( -d, 0.0, 0.0), + wx.WXK_RIGHT :ogre.Vector3( d, 0.0, 0.0), + wx.WXK_UP :ogre.Vector3( 0.0, 0.0, -d), + wx.WXK_DOWN :ogre.Vector3( 0.0, 0.0, d), + wx.WXK_PAGEUP :ogre.Vector3( 0.0, d, 0.0), + wx.WXK_PAGEDOWN :ogre.Vector3( 0.0, -d, 0.0)} + #ord('Q') :ogre.Vector3( 0.0, d, 0.0), + #ord('E') :ogre.Vector3( 0.0, -d, 0.0), + self.Bind( wx.EVT_KEY_DOWN, self._DefaultKeyDownManager ) self.Bind( wx.EVT_MOUSE_EVENTS, self._DefaultMouseEventManager) ##self.Bind(wx.EVT_ENTER_WINDOW,lambda evt : self.SetFocus()) def _DefaultKeyDownManager( self, event ): "If you want to implement a similar callback function, do not forget the event.Skip() at the end" - validMove = self.ControlKeyDict.get( event.m_keyCode, False ) + validMove = self.moveKeyDict.get( event.m_keyCode, False ) if validMove: - self.sceneEntities.cameraNode.translate( validMove, self.sceneEntities.cameraNode.TS_LOCAL ) + self.sceneEntities.cameraNode.translate( validMove, self.sceneEntities.cameraNode.TS_LOCAL ) + + #validRot = self.rotKeyDict.get( event.m_keyCode, False ) + #if validRot: + #self.sceneEntities.cameraNode.translate( validMove, self.sceneEntities.cameraNode.TS_LOCAL ) event.Skip() def _DefaultMouseEventManager( self, event ): @@ -262,10 +274,11 @@ if event.Dragging() and event.RightIsDown(): #Dragging with RMB x,y = event.GetPosition() - dx = x-self.StartDragX - dy = y-self.StartDragY + dx = self.StartDragX -x + dy = self.StartDragY -y self.StartDragX, self.StartDragY = x, y - self.sceneEntities.cameraNode.yaw( ogre.Degree( dx / 3.0 ) ) - self.sceneEntities.cameraPitchNode.pitch( ogre.Degree( dy / 3.0 ) ) + self.sceneEntities.cameraNode.yaw( ogre.Degree( dx / 3.0 ), ogre.Node.TS_LOCAL ) + self.sceneEntities.cameraNode.pitch( ogre.Degree( dy / 3.0 ), ogre.Node.TS_LOCAL ) + #self.sceneEntities.cameraPitchNode.pitch( ogre.Degree( dy / 3.0 ), ogre.Node.TS_LOCAL ) event.Skip() Modified: branches/ogEditor/src/PropertyGrid.py =================================================================== --- branches/ogEditor/src/PropertyGrid.py 2008-05-18 19:30:59 UTC (rev 900) +++ branches/ogEditor/src/PropertyGrid.py 2008-05-20 21:26:54 UTC (rev 901) @@ -1,23 +1,77 @@ -#!/usr/bin/env python - -import wx +import os, os.path, wx +import string import wx.combo import wx.lib.colourselect as csel -SLIDER_INT=0 -SLIDER_FLOAT=1 -SLIDER_LOG10=2 +FORMAT_INT=0 +FORMAT_FLOAT=1 +FORMAT_LOG10=2 +FORMAT_STRING=3 +ALPHA_ONLY = 1 +DIGIT_ONLY = 2 + class NullLog: - def write(*args): + def write(self, *args): pass class SimpleLog: - def write(*args): + def write(self, *args): print args +class MyValidator(wx.PyValidator): + def __init__(self, flag=None, pyVar=None): + wx.PyValidator.__init__(self) + self.flag = flag + self.Bind(wx.EVT_CHAR, self.OnChar) + def Clone(self): + return MyValidator(self.flag) + + def Validate(self, win): + tc = self.GetWindow() + val = tc.GetValue() + + if self.flag == ALPHA_ONLY: + for x in val: + if x not in string.letters: + return False + + elif self.flag == DIGIT_ONLY: + for x in val: + if x not in string.digits: + return False + + return True + + def OnChar(self, event): + key = event.GetKeyCode() + + if key < wx.WXK_SPACE or key == wx.WXK_DELETE or key > 255: + event.Skip() + return + + if self.flag == ALPHA_ONLY and chr(key) in string.letters: + event.Skip() + return + + if self.flag == DIGIT_ONLY and chr(key) in string.digits: + event.Skip() + return + + if not wx.Validator_IsSilent(): + wx.Bell() + + if self.flag == None: + event.Skip() + + # Returning without calling even.Skip eats the event before it + # gets to the text control + return + class ListCtrlComboPopup( wx.ListCtrl, wx.combo.ComboPopup ): + value = -1 + curritem = -1 def __init__( self, log = None, cback = None ): if log: self.log = log @@ -38,6 +92,14 @@ def AddItem(self, txt): self.InsertStringItem(self.GetItemCount(), txt) + def AddItems(self, txt): + for i in txt: + self.InsertStringItem(self.GetItemCount(), i) + + def SetItems(self, txt): + self.ClearAll() + self.AddItems( txt ) + def OnMotion(self, evt): item, flags = self.HitTest(evt.GetPosition()) if item >= 0: @@ -137,85 +199,271 @@ self.log.write("ListCtrlComboPopup.LazyCreate") return wx.combo.ComboPopup.LazyCreate(self) +class PropertyRowItem( ): + cback_ = None + parent_ = None + size_ = None + labelTextCtrl_ = None + rowHeight_ = 10 -class PropertyRowItem( ): + def __init__( self, parent, name, cback = None ): + self.cback_ = cback + self.parent_ = parent + self.sizer_ = wx.BoxSizer( wx.HORIZONTAL ) + + self.labelTextCtrl_ = wx.TextCtrl( parent, -1, name, + style = wx.NO_BORDER | wx.ALIGN_LEFT ) + self.rowHeight_ = self.labelTextCtrl_.GetSize()[ 1 ] + self.labelTextCtrl_.SetEditable( False ) + self.sizer_.Add( self.labelTextCtrl_, 0, wx.EXPAND | wx.ALIGN_RIGHT ) + + def Disable(self): + for item in self.sizer_.GetChildren(): + if item.GetWindow() != None: + item.GetWindow().Disable() + + def Enable(self, value ): + for item in self.sizer_.GetChildren(): + if item.GetWindow() != None: + item.GetWindow().Enable( value ) + +class PropertyRowItemInfo( PropertyRowItem ): def __init__( self, parent, name ): - self.sizer = wx.BoxSizer( wx.HORIZONTAL ) - - labelTextCtrl = wx.TextCtrl( parent, -1, name, + self.sizer_ = wx.BoxSizer( wx.HORIZONTAL ) + self.labelTextCtrl_ = wx.TextCtrl( parent, -1, name, style = wx.NO_BORDER | wx.ALIGN_LEFT ) - self.rowHeight = labelTextCtrl.GetSize()[ 1 ] - labelTextCtrl.SetEditable( False ) - self.sizer.Add( labelTextCtrl, 0, wx.EXPAND | wx.ALIGN_RIGHT ) - + self.labelTextCtrl_.SetEditable( False ) + self.sizer_.Add( self.labelTextCtrl_, 1, wx.EXPAND | wx.ALIGN_RIGHT ) + class PropertyRowItemName( PropertyRowItem ): - def __init__( self, parent, name, value = "" ): - PropertyRowItem.__init__( self, parent, name ) - self.valueTextCtrl = wx.TextCtrl( parent, -1, value, - size = wx.Size( 30, self.rowHeight ), - style = wx.NO_BORDER | wx.ALIGN_LEFT | wx.EXPAND) - self.sizer.AddSpacer( 1 ) - self.sizer.Add( self.valueTextCtrl, 1, wx.EXPAND | wx.ALIGN_LEFT ) + valueTextCtrl_ = None + format_ = None + def __init__( self, parent, name, value = None, format = FORMAT_STRING, cback = None): + PropertyRowItem.__init__( self, parent, name, cback = cback ) + self.format_ = format + self.validator = MyValidator() + + if format == FORMAT_INT: + self.validator = MyValidator( DIGIT_ONLY ) + + self.valueTextCtrl_ = wx.TextCtrl( parent, -1, "", + size = wx.Size( 40, self.rowHeight_ ), + style = wx.NO_BORDER | wx.ALIGN_LEFT | wx.EXPAND, + validator = self.validator ) + + if ( format == FORMAT_STRING ): + self.valueTextCtrl_.SetValue( "%s" % value ); + elif ( format == FORMAT_INT ): + self.valueTextCtrl_.SetValue( "%d" % value ); + elif ( format == FORMAT_FLOAT ): + self.valueTextCtrl_.SetValue( "%g" % value ); + + self.sizer_.AddSpacer( 1 ) + self.sizer_.Add( self.valueTextCtrl_, 1, wx.EXPAND | wx.ALIGN_LEFT ) + + self.valueTextCtrl_.Bind( wx.EVT_KILL_FOCUS, self.onText ) + + def onText(self, event): + self.value = self.valueTextCtrl_.GetValue() + self.applyValue( True ) + + def applyValue( self, update = True ): + if self.format_ == FORMAT_INT: + self.value = int(self.value) + elif self.format_ == FORMAT_FLOAT: + self.value = float(self.value) + + if update == True: + if self.cback_ != None: + self.cback_( self.value ) +class PropertyRowItemButton( PropertyRowItem ): + button_ = None + + def __init__( self, parent, name, cback = None ): + PropertyRowItem.__init__( self, parent, name, cback = cback ) + self.button_ = wx.Button( parent, -1, + size = wx.Size( 40, self.rowHeight_ ), + style = wx.NO_BORDER | wx.ALIGN_LEFT | wx.EXPAND) + self.sizer_.AddSpacer( 1 ) + self.sizer_.Add( self.button_, 1, wx.EXPAND | wx.ALIGN_LEFT ) + self.button_.Bind( wx.EVT_BUTTON, self.cback_ ) + +class PropertyRowItemFileSelect( PropertyRowItem ): + def __init__( self, parent, name, value = "", cback = None, flag = 0, + wildcard = "All files (*.*)|*.*" ): + PropertyRowItem.__init__( self, parent, name, cback = cback ) + self.value = value + self.filename = self.value + self.paths = [] + self.wildcard = wildcard + self.flag = flag + if self.flag == wx.MULTIPLE: + self.choice = wx.combo.ComboCtrl( parent, -1, + size = wx.Size( 100, self.rowHeight_ ), + style = wx.NO_BORDER | wx.NO_3D | wx.CB_READONLY ) + self.popup = ListCtrlComboPopup( cback = self.setFilenameIdx ) + self.popup.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "")) + self.choice.SetPopupControl( self.popup ) + + self.sizer_.AddSpacer( 1 ) + self.sizer_.Add( self.choice, 1, wx.EXPAND | wx.ALIGN_LEFT ) + else: + self.valueTextCtrl = wx.TextCtrl( parent, -1, value, + size = wx.Size( 40, self.rowHeight_ ), + style = wx.NO_BORDER | wx.ALIGN_LEFT | wx.EXPAND) + self.sizer_.AddSpacer( 1 ) + self.sizer_.Add( self.valueTextCtrl, 1, wx.EXPAND | wx.ALIGN_LEFT ) + + self.fileSelectButton = wx.Button( parent, -1, "'''", + size = wx.Size( self.rowHeight_, self.rowHeight_ ), + style = wx.NO_BORDER + ) + + self.sizer_.AddSpacer( 1 ) + self.sizer_.Add( self.fileSelectButton, 0, wx.EXPAND ) + self.fileSelectButton.Bind( wx.EVT_BUTTON, self.OnButton ) + + def OnButton( self, event): + dlg = wx.FileDialog( self.parent, message="Choose a file", + defaultDir=os.getcwd(), + defaultFile="", + wildcard=self.wildcard, + style=wx.OPEN | wx.CHANGE_DIR | self.flag) + + if dlg.ShowModal() == wx.ID_OK: + self.paths = dlg.GetPaths() + self.filename = self.paths[0] + + if self.flag == wx.MULTIPLE: + self.popup.ClearAll() + for path in self.paths: + self.popup.AddItem( os.path.basename( path ) ) + self.popup.Select(0) + self.applyValue() + #self.choice.SetSelection(0) + self.choice.SetValue(os.path.basename( self.filename )) + else: + self.valueTextCtrl.SetValue( os.path.basename( self.filename ) ) + self.applyValue() + + dlg.Destroy() + + def setFilenameIdx(self, idx ): + if idx >= 0: + self.filename = self.paths[ idx ] + self.applyValue() + + def applyValue( self, update = True ): + + if type( self.filename ) == unicode: + self.filename = self.filename.encode("iso-8859-1", "ignore") + + if update == True: + if self.cback_ != None: + self.cback_( self.filename ) + +class PropertyRowItemCheck( PropertyRowItem ): + def __init__( self, parent, name, value = False, cback = None): + PropertyRowItem.__init__( self, parent, name, cback = cback ) + self.isChecked = value + self.checkbox = wx.CheckBox( parent, -1 ) + self.sizer_.AddSpacer( 1 ) + self.sizer_.Add( self.checkbox, 1, wx.EXPAND | wx.ALIGN_LEFT ) + self.checkbox.Bind( wx.EVT_CHECKBOX, self.onChecked ) + self.checkbox.SetValue( self.isChecked ) + + def onChecked( self, event ): + self.isChecked = event.IsChecked() + self.applyValue() + + def applyValue( self, update = True ): + if update == True: + if self.cback_ != None: + self.cback_( self.isChecked ) + class PropertyRowItemSlider( PropertyRowItem ): - def __init__( self, parent, name, start = 0, end = 100, format = SLIDER_INT, cback = None ): - PropertyRowItem.__init__( self, parent, name ) + def __init__( self, parent, name, value = 0, start = 0, end = 100, + format = FORMAT_INT, cback = None ): + PropertyRowItem.__init__( self, parent, name, cback = cback ) self.format = format - self.cback = cback - self.value = 0 + self.value = value self.start = start self.end = end + if self.end == self.start: + self.end = self.end +1 + self.sliderValue = 0 - if self.format == SLIDER_INT: + if self.format == FORMAT_INT: + self.validator = MyValidator( DIGIT_ONLY ) self.sliderStart = start self.sliderEnd = end else: + self.validator = MyValidator( DIGIT_ONLY ) self.sliderStart = 0 self.sliderEnd = 100 + self.start = float( self.start ) + self.end = float( self.end ) self.scale = float( self.end - self.start )/( self.sliderEnd - self.sliderStart ) self.valueTextCtrl = wx.TextCtrl( parent, -1, "", - size = wx.Size( 30, self.rowHeight ), - style = wx.NO_BORDER | wx.ALIGN_LEFT | wx.EXPAND) + size = wx.Size( 40, self.rowHeight_ ), + style = wx.NO_BORDER | wx.ALIGN_LEFT | wx.EXPAND, + validator = self.validator) self.slider = wx.Slider( parent, -1, self.sliderValue, self.sliderStart, self.sliderEnd, - size = wx.Size( 100, self.rowHeight ), + size = wx.Size( 100, self.rowHeight_ ), style = wx.NO_BORDER | wx.NO_3D ) - self.sizer.AddSpacer( 1 ) - self.sizer.Add( self.valueTextCtrl, 0, wx.EXPAND | wx.ALIGN_LEFT ) - self.sizer.Add( self.slider, 1, wx.EXPAND | wx.ALIGN_LEFT ) - self.slider.Bind(wx.EVT_SLIDER, self.OnSlide ) + self.sizer_.AddSpacer( 1 ) + self.sizer_.Add( self.valueTextCtrl, 0, wx.EXPAND | wx.ALIGN_LEFT ) + self.sizer_.Add( self.slider, 1, wx.EXPAND | wx.ALIGN_LEFT ) + + self.valueTextCtrl.Bind( wx.EVT_KILL_FOCUS, self.onText ) + + self.slider.Bind(wx.EVT_SLIDER, self.onSlide ) + self.slider.Bind(wx.EVT_COMMAND_SCROLL_ENDSCROLL, self.onSlideEnd ) + self.applyValue( False ) - def OnSlide(self, event): + def onText(self, event): + self.value = self.valueTextCtrl.GetValue() + self.applyValue( True ) + + def onSlideEnd(self, event): val = event.GetEventObject().GetValue() self.value = self.start + self.scale * val; - self.applyValue() + self.applyValue( True ) + + def onSlide(self, event): + val = event.GetEventObject().GetValue() + self.value = self.start + self.scale * val; + self.applyValue( False ) def setValue(self, value): self.value = value self.applyValue( False ) def applyValue( self, update = True ): - if self.format == SLIDER_INT: + if self.format == FORMAT_INT: + self.value = int(self.value) self.valueTextCtrl.SetValue( "%d" % self.value ) else: - self.valueTextCtrl.SetValue( "%.1g" % self.value ) + self.value = float(self.value) + self.valueTextCtrl.SetValue( "%.1f" % self.value ) self.slider.SetValue( (self.value -self.start)/ self.scale ) if update == True: - if self.cback != None: - self.cback( self.value ) + if self.cback_ != None: + self.cback_( self.value ) class PropertyRowItemChoice( PropertyRowItem ): - def __init__( self, parent, name, itemList = None, itemMap = None, cback = None): - PropertyRowItem.__init__( self, parent, name ) - - self.cback = cback - self.value = "None" + def __init__( self, parent, name, value = None, itemList = None, itemMap = None, cback = None): + PropertyRowItem.__init__( self, parent, name, cback = cback ) + + self.value = "" if itemList != None: self.ITEMDICT = False @@ -225,34 +473,38 @@ self.itemList = itemMap self.choice = wx.combo.ComboCtrl( parent, -1, - size = wx.Size( 100, self.rowHeight ), + size = wx.Size( 100, self.rowHeight_ ), style = wx.NO_BORDER | wx.NO_3D | wx.CB_READONLY ) - - #self.choice.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "")) - self.popup = ListCtrlComboPopup( cback = self.choiceChanged ) self.popup.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "")) - self.choice.SetPopupControl( self.popup ) - - + if self.ITEMDICT == False: for i in self.itemList: self.popup.AddItem( i ) + if i == value: + self.value = value + self.valueName = i else: for i in self.itemList: self.popup.AddItem( i[ 1 ] ) + if i[0] == value: + self.value = i[0] + self.valueName = i[1] - self.sizer.AddSpacer( 1 ) - self.sizer.Add( self.choice, 1, wx.EXPAND | wx.ALIGN_LEFT ) + self.sizer_.AddSpacer( 1 ) + self.sizer_.Add( self.choice, 1, wx.EXPAND | wx.ALIGN_LEFT ) + self.popup.Select(0) + self.choice.SetValue( self.valueName ) def choiceChanged(self, idx): - if self.ITEMDICT == False: - self.value = self.itemList[ idx ] - else: - self.value = self.itemList[idx][ 0 ] + if idx != -1: + if self.ITEMDICT == False: + self.value = self.itemList[ idx ] + else: + self.value = self.itemList[idx][ 0 ] - self.applyValue() + self.applyValue() def setValue(self, value): self.value = value @@ -271,22 +523,21 @@ # print item if update == True: - if self.cback != None: - self.cback( self.value ) + if self.cback_ != None: + self.cback_( self.value ) class PropertyRowItemColourSelect( PropertyRowItemName ): def __init__( self, parent, name, cback = None ): - PropertyRowItemName.__init__( self, parent, name ) - self.cback = cback + PropertyRowItemName.__init__( self, parent, name, cback = cback ) self.value = wx.Colour(0,0,0) self.colourButton = csel.ColourSelect( parent, -1, "", colour = self.value, - size = wx.Size( self.rowHeight,self.rowHeight ), + size = wx.Size( self.rowHeight_, self.rowHeight_ ), style = wx.NO_BORDER ) - self.sizer.AddSpacer( 1 ) - self.sizer.Add( self.colourButton, 0, wx.EXPAND ) + self.sizer_.AddSpacer( 1 ) + self.sizer_.Add( self.colourButton, 0, wx.EXPAND ) self.colourButton.Bind( csel.EVT_COLOURSELECT, self.OnColour ) def OnColour(self, event): @@ -298,48 +549,72 @@ self.applyValue( False ) def applyValue( self, update = True ): - self.valueTextCtrl.SetValue( "%d,%d,%d" % (self.value[0],self.value[1],self.value[2]) ) + self.valueTextCtrl_.SetValue( "%d,%d,%d" % (self.value[0],self.value[1],self.value[2]) ) self.colourButton.SetColour( self.value ) if update == True: - if self.cback != None: - self.cback( self.value ) + if self.cback_ != None: + self.cback_( self.value ) class PropertyGrid( ): def __init__(self): - self.sizer = wx.BoxSizer( wx.VERTICAL ) - self.SetSizer( self.sizer ) - self.widthCol0 = 70 + self.sizer_ = wx.BoxSizer( wx.VERTICAL ) + self.SetSizer( self.sizer_ ) + self.widthCol0 = 50 self.widthCol2 = 24 self.xOffset = 17 def appendRow(self, row ): - self.sizer.AddSpacer(1) - self.sizer.Add( row.sizer, 0, wx.EXPAND ) + self.sizer_.AddSpacer(1) + self.sizer_.Add( row.sizer_, 0, wx.EXPAND ) - def appendRowItemName(self, name, value = "" ): - item = PropertyRowItemName( self.pane, name, value ) + def appendRowItemInfo(self, name ): + item = PropertyRowItemInfo( self.pane, name ) self.appendRow( item ) return item - def appendRowItemChoice(self, name, itemList = None, itemMap = None, cback = None ): - item = PropertyRowItemChoice( self.pane, name, itemList, itemMap, cback ) + def appendRowItemName(self, name, value = None, format = FORMAT_STRING, cback = None ): + item = PropertyRowItemName( self.pane, name, value, format, cback ) + self.appendRow( item ) + return item + + def appendRowItemButton(self, name, cback = None ): + item = PropertyRowItemButton( self.pane, name, cback = cback) + self.appendRow( item ) + return item + + def appendRowItemCheck(self, name, value = False, cback = None ): + item = PropertyRowItemCheck( self.pane, name, value, cback = cback) + self.appendRow( item ) + return item + + def appendRowItemChoice(self, name, value = None, itemList = None, itemMap = None, cback = None ): + item = PropertyRowItemChoice( self.pane, name, value, itemList, itemMap, cback ) self.appendRow( item ) return item - def appendRowItemSlider(self, name, start = 0, end = 100, format = SLIDER_INT, cback = None ): - item = PropertyRowItemSlider( self.pane, name, start, end, format, cback ) + def appendRowItemFileSelect(self, name, value = "", cback = None, flag = 0, + wildcard = "All files (*.*)|*.*" ): + item = PropertyRowItemFileSelect( self.pane, name, value = value, + cback = cback, flag = flag, + wildcard = wildcard ) self.appendRow( item ) return item + def appendRowItemSlider( self, name, value = 0, start = 0, end = 100, + format = FORMAT_INT, cback = None ): + item = PropertyRowItemSlider( self.pane, name, value, start, end, format, cback ) + self.appendRow( item ) + return item + def appendRowItemColourSelect( self, name, cback = None ): - item = PropertyRowItemColourSelect( self.pane, name, cback ) + item = PropertyRowItemColourSelect( self.pane, name, cback = cback ) self.appendRow( item ) return item def appendPane(self, pane ): - self.sizer.AddSpacer(1) - self.sizer.Add( pane, 0, wx.EXPAND ) + self.sizer_.AddSpacer(1) + self.sizer_.Add( pane, 0, wx.EXPAND ) def appendPaneColourSelect( self, name, cfront = None, cback = None ): pane = PropertyPaneItemColour( self.pane, name, cfront, cback ) @@ -370,7 +645,7 @@ event.GetEventObject().GetPane().Hide() else: event.GetEventObject().GetPane().Show() - parent = self.GetParent().Layout() + self.GetParent().Layout() class PropertyPaneItemColour( PropertyPaneItem ): @@ -386,7 +661,7 @@ self.g = self.appendRowItemSlider( "green", 0, 255, cback = self.setGreen ) self.b = self.appendRowItemSlider( "blue", 0, 255, cback = self.setBlue ) self.a = self.appendRowItemSlider( "alpha", 0, 255, cback = self.setAlpha ) - + if self.cfront != None: colour = self.cfront() self.value = map(lambda x: x * self.scale, [colour[0], colour[1], colour[2], colour[3]] ) @@ -430,6 +705,6 @@ self.pane = self def clean( self ): - self.sizer.Clear( True ) - self.sizer.Layout() + self.sizer_.Clear( True ) + self.sizer_.Layout() Modified: trunk/data/misc/testsector.xml =================================================================== --- trunk/data/misc/testsector.xml 2008-05-18 19:30:59 UTC (rev 900) +++ trunk/data/misc/testsector.xml 2008-05-20 21:26:54 UTC (rev 901) @@ -55,8 +55,8 @@ <position> -250, 0, 500</position> <scale>20, 20, 20</scale> <material>Asteroid</material> - </sectorobject> - <sectorobject> + </sectorobject>--> +- <sectorobject> <name>ring</name> <mesh>ring</mesh> <position> -650, 100, 800</position> Modified: trunk/src/AiCommands.h =================================================================== --- trunk/src/AiCommands.h 2008-05-18 19:30:59 UTC (rev 900) +++ trunk/src/AiCommands.h 2008-05-20 21:26:54 UTC (rev 901) @@ -29,7 +29,6 @@ namespace Ogre{ class Timer; - class Vector3; } #include <OgreVector3.h> Modified: trunk/src/BaseObject.cpp =================================================================== --- trunk/src/BaseObject.cpp 2008-05-18 19:30:59 UTC (rev 900) +++ trunk/src/BaseObject.cpp 2008-05-20 21:26:54 UTC (rev 901) @@ -34,7 +34,7 @@ sceneMgr_ = sector_->sceneManager(); try{ - mainNode_ = sceneMgr_->getRootSceneNode()->createChildSceneNode( name + "_MainNode" ); + mainNode_ = sceneMgr_->getRootSceneNode()->createChildSceneNode( name ); } catch( Ogre::Exception & e ) { LogManager::getSingleton().fatal( e.getFullDescription() ); } Modified: trunk/src/Entity.cpp =================================================================== --- trunk/src/Entity.cpp 2008-05-18 19:30:59 UTC (rev 900) +++ trunk/src/Entity.cpp 2008-05-20 21:26:54 UTC (rev 901) @@ -28,6 +28,7 @@ #include <OgreException.h> #include <OgreCEGUITexture.h> +#include <OgreMeshManager.h> #include <CEGUIImageset.h> #include <CEGUIExceptions.h> #include <CEGUIBase.h> @@ -41,62 +42,62 @@ // addProperty< float >( "baseYaw", this, setBaseYaw, baseYaw, mandatory, default, description ) //Property * prop = new Property< Uint32 >( "mass", this, &OpenGate::Entity::setMass, &OpenGate::Entity::mass ); //properties_.push_back( new Property< Uint32 >( "mass", this, &OpenGate::Entity::setMass, &OpenGate::Entity::mass ) ); - - id_ = 0; - techLevel_ = 0; - mass_ = 1; - size_ = 1; - rtti_ = ENTITY; - factionID_ = 1; - baseSize_ = Ogre::Vector3::ZERO; - baseYaw_ = 0; - basePitch_ = 0; - baseRoll_ = 0; + id_ = 0; + techLevel_ = 0; + mass_ = 1; + size_ = 1; + rtti_ = ENTITY; + factionID_ = 1; - imageInitialised_ = false; - setFactionName_( ResourceManager::getSingleton().factionName( factionID_ ) ); -} - -void Entity::setFactionID( int id ){ - factionID_ = id; + imageInitialised_ = false; setFactionName_( ResourceManager::getSingleton().factionName( factionID_ ) ); } -void Entity::setBaseSize( float length, float width, float height ){ - baseSize_[ 0 ] = length; - baseSize_[ 1 ] = width; - baseSize_[ 2 ] = height; -} +void Entity::readPropertiesFromXML( TiXmlHandle & hRoot ){ + readXMLNode< std::string >( hRoot, "name_"+ ResourceManager::getSingleton().languageSuffix() + " name_en name", + this, &OpenGate::Entity::setName, true ); - /*! If size is a scalar value, the length of the entity. */ -void Entity::setBaseSize( float size ){ baseSize_[ 2 ] = size; } + readXMLNode< Uint16 >( hRoot, "object_id", this, &OpenGate::Entity::setID, true ); + readXMLNode< Uint8 >( hRoot, "faction_id", this, &OpenGate::Entity::setFactionID, true ); -Ogre::Vector3 Entity::baseSize( ) const { return baseSize_; } + // what is that for + //readXMLNode< Uint8 >( hRoot, "class_id", this, &OpenGate::Entity::setClassID, false ); + readXMLNode< Uint8 >( hRoot, "techlevel required_rank", this, &OpenGate::Entity::setTechLevel, false ); + + readXMLNode< int >( hRoot, "size", this, &OpenGate::Entity::setSize, false ); + readXMLNode< int >( hRoot, "mass", this, &OpenGate::Entity::setMass, false ); + + readXMLNode< std::string >( hRoot, "description_" + ResourceManager::getSingleton().languageSuffix() + + " description_en description", this, &OpenGate::Entity::setDescription, false ); + + readXMLNodes< std::string >( hRoot, "production-center", this, &OpenGate::Entity::addProductionCenter ); +} + void Entity::loadImages_( ) { - imageInitialised_ = true; - bool haveSmall = true; + imageInitialised_ = true; + bool haveSmall = true; - if ( imageFileName_ == "unknown" ) imageFileName_ = name_; + if ( imageFileName_ == "unknown" ) imageFileName_ = name_; - if ( !initialiseImage( imageFileName_ + "_small.png", imageFileName_ + "Small" ) ){ - haveSmall = false; - } + if ( !initialiseImage( imageFileName_ + "_small.png", imageFileName_ + "Small" ) ){ + haveSmall = false; + } - if ( haveSmall ){ - ceguiSmallImageName_ = ceguiImageName_; - } + if ( haveSmall ){ + ceguiSmallImageName_ = ceguiImageName_; + } - if ( !initialiseImage( imageFileName_ + "_big.png", imageFileName_ ) ){ + if ( !initialiseImage( imageFileName_ + "_big.png", imageFileName_ ) ){ //**fallback; - initialiseImage( imageFileName_ + ".png", imageFileName_, true ); - } + initialiseImage( imageFileName_ + ".png", imageFileName_, true ); + } - if ( !haveSmall ) { - initialiseImage( imageFileName_ + ".png", imageFileName_ + "Small" ); - ceguiSmallImageName_ = ceguiImageName_; - } + if ( !haveSmall ) { + initialiseImage( imageFileName_ + ".png", imageFileName_ + "Small" ); + ceguiSmallImageName_ = ceguiImageName_; + } } bool Entity::initialiseImage( const std::string & imageName, const std::string & targetName, bool verbose ){ @@ -128,27 +129,26 @@ return !fail; } -void Entity::readPropertiesFromXML( TiXmlHandle & hRoot ){ - readXMLNode< std::string >( hRoot, "name_"+ ResourceManager::getSingleton().languageSuffix() + " name_en name", - this, &OpenGate::Entity::setName, true ); +void Entity::setFactionID( int id ){ + factionID_ = id; + setFactionName_( ResourceManager::getSingleton().factionName( factionID_ ) ); +} - readXMLNode< Uint16 >( hRoot, "object_id", this, &OpenGate::Entity::setID, true ); - readXMLNode< Uint8 >( hRoot, "faction_id", this, &OpenGate::Entity::setFactionID, true ); +MeshEntity::MeshEntity(): Entity(){ + baseSize_ = Ogre::Vector3::ZERO; + baseYaw_ = 0; + basePitch_ = 0; + baseRoll_ = 0; +} - // what is that for - //readXMLNode< Uint8 >( hRoot, "class_id", this, &OpenGate::Entity::setClassID, false ); - readXMLNode< Uint8 >( hRoot, "techlevel required_rank", this, &OpenGate::Entity::setTechLevel, false ); - - readXMLNode< int >( hRoot, "size", this, &OpenGate::Entity::setSize, false ); - readXMLNode< int >( hRoot, "mass", this, &OpenGate::Entity::setMass, false ); +MeshEntity::~MeshEntity(){} + +void MeshEntity::readPropertiesFromXML( TiXmlHandle & hRoot ){ + Entity::readPropertiesFromXML( hRoot ); - readXMLNode< std::string >( hRoot, "description_" + ResourceManager::getSingleton().languageSuffix() + - " description_en description", this, &OpenGate::Entity::setDescription, false ); - - readXMLNodes< std::string >( hRoot, "production-center", this, &OpenGate::Entity::addProductionCenter ); - readXMLNode< float >( hRoot, "baseyaw", this, &OpenGate::Entity::setBaseYaw, false ); - readXMLNode< float >( hRoot, "basepitch", this, &OpenGate::Entity::setBasePitch, false ); - readXMLNode< float >( hRoot, "baseroll", this, &OpenGate::Entity::setBaseRoll, false ); + readXMLNode< float >( hRoot, "baseyaw", this, &OpenGate::MeshEntity::setBaseYaw, false ); + readXMLNode< float >( hRoot, "basepitch", this, &OpenGate::MeshEntity::setBasePitch, false ); + readXMLNode< float >( hRoot, "baseroll", this, &OpenGate::MeshEntity::setBaseRoll, false ); TiXmlElement * pElem; @@ -171,8 +171,44 @@ if ( pElem ) height = toDouble( pElem->FirstChild()->Value() ); if ( length > 0 && width > 0 && height > 0 ) this->setBaseSize( width, height, length ); - + + if ( !readXMLNode< std::string >( hRoot, "mesh", this, &OpenGate::MeshEntity::setMesh, false ) ){ + + try { + setMesh( createMeshName( name_ ) ); + } catch( Ogre::Exception & e ){ + LogManager::getSingleton().warn( e.what() ); + } + } } + +void MeshEntity::setBaseSize( float length, float width, float height ){ + baseSize_[ 0 ] = length; + baseSize_[ 1 ] = width; + baseSize_[ 2 ] = height; +} + /*! If size is a scalar value, the length of the entity. */ +void MeshEntity::setBaseSize( float size ){ baseSize_[ 2 ] = size; } +Ogre::Vector3 MeshEntity::baseSize( ) const { return baseSize_; } + +std::string MeshEntity::createMeshName( const std::string & meshName ){ + return strReplaceBlankWithUnderscore( strCopyToLowerCase( meshName ) ); +} + +void MeshEntity::setMesh( const std::string & meshName ){ + meshName_ = meshName.substr( 0, meshName.rfind( ".mesh" ) ) + ".mesh" ; + + pMesh_ = Ogre::MeshManager::getSingleton().load( meshName_, + "General", + Ogre::HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY, + Ogre::HardwareBuffer::HBU_STATIC_WRITE_ONLY, + true, true); + + unsigned short src = 0, dest = 0; + if ( !pMesh_->suggestTangentVectorBuildParams( Ogre::VES_TANGENT, src, dest) ) { + pMesh_->buildTangentVectors( Ogre::VES_TANGENT, src, dest); + } +} } // namespace OpenGate Modified: trunk/src/Entity.h =================================================================== --- trunk/src/Entity.h 2008-05-18 19:30:59 UTC (rev 900) +++ trunk/src/Entity.h 2008-05-20 21:26:54 UTC (rev 901) @@ -27,6 +27,7 @@ #include "common.h" #include <OgreVector3.h> +#include <OgreMesh.h> // namespace Ogre{ // class Vector3; @@ -35,7 +36,7 @@ namespace OpenGate{ -enum EntityType{NONE,ENTITY,VESSEL,COMMODITY,POWERPLANT,ENGINE,RADAR,ECM,CAPACITOR,SHIELD,GUN,MISSILE,MODX}; +enum EntityType{NONE,ENTITY,VESSEL,COMMODITY,POWERPLANT,ENGINE,RADAR,ECM,CAPACITOR,SHIELD,GUN,MISSILE,MODX,STATION}; enum GunType{UNKNOWN,LASER,MININGLASER,BULLET}; class Commodity; @@ -92,26 +93,6 @@ inline void setID( int id ){ id_ = id; } inline int id( ) const { return id_; } - /*! Base sizes are necessary for resizing the ogremesh */ - void setBaseSize( float length, float width, float height ); - - /*! If size is a scalar value, the length of the entity.*/ - void setBaseSize( float size ); - - Ogre::Vector3 baseSize( ) const; - - /*! Base sizes are necessary for resizing the ogremesh */ - inline void setBaseYaw( Ogre::Real baseYaw ){ baseYaw_ = baseYaw; } - inline Ogre::Real baseYaw( ) const { return baseYaw_; } - - /*! Base sizes are necessary for resizing the ogremesh */ - inline void setBasePitch( Ogre::Real basePitch ){ basePitch_ = basePitch; } - inline Ogre::Real basePitch( ) const { return basePitch_; } - - /*! Base sizes are necessary for resizing the ogremesh */ - inline void setBaseRoll( Ogre::Real baseRoll ){ baseRoll_ = baseRoll; } - inline Ogre::Real baseRoll( ) const { return baseRoll_; } - inline void setTechLevel( int level ){ techLevel_ = level; } inline int techLevel( ) const { return techLevel_; } @@ -153,12 +134,6 @@ std::string factionName_; int factionID_; - //** geometric parameters - Ogre::Vector3 baseSize_; - Ogre::Real baseYaw_; - Ogre::Real basePitch_; - Ogre::Real baseRoll_; - std::string imageFileName_; std::string ceguiSmallImageName_; std::string ceguiImageName_; @@ -185,6 +160,67 @@ //std::vector < Property< class ValueType > * > properties_; }; +class MeshEntity : public Entity{ +public: + MeshEntity(); + + virtual ~MeshEntity(); + + void readPropertiesFromXML( TiXmlHandle & hRoot ); + + /*! Base sizes are necessary for resizing the ogremesh */ + void setBaseSize( float length, float width, float height ); + + /*! If size is a scalar value, the length of the entity.*/ + void setBaseSize( float size ); + Ogre::Vector3 baseSize( ) const; + + /*! Base sizes are necessary for resizing the ogremesh */ + inline void setBaseYaw( Ogre::Real baseYaw ){ baseYaw_ = baseYaw; } + inline Ogre::Real baseYaw( ) const { return baseYaw_; } + + /*! Base sizes are necessary for resizing the ogremesh */ + inline void setBasePitch( Ogre::Real basePitch ){ basePitch_ = basePitch; } + inline Ogre::Real basePitch( ) const { return basePitch_; } + + /*! Base sizes are necessary for resizing the ogremesh */ + inline void setBaseRoll( Ogre::Real baseRoll ){ baseRoll_ = baseRoll; } + inline Ogre::Real baseRoll( ) const { return baseRoll_; } + + void setMesh( const std::string & meshName ); + std::string meshName( ) const { return meshName_; } + virtual std::string createMeshName( const std::string & meshName ); + Ogre::MeshPtr & meshPtr( ){ return pMesh_; } + +protected: + //** geometric parameters + Ogre::Vector3 baseSize_; + Ogre::Real baseYaw_; + Ogre::Real basePitch_; + Ogre::Real baseRoll_; + + Ogre::MeshPtr pMesh_; + + std::string meshName_; +}; + +//! +/*!*/ +class Station : public MeshEntity{ +public: + Station( ) : MeshEntity(){ + rtti_ = STATION; + } + + virtual ~Station( ){} + + void readPropertiesFromXML( TiXmlHandle & hRoot ){ + MeshEntity::readPropertiesFromXML( hRoot ); + } + +protected: +}; + } // namespace OpenGate #endif //_OPENGATE_ENTITY_H Modified: trunk/src/EntityManager.cpp =================================================================== --- trunk/src/EntityManager.cpp 2008-05-18 19:30:59 UTC (rev 900) +++ trunk/src/EntityManager.cpp 2008-05-20 21:26:54 UTC (rev 901) @@ -73,7 +73,10 @@ category == "modx" || category == "modxs" ) return MODX; else if ( category == "Vessel" || category == "Vessels" || category == "vessel" || category == "vessels" ) return VESSEL; + else if ( category == "Station" || category == "Stations" || + category == "station" || category == "stations" ) return VESSEL; + LogManager::getSingleton().warn("Requested entity rtti for " + category + " unknown" ); return ENTITY; } @@ -93,6 +96,7 @@ case MISSILE: return "MISSILE"; case MODX: return "MODx"; case VESSEL: return "Vessel"; + case STATION: return "Station"; } LogManager::getSingleton().warn("Requested name for category " + toStr( type ) + " unknown" ); @@ -129,6 +133,7 @@ Ecm * EntityManager::ecm( const std::string & name ){ return entity_< Ecm >( name ); } Vessel * EntityManager::vessel( const std::string & name ){ return entity_< Vessel >( name ); } Vessel * EntityManager::vessel( Uint16 ID ){ return entity_< Vessel >( ID ); } +Station * EntityManager::station( const std::string & name ){ return entity_< Station >( name ); } std::vector < Entity * > EntityManager::allByCategory( const std::string & category ){ EntityType rtti = NONE; @@ -212,15 +217,16 @@ int category = toInt( pElem->FirstChild()->Value() ); switch( category ){ - case 1: entity = new Commodity(); break; + case 1: entity = new Commodity(); break; case 2: entity = new PowerPlant(); break; - case 4: entity = new Capacitor(); break; - case 6: entity = new Engine(); break; - case 7: entity = new Shield(); break; - case 8: entity = new Radar(); break; - case 9: entity = new Vessel(); break; - case 10: entity = new Gun(); break; - case 11: entity = new Missile(); break; + case 3: entity = new Station(); break; + case 4: entity = new Capacitor(); break; + case 6: entity = new Engine(); break; + case 7: entity = new Shield(); break; + case 8: entity = new Radar(); break; + case 9: entity = new Vessel(); break; + case 10: entity = new Gun(); break; + case 11: entity = new Missile(); break; default: log_->fatal( fileName + " category_id " + toStr( category ) + " unknown." ); return NULL; @@ -254,467 +260,7 @@ categories_.insert( entity->categoryName() ); return entity; } - -// template<> EquipmentManager * Ogre::Singleton< EquipmentManager >::ms_Singleton = 0; -// -// EquipmentManager::EquipmentManager(): EntityManager(){ -// Entity * entity = new Missile(); -// entity->setName( "firefly" ); -// entity->setID( 10001 ); -// dynamic_cast< Missile * >( entity )->setDamage( 10400 ); -// dynamic_cast< Missile * >( entity )->setThrust( 150000 ); -// // dynamic_cast< Missile * >( entity )->setYaw( 90 ); -// // dynamic_cast< Missile * >( entity )->setPitch( 90 ); -// // dynamic_cast< Missile * >( entity )->setRoll( 90 ); -// //dynamic_cast< Missile * >( entity )->setArmor( 1 ); -// //dynamic_cast< Missile * >( entity )->setMass( 150 ); -// dynamic_cast< Missile * >( entity )->setLifeTime( 20 ); -// // dynamic_cast< Missile * >( entity )->setDragFactor( 1 ); -// dynamic_cast< Missile * >( entity )->setBaseSize(0.2, 0.2, 1.0 ); -// try{ -// dynamic_cast< Missile * >(entity)->setMesh( "firefly.mesh", false ); -// -// -// } catch( Ogre::Exception & e ){ -// LogManager::getSingleton().warn( e.what() ); -// } -// templatesByName_[ entity->name() ] = entity; -// templatesByID_[ entity->id() ] = entity; -// } -// -// EquipmentManager::~EquipmentManager() { -// } -// -// EquipmentManager & EquipmentManager::getSingleton( ){ -// assert( ms_Singleton ); -// return ( *ms_Singleton ); -// } -// -// EquipmentManager * EquipmentManager::getSingletonPtr( ){ -// if ( ms_Singleton == NULL ){ -// LogManager::getSingleton().fatal( "CommodityManager not initialized." ); -// } -// return ms_Singl... [truncated message content] |