Alphabetical Class Index  Class Hierarchy   File Members   Compound Members   File List  

HUtilityAnnotation.h
1 //
2 // Copyright (c) 2000 by Tech Soft 3D, LLC.
3 // The information contained herein is confidential and proprietary to
4 // Tech Soft 3D, LLC., and considered a trade secret as defined under
5 // civil and criminal statutes. Tech Soft 3D shall pursue its civil
6 // and criminal remedies in the event of unauthorized use or misappropriation
7 // of its trade secrets. Use of this information by anyone other than
8 // authorized employees of Tech Soft 3D, LLC. is granted only under a
9 // written non-disclosure agreement, expressly prescribing the scope and
10 // manner of such use.
11 //
12 
13 // HUtilityAnnotation.h : interface of the HUtilityAnnotation class
14 
15 
16 
17 #ifndef _HUtilityAnnotation_H
18 #define _HUtilityAnnotation_H
19 
20 #ifdef H_PACK_8
21 #pragma pack(push)
22 #pragma pack(8)
23 #endif
24 
25 #include "hic_types.h"
26 
27 #include "HTools.h"
28 
29 class HPoint;
30 class HBaseView;
31 class HCamera;
32 
33 #define BG_CIRCLE 0
34 #define BG_QUAD 1
35 #define BG_CLOUD 2
36 #define BG_NONE 3
37 
38 
40 
43 class MVO_API HUtilityAnnotation
44 {
45 public:
46  HUtilityAnnotation() {;};
47 
48  virtual ~HUtilityAnnotation() {;};
49 
51  virtual void AddChar(char the_char);
52 
54  virtual void AddChar(unsigned short the_char);
55 
59  virtual HC_KEY GetBackgroundSegmentKey();
60 
62  virtual HC_KEY GetKey() {return m_MyKey;}
63 
65  static HC_KEY GetKey(HC_KEY);
66 
70  virtual void GetText(char * text, int &length);
71 
73  virtual int GetTextLength();
74 
78  virtual void GetTextWithEncoding(unsigned short * text, int &length);
79 
81  virtual char const* GetType() {return "HUtilityAnnotation";};
82 
94  virtual HC_KEY Insert(
95  HPoint target,
96  HPoint position,
97  HC_KEY AnnotateThis,
98  HBaseView * pView,
99  HC_KEY layer_key = INVALID_KEY,
100  int bg_type = BG_QUAD,
101  bool useArrow = true,
102  HC_KEY * key_path = (HC_KEY*)0,
103  int key_path_length = 0);
104 
117  virtual HC_KEY Insert(
118  const char * text,
119  HPoint target,
120  HPoint position,
121  HC_KEY AnnotateThis,
122  HBaseView * pView,
123  HC_KEY layer_key = INVALID_KEY,
124  int bg_type = BG_QUAD,
125  bool useArrow = true,
126  HC_KEY * key_path = (HC_KEY*)0,
127  int key_path_length = 0);
128 
141  virtual HC_KEY InsertWithEncoding(
142  const unsigned short * text,
143  HPoint target,
144  HPoint position,
145  HC_KEY AnnotateThis,
146  HBaseView * pView,
147  HC_KEY layer_key = INVALID_KEY,
148  int bg_type = BG_QUAD,
149  bool useArrow = true,
150  HC_KEY * key_path = (HC_KEY*)0,
151  int key_path_length = 0);
152 
157  static bool IsAnnotation(HC_KEY key);
158 
161  static bool IsNote(HC_KEY noteskey);
162 
164  static void ChangeAllFonts(HBaseView * view, char const * const font, HC_KEY seg_key = INVALID_KEY);
165 
167  virtual void MoveText(HPoint const & pos, HCamera const * camera = 0);
168 
170  virtual void MoveText(HPoint const & tar, HPoint const & pos, HCamera const * camera = 0);
171 
174  virtual void SetBackgroundType(long type);
175 
178  virtual void SetColor(char const * color);
179 
181  virtual void SetEdgeWeight(float weight);
182 
184  virtual void SetExtents(int xpixels, int ypixels, HC_KEY view_key);
185 
188  virtual void SetFacePattern(char const * pattern);
189 
192  virtual void SetLinePattern(char const * pattern);
193 
195  virtual void SetLineWeight(float weight);
196 
201  virtual void SetNote(HC_KEY noteskey, HC_KEY view_key);
202 
207  virtual void SetNote(HC_KEY noteskey, HBaseView* pView);
208 
211  virtual void SetOnTop(bool t);
212 
215  virtual bool GetOnTop();
216 
218  virtual void SetText(char const * text);
219 
223  virtual void SetTextFont(char const * font);
224 
226  virtual void SetTextWithEncoding(unsigned short const * text);
227 
229  virtual void ShowPosition(HPoint &p);
230 
232  virtual void ShowPosition(float *x, float *y, float *z);
233 
235  virtual void ShowTarget(HPoint &p);
236 
238  virtual void ShowTarget(float *x, float *y, float *z);
239 
241  virtual void UnSetExtents();
242 
246  virtual void Resize(int include_count, HC_KEY *include_keys, HC_KEY view_key);
247 
248  virtual void Resize(HC_KEY include_keys, HC_KEY view_key) {
249  HC_KEY key = include_keys;
250  Resize(1, &key, view_key);
251  };
252 
253  /* This is the direction the note was facing the last time it was moved (if the caller passed
254  * in a camera on the last move). */
255  virtual HPoint GetFacing() const;
256 
257  /* This is the up direction of the note the last time it was moved (if the caller passed
258  * in a camera on the last move). */
259  virtual HPoint GetUp() const;
260 
263  static void WindowResizeCallback(int signal, void * signal_data, void * user_data);
264 
267  static void recursive_resize(HC_KEY seg_key, int include_count, HC_KEY *include_keys, HC_KEY view_key);
268 
269  static void drawLineCallback (HIC_Rendition const *rendition,int count, HIC_DC_Point *p);
270  static void drawLineCallbackClip (HIC_Rendition const *rendition,int count, HIC_DC_Point *p);
271  static void drawMarkerCallback (HIC_Rendition const *rendition, HIC_DC_Point *p);
272 private:
273 
274 
275 
277  static void recursive_change_font(HC_KEY seg_key, int include_count, HC_KEY *include_keys, HC_KEY view_key, char const * const font);
278 
279  void SetConditionalVisibility(HBaseView * pView, HC_KEY const * const key_path, int const key_path_length);
280 
281 protected:
282  static int Clip_Line_Inverse(HIC_DC_Point *p, HIC_DC_Point *po, int top, int left, int bottom, int right);
283  static int Clip_Line(HIC_DC_Point *p, HIC_DC_Point *po, int top, int left, int bottom, int right);
284 
285  HC_KEY m_MyKey;
286  HC_KEY m_MyTextKey;
287  static HC_KEY g_segmentkey;
288  static int g_width;
289  static int g_height;
290 
291  HPoint m_target, m_position;
292 };
293 
294 #ifdef H_PACK_8
295 #pragma pack(pop)
296 #endif
297 
298 #endif
299 
300 
301 
#define HC_KEY
The HCamera class is the data type of a HOOPS Camera Attribute.
Definition: HUtility.h:543
virtual HC_KEY GetKey()
Definition: HUtilityAnnotation.h:62
The HPoint class is the data type of a three-dimensional point.
Definition: HGlobals.h:126
The HBaseView class defines and manages a view of model information.
Definition: HBaseView.h:337
The HUtilityAnnotation class defines and manages annotations.
Definition: HUtilityAnnotation.h:43
virtual char const * GetType()
Definition: HUtilityAnnotation.h:81