Alphabetical Class Index  Class Hierarchy   File Members   Compound Members   File List  

HUtilityAnnotation Class Reference

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

#include <HUtilityAnnotation.h>

Inheritance diagram for HUtilityAnnotation:

HUtilityAnnotationMeasure

List of all members.

Public Member Functions

virtual void AddChar (unsigned short the_char)
virtual void AddChar (char 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 (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 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 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 &tar, HPoint const &pos, HCamera const *camera=0)
virtual void MoveText (HPoint const &pos, HCamera const *camera=0)
virtual void Resize (HC_KEY include_keys, HC_KEY view_key)
virtual void Resize (int include_count, 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, HBaseView *pView)
virtual void SetNote (HC_KEY noteskey, HC_KEY view_key)
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 (float *x, float *y, float *z)
virtual void ShowPosition (HPoint &p)
virtual void ShowTarget (float *x, float *y, float *z)
virtual void ShowTarget (HPoint &p)
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

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

Adds a unicode char to the note

virtual void HUtilityAnnotation::AddChar ( char  the_char  )  [virtual]

Adds a char to the note

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

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

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.

virtual HC_KEY HUtilityAnnotation::GetKey (  )  [inline, virtual]

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

References HC_KEY.

virtual bool HUtilityAnnotation::GetOnTop (  )  [virtual]

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

Returns:
If note is on top

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 (  )  [inline, virtual]

Returns "HUtilityAnnotation"

Reimplemented in HUtilityAnnotationMeasure.

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:
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

Reimplemented in HUtilityAnnotationMeasure.

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

Reimplemented in HUtilityAnnotationMeasure.

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:
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

Reimplemented in HUtilityAnnotationMeasure.

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

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

Repositions the text and target.

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

Repositions the text

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

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::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,
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

Reimplemented in HUtilityAnnotationMeasure.

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::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 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 ( float *  x,
float *  y,
float *  z 
) [virtual]

Returns the position of the text in world space

virtual void HUtilityAnnotation::ShowPosition ( HPoint p  )  [virtual]

Returns the position of the text in world space

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::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::UnSetExtents (  )  [virtual]

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

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: