GLG 3.7 Release: New Features and
Enhancements
Overview
The new 3.7 release of the GLG Toolkit contains a number of new
features, including:
- Simplified creation of multi-segment 3D pipe objects.
- Simplified editing of predefined widgets via public
properties.
- New Real-Time Chart types and support for vertical time lines.
- Support for extended rendering attributes in a real-time chart
that makes it possible to supply color, marker size and other
rendering attributes for individual data samples.
- Integrated support for Double-Click events, such as executing
an action when the user double-clicks on an object.
- Support for anti-aliased fonts on Linux for smoother text
rendering and easier locale-independent font specification.
- New GLG API methods for traversing objects in the drawing and
finding objects that match specified criteria.
- Installable Interaction Handler Utilities for handling complex
user interfaces.
- New Map Server feature to clip map layer rendering to a
specified lat/lon region.
- Many other new features, improvements and bug fixes.
Widget Palette
Icons for Creating Multi-Segment Pipes and Lines
The new feature extends functionality of Widget Palettes by allowing
the user to create multi-segment pipes and lines by defining
multiple points in the drawing, similar to the way polygons are
created.
The new feature allows creating multi-segment 3D pipes and
process-control lines with specific properties from predefined
templates displayed as icons in the Widget Palette. The predefined
templates may include animated flow lines and dynamic data-driven
parameters. The new feature also supports constraining pipe points
to other points in the drawing at the creation time.
Widget Public Properties
Public properties were added to all GLG Widgets to simplify basic
editing of the widget properties. The Public Properties button can be used to display
all public properties of a widget in a single dialog.
Previously, widget properties were accessible only via the Resource Browser.
A resource named "IsWidget"
was also added to all widgets. The presence of this resource can be
used to identify a widget in a program using the GLG API.
New Real-Time Chart
Features
Real-Time Bar Charts
Several types of bar charts are now supported
by the real-time chart object. The PlotType attribute of a chart's plot can be set to
either BAR or FLOATING BAR to render data
samples as bars. A BAR
plot displays bars that start at the bottom of the chart. A FLOATING BAR plot starts at the
level defined by the plot's BarYLow
attribute. If the plot's ExtendedData
attribute is set to YES,
each floating bar can start at a different level supplied by the BarYLow attribute.
Extended Data
Sample Attributes
A new feature was added to enable storing an extended set of
attributes for rendering each data sample, making it possible to
annotate bars and markers in a chart with different colors, marker
sizes or marker types.
By default, each data sample stores only a limited number of data
values, such as the sample value, time stamp, validity and marker
visibility. This minimizes memory consumption and optimizes update
performance for plots with large number of data samples. The rest of
the attributes, such as bar fill color, marker size and type, etc.,
are global per plot and are used to render all data samples using
current attribute values.
However, if a plot's ExtendedData
attribute is set to YES,
the plot keeps extended information for each data sample, including
color and line attributes for bars and markers, bar fill type,
marker type, etc. For FLOATING
BAR plots, the BarYLow
value is also stored, which can be used to render both High and Low ranges for each bar.
If ExtendedData=YES, the
marker and plot attributes listed above serve as entry points for
supplying attributes to draw each sample. This may be used to draw
markers and bars in different colors, and also to supply a different
BarYLow value for each
floating bar of a FLOATING BAR
plot. If attribute values are not supplied for some data samples,
the last supplied values will be used.
Time Lines
A time line object annotates a time stamp by drawing a vertical line
at a specified time value. There are two modes of operation that are
controlled by the value of the NumTimeLines
attribute of the chart.
If the attribute value is greater than or equal to zero, it controls
the number of persistent time lines in the chart. The chart
automatically adds or deletes time lines when the value of the
attribute is changed. Each time line is positioned by setting its
Level attribute to the time stamp of the event that needs to be
annotated.
If the attribute value is set to -1, the time lines can be added via
the GlgAddTimeLine API
method at run time. Added time lines are automatically deleted when
the data sample closest to the time line falls out from the history
buffer (due to the settings of the chart's BufferSize or BufferXSpan
attribute). The GlgDeleteTimeLine
method can also be used to delete individual time lines.
Dynamic AutoScaleDelta
If the plot's AutoScaleDelta
is set to a negative value, the absolute value of the attribute
defines the auto-scale adjustment as the fraction of the current
chart range.
Negative Filter
Precision
While a positive value of a plot's FilterPrecision attribute defines a filter
interval in pixels, a negative value may be used to specify a filter
interval in units of the X axis, i.e. in seconds for charts with a
time X axis. The absolute value of a negative FilterPrecision is used as the
filter interval in units of the X axis.
Support for the
Double-Click Event
Support for double-click was added to the action objects as well as
the trace callback. The DoubleClick
attribute of an action object can be used to differentiate between
single and double click events, and execute an action only on a
double click, a single click, or both.
The GlgGetModifierState
method can also be invoked in either the Trace or Input
callback with the GLG_DOUBLE_CLICK_MOD
parameter to query the state of the double-click modifier. The
method will return true if the callback was triggered by a
double-click event.
Support
for Anti-Aliased Fonts on Linux
Added support for anti-aliased fonts on Linux to improve appearance
of text objects in the GLG drawing when rendered using the C/C++
library. Previously, the anti-aliased text rendering was
available only in Java, C# and also in C/C+ on Windows, but not in
C/C++ on the Linux/Unix platforms.
The anti-aliased fonts use the XFT-based
font driver, which is used by both the GLG editors and the
C/C++ run-time library. The anti-aliased fonts are supported for
both X GDI and OpenGL drivers.
The new font driver also provides a better support for the UTF-8
locale on Linux by using Fontconfig
for defining font names. For example, the "Helvetica-12:bold" font name may be used for
displaying text in any language supported on the system, while the
old driver required to define a font set that contained a list of
fonts to handle encodings for each required language.
The older font driver that
uses the core (XLFD) X fonts is
still available. An
application can select the type of the font driver by using
either the GLG_XFT_FONTS
environment variable, a command-line option (-glg-enable-xft-fonts or -glg-disable-xft-fonts), or by
setting the GlgXftFonts
global configuration resource via the API at run time. Each
font object in a font table contains both the X Font Name and the XFT Font Name, which will be
used by the corresponding driver.
An application can also define the type of the font driver on a
per-font basis by setting the font's XFontType attribute. The XftFonts attribute of a viewport's screen object
can also be used to enable or disable XFT fonts for the viewport.
A new LocaleType attribute
was added to a viewport's screen object to facilitate cross-platform
handling of the UTF-8 and Latin1 locales on both Linux and Windows.
The -reset-utf8-locale-flag
and -set-locale-flag
command-line options were also added to the gconvert utility for
convenience of changing this attribute after the drawings were
created.
New Transformations
A pair of new D From G and
G From D transformations
allow the user to extract individual XYZ or RGB values from an XYZ
or color RGB triplet, as well as to form XYZ or RGB triplets from
individual double values.
The D From G
transformation extracts an X, Y or Z coordinate (or an R, G or B
color value) from a G data
object containing a triplet of XYZ or RGB values, and stores the
extracted value in a D
data object.
The G From D
transformation may be used to combine X, Y and Z coordinates (or R,
G and B color values) defined by separate D (double) data objects into a single G data object containing a
combined XYZ or RGB triplet. The transformation has three
attributes; each attribute supplies a coordinate or a component of
an RGB color. This transformation may be attached only to a G attribute. To achieve the
same result for a control point, MoveByX,
MoveByY and MoveByZ
transformations can be added to the control point to supply the X, Y
and Z coordinates from independent double data values.
The new transformations are used in the new Lat/Lon display indicators for
extracting the Lat and Lon values from a G data object that supplies Lon as X and Lat as Y coordinate.
PreciseSize Attribute
This new attribute controls resize behavior of a child viewport when
its size changes by a small amount. If the attribute is set to NO, it prevents the viewport
from resizing for changes in size less than one pixel. It improves
scrolling performance of drawings that contain multiple viewports,
such as the Builder's palettes. When a resizable drawing is
scrolled, the size of children viewports may fluctuate by a fraction
of a pixel due to the coordinate-to-pixel mapping, and the PresizeSize=NO setting prevents
excessive repaint events due to viewport resizing.
Tooltip Erase Distance
A new GlgTooltipEraseDistance
global configuration resource defines the maximum distance in pixels
the mouse can move without erasing the currently displayed tooltip,
which avoids erasing the tooltip on an accidental small mouse
movement. The resource can be changed from the default value (5) to
1 for precise selection of real-time chart tooltips.
Miscellaneous
GLG Editors' Interface Improvements
Force File Extensions
Option
A new Force File Extensions
option was added to all GLG editors. If enabled, it will add the ".g" extension to the filenames
that have no extension. The default setting can be configured
using the ForceFileExtensions
variable in the GLG configuration file.
Public Properties
Toolbar Icon
The Public Properties
toolbar icon is now enabled in all editors by default.
Separate Undo Menu
The Undo menu option now
appears as a separate top-level menu, which allows to keep the state
of the editing dialogs when performing an undo operation.
New GLG API
Methods and Features
New Methods
for Traversing and Finding Matching Objects
The new GlgFindMatchingObjects
method can be used to find all children or parents of a given object
that match selected criteria. This method can be used for finding TimeEntryPoint of a plot that
corresponds to the plot's ValueEntryPoint,
which makes it possible to supply value and time stamp pairs to a
plot using a single tag added to the plot's ValueEntryPoint. The GLG SimpleViewer demo demonstrates
this functionality.
The GlgTraverseObjects
method can be used to traverse object hierarchy of a given object.
Installable
Interaction Handler Utilities
A new set of Installable
Interface Handler Utilities assist an application developer
with implementing functionality of complex user interactions usually
encountered in editor-style applications. The utilities include a
collection of methods as part of the GLG Intermediate API library and are available for
the C/C++, Java and C#/.NET environments.
Installable Interface Handlers
provide a mechanism for handling user interaction where persistency
is necessary to handle interrelated sequences of user actions. The
interface handlers are hierarchical, allowing an application to
handle nested operations, such as nested dialogs or chained
operations. Internally, a stack is used to maintain a hierarchy of
handlers, making it possible to handle arbitrary nested sequences,
for example display a confirmation dialog based on the action of the
parent dialog (such as parent dialog closing).
Each handler maintains its own persistent data storage for
intermediate data, which is automatically cleaned up when the
handler is uninstalled. A variable number of dynamic parameters can
be supplied to each handler to modify its behavior as needed.
Interface handlers extend functionality of event handling callbacks
and listeners by providing event handlers that support persistency
and provide data storage for intermediate data that control user
interaction. An interface handler stays active to process all events
for a dialog or a page, until the handler is uninstalled when dialog
closes or a page is switched to display another page. The interface
handlers provide a flexible alternative to the Hierarchical State
Machines (HMS) that are often used to handle the state of the user
interface transitions. Unlike HMS, interface handlers allow a
developer to extend the handler functionality by adding handler
parameters and augment the handler source code based on the
parameter values passed to it, which could be easier than adding new
states to the state machine.
The GLG Diagram Demo was
rewritten to use these new methods. It provides examples of
implementing several design patterns for handling various types of
user interaction.
GlgXPrintDefaultError
Function for X Error Handling
A new GlgXPrintDefaultError function was added to the GLG C/C++ Standard API on Linux/Unix to
simplify error handling of the X Windows errors. Given an X error,
the function obtains extended error information and prints it into
the specified file. The output format is similar to the default X
error output format. The new function simplifies the task of
installing X error handlers, since the error handler can use this
function to log the error information into a file. The stdout file pointer can be used
to print error information to the console.
Examples of
Asynchronous Data Supply From a Data Thread
Additional example programs in the SimpleViewerThread directory provide sample
implementations of asynchronous data supply from a data thread
for C, C++, Java and C#. While existing SimpleViewer examples poll data on a timer, the
new examples may be used to implement event-driven data updates.
The C example demonstrates the use of the ZeroMQ library for passing
data from the data thread to the GUI. The rest of examples show an
alternative
method of exchanging data between the data and GUI threads using a
queue and thread locking for thread synchronization.
New Widgets
Several new Real-Time Bar Chart
widgets were added to the Real-Time
Charts widget palette: a Bar
chart,
a Floating Bar chart and
two High/Low Bar charts.
New Lat/Lon display indicators were
added to the Value
and State Display widget palette. They can be used to take
a latitude and longitude values supplied as a Decimal Degrees (DD)
and display them in the Degrees, Minutes and Seconds (DMS) form. The
indicators use a Java Script
transformation to convert Lat/Lon values from the DD notation to DMS.
New Map Server Features
Support for clipping layer output to a specified lat/lon box has
been added to the GLG Mar Server. The clip box can be defined in the
layer's LIF file. Clipping
is supported for both image and vector layers. Several clip
types are supported to allow clipping vector features while allowing
labels to extend outside of the clip box.
The Map Server's GetCapabilities
request was improved to comply with stricter XML parsing rules.
Bug Fixes
Fixed "Window is too big,
turning double buffering off" warning displayed when
widgets from the Object Palette
were added to a fixed-size drawing.
Disabled tooltips for disabled (not drawn) chart plots and excluded
disabled plots' data from the extent queries via the GlgGetDataExtent method.