GLG Toolkit, C / C++ API Library  Version 4.5
Native Widgets

Detailed Description

This group lists platform-specific widgets and controls that can be used to integrate GLG drawing in a native windowing environment on both Linux/Unix and Windows.

Alternatively, the GLG Generic API may be used to display GLG drawings in a platfom-independent way.

Structures and Classes

class  GlgControlC
 Windows only: A native MFC-based control used by legacy MFC applications. More...
 
class  GlgWrapperC
 Linux/Unix only: A C++ widget wrapper around the X11 and Motif-based GlgWrapper widget for legacy X11 applications. More...
 
class  GtkmmGlgWidget
 Linux only: A native GTKMM widget that can be used to in the GTKMM environment. More...
 
class  QGlgWidget
 A native Qt widget that can be used in the Qt environment on both Windows and Linux/Unix. More...
 

Functions

void QGlgInit (int argc, char **argv, QApplication *q_app)
 Used with QGlgWidget: Initializes GLG Toolkit in Qt environment using applicable command-line options. More...
 

Class Documentation

◆ GlgControlC

class GlgControlC

Windows only: A native MFC-based control used by legacy MFC applications.

The control allows embedding GLG drawings into the MFC interface hierarchy.

The control uses an MFC CWnd derived class that provides a window for displaying a GLG drawing in an MFC framework.

The files in the examples_mfc/Dashboard directory of the GLG installation on Windows present an example of using the GlgControlC class in an MFC application.

Include file: GlgClass.h

Inherits CWnd.

Public Attributes

GlgObjectC viewport
 An object ID of the associated GLG viewport object containing the control's drawing. More...
 

Public Member Functions

 GlgControlC (void)
 Default constructor: creates an empty control. More...
 
virtual ~GlgControlC (void)
 Destructor. More...
 
void Create (char *drawing_file, CWnd *parent, char *control_name="GlgControl", CRect *in_rect=NULL, int IDC_id=0)
 Creates a control’s window and loads a drawing from a file. More...
 
void Create (GlgObjectC &object, CWnd *parent, char *control_name="GlgControl", CRect *in_rect=NULL, int IDC_id=0)
 Creates a control's window and uses a "$Widget" viewport of another object as a drawing. More...
 
void Create (void *drawing_image, GlgLong image_size, CWnd *parent, char *control_name="GlgControl", CRect *in_rect=NULL, int IDC_id=0)
 Creates a control's window and loads a drawing from a generated memory image. More...
 
void DialogInitialDraw (GlgObjectC &parent)
 Displays a GLG drawing as a floating dialog for the first time after it has been created or loaded. More...
 
void DialogSetupHierarchy (GlgObjectC &parent)
 Provides an explicit request to set up the object hierarchy of a drawing displayed in a dialog window. More...
 
virtual void EnableCallback (GlgCallbackType callback_type, GlgObject callback_viewport=NULL)
 Enables the control's Input, Select, Trace and Hierarchy callbacks. More...
 
GlgObject GetViewport (void)
 Returns the top-level viewport containing the control's drawing. More...
 
virtual void HCallback ()
 An H callback used to get access to the drawing to be displayed in the control before its object hierarchy has been set up. More...
 
virtual void Hierarchy (GlgObjectC &callback_viewport, GlgHierarchyCBStruct *hierarchy_info)
 A Hierarchy callback used to get access to the drawing to be displayed in the SubWindow and SubDrawing objects before the drawing is displayed. More...
 
void InitialDraw ()
 Draw the control's graphics the first time, invokes the control's H and V callbacks. More...
 
virtual void Input (GlgObjectC &callback_viewport, GlgObjectC &message_object)
 An Input callback used to handle user interaction with input objects, as well as object selection and action processing. More...
 
void Print (CDC *pDC, DWORD dwFlags)
 A native Windows print method. More...
 
void ResetHierarchy ()
 Resets the object hierarchy of the control's drawing. More...
 
virtual void Select (GlgObjectC &callback_viewport, char **name_array)
 A simplified selection callback used to process object selection using object names. More...
 
void SetDrawing (char *filename)
 Loads a new control's drawing from a file, replacing a previously displayed drawing, if any. More...
 
void SetDrawing (GlgObjectC &object)
 Set a "$Widget" viewport of another object as a new drawing, replacing a previously displayed drawing, if any. More...
 
void SetDrawing (void *drawing_image, GlgLong image_size)
 Loads a new control's drawing from a memory image, replacing a previously displayed drawing, if any. More...
 
void SetupHierarchy ()
 Sets up hierarchy of the control's drawing. More...
 
virtual void Trace (GlgObjectC &callback_viewport, GlgTraceCBStruct *trace_info)
 A Trace callback used to handle native windowing events. More...
 
virtual void Trace2 (GlgObjectC &callback_viewport, GlgTraceCBStruct *trace_info)
 A Trace2 callback used to handle native windowing events. More...
 
GlgBoolean Update (void)
 Updates the graphics displayed in the control. More...
 
virtual void VCallback ()
 An V callback used to get access to the drawing to be displayed in the control after its object hierarchy has been set up. More...
 

Constructor & Destructor Documentation

◆ GlgControlC()

GlgControlC ( void  )

Default constructor: creates an empty control.

◆ ~GlgControlC()

virtual ~GlgControlC ( void  )
virtual

Destructor.

Destroys the window and dereferences the viewport object.

Member Function Documentation

◆ Create() [1/3]

void Create ( char *  drawing_file,
CWnd *  parent,
char *  control_name = "GlgControl",
CRect *  in_rect = NULL,
int  IDC_id = 0 
)

Creates a control’s window and loads a drawing from a file.

Parameters
drawing_fileThe drawing file name.
parentThe control's parent.
control_nameThe control's name.
in_rectIf non-NULL, specifies the control's area inside the parent.
IDC_idThe control's ID.

◆ Create() [2/3]

void Create ( GlgObjectC object,
CWnd *  parent,
char *  control_name = "GlgControl",
CRect *  in_rect = NULL,
int  IDC_id = 0 
)

Creates a control's window and uses a "$Widget" viewport of another object as a drawing.

Parameters
objectAn object containing the $Widget viewport.
parentThe control's parent.
control_nameThe control's name.
in_rectIf non-NULL, specifies the control's area inside the parent.
IDC_idThe control's ID.

◆ Create() [3/3]

void Create ( void *  drawing_image,
GlgLong  image_size,
CWnd *  parent,
char *  control_name = "GlgControl",
CRect *  in_rect = NULL,
int  IDC_id = 0 
)

Creates a control's window and loads a drawing from a generated memory image.

Parameters
drawing_imageSpecifies the address of the drawing image generated by the GLG Code Generation Utility gcodegen.
image_sizeSpecifies the image size. This is also generated by gcodegen.
parentThe control's parent.
control_nameThe control's name.
in_rectIf non-NULL, specifies the control's area inside the parent.
IDC_idThe control's ID.

◆ DialogInitialDraw()

void DialogInitialDraw ( GlgObjectC parent)

Displays a GLG drawing as a floating dialog for the first time after it has been created or loaded.

See GlgObjectC::DialogInitialDraw for more information.

Parameters
parentThe parent the dialog will be a child of.

◆ DialogSetupHierarchy()

void DialogSetupHierarchy ( GlgObjectC parent)

Provides an explicit request to set up the object hierarchy of a drawing displayed in a dialog window.

See GlgObjectC::DialogSetupHierarchy for more information.

Parameters
parentThe parent the dialog will be a child of.

◆ EnableCallback()

virtual void EnableCallback ( GlgCallbackType  callback_type,
GlgObject  callback_viewport = NULL 
)
virtual

Enables the control's Input, Select, Trace and Hierarchy callbacks.

Parameters
callback_typeSpecifies the type of a callback to be added:
callback_viewportIf not NULL, specifies the child viewport of the control to add the callbacks to. If NULL, the callbacks will be added to the top viewport of the control.

