HBaseGraph

class HBaseGraph

Provides basic graphing capabilities required by all types of graphs

Methods

HBaseGraph::HBaseGraph(HC_KEY plot_seg)

HBaseGraph Constructor.

Parameters

plot_seg: The segment that all graph subsegments will be created beneath.
virtual HBaseGraph::~HBaseGraph()

virtual

~HBaseGraph Destructor.

void HBaseGraph::GetPlotTitle(char *title)

This method retrieves the title of the plot.

Parameters

title: The title of the plot. Returned to user. Passed by reference always.
void HBaseGraph::GetPlotUnicodeTitle(unsigned short *title)

This method retrieves the title of the plot.

Parameters

title: The title of the plot. Returned to user. Passed by reference always.
virtual void HBaseGraph::SetPlotTitle(char const *title) = 0

virtual

This method adds a plot title. If a title already exists, it replaces the existing one.

Parameters

title: The title of the plot.
virtual void HBaseGraph::SetPlotUnicodeTitle(unsigned short *title) = 0

virtual

This methods adds a unicode plot title. If a title already exists, it replaces the existing one.

Parameters

title: The title of the plot.
virtual void HBaseGraph::GetPlotTitleColor(char *color)

virtual

This method retrieves the color of the title of the plot.

Parameters

color: The color of the title of the plot. Passed by reference always.
virtual void HBaseGraph::SetPlotTitleColor(char const *color)

virtual

This method sets a plot title color.

Parameters

color: The color of the title of the plot.
void HBaseGraph::GetPlotTitleTextFont(char *font)

Retrieves the current font used to render the plot title.

Parameters

font: The font of the plot title. Returned to user. Passed by reference always.
void HBaseGraph::SetPlotTitleTextFont(char const *font)

Retrieves the current font used to render the plot title.

Parameters

font: The font of the plot title. Passed by reference always.
HPoint HBaseGraph::GetPlotTitleLocation()

Retrieves the location of the current plot title.

Returns

An HPoint value representing the location of the title of the plot.
void HBaseGraph::SetPlotTitleLocation(HPoint loc)

Sets the location of the plot title.

Parameters

loc: An HPoint value representing the new location of the title of the plot.
HPoint HBaseGraph::GetPlotOrigin()

This method retrieves the location of the current plot origin.

Returns

An HPoint value representing the location of the plot’s origin point.
void HBaseGraph::SetPlotOrigin(HPoint origin)

This method sets the location of the plot origin.

Parameters

origin: An HPoint value representing the new location of the title of the plot.
bool HBaseGraph::GetFrameVisibility()

This method retrieves the visibility of the plot frame.

Returns

A boolean value reflecting the current visibility of the plot’s frame
void HBaseGraph::SetFrameVisibility(bool visible)

This method sets the visibility of the plot frame.

Parameters

visible: A boolean value setting the current visibility of the plot’s frame
void HBaseGraph::GetFramePattern(char *pattern)

This method retrieves the current frame line pattern.

Parameters

pattern: The line pattern. Returned to user. Passed by reference always.
void HBaseGraph::SetFramePattern(char const *pattern)

Sets the frame line pattern.

Parameters

pattern: The line pattern. Passed by reference always.
void HBaseGraph::GetFrameColor(char *color)

This method retrieves the current frame color.

Parameters

color: The frame color. Returned to user. Passed by reference always.
void HBaseGraph::SetFrameColor(char const *color)

This method sets the frame color.

Parameters

color: The frame color. Passed by reference always.
float HBaseGraph::GetFrameWeight()

This method retrieves the line weight of the current plot frame.

Returns

The frame weight.
void HBaseGraph::SetFrameWeight(float weight)

Sets the line weight of the plot frame.

Parameters

weight: The new frame weight to be set.
int HBaseGraph::AddLabel(char const *str, HPoint loc, HGraphPointFormat format = PointFormatCartesian, float xvector = 1.0, float yvector = 0.0, float zvector = 0.0)

Adds a label on the graph, returns the ID of the label.

Parameters

str: The contents of the label.

loc: The location on the graph to put the label.

format: The format of the point loc. Default value: PointFormatCartesian.

xvector: The x component of the vector that the label text will be aligned with. Default value: (1.0, 0.0, 0.0).

yvector: The y component of the vector that the label text will be aligned with. Default value: (1.0, 0.0, 0.0).

zvector: The z component of the vector that the label text will be aligned with. Default value: (1.0, 0.0, 0.0).

Returns

The ID of the label just added. This ID can be used to later modify the label.
int HBaseGraph::AddUnicodeLabel(unsigned short const *str, HPoint loc, HGraphPointFormat format = PointFormatCartesian, float xvector = 1.0, float yvector = 0.0, float zvector = 0.0)

Adds a unicode label on the graph and returns the ID of the label.

Parameters

str: The contents of the label.

loc: The location on the graph to put the label.

format: The format of the point loc. Default value: PointFormatCartesian.

xvector: The x component of the vector that the label text will be aligned with. Default value: (1.0, 0.0, 0.0).

