Commit Graph
215 Commits
Author SHA1 Message Date
Erik Hofman 1f23fb89c0 Remove the dependency on boost for STANDALONE mode 2015-12-24 14:18:53 +01:00
Torsten Dreyer e64902ae8c Amend previous patch also for PropertyObject<string> 2015-05-28 12:03:48 +02:00
Torsten Dreyer 0b1399479a PropertyObject: enable creation of property
add a create-flag to the node() method of a PropertyObject,
defaulting to false to maintain existing behaviour.
This could be used to add a listener to a non-existing property
without having to write a dummy-value beforehand.

Usage:
myPropertyObject->node() returns the corresponding node or NULL if
does not exist or has not been accessed before.
myPropertyObject->node(true) returns the corresponding node, never NULL.
If the property does not exist, it will gets created.
2015-05-27 20:18:22 +02:00
Thomas Geymayer 3bcd0bafd5 Lots of (mostly) doxygen fixes/cleanup. 2014-08-01 00:13:25 +02:00
Thomas Geymayer f41b18f064 Improve (mostly Canvas event related) documentation. 2014-07-29 23:57:59 +02:00
Thomas Geymayer cb796e374a SGPropertyNode: add InterpolationMgr getter. 2014-07-12 01:07:28 +02:00
Thomas Geymayer 7c3491c679 Don't restore old canvasses on reset.
No need for this anymore as PRESERVE now works as expected.
Otherwise old canvasses are restored and do not work anymore
as the placements of the new canvasses do not apply.
2014-07-11 19:07:53 +02:00
Thomas Geymayer 6200b160ec canvas::Element: fix cleanup (and hopefully crash) 2014-07-01 12:09:55 +02:00
Thomas Geymayer 645cae184b SGConditionRef typedef. No functional changes. 2014-06-22 15:35:31 +02:00
Thomas Geymayer 820a315cbe Canvas: fix possible crash with destroyed canvasses 2014-06-01 12:12:28 +02:00
Thomas Geymayer b36cdebe8b Canvas: basic layouting system.
Support for vertical and horizontal layouts. More layouts and
widgets can be created using Nasal.
2014-05-31 02:40:59 +02:00
Thomas Geymayer 6db07373ee PropertyBasedElement: extend HTML5 (Canvas) data props interface
Allow check if property exists and removing properties.
2014-05-29 01:22:35 +02:00
Thomas Geymayer d77ba7d2db canvas::Element: setter/getter for HTML5 style data-* properties. 2014-05-28 18:11:32 +02:00
Thomas Geymayer efbec8b367 Canvas: base Elements/Canvas on SGWeakReferenced. 2014-05-06 18:10:42 +02:00
James Turner f40efe66fa Simplify copyProperties
- with initial-state save/restore gone, all uses of
copyProperties are now simple. For selective copying, use
copyPropertiesWithAttribute.
2014-03-11 08:32:33 +00:00
Thomas Geymayer 5560479665 SGPropertyNode: do not keep list of deleted children.
Get rid of the possibilty to keep delted children. This was not
used actively, required unnecessary memory for each property node
and lead to subtile bugs, as creating a node after a node with
the same path has been deleted resulted in getting the old node
back instead of a cleanly initialized one.
2014-03-06 00:39:23 +01:00
Thomas Geymayer 6b9ce935cd Write back additional attributes to PropertyList 2014-02-13 18:27:34 +01:00
Thomas Geymayer 781682f4ee Minor formatting... 2014-02-08 19:15:46 +01:00
Thomas Geymayer 13ae2f08ee Put unused attributes in the property tree while parsing.
Store unhandled xml attributes in a subnode named _attr_ for each
node on parsing propertylist files. This allows retrieving them at
a later stage where there is no access to the source xml file any
more.
2014-02-08 19:12:17 +01:00
James Turner d1942da317 Remove some debug log messages
- two uninformative ones in TextureBuilder
- very noisy one in tied-property-list
2014-01-23 13:51:18 +00:00
James Turner 16fa4d1d17 Security: fix 0777 directory permissions to 0755. 2013-12-19 14:56:23 +00:00
James Turner 890cc46825 Reset: alternate property copying strategy.
Search the tree for leaves / sub-trees with a particular attribute set.
This permits both sparse selection as well as selection by sub-tree.

(This is needed for PRESERVE attribute, and once new reset is switched
on, will enable 'normal' copyProperties to revert to ignoring
attributes completely)
2013-12-10 17:37:37 +00:00
Thomas Geymayer 42b50bd7f7 SGPropertyNode: add removeAllChildren() method 2013-12-07 13:42:15 +01:00
Thomas Geymayer 2c3f44ae11 Canvas: ensure all canvasses are destroyed
- For shutdown/reset make sure all properties describing a canvas
   are removed and also not restored after the reset.