See GlgObjectC::EnableCallback for more information.

◆ GetViewport()

GlgObject GetViewport ( void  )

Returns the top-level viewport containing the control's drawing.

Returns
The viewport, or NULL if the viewport has not been assigned.

◆ HCallback()

virtual void HCallback ( )
virtual

An H callback used to get access to the drawing to be displayed in the control before its object hierarchy has been set up.

The callback is invoked by InitialDraw and may be used to set initial resources of the drawing before the hierarchy set up. It is a virtual callback method to be overridden by a derived class.

◆ Hierarchy()

virtual void Hierarchy ( GlgObjectC callback_viewport,
GlgHierarchyCBStruct hierarchy_info 
)
virtual

A Hierarchy callback used to get access to the drawing to be displayed in the SubWindow and SubDrawing objects before the drawing is displayed.

It is a virtual callback method to be overridden by a derived class and is enabled via EnableCallback.

Parameters
callback_viewportThe viewport the callback is attached to.
hierarchy_infoThe structure containing information about the subdrawing triggered the callback. See GlgHierarchyCBStruct for more information.

See GlgObjectC::Hierarchy for more information.

◆ InitialDraw()

void InitialDraw ( )

Draw the control's graphics the first time, invokes the control's H and V callbacks.

◆ Input()

virtual void Input ( GlgObjectC callback_viewport,
GlgObjectC message_object 
)
virtual

An Input callback used to handle user interaction with input objects, as well as object selection and action processing.

It is a virtual callback method to be overridden by a derived class and is enabled via EnableCallback.

Parameters
callback_viewportThe viewport the callback is attached to.
message_objectThe message object containing information about the event or action that triggered the callback.

See GlgObjectC::Input for more information.

◆ Print()

void Print ( CDC *  pDC,
DWORD  dwFlags 
)

A native Windows print method.

Parameters
pDCPrint drawing context.
dwFlagsPrinting flags.

◆ ResetHierarchy()

void ResetHierarchy ( )

Resets the object hierarchy of the control's drawing.

See GlgObjectC::ResetHierarchy for more information.

◆ Select()

virtual void Select ( GlgObjectC callback_viewport,
char **  name_array 
)
virtual

A simplified selection callback used to process object selection using object names.

It is a virtual callback method to be overridden by a derived class and is enabled via EnableCallback.

Parameters
callback_viewportThe viewport the callback is attached to.
name_arrayA NULL-terminated list of names of all named selected objects.

See GlgObjectC::Select for more information.

◆ SetDrawing() [1/3]

void SetDrawing ( char *  filename)

Loads a new control's drawing from a file, replacing a previously displayed drawing, if any.

Parameters
filenameThe drawing file name.

◆ SetDrawing() [2/3]

void SetDrawing ( GlgObjectC object)

Set a "$Widget" viewport of another object as a new drawing, replacing a previously displayed drawing, if any.

Parameters
objectAn object containing the $Widget viewport.

◆ SetDrawing() [3/3]

void SetDrawing ( void *  drawing_image,
GlgLong  image_size 
)

Loads a new control's drawing from a memory image, replacing a previously displayed drawing, if any.

Parameters
drawing_imageSpecifies the address of the drawing image generated by the GLG Code Generation Utility gcodegen.
image_sizeSpecifies the image size. This is also generated by gcodegen.

◆ SetupHierarchy()

void SetupHierarchy ( )

Sets up hierarchy of the control's drawing.

See GlgObjectC::SetupHierarchy for more information.

◆ Trace()

virtual void Trace ( GlgObjectC callback_viewport,
GlgTraceCBStruct trace_info 
)
virtual

A Trace callback used to handle native windowing events.

It is a virtual callback method to be overridden by a derived class and is enabled via EnableCallback.

Parameters
callback_viewportThe viewport the callback is attached to.
trace_infoThe structure containing information about the native windowing event that triggered the callback. See GlgTraceCBStruct for more information.

See GlgObjectC::Trace for more information.

◆ Trace2()

virtual void Trace2 ( GlgObjectC callback_viewport,
GlgTraceCBStruct trace_info 
)
virtual

A Trace2 callback used to handle native windowing events.

It is a virtual callback method to be overridden by a derived class and is enabled via EnableCallback.

The Trace2 callback is similar to Trace, but is invoked after the event has been processed.

Parameters
callback_viewportThe viewport the callback is attached to.
trace_infoThe structure containing information about the native windowing event that triggered the callback. See GlgTraceCBStruct for more information.

See GlgObjectC::Trace for more information.

◆ Update()

GlgBoolean Update ( void  )

Updates the graphics displayed in the control.

See GlgObjectC::Update for more information.

Returns
True if the drawing has been successfully updated, otherwise False.

◆ VCallback()

virtual void VCallback ( )
virtual

An V callback used to get access to the drawing to be displayed in the control after its object hierarchy has been set up.

The callback is invoked by InitialDraw and may be used to set resources of the drawing after its object hierarchy has been set up, but before its graphics has been rendered for the first time. It is a virtual callback method to be overridden by a derived class.

Member Data Documentation

◆ viewport

GlgObjectC viewport

An object ID of the associated GLG viewport object containing the control's drawing.

◆ GlgWrapperC

class GlgWrapperC

Linux/Unix only: A C++ widget wrapper around the X11 and Motif-based GlgWrapper widget for legacy X11 applications.

The C++ widget wrapper allows embedding GLG drawings into the X11 widget interface hierarchy.

It is a subclass of a GlgObjectC and inherits the GLG API from it. The GLG_ENABLE_X11_WRAPPER macro has to be defined to use GlgWrapperC on Linux/Unix.

The examples_c_cpp/Dashboard/GlgDashboardX.cpp file in the GLG installation directory presents an example of using the GlgWrapperC widget in an X11/Motif application.

Note: The GetViewport method has to be called explicitly after the widget has been realized and before any API methods are used. The GetViewport method associates a viewport object of the loaded drawing with the instance of a the GlgWrapperC class. The viewport is set to NULL initially and its object ID has to be obtained from the widget after the widget has been realized. The viewport is created by the widget when it is realizing. Since the widget may be realized by its parent, it's difficult to encapsulate GetViewport functionality into the GlgWrapperC class in a way that is transparent to the user. Trying to do so causes a lot of code duplication and is prone to errors, so invoking GetViewport is left as responsibility of the user.

Include file: GlgClass.h

Inherits GlgObjectC.

Public Attributes

Widget widget
 The ID of the widget used by this instance. More...
 
- Public Attributes inherited from GlgObjectC
GlgObject glg_obj
 An object ID of the associated GLG object. More...
 
GlgObject suspend_obj
 An object containing suspension information. More...
 

Public Member Functions

 GlgWrapperC (void)
 Default constructor: creates an empty wrapper widget with no drawing. More...
 
virtual ~GlgWrapperC (void)
 Destructor. More...
 
void Create (char *drawing_file, Widget parent, char *widget_name="GlgWrapper", GlgLong width=400, GlgLong height=300)
 Creates a widget and loads a drawing from a file. More...
 
void Create (GlgObjectC &object, Widget parent, char *widget_name="GlgWrapper", GlgLong width=400, GlgLong height=300)
 Creates a widget and uses a "$Widget" viewport of another object as a drawing. More...
 
void Create (void *image_data, GlgLong image_data_size, Widget parent, char *widget_name="GlgWrapper", GlgLong width=400, GlgLong height=300)
 Creates a widget and loads a drawing from a generated memory image. More...
 
void EnableCallback (GlgCallbackType callback_type, GlgObject callback_viewport=NULL)
 Enables the widget's Input, Select, Trace and Hierarchy callbacks. More...
 
GlgObject GetViewport ()
 Associates a viewport object of the wrapper widget with the instance of the class after the widget has been realized. More...
 
