Thomas Geymayer [Sat, 20 Jul 2013 13:45:02 +0000 (15:45 +0200)]
Canvas: Ensure all element types are initialized before first usage.
If setting properties on a group a check is performed if
this property exists on any possible child element, and
only if this is the case the property is stored in the
groups style.
Previously elements have been only initialized during
their first usage, leading to ignored styles if they
have been set on a parent element before instantiating
an instance of the actual element type.
Thomas Geymayer [Thu, 4 Jul 2013 12:11:54 +0000 (14:11 +0200)]
Canvas: Fix removing text elements.
Removing text elements failed due to prefering removing the
style property with the same name. Add a flag to each style
indicating whether it can be inherited. The text property
is only applicable to text elements and can not be inherited.
Now groups can not have a text property, avoiding the name
clash with the text element.
James Turner [Sat, 22 Jun 2013 10:59:42 +0000 (11:59 +0100)]
Fix pick callbacks on scenery.
Ensure pick callbacks work over the whole pick group, otherwise
the visible render group is hit first, and resolves to the ground
pick callback instead.
James Turner [Wed, 19 Jun 2013 22:58:57 +0000 (23:58 +0100)]
Windows SGPath::desktop() impl
Basic SHGetSpecialFolderPath wrapper, with dynamic
finding of the function since linking to shell32.dll
is painful. Obviously could be generalised to other
CSIDLs in the future.
Thomas Geymayer [Sat, 8 Jun 2013 09:28:49 +0000 (11:28 +0200)]
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.
Thomas Geymayer [Mon, 3 Jun 2013 21:39:11 +0000 (23:39 +0200)]
Canvas: clear event listeners on destroy
Removing all event listeneres on destroying a canvas
prevents circular references due to Nasal event listeners
keeping a reference to the canvas in their closure.
Also fix event handling with direct children of the root
group and add some more helpers to the Canvas.
Thomas Geymayer [Sun, 28 Apr 2013 21:46:21 +0000 (23:46 +0200)]
Extend locked-track animation to support a slave element.
This allows tracking elements while at the same time changing the
rotation of both animated elements to fill the available distance
to the target element. This allows for example animating gear
scissors or other connected objects like gear doors and their
actuators/arms (possibly connected to the gear strut).
Thomas Geymayer [Fri, 19 Apr 2013 22:22:37 +0000 (00:22 +0200)]
Canvas: rework style setter system.
Style setters are now only setup once for each element type and
not for each element instance as before. A static map holds the
setters for each element type. Also an animation type is stored
which will later allow to animate properties of Canvas elements
without specifying and animation type.
James Turner [Sat, 13 Apr 2013 13:40:55 +0000 (14:40 +0100)]
Restructure to avoid ordering issues.
Create a pick group for each object, instead of a single one. This
can be optimised in the future but this structure is backwards-
compatible with existing usage, which is more important.
James Turner [Fri, 5 Apr 2013 08:13:58 +0000 (09:13 +0100)]
Support for proxy pick objects.
Pick, knob and slider animations support additional object-names,
which are always invisible and untransformed (in the case of knobs/
sliders). These objects act to extend the hover/pick area, making small
switches and knobs more usable. (Especially for users with smaller
screens / windows).