yvector: The y component of the vector that the label text will be aligned with. Default value: (1.0, 0.0, 0.0).

zvector: The z component of the vector that the label text will be aligned with. Default value: (1.0, 0.0, 0.0).

Returns

The ID of the label just added. Used to later modify the label.
void HBaseGraph::RemoveLabel(int label_id)

Removes a previously created label.

Parameters

label_id: The ID of the label to be removed.
void HBaseGraph::GetLabelContents(int label_id, char *str)

Shows the contents of a label.

Parameters

label_id: The ID of the label.

str: The label string. Returned to user. Passed by reference always.

void HBaseGraph::GetLabelUnicodeContents(int label_id, unsigned short *str)

Shows the contents of a unicode label.

Parameters

label_id: The ID of the label.

str: The label string. Returned to user. Passed by reference always.

void HBaseGraph::SetLabelContents(int label_id, char const *str)

Replaces the contents of a label.

Parameters

label_id: The ID of the label.

str: The label string. Passed by reference always.

void HBaseGraph::SetLabelUnicodeContents(int label_id, unsigned short const *str)

Replaces the contents of a unicode label.

Parameters

label_id: The ID of the label.

str: The label string. Passed by reference always.

void HBaseGraph::SetLabelTextFont(int label_id, char const *font)

Sets the text font of a label.

Parameters

label_id: The ID of the label.

font: The label font. Passed by reference always.

void HBaseGraph::GetLabelTextFont(int label_id, char *font)

Retrieves the text font of a label.

Parameters

label_id: The ID of the label.

font: The label font. Returned to user. Passed by reference always.

void HBaseGraph::SetLabelTextColor(int label_id, char const *color)

Sets the text color of a label.

Parameters

label_id: The ID of the label.

color: The label color. Passed by reference always.

void HBaseGraph::GetLabelTextColor(int label_id, char *color)

Retrieves the text color of a label.

Parameters

label_id: The ID of the label.

color: The label color. Returned to user. Passed by reference always.

void HBaseGraph::SetLabelTextAlignment(int label_id, char const *alignment)

Sets the text alignment of a label.

Parameters

label_id: The ID of the label.

alignment: The label alignment. Passed by reference always.

void HBaseGraph::GetLabelTextAlignment(int label_id, char *alignment)

Retrieves the text alignment of a label.

Parameters

label_id: The ID of the label.

alignment: The label alignment. Returned to user. Passed by reference always.

void HBaseGraph::SetLabelLocation(int label_id, HPoint loc, HGraphPointFormat format = PointFormatCartesian)

Sets the location of a label.

Parameters

label_id: The ID of the label.

loc: The label location.

format: The format of the point loc. Default value: PointFormatCartesian.

HPoint HBaseGraph::GetLabelLocation(int label_id)

Retrieves the location of a label.

Parameters

label_id: The ID of the label.

Returns

The label location in cartesian space.
void HBaseGraph::SetLabelTextPath(int label_id, float xvector, float yvector, float zvector)

Sets the text path used for a label.

Parameters

label_id: The ID of the label.

xvector: The x component of the text path vector.

yvector: The y component of the text path vector.

zvector: The z component of the text path vector.

void HBaseGraph::GetLabelTextPath(int label_id, float *xvector, float *yvector, float *zvector)

Gets the text path used for a label

Parameters

label_id: The ID of the label.

xvector: The x component of the text path vector. Returned to user.

yvector: The y component of the text path vector. Returned to user.

zvector: The z component of the text path vector. Returned to user.

void HBaseGraph::AddLegend(HPoint loc, HGraphPointFormat format = PointFormatCartesian)

Adds a legend to the current plot. Each plot may only have one legend.

Parameters

loc: The location of the top left corner of the legend.

format: The format of the point loc. Default value: PointFormatCartesian.

void HBaseGraph::RemoveLegend()

Removes the current legend (if any) from the plot and deletes all legend entries.

void HBaseGraph::SetLegendTitle(char const *title)

Sets the title of the legend.

Parameters

title: The title of the plot. Passed by reference always.
void HBaseGraph::GetLegendTitle(char *title)

Retrieves the title of the legend.

Parameters

title: The title of the plot. Returned to user. Passed by reference always.
void HBaseGraph::RemoveLegendTitle()

Removes the title of the legend. This method has no effect if the title is uninitialized.

void HBaseGraph::SetLegendUnicodeTitle(unsigned short const *title)

Sets a unicode title for the legend.

Parameters

title: The title of the plot. Passed by reference always.
void HBaseGraph::GetLegendUnicodeTitle(unsigned short *title)

Gets the unicode legend title.

Parameters

title: The title of the plot. Returned to user. Passed by reference always.
void HBaseGraph::SetLegendTitleTextFont(char const *font)

Sets the text font of the legend title. Note that oru font sizes should be used.

Parameters

font: The font of the legend title. Passed by reference always.
void HBaseGraph::GetLegendTitleTextFont(char *font)