Widget GetWidget (void)
 The widget used by this GlgWrapperC object. More...
 
void GetXtResource (String xt_resource_name, char **resource_value_ptr)
 Queries resources of the GlgWrapper widget. More...
 
virtual void HCallback (GlgObjectC &callback_viewport)
 An H callback used to get access to the drawing to be displayed in the control before its object hierarchy has been set up. More...
 
virtual void Hierarchy (GlgObjectC &callback_viewport, GlgHierarchyCBStruct *hierarchy_info)
 A Hierarchy callback used to get access to the drawing to be displayed in the SubWindow and SubDrawing objects before the drawing is displayed. More...
 
virtual void Input (GlgObjectC &callback_viewport, GlgObjectC &message_object)
 An Input callback used to handle user interaction with input objects, as well as object selection and action processing. More...
 
virtual void Select (GlgObjectC &callback_viewport, char **name_array)
 A simplified selection callback used to process object selection using object names. More...
 
void SetDrawing (char *filename)
 Loads a new drawing from a file, replacing the previous drawing, if any (uses the XtNglgDrawingFile resource of the GlgWrapper widget). More...
 
void SetDrawing (GlgObjectC &object)
 Set a "$Widget" viewport of another object as a new drawing, replacing a previously displayed drawing, if any (uses XtNglgDrawingObject resource). More...
 
void SetDrawing (void *image_data, GlgLong image_data_size)
 Load a new drawing from a generated memory image, replacing the previous drawing, if any (uses the XtNglgDrawingImage resource of the GlgWrapper widget),. More...
 
void SetXtResource (String xt_resource_name, char *resource_value)
 Sets resources of the GlgWrapper widget. More...
 
virtual void Trace (GlgObjectC &callback_viewport, GlgTraceCBStruct *trace_info)
 A Trace callback used to handle native windowing events. More...
 
virtual void Trace2 (GlgObjectC &callback_viewport, GlgTraceCBStruct *trace_info)
 A Trace2 callback used to handle native windowing events. More...
 
virtual void VCallback (GlgObjectC &callback_viewport)
 An V callback used to get access to the drawing to be displayed in the control after its object hierarchy has been set up. More...
 
- Public Member Functions inherited from GlgObjectC
 GlgObjectC (char *filename)
 Constructor: Loads an object from a file. More...
 
 GlgObjectC (GlgObject object)
 Constructor: Creates a C++ class from GlgObject. More...
 
 GlgObjectC (GlgObjectC &object, GlgCloneType clone_type=GLG_FULL_CLONE)
 Copy constructor, Extended API: Creates a copy of the object. More...
 
 GlgObjectC (GlgObjectC &parent, char *resource_name)
 Constructor, Intermediate API: associates this object with a named resource object inside another object. More...
 
 GlgObjectC (GlgObjectType type, char *name=NULL, GlgAnyType data1=NULL, GlgAnyType data2=NULL, GlgAnyType data3=NULL, GlgAnyType data4=NULL)
 Constructor, Extended API: Creates a new object of the specified type. More...
 
 GlgObjectC (void *image, GlgLong size)
 Constructor: loads an object from a generated memory image. More...
 
 GlgObjectC (void)
 Default constructor: Creates a null object. More...
 
virtual ~GlgObjectC (void)
 Destructor: Destroys an instance of GlgObjectC and dereferences the GlgObject object it contains. More...
 
GlgBoolean Add (GlgObjectC &object, GlgAccessType access_type=GLG_BOTTOM, GlgPositionModifier pos_modifier=GLG_AFTER)
 A generic method for adding an object to this container. More...
 
GlgBoolean AddAt (GlgObjectC &object, GlgLong index)
 Adds an object at the specified position inside this container. More...
 
GlgObject AddPlot (char *resource_name, GlgObjectC &plot)
 Adds a plot to this chart. More...
 
GlgBoolean AddToBottom (GlgObjectC &object)
 Adds an object at the end of this container. More...
 
GlgBoolean AddToTop (GlgObjectC &object)
 Adds an object at the beginning of this container. More...
 
GlgBoolean ConstrainObject (GlgObjectC &to_attribute)
 Constrains an attribute or a point of an object to an attribute or a point of another object. More...
 
GlgBoolean ContainsObject (GlgObjectC &object)
 Checks if object belongs to this container. More...
 
void Copy (GlgCloneType clone_type=GLG_FULL_CLONE)
 Creates a copy of an object. More...
 
void Create (GlgObjectType type, char *name=NULL, GlgAnyType data1=NULL, GlgAnyType data2=NULL, GlgAnyType data3=NULL, GlgAnyType data4=NULL)
 Creates a new GLG object of the specified type. More...
 
GlgObject CreateAlarmList (void)
 Creates and returns a list of alarms defined in this object. More...
 
GlgObject CreateChartSelection (GlgObjectC *plot, double x, double y, double dx, double dy, GlgBoolean screen_coord, GlgBoolean include_invalid, GlgBoolean x_priority)
 Selects a this chart's data sample closest to the specified position and returns a message object containing the selected sample's information. More...
 
GlgObject CreatePointArray (GlgControlPointType type)
 ADVANCED: Creates and returns an array containing all control points of an object. More...
 
GlgObject CreateResourceList (GlgBoolean list_named_res, GlgBoolean list_def_attr, GlgBoolean list_aliases)
 Returns a list of an object's resources. More...
 
GlgObject CreateTagList (GlgBoolean unique_tag_sources)
 Creates and returns a list of data tags defined in this object. More...
 
char * CreateTooltipString (double x, double y, double dx, double dy, char *format)
 Creates and returns a chart or axis tooltip string based on the mouse position. More...
 
GlgBoolean Delete (GlgObjectC *object=NULL, GlgAccessType access_type=GLG_BOTTOM, GlgPositionModifier pos_modifier=GLG_AFTER)
 A generic method for deleting an object from this container. More...
 
GlgBoolean DeleteBottomObject (void)
 Deletes an object from the bottom of this container. More...
 
GlgBoolean DeleteObject (GlgObjectC &object)
 Finds and deletes an object from this container. More...
 
GlgBoolean DeleteObjectAt (GlgLong index)
 Deletes an object from the specified position in this container. More...
 
GlgBoolean DeletePlot (char *resource_name, GlgObjectC &plot)
 Deletes a plot from this chart. More...
 
GlgBoolean DeleteTopObject (void)
 Deletes an object from the beginning of this container. More...
 
void DialogInitialDraw (GlgObjectC &parent)
 Displays a GLG drawing as a floating dialog for the first time after it has been created or loaded. More...
 
void DialogSetupHierarchy (GlgObjectC &parent)
 Provides an explicit request to set up the object hierarchy of a drawing displayed in a dialog window. More...
 
void Drop (void)
 Explicitly dereferences the GLG object contained in this instance. More...
 
void EnableCallback (GlgCallbackType callback_type, GlgObject callback_viewport=NULL)
 Enables Input, Select, Trace and Hierarchy callbacks of this object. More...
 
GlgBoolean ExportPostScript (char *filename="out.ps", double x=0., double y=0., double width=2000., double height=2000., GlgBoolean portrait=True, GlgBoolean stretch=True, GlgBoolean center=True)
 Generates a PostScript output of the current state of the viewport's graphics. More...
 
GlgBoolean FitObject (GlgCoordType coord_type, GlgCube *box, GlgBoolean keep_ratio)
 Fits an object to the specified rectangular area. More...
 
PlatformDependent GenerateImage (char *resource_name=NULL, PlatformDependent image=NULL)
 Creates and returns an image of the current state of the viewport's graphics. More...
 
PlatformDependent GenerateImageCustom (char *resource_name, PlatformDependent image, GlgLong x, GlgLong y, GlgLong width, GlgLong height, GlgLong gap)
 Creates an image of the specified rectangular region of the viewport's graphics. More...
 
GlgObject GetAlarmObject (char *alarm_label, GlgBoolean single_alarm)
 Returns an alarm object with a specified alarm label, or a list of alarms matching the specified alarm label pattern. More...
 
GlgCubeGetBoxPtr (void)
 Returns an object's bounding box extent in screen coordinates. More...
 
GlgBoolean GetChartDataExtent (char *resource_name, GlgMinMax *min_max, GlgBoolean x_extent, GlgBoolean visible_only)
 Queries the minimum and maximum extent of the data accumulated in thischart or in one of its plots. More...
 
GlgObject GetDrawingMatrix (void)
 Returns the transformation matrix used to draw the object. More...
 
GlgBoolean GetDResource (char *resource_name, double *value)
 Returns the current value of a D (double) resource of this object. More...
 
GlgBoolean GetDTag (char *tag_name, double *value)
 Returns the current value of a D (double) tag. More...
 
GlgObject GetElement (GlgLong index)
 Returns the object at the specified position in this container. More...
 
GlgObject GetGlgObject (void)
 Returns an object ID of the stored GlgObject object. More...
 
GlgBoolean GetGResource (char *resource_name, double *x_value, double *y_value, double *z_value)
 Returns the current value of a G (geometrical or color) resource of this object. More...
 
GlgBoolean GetGTag (char *tag_name, double *x_value, double *y_value, double *z_value)
 Returns the current value of a G (geometrical or color) tag. More...
 
GlgLong GetIndex (GlgObjectC &object)
 Returns the index of the first occurrence of an object in this container. More...
 
void GetMatrixData (GlgMatrixData *matrix_data)
 Queries coefficients of this matrix. More...
 
GlgObject GetNamedObject (char *name)
 Find and returns an object ID of the object with the specified name inside this container. More...
 
GlgObject GetNamedPlot (char *resource_name, char *plot_name)
 Given a name of this chart's plot, returns the plot's object ID. More...
 
GlgObject GetParent (GlgLong *num_parents)
 Returns an object's parent object, if one exists. More...
 
GlgBoolean GetResource (char *resource_name, char **value)
 Returns the current value of a S (string) resource of this object. More...
 
GlgBoolean GetResource (char *resource_name, double *value)
 Returns the current value of a D (double) resource of this object. More...
 
GlgBoolean GetResource (char *resource_name, double *x_value, double *y_value, double *z_value)
 Returns the current value of a G (geometrical or color) resource of this object. More...
 
GlgObject GetResourceObject (char *resource_name)
 Find a resource object. More...
 
GlgLong GetSize (void)
 Returns size of this container object. More...
 
GlgBoolean GetSResource (char *resource_name, char **value)
 Returns the current value of a S (string) resource of this object. More...
 
GlgBoolean GetSTag (char *tag_name, char **value)
 Returns the current value of a S (string) tag. More...
 
GlgLong GetStringIndex (char *string)
 Returns the index of the first occurrence of a string in this container of the GLG_STRING type. More...
 
GlgBoolean GetTag (char *tag_name, char **value)
 Returns the current value of a S (string) tag. More...
 
GlgBoolean GetTag (char *tag_name, double *value)
 Returns the current value of a D (double) tag. More...
 
GlgBoolean GetTag (char *tag_name, double *x_value, double *y_value, double *z_value)
 Returns the current value of a G (geometrical or color) tag. More...
 
GlgObject GetTagObject (char *search_string, GlgBoolean by_name, GlgBoolean unique_tags, GlgBoolean single_tag, GlgTagType tag_type_mask)
 Retrieves a tag object with a specified tag name, data tag source, or export tag category, or retrieves a list of tags matching the specified tag name, tag source or category pattern. More...
 
GlgBoolean HasResourceObject (char *resource_name)
 Checks if a named resource of this object exists. More...
 
GlgBoolean HasTag (char *tag_name, GlgTagType tag_type_mask)
 Checks if a data or export tag with a specified tag name exists. More...
 
GlgBoolean HasTagName (char *tag_name)
 Checks if a data tag with a specified tag name exists. More...
 
GlgBoolean HasTagSource (char *tag_source)
 Checks if a data tag with a specified tag source exists. More...
 
void InitialDraw (void)
 Draws a GLG viewport object for the first time after it has been created or loaded. More...
 
void Inverse ()
 Inverses the order of elements inside this container object. More...
 
GlgObject InverseMatrix (void)
 Inverts this matrix object. More...
 
GlgBoolean IsContainer (void)
 
GlgBoolean IsNull (void)
 Checks if a non-null object is stored in this instance. More...
 
GlgObject Iterate (void)
 Traverses elements of this container object in the forward direction. More...
 
GlgObject IterateBack (void)
 Traverses elements of this container object in the backward direction. More...
 
GlgBoolean LayoutObjects (GlgObject anchor, GlgLayoutType type, double distance, GlgBoolean use_box, GlgBoolean process_subobjects)
 Performs operations ranging from setting an object's width and height to aligning and layout of groups of objects. More...
 
GlgBoolean Load (char *filename, char *resource_name=NULL)
 Loads an object from a file or a URL, replacing the previously stored object. More...
 
GlgBoolean Load (GlgObjectC &parent, char *resource_name=NULL)
 Finds a resource. More...
 
GlgBoolean Load (void *image, GlgLong size, char *resource_name=NULL)
 Loads an object from a generated memory image, replacing the previously stored object. More...
 
void LoadNullObject (void)
 Releases the stored object. More...
 
GlgBoolean LoadWidget (char *filename)
 Loads a GLG widget from a file or a URL. More...
 
GlgBoolean LoadWidget (GlgObjectC &parent)
 Extracts a GLG widget contained inside another object. More...
 
GlgBoolean LoadWidget (void *image, GlgLong size)
 Loads a GLG widget from a generated memory image. More...
 
GlgBoolean MoveObject (GlgCoordType coord_type, GlgPoint *start_point, GlgPoint *end_point)
 Moves an object by a move vector. More...
 
GlgBoolean MoveObjectBy (GlgCoordType coord_type, double x, double y, double z)
 Moves an object by the specified distances. More...
 
void OnDrawMetafile (CDC *print_dc)
 Windows only: Provides MFC metafile output support. More...
 
void OnPrint (CDC *print_dc)
 Windows only: Provides MFC printing support. More...
 
 operator GlgObject (void)
 Type converter to GlgObject. More...
 
GlgBoolean operator! (void)
 Checks if a non-null object is stored in this instance. More...
 
GlgObjectCoperator++ (int)
 Postfix operator: References an object. More...
 
GlgObjectCoperator++ (void)
 Prefix operator: References an object. More...
 
GlgObjectCoperator-- (int)
 Postfix operator: Dereferences an object. More...
 
GlgObjectCoperator-- (void)
 Prefix operator: Dereferences an object. More...
 
GlgObjectCoperator= (const GlgObjectC &object)
 Assignment operator: Stores a GLG object in this instance. More...
 
GlgBoolean PositionObject (GlgCoordType coord_type, GlgLong anchoring, double x, double y, double z)
 Positions an object at the specified location. More...
 
GlgBoolean PositionToValue (char *resource_name, double x, double y, GlgBoolean outside_x, GlgBoolean outside_y, double *value)
 Returns a value corresponding to the specified position on top of this Chart or Axis object. More...
 
GlgBoolean Print (PlatformDependent print_context, double x=0., double y=0., double width=2000., double height=2000., GlgBoolean portrait=True, GlgBoolean stretch=True, GlgBoolean center=True)
 GTK and Windows only: Generates printing output of the current state of the viewport's graphics. More...
 
GlgObject QueryTags (GlgTagType tag_type_mask)
 Returns a group of all tags of the requested tag type defined in the object. More...
 
void Reference (void)
 Explicitly references the GLG object contained in this instance. More...
 
void ReleaseObject (void)
 Releases an object that was suspended for editing. More...
 
GlgBoolean ReorderElement (GlgLong old_index, GlgLong new_index)
 Changes an object's position inside this container. More...
 
GlgBoolean Reset (void)
 Reinitializes the drawing by resetting the drawing hierarchy, then setting it up again and rendering the drawing. More...
 
void ResetHierarchy (void)
 Resets the object hierarchy. More...
 
GlgBoolean RotateObject (GlgCoordType coord_type, GlgPoint *center, double x_angle, double y_angle, double z_angle)
 Rotates an object. More...
 
GlgBoolean Same (GlgObject object)
 Compares two GLG objects. More...
 
GlgBoolean Same (GlgObjectC &object)
 Compares two GLG objects. More...
 
GlgBoolean Save (char *filename)
 Saves this object to a file. More...
 
GlgBoolean SaveImage (char *resource_name, char *filename, GlgImageFormat format=GLG_JPEG)
 Generates a JPEG or PNG image of the current state of this viewport's graphics and saves it to a file. More...
 
GlgBoolean SaveImageCustom (char *resource_name, char *filename, GlgImageFormat format, GlgLong x, GlgLong y, GlgLong width, GlgLong height, GlgLong gap)
 Generates a JPEG or PNG image of the specified rectangular region of the viewport's graphics and saves it to a file. More...
 
GlgBoolean ScaleObject (GlgCoordType coord_type, GlgPoint *center, double x_scale, double y_scale, double z_scale)
 Scales an object. More...
 
GlgBoolean ScreenToWorld (GlgBoolean inside_vp, GlgPoint *in_point, GlgPoint *out_point)
 Converts a point's screen coordinates to the GLG world coordinate system. More...
 
GlgAnyType SendMessage (char *resource_path, char *message, GlgAnyType param1=NULL, GlgAnyType param2=NULL, GlgAnyType param3=NULL, GlgAnyType param4=NULL)
 Sends a message to an object to request some action to be performed. More...
 
GlgBoolean SetDResource (char *resource_name, double value)
 Sets a new value of a D (double) resource of this object. More...
 
GlgBoolean SetDResourceIf (char *resource_name, double value, GlgBoolean if_changed)
 Sets a new value of a D (double) resource of this object. More...
 
GlgBoolean SetDTag (char *tag_name, double value, GlgBoolean if_changed)
 Sets a new value for a D (double) tag. More...
 
void SetEnd (void)
 Initializes this container object for the backward traversing. More...
 
void SetGlgObject (GlgObject object)
 Low-level utility: Stores the specified GlgObject object in this object and references the stored object. More...
 
GlgBoolean SetGResource (char *resource_name, double x_value, double y_value, double z_value)
 Sets new values of a G (geometrical or color) resource of this object. More...
 
GlgBoolean SetGResourceIf (char *resource_name, double x_value, double y_value, double z_value, GlgBoolean if_changed)
 Sets new values of a G (geometrical or color) resource of this object. More...
 
GlgBoolean SetGTag (char *tag_name, double x_value, double y_value, double z_value, GlgBoolean if_changed)
 Sets new values of a G (geometrical or color) tag. More...
 
void SetMatrixData (GlgMatrixData *matrix_data)
 Sets coefficients of this matrix. More...
 
GlgBoolean SetResource (char *resource_name, char *format, double value)
 Replaces the string of an S (string) resource of this object with a value specified by an input number and a format string. More...
 
GlgBoolean SetResource (char *resource_name, char *format, double value, GlgBoolean if_changed)
 Replaces the string of an S (string) resource of this object with a value specified by an input number and a format string. More...
 
GlgBoolean SetResource (char *resource_name, char *value)
 Replaces the string of an S (string) resource of this object. More...
 
GlgBoolean SetResource (char *resource_name, char *value, GlgBoolean if_changed)
 Replaces the string of an S (string) resource of this object. More...
 
GlgBoolean SetResource (char *resource_name, double value)
 Sets a new value of a D (double) resource of this object. More...
 
GlgBoolean SetResource (char *resource_name, double value, GlgBoolean if_changed)
 Sets a new value of a D (double) resource of this object. More...
 
GlgBoolean SetResource (char *resource_name, double x_value, double y_value, double z_value)
 Sets new values of a G (geometrical or color) resource of this object. More...
 
GlgBoolean SetResource (char *resource_name, double x_value, double y_value, double z_value, GlgBoolean if_changed)
 Sets new values of a G (geometrical or color) resource of this object. More...
 
GlgBoolean SetResource (char *resource_name, GlgObjectC &value)
 Sets the value of a data or matrix object using another object of the same type and data type. More...
 
GlgBoolean SetResource (char *resource_name, GlgObjectC &value, GlgBoolean if_changed)
 Sets the value of a data or matrix object using another object of the same type and data type. More...
 
GlgBoolean SetResourceFromObject (char *resource_name, GlgObjectC &value)
 Sets the value of a data or matrix object using another object of the same type and data type. More...
 
GlgBoolean SetResourceFromObjectIf (char *resource_name, GlgObjectC &value, GlgBoolean if_changed)
 Sets the value of a data or matrix object using another object of the same type and data type. More...
 
GlgBoolean SetResourceObject (char *resource_name, GlgObjectC *value)
 Replaces a resource object. More...
 
GlgBoolean SetSResource (char *resource_name, char *value)
 Replaces the string of an S (string) resource of this object. More...
 
GlgBoolean SetSResourceFromD (char *resource_name, char *format, double value)
 Replaces the string of an S (string) resource of this object with a value specified by an input number and a format string. More...
 
GlgBoolean SetSResourceFromDIf (char *resource_name, char *format, double value, GlgBoolean if_changed)
 Replaces the string of an S (string) resource of this object with a value specified by an input number and a format string. More...
 
GlgBoolean SetSResourceIf (char *resource_name, char *value, GlgBoolean if_changed)
 Replaces the string of an S (string) resource of this object. More...
 
GlgBoolean SetSTag (char *tag_name, char *value, GlgBoolean if_changed)
 Replaces the string of an S (string) tag. More...
 
GlgBoolean SetSTagFromD (char *tag_name, char *format, double value, GlgBoolean if_changed)
 Replaces the string of an S (string) tag with a value specified by an input number and a format string. More...
 
void SetStart (void)
 Initializes this container object for the forward traversing. More...
 
GlgBoolean SetTag (char *tag_name, char *format, double value, GlgBoolean if_changed)
 Replaces the string of an S (string) tag with a value specified by an input number and a format string. More...
 
GlgBoolean SetTag (char *tag_name, char *value, GlgBoolean if_changed)
 Replaces the string of an S (string) tag. More...
 
GlgBoolean SetTag (char *tag_name, double value, GlgBoolean if_changed)
 Sets a new value for a D (double) tag. More...
 
GlgBoolean SetTag (char *tag_name, double x_value, double y_value, double z_value, GlgBoolean if_changed)
 Sets new values of a G (geometrical or color) tag. More...
 
void SetupHierarchy (void)
 Provides an explicit request to set up the object hierarchy without rendering the object. More...
 
GlgBoolean SetXform (GlgObjectC *xform)
 Adds or deletes transformations attached to an object. More...
 
GlgBoolean SetZoom (char *resource_name, GlgLong type, double value=0.)
 Provides a programmatic interface to integrated zooming and panning. More...
 
GlgBoolean SetZoomMode (char *resource_name, GlgObjectC *zoom_object, char *zoom_object_resource_name, GlgZoomMode zoom_mode)
 Sets or resets a viewport's zoom mode by supplying a GIS or Chart object to be zoomed. More...
 
void SuspendObject (void)
 Suspends a drawn object for editing. More...
 
GlgBoolean Sync (void)
 Flushes the windowing system output for this viewport to the display. More...
 
GlgBoolean TransformObject (GlgObjectC &xform, GlgCoordType coord_type, GlgObjectC *parent=NULL)
 ADVANCED: Transforms all control points of an object with an arbitrary transformation. More...
 
void TransformPoint (GlgPoint *in_point, GlgPoint *out_point)
 Transforms a single point using this matrix. More...
 
GlgBoolean UnconstrainObject (void)
 Unconstrains an attribute or point object stored in this object. More...
 
GlgBoolean Update (void)
 Updates a drawing to show new resource values. More...
 
GlgBoolean WorldToScreen (GlgBoolean inside_vp, GlgPoint *in_point, GlgPoint *out_point)
 Converts a point's coordinates from the GLG world coordinate system to the screen coordinate system. More...
 

Constructor & Destructor Documentation

◆ GlgWrapperC()

GlgWrapperC ( void  )

Default constructor: creates an empty wrapper widget with no drawing.

◆ ~GlgWrapperC()

virtual ~GlgWrapperC ( void  )
virtual

Destructor.

Destroys the wrapper widget.

Note: The instance's widget property must be explicitly set to NULL if the widget is destroyed by destroying its parent. This avoids XtDestroyWidget being called with an invalid widget ID.

Member Function Documentation

◆ Create() [1/3]

void Create ( char *  drawing_file,
Widget  parent,
char *  widget_name = "GlgWrapper",
GlgLong  width = 400,
GlgLong  height = 300 
)

Creates a widget and loads a drawing from a file.

Parameters
drawing_fileThe drawing file name.
parentThe widget's parent.
widget_nameWidget name.
width,heightWidget dimensions.

◆ Create() [2/3]

void Create ( GlgObjectC object,
Widget  parent,
char *  widget_name = "GlgWrapper",
GlgLong  width = 400,
GlgLong  height = 300 
)

Creates a widget and uses a "$Widget" viewport of another object as a drawing.

Parameters
objectAn object containing the $Widget viewport.
parentThe widget's parent.
widget_nameWidget name.
width,heightWidget dimensions.

◆ Create() [3/3]

void Create ( void *  image_data,
GlgLong  image_data_size,
Widget  parent,
char *  widget_name = "GlgWrapper",
GlgLong  width = 400,
GlgLong  height = 300 
)

Creates a widget and loads a drawing from a generated memory image.

Parameters
image_dataSpecifies the address of the drawing image generated by the GLG Code Generation Utility gcodegen.
image_data_sizeSpecifies the image size. This is also generated by gcodegen.
parentThe widget's parent.
widget_nameWidget name.
width,heightWidget dimensions.

◆ EnableCallback()

void EnableCallback ( GlgCallbackType  callback_type,
GlgObject  callback_viewport = NULL 
)

Enables the widget's Input, Select, Trace and Hierarchy callbacks.

Parameters
callback_typeSpecifies the type of a callback to be added:
callback_viewportIf not NULL, specifies a widget's child viewport to add the callbacks to. If NULL, the callbacks will be added to the widget's top viewport.

See GlgObjectC::EnableCallback for more information.

◆ GetViewport()

GlgObject GetViewport ( )

Associates a viewport object of the wrapper widget with the instance of the class after the widget has been realized.

See the following note for more information.

Returns
The viewport, or NULL if the viewport has not been set.

◆ GetWidget()

Widget GetWidget ( void  )

The widget used by this GlgWrapperC object.

Returns
The X11 widget id (the widget property).

◆ GetXtResource()

void GetXtResource ( String  xt_resource_name,
char **  resource_value_ptr 
)

Queries resources of the GlgWrapper widget.

Parameters
xt_resource_nameResource name.
resource_value_ptrA pointer used to return resource value. The pointer will be set to point to the string representing resource value.

◆ HCallback()

virtual void HCallback ( GlgObjectC callback_viewport)
virtual

An H callback used to get access to the drawing to be displayed in the control before its object hierarchy has been set up.

The callback is invoked by the widget before the object hierarchy of its drawing has been set up and may be used to set initial resources of the drawing. It is a virtual callback method to be overridden by a derived class.

Parameters
callback_viewportThe viewport the callback is attached to.

◆ Hierarchy()

virtual void Hierarchy ( GlgObjectC callback_viewport,
GlgHierarchyCBStruct hierarchy_info 
)
virtual

A Hierarchy callback used to get access to the drawing to be displayed in the SubWindow and SubDrawing objects before the drawing is displayed.

It is a virtual callback method to be overridden by a derived class and is enabled via EnableCallback.

Parameters
callback_viewportThe viewport the callback is attached to.
hierarchy_infoThe structure containing information about the subdrawing triggered the callback. See GlgHierarchyCBStruct for more information.

See GlgObjectC::Hierarchy for more information.

Reimplemented from GlgObjectC.

◆ Input()

virtual void Input ( GlgObjectC callback_viewport,
GlgObjectC message_object 
)
virtual

An Input callback used to handle user interaction with input objects, as well as object selection and action processing.

It is a virtual callback method to be overridden by a derived class and is enabled via EnableCallback.

Parameters
callback_viewportThe viewport the callback is attached to.
message_objectThe message object containing information about the event or action that triggered the callback.

See GlgObjectC::Input for more information.

Reimplemented from GlgObjectC.

◆ Select()

virtual void Select ( GlgObjectC callback_viewport,
char **  name_array 
)
virtual

A simplified selection callback used to process object selection using object names.

It is a virtual callback method to be overridden by a derived class and is enabled via EnableCallback.

Parameters
callback_viewportThe viewport the callback is attached to.
name_arrayA NULL-terminated list of names of all named selected objects.

See GlgObjectC::Select for more information.

Reimplemented from GlgObjectC.

◆ SetDrawing() [1/3]

void SetDrawing ( char *  filename)

Loads a new drawing from a file, replacing the previous drawing, if any (uses the XtNglgDrawingFile resource of the GlgWrapper widget).

Parameters
filenameDrawing file name.

◆ SetDrawing() [2/3]

void SetDrawing ( GlgObjectC object)

Set a "$Widget" viewport of another object as a new drawing, replacing a previously displayed drawing, if any (uses XtNglgDrawingObject resource).

Parameters
objectAn object containing the $Widget viewport.

◆ SetDrawing() [3/3]

void SetDrawing ( void *  image_data,
GlgLong  image_data_size 
)

Load a new drawing from a generated memory image, replacing the previous drawing, if any (uses the XtNglgDrawingImage resource of the GlgWrapper widget),.

Parameters
image_dataSpecifies the address of the drawing image generated by the GLG Code Generation Utility gcodegen.
image_data_sizeSpecifies the image size. This is also generated by gcodegen.

◆ SetXtResource()

void SetXtResource ( String  xt_resource_name,
char *  resource_value 
)

Sets resources of the GlgWrapper widget.

It is primarily used for setting XtNglgHResource* and XtNglgVResource* resources.

Parameters
xt_resource_nameResource name.
resource_valueA string representation of the resource value.

◆ Trace()

virtual void Trace ( GlgObjectC callback_viewport,
GlgTraceCBStruct trace_info 
)
virtual

A Trace callback used to handle native windowing events.

It is a virtual callback method to be overridden by a derived class and is enabled via EnableCallback.

Parameters
callback_viewportThe viewport the callback is attached to.
trace_infoThe structure containing information about the native windowing event that triggered the callback. See GlgTraceCBStruct for more information.

See GlgObjectC::Trace for more information.

Reimplemented from GlgObjectC.

◆ Trace2()

virtual void Trace2 ( GlgObjectC callback_viewport,
GlgTraceCBStruct trace_info 
)
virtual

A Trace2 callback used to handle native windowing events.

It is a virtual callback method to be overridden by a derived class and is enabled via EnableCallback.

The Trace2 callback is similar to Trace, but is invoked after the event has been processed.

Parameters
callback_viewportThe viewport the callback is attached to.
trace_infoThe structure containing information about the native windowing event that triggered the callback. See GlgTraceCBStruct for more information.

