The HUtilityAnnotation class defines and manages annotations. More...

#include <HUtilityAnnotation.h>

Public Member Functions

virtual void AddChar (char the_char)
 
virtual void AddChar (unsigned short the_char)
 
virtual HC_KEY GetBackgroundSegmentKey ()
 
virtual HPoint GetFacing () const
 
virtual HC_KEY GetKey ()
 
virtual bool GetOnTop ()
 
virtual void GetText (char *text, int &length)
 
virtual int GetTextLength ()
 
virtual void GetTextWithEncoding (unsigned short *text, int &length)
 
virtual char const * GetType ()
 
virtual HPoint GetUp () const
 
virtual HC_KEY 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 HC_KEY Insert (const char *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 HC_KEY InsertWithEncoding (const unsigned short *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 void MoveText (HPoint const &pos, HCamera const *camera=0)
 
virtual void MoveText (HPoint const &tar, HPoint const &pos, HCamera const *camera=0)
 
virtual void Resize (int include_count, HC_KEY include_keys[], HC_KEY view_key)
 
virtual void Resize (HC_KEY include_keys, HC_KEY view_key)
 
virtual void SetBackgroundType (long type)
 
virtual void SetColor (char const *color)
 
virtual void SetEdgeWeight (float weight)
 
virtual void SetExtents (int xpixels, int ypixels, HC_KEY view_key)
 
virtual void SetFacePattern (char const *pattern)
 
virtual void SetLinePattern (char const *pattern)
 
virtual void SetLineWeight (float weight)
 
virtual void SetNote (HC_KEY noteskey, HC_KEY view_key)
 
virtual void SetNote (HC_KEY noteskey, HBaseView *pView)
 
virtual void SetOnTop (bool t)
 
virtual void SetText (char const *text)
 
virtual void SetTextFont (char const *font)
 
virtual void SetTextWithEncoding (unsigned short const *text)
 
virtual void ShowPosition (HPoint &p)
 
virtual void ShowPosition (float *x, float *y, float *z)
 
virtual void ShowTarget (HPoint &p)
 
virtual void ShowTarget (float *x, float *y, float *z)
 
virtual void UnSetExtents ()
 

Static Public Member Functions

static void ChangeAllFonts (HBaseView *view, char const *const font, HC_KEY seg_key=INVALID_KEY)
 
static void drawLineCallback (HIC_Rendition const *rendition, int count, HIC_DC_Point p[])
 
static void drawLineCallbackClip (HIC_Rendition const *rendition, int count, HIC_DC_Point p[])
 
static void drawMarkerCallback (HIC_Rendition const *rendition, HIC_DC_Point *p)
 
static HC_KEY GetKey (HC_KEY)
 
static bool IsAnnotation (HC_KEY key)
 
static bool IsNote (HC_KEY noteskey)
 
static void recursive_resize (HC_KEY seg_key, int include_count, HC_KEY include_keys[], HC_KEY view_key)
 
static void WindowResizeCallback (int signal, void *signal_data, void *user_data)
 

Static Protected Member Functions

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

Protected Attributes

HC_KEY m_MyKey
 
HC_KEY m_MyTextKey
 
HPoint m_position
 
HPoint m_target
 

Static Protected Attributes

static int g_height
 
static HC_KEY g_segmentkey
 
static int g_width
 

Detailed Description

The HUtilityAnnotation class defines and manages annotations.

This class simplified the creation of annotations.

Member Function Documentation

◆ AddChar() [1/2]

virtual void HUtilityAnnotation::AddChar ( char  the_char)
virtual

Adds a char to the note

◆ AddChar() [2/2]

virtual void HUtilityAnnotation::AddChar ( unsigned short  the_char)
virtual

Adds a unicode char to the note

◆ ChangeAllFonts()

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

◆ GetBackgroundSegmentKey()

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

◆ GetKey() [1/2]

virtual HC_KEY HUtilityAnnotation::GetKey ( )
inlinevirtual

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

◆ GetKey() [2/2]

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.

◆ GetOnTop()

virtual bool HUtilityAnnotation::GetOnTop ( )
virtual

This return if the note on top of "normal" geometry

Returns
If note is on top

◆ GetText()

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

Fills text with the current note text

Parameters
texta pointer to where the text should be written (may be null)
lengthreturn values for how much text was put in the buffer

◆ GetTextLength()

virtual int HUtilityAnnotation::GetTextLength ( )
virtual

Returns just the length of the text

◆ GetTextWithEncoding()

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

Fills text with the current note text

Parameters
texta pointer to where the text should be written (may be null)
lengthreturn values for how much text was put in the buffer

◆ GetType()

virtual char const* HUtilityAnnotation::GetType ( )
inlinevirtual

Returns "HUtilityAnnotation"

Reimplemented in HUtilityAnnotationMeasure.

◆ Insert() [1/2]

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
targetwhere the arrow should point
positionwhere the text is positioned
AnnotateThiskey to what this annotation is annotating
pViewpointer to the view
layer_keystyle segment for this note
bg_typeone of four stock background types
useArrowsets the visibility of the arrow
key_pathis the key path returned by HC_Show_Selection_Original_Keys
key_path_lengthis the length returned by HC_Show_Selection_Original_Keys
Returns
key to the root of the note segment tree

Reimplemented in HUtilityAnnotationMeasure.

◆ Insert() [2/2]

virtual HC_KEY HUtilityAnnotation::Insert ( const char *  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
textinitial text for this note
targetwhere the arrow should point
positionwhere the text is positioned
AnnotateThiskey to what this annotation is annotating
pViewpointer to the view
layer_keystyle segment for this note
bg_typeone of four stock background types
useArrowsets the visibility of the arrow
key_pathis the key path returned by HC_Show_Selection_Original_Keys
key_path_lengthis the length returned by HC_Show_Selection_Original_Keys
Returns
key to the root of the note segment tree

Reimplemented in HUtilityAnnotationMeasure.

◆ InsertWithEncoding()

virtual HC_KEY HUtilityAnnotation::InsertWithEncoding ( const unsigned short *  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
textinitial text for this note
targetwhere the arrow should point
positionwhere the text is positioned
AnnotateThiskey to what this annotation is annotating
pViewpointer to the view
layer_keystyle segment for this note
bg_typeone of four stock background types
useArrowsets the visibility of the arrow
key_pathis the key path returned by HC_Show_Selection_Original_Keys
key_path_lengthis the length returned by HC_Show_Selection_Original_Keys
Returns
key to the root of the note segment tree

Reimplemented in HUtilityAnnotationMeasure.

◆ IsAnnotation()

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.

◆ IsNote()

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()

◆ MoveText() [1/2]

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

Repositions the text

◆ MoveText() [2/2]

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

Repositions the text and target.

◆ recursive_resize()

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).

◆ Resize()

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.

◆ SetBackgroundType()

virtual void HUtilityAnnotation::SetBackgroundType ( long  type)
virtual

Sets the background type to one of the four predefined types

Parameters
typecan be 0, 1, 2, 3 or BG_CIRCLE, BG_QUAD, BG_CLOUD, BG_NONE

◆ SetColor()

virtual void HUtilityAnnotation::SetColor ( char const *  color)
virtual

sets the color at the root of the note segment tree

Parameters
colorcan be anything that HC_Set_Color accepts

◆ SetEdgeWeight()

virtual void HUtilityAnnotation::SetEdgeWeight ( float  weight)
virtual

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

◆ SetExtents()

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

◆ SetFacePattern()

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

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

Parameters
patterncan be anything that HC_Set_Face_Pattern accepts

◆ SetLinePattern()

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

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

Parameters
patterncan be anything that HC_Set_Line_Pattern accepts

◆ SetLineWeight()

virtual void HUtilityAnnotation::SetLineWeight ( float  weight)
virtual

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

◆ SetNote() [1/2]

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

Changes the note the class refers to

Parameters
noteskeyshould 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_keyThe view key where a camera can be found by compute text extents

◆ SetNote() [2/2]

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

Changes the note the class refers to

Parameters
noteskeyshould be a key that IsNote returns true on and is the key to the note we want this class to refer to and manipulate
pViewThe view where a camera can be found by compute text extents

Reimplemented in HUtilityAnnotationMeasure.

◆ SetOnTop()

virtual void HUtilityAnnotation::SetOnTop ( bool  t)
virtual

Sets this note on top of "normal" geometry

Parameters
tif true, the note will be on top, false will unset the note as on top.

◆ SetText()

virtual void HUtilityAnnotation::SetText ( char const *  text)
virtual

Sets the text of this note

◆ SetTextFont()

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
fontis anything that is accepted by HC_Set_Text_Font Setting points or pixels may result in incorrectly sized text when printing.

◆ SetTextWithEncoding()

virtual void HUtilityAnnotation::SetTextWithEncoding ( unsigned short const *  text)
virtual

Sets unicode text for this note

◆ ShowPosition() [1/2]

virtual void HUtilityAnnotation::ShowPosition ( HPoint p)
virtual

Returns the position of the text in world space

◆ ShowPosition() [2/2]

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

Returns the position of the text in world space

◆ ShowTarget() [1/2]

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

◆ ShowTarget() [2/2]

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

◆ UnSetExtents()

virtual void HUtilityAnnotation::UnSetExtents ( )
virtual

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

◆ WindowResizeCallback()

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


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