Alphabetical Class Index  Class Hierarchy   File Members   Compound Members   File List  

HUtilityAnnotation.h
00001 //
00002 // Copyright (c) 2000 by Tech Soft 3D, LLC.
00003 // The information contained herein is confidential and proprietary to
00004 // Tech Soft 3D, LLC., and considered a trade secret as defined under
00005 // civil and criminal statutes.  Tech Soft 3D shall pursue its civil
00006 // and criminal remedies in the event of unauthorized use or misappropriation
00007 // of its trade secrets.  Use of this information by anyone other than
00008 // authorized employees of Tech Soft 3D, LLC. is granted only under a
00009 // written non-disclosure agreement, expressly prescribing the scope and
00010 // manner of such use.
00011 //
00012 
00013 // HUtilityAnnotation.h : interface of the HUtilityAnnotation class
00014 
00015 
00016 
00017 #ifndef _HUtilityAnnotation_H
00018 #define _HUtilityAnnotation_H
00019  
00020 #ifdef H_PACK_8
00021 #pragma pack(push)
00022 #pragma pack(8)
00023 #endif
00024 
00025 #include "hic_types.h"
00026 
00027 #include "HTools.h"
00028 
00029 class HPoint;
00030 class HBaseView;
00031 class HCamera;
00032 
00033 #define BG_CIRCLE   0
00034 #define BG_QUAD     1
00035 #define BG_CLOUD    2
00036 #define BG_NONE     3
00037 
00038 
00040 
00043 class MVO_API HUtilityAnnotation
00044 {
00045 public:
00046     HUtilityAnnotation() : m_MyTextKey(INVALID_KEY) {;};
00047 
00048     virtual ~HUtilityAnnotation() {;};
00049 
00051     virtual void AddChar(char the_char);
00052 
00054     virtual void AddChar(unsigned short the_char);
00055 
00059     virtual HC_KEY GetBackgroundSegmentKey();
00060 
00062     virtual HC_KEY GetKey() {return m_MyKey;}
00063 
00065     static HC_KEY GetKey(HC_KEY);
00066 
00070     virtual void GetText(char * text, int &length);
00071 
00073     virtual int  GetTextLength();
00074 
00078     virtual void GetTextWithEncoding(unsigned short * text, int &length);
00079 
00081     virtual char const* GetType() {return "HUtilityAnnotation";};
00082 
00094     virtual HC_KEY Insert(
00095         HPoint target,
00096         HPoint position,
00097         HC_KEY AnnotateThis,
00098         HBaseView * pView,
00099         HC_KEY layer_key = INVALID_KEY,
00100         int bg_type = BG_QUAD,
00101         bool useArrow = true,
00102         HC_KEY * key_path = (HC_KEY*)0,
00103         int key_path_length = 0);
00104 
00117     virtual HC_KEY Insert(
00118         const char * text,
00119         HPoint target,
00120         HPoint position,
00121         HC_KEY AnnotateThis,
00122         HBaseView * pView,
00123         HC_KEY layer_key = INVALID_KEY,
00124         int bg_type = BG_QUAD,
00125         bool useArrow = true,
00126         HC_KEY * key_path = (HC_KEY*)0,
00127         int key_path_length = 0);
00128 
00141     virtual HC_KEY InsertWithEncoding(
00142         const unsigned short * text,
00143         HPoint target,
00144         HPoint position,
00145         HC_KEY AnnotateThis,
00146         HBaseView * pView,
00147         HC_KEY layer_key = INVALID_KEY,
00148         int bg_type = BG_QUAD,
00149         bool useArrow = true,
00150         HC_KEY * key_path = (HC_KEY*)0,
00151         int key_path_length = 0);
00152     
00157     static bool IsAnnotation(HC_KEY key);
00158 
00161     static bool IsNote(HC_KEY noteskey);
00162 
00164     static void ChangeAllFonts(HBaseView * view, char const * const font, HC_KEY seg_key = INVALID_KEY);
00165 
00167     virtual void MoveText(HPoint const & pos, HCamera const * camera = 0);
00168 
00170     virtual void MoveText(HPoint const & tar, HPoint const & pos, HCamera const * camera = 0);
00171 
00174     virtual void SetBackgroundType(long type);
00175 
00178     virtual void SetColor(char const * color);
00179 
00181     virtual void SetEdgeWeight(float weight);
00182 
00184     virtual void SetExtents(int xpixels, int ypixels, HC_KEY view_key);
00185 
00188     virtual void SetFacePattern(char const * pattern);
00189 
00192     virtual void SetLinePattern(char const * pattern);
00193 
00195     virtual void SetLineWeight(float weight);
00196 
00201     virtual void SetNote(HC_KEY noteskey, HC_KEY view_key);
00202 
00207     virtual void SetNote(HC_KEY noteskey, HBaseView* pView);
00208     
00211     virtual void SetOnTop(bool t);
00212 
00215     virtual bool GetOnTop();
00216 
00218     virtual void SetText(char const * text);
00219 
00223     virtual void SetTextFont(char const * font);
00224 
00226     virtual void SetTextWithEncoding(unsigned short const * text);
00227 
00229     virtual void ShowPosition(HPoint &p);
00230 
00232     virtual void ShowPosition(float *x, float *y, float *z);
00233 
00235     virtual void ShowTarget(HPoint &p);
00236 
00238     virtual void ShowTarget(float *x, float *y, float *z);
00239 
00241     virtual void UnSetExtents();
00242 
00246     virtual void Resize(int include_count, HC_KEY *include_keys, HC_KEY view_key);
00247 
00248     virtual void Resize(HC_KEY include_keys, HC_KEY view_key) {
00249         HC_KEY key = include_keys;
00250         Resize(1, &key, view_key);
00251     };
00252 
00253     /* This is the direction the note was facing the last time it was moved (if the caller passed
00254      * in a camera on the last move). */
00255     virtual HPoint GetFacing() const;
00256 
00257     /* This is the up direction of the note the last time it was moved (if the caller passed
00258      * in a camera on the last move). */
00259     virtual HPoint GetUp() const;
00260 
00263     static void WindowResizeCallback(int signal, void * signal_data, void * user_data);
00264 
00267     static void recursive_resize(HC_KEY seg_key, int include_count, HC_KEY *include_keys, HC_KEY view_key);
00268 
00269     static void drawLineCallback (HIC_Rendition const *rendition,int count, HIC_DC_Point *p);
00270     static void drawLineCallbackClip (HIC_Rendition const *rendition,int count, HIC_DC_Point *p);
00271     static void drawMarkerCallback (HIC_Rendition const *rendition, HIC_DC_Point *p);
00272 private:
00273 
00274  
00275  
00277     static void recursive_change_font(HC_KEY seg_key, int include_count, HC_KEY *include_keys, HC_KEY view_key, char const * const font);
00278 
00279     void SetConditionalVisibility(HBaseView * pView, HC_KEY const * const key_path, int const key_path_length);
00280     
00281 protected:
00282     static int   Clip_Line_Inverse(HIC_DC_Point  *p, HIC_DC_Point  *po, int top, int left, int bottom, int right);
00283     static int   Clip_Line(HIC_DC_Point  *p, HIC_DC_Point  *po, int top, int left, int bottom, int right);
00284 
00285     HC_KEY m_MyKey;
00286     HC_KEY m_MyTextKey;
00287     static HC_KEY g_segmentkey;
00288     static int g_width;
00289     static int g_height;
00290 
00291     HPoint m_target, m_position;
00292 };
00293 
00294 #ifdef H_PACK_8
00295 #pragma pack(pop)
00296 #endif
00297 
00298 #endif
00299 
00300 
00301