00001 // Copyright (c) 1998-2014 by Tech Soft 3D, Inc. 00002 // 00003 // The information contained herein is confidential and proprietary to Tech Soft 3D, Inc., 00004 // and considered a trade secret as defined under civil and criminal statutes. 00005 // Tech Soft 3D, Inc. shall pursue its civil and criminal remedies in the event of 00006 // unauthorized use or misappropriation of its trade secrets. Use of this information 00007 // by anyone other than authorized employees of Tech Soft 3D, Inc. is granted only under 00008 // a written non-disclosure agreement, expressly prescribing the scope and manner of such use. 00009 00010 #ifndef H_MARKUP_MANAGER_H 00011 #define H_MARKUP_MANAGER_H 00012 00013 #ifdef H_PACK_8 00014 #pragma pack(push) 00015 #pragma pack(8) 00016 #endif 00017 00018 #include "HTools.h" 00019 #include "HUtility.h" 00020 00021 00022 class HBaseView; 00023 00028 class MVO_API HMarkupManager { 00029 00030 public: 00032 HMarkupManager(HBaseView *view); 00033 00034 00037 void ReInit(HBaseView *view); 00038 00039 virtual ~HMarkupManager(); 00040 00048 virtual HC_KEY OpenLayer(const char *layername, bool setcamera = true, bool emit_message = true); 00049 00051 virtual HC_KEY RenameLayer(HC_KEY laykey, char const * new_name); 00052 00054 virtual HC_KEY CopyLayer(HC_KEY laykey, char const * new_name); 00055 00057 virtual bool GetCamera(HC_KEY layerkey, HCamera & cam) const; 00058 00064 virtual HC_KEY OpenLayer(HC_KEY layerkey, bool setcamera = true); 00065 00066 00071 virtual HC_KEY FindLayer(const char *layername) const; 00072 00074 virtual char const * GetLayerNames() const; 00075 00076 00079 virtual HC_KEY GetCurrentLayerKey() const; 00080 00083 virtual char const * GetCurrentLayerName() const; 00084 00085 00091 virtual void DisableCurrentLayer(bool emit_message = true); 00092 00093 00099 virtual void DeleteLayer(const char *layername); 00100 00105 virtual void DeleteLayer(HC_KEY layerkey); 00106 00107 00111 void SetDefaultLayerKey(HC_KEY layerkey) {m_DefaultLayerKey = layerkey; } 00112 00116 HC_KEY GetDefaultLayerKey() {return m_DefaultLayerKey; } 00117 00121 HC_KEY GetMarkupKey() {return m_MarkupKey; } 00122 00126 HC_KEY GetMarkupLayerKey() {return m_MarkupLayerKey; } 00127 00130 virtual float GetMarkupWeight(){return m_fMarkupWeight;}; 00131 00137 virtual void SetMarkupWeight(float weight); 00138 00142 virtual void GetMarkupColor(HPoint &markup_color){markup_color.Set(m_MarkupColor);}; 00143 00149 virtual void SetMarkupColor(HPoint markup_color); 00150 00151 // HNet Work 00152 00157 virtual void EmitMarkupSegment(HC_KEY key); 00158 00165 virtual void InsertMarkupSegmentFromMessage(const char *in_data, unsigned int data_length); 00166 00169 virtual void EmitDisableCurrentMarkupLayer(); 00170 00176 virtual void DisableCurrentMarkupLayerFromMessage(const char *data, unsigned int data_length); 00177 00180 virtual void EmitSetMarkupLayer(const char *layer); 00181 00187 virtual void SetMarkupLayerFromMessage(const char *data, unsigned int data_length); 00188 00190 virtual bool GetPreviewImage(char const *, int*, int*, int*, unsigned char const**); 00191 00192 00193 virtual void UpdatePreviewImage(bool forceUpdate = false); 00194 bool IsCameraLayer(HC_KEY layerkey); 00195 00196 /* 00197 get and apply condition on model segments 00198 */ 00199 void SetLayerCondition(HC_KEY layerkey); 00200 /* 00201 reset conditions applied on model segments 00202 */ 00203 void UnsetCurrentLayerCondition(); 00204 00205 void UnsetLayerCondition(HC_KEY layerkey); 00206 00207 void SetGeneratePreviewImage(bool onoff) {m_bGeneratePreviewImage = onoff; } 00208 bool GetGeneratePreviewImage() { return m_bGeneratePreviewImage; } 00209 void SetNoResetOnCameraChange(); 00210 bool GetResetOnCameraChange(HC_KEY layerkey); 00211 00212 00213 protected: 00216 virtual void SetupNewLayer(); 00222 virtual void OpenLayerInternal(HC_KEY layerkey, bool setcamera); 00227 virtual char *FindValidLayerName(char *newlayername); 00228 HBaseView *m_pHView; 00229 HC_KEY m_ActiveLayerKey; 00230 mutable char * m_ActiveLayerName; 00231 HC_KEY m_DefaultLayerKey; 00232 HC_KEY m_MarkupKey; 00233 HC_KEY m_MarkupLayerKey; 00234 HPoint m_MarkupColor; 00235 float m_fMarkupWeight; 00236 mutable char * m_allNames; 00237 bool m_bGeneratePreviewImage; 00238 }; 00239 00240 00241 #ifdef H_PACK_8 00242 #pragma pack(pop) 00243 #endif 00244 00245 #endif 00246 00247 00248 00249 00250 00251 00252 00253 00254 00255 00256 00257 00258 00259