See GlgObjectC::Trace for more information.

Reimplemented from GlgObjectC.

◆ VCallback()

virtual void VCallback ( GlgObjectC callback_viewport)
virtual

An V callback used to get access to the drawing to be displayed in the control after its object hierarchy has been set up.

The callback is invoked by the widget after the object hierarchy of its drawing has been set up, but before its graphics has been drawn for the first time, and may be used to set resources of the drawing on the initial appearance. It is a virtual callback method to be overridden by a derived class.

Parameters
callback_viewportThe viewport the callback is attached to.

Member Data Documentation

◆ widget

Widget widget

The ID of the widget used by this instance.

◆ GtkmmGlgWidget

class GtkmmGlgWidget

Linux only: A native GTKMM widget that can be used to in the GTKMM environment.

The widget allows embedding GLG drawings into the GTKMM interface hierarchy, and is a C++ wrapper around a native GtkGlg widget.

To use the widget in an application, copy and include in your project the GtkmmGlgWidget.h and GtkmmGlgWidget.cpp files from the integration/gtkmm3_glg_native/src directory of the GLG installation on Linux.

The files in the integration/gtkmm3_glg_native directory of the GLG installation on Linux provide an example of using the widget in an application.

Include file: GtkmmGlgWidget.h

Inherits Bin.

Public Attributes

bool drawn
 Is set to True if the widget's graphics has been drawn. More...
 
GlgObject viewport
 Is set to True is the widget has been attached to the parent. More...
 

Public Member Functions

 GtkmmGlgWidget ()
 Default constructor: creates an empty widget. More...
 
virtual ~GtkmmGlgWidget ()
 Destructor. More...
 
void EnableCallback (GlgCallbackType callback_type)
 Enables the widget's Input, Select, Trace and Hierarchy callbacks. More...
 
GlgObject GetViewport ()
 Returns the top-level viewport containing the widget's drawing. More...
 
virtual void HCB (GlgObject callback_viewport)
 An H callback used to get access to the drawing to be displayed in the control before its object hierarchy has been set up. More...
 
virtual void HierarchyCB (GlgObject callback_viewport, GlgHierarchyCBStruct *hierarchy_info)
 A Hierarchy callback used to get access to the drawing that will be used by the SubWindow or SubDrawing object before the drawing is displayed. More...
 
virtual void InputCB (GlgObject callback_viewport, GlgObject message_object)
 An Input callback used to handle user interaction with input objects, as well as object selection and action processing. More...
 
virtual void SelectCB (GlgObject callback_viewport, char **name_array)
 A simplified selection callback used to process object selection using object names. More...
 
void SetViewport (GlgObject viewport_p)
 Assigns the top-level viewport that will be used as the widget's drawing. More...
 
virtual void Trace2CB (GlgObject callback_viewport, GlgTraceCBStruct *trace_info)
 A Trace2 callback used to handle native windowing events. More...
 
virtual void TraceCB (GlgObject callback_viewport, GlgTraceCBStruct *trace_info)
 A Trace callback used to handle native windowing events. More...
 
virtual void VCB (GlgObject callback_viewport)
 An V callback used to get access to the drawing to be displayed in the control after its object hierarchy has been set up. More...
 

Static Public Member Functions

static void Init (int argc, char *argv[])
 Optional: Initializes GLG Toolkit using applicable command-line options. More...
 

Constructor & Destructor Documentation

◆ GtkmmGlgWidget()

Default constructor: creates an empty widget.

◆ ~GtkmmGlgWidget()

virtual ~GtkmmGlgWidget ( )
virtual

Destructor.

Member Function Documentation

◆ EnableCallback()

void EnableCallback ( GlgCallbackType  callback_type)

Enables the widget's Input, Select, Trace and Hierarchy callbacks.

Parameters
callback_typeSpecifies the type of a callback to be added:

See GlgObjectC::EnableCallback for more information.

◆ GetViewport()

GlgObject GetViewport ( )

Returns the top-level viewport containing the widget's drawing.

Returns
The viewport, or NULL if the viewport has not been assigned.

◆ HCB()

virtual void HCB ( GlgObject  callback_viewport)
virtual

An H callback used to get access to the drawing to be displayed in the control before its object hierarchy has been set up.

The callback is invoked by the widget before the object hierarchy of its drawing has been set up and may be used to set initial resources of the drawing. It is a virtual callback method to be overridden by a derived class.

Parameters
callback_viewportThe viewport the callback is attached to.

◆ HierarchyCB()

virtual void HierarchyCB ( GlgObject  callback_viewport,
GlgHierarchyCBStruct hierarchy_info 
)
virtual

A Hierarchy callback used to get access to the drawing that will be used by the SubWindow or SubDrawing object before the drawing is displayed.

It is a virtual callback method to be overridden by a derived class and is enabled via EnableCallback.

Parameters
callback_viewportThe viewport the callback is attached to.
hierarchy_infoThe structure containing information about the subdrawing triggered the callback. See GlgHierarchyCBStruct for more information.

See GlgObjectC::Hierarchy for more information.

◆ Init()

static void Init ( int  argc,
char *  argv[] 
)
static

Optional: Initializes GLG Toolkit using applicable command-line options.

Parameters
argcSpecifies the number of command line parameters.
argvSpecifies the command line parameter list.

◆ InputCB()

virtual void InputCB ( GlgObject  callback_viewport,
GlgObject  message_object 
)
virtual

An Input callback used to handle user interaction with input objects, as well as object selection and action processing.

It is a virtual callback method to be overridden by a derived class and is enabled via EnableCallback.

Parameters
callback_viewportThe viewport the callback is attached to.
message_objectThe message object containing information about the event or action that triggered the callback.

See GlgObjectC::Input for more information.

◆ SelectCB()

virtual void SelectCB ( GlgObject  callback_viewport,
char **  name_array 
)
virtual

A simplified selection callback used to process object selection using object names.

It is a virtual callback method to be overridden by a derived class and is enabled via EnableCallback.

Parameters
callback_viewportThe viewport the callback is attached to.
name_arrayA NULL-terminated list of names of all named selected objects.

See GlgObjectC::Select for more information.

◆ SetViewport()

void SetViewport ( GlgObject  viewport_p)

Assigns the top-level viewport that will be used as the widget's drawing.

Parameters
viewport_pThe viewport containing a drawing to be used.

◆ Trace2CB()

virtual void Trace2CB ( GlgObject  callback_viewport,
GlgTraceCBStruct trace_info 
)
virtual

A Trace2 callback used to handle native windowing events.

It is a virtual callback method to be overridden by a derived class and is enabled via EnableCallback.

The Trace2 callback is similar to Trace, but is invoked after the event has been processed.

Parameters
callback_viewportThe viewport the callback is attached to.
trace_infoThe structure containing information about the native windowing event that triggered the callback. See GlgTraceCBStruct for more information.

See GlgObjectC::Trace for more information.

◆ TraceCB()

virtual void TraceCB ( GlgObject  callback_viewport,
GlgTraceCBStruct trace_info 
)
virtual

A Trace callback used to handle native windowing events.

It is a virtual callback method to be overridden by a derived class and is enabled via EnableCallback.

Parameters
callback_viewportThe viewport the callback is attached to.
trace_infoThe structure containing information about the native windowing event that triggered the callback. See GlgTraceCBStruct for more information.

See GlgObjectC::Trace for more information.

◆ VCB()

virtual void VCB ( GlgObject  callback_viewport)
virtual

An V callback used to get access to the drawing to be displayed in the control after its object hierarchy has been set up.

The callback is invoked by the widget after the object hierarchy of its drawing has been set up, but before its graphics has been drawn for the first time, and may be used to set resources of the drawing on the initial appearance. It is a virtual callback method to be overridden by a derived class.

Parameters
callback_viewportThe viewport the callback is attached to.

