HMarkupManager.h
1 // Copyright (c) Tech Soft 3D, Inc.
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 #ifndef H_MARKUP_MANAGER_H
11 #define H_MARKUP_MANAGER_H
12 
13 #ifdef H_PACK_8
14 #pragma pack(push)
15 #pragma pack(8)
16 #endif
17 
18 #include "HTools.h"
19 #include "HUtility.h"
20 
21 
22 class HBaseView;
23 
28 class MVO_API HMarkupManager {
29 
30 public:
32  HMarkupManager(HBaseView *view);
33 
34 
37  void ReInit(HBaseView *view);
38 
39  virtual ~HMarkupManager();
40 
48  virtual HC_KEY OpenLayer(const char *layername, bool setcamera = true, bool emit_message = true);
49 
51  virtual HC_KEY RenameLayer(HC_KEY laykey, char const * new_name);
52 
54  virtual HC_KEY CopyLayer(HC_KEY laykey, char const * new_name);
55 
57  virtual bool GetCamera(HC_KEY layerkey, HCamera & cam) const;
58 
64  virtual HC_KEY OpenLayer(HC_KEY layerkey, bool setcamera = true);
65 
66 
71  virtual HC_KEY FindLayer(const char *layername) const;
72 
74  virtual char const * GetLayerNames() const;
75 
76 
79  virtual HC_KEY GetCurrentLayerKey() const;
80 
83  virtual char const * GetCurrentLayerName() const;
84 
85 
91  virtual void DisableCurrentLayer(bool emit_message = true);
92 
93 
99  virtual void DeleteLayer(const char *layername);
100 
105  virtual void DeleteLayer(HC_KEY layerkey);
106 
107 
111  void SetDefaultLayerKey(HC_KEY layerkey) {m_DefaultLayerKey = layerkey; }
112 
116  HC_KEY GetDefaultLayerKey() {return m_DefaultLayerKey; }
117 
121  HC_KEY GetMarkupKey() {return m_MarkupKey; }
122 
126  HC_KEY GetMarkupLayerKey() {return m_MarkupLayerKey; }
127 
130  virtual float GetMarkupWeight(){return m_fMarkupWeight;};
131 
137  virtual void SetMarkupWeight(float weight);
138 
142  virtual void GetMarkupColor(HPoint &markup_color){markup_color.Set(m_MarkupColor);};
143 
149  virtual void SetMarkupColor(HPoint markup_color);
150 
151 // HNet Work
152 
157  virtual void EmitMarkupSegment(HC_KEY key);
158 
165  virtual void InsertMarkupSegmentFromMessage(const char *in_data, unsigned int data_length);
166 
169  virtual void EmitDisableCurrentMarkupLayer();
170 
176  virtual void DisableCurrentMarkupLayerFromMessage(const char *data, unsigned int data_length);
177 
180  virtual void EmitSetMarkupLayer(const char *layer);
181 
187  virtual void SetMarkupLayerFromMessage(const char *data, unsigned int data_length);
188 
190  virtual bool GetPreviewImage(char const *, int*, int*, int*, unsigned char const**);
191 
192 
193  virtual void UpdatePreviewImage(bool forceUpdate = false);
194  bool IsCameraLayer(HC_KEY layerkey);
195 
196  /*
197  get and apply condition on model segments
198  */
199  void SetLayerCondition(HC_KEY layerkey);
200  /*
201  reset conditions applied on model segments
202  */
203  void UnsetCurrentLayerCondition();
204 
205  void UnsetLayerCondition(HC_KEY layerkey);
206 
207  void SetGeneratePreviewImage(bool onoff) {m_bGeneratePreviewImage = onoff; }
208  bool GetGeneratePreviewImage() { return m_bGeneratePreviewImage; }
209  void SetNoResetOnCameraChange();
210  bool GetResetOnCameraChange(HC_KEY layerkey);
211 
212 
213 protected:
216  virtual void SetupNewLayer();
222  virtual void OpenLayerInternal(HC_KEY layerkey, bool setcamera);
227  virtual char *FindValidLayerName(char *newlayername);
230  mutable char * m_ActiveLayerName;
232  HC_KEY m_MarkupKey;
236  mutable char * m_allNames;
237  bool m_bGeneratePreviewImage;
238 };
239 
240 
241 #ifdef H_PACK_8
242 #pragma pack(pop)
243 #endif
244 
245 #endif
246 
247 
248 
249 
250 
251 
252 
253 
254 
255 
256 
257 
258 
259 
float m_fMarkupWeight
Weight of markup geometry.
Definition: HMarkupManager.h:235
HC_KEY GetMarkupKey()
Definition: HMarkupManager.h:121
Definition: HMarkupManager.h:28
The HCamera class is the data type of a HOOPS Camera Attribute.
Definition: HUtility.h:540
virtual float GetMarkupWeight()
Definition: HMarkupManager.h:130
HC_KEY GetMarkupLayerKey()
Definition: HMarkupManager.h:126
void SetDefaultLayerKey(HC_KEY layerkey)
Definition: HMarkupManager.h:111
char * m_ActiveLayerName
Currently open lay name.
Definition: HMarkupManager.h:230
HC_KEY m_DefaultLayerKey
Default layer (gets used if no other layer is open)
Definition: HMarkupManager.h:231
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
HC_KEY GetDefaultLayerKey()
Definition: HMarkupManager.h:116
HC_KEY m_MarkupLayerKey
Key to parent segment of all layers.
Definition: HMarkupManager.h:233
HBaseView * m_pHView
A pointer to the view object.
Definition: HMarkupManager.h:228
HC_KEY m_ActiveLayerKey
Currently open markup layer.
Definition: HMarkupManager.h:229
HC_KEY m_MarkupKey
Key to the top level markup layer.
Definition: HMarkupManager.h:232
HPoint m_MarkupColor
Color of markup geometry.
Definition: HMarkupManager.h:234
void Set(float X, float Y, float Z=0.0f)
Definition: HGlobals.h:141
virtual void GetMarkupColor(HPoint &markup_color)
Definition: HMarkupManager.h:142