#include <HGraph.h>

Public Member Functions

int AddLabel (const char *str, HPoint loc, HGraphPointFormat format=PointFormatCartesian, float xvector=1.0, float yvector=0.0, float zvector=0.0)
 
void AddLegend (HPoint loc, HGraphPointFormat format=PointFormatCartesian)
 
int AddLegendEntry (const char *str, const char *color, HGraphLegendEntryType ltype=LegendEntryTypeLine)
 
int AddLegendUnicodeEntry (const unsigned short *str, const char *color, HGraphLegendEntryType ltype=LegendEntryTypeLine)
 
int AddUnicodeLabel (const unsigned short *str, HPoint loc, HGraphPointFormat format=PointFormatCartesian, float xvector=1.0, float yvector=0.0, float zvector=0.0)
 
void ConvertPoints (unsigned int in_count, const HPoint in_points[], HGraphPointFormat in_system, HPoint out_points[], HGraphPointFormat out_system)
 
bool GetAutomaticUpdates ()
 
void GetFrameColor (char *color)
 
void GetFramePattern (char *pattern)
 
bool GetFrameVisibility ()
 
float GetFrameWeight ()
 
void GetLabelContents (int label_id, char *str)
 
HPoint GetLabelLocation (int label_id)
 
void GetLabelTextAlignment (int label_id, char *alignment)
 
void GetLabelTextColor (int label_id, char *color)
 
void GetLabelTextFont (int label_id, char *font)
 
void GetLabelTextPath (int label_id, float *xvector, float *yvector, float *zvector)
 
void GetLabelUnicodeContents (int label_id, unsigned short *str)
 
void GetLegendEntry (int entry_id, char *str, char *color, HGraphLegendEntryType *entry_type=0)
 
HPoint GetLegendLocation ()
 
void GetLegendTextFont (char *font)
 
void GetLegendTitle (char *title)
 
void GetLegendTitleTextFont (char *font)
 
void GetLegendUnicodeEntry (int entry_id, unsigned short *str, char *color, HGraphLegendEntryType *entry_type=0)
 
void GetLegendUnicodeTitle (unsigned short *title)
 
HPoint GetPlotOrigin ()
 
void GetPlotTitle (char *title)
 
virtual void GetPlotTitleColor (char *color)
 
HPoint GetPlotTitleLocation ()
 
void GetPlotTitleTextFont (char *font)
 
void GetPlotUnicodeTitle (unsigned short *title)
 
 HBaseGraph (HC_KEY plot_seg)
 
void PreserveData (bool preserve=true)
 
void RemoveLabel (int label_id)
 
void RemoveLegend ()
 
void RemoveLegendEntry (int entry_id)
 
void RemoveLegendTitle ()
 
void SetAutomaticUpdates (bool automatic=true)
 
void SetFrameColor (const char *color)
 
void SetFramePattern (const char *pattern)
 
void SetFrameVisibility (bool visible)
 
void SetFrameWeight (float weight)
 
void SetLabelContents (int label_id, const char *str)
 
void SetLabelLocation (int label_id, HPoint loc, HGraphPointFormat format=PointFormatCartesian)
 
void SetLabelTextAlignment (int label_id, const char *alignment)
 
void SetLabelTextColor (int label_id, const char *color)
 
void SetLabelTextFont (int label_id, const char *font)
 
void SetLabelTextPath (int label_id, float xvector, float yvector, float zvector)
 
void SetLabelUnicodeContents (int label_id, const unsigned short *str)
 
void SetLegendLocation (HPoint loc, HGraphPointFormat format=PointFormatCartesian)
 
void SetLegendTextFont (const char *font)
 
void SetLegendTitle (const char *title)
 
void SetLegendTitleTextFont (const char *font)
 
void SetLegendUnicodeTitle (const unsigned short *title)
 
void SetPlotOrigin (HPoint origin)
 
virtual void SetPlotTitle (const char *title)=0
 
virtual void SetPlotTitleColor (const char *color)
 
void SetPlotTitleLocation (HPoint loc)
 
void SetPlotTitleTextFont (const char *font)
 
virtual void SetPlotUnicodeTitle (unsigned short *title)=0
 
virtual void Update ()
 
virtual ~HBaseGraph ()
 

Protected Member Functions

virtual void DrawFrame ()=0
 
virtual void DrawLegend ()
 

Protected Attributes

bool m_automatic_updates
 
bool m_force_update
 
VArray< HGraphLabelNode * > m_labels
 
HGraphLegend m_legend
 
HPoint m_origin
 
HC_KEY m_plot_segment
 
bool m_preserve_data
 
bool m_show_frame
 

Detailed Description

Provides basic graphing capabilities required by all types of graphs

Constructor & Destructor Documentation

◆ HBaseGraph()

HBaseGraph::HBaseGraph ( HC_KEY  plot_seg)

HBaseGraph Constructor.

Parameters
plot_segThe segment that all graph subsegments will be created beneath.

◆ ~HBaseGraph()

virtual HBaseGraph::~HBaseGraph ( )
virtual

~HBaseGraph Destructor.

Member Function Documentation

◆ AddLabel()

int HBaseGraph::AddLabel ( const char *  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
strThe contents of the label.
locThe location on the graph to put the label.
formatThe format of the point loc. Default value: PointFormatCartesian.
xvectorThe x component of the vector that the label text will be aligned with. Default value: (1.0, 0.0, 0.0).
yvectorThe y component of the vector that the label text will be aligned with. Default value: (1.0, 0.0, 0.0).
zvectorThe 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.

◆ AddLegend()

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

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

Parameters
locThe location of the top left corner of the legend.
formatThe format of the point loc. Default value: PointFormatCartesian.

◆ AddLegendEntry()

int HBaseGraph::AddLegendEntry ( const char *  str,
const char *  color,
HGraphLegendEntryType  ltype = LegendEntryTypeLine 
)

Adds an entry to the legend associated with a color.

Parameters
strThe string to be entered in to the legend.
colorThe color associated with the string.
ltypeWhat 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.

◆ AddLegendUnicodeEntry()

int HBaseGraph::AddLegendUnicodeEntry ( const unsigned short *  str,
const char *  color,
HGraphLegendEntryType  ltype = LegendEntryTypeLine 
)

Adds a unicode legend entry associated with a color.

Parameters
strThe string to be entered in to the legend.
colorThe color associated with the string.
ltypeWhat 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.

◆ AddUnicodeLabel()

int HBaseGraph::AddUnicodeLabel ( const unsigned short *  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
strThe contents of the label.
locThe location on the graph to put the label.
formatThe format of the point loc. Default value: PointFormatCartesian.
xvectorThe x component of the vector that the label text will be aligned with. Default value: (1.0, 0.0, 0.0).
yvectorThe y component of the vector that the label text will be aligned with. Default value: (1.0, 0.0, 0.0).
zvectorThe 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.

◆ ConvertPoints()

void HBaseGraph::ConvertPoints ( unsigned int  in_count,
const HPoint  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_countThe size of the in_points array.
in_pointsAn array of points to be transformed. Passed by reference always.
in_systemThe point system that in_points is in.
out_pointsAn array of points the same size as in_points to hold the transformed values. Returned to user. Passed by reference always.
out_systemThe point system that in_points should be transformed into.

◆ DrawFrame()

virtual void HBaseGraph::DrawFrame ( )
protectedpure virtual

Draws a frame around the perimeter of the plot.

Implemented in HPieChart, and HPlot2D.

◆ DrawLegend()

virtual void HBaseGraph::DrawLegend ( )
protectedvirtual

Constructs the legend in the Hoops segment tree.

◆ GetAutomaticUpdates()

bool HBaseGraph::GetAutomaticUpdates ( )

Gets the status of automatic updates.

Returns
true if automatic updates are enabled, false otherwise.

◆ GetFrameColor()

void HBaseGraph::GetFrameColor ( char *  color)

This method retrieves the current frame color.

Parameters
colorThe frame color. Returned to user. Passed by reference always.

◆ GetFramePattern()

void HBaseGraph::GetFramePattern ( char *  pattern)

This method retrieves the current frame line pattern.

Parameters
patternThe line pattern. Returned to user. Passed by reference always.

◆ GetFrameVisibility()

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

◆ GetFrameWeight()

float HBaseGraph::GetFrameWeight ( )

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

Returns
The frame weight.

◆ GetLabelContents()

void HBaseGraph::GetLabelContents ( int  label_id,
char *  str 
)

Shows the contents of a label.

Parameters
label_idThe ID of the label.
strThe label string. Returned to user. Passed by reference always.

◆ GetLabelLocation()

HPoint HBaseGraph::GetLabelLocation ( int  label_id)

Retrieves the location of a label.

Parameters
label_idThe ID of the label.
Returns
The label location in cartesian space.

◆ GetLabelTextAlignment()

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

Retrieves the text alignment of a label.

Parameters
label_idThe ID of the label.
alignmentThe label alignment. Returned to user. Passed by reference always.

◆ GetLabelTextColor()

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

Retrieves the text color of a label.

Parameters
label_idThe ID of the label.
colorThe label color. Returned to user. Passed by reference always.

◆ GetLabelTextFont()

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

Retrieves the text font of a label.

Parameters
label_idThe ID of the label.
fontThe label font. Returned to user. Passed by reference always.

◆ GetLabelTextPath()

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

Gets the text path used for a label

Parameters
label_idThe ID of the label.
xvectorThe x component of the text path vector. Returned to user.
yvectorThe y component of the text path vector. Returned to user.
zvectorThe z component of the text path vector. Returned to user.

◆ GetLabelUnicodeContents()

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

Shows the contents of a unicode label.

Parameters
label_idThe ID of the label.
strThe label string. Returned to user. Passed by reference always.

◆ GetLegendEntry()

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

Retrieves the legend entry associated with entry_id.

Parameters
entry_idThe legend entry.
strThe text string associated with the legend entry.
colorThe color of the geometry associated with the legend entry.
entry_typeOptionally, the type of geometry drawn in the legend entry can be retrieved. Returned to user. Passed by reference always.

◆ GetLegendLocation()

HPoint HBaseGraph::GetLegendLocation ( )

Gets the location of the legend.

Returns
The location of the legend in cartesian space.

◆ GetLegendTextFont()

void HBaseGraph::GetLegendTextFont ( char *  font)

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

Parameters
fontThe font of the legend entries. Returned to user. Passed by reference always.

◆ GetLegendTitle()

void HBaseGraph::GetLegendTitle ( char *  title)

Retrieves the title of the legend.

Parameters
titleThe title of the plot. Returned to user. Passed by reference always.

◆ GetLegendTitleTextFont()

void HBaseGraph::GetLegendTitleTextFont ( char *  font)

Retrieves the text font of the legend title.

Parameters
fontThe font of the legend title. Returned to user. Passed by reference always.

◆ GetLegendUnicodeEntry()

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_idThe legend entry.
strThe unicode string associated with the legend entry.
colorThe color of the geometry associated with the legend entry.
entry_typeOptionally, the type of geometry drawn in the legend entry can be retrieved. Returned to user. Passed by reference always.

◆ GetLegendUnicodeTitle()

void HBaseGraph::GetLegendUnicodeTitle ( unsigned short *  title)

Gets the unicode legend title.

Parameters
titleThe title of the plot. Returned to user. Passed by reference always.

◆ GetPlotOrigin()

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.

◆ GetPlotTitle()

void HBaseGraph::GetPlotTitle ( char *  title)

This method retrieves the title of the plot.

Parameters
titleThe title of the plot. Returned to user. Passed by reference always.

◆ GetPlotTitleColor()

virtual void HBaseGraph::GetPlotTitleColor ( char *  color)
virtual

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

Parameters
colorThe color of the title of the plot. Passed by reference always.

◆ GetPlotTitleLocation()

HPoint HBaseGraph::GetPlotTitleLocation ( )

Retrieves the location of the current plot title.

Returns
An HPoint value representing the location of the title of the plot.

◆ GetPlotTitleTextFont()

void HBaseGraph::GetPlotTitleTextFont ( char *  font)

Retrieves the current font used to render the plot title.

Parameters
fontThe font of the plot title. Returned to user. Passed by reference always.

◆ GetPlotUnicodeTitle()

void HBaseGraph::GetPlotUnicodeTitle ( unsigned short *  title)

This method retrieves the title of the plot.

Parameters
titleThe title of the plot. Returned to user. Passed by reference always.

◆ PreserveData()

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
preserveSet this parameter to true if you wish to presevere the plog segment.

◆ RemoveLabel()

void HBaseGraph::RemoveLabel ( int  label_id)

Removes a previously created label.

Parameters
label_idThe ID of the label to be removed.

◆ RemoveLegend()

void HBaseGraph::RemoveLegend ( )

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

◆ RemoveLegendEntry()

void HBaseGraph::RemoveLegendEntry ( int  entry_id)

Removes the legend entry associated with entry_id.

Parameters
entry_idThe legend entry to be removed.

◆ RemoveLegendTitle()

void HBaseGraph::RemoveLegendTitle ( )

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

◆ SetAutomaticUpdates()

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
automaticIf true, automatic updates will be enabled.

◆ SetFrameColor()

void HBaseGraph::SetFrameColor ( const char *  color)

This method sets the frame color.

Parameters
colorThe frame color. Passed by reference always.

◆ SetFramePattern()

void HBaseGraph::SetFramePattern ( const char *  pattern)

Sets the frame line pattern.

Parameters
patternThe line pattern. Passed by reference always.

◆ SetFrameVisibility()

void HBaseGraph::SetFrameVisibility ( bool  visible)

This method sets the visibility of the plot frame.

Parameters
visibleA boolean value setting the current visibility of the plot's frame

◆ SetFrameWeight()

void HBaseGraph::SetFrameWeight ( float  weight)

Sets the line weight of the plot frame.

Parameters
weightThe new frame weight to be set.

◆ SetLabelContents()

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

Replaces the contents of a label.

Parameters
label_idThe ID of the label.
strThe label string. Passed by reference always.

◆ SetLabelLocation()

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

Sets the location of a label.

Parameters
label_idThe ID of the label.
locThe label location.
formatThe format of the point loc. Default value: PointFormatCartesian.

◆ SetLabelTextAlignment()

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

Sets the text alignment of a label.

Parameters
label_idThe ID of the label.
alignmentThe label alignment. Passed by reference always.

◆ SetLabelTextColor()

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

Sets the text color of a label.

Parameters
label_idThe ID of the label.
colorThe label color. Passed by reference always.

◆ SetLabelTextFont()

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

Sets the text font of a label.

Parameters
label_idThe ID of the label.
fontThe label font. Passed by reference always.

◆ SetLabelTextPath()

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

Sets the text path used for a label.

Parameters
label_idThe ID of the label.
xvectorThe x component of the text path vector.
yvectorThe y component of the text path vector.
zvectorThe z component of the text path vector.

◆ SetLabelUnicodeContents()

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

Replaces the contents of a unicode label.

Parameters
label_idThe ID of the label.
strThe label string. Passed by reference always.

◆ SetLegendLocation()

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

Sets the location of the legend.

Parameters
locThe label location.
formatThe format of the point loc. Default value: PointFormatCartesian.

◆ SetLegendTextFont()

void HBaseGraph::SetLegendTextFont ( const char *  font)

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

Parameters
fontThe font of the legend entries. Passed by reference always.

◆ SetLegendTitle()

void HBaseGraph::SetLegendTitle ( const char *  title)

Sets the title of the legend.

Parameters
titleThe title of the plot. Passed by reference always.

◆ SetLegendTitleTextFont()

void HBaseGraph::SetLegendTitleTextFont ( const char *  font)

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

Parameters
fontThe font of the legend title. Passed by reference always.

◆ SetLegendUnicodeTitle()

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

Sets a unicode title for the legend.

Parameters
titleThe title of the plot. Passed by reference always.

◆ SetPlotOrigin()

void HBaseGraph::SetPlotOrigin ( HPoint  origin)

This method sets the location of the plot origin.

Parameters
originAn HPoint value representing the new location of the title of the plot.

◆ SetPlotTitle()

virtual void HBaseGraph::SetPlotTitle ( const char *  title)
pure virtual

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

Parameters
titleThe title of the plot.

Implemented in HPieChart, and HPlot2D.

◆ SetPlotTitleColor()

virtual void HBaseGraph::SetPlotTitleColor ( const char *  color)
virtual

This method sets a plot title color.

Parameters
colorThe color of the title of the plot.

◆ SetPlotTitleLocation()

void HBaseGraph::SetPlotTitleLocation ( HPoint  loc)

Sets the location of the plot title.

Parameters
locAn HPoint value representing the new location of the title of the plot.

◆ SetPlotTitleTextFont()

void HBaseGraph::SetPlotTitleTextFont ( const char *  font)

Retrieves the current font used to render the plot title.

Parameters
fontThe font of the plot title. Passed by reference always.

◆ SetPlotUnicodeTitle()

virtual void HBaseGraph::SetPlotUnicodeTitle ( unsigned short *  title)
pure virtual

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

Parameters
titleThe title of the plot.

Implemented in HPieChart, and HPlot2D.

◆ Update()

virtual void HBaseGraph::Update ( )
virtual

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

Reimplemented in HPieChart, and HPlot2D.


The documentation for this class was generated from the following file: