HUtilityAnnotation

class HUtilityAnnotation

The HUtilityAnnotation class defines and manages annotations.

This class simplified the creation of annotations.

Methods

HUtilityAnnotation::HUtilityAnnotation()
virtual HUtilityAnnotation::~HUtilityAnnotation()

virtual

virtual void HUtilityAnnotation::AddChar(char the_char)

virtual

Adds a char to the note

virtual void HUtilityAnnotation::AddChar(unsigned short the_char)

virtual

Adds a unicode char to the note

virtual HC_KEY HUtilityAnnotation::GetBackgroundSegmentKey()

virtual

Returns a key to the background segment. In the segment a user-defined background can be set. Assume the text will range from x=[-1, 1] y=[-1, 1] and the background will be scaled to fit the text

virtual HC_KEY HUtilityAnnotation::GetKey()

virtual

Returns the key to the root of the note sub-tree

virtual void HUtilityAnnotation::GetText(char *text, int &length)

virtual

Fills text with the current note text

Parameters

text: a pointer to where the text should be written (may be null)

length: return values for how much text was put in the buffer

virtual int HUtilityAnnotation::GetTextLength()

virtual

Returns just the length of the text

virtual void HUtilityAnnotation::GetTextWithEncoding(unsigned short *text, int &length)

virtual

Fills text with the current note text

Parameters

text: a pointer to where the text should be written (may be null)

length: return values for how much text was put in the buffer

virtual char const *HUtilityAnnotation::GetType()

virtual

Returns “HUtilityAnnotation”

virtual HC_KEY HUtilityAnnotation::Insert(HPoint target, HPoint position, HC_KEY AnnotateThis, HBaseView *pView, HC_KEY layer_key = INVALID_KEY, int bg_type = BG_QUAD, bool useArrow = true, HC_KEY *key_path = (HC_KEY*)0, int key_path_length = 0)

virtual

Inserts a note

Parameters

target: where the arrow should point

position: where the text is positioned

AnnotateThis: key to what this annotation is annotating

pView: pointer to the view

layer_key: style segment for this note

bg_type: one of four stock background types

useArrow: sets the visibility of the arrow

key_path: is the key path returned by HC_Show_Selection_Original_Keys

key_path_length: is the length returned by HC_Show_Selection_Original_Keys

Returns

key to the root of the note segment tree
virtual HC_KEY HUtilityAnnotation::Insert(char const *text, HPoint target, HPoint position, HC_KEY AnnotateThis, HBaseView *pView, HC_KEY layer_key = INVALID_KEY, int bg_type = BG_QUAD, bool useArrow = true, HC_KEY *key_path = (HC_KEY*)0, int key_path_length = 0)

virtual

Inserts a note

Parameters

text: initial text for this note

target: where the arrow should point

position: where the text is positioned

AnnotateThis: key to what this annotation is annotating

pView: pointer to the view

layer_key: style segment for this note

bg_type: one of four stock background types

useArrow: sets the visibility of the arrow

key_path: is the key path returned by HC_Show_Selection_Original_Keys

key_path_length: is the length returned by HC_Show_Selection_Original_Keys

Returns

key to the root of the note segment tree
virtual HC_KEY HUtilityAnnotation::InsertWithEncoding(unsigned short const *text, HPoint target, HPoint position, HC_KEY AnnotateThis, HBaseView *pView, HC_KEY layer_key = INVALID_KEY, int bg_type = BG_QUAD, bool useArrow = true, HC_KEY *key_path = (HC_KEY*)0, int key_path_length = 0)

virtual

Inserts a note

Parameters

text: initial text for this note

target: where the arrow should point

position: where the text is positioned

AnnotateThis: key to what this annotation is annotating

pView: pointer to the view

layer_key: style segment for this note

bg_type: one of four stock background types

useArrow: sets the visibility of the arrow

key_path: is the key path returned by HC_Show_Selection_Original_Keys

key_path_length: is the length returned by HC_Show_Selection_Original_Keys

Returns

key to the root of the note segment tree
virtual void HUtilityAnnotation::MoveText(HPoint const &pos, HCamera const *camera = 0)

virtual

Repositions the text

virtual void HUtilityAnnotation::MoveText(HPoint const &tar, HPoint const &pos, HCamera const *camera = 0)

virtual

Repositions the text and target.

virtual void HUtilityAnnotation::SetBackgroundType(long type)

virtual

Sets the background type to one of the four predefined types

Parameters

type: can be 0, 1, 2, 3 or BG_CIRCLE, BG_QUAD, BG_CLOUD, BG_NONE
virtual void HUtilityAnnotation::SetColor(char const *color)

virtual

sets the color at the root of the note segment tree

Parameters

color: can be anything that HC_Set_Color accepts
virtual void HUtilityAnnotation::SetEdgeWeight(float weight)

virtual

Sets the edge weight at the root of the note segment tree

virtual void HUtilityAnnotation::SetExtents(int xpixels, int ypixels, HC_KEY view_key)

virtual

Sets the extents of the background. The text will be scaled to fit within these extents

virtual void HUtilityAnnotation::SetFacePattern(char const *pattern)

virtual

Sets the face pattern at the root of the note segment tree

Parameters

pattern: can be anything that HC_Set_Face_Pattern accepts
virtual void HUtilityAnnotation::SetLinePattern(char const *pattern)

virtual

Sets the line pattern at the root of the note segment tree

Parameters

pattern: can be anything that HC_Set_Line_Pattern accepts
virtual void HUtilityAnnotation::SetLineWeight(float weight)

virtual

Sets the line weight at the root of the note segment tree

