yake-svn Mailing List for Yake Engine (Page 2)
Status: Beta
Brought to you by:
psyclonist
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(17) |
Sep
(51) |
Oct
(2) |
Nov
(18) |
Dec
(66) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(44) |
Feb
(13) |
Mar
(73) |
Apr
(61) |
May
|
Jun
(4) |
Jul
(19) |
Aug
(50) |
Sep
(47) |
Oct
(7) |
Nov
(7) |
Dec
(14) |
2008 |
Jan
(2) |
Feb
|
Mar
(4) |
Apr
(4) |
May
(5) |
Jun
(7) |
Jul
(4) |
Aug
|
Sep
(5) |
Oct
|
Nov
(1) |
Dec
(4) |
2009 |
Jan
|
Feb
(22) |
Mar
(12) |
Apr
(1) |
May
(1) |
Jun
(4) |
Jul
(4) |
Aug
|
Sep
|
Oct
(17) |
Nov
(3) |
Dec
|
2010 |
Jan
|
Feb
|
Mar
(12) |
Apr
(11) |
May
|
Jun
(5) |
Jul
(3) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <psy...@us...> - 2010-03-22 21:56:42
|
Revision: 2012 http://yake.svn.sourceforge.net/yake/?rev=2012&view=rev Author: psyclonist Date: 2010-03-22 21:56:36 +0000 (Mon, 22 Mar 2010) Log Message: ----------- moved code Added Paths: ----------- branches/yake2/yake/samples/property1/ branches/yake2/yake/samples/property1/demo.cpp Removed Paths: ------------- branches/yake2/yake/samples/property/demo1/ branches/yake2/yake/samples/property1/demo.cpp Deleted: branches/yake2/yake/samples/property1/demo.cpp =================================================================== --- branches/yake2/yake/samples/property/demo1/demo.cpp 2009-06-22 16:02:15 UTC (rev 1980) +++ branches/yake2/yake/samples/property1/demo.cpp 2010-03-22 21:56:36 UTC (rev 2012) @@ -1,105 +0,0 @@ -#include <yake/property/property.h> - -using namespace yake; - -//------------------------------------------- -// primitive test harness: -//------------------------------------------- -namespace yake { - YAKE_DEFINE_EXCEPTION(TestFailedException); -} // namespace yake - -#define ASSERT_BOOL(OP,VALUE) \ - { \ - std::cout << "-----------------------------------------------------------[\n"; \ - std::cout << "TEST: " << String(# OP) << " == " << #VALUE << "\n"; \ - if (VALUE == (OP)) \ - std::cout << "=> TEST OK\n"; \ - else \ - std::cout << "=> TEST FAILED!\n"; \ - std::cout << "]-----------------------------------------------------------\n"; \ - } - -#define ASSERT_EXCEPTION(OP,EXCEPTION) \ - { \ - try { \ - std::cout << "-----------------------------------------------------------[\n"; \ - std::cout << "TEST TRY: " << String(# OP) << "\n"; \ - OP; \ - } \ - catch (EXCEPTION&) \ - { \ - std::cout << "=> TEST OK (Caught expected exception " << # EXCEPTION << ")\n"; \ - } \ - catch (...) \ - { \ - std::cerr << "=> TEST FAILED (Caught unexpected exception instead of " << # EXCEPTION << ")\n"; \ - throw TestFailedException("TEST FAILED (Caught unexpected exception)"); \ - } \ - std::cout << "]-----------------------------------------------------------\n"; \ - } - -//------------------------------------------- -struct object : public boost::noncopyable -{ - object() - { - properties().add("name",property::makePointerProperty<String>(&name_)); - } - typedef property::PropertyContainer<String> property_container_t; - property_container_t& properties() - { return props_; } - const property_container_t& properties() const - { return props_; } -private: - property_container_t props_; - String name_; -}; - -//------------------------------------------- -#include <yake/base/yakeStderrLog.h> -//#include <yake/base/yakeFileLog.h> - -//------------------------------------------- -int main(int argc,char* argv[]) -{ - logging::log_listener_ptr to_stderr = logging::stderr_listener::add(); - //logging::log_listener_ptr to_file = logging::file_listener::add("prop.log"); - - using namespace yake::property; // We don't expect collisions in this demo. - - try { - //property_def<int,storage_accessor> i_s(12); - //property<int> p_i(new storage_accessor<int>()); - - { - object o; - // indirect access via property_base and boost::any: - o.properties().get("name").setAny(String("o1")); - boost::any_cast<String>(o.properties().get("name").getAny()); - } - - { - PropertyContainer<String> props; - props.add("a", makeValueProperty<int>(33)); - //props += std::make_pair(String("a"),property_ptr(newValueProperty<int>(33))); - ASSERT_BOOL( props.has("a"), true ); - ASSERT_EXCEPTION(props.add("a",0),InvalidInputException); - ASSERT_EXCEPTION(props.add("a",makeValueProperty<int>(33)),AlreadyExistsException); - ASSERT_EXCEPTION(props.get("noname"),NotFoundException); - std::cout << "'a' : " << props.get("a") << "\n"; - try_set<int>(props.get("a"),44); - try_cast<int>(props.get("a")).set(55); - ASSERT_EXCEPTION( try_set<String>(props.get("a"),"66"), BadCastException ); - std::cout << props << "\n"; - } - } - catch (std::exception& ex) - { - std::cerr << "----------------------------------------------------\n"; - std::cerr << "EXCEPTION: " << ex.what() << "\n"; - std::cerr << "----------------------------------------------------\n"; - } - - return 0; -} Copied: branches/yake2/yake/samples/property1/demo.cpp (from rev 2011, branches/yake2/yake/samples/property/demo1/demo.cpp) =================================================================== --- branches/yake2/yake/samples/property1/demo.cpp (rev 0) +++ branches/yake2/yake/samples/property1/demo.cpp 2010-03-22 21:56:36 UTC (rev 2012) @@ -0,0 +1,103 @@ +#include <yake/property/property.h> + +using namespace yake; + +//------------------------------------------- +// primitive test harness: +//------------------------------------------- +namespace yake { + YAKE_DEFINE_EXCEPTION(TestFailedException); +} // namespace yake + +#define ASSERT_BOOL(OP,VALUE) \ + { \ + std::cout << "-----------------------------------------------------------[\n"; \ + std::cout << "TEST: " << String(# OP) << " == " << #VALUE << "\n"; \ + if (VALUE == (OP)) \ + std::cout << "=> TEST OK\n"; \ + else \ + std::cout << "=> TEST FAILED!\n"; \ + std::cout << "]-----------------------------------------------------------\n"; \ + } + +#define ASSERT_EXCEPTION(OP,EXCEPTION) \ + { \ + try { \ + std::cout << "-----------------------------------------------------------[\n"; \ + std::cout << "TEST TRY: " << String(# OP) << "\n"; \ + OP; \ + } \ + catch (EXCEPTION&) \ + { \ + std::cout << "=> TEST OK (Caught expected exception " << # EXCEPTION << ")\n"; \ + } \ + catch (...) \ + { \ + std::cerr << "=> TEST FAILED (Caught unexpected exception instead of " << # EXCEPTION << ")\n"; \ + throw TestFailedException("TEST FAILED (Caught unexpected exception)"); \ + } \ + std::cout << "]-----------------------------------------------------------\n"; \ + } + +//------------------------------------------- +struct object : public boost::noncopyable +{ + object() + { + properties().add("name",property::makePointerProperty<String>(&name_)); + } + typedef property::PropertyContainer<String> property_container_t; + property_container_t& properties() + { return props_; } + const property_container_t& properties() const + { return props_; } +private: + property_container_t props_; + String name_; +}; + +//------------------------------------------- +#include <yake/log/log.h> + +//------------------------------------------- +int main(int argc,char* argv[]) +{ + logging::logToStdErr(); + + using namespace yake::property; // We don't expect collisions in this demo. + + try { + //property_def<int,storage_accessor> i_s(12); + //property<int> p_i(new storage_accessor<int>()); + + { + object o; + // indirect access via property_base and boost::any: + o.properties().get("name").setAny(String("o1")); + boost::any_cast<String>(o.properties().get("name").getAny()); + } + + { + PropertyContainer<String> props; + props.add("a", makeValueProperty<int>(33)); + //props += std::make_pair(String("a"),property_ptr(newValueProperty<int>(33))); + ASSERT_BOOL( props.has("a"), true ); + ASSERT_EXCEPTION(props.add("a",0),InvalidInputException); + ASSERT_EXCEPTION(props.add("a",makeValueProperty<int>(33)),AlreadyExistsException); + ASSERT_EXCEPTION(props.get("noname"),NotFoundException); + std::cout << "'a' : " << props.get("a") << "\n"; + try_set<int>(props.get("a"),44); + try_cast<int>(props.get("a")).set(55); + ASSERT_EXCEPTION( try_set<String>(props.get("a"),"66"), BadCastException ); + std::cout << props << "\n"; + } + } + catch (std::exception& ex) + { + std::cerr << "----------------------------------------------------\n"; + std::cerr << "EXCEPTION: " << ex.what() << "\n"; + std::cerr << "----------------------------------------------------\n"; + } + + return 0; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2010-03-22 21:54:35
|
Revision: 2011 http://yake.svn.sourceforge.net/yake/?rev=2011&view=rev Author: psyclonist Date: 2010-03-22 21:54:29 +0000 (Mon, 22 Mar 2010) Log Message: ----------- added includes used if including directly. Modified Paths: -------------- branches/yake2/yake/yake/ent/component_holder.h branches/yake2/yake/yake/ent/trigger.h branches/yake2/yake/yake/model/model_component.h Modified: branches/yake2/yake/yake/ent/component_holder.h =================================================================== --- branches/yake2/yake/yake/ent/component_holder.h 2010-03-22 21:53:08 UTC (rev 2010) +++ branches/yake2/yake/yake/ent/component_holder.h 2010-03-22 21:54:29 UTC (rev 2011) @@ -28,6 +28,7 @@ #define YAKE_ENT_COMPONENT_HOLDER_H #include "yake/ent/prerequisites.h" +#include "yake/ent/component.h" namespace yake { namespace ent { Modified: branches/yake2/yake/yake/ent/trigger.h =================================================================== --- branches/yake2/yake/yake/ent/trigger.h 2010-03-22 21:53:08 UTC (rev 2010) +++ branches/yake2/yake/yake/ent/trigger.h 2010-03-22 21:54:29 UTC (rev 2011) @@ -29,6 +29,7 @@ #include "yake/ent/prerequisites.h" #include "yake/ent/entity.h" +#include "yake/base/math/yakeVolume.h" namespace yake { namespace ent { Modified: branches/yake2/yake/yake/model/model_component.h =================================================================== --- branches/yake2/yake/yake/model/model_component.h 2010-03-22 21:53:08 UTC (rev 2010) +++ branches/yake2/yake/yake/model/model_component.h 2010-03-22 21:54:29 UTC (rev 2011) @@ -28,6 +28,7 @@ #define YAKE_MODEL_COMPONENT_H #include "yake/model/prerequisites.h" +#include <yake/base/yakeStringMap.h> namespace yake { namespace data { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2010-03-22 21:53:14
|
Revision: 2010 http://yake.svn.sourceforge.net/yake/?rev=2010&view=rev Author: psyclonist Date: 2010-03-22 21:53:08 +0000 (Mon, 22 Mar 2010) Log Message: ----------- added missing #endif Modified Paths: -------------- branches/yake2/yake/yake/base/yakeStringMap.h Modified: branches/yake2/yake/yake/base/yakeStringMap.h =================================================================== --- branches/yake2/yake/yake/base/yakeStringMap.h 2010-03-22 21:52:43 UTC (rev 2009) +++ branches/yake2/yake/yake/base/yakeStringMap.h 2010-03-22 21:53:08 UTC (rev 2010) @@ -57,3 +57,5 @@ return out; } } // yake + +#endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2010-03-22 21:52:51
|
Revision: 2009 http://yake.svn.sourceforge.net/yake/?rev=2009&view=rev Author: psyclonist Date: 2010-03-22 21:52:43 +0000 (Mon, 22 Mar 2010) Log Message: ----------- base: re-added AssocVector Added Paths: ----------- branches/yake2/yake/yake/base/templates/yakeFastMap.h Copied: branches/yake2/yake/yake/base/templates/yakeFastMap.h (from rev 1981, branches/yake2/yake/yake/base/templates/yakeFastMap.h) =================================================================== --- branches/yake2/yake/yake/base/templates/yakeFastMap.h (rev 0) +++ branches/yake2/yake/yake/base/templates/yakeFastMap.h 2010-03-22 21:52:43 UTC (rev 2009) @@ -0,0 +1,352 @@ +/* + ------------------------------------------------------------------------------------ + This file is part of YAKE + Copyright (c) 2004 - 2008 The YAKE Team + For the latest information visit http://www.yake.org + ------------------------------------------------------------------------------------ + This program is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the Free Software + Foundation; either version 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 Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser 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, or go to + http://www.gnu.org/copyleft/lesser.txt. + ------------------------------------------------------------------------------------ + If you are interested in another license model contact the Yake Team via + E-Mail: te...@ya.... + For more information see the LICENSE file in the root directory of the + source code distribution. + ------------------------------------------------------------------------------------ +*/ +#ifndef YAKE_BASE_TEMPLATESFASTMAP_H +#define YAKE_BASE_TEMPLATESFASTMAP_H + +//============================================================================ +// IMPLEMENTATION HEADERS +//============================================================================ +// Standard headers +#ifndef YAKE_BASEPREREQUISITES_H +# include "../yakePrerequisites.h" +#endif + +//============================================================================ +// INTERFACE STRUCTURES / UTILITY CLASSES +//============================================================================ +namespace yake { + +//////////////////////////////////////////////////////////////////////////////// +// class template AssocVectorCompare +// Used by AssocVector +//////////////////////////////////////////////////////////////////////////////// + + namespace Private + { + template <class Value, class C> + class AssocVectorCompare : public C + { + typedef std::pair<typename C::first_argument_type, Value> + Data; + typedef typename C::first_argument_type first_argument_type; + + public: + AssocVectorCompare() + {} + + AssocVectorCompare(const C& src) : C(src) + {} + + bool operator()(const first_argument_type& lhs, + const first_argument_type& rhs) const + { return C::operator()(lhs, rhs); } + + bool operator()(const Data& lhs, const Data& rhs) const + { return operator()(lhs.first, rhs.first); } + + bool operator()(const Data& lhs, + const first_argument_type& rhs) const + { return operator()(lhs.first, rhs); } + + bool operator()(const first_argument_type& lhs, + const Data& rhs) const + { return operator()(lhs, rhs.first); } + }; + } + +//////////////////////////////////////////////////////////////////////////////// +// class template AssocVector +// An associative vector built as a syntactic drop-in replacement for std::map +// BEWARE: AssocVector doesn't respect all map's guarantees, the most important +// being: +// * iterators are invalidated by insert and erase operations +// * the complexity of insert/erase is O(N) not O(log N) +// * value_type is std::pair<K, V> not std::pair<const K, V> +// * iterators are random +//////////////////////////////////////////////////////////////////////////////// + + template + < + class K, + class V, + class C = std::less<K>, + class A = std::allocator< std::pair<K, V> > + > + class AssocVector + : private std::vector< std::pair<K, V>, A > + , private Private::AssocVectorCompare<V, C> + { + typedef std::vector<std::pair<K, V>, A> Base; + typedef Private::AssocVectorCompare<V, C> MyCompare; + + public: + typedef K key_type; + typedef V mapped_type; + typedef typename Base::value_type value_type; + + typedef C key_compare; + typedef A allocator_type; + typedef typename A::reference reference; + typedef typename A::const_reference const_reference; + typedef typename Base::iterator iterator; + typedef typename Base::const_iterator const_iterator; + typedef typename Base::size_type size_type; + typedef typename Base::difference_type difference_type; + typedef typename A::pointer pointer; + typedef typename A::const_pointer const_pointer; + typedef typename Base::reverse_iterator reverse_iterator; + typedef typename Base::const_reverse_iterator const_reverse_iterator; + + class value_compare + : public std::binary_function<value_type, value_type, bool> + , private key_compare + { + friend class AssocVector; + + protected: + value_compare(key_compare pred) : key_compare(pred) + {} + + public: + bool operator()(const value_type& lhs, const value_type& rhs) const + { return key_compare::operator()(lhs.first, rhs.first); } + }; + + // 23.3.1.1 construct/copy/destroy + + explicit AssocVector(const key_compare& comp = key_compare(), + const A& alloc = A()) + : Base(alloc), MyCompare(comp) + {} + + template <class InputIterator> + AssocVector(InputIterator first, InputIterator last, + const key_compare& comp = key_compare(), + const A& alloc = A()) + : Base(first, last, alloc), MyCompare(comp) + { + MyCompare& me = *this; + std::sort(begin(), end(), me); + } + + AssocVector& operator=(const AssocVector& rhs) + { + AssocVector(rhs).swap(*this); + return *this; + } + + // iterators: + // The following are here because MWCW gets 'using' wrong + iterator begin() { return Base::begin(); } + const_iterator begin() const { return Base::begin(); } + iterator end() { return Base::end(); } + const_iterator end() const { return Base::end(); } + reverse_iterator rbegin() { return Base::rbegin(); } + const_reverse_iterator rbegin() const { return Base::rbegin(); } + reverse_iterator rend() { return Base::rend(); } + const_reverse_iterator rend() const { return Base::rend(); } + + // capacity: + bool empty() const { return Base::empty(); } + size_type size() const { return Base::size(); } + size_type max_size() { return Base::max_size(); } + + // 23.3.1.2 element access: + mapped_type& operator[](const key_type& key) + { return insert(value_type(key, mapped_type())).first->second; } + + // modifiers: + std::pair<iterator, bool> insert(const value_type& val) + { + bool found(true); + iterator i(lower_bound(val.first)); + + if (i == end() || this->operator()(val.first, i->first)) + { + i = Base::insert(i, val); + found = false; + } + return std::make_pair(i, !found); + } + + iterator insert(iterator pos, const value_type& val) + { + if (pos != end() && this->operator()(*pos, val) && + (pos == end() - 1 || + !this->operator()(val, pos[1]) && + this->operator()(pos[1], val))) + { + return Base::insert(pos, val); + } + return insert(val).first; + } + + template <class InputIterator> + void insert(InputIterator first, InputIterator last) + { for (; first != last; ++first) insert(*first); } + + void erase(iterator pos) + { Base::erase(pos); } + + size_type erase(const key_type& k) + { + iterator i(find(k)); + if (i == end()) return 0; + erase(i); + return 1; + } + + void erase(iterator first, iterator last) + { Base::erase(first, last); } + + void swap(AssocVector& other) + { + using std::swap; + Base::swap(other); + MyCompare& me = *this; + MyCompare& rhs = other; + swap(me, rhs); + } + + void clear() + { Base::clear(); } + + // observers: + key_compare key_comp() const + { return *this; } + + value_compare value_comp() const + { + const key_compare& comp = *this; + return value_compare(comp); + } + + // 23.3.1.3 map operations: + iterator find(const key_type& k) + { + iterator i(lower_bound(k)); + if (i != end() && this->operator()(k, i->first)) + { + i = end(); + } + return i; + } + + const_iterator find(const key_type& k) const + { + const_iterator i(lower_bound(k)); + if (i != end() && this->operator()(k, i->first)) + { + i = end(); + } + return i; + } + + size_type count(const key_type& k) const + { return find(k) != end(); } + + iterator lower_bound(const key_type& k) + { + MyCompare& me = *this; + return std::lower_bound(begin(), end(), k, me); + } + + const_iterator lower_bound(const key_type& k) const + { + const MyCompare& me = *this; + return std::lower_bound(begin(), end(), k, me); + } + + iterator upper_bound(const key_type& k) + { + MyCompare& me = *this; + return std::upper_bound(begin(), end(), k, me); + } + + const_iterator upper_bound(const key_type& k) const + { + const MyCompare& me = *this; + return std::upper_bound(begin(), end(), k, me); + } + + std::pair<iterator, iterator> equal_range(const key_type& k) + { + MyCompare& me = *this; + return std::equal_range(begin(), end(), k, me); + } + + std::pair<const_iterator, const_iterator> equal_range( + const key_type& k) const + { + const MyCompare& me = *this; + return std::equal_range(begin(), end(), k, me); + } + + friend bool operator==(const AssocVector& lhs, const AssocVector& rhs) + { + const Base& me = lhs; + return me == rhs; + } + + bool operator<(const AssocVector& rhs) const + { + const Base& me = *this; + const Base& yo = rhs; + return me < yo; + } + + friend bool operator!=(const AssocVector& lhs, const AssocVector& rhs) + { return !(lhs == rhs); } + + friend bool operator>(const AssocVector& lhs, const AssocVector& rhs) + { return rhs < lhs; } + + friend bool operator>=(const AssocVector& lhs, const AssocVector& rhs) + { return !(lhs < rhs); } + + friend bool operator<=(const AssocVector& lhs, const AssocVector& rhs) + { return !(rhs < lhs); } + + const_reference at(size_type _Pos) const + { // subscript nonmutable sequence with checking + return Base::at(_Pos); + } + reference at(size_type _Pos) + { + return Base::at(_Pos); + } + + }; + + // specialized algorithms: + template <class K, class V, class C, class A> + void swap(AssocVector<K, V, C, A>& lhs, AssocVector<K, V, C, A>& rhs) + { lhs.swap(rhs); } + +} // yake + +#endif // YAKE_BASE_TEMPLATESFASTMAP_H This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2010-03-22 21:51:42
|
Revision: 2008 http://yake.svn.sourceforge.net/yake/?rev=2008&view=rev Author: psyclonist Date: 2010-03-22 21:51:34 +0000 (Mon, 22 Mar 2010) Log Message: ----------- graphicsOgre: fixed bug in code path with pre-created window: call initialiseAllResourceGroups() after setupResourcesFromConfigFile(). Modified Paths: -------------- branches/yake2/yake/src/plugins/graphicsOgre/graphicsOgreCore.cpp Modified: branches/yake2/yake/src/plugins/graphicsOgre/graphicsOgreCore.cpp =================================================================== --- branches/yake2/yake/src/plugins/graphicsOgre/graphicsOgreCore.cpp 2010-03-22 21:50:27 UTC (rev 2007) +++ branches/yake2/yake/src/plugins/graphicsOgre/graphicsOgreCore.cpp 2010-03-22 21:51:34 UTC (rev 2008) @@ -165,10 +165,16 @@ YAKE_ASSERT( pRenderWindow ); mRWin = pRenderWindow; + + // setup resource paths + if (bParseDefaultResourceFile) + setupResourcesFromConfigFile(); + + // parse scripts etc. from resource paths ResourceGroupManager::getSingleton().initialiseAllResourceGroups(); + + // select/create scene manager _chooseSceneManager(); - if (bParseDefaultResourceFile) - setupResourcesFromConfigFile(); } mSysFL = new SystemFrameListener( mRWin ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2010-03-22 21:50:34
|
Revision: 2007 http://yake.svn.sourceforge.net/yake/?rev=2007&view=rev Author: psyclonist Date: 2010-03-22 21:50:27 +0000 (Mon, 22 Mar 2010) Log Message: ----------- qt: * added helper function for centering on primary screen * added basic (and experimental!) property editor Added Paths: ----------- branches/yake2/yake/src/qt/property_browser.cpp branches/yake2/yake/src/qt/utils.cpp branches/yake2/yake/yake/qt/property_browser.h branches/yake2/yake/yake/qt/utils.h Added: branches/yake2/yake/src/qt/property_browser.cpp =================================================================== --- branches/yake2/yake/src/qt/property_browser.cpp (rev 0) +++ branches/yake2/yake/src/qt/property_browser.cpp 2010-03-22 21:50:27 UTC (rev 2007) @@ -0,0 +1,191 @@ +#include "yake/qt/property_browser.h" +#include "yake/qt/property_browser.moc" +#include "yake/qt/style.h" + +#include <boost/bind.hpp> +#include <boost/optional.hpp> + +#include <QAbstractItemView> +#include <QMessageBox> +#include <QVBoxLayout> + +namespace yake { +namespace qt { + //----------------------------------------------------- + template<typename Vt> + struct Property; + + template<> + struct Property<string> + { + typedef string value_type; + static const EditorType default_editor = StringEditor; + static boost::optional<QString> toDisplayString(const Value& v) + { + try { + return QString::fromUtf8(boost::any_cast<string>(v).c_str()); + } + catch (boost::bad_any_cast&) + { + return boost::optional<QString>(); + } + } + static boost::optional<Value> fromString(const QString& text) + { + return string( text.toUtf8().constData() ); + } + }; + template<> + struct Property<real> + { + typedef real value_type; + static const EditorType default_editor = StringEditor; + static boost::optional<QString> toDisplayString(const Value& v) + { + try { + return QString::number(boost::any_cast<real>(v),'g',3); + } + catch (boost::bad_any_cast&) + { + return boost::optional<QString>(); + } + } + static boost::optional<Value> fromString(const QString& text) + { + bool ok = false; + const value_type value = text.toDouble(&ok); + if (ok) + return value; + else + return boost::optional<Value>(); + } + }; + template<> + struct Property<bool> + { + typedef real value_type; + static const EditorType default_editor = CheckStateEditor; + static boost::optional<bool> toDisplayString(const Value& v) + { + try { + return boost::any_cast<bool>(v); + } + catch (boost::bad_any_cast&) + { + return boost::optional<QString>(); + } + } + static boost::optional<Value> fromString(const QString& text) + { + return boost::optional<bool>(text == "1" || text == "Yes"); + } + }; + //----------------------------------------------------- + PropertyBrowser::PropertyBrowser(QWidget* parent) : + QWidget(parent), + m_tree(0), + m_parent(0) + { + QVBoxLayout* thisL = new QVBoxLayout(this); + m_tree = new QTreeWidget(this); + m_tree->setAlternatingRowColors(true); + // + applyStyleFileTo(*this, "property_browser.style"); + // + + QStringList headerLabels; + headerLabels << "Property" << "Value"; + m_tree->setHeaderLabels(headerLabels); + m_tree->setItemDelegateForColumn(0, new DoNothingDelegate(m_tree)); + m_tree->setItemDelegateForColumn(1, new ValueDelegate(m_tree)); + + m_tree->setSelectionMode(QAbstractItemView::SingleSelection); + //m_tree->setEditTriggers(QAbstractItemView::CurrentChanged); + m_tree->setEditTriggers(QAbstractItemView::DoubleClicked|QAbstractItemView::SelectedClicked); +#if 0 + // + this->addLineEdit("Name", string("box 001")); + this->addLineEdit("Priority", real(12.3)); + + NameValueList nv; + nv.push_back(std::make_pair("yes",true)); + nv.push_back(std::make_pair("no",false)); + this->addEnumBox("Enabled",false,nv); + + this->addPoint3("Position"); +#endif + // + thisL->addWidget(m_tree); + connect(m_tree,SIGNAL(itemChanged(QTreeWidgetItem*,int)),this,SLOT(onItemChanged(QTreeWidgetItem*,int))); + connect(m_tree,SIGNAL(itemActivated(QTreeWidgetItem*,int)),this,SLOT(onItemActivated(QTreeWidgetItem*,int))); + } + QTreeWidgetItem* PropertyBrowser::addText(const QString& name, const QString& text) + { + QTreeWidgetItem* item = m_parent ? new QTreeWidgetItem(m_parent) : new QTreeWidgetItem(m_tree); + if (!m_parent) + m_tree->addTopLevelItem(item); + item->setData(0,Qt::DisplayRole,name); + item->setData(1,Qt::DisplayRole,text); + return item; + } + void PropertyBrowser::addReadOnlyText(const QString& name, const QString& text) + { + this->addText(name,text); + } + void PropertyBrowser::subscribeToValueChanged(QTreeWidgetItem* item, const ValueChangedFn& fn) + { + m_valueChanged[item] = fn; + } + Value PropertyBrowser::getCurrentValue(QTreeWidgetItem* item) const + { + return detail::GetValue::getRaw(item,1); + } + void PropertyBrowser::onItemChanged(QTreeWidgetItem *item, int column) + { + //QMessageBox::information(this,tr("onItemChanged"),tr("column %1").arg(column)); + ValueChangedFn fn = m_valueChanged[item]; + if (fn) + fn(detail::GetValue::getRaw(item,1)); + } + void PropertyBrowser::onItemActivated(QTreeWidgetItem *item, int column) + { + } + void PropertyBrowser::setPoint3Ordinate(const real o) + { + QMessageBox::information(this,tr("Point3 modified"),tr("%1").arg(o)); + } + void PropertyBrowser::setPoint3Ordinate2(const size_t idx, const Value& o) + { + QMessageBox::information(this,tr("Point3 modified"),tr("[%1]=%2").arg(idx).arg(boost::any_cast<real>(o))); + } + boost::optional<QString> _real_toString(const Value& v) + { + return QString("%1").arg(boost::any_cast<real>(v)); + } + boost::optional<Value> _real_toValue(const QString& s) + { + bool ok = false; + real r = s.toDouble(&ok); + return ok ? Value(r) : boost::optional<Value>(); + } + /* + void PropertyBrowser::addPoint3(const QString& name) + { + m_parent = this->addText(name,"(x,y,z)"); + ValueToStringFn v2s = boost::bind(&_real_toString,_1); + this->subscribeToValueChanged( + this->addLineEdit(" x",real(1.0), + boost::bind(&_real_toValue,_1), + v2s), + boost::bind(&PropertyBrowser::setPoint3Ordinate2,this,0,_1) ); + this->subscribeToValueChanged( + this->addLineEdit(" y",real(2.0),&_real_toValue,&_real_toString), + boost::bind(&PropertyBrowser::setPoint3Ordinate2,this,1,_1) ); + this->subscribeToValueChanged( + this->addLineEdit(" z",real(3.0),&_real_toValue,&_real_toString), + boost::bind(&PropertyBrowser::setPoint3Ordinate2,this,2,_1) ); + m_parent = 0; + } + */ +} // qt +} // yake \ No newline at end of file Added: branches/yake2/yake/src/qt/utils.cpp =================================================================== --- branches/yake2/yake/src/qt/utils.cpp (rev 0) +++ branches/yake2/yake/src/qt/utils.cpp 2010-03-22 21:50:27 UTC (rev 2007) @@ -0,0 +1,15 @@ +#include "yake/qt/utils.h" +#include <QApplication> +#include <QDesktopWidget> + +namespace yake { +namespace qt { + void centerOnPrimaryScreen(QWidget* w) + { + if (!w) + return; + const QRect desktopRect(QApplication::desktop()->availableGeometry(QApplication::desktop()->primaryScreen())); + w->move(desktopRect.center() - w->rect().center()); + } +} // qt +} // yake Added: branches/yake2/yake/yake/qt/property_browser.h =================================================================== --- branches/yake2/yake/yake/qt/property_browser.h (rev 0) +++ branches/yake2/yake/yake/qt/property_browser.h 2010-03-22 21:50:27 UTC (rev 2007) @@ -0,0 +1,112 @@ +#ifndef YAKE_QT_PROPERTY_BROWSER_H +#define YAKE_QT_PROPERTY_BROWSER_H + +#include "prerequisites.h" +#include "editor_types.h" +#include "delegates.h" +#include "combo.h" + +#include <QTreeWidget> +#include <QTreeWidgetItem> + +namespace yake { +namespace qt { + class YAKE_QT_API PropertyBrowser : public QWidget + { + Q_OBJECT + public: + PropertyBrowser(QWidget* parent); + + void addReadOnlyText(const QString& name, const QString& text); + private: + QTreeWidgetItem* addText(const QString& name, const QString& text); + private: + std::map<QTreeWidgetItem*,ValueChangedFn> m_valueChanged; + public: + void subscribeToValueChanged(QTreeWidgetItem* item, const ValueChangedFn& fn); + private Q_SLOTS: + void onItemChanged(QTreeWidgetItem *item, int column); + void onItemActivated(QTreeWidgetItem *item, int column); + public: + Value getCurrentValue(QTreeWidgetItem* item) const; + + template<typename Vt> + QTreeWidgetItem* addLineEdit(const QString& name, const Vt& v, StringToValueFn s2v, ValueToStringFn v2s) + { + QTreeWidgetItem* item = m_parent ? new QTreeWidgetItem(m_parent) : new QTreeWidgetItem(m_tree); + if (!m_parent) + m_tree->addTopLevelItem(item); + item->setData(0,Qt::DisplayRole,name); + const boost::optional<QString> displayString = v2s(v); + if (displayString) + item->setData(1,Qt::DisplayRole,*displayString); + + item->setData(1,CustomEditRole,QVariant::fromValue(Value(v))); + item->setData(1,ValueToStringRole,QVariant::fromValue(Value(v2s))); + item->setData(1,StringToValueRole,QVariant::fromValue(Value(s2v))); + item->setFlags(item->flags()|Qt::ItemIsEditable); + + item->setData(1,PropertyTypeRole, StringEditor/*editor*/); + + //return boost::bind(&detail::GetValue::get<Vt>,item,1); + return item; + } + QTreeWidgetItem* addCheckBox(const QString& name, const bool value) + { + QTreeWidgetItem* item = m_parent ? new QTreeWidgetItem(m_parent) : new QTreeWidgetItem(m_tree); + if (!m_parent) + m_tree->addTopLevelItem(item); + item->setText(0,name); + item->setFlags(item->flags()|Qt::ItemIsEditable); + // + item->setData(1,PropertyTypeRole,CheckStateEditor); + item->setCheckState(1,value ? Qt::Checked : Qt::Unchecked); + + return item; + } + template<typename Vt> + QTreeWidgetItem* addEnumBox(const QString& name, const Vt& v, const NameValueList& values) + { + QTreeWidgetItem* item = m_parent ? new QTreeWidgetItem(m_parent) : new QTreeWidgetItem(m_tree); + if (!m_parent) + m_tree->addTopLevelItem(item); + //m_tree->model()->setData(m_tree->indexFromItem(item,0),name,Qt::DisplayRole); + item->setText(0,name); + // + + for (size_t i=0; i<values.size(); ++i) + { + if (isValueEqualTo<Vt>(values.at(i).second, v)) + { + //m_tree->model()->setData(m_tree->indexFromItem(item,1),values.at(i).first,Qt::DisplayRole); + //item->setData(1,Qt::DisplayRole,values.at(i).first); + item->setText(1,values.at(i).first); + break; + } + } + item->setData(1,CustomEditRole,QVariant::fromValue(Value(v))); + //Not required for ComboBoxes: item->setData(1,ValueToStringRole,QVariant::fromValue(Value(ValueToStringFn(boost::bind(&Property<Vt>::toDisplayString,_1))))); + item->setFlags(item->flags()|Qt::ItemIsEditable); + + item->setData(1,PropertyTypeRole,EnumEditor); + + item->setData(1,EnumValues,QVariant::fromValue(Value(values))); + item->setData(1,ValueEqualRole,QVariant::fromValue(Value(IsValueEqualFn(boost::bind(&isValueEqualTo<Vt>,_1,_2))))); + + // + //this->subscribeToValueChanged(item, boost::bind(& + return item; + } + + private: + void setPoint3Ordinate(const real o); + void setPoint3Ordinate2(const size_t idx, const Value& o); + //void addPoint3(const QString& name); + private: + QTreeWidget* m_tree; + QTreeWidgetItem* m_parent; + }; +} // qt +} // yake + +#endif Added: branches/yake2/yake/yake/qt/utils.h =================================================================== --- branches/yake2/yake/yake/qt/utils.h (rev 0) +++ branches/yake2/yake/yake/qt/utils.h 2010-03-22 21:50:27 UTC (rev 2007) @@ -0,0 +1,12 @@ +#ifndef YAKE_QT_UTILS_H +#define YAKE_QT_UTILS_H + +#include "prerequisites.h" + +namespace yake { +namespace qt { + YAKE_QT_API void centerOnPrimaryScreen(QWidget*); +} // qt +} // yake + +#endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2009-11-21 22:59:41
|
Revision: 2006 http://yake.svn.sourceforge.net/yake/?rev=2006&view=rev Author: psyclonist Date: 2009-11-21 22:59:35 +0000 (Sat, 21 Nov 2009) Log Message: ----------- fixed includes, cleanup Modified Paths: -------------- branches/yake2/yake/yake/graphics/yakeGraphicalWorld.h branches/yake2/yake/yake/graphics/yakeGraphics.h branches/yake2/yake/yake/graphics/yakeGraphicsSystem.h Modified: branches/yake2/yake/yake/graphics/yakeGraphicalWorld.h =================================================================== --- branches/yake2/yake/yake/graphics/yakeGraphicalWorld.h 2009-11-21 22:56:15 UTC (rev 2005) +++ branches/yake2/yake/yake/graphics/yakeGraphicalWorld.h 2009-11-21 22:59:35 UTC (rev 2006) @@ -31,7 +31,6 @@ // IMPLEMENTATION HEADERS //============================================================================ #include <yake/graphics/yakeGraphics.h> -#include <yake/base/yakeMovable.h> #include <yake/graphics/yakeGraphicsSystem.h> #include <yake/graphics/yakeEntity.h> #include <yake/base/templates/yakeSignals.h> Modified: branches/yake2/yake/yake/graphics/yakeGraphics.h =================================================================== --- branches/yake2/yake/yake/graphics/yakeGraphics.h 2009-11-21 22:56:15 UTC (rev 2005) +++ branches/yake2/yake/yake/graphics/yakeGraphics.h 2009-11-21 22:59:35 UTC (rev 2006) @@ -37,6 +37,8 @@ #include <yake/base/yakePrerequisites.h> #endif #include <yake/base/yakeString.h> +#include <yake/base/yakeMovable.h> +#include <yake/factory/global_dynamic_factory.h> #include <yake/graphics/yakeGraphicsSystem.h> #include <yake/graphics/yakeGraphicalWorld.h> //#include <yake/graphics/yakeGraphicsEnvironment.h> Modified: branches/yake2/yake/yake/graphics/yakeGraphicsSystem.h =================================================================== --- branches/yake2/yake/yake/graphics/yakeGraphicsSystem.h 2009-11-21 22:56:15 UTC (rev 2005) +++ branches/yake2/yake/yake/graphics/yakeGraphicsSystem.h 2009-11-21 22:59:35 UTC (rev 2006) @@ -32,6 +32,8 @@ //============================================================================ #include <yake/graphics/yakeGraphics.h> #include <yake/graphics/yakeGraphicalWorld.h> +#include <yake/base/yakeException.h> +#include <yake/base/templates/yakeRegistry.h> #pragma warning(disable: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow) @@ -41,9 +43,6 @@ namespace yake { namespace graphics { - using namespace ::yake::mpl; - using namespace ::yake::templates; - class IWorld; //struct SceneSerializer This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2009-11-21 22:56:21
|
Revision: 2005 http://yake.svn.sourceforge.net/yake/?rev=2005&view=rev Author: psyclonist Date: 2009-11-21 22:56:15 +0000 (Sat, 21 Nov 2009) Log Message: ----------- added include Modified Paths: -------------- branches/yake2/yake/yake/graphics/yakeGraphicalWorld.h Modified: branches/yake2/yake/yake/graphics/yakeGraphicalWorld.h =================================================================== --- branches/yake2/yake/yake/graphics/yakeGraphicalWorld.h 2009-11-21 22:51:58 UTC (rev 2004) +++ branches/yake2/yake/yake/graphics/yakeGraphicalWorld.h 2009-11-21 22:56:15 UTC (rev 2005) @@ -31,6 +31,7 @@ // IMPLEMENTATION HEADERS //============================================================================ #include <yake/graphics/yakeGraphics.h> +#include <yake/base/yakeMovable.h> #include <yake/graphics/yakeGraphicsSystem.h> #include <yake/graphics/yakeEntity.h> #include <yake/base/templates/yakeSignals.h> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2009-11-21 22:52:13
|
Revision: 2004 http://yake.svn.sourceforge.net/yake/?rev=2004&view=rev Author: psyclonist Date: 2009-11-21 22:51:58 +0000 (Sat, 21 Nov 2009) Log Message: ----------- added include Modified Paths: -------------- branches/yake2/yake/yake/graphics/yakeGraphics.h Modified: branches/yake2/yake/yake/graphics/yakeGraphics.h =================================================================== --- branches/yake2/yake/yake/graphics/yakeGraphics.h 2009-10-18 01:55:06 UTC (rev 2003) +++ branches/yake2/yake/yake/graphics/yakeGraphics.h 2009-11-21 22:51:58 UTC (rev 2004) @@ -36,6 +36,7 @@ #ifndef YAKE_BASE_PREREQUISITES_H #include <yake/base/yakePrerequisites.h> #endif +#include <yake/base/yakeString.h> #include <yake/graphics/yakeGraphicsSystem.h> #include <yake/graphics/yakeGraphicalWorld.h> //#include <yake/graphics/yakeGraphicsEnvironment.h> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2009-10-18 01:55:14
|
Revision: 2003 http://yake.svn.sourceforge.net/yake/?rev=2003&view=rev Author: psyclonist Date: 2009-10-18 01:55:06 +0000 (Sun, 18 Oct 2009) Log Message: ----------- qt: added comments Modified Paths: -------------- branches/yake2/yake/yake/qt/combo.h branches/yake2/yake/yake/qt/delegates.h branches/yake2/yake/yake/qt/editor_types.h branches/yake2/yake/yake/qt/titlebar.h Modified: branches/yake2/yake/yake/qt/combo.h =================================================================== --- branches/yake2/yake/yake/qt/combo.h 2009-10-18 00:24:41 UTC (rev 2002) +++ branches/yake2/yake/yake/qt/combo.h 2009-10-18 01:55:06 UTC (rev 2003) @@ -8,6 +8,8 @@ namespace yake { namespace qt { + /** A QComboBox equivalent but using the 'name/value' interface. + */ class YAKE_QT_API Combo : public QComboBox { public: Modified: branches/yake2/yake/yake/qt/delegates.h =================================================================== --- branches/yake2/yake/yake/qt/delegates.h 2009-10-18 00:24:41 UTC (rev 2002) +++ branches/yake2/yake/yake/qt/delegates.h 2009-10-18 01:55:06 UTC (rev 2003) @@ -8,6 +8,9 @@ namespace yake { namespace qt { + /** A delegate which does nothing, i.e. does not provide any editing functionality. + Basically, it results in a read-only item. + */ class YAKE_QT_API DoNothingDelegate : public QItemDelegate { public: Modified: branches/yake2/yake/yake/qt/editor_types.h =================================================================== --- branches/yake2/yake/yake/qt/editor_types.h 2009-10-18 00:24:41 UTC (rev 2002) +++ branches/yake2/yake/yake/qt/editor_types.h 2009-10-18 01:55:06 UTC (rev 2003) @@ -11,6 +11,8 @@ namespace qt { typedef std::string string; //@todo fixme + /** Roles for a specific QModelIndex, as used by qt::* delegates. + */ enum ItemRole { PropertyTypeRole = Qt::UserRole + 1, // type: EditorType EnumValues, Modified: branches/yake2/yake/yake/qt/titlebar.h =================================================================== --- branches/yake2/yake/yake/qt/titlebar.h 2009-10-18 00:24:41 UTC (rev 2002) +++ branches/yake2/yake/yake/qt/titlebar.h 2009-10-18 01:55:06 UTC (rev 2003) @@ -11,6 +11,7 @@ namespace yake { namespace qt { class Dialog; + /** A titlebar for a qt::Dialog. */ class YAKE_QT_API Titlebar : public QFrame { Q_OBJECT This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2009-10-18 00:24:57
|
Revision: 2002 http://yake.svn.sourceforge.net/yake/?rev=2002&view=rev Author: psyclonist Date: 2009-10-18 00:24:41 +0000 (Sun, 18 Oct 2009) Log Message: ----------- added new library yake::qt Added Paths: ----------- branches/yake2/yake/src/qt/ branches/yake2/yake/src/qt/combo.cpp branches/yake2/yake/src/qt/delegates.cpp branches/yake2/yake/src/qt/dialog.cpp branches/yake2/yake/src/qt/style.cpp branches/yake2/yake/src/qt/titlebar.cpp branches/yake2/yake/yake/qt/ branches/yake2/yake/yake/qt/combo.h branches/yake2/yake/yake/qt/delegates.h branches/yake2/yake/yake/qt/dialog.h branches/yake2/yake/yake/qt/editor_types.h branches/yake2/yake/yake/qt/prerequisites.h branches/yake2/yake/yake/qt/style.h branches/yake2/yake/yake/qt/titlebar.h Added: branches/yake2/yake/src/qt/combo.cpp =================================================================== --- branches/yake2/yake/src/qt/combo.cpp (rev 0) +++ branches/yake2/yake/src/qt/combo.cpp 2009-10-18 00:24:41 UTC (rev 2002) @@ -0,0 +1,60 @@ +#include "yake/qt/combo.h" +#include "yake/qt/combo.moc" + +#include <QAbstractItemView> + +namespace yake { +namespace qt { + Combo::Combo(QWidget* parent) : QComboBox(parent), m_combo(this) + { + // Make sure the combo box gets the focus: + //this->setFocusProxy(m_combo); + this->setEditable(false); + this->setDuplicatesEnabled( false ); + //this->view()->setMinimumHeight(this->view()->minimumHeight()*1.5); + } + void Combo::showPopup() + { +#if 1 + if (count()>0 && view()) + { + const QFontMetrics metrics = fontMetrics(); + int maxLen = 0; + for (int i=0, end=count(); i<end; ++i) + maxLen = std::max(maxLen, metrics.width(itemText(i))); + if (maxLen+20 > view()->minimumWidth()) + view()->setMinimumWidth(maxLen + 20); //@todo +20 for the scrollbar - but how large should it be? + } +#endif + QComboBox::showPopup(); + } + void Combo::setEqualFn(const IsValueEqualFn& isEqualFn) + { + m_isEqual = isEqualFn; + } + void Combo::setValues(const NameValueList& values) + { + m_combo->clear(); + m_values = values; + for (size_t i=0; i<m_values.size(); ++i) + m_combo->addItem( m_values.at(i).first, QVariant::fromValue(m_values.at(i).second) ); + } + void Combo::select(const Value& value) + { + assert( m_isEqual ); + for (size_t i=0; i<m_values.size(); ++i) + { + if (m_isEqual(m_values.at(i).second, value)) + m_combo->setCurrentIndex(i); + } + } + Value Combo::currentValue() const + { + return m_combo->itemData( m_combo->currentIndex() ).value<Value>(); + } + QString Combo::currentText() const + { + return m_combo->currentText(); + } +} // qt +} // yake \ No newline at end of file Added: branches/yake2/yake/src/qt/delegates.cpp =================================================================== --- branches/yake2/yake/src/qt/delegates.cpp (rev 0) +++ branches/yake2/yake/src/qt/delegates.cpp 2009-10-18 00:24:41 UTC (rev 2002) @@ -0,0 +1,205 @@ +#include "yake/qt/delegates.h" +#include "yake/qt/delegates.moc" +#include "yake/qt/editor_types.h" +#include "yake/qt/combo.h" + +#include <boost/optional.hpp> + +#include <QLineEdit> +#include <QAbstractItemView> +#include <QCheckBox> +#include <QMessageBox> +#include <QTreeWidgetItem> + +namespace yake { +namespace qt { + //----------------------------------------------------- + boost::optional<string> EditorHints::get(const string& key) const + { + const std::map<string,string>::const_iterator it = hints.find(key); + return (it == hints.end()) ? boost::optional<string>() : it->second; + } + //----------------------------------------------------- + DoNothingDelegate::DoNothingDelegate(QObject* parent) : QItemDelegate(parent) + { + } + QWidget* DoNothingDelegate::createEditor( QWidget * parent, const QStyleOptionViewItem & option, const QModelIndex & index ) const + { + return 0; + } + //----------------------------------------------------- + ValueDelegate::ValueDelegate(QObject* parent) : QItemDelegate(parent) + { + } + void ValueDelegate::emitCommitData() + { + emit commitData(qobject_cast<QWidget *>(sender())); + } + QWidget* ValueDelegate::createEditor ( QWidget * parent, const QStyleOptionViewItem & option, const QModelIndex & index ) const + { + const QVariant value = index.data(CustomEditRole); + if (value.canConvert<Value>()) + { + assert( index.data(PropertyTypeRole).canConvert<int>() ); + const EditorType type = EditorType(index.data(PropertyTypeRole).value<int>()); + boost::optional<EditorHints> hints; + { + if (index.data(EditorHintsRole).canConvert<boost::any>()) + { + const boost::any anyHints = index.data(EditorHintsRole).value<boost::any>(); + assert( !anyHints.empty() ); + try { + hints = boost::any_cast<EditorHints>(anyHints); + } + catch (boost::bad_any_cast&) + { + return 0; + } + } + } + switch (type) + { + case StringEditor: + { + if (hints) + { + if (hints->get("filename")) + return new QLineEdit(parent); + else + return new QLineEdit(parent); + } + else + return new QLineEdit(parent); + } + case EnumEditor: + { + Combo* editor = new Combo(parent); + //editor->installEventFilter(const_cast<ValueDelegate*>(this)); + //editor->setFocusPolicy(Qt::StrongFocus); + + const NameValueList values = boost::any_cast<NameValueList>( index.data(EnumValues).value<Value>() ); + const IsValueEqualFn equalFn = boost::any_cast<IsValueEqualFn>( index.data(ValueEqualRole).value<Value>() ); + assert( equalFn ); + editor->setEqualFn(equalFn); + editor->setValues(values); + + //connect(editor, SIGNAL(activated(int)), this, SLOT(emitCommitData())); + return editor; + } + case CheckStateEditor: + assert(0 && "actually, the way Qt works, this editor gets never instantiated..."); + { + QCheckBox* editor = new QCheckBox(parent); + editor->setCheckState( Qt::CheckState(index.data(Qt::CheckStateRole).value<int>()) ); + return editor; + } + default: + return 0; + }; + } + else + return QItemDelegate::createEditor(parent,option,index); + } + void ValueDelegate::setEditorData ( QWidget * editor, const QModelIndex & index ) const + { + const QVariant value = index.data(CustomEditRole); + if (value.canConvert<Value>()) + { + try { + const Value v = value.value<Value>(); + assert( index.data(PropertyTypeRole).canConvert<int>() ); + const EditorType type = EditorType(index.data(PropertyTypeRole).value<int>()); + switch (type) + { + case StringEditor: + { + QLineEdit* edit = dynamic_cast<QLineEdit*>(editor); + assert( edit ); + assert( index.data(ValueToStringRole).canConvert<Value>() ); + const ValueToStringFn toStringFn = boost::any_cast<ValueToStringFn>(index.data(ValueToStringRole).value<Value>()); + assert( toStringFn ); + const boost::optional<QString> text = toStringFn(v); + edit->setText( text ? *text : "" ); + } + break; + case EnumEditor: + { + Combo* edit = dynamic_cast<Combo*>(editor); + assert( edit ); + edit->select(v); + edit->showPopup(); + } + break; + default: + break; + }; + } + catch (boost::bad_any_cast&) + { + assert( false && "bad any cast" ); + } + } + else + QItemDelegate::setEditorData(editor, index); + } + void ValueDelegate::setModelData ( QWidget * editor, QAbstractItemModel * model, const QModelIndex & index ) const + { + const QVariant value = index.data(CustomEditRole); + if (value.canConvert<Value>()) + { + assert( index.data(PropertyTypeRole).canConvert<int>() ); + const EditorType type = EditorType(index.data(PropertyTypeRole).value<int>()); + switch (type) + { + case StringEditor: + { + QLineEdit* edit = dynamic_cast<QLineEdit*>(editor); + assert( edit ); + const QString text = edit->text(); + + assert( index.data(ValueToStringRole).canConvert<Value>() ); + const StringToValueFn toValueFn = boost::any_cast<StringToValueFn>(index.data(StringToValueRole).value<Value>()); + assert( toValueFn ); + const boost::optional<Value> value = toValueFn(text); + if (value) + { + model->setData(index,text,Qt::DisplayRole); + model->setData(index,QVariant::fromValue<Value>( *value ),CustomEditRole); + } + else + QMessageBox::warning(edit,tr("Validation failed"),tr("The text you entered is not valid.")); + } + break; + case EnumEditor: + { + Combo* edit = dynamic_cast<Combo*>(editor); + assert( edit ); + const Value v = edit->currentValue(); + model->setData(index,edit->currentText(),Qt::DisplayRole); + model->setData(index,QVariant::fromValue(v),CustomEditRole); + } + default: + break; + }; + } + else + QItemDelegate::setModelData(editor,model,index); + } + //----------------------------------------------------- + namespace detail { + Value GetValue::getRaw(QTreeWidgetItem* item, const int column) + { + assert(item); + + const QVariant editor = item->data(column,PropertyTypeRole); + if (editor.canConvert<int>() && + EditorType(editor.value<int>())==CheckStateEditor) + return item->checkState(column)==Qt::Checked; + + const QVariant data = item->data(column,CustomEditRole); + assert( data.canConvert<Value>() ); + return data.value<Value>(); + } + } // namespace detail +} // qt +} // yake \ No newline at end of file Added: branches/yake2/yake/src/qt/dialog.cpp =================================================================== --- branches/yake2/yake/src/qt/dialog.cpp (rev 0) +++ branches/yake2/yake/src/qt/dialog.cpp 2009-10-18 00:24:41 UTC (rev 2002) @@ -0,0 +1,164 @@ +#include "yake/qt/dialog.h" +#include "yake/qt/dialog.moc" +#include "yake/qt/style.h" +#include "yake/qt/titlebar.h" + +#include <QVBoxLayout> +#include <QLabel> +#include <QMouseEvent> +#include <QPainter> + +namespace yake { +namespace qt { + Dialog::Dialog(QWidget* parent) : Dialog2Parent(parent), m_titlebar(0), m_content(0), + m_left(false), m_right(false), m_bottom(false), m_debug(0) + { + //this->setFrameShape(Panel); + Qt::WindowFlags flags = this->windowFlags(); //this->setWindowFlags(flags|Qt::FramelessWindowHint); + this->setWindowFlags(Qt::Dialog|Qt::Window|Qt::FramelessWindowHint); + this->setWindowOpacity(0.95); + + // (Description of flags: http://doc.trolltech.com/4.5/qt.html) + // Qt::WA_NoSystemBackground: + // Indicates that a widget has no background. + // Qt::WA_TranslucentBackground: + // Indicates that a widget has a translucent background, i.e. an alpha channel. + // This flag implicitely causes Qt::WA_NoSystemBackground to be set. + // On Windows this also requires the Qt::FramelessWindowHint to be set. + this->setAttribute(Qt::WA_TranslucentBackground, true); + + // Give it a unique name that can be referenced in the style sheet. + this->setObjectName("dialog2"); + + // Apply the stylesheet: + applyStyleFileTo(*this, "dialog.style"); + + // Setup the titlebar + + this->setMouseTracking(true); + + m_titlebar = new Titlebar(this,this); + m_titlebar->move(0,0); + + QVBoxLayout* layout = new QVBoxLayout(this); + layout->setMargin(0); + layout->setSpacing(0); + layout->setContentsMargins(0,0,0,0); + layout->addWidget(m_titlebar); + + // Setup the content widget + + QVBoxLayout* contentLayout = new QVBoxLayout(this); + m_content = new QFrame(this); + m_content->setObjectName("content"); + contentLayout->addWidget(m_content); + contentLayout->setMargin(0); + contentLayout->setSpacing(0); + layout->addLayout(contentLayout); +#if 1 + //m_content->setAttribute(Qt::WA_NoSystemBackground,false); +#else + QPalette palette = m_content->palette(); + palette.setBrush(QPalette::Base, Qt::transparent); + m_content->setPalette(palette); + m_content->setAttribute(Qt::WA_OpaquePaintEvent, false); +#endif + //m_debug = new QLabel(this); + //layout->addWidget(m_debug); + + + // When rendering with GL it seems that this is not initialized correctly, + // so we move the window manually. + //qt::MainOgreWindow::instance().addWidget(m_titlebar); + //this->move(m_titlebar->pos().x(),m_titlebar->pos().y()+m_titlebar->size().height()); + this->move(0,20); + } + void Dialog::setWindowTitle(const QString& title) + { + m_titlebar->label()->setText(title); + } + void Dialog::moveEvent(QMoveEvent* e) + { + Dialog2Parent::moveEvent(e); + + //m_titlebar->move(this->pos().x(),this->pos().y()-m_titlebar->size().height()); + } + void Dialog::resizeEvent(QResizeEvent* e) + { + Dialog2Parent::resizeEvent(e); + } + void Dialog::mousePressEvent(QMouseEvent* e) + { + m_oldPos = e->pos(); + m_mousePressed = e->button() == Qt::LeftButton; + m_oldCursor = cursor(); + } + void Dialog::mouseReleaseEvent(QMouseEvent* e) + { + m_mousePressed = false; + setCursor(Qt::ArrowCursor/*m_oldCursor*/); + } + void Dialog::mouseMoveEvent(QMouseEvent* e) + { + const int x = e->x(); + const int y = e->y(); + if (m_mousePressed) + { + const QPoint deltaPos(x - m_oldPos.x(), y - m_oldPos.y()); + + QRect g = geometry(); + if (m_left) + g.setLeft(g.left() + deltaPos.x()); + if (m_right) + { + g.setRight(g.right() + deltaPos.x()); + m_oldPos.setX(x); + } + if (m_bottom) + g.setBottom(g.bottom() + deltaPos.y()); + + setGeometry(g); + + m_oldPos.setY(y); + } + else + { + const QRect r = rect(); + m_left = qAbs(x - r.left()) <= 5; + m_right = qAbs(x - r.right()) <= 5; + m_bottom = qAbs(y - r.bottom()) <= 5; + + if (m_debug) + m_debug->setText( + QString("left %1 right %2 bottom %3").arg(m_left).arg(m_right).arg(m_bottom) + "\n" + + QString("x %1 y %2").arg(x).arg(y) + "\n" + + QString("r=(x=%1, y=%2, top=%3, bottom=%4)").arg(r.x()).arg(r.y()).arg(r.top()).arg(r.bottom()) + ); + + if ((m_left || m_right) && m_bottom) + { + if (m_left) + setCursor(Qt::SizeBDiagCursor); + else + setCursor(Qt::SizeFDiagCursor); + } + else if (m_left || m_right) + { + setCursor(Qt::SizeHorCursor); + } + else if (m_bottom) + { + setCursor(Qt::SizeVerCursor); + } + else + { + setCursor(Qt::ArrowCursor/*m_oldCursor*/); + } + } + } + void Dialog::paintEvent(QPaintEvent* e) + { + Dialog2Parent::paintEvent(e); + } +} // qt +} // yake \ No newline at end of file Added: branches/yake2/yake/src/qt/style.cpp =================================================================== --- branches/yake2/yake/src/qt/style.cpp (rev 0) +++ branches/yake2/yake/src/qt/style.cpp 2009-10-18 00:24:41 UTC (rev 2002) @@ -0,0 +1,38 @@ +#include "yake/qt/style.h" + +#include <cassert> +#include <fstream> +#include <QWidget> +#include <QApplication> + +namespace yake { +namespace qt { + /** @todo Use yake::res resource system instead. */ + std::string getFileContents(const std::string& filename) + { + assert(!filename.empty()); + if (filename.empty()) + return std::string(); + std::ifstream styleFile(filename.c_str(),std::ios_base::in); + if (styleFile) + { + const std::string contents((std::istreambuf_iterator<char>(styleFile)), std::istreambuf_iterator<char>()); + return contents; + } + return std::string(); + } + void applyStyleFileTo(QWidget& w, const std::string& filename) + { + const std::string style = getFileContents(filename); + assert(!style.empty()); + if (!style.empty()) + w.setStyleSheet(style.c_str()); + } + void applyStyleFileTo(QApplication& app, const std::string& filename) + { + const std::string style = getFileContents(filename); + if (!style.empty()) + app.setStyleSheet(style.c_str()); + } +} // qt +} // yake \ No newline at end of file Added: branches/yake2/yake/src/qt/titlebar.cpp =================================================================== --- branches/yake2/yake/src/qt/titlebar.cpp (rev 0) +++ branches/yake2/yake/src/qt/titlebar.cpp 2009-10-18 00:24:41 UTC (rev 2002) @@ -0,0 +1,82 @@ +#include "yake/qt/titlebar.h" +#include "yake/qt/titlebar.moc" +#include "yake/qt/style.h" + +#include <QHBoxLayout> +#include <QLabel> +#include <QPushButton> +#include <QMouseEvent> + +namespace yake { +namespace qt { + Titlebar::Titlebar(Dialog* dlg, QWidget* parent) : QFrame(parent), m_label(0), m_mousePressed(false), m_dlg(dlg) + { + // We give this always the name 'titlebar' so that the stylesheet can + // reference this Titlebar with 'QFrame#titlebar'. + this->setObjectName("titlebar"); + this->setFrameShape(StyledPanel); + + // + applyStyleFileTo(*this, "titlebar.style"); + + // + // + QHBoxLayout* layout = new QHBoxLayout(this); + layout->setMargin(2); + layout->setSpacing(0); + + // Title + m_label = new QLabel("",this); + layout->addWidget(m_label); + parent->setWindowTitle(m_label->text()); + + // Buttons + layout->addStretch(1); + QPushButton* close = new QPushButton(QPixmap("icons/cross.png"),"",this); + close->setObjectName("titlebarbutton"); + layout->addWidget(close); + + // + this->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); + + // + this->move(0,0); + this->updateGeometry(); + } + QLabel* Titlebar::label() const + { + return m_label; + } + void Titlebar::mousePressEvent(QMouseEvent* e) + { + m_mousePressed = true; + m_startPos = e->globalPos(); + m_clickPos = mapToParent(e->pos()); + + QFrame::mousePressEvent(e); + } + void Titlebar::mouseReleaseEvent(QMouseEvent* e) + { + m_mousePressed = false; + + QFrame::mouseReleaseEvent(e); + } + void Titlebar::mouseMoveEvent(QMouseEvent* e) + { + //if (maxNormal) + // return; + parentWidget()->move(e->globalPos() - m_clickPos); + } + void Titlebar::focusInEvent(QFocusEvent* e) + { + QFrame::focusInEvent(e); +// +// m_dlg->setFocus(e->reason()); +// this->show(); +// this->raise(); +// m_dlg->show(); +// m_dlg->raise(); +// QApplication::setActiveWindow(m_dlg); + } +} // qt +} // yake \ No newline at end of file Added: branches/yake2/yake/yake/qt/combo.h =================================================================== --- branches/yake2/yake/yake/qt/combo.h (rev 0) +++ branches/yake2/yake/yake/qt/combo.h 2009-10-18 00:24:41 UTC (rev 2002) @@ -0,0 +1,29 @@ +#ifndef YAKE_QT_COMBO_H +#define YAKE_QT_COMBO_H + +#include "prerequisites.h" +#include "editor_types.h" + +#include <QComboBox> + +namespace yake { +namespace qt { + class YAKE_QT_API Combo : public QComboBox + { + public: + Combo(QWidget* parent); + virtual void showPopup(); + void setEqualFn(const IsValueEqualFn& isEqualFn); + void setValues(const NameValueList& values); + void select(const Value& value); + Value currentValue() const; + QString currentText() const; + private: + QComboBox* m_combo; + IsValueEqualFn m_isEqual; + NameValueList m_values; + }; +} // qt +} // yake + +#endif Added: branches/yake2/yake/yake/qt/delegates.h =================================================================== --- branches/yake2/yake/yake/qt/delegates.h (rev 0) +++ branches/yake2/yake/yake/qt/delegates.h 2009-10-18 00:24:41 UTC (rev 2002) @@ -0,0 +1,50 @@ +#ifndef YAKE_QT_DELEGATES_H +#define YAKE_QT_DELEGATES_H + +#include "prerequisites.h" + +#include <QItemDelegate> +class QTreeWidgetItem; + +namespace yake { +namespace qt { + class YAKE_QT_API DoNothingDelegate : public QItemDelegate + { + public: + DoNothingDelegate(QObject* parent); + virtual QWidget* createEditor( QWidget * parent, const QStyleOptionViewItem & option, const QModelIndex & index ) const; + }; + class YAKE_QT_API ValueDelegate : public QItemDelegate + { + Q_OBJECT + public: + ValueDelegate(QObject* parent); + + virtual QWidget* createEditor ( QWidget * parent, const QStyleOptionViewItem & option, const QModelIndex & index ) const; + virtual void setEditorData ( QWidget * editor, const QModelIndex & index ) const; + virtual void setModelData ( QWidget * editor, QAbstractItemModel * model, const QModelIndex & index ) const; + private Q_SLOTS: + void emitCommitData(); + }; + namespace detail { + struct YAKE_QT_API GetValue + { + static Value getRaw(QTreeWidgetItem* item, const int column); + template<typename Vt> + static Vt get(QTreeWidgetItem* item, const int column) + { + try { + return boost::any_cast<Vt>(getRaw(item, column)); + } + catch (boost::bad_any_cast&) + { + assert( 0 && "yake::qt::detail::GetValue::get<>() bad any cast" ); + } + return Vt(); + } + }; + } +} // qt +} // yake + +#endif Added: branches/yake2/yake/yake/qt/dialog.h =================================================================== --- branches/yake2/yake/yake/qt/dialog.h (rev 0) +++ branches/yake2/yake/yake/qt/dialog.h 2009-10-18 00:24:41 UTC (rev 2002) @@ -0,0 +1,63 @@ +#ifndef YAKE_QT_DIALOG_H +#define YAKE_QT_DIALOG_H + +#include "prerequisites.h" + +#include <QDialog> +class QLabel; + +namespace yake { +namespace qt { + class Titlebar; + typedef QDialog Dialog2Parent; + //typedef QFrame Dialog2Parent; + + /** Represents a dialog. In an ideal world, we could just use QDialog, + but unfortunately, there're still some issues as not the whole QDialog + can be styled (using stylesheets) (e.g. the titlebar). + + Note: The major impact is, that child widgets have to be created with + qt::Dialog::content() as their parent widget instead of qt::Dialog instance. + */ + class YAKE_QT_API Dialog : public Dialog2Parent + { + Q_OBJECT + public: + Dialog(QWidget* parent = 0); + + /** Sets the dialog window's title text. */ + void setWindowTitle(const QString& title); + /** @copydoc setWindowTitle + @see setWindowTitle + */ + void setCaption(const QString& title) + { setWindowTitle(title); } + + /** Returns the content widget. */ + QWidget* content() const + { + return m_content; + } + private Q_SLOTS: + virtual void resizeEvent(QResizeEvent*); + virtual void moveEvent(QMoveEvent*); + virtual void mousePressEvent(QMouseEvent*); + virtual void mouseReleaseEvent(QMouseEvent*); + virtual void mouseMoveEvent(QMouseEvent*); + virtual void paintEvent(QPaintEvent*); + private: + Titlebar* m_titlebar; + QWidget* m_content; + QLabel* m_debug; + + QPoint m_oldPos; + bool m_mousePressed; + bool m_left; + bool m_right; + bool m_bottom; + QCursor m_oldCursor; + }; +} // qt +} // yake + +#endif Added: branches/yake2/yake/yake/qt/editor_types.h =================================================================== --- branches/yake2/yake/yake/qt/editor_types.h (rev 0) +++ branches/yake2/yake/yake/qt/editor_types.h 2009-10-18 00:24:41 UTC (rev 2002) @@ -0,0 +1,61 @@ +#ifndef YAKE_QT_EDITOR_TYPES_H +#define YAKE_QT_EDITOR_TYPES_H + +#include "prerequisites.h" + +#include <boost/any.hpp> +#include <boost/function.hpp> +#include <boost/optional/optional_fwd.hpp> + +namespace yake { +namespace qt { + typedef std::string string; //@todo fixme + + enum ItemRole { + PropertyTypeRole = Qt::UserRole + 1, // type: EditorType + EnumValues, + ValueEqualRole, + ValueToStringRole, + StringToValueRole, + CustomEditRole, + EditorHintsRole // type: EditorHints (e.g. "filename;ext=mesh") + }; + enum EditorType { + StringEditor, + EnumEditor, + CheckStateEditor + }; + typedef boost::function<bool(const Value& , const Value& )> IsValueEqualFn; + typedef boost::function<boost::optional<QString>(const Value& v)> ValueToStringFn; + typedef boost::function<boost::optional<Value>(const QString&)> StringToValueFn; + typedef boost::function<void(const Value&)> ValueChangedFn; + + template<typename Vt> + inline bool isValueEqualTo(const Value& lhs, const Value& rhs) + { + try { + const Vt a = boost::any_cast<Vt>(lhs); + const Vt b = boost::any_cast<Vt>(rhs); + return a == b; + } + catch (boost::bad_any_cast&) + { + assert(0 && "bad any cast"); + } + return false; + } + + struct YAKE_QT_API EditorHints + { + boost::optional<string> get(const string& key) const; + + // "filename" + // "ext" = "mesh" + private: + std::map<string,string> hints; + }; + +} // qt +} // yake + +#endif Added: branches/yake2/yake/yake/qt/prerequisites.h =================================================================== --- branches/yake2/yake/yake/qt/prerequisites.h (rev 0) +++ branches/yake2/yake/yake/qt/prerequisites.h 2009-10-18 00:24:41 UTC (rev 2002) @@ -0,0 +1,34 @@ +#ifndef YAKE_QT_PREREQUISITES_H +#define YAKE_QT_PREREQUISITES_H + +#include <yake/base/yakePrerequisites.h> + +#ifdef YAKE_QT_EXPORTS +# define YAKE_QT_API DLLEXPORT +#else +# define YAKE_QT_API DLLIMPORT +#endif + +#include <deque> +#include <map> +#include <boost/any.hpp> +#include <QMetaType> + +Q_DECLARE_METATYPE(boost::any) + +namespace yake { +namespace qt { + + // Types used for comboboxes etc.: + + typedef QString Name; + typedef boost::any Value; + typedef std::deque<Value> ValueList; + typedef std::deque<Name> NameList; + typedef std::map<Name,Value> NameToValue; + typedef std::deque<std::pair<Name,Value> > NameValueList; + +} // qt +} // yake + +#endif Added: branches/yake2/yake/yake/qt/style.h =================================================================== --- branches/yake2/yake/yake/qt/style.h (rev 0) +++ branches/yake2/yake/yake/qt/style.h 2009-10-18 00:24:41 UTC (rev 2002) @@ -0,0 +1,16 @@ +#ifndef YAKE_QT_STYLE_H +#define YAKE_QT_STYLE_H + +#include "prerequisites.h" + +class QWidget; +class QApplication; + +namespace yake { +namespace qt { + YAKE_QT_API void applyStyleFileTo(QWidget& w, const std::string& filename); + YAKE_QT_API void applyStyleFileTo(QApplication& app, const std::string& filename); +} // qt +} // yake + +#endif Added: branches/yake2/yake/yake/qt/titlebar.h =================================================================== --- branches/yake2/yake/yake/qt/titlebar.h (rev 0) +++ branches/yake2/yake/yake/qt/titlebar.h 2009-10-18 00:24:41 UTC (rev 2002) @@ -0,0 +1,35 @@ +#ifndef YAKE_QT_TITLEBAR_H +#define YAKE_QT_TITLEBAR_H + +#include "prerequisites.h" + +#include <QFrame> +class QLabel; +class QMouseEvent; +class QFocusEvent; + +namespace yake { +namespace qt { + class Dialog; + class YAKE_QT_API Titlebar : public QFrame + { + Q_OBJECT + public: + Titlebar(Dialog* dlg, QWidget* parent = 0); + QLabel* label() const; + private Q_SLOTS: + virtual void mousePressEvent(QMouseEvent*); + virtual void mouseReleaseEvent(QMouseEvent*); + virtual void mouseMoveEvent(QMouseEvent*); + virtual void focusInEvent(QFocusEvent*); + private: + bool m_mousePressed; + QLabel* m_label; + Dialog* m_dlg; + QPoint m_clickPos; + QPoint m_startPos; + }; +} // qt +} // yake + +#endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2009-10-17 10:57:41
|
Revision: 2001 http://yake.svn.sourceforge.net/yake/?rev=2001&view=rev Author: psyclonist Date: 2009-10-17 10:57:34 +0000 (Sat, 17 Oct 2009) Log Message: ----------- added user interface theme 'dark' Added Paths: ----------- other/storm/theme/ other/storm/theme/dark/ other/storm/theme/dark/application.style other/storm/theme/dark/dialog.style other/storm/theme/dark/down_arrow.png other/storm/theme/dark/titlebar.style other/storm/theme/dark/up_arrow.png Added: other/storm/theme/dark/application.style =================================================================== --- other/storm/theme/dark/application.style (rev 0) +++ other/storm/theme/dark/application.style 2009-10-17 10:57:34 UTC (rev 2001) @@ -0,0 +1,232 @@ +QWidget +{ + color: white; +} + +QFrame +{ + /*background-color: #1C4860;*/ +} + +QDialog +{ + margin: 0; + border-width: 0; + padding 0; + + background-origin: margin; + background-clip: margin; + + /*background-image: url(image.png);*/ + background-position: top left; + /*background-color: #1C4860;*/ +} + +/* Make the entire row selected in item views. */ +QAbstractItemView +{ + show-decoration-selected: 1; +} + +/* arrows: */ +*::down-arrow, *::menu-indicator +{ + image: url(./down_arrow.png); + width: 7px; + height: 7px; +} +*::down-arrow:disabled, *::menu-indicator:off +{ + image: url(./down_arrow.png); + width: 7px; + height: 7px; +} +*::up-arrow +{ + image: url(./up_arrow.png); + width: 7px; + height: 7px; +} +*::up-arrow:disabled, *::up-arrow:off +{ + image: url(./up_arrow.png); +} + +/* Notes + * We modify the padding by +/-1px to compensate the increase of the border width. +*/ +QPushButton +{ + color: white; + min-width: 60px; + padding-left: 4px; + padding-right: 4px; + padding-top: 1px; + padding-bottom: 1px; + border: 1px solid #6FC4F2; + border-radius: 3px; + background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, + stop: 0 #808080, stop: 1 #505050); +} +QPushButton:pressed +{ + background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, + stop: 0 #909090, stop: 1 #a0a0a0); +} +QPushButton:default +{ + border: 2px solid #3B99CC; + padding-left: 3px; + padding-right: 3px; + padding-top: 0px; + padding-bottom: 0px; +} +QPushButton:hover,QPushButton:focus +{ + border: 2px solid #6FC4F2; + padding-left: 3px; + padding-right: 3px; + padding-top: 0px; + padding-bottom: 0px; +} + + +QLineEdit +{ + background-color: gray; + color: white; + + border-radius: 3px; + border: 1px solid #6FC4F2; + padding: 1px; + selection-background-color: #6FC4F2; +} +/* we modify the padding by -1px to compensate the increase of the border width by +1px */ +QLineEdit:hover,QLineEdit:focus +{ + border: 2px solid #6FC4F2; + padding: 0px; +} + + +QTreeView +{ + show-decoration-selected: 1; + /*background-color: gray;*/ + alternate-background-color: #606060; + border: 2px solid gray; + border-radius: 3px; +} +QTreeView::item +{ +/* + margin: 1px; + border: 1px solid #EEEEEE; + border-radius: 2px; +*/ +} +QTreeView::item:focus +{ + /*border: 1px solid yellow;*/ + background: #3B99CC; +} +QTreeView::item:selected +{ + background: #3B99CC; +} +QTreeView::item:selected:active +{ + background: #3B99CC; +} +QTreeView::item:selected:!active +{ + background: #3B99CC; +} +QTreeView::branch +{ + /*background: palette(base);*/ +} +QHeaderView::section +{ + padding-left: 1ex; + background-color: #707070; + border-left: 0; + border-right 0; + border-top: 0; + border-bottom: 2px solid gray; +} +QHeaderView::section:!first +{ + border-left: 2px solid gray; +} +QTreeView QComboBox +{ + border: 0; + background-color: #3B99CC; +} +QTreeView QComboBox:on +{ /* shift the text when the popup opens */ + padding-left: 4px; +} +QTreeView QComboBox QAbstractItemView +{ + /*show-decoration-selected: 1;*/ + border: 0; + background-color: #606060; + selection-background-color: #6FC4F2; +} +QComboBox::drop-down +{ + margin-top: 2px; + margin-bottom: 2px; + border-left: 1px solid gray; +} + +QScrollBar:vertical { + border: 2px solid gray; + background: #707070; + width: 15px; + margin: 10px 0 10px 0; + } + QScrollBar::handle:vertical { + background: gray; + min-height: 20px; + margin: 2px; + } + QScrollBar::add-line:vertical { + background: gray; + height: 10px; + subcontrol-position: bottom; + subcontrol-origin: margin; + } + QScrollBar::sub-line:vertical { + background: gray; + height: 10px; + subcontrol-position: top; + subcontrol-origin: margin; + } + QScrollBar::up-arrow:vertical + { + } + QScrollBar::down-arrow:vertical + { + } + QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical { + background: none; + } + +QGroupBox +{ + border: 1px solid gray; + border-radius: 3px; + margin-top: 2ex; /* space at top for title */ + padding: 0; +} +QGroupBox::title +{ + subcontrol-origin: margin; + subcontrol-position: top left; + left: 10px; /* move a little to the right so that the rounded corner is visible */ + padding: 0 2px; +} + Added: other/storm/theme/dark/dialog.style =================================================================== --- other/storm/theme/dark/dialog.style (rev 0) +++ other/storm/theme/dark/dialog.style 2009-10-17 10:57:34 UTC (rev 2001) @@ -0,0 +1,21 @@ +/* This is for the GL-rendered UI: */ +QFrame#dialog2 +{ + border-bottom: 4px solid #3B99CC; + border-top-left-radius: 8px; + background-clip: content; +} +QFrame#content +{ + background: #505050; +} + +/* This is for the non-GL-rendered UI: */ +QDialog +{ + border-bottom: 4px solid #3B99CC; + border-top-left-radius: 8px; + border-top-right-radius: 8px; + background-clip: content; + background: #505050; +} Added: other/storm/theme/dark/down_arrow.png =================================================================== (Binary files differ) Property changes on: other/storm/theme/dark/down_arrow.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: other/storm/theme/dark/titlebar.style =================================================================== --- other/storm/theme/dark/titlebar.style (rev 0) +++ other/storm/theme/dark/titlebar.style 2009-10-17 10:57:34 UTC (rev 2001) @@ -0,0 +1,18 @@ +QFrame#titlebar +{ + /*border: 1px solid #3B99CC;*/ + border-top-left-radius: 6px; + border-top-right-radius: 6px; + margin: 0; + padding: 0; + spacing: 0; + background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, + stop: 0 #6FC4F2, stop: 1 #3B99CC); +} +QFrame#titlebar QLabel +{ + margin-left: 4px; + padding: 0; + spacing: 0; + border: 0; +} Added: other/storm/theme/dark/up_arrow.png =================================================================== (Binary files differ) Property changes on: other/storm/theme/dark/up_arrow.png ___________________________________________________________________ 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: <psy...@us...> - 2009-10-16 23:46:43
|
Revision: 2000 http://yake.svn.sourceforge.net/yake/?rev=2000&view=rev Author: psyclonist Date: 2009-10-16 23:46:37 +0000 (Fri, 16 Oct 2009) Log Message: ----------- updated BUILDING Modified Paths: -------------- branches/yake2/yake/BUILDING Modified: branches/yake2/yake/BUILDING =================================================================== --- branches/yake2/yake/BUILDING 2009-10-08 23:48:29 UTC (rev 1999) +++ branches/yake2/yake/BUILDING 2009-10-16 23:46:37 UTC (rev 2000) @@ -49,7 +49,7 @@ This article assumes that the root directory is 'yake' and the directory structure looks like this: yake/ - src/ + src/ yake/ scripts/ etc. @@ -138,7 +138,14 @@ By default, the libraries can now be found in "build/vs2008/bin". +* Copy all required .lib, .dll and .pdb files as well as all samples (.exe) to + the staging area in "build/stage" (Especially useful for releases, SDKs, ...): + premake4 --toolset=vs2008 stage + +Note: You can build the targets for different toolset in the same source tree. + + 1.3 Building with Code::Blocks ------------------------------ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2009-10-08 23:48:35
|
Revision: 1999 http://yake.svn.sourceforge.net/yake/?rev=1999&view=rev Author: psyclonist Date: 2009-10-08 23:48:29 +0000 (Thu, 08 Oct 2009) Log Message: ----------- Created folder remotely Added Paths: ----------- other/qtogre/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2009-10-08 23:46:17
|
Revision: 1998 http://yake.svn.sourceforge.net/yake/?rev=1998&view=rev Author: psyclonist Date: 2009-10-08 23:46:11 +0000 (Thu, 08 Oct 2009) Log Message: ----------- Created folder remotely Added Paths: ----------- other/storm/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2009-10-08 23:45:54
|
Revision: 1997 http://yake.svn.sourceforge.net/yake/?rev=1997&view=rev Author: psyclonist Date: 2009-10-08 23:45:47 +0000 (Thu, 08 Oct 2009) Log Message: ----------- Created folder remotely Added Paths: ----------- other/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2009-10-08 23:44:42
|
Revision: 1996 http://yake.svn.sourceforge.net/yake/?rev=1996&view=rev Author: psyclonist Date: 2009-10-08 23:44:35 +0000 (Thu, 08 Oct 2009) Log Message: ----------- physicsODE: updated project due to changes in yake.base Modified Paths: -------------- branches/yake2/yake/src/plugins/physicsODE/OdeAvatar.cpp Modified: branches/yake2/yake/src/plugins/physicsODE/OdeAvatar.cpp =================================================================== --- branches/yake2/yake/src/plugins/physicsODE/OdeAvatar.cpp 2009-10-08 23:42:26 UTC (rev 1995) +++ branches/yake2/yake/src/plugins/physicsODE/OdeAvatar.cpp 2009-10-08 23:44:35 UTC (rev 1996) @@ -25,6 +25,7 @@ ------------------------------------------------------------------------------------ */ #include <yake/plugins/physicsODE/yakePCH.h> +#include <yake/log/log.h> #include <yake/plugins/physicsODE/OdeWorld.h> #include <yake/plugins/physicsODE/OdeJoint.h> #include <yake/plugins/physicsODE/OdeBody.h> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2009-10-08 23:42:33
|
Revision: 1995 http://yake.svn.sourceforge.net/yake/?rev=1995&view=rev Author: psyclonist Date: 2009-10-08 23:42:26 +0000 (Thu, 08 Oct 2009) Log Message: ----------- scripting: updated project due to changes in yake.base scriptingLua: updated project due to changes in yake.base physicsODE: updated project due to changes in yake.base Modified Paths: -------------- branches/yake2/yake/premake4.lua branches/yake2/yake/src/plugins/physicsODE/OdeActor.cpp branches/yake2/yake/src/plugins/physicsODE/OdeShapes.cpp branches/yake2/yake/src/plugins/physicsODE/OdeWorld.cpp branches/yake2/yake/src/plugins/scriptingLua/ScriptingSystemLua.cpp branches/yake2/yake/yake/plugins/physicsODE/OdeActor.h branches/yake2/yake/yake/plugins/physicsODE/OdeWorld.h branches/yake2/yake/yake/plugins/physicsODE/PhysicsSystemODE.h branches/yake2/yake/yake/plugins/physicsODE/yakePrerequisites.h branches/yake2/yake/yake/scripting/yakeScriptingSystem.h Modified: branches/yake2/yake/premake4.lua =================================================================== --- branches/yake2/yake/premake4.lua 2009-10-08 23:22:38 UTC (rev 1994) +++ branches/yake2/yake/premake4.lua 2009-10-08 23:42:26 UTC (rev 1995) @@ -18,7 +18,7 @@ libdirs = { DEP_DIR .. "boost/stage/lib" }, } yake_deps["lua"] = { - includedirs = { DEP_DIR .. "lua" }, + includedirs = { DEP_DIR .. "lua/include" }, libdirs = { DEP_DIR .. "lua/lib" }, links = { --["Debug"] = { "lua5.1d" }, @@ -29,6 +29,16 @@ ["ReleaseDLL"] = { "lua5.1" }, } } + yake_deps["luabind"] = { + includedirs = { DEP_DIR .. "luabind" }, + libdirs = { DEP_DIR .. "luabind/lib" }, + links = { + ["DebugLib"] = { "luabindd" }, + ["DebugDLL"] = { "luabindd" }, + ["ReleaseLib"] = { "luabind" }, + ["ReleaseDLL"] = { "luabind" }, + } + } yake_deps["ogre"] = { includedirs = { DEP_DIR .. "ogre/include" }, libdirs = { DEP_DIR .. "ogre/lib" }, @@ -49,6 +59,16 @@ ["ReleaseDLL"] = { "OIS" }, } } + yake_deps["ode"] = { + includedirs = { DEP_DIR .. "ode/include" }, + libdirs = { DEP_DIR .. "ode/lib" }, + links = { + ["DebugLib"] = { "ode_doubled" }, + ["DebugDLL"] = { "ode_doubled" }, + ["ReleaseLib"] = { "ode_double" }, + ["ReleaseDLL"] = { "ode_double" }, + } + } end local function require_package_incs(name) print("require_package_incs",name) @@ -445,12 +465,30 @@ requires_lib "base" requires_lib "log" +project_lib("scripting", {require_package = {"boost"}}) + requires_lib "base" + requires_lib "log" + +-- plugins project_plugin("graphicsOgre", {require_package = {"boost","ogre"}}) requires_lib "base" requires_lib "log" requires_lib "graphics" -for k,v in pairs(_OPTIONS) do print("OPT",k,v) end +project_plugin("scriptingLua", {require_package = {"boost","lua","luabind"}}) + requires_lib "base" + requires_lib "log" + requires_lib "res" + requires_lib "scripting" + +project_plugin("physicsODE", {require_package = {"boost","ode"}}) + requires_lib "base" + requires_lib "log" + requires_lib "physics" + +-- samples +--debug: for k,v in pairs(_OPTIONS) do print("OPT",k,v) end + if not _OPTIONS["without-demos"] then project_exe "log1" requires_lib "base" @@ -477,4 +515,3 @@ if _ACTION == "clean" then os.rmdir("build") end - Modified: branches/yake2/yake/src/plugins/physicsODE/OdeActor.cpp =================================================================== --- branches/yake2/yake/src/plugins/physicsODE/OdeActor.cpp 2009-10-08 23:22:38 UTC (rev 1994) +++ branches/yake2/yake/src/plugins/physicsODE/OdeActor.cpp 2009-10-08 23:42:26 UTC (rev 1995) @@ -25,6 +25,7 @@ ------------------------------------------------------------------------------------ */ #include <yake/plugins/physicsODE/yakePCH.h> +#include <yake/log/log.h> #include <yake/plugins/physicsODE/OdeWorld.h> #include <yake/plugins/physicsODE/OdeJoint.h> #include <yake/plugins/physicsODE/OdeBody.h> Modified: branches/yake2/yake/src/plugins/physicsODE/OdeShapes.cpp =================================================================== --- branches/yake2/yake/src/plugins/physicsODE/OdeShapes.cpp 2009-10-08 23:22:38 UTC (rev 1994) +++ branches/yake2/yake/src/plugins/physicsODE/OdeShapes.cpp 2009-10-08 23:42:26 UTC (rev 1995) @@ -25,6 +25,7 @@ ------------------------------------------------------------------------------------ */ #include <yake/plugins/physicsODE/yakePCH.h> +#include <yake/log/log.h> #include <yake/plugins/physicsODE/OdeShapes.h> Modified: branches/yake2/yake/src/plugins/physicsODE/OdeWorld.cpp =================================================================== --- branches/yake2/yake/src/plugins/physicsODE/OdeWorld.cpp 2009-10-08 23:22:38 UTC (rev 1994) +++ branches/yake2/yake/src/plugins/physicsODE/OdeWorld.cpp 2009-10-08 23:42:26 UTC (rev 1995) @@ -25,6 +25,7 @@ ------------------------------------------------------------------------------------ */ #include <yake/plugins/physicsODE/yakePCH.h> +#include <yake/log/log.h> #include <yake/plugins/physicsODE/OdeWorld.h> #include <yake/plugins/physicsODE/OdeJoint.h> #include <yake/plugins/physicsODE/OdeBody.h> @@ -123,10 +124,10 @@ } //----------------------------------------------------- - Deque<ShapeType> OdeWorld::getSupportedShapes( bool includeStatic, bool includeDynamic ) const + std::deque<ShapeType> OdeWorld::getSupportedShapes( bool includeStatic, bool includeDynamic ) const { /// TODO Add real implementation! FIXME - Deque<ShapeType> supportedShapes; + std::deque<ShapeType> supportedShapes; return supportedShapes; } @@ -159,19 +160,19 @@ return (itFind == mMaterials.end()) ? 0 : itFind->second.get(); } //----------------------------------------------------- - Deque<JointType> OdeWorld::getSupportedJoints() const + std::deque<JointType> OdeWorld::getSupportedJoints() const { //TODO Add real implementation - Deque<JointType> supportedJoints; + std::deque<JointType> supportedJoints; return supportedJoints; } //----------------------------------------------------- - Deque<String> OdeWorld::getSupportedSolvers() const + StringVector OdeWorld::getSupportedSolvers() const { //TODO Add real implementation - Deque<String> supportedSolvers; + StringVector supportedSolvers; supportedSolvers.push_back( "quickStep" ); supportedSolvers.push_back( "StepFast" ); @@ -329,7 +330,7 @@ OdeActor* pActor = new OdeActor( this, rActorDesc.type ); YAKE_ASSERT( pActor ); - typedef Deque< SharedPtr<IShape::Desc> > ActorShapesCollection; + typedef std::deque< SharedPtr<IShape::Desc> > ActorShapesCollection; const ActorShapesCollection& shapes = rActorDesc.shapes; for ( ActorShapesCollection::const_iterator i = shapes.begin(); i != shapes.end(); ++i ) Modified: branches/yake2/yake/src/plugins/scriptingLua/ScriptingSystemLua.cpp =================================================================== --- branches/yake2/yake/src/plugins/scriptingLua/ScriptingSystemLua.cpp 2009-10-08 23:22:38 UTC (rev 1994) +++ branches/yake2/yake/src/plugins/scriptingLua/ScriptingSystemLua.cpp 2009-10-08 23:42:26 UTC (rev 1995) @@ -25,6 +25,7 @@ ------------------------------------------------------------------------------------ */ #include <yake/plugins/scriptingLua/yakePCH.h> +#include <yake/log/log.h> #include <yake/bindings.lua/common/yake.lua.common.h> Modified: branches/yake2/yake/yake/plugins/physicsODE/OdeActor.h =================================================================== --- branches/yake2/yake/yake/plugins/physicsODE/OdeActor.h 2009-10-08 23:22:38 UTC (rev 1994) +++ branches/yake2/yake/yake/plugins/physicsODE/OdeActor.h 2009-10-08 23:42:26 UTC (rev 1995) @@ -103,7 +103,7 @@ OdeBody* mBody; OdeWorld* mOdeWorld; - typedef Deque<SharedPtr<OdeGeom> > ShapeList; + typedef std::deque<SharedPtr<OdeGeom> > ShapeList; ShapeList mShapes; struct CollisionInfo Modified: branches/yake2/yake/yake/plugins/physicsODE/OdeWorld.h =================================================================== --- branches/yake2/yake/yake/plugins/physicsODE/OdeWorld.h 2009-10-08 23:22:38 UTC (rev 1994) +++ branches/yake2/yake/yake/plugins/physicsODE/OdeWorld.h 2009-10-08 23:42:26 UTC (rev 1995) @@ -27,9 +27,11 @@ #ifndef YAKE_ODEWORLD_H #define YAKE_ODEWORLD_H -#include <yake/plugins/physicsODE/yakePrerequisites.h> +#include "yake/plugins/physicsODE/yakePrerequisites.h" #include "yake/plugins/physicsODE/OdeShapes.h" +#include <deque> + namespace yake { namespace physics { @@ -62,9 +64,9 @@ virtual TriangleMeshId createTriangleMesh( const TriangleMeshDesc& rTrimeshDesc ); - virtual Deque<ShapeType> getSupportedShapes( bool bStatic = true, bool bDynamic = true) const; - virtual Deque<JointType> getSupportedJoints() const; - virtual Deque<String> getSupportedSolvers() const; + virtual std::deque<ShapeType> getSupportedShapes( bool bStatic = true, bool bDynamic = true) const; + virtual std::deque<JointType> getSupportedJoints() const; + virtual StringVector getSupportedSolvers() const; virtual bool useSolver( const String& rSolver ); virtual String getCurrentSolver() const; virtual const StringVector getCurrentSolverParams() const; @@ -118,21 +120,21 @@ BodyList mBodies; TriangleMeshId mNextMeshId; - typedef AssocVector< TriangleMeshId, OdeTriMesh::MeshData > MeshDataMap; + typedef std::map< TriangleMeshId, OdeTriMesh::MeshData > MeshDataMap; MeshDataMap mMeshDataMap; StringVector mCurrentSolverParams; - typedef Deque<SharedPtr<OdeActor> > OdeActorVector; + typedef std::deque<SharedPtr<OdeActor> > OdeActorVector; OdeActorVector mActors; - typedef Deque<SharedPtr<OdeJoint> > OdeJointVector; + typedef std::deque<SharedPtr<OdeJoint> > OdeJointVector; OdeJointVector mJoints; typedef std::map<String,SharedPtr<OdeMaterial> > OdeMaterialVector; OdeMaterialVector mMaterials; - typedef Deque<SharedPtr<OdeAvatar> > OdeAvatarVector; + typedef std::deque<SharedPtr<OdeAvatar> > OdeAvatarVector; OdeAvatarVector mAvatars; }; } Modified: branches/yake2/yake/yake/plugins/physicsODE/PhysicsSystemODE.h =================================================================== --- branches/yake2/yake/yake/plugins/physicsODE/PhysicsSystemODE.h 2009-10-08 23:22:38 UTC (rev 1994) +++ branches/yake2/yake/yake/plugins/physicsODE/PhysicsSystemODE.h 2009-10-08 23:42:26 UTC (rev 1995) @@ -34,7 +34,6 @@ class PhysicsSystemODE : public IPhysicsSystem { - YAKE_DECLARE_CLASS( PhysicsSystemODE ) YAKE_DECLARE_CONCRETE( PhysicsSystemODE, "ode" ); public: PhysicsSystemODE(); Modified: branches/yake2/yake/yake/plugins/physicsODE/yakePrerequisites.h =================================================================== --- branches/yake2/yake/yake/plugins/physicsODE/yakePrerequisites.h 2009-10-08 23:22:38 UTC (rev 1994) +++ branches/yake2/yake/yake/plugins/physicsODE/yakePrerequisites.h 2009-10-08 23:42:26 UTC (rev 1995) @@ -29,7 +29,7 @@ #include "yake/base/yakePrerequisites.h" -#ifdef YAKEPHYSICSODE_EXPORTS +#ifdef YAKE_PHYSICSODE_EXPORTS # define YAKE_PHYSICSODE_API YAKE_EXPORT_API #else # define YAKE_PHYSICSODE_API YAKE_IMPORT_API Modified: branches/yake2/yake/yake/scripting/yakeScriptingSystem.h =================================================================== --- branches/yake2/yake/yake/scripting/yakeScriptingSystem.h 2009-10-08 23:22:38 UTC (rev 1994) +++ branches/yake2/yake/yake/scripting/yakeScriptingSystem.h 2009-10-08 23:42:26 UTC (rev 1995) @@ -32,7 +32,6 @@ #include <yake/base/yakePrerequisites.h> #include <yake/base/yakePlugin.h> #include <yake/base/templates/yakePointer.h> -#include <yake/base/templates/yakeManager.h> #include <yake/base/templates/yakeRegistry.h> #include <yake/base/templates/yakeFunction.h> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2009-10-08 23:22:46
|
Revision: 1994 http://yake.svn.sourceforge.net/yake/?rev=1994&view=rev Author: psyclonist Date: 2009-10-08 23:22:38 +0000 (Thu, 08 Oct 2009) Log Message: ----------- graphics: updated project due to changes in yake.base Modified Paths: -------------- branches/yake2/yake/premake4.lua branches/yake2/yake/yake/plugins/graphicsOgre/graphicsOgreCore.h branches/yake2/yake/yake/plugins/graphicsOgre/graphicsOgreGeometryAccess.h branches/yake2/yake/yake/plugins/graphicsOgre/graphicsOgrePrerequisites.h branches/yake2/yake/yake/plugins/graphicsOgre/yakeGraphicsSystem.h branches/yake2/yake/yake/plugins/graphicsOgre/yakeGraphicsWorld.h branches/yake2/yake/yake/plugins/graphicsOgre/yakePCH.h Modified: branches/yake2/yake/premake4.lua =================================================================== --- branches/yake2/yake/premake4.lua 2009-10-08 23:10:12 UTC (rev 1993) +++ branches/yake2/yake/premake4.lua 2009-10-08 23:22:38 UTC (rev 1994) @@ -29,6 +29,26 @@ ["ReleaseDLL"] = { "lua5.1" }, } } + yake_deps["ogre"] = { + includedirs = { DEP_DIR .. "ogre/include" }, + libdirs = { DEP_DIR .. "ogre/lib" }, + links = { + ["DebugLib"] = { "OgreMain_d" }, + ["DebugDLL"] = { "OgreMain_d" }, + ["ReleaseLib"] = { "OgreMain" }, + ["ReleaseDLL"] = { "OgreMain" }, + } + } + yake_deps["ois"] = { + includedirs = { DEP_DIR .. "ogre/include/ois" }, + libdirs = { DEP_DIR .. "ogre/lib" }, + links = { + ["DebugLib"] = { "OIS_d" }, + ["DebugDLL"] = { "OIS_d" }, + ["ReleaseLib"] = { "OIS" }, + ["ReleaseDLL"] = { "OIS" }, + } + } end local function require_package_incs(name) print("require_package_incs",name) @@ -326,6 +346,8 @@ targetname(YAKE_LIBFILE_PREFIX.. name.."_"..mapActionToCompilerName[_ACTION].."_sd") require_package_links( "DebugLib", opt.require_package ) end + +-- project_lib local function project_lib(name,opt) opt = opt or {} opt.files = opt.files or { @@ -339,16 +361,34 @@ includedirs { ROOT_DIR .. "yake/" .. name .. "/**" } links { name } end + +-- project_plugin +local function project_plugin(name,opt) + opt = opt or {} + opt.files = opt.files or { + ROOT_DIR .. "src/plugins/"..name.."/**.cpp", + ROOT_DIR .. "yake/plugins/"..name.."/**.h", + ROOT_DIR .. "yake/plugins/"..name.."/**.inl" + } + project_lib_basic(name,opt) +end +local function requires_plugin( name ) + includedirs { ROOT_DIR .. "yake/plugins/" .. name .. "/**" } + links { name } +end + +-- project_exe local function project_exe(name,opt) - assert(name,"no name specified for project_lib") + assert(name,"no name specified for project_exe") local opt = opt or {} opt.require_package = opt.require_package or { "boost" } project("sample_"..name) + language "C++" + kind "ConsoleApp" + location ( ROOT_DIR .. "build/" .. _ACTION ) targetdir ( ROOT_DIR .. "build/" .. _ACTION .. "/bin" ) - language "C++" - kind "ConsoleApp" files { ROOT_DIR .. "samples/"..name.."/**.cpp", ROOT_DIR .. "samples/"..name.."/**.h" } -- general include base directory @@ -386,6 +426,10 @@ project_lib("log", {require_package = {"boost"}}) requires_lib "base" +project_lib("res", {require_package = {"boost"}}) + requires_lib "base" + requires_lib "log" + project_lib("property2", {require_package = {"boost"}}) requires_lib "log" @@ -401,6 +445,11 @@ requires_lib "base" requires_lib "log" +project_plugin("graphicsOgre", {require_package = {"boost","ogre"}}) + requires_lib "base" + requires_lib "log" + requires_lib "graphics" + for k,v in pairs(_OPTIONS) do print("OPT",k,v) end if not _OPTIONS["without-demos"] then project_exe "log1" Modified: branches/yake2/yake/yake/plugins/graphicsOgre/graphicsOgreCore.h =================================================================== --- branches/yake2/yake/yake/plugins/graphicsOgre/graphicsOgreCore.h 2009-10-08 23:10:12 UTC (rev 1993) +++ branches/yake2/yake/yake/plugins/graphicsOgre/graphicsOgreCore.h 2009-10-08 23:22:38 UTC (rev 1994) @@ -90,7 +90,7 @@ SystemFrameListener* mSysFL; - typedef AssocVector<String,String> StringMap; + typedef std::map<String,String> StringMap; StringMap mConfig; Ogre::SceneType mSceneType; Modified: branches/yake2/yake/yake/plugins/graphicsOgre/graphicsOgreGeometryAccess.h =================================================================== --- branches/yake2/yake/yake/plugins/graphicsOgre/graphicsOgreGeometryAccess.h 2009-10-08 23:10:12 UTC (rev 1993) +++ branches/yake2/yake/yake/plugins/graphicsOgre/graphicsOgreGeometryAccess.h 2009-10-08 23:22:38 UTC (rev 1994) @@ -38,7 +38,7 @@ { private: Ogre::MeshPtr mMesh; - typedef AssocVector<SubmeshId, Ogre::SubMesh*> SubMeshMap; + typedef std::map<SubmeshId, Ogre::SubMesh*> SubMeshMap; SubMeshMap mSubmeshes; SubmeshId mLastId; public: Modified: branches/yake2/yake/yake/plugins/graphicsOgre/graphicsOgrePrerequisites.h =================================================================== --- branches/yake2/yake/yake/plugins/graphicsOgre/graphicsOgrePrerequisites.h 2009-10-08 23:10:12 UTC (rev 1993) +++ branches/yake2/yake/yake/plugins/graphicsOgre/graphicsOgrePrerequisites.h 2009-10-08 23:22:38 UTC (rev 1994) @@ -29,7 +29,7 @@ #include "yake/config.h" -#if defined( YAKE_GRAPHICSCONCRETEAPI_EXPORTS ) +#if defined( YAKE_GRAPHICSOGRE_EXPORTS ) # define YAKE_GRAPHICS_CONCRETE_API YAKE_EXPORT_API #else # define YAKE_GRAPHICS_CONCRETE_API YAKE_IMPORT_API Modified: branches/yake2/yake/yake/plugins/graphicsOgre/yakeGraphicsSystem.h =================================================================== --- branches/yake2/yake/yake/plugins/graphicsOgre/yakeGraphicsSystem.h 2009-10-08 23:10:12 UTC (rev 1993) +++ branches/yake2/yake/yake/plugins/graphicsOgre/yakeGraphicsSystem.h 2009-10-08 23:22:38 UTC (rev 1994) @@ -45,14 +45,7 @@ /** The graphics system interface. */ class YAKE_GRAPHICS_CONCRETE_API GraphicsSystem : public IGraphicsSystem - /*,public ConcreteFactory - < - IGraphicsSystem, - OpNewFactoryUnit, - sequences::list< GraphicalWorld > - >*/ { - YAKE_DECLARE_CLASS( yake::graphics::ogre3d::GraphicsSystem ); YAKE_DECLARE_CONCRETE(GraphicsSystem, "ogre3d"); public: // class Modified: branches/yake2/yake/yake/plugins/graphicsOgre/yakeGraphicsWorld.h =================================================================== --- branches/yake2/yake/yake/plugins/graphicsOgre/yakeGraphicsWorld.h 2009-10-08 23:10:12 UTC (rev 1993) +++ branches/yake2/yake/yake/plugins/graphicsOgre/yakeGraphicsWorld.h 2009-10-08 23:22:38 UTC (rev 1994) @@ -108,7 +108,7 @@ } private: static OgreCore* msCore; - typedef AssocVector< String, Ogre::MeshPtr > ProcMeshMap; + typedef std::map< String, Ogre::MeshPtr > ProcMeshMap; ProcMeshMap mProcMeshes; Ogre::RaySceneQuery* mpRaySceneQuery; Modified: branches/yake2/yake/yake/plugins/graphicsOgre/yakePCH.h =================================================================== --- branches/yake2/yake/yake/plugins/graphicsOgre/yakePCH.h 2009-10-08 23:10:12 UTC (rev 1993) +++ branches/yake2/yake/yake/plugins/graphicsOgre/yakePCH.h 2009-10-08 23:22:38 UTC (rev 1994) @@ -28,6 +28,7 @@ #define __INC_OGRE_PCH_H__ #include <yake/base/yake.h> +#include <yake/log/log.h> #include <yake/graphics/yakeGraphicsSystem.h> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2009-10-08 23:10:19
|
Revision: 1993 http://yake.svn.sourceforge.net/yake/?rev=1993&view=rev Author: psyclonist Date: 2009-10-08 23:10:12 +0000 (Thu, 08 Oct 2009) Log Message: ----------- physics: updated project due to changes in yake.base Modified Paths: -------------- branches/yake2/yake/premake4.lua branches/yake2/yake/yake/physics/yakePCH.h branches/yake2/yake/yake/physics/yakePhysicsActor.h branches/yake2/yake/yake/physics/yakePhysicsJoint.h branches/yake2/yake/yake/physics/yakePhysicsPrerequisites.h branches/yake2/yake/yake/physics/yakePhysicsWorld.h Modified: branches/yake2/yake/premake4.lua =================================================================== --- branches/yake2/yake/premake4.lua 2009-10-08 23:05:54 UTC (rev 1992) +++ branches/yake2/yake/premake4.lua 2009-10-08 23:10:12 UTC (rev 1993) @@ -397,6 +397,10 @@ requires_lib "base" requires_lib "log" +project_lib("physics", {require_package = {"boost"}}) + requires_lib "base" + requires_lib "log" + for k,v in pairs(_OPTIONS) do print("OPT",k,v) end if not _OPTIONS["without-demos"] then project_exe "log1" Modified: branches/yake2/yake/yake/physics/yakePCH.h =================================================================== --- branches/yake2/yake/yake/physics/yakePCH.h 2009-10-08 23:05:54 UTC (rev 1992) +++ branches/yake2/yake/yake/physics/yakePCH.h 2009-10-08 23:10:12 UTC (rev 1993) @@ -29,4 +29,4 @@ #include <iostream> // Yake #include <yake/base/yake.h> -#include <yake/base/yakeLog.h> +#include <yake/log/log.h> Modified: branches/yake2/yake/yake/physics/yakePhysicsActor.h =================================================================== --- branches/yake2/yake/yake/physics/yakePhysicsActor.h 2009-10-08 23:05:54 UTC (rev 1992) +++ branches/yake2/yake/yake/physics/yakePhysicsActor.h 2009-10-08 23:10:12 UTC (rev 1993) @@ -96,7 +96,7 @@ explicit Desc(const ActorType t) : type(t) {} explicit Desc(const Desc& desc) { this->shapes = desc.shapes; this->type = desc.type; } virtual ~Desc() {} - Deque< SharedPtr<IShape::Desc> > shapes; + std::deque< SharedPtr<IShape::Desc> > shapes; ActorType type; }; public: Modified: branches/yake2/yake/yake/physics/yakePhysicsJoint.h =================================================================== --- branches/yake2/yake/yake/physics/yakePhysicsJoint.h 2009-10-08 23:05:54 UTC (rev 1992) +++ branches/yake2/yake/yake/physics/yakePhysicsJoint.h 2009-10-08 23:10:12 UTC (rev 1993) @@ -68,7 +68,7 @@ high(h) {} }; - typedef Deque<Limit> LimitList; + typedef std::deque<Limit> LimitList; class IWorld; class IActor; Modified: branches/yake2/yake/yake/physics/yakePhysicsPrerequisites.h =================================================================== --- branches/yake2/yake/yake/physics/yakePhysicsPrerequisites.h 2009-10-08 23:05:54 UTC (rev 1992) +++ branches/yake2/yake/yake/physics/yakePhysicsPrerequisites.h 2009-10-08 23:10:12 UTC (rev 1993) @@ -30,7 +30,6 @@ #ifndef YAKE_BASE_PREREQUISITES_H # include <yake/base/yakePrerequisites.h> #endif -#include <yake/base/templates/yakeDeque.h> #include <yake/base/math/yakeMath.h> #include <yake/base/math/yakeVector3.h> #include <yake/base/math/yakePoint3.h> @@ -52,9 +51,11 @@ #include <boost/any.hpp> +#include <deque> + #define YAKE_PHYSICS_COMMON_POINTERS( CLASS ) \ typedef CLASS* CLASS##Ptr; \ - typedef Deque<CLASS##Ptr> CLASS##PtrList; + typedef std::deque<CLASS##Ptr> CLASS##PtrList; namespace yake { namespace physics { @@ -80,7 +81,6 @@ String name; boost::any value; }; - typedef Deque<String> StringVector; class YAKE_PHYSICS_API IPropertyQueryHandler { Modified: branches/yake2/yake/yake/physics/yakePhysicsWorld.h =================================================================== --- branches/yake2/yake/yake/physics/yakePhysicsWorld.h 2009-10-08 23:05:54 UTC (rev 1992) +++ branches/yake2/yake/yake/physics/yakePhysicsWorld.h 2009-10-08 23:10:12 UTC (rev 1993) @@ -73,8 +73,8 @@ virtual TriangleMeshId createTriangleMesh( const TriangleMeshDesc& rTrimeshDesc ) = 0; - virtual Deque<ShapeType> getSupportedShapes( bool bStatic = true, bool bDynamic = true ) const = 0; - virtual Deque<JointType> getSupportedJoints() const = 0; + virtual std::deque<ShapeType> getSupportedShapes( bool bStatic = true, bool bDynamic = true ) const = 0; + virtual std::deque<JointType> getSupportedJoints() const = 0; virtual StringVector getSupportedSolvers() const = 0; virtual bool useSolver( const String& rSolver ) = 0; virtual String getCurrentSolver() const = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2009-10-08 23:06:02
|
Revision: 1992 http://yake.svn.sourceforge.net/yake/?rev=1992&view=rev Author: psyclonist Date: 2009-10-08 23:05:54 +0000 (Thu, 08 Oct 2009) Log Message: ----------- premake: yake/config.h is now only rewritten if the resulting config.h is actually different than the current - thereby avoiding unnecessary rebuilds when rebuilding makefiles. premake: fixed settings and added projects Modified Paths: -------------- branches/yake2/yake/premake4.lua Modified: branches/yake2/yake/premake4.lua =================================================================== --- branches/yake2/yake/premake4.lua 2009-10-08 23:04:09 UTC (rev 1991) +++ branches/yake2/yake/premake4.lua 2009-10-08 23:05:54 UTC (rev 1992) @@ -172,9 +172,10 @@ end function make_config_h() local filename = ROOT_DIR .. "yake/config.h" - local f = io.open(filename, "w") + local tmpfilename = ROOT_DIR .. "yake/config.tmp" + local f = io.open(tmpfilename, "w") if not f then - print("ERROR: Unable to create [yake]/yake/config.h") + print("ERROR: Unable to create [yake]/yake/config.tmp") return false end f:write("// This file is auto-generated. Do not modify manually.\n") @@ -205,6 +206,27 @@ f:write("\n") f:write("#endif\n") io.close(f) + + local f_new = io.open(tmpfilename,"r") + assert(f_new) + local new = f_new:read("*all") + f_new:close() + + local copy = false + local f_orig = io.open(filename,"r") + if f_orig then + local orig = f_orig:read("*all") + f_orig:close() + copy = orig ~= new + end + print("copy required:",copy) + if copy then + f_orig = io.open(filename,"w") + assert(f_orig) + f_orig:write(new) + f_orig:close() + end + return true end if not make_config_h() then @@ -226,28 +248,28 @@ if os.is("windows") then -- TODO actually it's "is VC++" configuration { "DebugDLL", "DebugLib", "ReleaseDLL", "ReleaseLib" } defines { "NOMINMAX", "WIN32_LEAN_AND_MEAN" } + -- for VC only: + -- @todo perhaps set to 0 only in release mode? + defines { "_SECURE_SCL=0", "_HAS_ITERATOR_DEBUGGING=0" } end - configuration { "DebugDLL", "DebugLib" } + configuration { "DebugDLL" } + kind "SharedLib" defines { "_DEBUG" } flags { "Symbols" } - configuration { "ReleaseDLL", "ReleaseLib" } + configuration { "ReleaseDLL" } + kind "SharedLib" defines { "NDEBUG" } flags { "Optimize" } - -- dynamic targets: - configuration { "DebugDLL" } - kind "SharedLib" - defines { "_DEBUG", "_DLL" } - configuration { "ReleaseDLL" } - kind "SharedLib" - defines { "NDEBUG", "_DLL" } -- static targets: configuration { "DebugLib" } kind "SharedLib" defines { "_DEBUG" } + flags { "Symbols" } configuration { "ReleaseLib" } kind "SharedLib" defines { "NDEBUG" } + flags { "Optimize" } -- kind (solution/project/configuration): ConsoleApp, WindowedApp, SharedLib, StaticLib --[[project "base" @@ -278,17 +300,25 @@ require_package_incs( opt.require_package ) if opt.files then files(opt.files) end - + configuration "ReleaseDLL" targetname(YAKE_LIBFILE_PREFIX.. name.."_"..mapActionToCompilerName[_ACTION]) defines { "YAKE_" .. name:upper() .. "_EXPORTS" } require_package_links( "ReleaseDLL", opt.require_package ) - if os.is("windows") then links { "winmm" } end -- for timeGetTime + if os.is("windows") then + links { "winmm" } + end -- for timeGetTime + defines { "_DLL" } + configuration "DebugDLL" targetname(YAKE_LIBFILE_PREFIX.. name.."_"..mapActionToCompilerName[_ACTION].."_d") defines { "YAKE_" .. name:upper() .. "_EXPORTS" } require_package_links( "DebugDLL", opt.require_package ) - if os.is("windows") then links { "winmm" } end -- for timeGetTime + if os.is("windows") then + links { "winmm" } + end -- for timeGetTime + defines { "_DLL" } + configuration "ReleaseLib" targetname(YAKE_LIBFILE_PREFIX.. name.."_"..mapActionToCompilerName[_ACTION].."_s") require_package_links( "ReleaseLib", opt.require_package ) @@ -309,9 +339,12 @@ includedirs { ROOT_DIR .. "yake/" .. name .. "/**" } links { name } end -local function project_exe(name) +local function project_exe(name,opt) assert(name,"no name specified for project_lib") - project(name) + local opt = opt or {} + opt.require_package = opt.require_package or { "boost" } + + project("sample_"..name) location ( ROOT_DIR .. "build/" .. _ACTION ) targetdir ( ROOT_DIR .. "build/" .. _ACTION .. "/bin" ) language "C++" @@ -322,14 +355,16 @@ includedirs { ROOT_DIR } -- basic dependencies (boost) - require_package_incs { "boost" } + require_package_incs( opt.require_package ) + requires_lib "base" - requires_lib "base" - + -- configurations... configuration "DebugDLL" - targetname(name.."_d") + targetname("sample_"..name.."_d") + require_package_links( "DebugDLL", opt.require_package ) configuration "ReleaseDLL" - targetname(name) + targetname("sample_"..name) + require_package_links( "ReleaseDLL", opt.require_package ) end project_lib_basic( "base", { files = { ROOT_DIR .. "src/base/*.cpp", ROOT_DIR .. "src/base/math/*.cpp", ROOT_DIR .. "src/base/templates/*.cpp", @@ -351,11 +386,28 @@ project_lib("log", {require_package = {"boost"}}) requires_lib "base" +project_lib("property2", {require_package = {"boost"}}) + requires_lib "log" + +project_lib("graphics", {require_package = {"boost"}}) + requires_lib "base" + requires_lib "log" + +project_lib("audio", {require_package = {"boost"}}) + requires_lib "base" + requires_lib "log" + for k,v in pairs(_OPTIONS) do print("OPT",k,v) end if not _OPTIONS["without-demos"] then project_exe "log1" - requires_lib "base" - requires_lib "log" + requires_lib "base" + requires_lib "log" + project_exe "property1" + requires_lib "base" + requires_lib "log" + project_exe "property2" + requires_lib "log" + requires_lib "property2" end --[[ project "demo1" @@ -372,3 +424,4 @@ if _ACTION == "clean" then os.rmdir("build") end + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2009-10-08 23:04:29
|
Revision: 1991 http://yake.svn.sourceforge.net/yake/?rev=1991&view=rev Author: psyclonist Date: 2009-10-08 23:04:09 +0000 (Thu, 08 Oct 2009) Log Message: ----------- audio: updated project due to changes in yake.base audio: updated documentation Modified Paths: -------------- branches/yake2/yake/yake/audio/yakeAudioSystem.h Modified: branches/yake2/yake/yake/audio/yakeAudioSystem.h =================================================================== --- branches/yake2/yake/yake/audio/yakeAudioSystem.h 2009-10-08 23:01:03 UTC (rev 1990) +++ branches/yake2/yake/yake/audio/yakeAudioSystem.h 2009-10-08 23:04:09 UTC (rev 1991) @@ -30,14 +30,13 @@ #include <yake/audio/yakeAudioPrerequisites.h> #include <yake/base/yakeMovable.h> #include <yake/base/yakeString.h> -#include <yake/base/templates/yakeManager.h> #include <yake/base/templates/yakeRegistry.h> #include <yake/base/templates/yakePointer.h> namespace yake { namespace audio { - /** + /** Represents sound data (e.g. waveform). */ class YAKE_AUDIO_API ISoundData { @@ -121,7 +120,7 @@ typedef SharedPtr<IListener> ListenerPtr; /** Represents an environment in which an audio simulation takes place. - It also is responsible for creating and managing audio sources and listeners. + It also is responsible for managing audio sources and listeners. */ class YAKE_AUDIO_API IWorld { @@ -149,7 +148,7 @@ }; typedef SharedPtr<IWorld> WorldPtr; - /** Audio system interface. + /** Audio system interface to create audio environments (worlds). */ class YAKE_AUDIO_API IAudioSystem { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2009-10-08 23:01:10
|
Revision: 1990 http://yake.svn.sourceforge.net/yake/?rev=1990&view=rev Author: psyclonist Date: 2009-10-08 23:01:03 +0000 (Thu, 08 Oct 2009) Log Message: ----------- log: added missing windows specific include Modified Paths: -------------- branches/yake2/yake/src/log/log.cpp Modified: branches/yake2/yake/src/log/log.cpp =================================================================== --- branches/yake2/yake/src/log/log.cpp 2009-10-08 23:00:45 UTC (rev 1989) +++ branches/yake2/yake/src/log/log.cpp 2009-10-08 23:01:03 UTC (rev 1990) @@ -31,6 +31,10 @@ #include <boost/thread/locks.hpp> #include <yake/log/detail/native.h> +#if YAKE_PLATFORM == PLATFORM_WIN32 +# include <Windows.h> +#endif + namespace yake { namespace native { #if YAKE_PLATFORM == PLATFORM_WIN32 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2009-10-08 23:00:58
|
Revision: 1989 http://yake.svn.sourceforge.net/yake/?rev=1989&view=rev Author: psyclonist Date: 2009-10-08 23:00:45 +0000 (Thu, 08 Oct 2009) Log Message: ----------- updated project graphics due to changes in yake.base Modified Paths: -------------- branches/yake2/yake/yake/graphics/yakeGraphicalWorld.h branches/yake2/yake/yake/graphics/yakeGraphics.h branches/yake2/yake/yake/graphics/yakeGraphicsSystem.h branches/yake2/yake/yake/graphics/yakePCH.h Modified: branches/yake2/yake/yake/graphics/yakeGraphicalWorld.h =================================================================== --- branches/yake2/yake/yake/graphics/yakeGraphicalWorld.h 2009-10-08 22:10:45 UTC (rev 1988) +++ branches/yake2/yake/yake/graphics/yakeGraphicalWorld.h 2009-10-08 23:00:45 UTC (rev 1989) @@ -37,7 +37,6 @@ #include <yake/base/math/yakeColor.h> #include <yake/base/math/yakeRay.h> #include <yake/base/math/yakeMatrix4.h> -#include <yake/base/templates/yakeDeque.h> //============================================================================ // INTERFACE STRUCTURES / UTILITY CLASSES @@ -414,7 +413,6 @@ class IMeshGeometryAccess; - typedef Deque<String> StringVector; typedef std::map<String,String> StringMap; /** A graphics world. Modified: branches/yake2/yake/yake/graphics/yakeGraphics.h =================================================================== --- branches/yake2/yake/yake/graphics/yakeGraphics.h 2009-10-08 22:10:45 UTC (rev 1988) +++ branches/yake2/yake/yake/graphics/yakeGraphics.h 2009-10-08 23:00:45 UTC (rev 1989) @@ -27,7 +27,7 @@ #ifndef YAKE_GRAPHICS_H #define YAKE_GRAPHICS_H -#if defined( YAKE_GRAPHICSINTERFACE_EXPORTS ) +#if defined( YAKE_GRAPHICS_EXPORTS ) # define YAKE_GRAPHICS_INTERFACE_API YAKE_EXPORT_API #else # define YAKE_GRAPHICS_INTERFACE_API YAKE_IMPORT_API Modified: branches/yake2/yake/yake/graphics/yakeGraphicsSystem.h =================================================================== --- branches/yake2/yake/yake/graphics/yakeGraphicsSystem.h 2009-10-08 22:10:45 UTC (rev 1988) +++ branches/yake2/yake/yake/graphics/yakeGraphicsSystem.h 2009-10-08 23:00:45 UTC (rev 1989) @@ -74,7 +74,7 @@ struct YAKE_GRAPHICS_INTERFACE_API IGraphicsSystem //: public AbstractFactory< sequences::list< IWorld > > { - typedef AssocVector<String, String> ParamMap; + typedef std::map<String, String> ParamMap; YAKE_DECLARE_REGISTRY_1(IGraphicsSystem, String, ParamMap); Modified: branches/yake2/yake/yake/graphics/yakePCH.h =================================================================== --- branches/yake2/yake/yake/graphics/yakePCH.h 2009-10-08 22:10:45 UTC (rev 1988) +++ branches/yake2/yake/yake/graphics/yakePCH.h 2009-10-08 23:00:45 UTC (rev 1989) @@ -31,4 +31,4 @@ #include <iostream> // Yake #include <yake/base/yake.h> -#include <yake/base/yakeLog.h> +#include <yake/log/log.h> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2009-10-08 22:10:52
|
Revision: 1988 http://yake.svn.sourceforge.net/yake/?rev=1988&view=rev Author: psyclonist Date: 2009-10-08 22:10:45 +0000 (Thu, 08 Oct 2009) Log Message: ----------- avoid compiler warning due to cast Modified Paths: -------------- branches/yake2/yake/src/base/math/yakeRay.cpp Modified: branches/yake2/yake/src/base/math/yakeRay.cpp =================================================================== --- branches/yake2/yake/src/base/math/yakeRay.cpp 2009-10-08 22:09:38 UTC (rev 1987) +++ branches/yake2/yake/src/base/math/yakeRay.cpp 2009-10-08 22:10:45 UTC (rev 1988) @@ -35,7 +35,7 @@ { const real denom = plane.normal.dotProduct(ray.direction()); if (Math::Abs(denom) < std::numeric_limits<real>::epsilon()) - return std::make_pair(false,0.); + return std::make_pair(false,real(0.)); const real nom = plane.normal.dotProduct(ray.origin().asVector()) + plane.d; const real t = - (nom / denom); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |