NAME
BQGlyph - BRTT Qt graphics extension for a glyph graphical object
SYNOPSIS
$(QTNATIVELIBS) -lbqplot_native -lbanner -lbrttutil -lbumapdata $(DBLIBS) $(TRLIBS)
#include "BQ.h"
DESCRIPTION
A
BQGlyph object is a graphical glyph object that can be displayed and manipulated
programmatically and with the mouse. A glyph can be a simple shape, like a circle or square,
or it can be a compound shape involving several separate shape paths, such as
an earthquake moment tensor "beachball". A glyph object's shape paths can be functions
of independent parameters, such as the beachball node paths which are functions of the
moment tensor components. Each glyph object can have optional text labels. Each glyph object
can have independent graphics contexts (see
BQGraphicsContext(3)), or can share
graphics contexts in arbitrary ways. Each glyph object can contain user defined data
that can point to information associated with each glyph.
All BQGlyph objects must be associated with a BQGlyphs
object (see BQGlyphs(3)). When a BQGlyph object is constructed it instructs
its BQViewportItem base class to not register it with the master BQViewport
object. The actual rendering of individual BQGlyph objects is controlled by
separate display lists within the associated BQGlyphs objects instead of the
master display list within the BQViewport object. This provides a means for
representing large numbers of BQGlyph objects within a BQViewport object
as a single BQGlyphs object.
INHERITS FROM
BQViewportItem
CONSTRUCTOR
BQGlyph(BQViewport *master, BQGlyphs *glyphs);
Where "master" is the bqplot BQViewport item that acts as the master for
the BQGlyph object and glyphs is the associated BQGlyphs object.
BQGlyph METHODS
-
void setGlyph (int symbol, double *params, QList<BqGraphicsContext *> gcs);
-
void setGlyph (int symbol, double *params, BqGraphicsContext *gc);
-
void setGlyph (QString gc_definitions_name, double *params);
-
void setGlyph (int symbol, QString gc_definitions_name, double *params);
-
void setGlyph (int symbol, QString gc_definitions_name, double *params);
These are used to set BQGlyph object graphics context. symbol is the glyph symbol
and should be one of BQ_GRAPHICS_CONTEXT_SYMBOL_TYPE_DEFAULT,
BQ_GRAPHICS_CONTEXT_SYMBOL_TYPE_POINT, BQ_GRAPHICS_CONTEXT_SYMBOL_TYPE_CROSS,
BQ_GRAPHICS_CONTEXT_SYMBOL_TYPE_X, BQ_GRAPHICS_CONTEXT_SYMBOL_TYPE_TRIANGLE,
BQ_GRAPHICS_CONTEXT_SYMBOL_TYPE_SQUARE, BQ_GRAPHICS_CONTEXT_SYMBOL_TYPE_CIRCLE,
BQ_GRAPHICS_CONTEXT_SYMBOL_TYPE_STAR, BQ_GRAPHICS_CONTEXT_SYMBOL_TYPE_DIAMOND, or
BQ_GRAPHICS_CONTEXT_SYMBOL_TYPE_BEACHBALL.
If the glyph symbol is BQ_GRAPHICS_CONTEXT_SYMBOL_TYPE_DEFAULT, then the symbol
is set to the default symbol defined within its associated BQGlyphs object.
The params array is a list of parameter values for compound glyph objects that
require parameters to determine the glyph shape paths. Currently the only glyph
shape that requires these parameters is BQ_GRAPHICS_CONTEXT_SYMBOL_TYPE_BEACHBALL.
For these glyph objects the params array should be the six independent
moment tensor components, mxx, myy, mzz, mxy, mxz
and myz as defined in bumoment(3). For all other glyph objects params
is ignored. The graphics context associated with each shape path component of the glyph is
specified by gcs. The only currently defined glyph with more than one shape
path component is the beachball glyph which has two components corresponding to the outside
of the beachball, a circle, and the internal node shapes, which are functions
of params. For all other glyph shapes a single graphics context item can be
set with gc.
The functions with gc_definitions_name refer to the name of a graphics context definition
list managed by BQGlyphsGraphicsContext(3). If symbol is specified, then the
symbol is set as with the previous versions of setGlyph, otherwise the symbol is
obtained from the graphics context definition.
-
void setPosition (double xw, double yw);
This will set the position of the center of the glyph at world
coordinates xw, yw.
-
void getPosition (double *xw, double *yw);
this will retrieve the world position coordinates of a glyph.
-
int getIndex ();
This will retrieve the glyph index. Each glyph in a BQGlyphs object has its
own unique index.
-
int getQEventState ();
This will retrieve the glyph event state, one of BQ_QEVENT_STATE_INITIAL,
for no state, BQ_QEVENT_STATE_PAN, for mouse in
a panning state, BQ_QEVENT_STATE_ZOOMIN, for mouse in
a zoom in state, BQ_QEVENT_STATE_ZOOMOUT, for mouse in
a zoom out state, or BQ_QEVENT_STATE_RLATLON, for mouse in
a panning reference latitude-longitude state.
-
void setSize (double size);
This will set the glyph size. This can also be accomplished through the graphics context.
-
void setCodingValue (QString name, double coding_value);
This will set the glyph graphics context coding value for graphics context item
with name name.
-
double getCodingValue (QString name);
This will retrieve the glyph graphics context coding value for graphics context item
with name name.
-
bool contains (QMouseEvent *event);
This will return a boolean that indicates if the mouse potion in event is
within the glyph.
-
void setClientData(BQ_ClientData client_data, int client_data_type=0);
This will set user client data for the glyph plus an optional data type. Client data can
be used to associate a glyph with user information such as a database pointer corresponding
to the glyph.
-
void getClientData(BQ_ClientData *client_data, int *client_data_type=NULL);
This will retrieve the glyph client data and client data type.
-
BqGraphicsContextItem getGraphicsContextItem (int gcindex, int type);
This will retrieve a graphics context item that has been previously set for a glyph.
The requested shape path index is gcindex (usually 0, but could
be 0 or 1
for beachball glyph objects) and the requested graphics context item type is type.
SEE ALSO
bqplot(3),
BQViewport(3),
BQViewportItem(3),
BQGlyphs(3),
BQGraphicsContext(3), BQSymbol(3)
AUTHOR
Danny Harvey, BRTT