virtual void HUtilityAnnotation::SetNote(HC_KEY noteskey, HC_KEY view_key)

virtual

Changes the note the class refers to

Parameters

noteskey: should be a key that IsNote returns true on and is the key to the note we want this class to refer to and manipulate

view_key: The view key where a camera can be found by compute text extents

virtual void HUtilityAnnotation::SetNote(HC_KEY noteskey, HBaseView *pView)

virtual

Changes the note the class refers to

Parameters

noteskey: should be a key that IsNote returns true on and is the key to the note we want this class to refer to and manipulate

pView: The view where a camera can be found by compute text extents

virtual void HUtilityAnnotation::SetOnTop(bool t)

virtual

Sets this note on top of “normal” geometry

Parameters

t: if true, the note will be on top, false will unset the note as on top.
virtual bool HUtilityAnnotation::GetOnTop()

virtual

This return if the note on top of “normal” geometry

Returns

If note is on top
virtual void HUtilityAnnotation::SetText(char const *text)

virtual

Sets the text of this note

virtual void HUtilityAnnotation::SetTextFont(char const *font)

virtual

Sets the font for this note. If no font is set the font is inherited from it’s parent.

Parameters

font: is anything that is accepted by HC_Set_Text_Font Setting points or pixels may result in incorrectly sized text when printing.
virtual void HUtilityAnnotation::SetTextWithEncoding(unsigned short const *text)

virtual

Sets unicode text for this note

virtual void HUtilityAnnotation::ShowPosition(HPoint &p)

virtual

Returns the position of the text in world space

virtual void HUtilityAnnotation::ShowPosition(float *x, float *y, float *z)

virtual

Returns the position of the text in world space

virtual void HUtilityAnnotation::ShowTarget(HPoint &p)

virtual

Shows the target point in world space. The target point is the point that this note is annotating

virtual void HUtilityAnnotation::ShowTarget(float *x, float *y, float *z)

virtual

Shows the target point in world space. The target point is the point that this note is annotating

virtual void HUtilityAnnotation::UnSetExtents()

virtual

Unsets the extents set on this note if an extent is set.

virtual void HUtilityAnnotation::Resize(int include_count, HC_KEY include_keys[], HC_KEY view_key)

virtual

This must be called after a note is modified and before the scene is updated. This method updates the size of the background and fits it to the text. If you’re note aren’t looking like you expect, you may be forgetting to update the notes with this method.

virtual void HUtilityAnnotation::Resize(HC_KEY include_keys, HC_KEY view_key)

virtual

virtual HPoint HUtilityAnnotation::GetFacing() const

const virtual

virtual HPoint HUtilityAnnotation::GetUp() const

const virtual

static HC_KEY HUtilityAnnotation::GetKey(HC_KEY)

static

Returns the key to the root of the note sub-tree giving a key in that subtree.

static bool HUtilityAnnotation::IsAnnotation(HC_KEY key)

static

Returns true if the key is an Annotation object (also returns true for objects deriving from this class. If this function returns try on this key, SetNote may be called on this key to do some limited things to that note such as changing the text and calling update.

static bool HUtilityAnnotation::IsNote(HC_KEY noteskey)

static

Returns true if noteskey refers to a note of this type. This key can then be passed to SetNote()

static void HUtilityAnnotation::ChangeAllFonts(HBaseView *view, char const *const font, HC_KEY seg_key = INVALID_KEY)

static

Change the font on all annotations in the s

static void HUtilityAnnotation::WindowResizeCallback(int signal, void *signal_data, void *user_data)

static

This method is registered to listen for window resize events. If the window is resized the all annotations with points or pixel sized fonts must be updated

static void HUtilityAnnotation::recursive_resize(HC_KEY seg_key, int include_count, HC_KEY include_keys[], HC_KEY view_key)

static

This method is normally called from WindowResizeCallback, but it can also get called by user code where there’s no real view (such is in two pass printing).

static void HUtilityAnnotation::drawLineCallback(HIC_Rendition const *rendition, int count, HIC_DC_Point p[])

static

static void HUtilityAnnotation::drawLineCallbackClip(HIC_Rendition const *rendition, int count, HIC_DC_Point p[])

static

static void HUtilityAnnotation::drawMarkerCallback(HIC_Rendition const *rendition, HIC_DC_Point *p)

static

static void HUtilityAnnotation::drawLineCallbackCommon(HIC_Rendition const *rendition, HIC_Point p[4])

private static

static void HUtilityAnnotation::recursive_change_font(HC_KEY seg_key, int include_count, HC_KEY include_keys[], HC_KEY view_key, char const *const font)

private static

this is called by ChangeAllFonts to change the fonts of all the annotations in a subtree.

void HUtilityAnnotation::SetConditionalVisibility(HBaseView *pView, HC_KEY const key_path[], int const key_path_length)

private

static int HUtilityAnnotation::Clip_Line_Inverse(HIC_DC_Point *p, HIC_DC_Point *po, int top, int left, int bottom, int right)

protected static

static int HUtilityAnnotation::Clip_Line(HIC_DC_Point *p, HIC_DC_Point *po, int top, int left, int bottom, int right)

protected static

Variables

HC_KEY HUtilityAnnotation::m_MyKey

protected

HC_KEY
HC_KEY HUtilityAnnotation::m_MyTextKey

protected

HC_KEY
HPoint HUtilityAnnotation::m_target

protected

HPoint HUtilityAnnotation::m_position

protected

HC_KEY HUtilityAnnotation::g_segmentkey

protected static

HC_KEY
int HUtilityAnnotation::g_width

protected static

int
int HUtilityAnnotation::g_height

protected static

int