GLG 3.0 Release: New Features and Enhancements

Overview
New Look and Feel of the Graphics Builder
New Tag Interface
Panning by Dragging the Drawing or Map with the Mouse
New Options for Creating Widgets and SubDrawings with Different Resize Policies
Setting Coordinate System on Per-Object Basis
Fixed Size Icons
New GIS Editing Mode
Positioning Objects in GIS Lat/Lon Coordinates
Persistent GIS Zoom Mode and New GIS Pan Options
New Line Fill Attribute and Line Width Gradient
Elliptical Gradient
Independent X and Y Panning and Custom Scrollbars
String Concatenation Transformation
Viewport Gradients
Alternative Behavior for Sliders and Knobs
Referenced Fonttable
New Widgets
Miscellaneous New Features
Miscellaneous Graphics Builder Interface Improvements
Performance Improvements and Bug Fixes

Overview

The major features of the new release are related to the GLG Graphics Builder look and feel and interface improvements, enhanced tag data access interface, new GIS capabilities, gradient rendering, control over the resize policy and coordinate system, as well as many other new features.

New Look and Feel of the Graphics Builder

New Graphics Builder Look And Feel The new GLG Graphics Builder uses highlighting icons, gradients, dimming and shading to provide cleaner and sharper visual appearance, as shown in the picture on the right.

New icons for common object transforming actions, such as flipping, rotation and scaling, were added to the control panel on the left of the drawing area.

The Data, History, Aliases and Xform indicators in the status panel at the bottom of the Builder were replaced with buttons that allow  direct access to the corresponding object properties.

New Tag Interface

The new tag interface introduces additional tag properties to facilitate the process of remapping tags defined in the drawing to the fields of the process database or PLC at run time.

Previously, a tag had only one attribute that defined a tag source, while the new release introduced a Tag Name attribute in addition to the Tag Source. A persistent Tag Name makes it possible to uniquely identify the tag even after its Tag Source has been changed by assigning a database variable to it. An additional Tag Comment attribute has also been added for storing user comments and any axillary information.

All tag properties are now stored in a tag object, which has to be explicitly created and attached to a resource object. In the Graphics Builder, a new dialog is provided to display and edit all tag object properties.

The Tag Browser interface has been changed to display both the Tag Name and Tag Source attributes of each tag. New toggles have been added to the Tag Browser to browse tags by either Tag Name or Tag Source.

The Tag Import/Export features have been extended to export TagName/TagSource pairs, which allows for more precise handling of tags with the same tag sources.

The String Import/Export features have also been extended to export string Name/Value pairs, which allows the application to use different translations for similar strings used in different places in the drawing.

Compatibility Note: The Tag attribute has been changed to TagSource. The name "Tag" is still supported for backward compatibility and mapped to the TagSource.

Panning by Dragging the Drawing or Map with the Mouse