Member Data Documentation

◆ drawn

bool drawn

Is set to True if the widget's graphics has been drawn.

◆ viewport

GlgObject viewport

Is set to True is the widget has been attached to the parent.

◆ QGlgWidget

class QGlgWidget

A native Qt widget that can be used in the Qt environment on both Windows and Linux/Unix.

The widget allows embedding GLG drawings into the Qt interface hierarchy.

The widget uses include and source files in the integration/qt_5x_glg/src directory of the GLG installation.

The following directories of the GLG installation contain examples of Qt applications that use QGlgWidget:

  • integration/qt_5x_glg/animation_example
  • integration/qt_5x_glg/SimpleViewer
  • integration/qt_5x_glg/RealTimeChart

Each directory contains Qt projects files as well as README.txt files that provide compilation instructions for both Windows and Linux/Unix.

Include file: QGlgWidget.h

Inherits QWidget.

Public Attributes

bool viewport_displayed
 True if the widget's viewport has been loaded and is displayed. More...
 
bool widget_displayed
 True if the widget is displayed. More...
 

Public Member Functions

 QGlgWidget (QWidget *parent)
 Constructor: Creates and empty widget. More...
 
virtual ~QGlgWidget ()
 Destructor. More...
 
void EnableCallback (GlgCallbackType callback_type)
 Enables the widget's Input, Select, Trace and Hierarchy callbacks. More...
 
virtual void HCB (GlgObject callback_viewport)
 An H callback used to get access to the drawing to be displayed in the control before its object hierarchy has been set up. More...
 
virtual void HierarchyCB (GlgObject callback_viewport, GlgHierarchyCBStruct *hierarchy_info)
 A Hierarchy callback used to get access to the drawing that will be used by the SubWindow or SubDrawing object before the drawing is displayed. More...
 
virtual void InputCB (GlgObject callback_viewport, GlgObject message_object)
 An Input callback used to handle user interaction with input objects, as well as object selection and action processing. More...
 
virtual void SelectCB (GlgObject callback_viewport, char **name_array)
 A simplified selection callback used to process object selection using object names. More...
 
void SetViewport (GlgObject viewport_p)
 Assigns the top-level viewport that will be used as the widget's drawing. More...
 
virtual void Trace2CB (GlgObject callback_viewport, GlgTraceCBStruct *trace_info)
 A Trace2 callback used to handle native windowing events. More...
 
virtual void TraceCB (GlgObject callback_viewport, GlgTraceCBStruct *trace_info)
 A Trace callback used to handle native windowing events. More...
 
virtual void VCB (GlgObject callback_viewport)
 An V callback used to get access to the drawing to be displayed in the control after its object hierarchy has been set up. More...
 

Constructor & Destructor Documentation

◆ QGlgWidget()

QGlgWidget ( QWidget *  parent)

Constructor: Creates and empty widget.

Parameters
parentA parent widget to attach the widget to.

◆ ~QGlgWidget()

virtual ~QGlgWidget ( )
virtual

Destructor.

Member Function Documentation

◆ EnableCallback()

void EnableCallback ( GlgCallbackType  callback_type)

Enables the widget's Input, Select, Trace and Hierarchy callbacks.

Parameters
callback_typeSpecifies the type of a callback to be added:

See GlgObjectC::EnableCallback for more information.

◆ HCB()

virtual void HCB ( GlgObject  callback_viewport)
virtual

An H callback used to get access to the drawing to be displayed in the control before its object hierarchy has been set up.

The callback is invoked by the widget before the object hierarchy of its drawing has been set up and may be used to set initial resources of the drawing. It is a virtual callback method to be overridden by a derived class.

Parameters
callback_viewportThe viewport the callback is attached to.

◆ HierarchyCB()

virtual void HierarchyCB ( GlgObject  callback_viewport,
GlgHierarchyCBStruct hierarchy_info 
)
virtual

A Hierarchy callback used to get access to the drawing that will be used by the SubWindow or SubDrawing object before the drawing is displayed.

It is a virtual callback method to be overridden by a derived class and is enabled via EnableCallback.

Parameters
callback_viewportThe viewport the callback is attached to.
hierarchy_infoThe structure containing information about the subdrawing triggered the callback. See GlgHierarchyCBStruct for more information.

See GlgObjectC::Hierarchy for more information.

◆ InputCB()

virtual void InputCB ( GlgObject  callback_viewport,
GlgObject  message_object 
)
virtual

An Input callback used to handle user interaction with input objects, as well as object selection and action processing.

It is a virtual callback method to be overridden by a derived class and is enabled via EnableCallback.

Parameters
callback_viewportThe viewport the callback is attached to.
message_objectThe message object containing information about the event or action that triggered the callback.

See GlgObjectC::Input for more information.

◆ SelectCB()

virtual void SelectCB ( GlgObject  callback_viewport,
char **  name_array 
)
virtual

A simplified selection callback used to process object selection using object names.

It is a virtual callback method to be overridden by a derived class and is enabled via EnableCallback.

Parameters
callback_viewportThe viewport the callback is attached to.
name_arrayA NULL-terminated list of names of all named selected objects.

See GlgObjectC::Select for more information.

◆ SetViewport()

void SetViewport ( GlgObject  viewport_p)

Assigns the top-level viewport that will be used as the widget's drawing.

Parameters
viewport_pThe viewport containing a drawing to be used.

◆ Trace2CB()

virtual void Trace2CB ( GlgObject  callback_viewport,
GlgTraceCBStruct trace_info 
)
virtual

A Trace2 callback used to handle native windowing events.

It is a virtual callback method to be overridden by a derived class and is enabled via EnableCallback.

The Trace2 callback is similar to Trace, but is invoked after the event has been processed.

Parameters
callback_viewportThe viewport the callback is attached to.
trace_infoThe structure containing information about the native windowing event that triggered the callback. See GlgTraceCBStruct for more information.

See GlgObjectC::Trace for more information.

◆ TraceCB()

virtual void TraceCB ( GlgObject  callback_viewport,
GlgTraceCBStruct trace_info 
)
virtual

A Trace callback used to handle native windowing events.

It is a virtual callback method to be overridden by a derived class and is enabled via EnableCallback.

Parameters
callback_viewportThe viewport the callback is attached to.
trace_infoThe structure containing information about the native windowing event that triggered the callback. See GlgTraceCBStruct for more information.

See GlgObjectC::Trace for more information.

◆ VCB()

virtual void VCB ( GlgObject  callback_viewport)
virtual

An V callback used to get access to the drawing to be displayed in the control after its object hierarchy has been set up.

The callback is invoked by the widget after the object hierarchy of its drawing has been set up, but before its graphics has been drawn for the first time, and may be used to set resources of the drawing on the initial appearance. It is a virtual callback method to be overridden by a derived class.

Parameters
callback_viewportThe viewport the callback is attached to.

Member Data Documentation

◆ viewport_displayed

bool viewport_displayed

True if the widget's viewport has been loaded and is displayed.

◆ widget_displayed

bool widget_displayed

True if the widget is displayed.

Function Documentation

◆ QGlgInit()

void QGlgInit ( int  argc,
char **  argv,
QApplication *  q_app 
)

Used with QGlgWidget: Initializes GLG Toolkit in Qt environment using applicable command-line options.

Parameters
argcSpecifies the number of command line parameters.
argvSpecifies the command line parameter list.
q_appQApplication pointer.

This method should be invoked after creating QApplication at the beginning of main() as follows:

#include <QApplication>
#include "QGlgInit.h"
int main( int argc, char ** argv )
{
QApplication q_app( argc, argv );
QGlgInit( argc, argv, &q_app );
...
}
void QGlgInit(int argc, char **argv, QApplication *q_app)
Used with QGlgWidget: Initializes GLG Toolkit in Qt environment using applicable command-line options...

Include file: QGlgInit.h