2013-12-07 13:40:22 +01:00
James Turner 3ec9c7ae6e Canvas: clear elements in shutdown()
- without this change, elements aren't un-ref-ed and hence destroyed
until the actual dtor runs, which is too late (other systems may be
destroyed already)
2013-12-06 18:14:48 +00:00
bcoconni 8e01acaa12 Added more explicit error messages to the property lists parser.
More specifically, each time an error or a warning is issued the location of the corresponding XML tag (file name an line number) is reported.
2013-11-24 12:20:26 +01:00
Thomas Geymayer 353b7e4438 SGPropertyNode: extract enum value with getValue 2013-11-03 20:11:06 +01:00
James Turner ea49a1a07b Fix GPS activation on Windows.
Bug 1190, fix route-manager -> GPS activation on Windows
(and probably a couple of unrelated issues).
SGPropertyChangeCallback was missing a suitable copy-constructor,
leading to incorrect behaviour on compilers where the operation
is not elided. Such as MSVC.
2013-10-22 00:42:31 +01:00
Thomas Geymayer 0b197501e1 Add SGPropertyNode::setValueReadOnly.
Helper to set value of relative node and mark
read only. Use eg. for exposing configuration
and build values to the property tree.
2013-10-20 12:03:41 +02:00
Tom Paoletti 15e3e92ec2 Performance optimization: empty() instead of size()>0
empty() is guaranteed to be constant complexity for both vectors and lists, while size() has linear complexity for lists.
2013-08-16 16:48:35 +01:00
Thomas Geymayer 948db69cc9 interpolate without values is used to abort interpolating -> no warning 2013-07-04 19:46:27 +02:00
James Turner e5bca74b9d std::string namespace fixes. 2013-06-27 10:14:08 +01:00
Thomas Geymayer 9bfa6ac1a1 Restructure Canvas/PropertyBasedElement
Nodes inside the osg scenegraph now hold a strong reference to
the according canvas element. Canvas elements in turn now only
hold a weak reference to the according node. This simplifies
for example the canvas::Group as it does not need to keep a
list of children on its own anymore. This is now stored inside
the scenegraph (as it was already before).

The restructuring will also allow to use a canvas::Group for
the canvas gui inside FlightGear and share for example the
handling of stacking based on z-index.
2013-06-08 11:28:49 +02:00
Thomas Geymayer 2a6c50c893 More helper methods for Canvas and PropertyBasedElement. 2013-06-02 21:19:37 +02:00
Thomas Geymayer 2fe9ad595f Canvas: bug fixing and add some helpers. 2013-05-31 19:07:55 +02:00
Thomas Geymayer e53c71543a Move and rework pow to math/SGMisc 2013-04-28 15:43:02 +02:00
Thomas Geymayer 5c5e2a0f2f Remove debug output (and shorten test names) 2013-04-26 00:13:35 +02:00
Thomas Geymayer 9e9cc7859c Interpolation system tweaking and add helpers to SGPropertyNode to interpolate its value 2013-03-17 23:48:01 +01:00
Thomas Geymayer 8898f5fe52 Tweak interpolator and allow passing list of interpolation steps 2013-03-16 16:36:20 +01:00
Thomas Geymayer 40be69ae8e Remove unecessary dependency from libSimGearCore on libSimGearScene. 2013-03-16 12:19:23 +01:00
Thomas Geymayer 17eec81071 Fix headless build 2013-03-16 10:35:30 +01:00
Thomas Geymayer c9bbbd18ec New interpolation/animation system.
Inspired by jQuery.animate() properties can be interpolated using
different easing functions and specifying an animation duration.
Additionally animations can be chained to get table-based
animations like with the current SGInterpolator, or also create
looped animations or other more complicated curves.

Currently this system is not used yet, but it is intended to
replace SGInterpolator and allow more advanced animations of
eg. also colors, for example, for the canvas.
2013-03-15 23:37:17 +01:00
Thomas Geymayer e08eda18d5 CMake: Create list of libs for testing only once 2013-03-15 23:21:38 +01:00
James Turner 1a5467aec8 Collect properties from expression/condition trees.
Initial ground-work to support efficient updating of condition/expression results; allow collecting all the dependent property values from the hierarchy, so they can be observed. Also add a very small test-case for this.
2013-03-11 16:53:52 +00:00
Thomas Geymayer 79ae0da927 Fix some warnings 2013-03-07 00:17:45 +01:00
James Turner cf4af2692b Fix property tests static linkage. 2013-02-07 17:51:42 +00:00
Thomas Geymayer 4bef2c48eb Remove debug output 2013-02-07 10:10:38 +01:00
Thomas Geymayer 21e2a769eb Fix PropertyObject bug and interface improvements.
- Fix overwriting of parent node if PropertyObject::node() is
   called for a non-existing node.
 - Prevent implicit conversion from const char* and
   SGPropertyNode*
2013-02-07 01:25:55 +01:00
Thomas Geymayer 50688e1159 Rename simgear::Rect to SGRect and make interface more similar to SGBox 2012-12-13 23:37:21 +01:00
Thomas Geymayer 8417fea3bf Overload Rect::contains and add compound assignment operators to PropertyObject 2012-12-13 00:30:11 +01:00