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