HBaseGraph
Functions
Detailed Description
-
class
HBaseGraph
Provides basic graphing capabilities required by all types of graphs
Subclassed by HPieChart, HPlot2D
Public Functions
-
HBaseGraph
(HC_KEY plot_seg) HBaseGraph Constructor.
Parameters: plot_seg – The segment that all graph subsegments will be created beneath.
-
virtual
~HBaseGraph
() ~HBaseGraph Destructor.
-
void
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
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
SetPlotTitle
(char const *title) = 0 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
SetPlotUnicodeTitle
(unsigned short *title) = 0 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
GetPlotTitleColor
(char *color) 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
SetPlotTitleColor
(char const *color) This method sets a plot title color.
Parameters: color – The color of the title of the plot.
-
void
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
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
GetPlotTitleLocation
() Retrieves the location of the current plot title.
Returns: An HPoint value representing the location of the title of the plot.
-
void
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
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
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
GetFrameVisibility
() This method retrieves the visibility of the plot frame.
Returns: A boolean value reflecting the current visibility of the plot’s frame
-
void
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
GetFramePattern
(char *pattern) This method retrieves the current frame line pattern.
Parameters: pattern – The line pattern. Returned to user. Passed by reference always.
-
void
SetFramePattern
(char const *pattern) Sets the frame line pattern.
Parameters: pattern – The line pattern. Passed by reference always.
-
void
GetFrameColor
(char *color) This method retrieves the current frame color.
Parameters: color – The frame color. Returned to user. Passed by reference always.
-
void
SetFrameColor
(char const *color) This method sets the frame color.
Parameters: color – The frame color. Passed by reference always.
-
float
GetFrameWeight
() This method retrieves the line weight of the current plot frame.
Returns: The frame weight.
-
void
SetFrameWeight
(float weight) Sets the line weight of the plot frame.
Parameters: weight – The new frame weight to be set.
-
int
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
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
RemoveLabel
(int label_id) Removes a previously created label.
Parameters: label_id – The ID of the label to be removed.
-
void
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
RemoveLegend
() Removes the current legend (if any) from the plot and deletes all legend entries.
-
void
SetLegendTitle
(char const *title) Sets the title of the legend.
Parameters: title – The title of the plot. Passed by reference always.
-
void
GetLegendTitle
(char *title) Retrieves the title of the legend.
Parameters: title – The title of the plot. Returned to user. Passed by reference always.
-
void
RemoveLegendTitle
() Removes the title of the legend. This method has no effect if the title is uninitialized.
-
void
SetLegendUnicodeTitle
(unsigned short const *title) Sets a unicode title for the legend.
Parameters: title – The title of the plot. Passed by reference always.
-
void
GetLegendUnicodeTitle
(unsigned short *title) Gets the unicode legend title.
Parameters: title – The title of the plot. Returned to user. Passed by reference always.
-
void
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
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
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
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
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
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
RemoveLegendEntry
(int entry_id) Removes the legend entry associated with entry_id.
Parameters: entry_id – The legend entry to be removed.
-
void
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
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
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
GetLegendLocation
() Gets the location of the legend.
Returns: The location of the legend in cartesian space.
-
void
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
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
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
GetAutomaticUpdates
() Gets the status of automatic updates.
Returns: true if automatic updates are enabled, false otherwise.
-
virtual void
Update
() Force the segment tree to reflect any queued changes in the graph.
-