Retrieves the text font of the legend title.

Parameters

font: The font of the legend title. Returned to user. Passed by reference always.
void HBaseGraph::SetLegendTextFont(char const *font)

Sets the text font of the legend entries. Note that oru font sizes should be used.

Parameters

font: The font of the legend entries. Passed by reference always.
void HBaseGraph::GetLegendTextFont(char *font)

Sets the text font of the legend entries. Note that oru font sizes should be used.

Parameters

font: The font of the legend entries. Returned to user. Passed by reference always.
int HBaseGraph::AddLegendEntry(char const *str, char const *color, HGraphLegendEntryType ltype = LegendEntryTypeLine)

Adds an entry to the legend associated with a color.

Parameters

str: The string to be entered in to the legend.

color: The color associated with the string.

ltype: What sort of geometry should be drawn in the legend entry.

Returns

The ID of the legend entry. This ID can be used to later modify or remove the legend entry.
int HBaseGraph::AddLegendUnicodeEntry(unsigned short const *str, char const *color, HGraphLegendEntryType ltype = LegendEntryTypeLine)

Adds a unicode legend entry associated with a color.

Parameters

str: The string to be entered in to the legend.

color: The color associated with the string.

ltype: What sort of geometry should be drawn in the legend entry.

Returns

The ID of the legend entry. This ID can be used to later modify or remove the legend entry.
void HBaseGraph::RemoveLegendEntry(int entry_id)

Removes the legend entry associated with entry_id.

Parameters

entry_id: The legend entry to be removed.
void HBaseGraph::GetLegendEntry(int entry_id, char *str, char *color, HGraphLegendEntryType *entry_type = 0)

Retrieves the legend entry associated with entry_id.

Parameters

entry_id: The legend entry.

str: The text string associated with the legend entry.

color: The color of the geometry associated with the legend entry.

entry_type: Optionally, the type of geometry drawn in the legend entry can be retrieved. Returned to user. Passed by reference always.

void HBaseGraph::GetLegendUnicodeEntry(int entry_id, unsigned short *str, char *color, HGraphLegendEntryType *entry_type = 0)

Gets the unicode legend entry specified by the entry_id.

Parameters

entry_id: The legend entry.

str: The unicode string associated with the legend entry.

color: The color of the geometry associated with the legend entry.

entry_type: Optionally, the type of geometry drawn in the legend entry can be retrieved. Returned to user. Passed by reference always.

void HBaseGraph::SetLegendLocation(HPoint loc, HGraphPointFormat format = PointFormatCartesian)

Sets the location of the legend.

Parameters

loc: The label location.

format: The format of the point loc. Default value: PointFormatCartesian.

HPoint HBaseGraph::GetLegendLocation()

Gets the location of the legend.

Returns

The location of the legend in cartesian space.
void HBaseGraph::ConvertPoints(unsigned int in_count, HPoint const in_points[], HGraphPointFormat in_system, HPoint out_points[], HGraphPointFormat out_system)

Converts in_points from one system to another. It does not actually modify in_points, but returns the transformed points as out_points. For in place conversion, out_points can be the same as in_points.

Parameters

in_count: The size of the in_points array.

in_points: An array of points to be transformed. Passed by reference always.

in_system: The point system that in_points is in.

out_points: An array of points the same size as in_points to hold the transformed values. Returned to user. Passed by reference always.

out_system: The point system that in_points should be transformed into.

void HBaseGraph::PreserveData(bool preserve = true)

If preserve is true, the plot_seg passed into the constructor will be preserved when the plot object is destroyed. Otherwise the segment and all child segments will be deleted.

Parameters

preserve: Set this parameter to true if you wish to presevere the plog segment.
void HBaseGraph::SetAutomaticUpdates(bool automatic = true)

If automatic updates are enabled, each call that modifies the graph will immediately modify the underlying segment tree. If not, updates must be triggered manually by the user via the Update() call. By default, automatic updates are on.

Parameters

automatic: If true, automatic updates will be enabled.
bool HBaseGraph::GetAutomaticUpdates()

Gets the status of automatic updates.

Returns

true if automatic updates are enabled, false otherwise.
virtual void HBaseGraph::Update()

virtual

Force the segment tree to reflect any queued changes in the graph.

virtual void HBaseGraph::DrawFrame() = 0

protected virtual

Draws a frame around the perimeter of the plot.

virtual void HBaseGraph::DrawLegend()

protected virtual

Constructs the legend in the Hoops segment tree.

Variables

HC_KEY HBaseGraph::m_plot_segment

protected

HC_KEY
HPoint HBaseGraph::m_origin

protected

bool HBaseGraph::m_show_frame

protected

bool
bool HBaseGraph::m_preserve_data

protected

bool
bool HBaseGraph::m_automatic_updates

protected

bool
bool HBaseGraph::m_force_update

protected

bool
HGraphLegend HBaseGraph::m_legend

protected

VArray<HGraphLabelNode*> HBaseGraph::m_labels

protected

VArray<*