This book provides information about programming with GLG and using different GLG Run-Time environments, including C/C++, Java and ActiveX control.
The first section of this manual describes the C API, while the rest of the book describes the C++, Java and ActiveX control versions.
Although various programming environments such as C, C++, Java, ActiveX, use different syntax to invoke the GLG API, the semantics of the API methods is the same in either environment. The C programming section provides the most detailed description of each method in terms of its effect on the underlying GLG objects. It also provides more examples and may be used as a reference for C, C++, Java and ActiveX programmers.
The book contains the following chapters:
GLG Programming Reference Manual
Using the C/C++ version of the Toolkit
How to render a GLG drawing from an application program.
Details of using GLG Standard API for C and C++
A general overview of the process of programming with the GLG Toolkit.
Animating a GLG Drawing Using the Standard API
Now that the drawing has been rendered, a description of how to animate the drawing with the function library supplied with the GLG Toolkit.
Handling Input Events
A description of the ways in which a GLG drawing can be used to get input from an application program user.
The GLG Extended API
How to modify a drawing from an application program.
C/C++ Graph Layout Component
How to modify a drawing from an application program.
GLG C++ Bindings
A description of GLG C++ Bindings and GLG MFC class.
GLG Programming Tools and Utilities
Descriptions of the utility tools that come with the GLG Toolkit.
Using the ActiveX Control
A description of the Glg ActiveX control that allows GLG drawings to be used with OLE-compliant Microsoft Windows applications or in IE.
Using the Java version of the GLG Toolkit
A description of the Java version of the Glg Run-Time environment.
Appendix A: Global Configuration Resources
A list of global configuration resources.
Appendix B: Message Object Resources
A table of the GLG event types and their message object resources.
Appendix C: GLG Object's Attribute Table
A list of the default attribute names for all object types.
This guide assumes that you are conversant with the basic concepts of computer graphics programming. For a comprehensive discussion of three dimensional computer graphics, we recommend Computer Graphics: Principles and Practice , Foley, Van Dam, Feiner, and Hughes. Second edition, 1990; Addison-Wesley, Reading MA.
Please note that although the illustrations in this document represent the UNIX version of the GLG Graphics Builder, the information it contains is equally relevant to MS Windows users. The two versions present the same functionality in equivalent user interfaces, with minimal, cosmetic differences caused by the different platforms.
X Windows and Wrapper Widget 17
Creating the Wrapper Widget 18
Obtaining a Viewport Handle 23
Microsoft Windows and GLG Custom Control 24
Creating the GLG Custom Control 25
Obtaining a Viewport Handle 26
Generic Program Entry Point 29
Loading and Displaying a Glg Drawing using Generic API 29
GLG Generic API Function Descriptions 30
1.2 Details of using GLG Standard API for C and C++ 41
Utilities 44
Linking with the GLG Libraries 45
1.3 Animating a GLG Drawing Using the Standard API 49
Overview 49
Communicating from a Client Process 77
Using Inter-Process Communication with the Standard API 78
Connecting to the GLG Graphics Builder 79
Communication Function Descriptions 79
Programming Examples of Inter-Client Communication 81
Writing a Custom Data Generator for Prototyping 84
Attaching Callbacks to a Viewport Object 87
Adding Callbacks to a GLG Wrapper Widget 88
Examples 94
Printing Selected Object Names using Selection Callback 94
Printing Selected Object Names using Input Callback 94
Processing Input Object Messages 96
Refining Input Object Selection 97
Overview 99
Get and Set Resource Function Extension 152
Automatic Referencing and Dereferencing 156
Using Input and Selection Callbacks 157
Miscellaneous Utility Classes 157
C++ API Files and Libraries 158
List of Classes and Methods in the GLG C++ Bindings 158
Overview 173
GLG ActiveX Control Properties 174
Dynamic Resource String Syntax 177
GLG ActiveX Control Events 178
ActiveX Control Extended API Methods 185
Introduction 195
Interfaces 198
GlgBean class 200
GlgJBean class 200
GlgJLWBean class 200
GlgObject class 214
Using datagen to Prototype Drawings in the Builder 250
Using datagen in Stand-Alone mode 250
Overview 255
Database Record Support Commands 257
4.5 C/C++ Graph Layout Component 269
Overview 269
Appendices 281
Generic Resources of the Message Object 285
Specific Resources of the Message Object 286
Clock and Stopwatch Message Object 293
Font Browser Message Object 294
Custom Event Message Object 297
Generic Attributes of Drawable objects 301
Rendering Object Attributes 302
Box Attributes Object Attributes 302
Group and List Objects' Attributes 304
Connector Object Attributes 304
Reference Object Attributes 304
Square Series Object Attributes 305
Colortable Object Attributes 308
Font Table Object Attributes 308
Transformation Object Attributes 309