Panning the drawing by dragging it with the mouse is now possible by using the Ctrl-drag binding. It is supported both in the Graphics Builder when editing a drawing, as well as at run-time (if enabled by the viewport's ZoomEnabled attribute). In the GIS Zoom Mode, the feature may be used to drag the map with the mouse.

A programmatic interface to start dragging under the control of the application, when certain conditions are met, is also provided via the GlgSetZoom() method.

New Options for Creating Widgets and SubDrawings with Different Resize Policies

New options for creating drawings with different resize policies were added to the Graphics Builder. The New Widget option creates a widget with a drawing surface that uses world coordinates and stretches when the widget is resized. This resizing behavior is commonly used by process control and monitoring applications which still want to display the whole drawing with a bigger or smaller magnification when a widget is resized.

The New Widget (No Stretch/Resize) option creates a widget with the drawing area that uses screen coordinates and does not stretch when the widget is resized. When the widget's window is resized, it shows a bigger or smaller portion of the drawing area, which is the default behavior of many GUI and image-editing tools. The non-resizable drawings may still be zoomed in or out.

These convenient options may be used without learning the advanced attributes of a viewport, as it was the case in the previous releases. The coordinate system of the Builder's Drawing Area is also adjusted to match a widget's resize policy. This allows the user to define a precise screen size in pixels for widgets with the No Stretch resize policy. The Set Width and Set Height options of the Layout Toolbox may be used for setting the widget's width and height in pixels.

Two new options for creating subdrawings are also introduced. The New SubDrawing option is used to create resizable subdrawings for widgets with the Stretch resize policy. The New SubDrawing (No Stretch/Resize) option may be used to create subdrawings for widgets with the No Stretch resize policy or to create fixed size subdrawings. These options set the coordinate system of the Builder' Drawing Area to an appropriate value for the selected subdrawing creation mode. The coordinate system setting is saved with the subdrawing's drawing and is restored when it is loaded in the Builder.

In a program, the resize policy of the viewport's drawing area may be controlled by the CoordSystem attribute of the viewport's screen.

Setting Coordinate System on Per-Object Basis

This feature allows mixing world and screen coordinate systems in the GLG drawing by setting an object's CoordFlag attribute. The available coordinate systems include the GLG-standard world coordinate system, as well as two screen coordinate systems.

The screen coordinate systems define coordinates in screen pixels relatively to a drawing area's upper left corner. Screen coordinates may be used to specify an absolute object position on the screen which does not change when the drawing is zoomed or resized. This provides a convenient mechanism for positioning text message overlays by specifying a fixed offset from the edge of the drawing.

There are two screen coordinate systems that differ in the direction of the Y axis.

Fixed Size Icons

Support for fixed size icons that do not change their size when the drawing is zoomed or resized has been added to the Toolkit via the FixedSize attribute of the reference and container objects. Fixed size icons use the screen coordinate system for rendering their graphics, while providing a user-friendly editing interface that transparently  handles all complexities of the coordinate system settings.

The fixed size icons automatically maintain their pixel size and X/Y ratio when the drawing is zoomed or resized, while they may still be independently scaled under the program control to increase or decrease the icons' size.

The GIS and AirTraffic Control demos have been updated to use fixed-size airplane icons. The updated Map demo uses the fixed size icons to automatically maintain the icon's X/Y ratio when the drawing is resized, with no source code required. These demos provide examples of using fixed size icons in an application.

New GIS Editing Mode

A new GIS Editing Mode has been added to the Graphics Builder, allowing the user to draw polygons and place dynamic icons on top of the GIS map using the GIS lat/lon coordinates directly. In the GIS Editing mode, the user simply draws GLG objects with the mouse, and the Builder positions them on the map, converting the screen coordinates of the mouse to the GIS lat/lon. The converted lat/lon coordinates are then stored as the coordinate values of the objects' points. The GIS Editing Mode transparently handles GIS projections, allowing the user to draw objects on the globe in the orthographic projection. To start the GIS Editing mode, the user goes down "into" the GIS object by selecting it and pressing the Hierarchy Down button.

Positioning Objects in GIS Lat/Lon Coordinates

With this new functionality, the GIS object now serves as a container object which holds icons, polygons and other objects drawn on top of the map. The GLG API may be used to add dynamic icons at run time and position them on the map by setting their lat/lon coordinates.

The coordinates of control points of objects added to the map as children of the GIS object are specified directly in lat/lon coordinates with no coordinate conversion required in previous releases. When the map is resized, zoomed or panned, the objects maintain their position on the map automatically. Specifying coordinates directly using lat/lon with no coordinate conversion greatly simplifies and reduces the amount of code for GIS applications.

The objects drawn on top of the map inside the GIS Object are automatically clipped to the GIS Object's boundaries, which eliminates a need for workarounds for wrap-around problems of the GDI driver in the previous releases. In the ORTHOGRAPHIC projection, the icons and lines drawn on top of the map inside the GIS Object are also clipped to the visible side of the globe, eliminating the objects located on the invisible back side.

Persistent GIS Zoom Mode and New GIS Pan Options

In the GIS Editing Mode, the Zoom and Pan controls of the Graphics Builder automatically switch to the GIS Zoom Mode, zooming and panning the map instead of the whole drawing. This allows the user to zoom and pan the map during editing, without the need to start the Run mode. The map may also be dragged with the mouse via the Ctrl-drag binding, both in the Edit mode and at run time if enabled by the viewport's ZoomEnabled attribute.

The GIS Zoom Mode may be permanently stored in the drawing by using the new "Set as parent viewport's GISObject" option of the Arrange menu. Once it is done, the viewport containing the GIS Object will always use the GIS Zoom Mode while being edited or prototyped.

Integrated pan scrollbars of the viewport can now be used in the GIS Zoom mode to pan the map. They are activated by the viewport's Pan attribute.

New Line Fill Attribute and Line Width GradientLine With Line Fill

A new EDGE_WITH_LINE_FILL fill type was added to polygons and all other objects that inherit polygon attributes, such as arcs or splines. When this fill type is used for lines with LineWidth greater than 3, the outline of the line is drawn using the EdgeColor, and the middle part of the line will be drawn using the FillColor, as shown in the first picture on the right.

A new Line Width gradient was added to facilitate easier rendering of fixed-width 3D pipes. In the earlier versions of the Toolkit, 3D pipes were rendered using filled polygons with gradient, which was tedious to create. In the new release, all segments of a 3D pipe may be rendered as a single polygon with FillType=EDGE and the Line Width gradient.

Line With Line Width

The Line Width gradient works with arrows, as shown in the second picture on the right.

Elliptical Gradient

An elliptical gradient is similar to the spherical gradient, but it also stretches with the object to create more realistic rendering. The spherical gradient did not change its shape when the object was stretched and always maintained a perfectly circular shape even when the object was stretched.

Independent X and Y Panning and Custom Scrollbars

Support for independent activation of the X and Y panning scrollbars was added to a viewport object. Previously, the X and Y scrollbars could be enabled or disabled only simultaneously.

Support for custom panning scrollbars has been added. It allows an application to use any GLG slider or scrollbar widget instead of the default native scrollbars for the integrated viewport scrolling. This is especially important for Qt and GTK integration where native scrollbars may not be available.

The use of the custom scrollbars is controlled by the GlgNativeScrollbars global configuration resource. If this resource is set to 1, custom GLG  scrollbars will be used. The GlgVScrollbarRef and GlgHScrollbarRef  global configuration resources may be used to provide the filenames of drawings that contain custom panning controls.

String Concatenation Transformation

A string concatenation transformation has been introduced to facilitate an easier creation of text labels that display several strings, where each string may be controlled by a separate resource. One such example is a text object used in GLG gauges to display a label, value and units in one object. Previously, such text label had to be assembled using nested format transformations. The string concatenation transformation simplifies the process of creating such labels.

Viewport Gradients

Support for rendering attributes has been extended to the viewport objects, making it easier to use gradients for the viewport's background. In the new release, the gradient may be used for the viewport's background using viewport's rendering attributes, the same way as for other objects. This yields proper rendering with no gaps regardless of how much the drawing is zoomed in or out.

Alternative Behavior for Sliders and Knobs

Support for the IncrementOnClick resource was added to the slider and knob interaction handlers to provide an alternative run-time behavior. If the resource is set to 0, the slider will move to the position of the mouse click, which was the only choice in previous versions.

Setting this resource to 1 changes behavior of the slider and knob controls. If the mouse click occurs outside of the slider's moving element, it is moved in the direction of the mouse click by the amount of the slider's increment resource, doing it repeatedly until either the mouse is released or the slider reaches the mouse location. The user can still move the slider or knob with the mouse by clicking on its moving element and dragging it with the mouse.

Support for the PageIncrement resource and PageIncrease/PageDecrease buttons and key bindings has been also added to the Slider and Knob interaction handlers.

All slider widgets have been changed to support SliderSize, StartPosition and EndPosition resources. The SliderSize resource controls the size of the slider's moving element, while the StartPosition and EndPosition resources control the extent of its movement. When these resources are modified, all other resources of the slider widgets get adjusted automatically.

Referenced Fonttable

A new FonttableFile viewport attribute may be used to specify a fonttable from an external file to be used for the drawing. A fonttable may be edited in the Builder, saved into a file and referenced by multiple drawings. The font changes applied to the fonttable will be reflected in all drawings that reference it. This feature enables applications to modify fonts used at run-time by simply changing a single external fonttable file using the GLG Graphics Builder.

The FonttableFile attribute may be edited in the Properties dialog of the viewport's Screen object.

New Widgets

The following new widgets were added to the Controls Widget Set:
An alarm bar widget was added to the Special Widgets palette.

Miscellaneous New Features

Support for string transformations was added to LabelString resource of native buttons as well as the TooltipString resource. The transformation may be used to provide a list of strings for the button's label or tooltip, so that they may be dynamically changed by selecting a desired string from the list depending on some condition.

Added support for the OnState resource for native push buttons to allow using them as toggles with changing labels.

Added support for handling MouseOverState for invisible objects to allow  making them visible on mouse-over via the MouseOverState resource.

Support for handling new line ('\n') and quoted strings was added to the GLG Script.

A new ZoomRectangle subaction was added for the ZoomTo action to allow the  program to change attributes of the ZoomTo dragging rectangle.

The "Empty history" message was disabled at run-time to allow setting Factors of the Series object to 0, which is useful for the graph widgets.

Miscellaneous Graphics Builder Interface Improvements

A new button for immediate editing of all objects in a group was added to the group properties dialog. The new button saves an extra mouse click by allowing the user to start editing a group of similar objects without selecting an object to define an attribute set for editing. The old option which allows selecting the set of attributes for editing is available as well. The Add/Delete buttons of the group dialog were reordered to the end of the group properties' list.

A new interface has been added to allow the user to mark and reuse text boxes, rendering attributes, light objects and font tables, as well as adding constrained copies of them to groups of objects.

A toggle was added to the Layout Toolbox to allow the user to apply the width, height and other settings to either all objects in a group or to the group itself.

A feedback indicator was added to the Select Anchor Object icon in the Layout Toolbox. The color of the icon changes to green when the layout anchor is defined.

The interface of browsing all resources of the drawing was changed to show resources of the viewport with the editing focus instead of the resources of the whole top-level drawing.

The new Builder makes a better use of spinners in the resource dialog, allowing the user to use them to set values of many additional resources such as Factors of the series, and other resources with integer values.

New buttons were added to the Scale, Rotate and some other transformation dialogs to set the Center attribute to the center of the object, as well as to reset the Center to (0,0,0).

New logic has been added for detection of constraint loop problems. Constraint loops may be created in the Builder when the user constrains the Buffer attributes of two Transfer transformations. This condition is now checked and reported, which makes it easier to diagnose and correct.

In the new Builder, separate ZoomBy and ScaleBy factors are maintained for convenience. This allows the user to set factors for zoom and scale operations independently.

The GIS Object interface has been changed to regenerate the map when the object's Verbosity value was changed. This eliminates the need to reset the drawing to see the verbose output after changing the Verbosity value.

A new "Save Direct OpenGL Image" option for saving images was added to get around limitations of OpenGL drivers which may use a low-quality software-based OpenGL renderers when rendering into an off-screen pixmap. Instead of rendering into the off-screen pixmap, the new image saving option copies bits from the screen, preserving the quality of the hardware-accelerated OpenGL rendering in the generated image.

The move point display of non-resizable viewports has been fixed. The display of an inoperative move point for viewports with HandlerDisabled has been eliminated to avoid confusion.

Drawing area scrollbars are now disabled in the Run Mode to eliminate confusion.

The Save Image Full option for saving the image of the whole drawing (instead of just the visible part of it) was changed to automatically exclude the drawing's pan sliders from being rendered in the saved image.

The menus presenting choices of attribute values and transformations are now scrollable for greater convenience.

When widgets are added to the drawing from a palette, they are now inserted at the center of the visible portion of the drawing instead of the origin of the coordinate system, which may be scrolled out.

The Hierarchy Down operation for series and reference objects in a non-resizable drawing was improved by placing the origin of the coordinate system in the center of the drawing for more convenient editing of their templates.

The initial grid size is now automatically adjusted when a new widget is created depending on the type of the widget's coordinate system.

The display of the buffer attribute of the transfer transformation was improved to show the updated buffer value when the UseValue attribute changes.

Performance Improvements and Bug Fixes

Clipping performance for objects that are completely clipped out was improved to speed up rendering of drawings with huge zoom factors.

A more detailed error message is now provided for SetResource methods to facilitate debugging. The new error message provides a complete resource path and differentiates between default attribute names and named resources.

OpenGL Renderer: Detection of the GLXBadDrawable X error message was added on Linux systems, with a message that describes possible remedies.

OpenGL Renderer: A check for the GLX BadMatch error was added to catch a depth mismatch between the default visual and the supported OpenGL visuals. If a depth mismatch is detected, GLG switches to the GDI renderer and generates a warning message describing possible remedies.

A coordinate overflow at very high zoom factors in the GDI renderer was eliminated for objects that were completely clipped out. The OpenGL renderer (which uses double coordinate values) presents an even better solution.

The zoom limit check that prevented coordinate overflow was eliminated for the OpenGL renderer.

The widget's minimum width/height in Qt integration was set to a default  value different from 0 to avoid problems with some layout managers.

The value of the Z coordinate of the points outside of the visible part of the globe, returned as a result of the GlgGISConvert() method, was changed from -1.0 to the GLG_GIS_OUTSIDE_VALUE defined constant equal -2000., to be consistent with the default extent of the GLG coordinate  system.

OpenGL Renderer: Line caps were fixed for lines with even line width.

OpenGL Renderer: Rendering of line arrows was fixed for ARROW FILL & EDGE, and rendering of arrows with FILL arrow style was improved by using anti-aliasing.

Arrow rendering was improved by making the arrow ends always round, even for lines with an even line width.

process_subobjects parameter was added to the GlgLayoutObjects() method to control the method's behavior for groups. If the parameter is set to True, the layout action is applied to all elements of the group. If the parameter is set to False, the method applies the action (such as SET_WIDTH) to the group itself.

Due to the new tag object interface, the GlgHasTagObject method was replaced with the GlgHasTagName and GlgHasTagSource methods. The by_name parameter has been added to the GlgGetTagObject method to allow to query a tag object by either its TagName or TagSource.

Windows ActiveX Control: The UpdateGlg method has been added to avoid using the Update method that conflicts with OLE interfaces in the new versions of the VisualStudio.NET. The new GetGlgMajorVersion and GetGlgMinorVersion methods provide GLG version information.

Windows ActiveX Control: Persistence of the UseOpenGL and UseMapServer properties on saving the ActiveX control was fixed.