HUtilitySubwindow.h
Go to the documentation of this file.
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 
14 #ifndef _H_HUtilitySubwindow_H
15 #define _H_HUtilitySubwindow_H
16 
17 #ifdef H_PACK_8
18 #pragma pack(push)
19 #pragma pack(8)
20 #endif
21 
22 #include "HTools.h"
23 #include "HEventListener.h"
24 #include "HBaseOperator.h"
25 #include "HEventManager.h"
26 
27 
28 #define SUBWINDOW_NOTYPE 0
29 #define SUBWINDOW_MAGNIFIER 1
30 #define SUBWINDOW_SNAPSHOT 2
31 #define SUBWINDOW_POINTER 3
32 
33 
34 #define SW_ACTION_NOACTION 0
35 #define SW_ACTION_MOVE 1
36 #define SW_ACTION_SIZING 2
37 #define SW_ACTION_MAGNIFYING 3
38 #define SW_ACTION_POINTERMOVE 4
39 #define SW_ACTION_DRAGGING 5
40 
41 #define SW_BORDER 1
42 #define SW_SIZE_FIELD 2
43 #define SW_MOVE_FIELD 4
44 #define SW_DRAG_FIELD 8
45 #define SW_DELETE_FIELD 16
46 #define SW_MAGNIFIER_FIELD 32
47 #define SW_BACKGROUND_BOX 64
48 
49 
50 class HBaseView;
51 
52 
54 class MVO_API HSubwindow : public HObject, public HBaseOperator, public HUpdateListener, public HFitWorldListener, public HObjectManipulationListener
60 {
61 
62 public:
63 
71  HSubwindow (HBaseView* view, int DoRepeat=0, int DoCapture=1);
75  HSubwindow ();
76  virtual ~HSubwindow();
77 
78 
89  virtual void Insert(float left, float right, float bottom, float top, int type = SUBWINDOW_NOTYPE, long appearance =
91 
96  virtual void Reset();
97 
98 
102  virtual bool IsActive();
103 
108  virtual void GetFromKey(HC_KEY key);
109 
114  virtual bool IsSubwindow(HC_KEY key);
115 
123  virtual bool FindSubwindow(HBaseView *view, HPoint pos, bool &pointerselected);
124 
130  virtual HC_KEY FindSubwindowFromSegment(HC_KEY key);
131 
137  virtual void GetPosition(float &x,float &y);
138 
144  virtual void SetPosition(float x,float y);
145 
146 
150  virtual HC_KEY GetWindowKey();
151 
157  virtual void GetSize(float &x,float &y);
158 
164  virtual void SetSize(float deltax, float deltay);
165 
166 
171  virtual void MakeCameraSnapshot(HBaseView *view);
172 
178  virtual void ConvertFromSubwindowToView(HPoint &in_point, HPoint &out_point);
179 
185  virtual void ConvertFromViewToSubwindow(HPoint const & in_point, HPoint & out_point);
186 
187 
194  virtual void ChangeType(int type, long appearance = SW_BORDER | SW_SIZE_FIELD | SW_MOVE_FIELD | SW_DRAG_FIELD | SW_DELETE_FIELD | SW_MAGNIFIER_FIELD | SW_BACKGROUND_BOX);
195 
201  virtual void GetPointerPosition(float &x,float &y);
202 
208  virtual void SetPointerPosition(float x,float y);
209 
217  virtual void SetSize(float left, float right, float bottom, float top);
218 
228  virtual void ComputeCoordinates(HBaseView *view, const char *in_system, HPoint &from, const char *out_system, HPoint &to);
229 
230 
237  virtual void Drag(HBaseView *view, HPoint p1, HPoint p2);
238 
243  virtual void SyncViewToWindow(HBaseView *view);
244 
249  virtual int GetType() { return m_Type; }
250 
255  virtual HC_KEY GetKey() { return m_OuterKey; }
256 
260  virtual const char * GetName();
264  static const char * GetStaticName();
265 
272  virtual int OnLButtonDown (HEventInfo &hevent);
279  virtual int OnLButtonUp (HEventInfo &hevent);
280 
287  virtual int CameraChangedEvent(HBaseView *view);
294  virtual int PreFitWorldEvent(HBaseView *view);
295 
302  virtual int PostFitWorldEvent(HBaseView *view);
303 
304 
313  virtual int OnLButtonDownAndMove(HEventInfo &hevent);
314 
322  virtual int SetupHandlesEvent(HBaseView *view, HC_KEY key, bool complex);
323 
331  virtual int ObjectMovedEvent(HBaseView *view, HC_KEY key, HPoint *p);
339  virtual int ObjectScaledEvent(HBaseView *view, HC_KEY key, HPoint &scale);
340 
341 protected:
342 
346  void GetParameters();
352  bool IsInSizeArea(HPoint &point);
358  bool IsInMagnifyArea(HPoint &point);
363  void CopyViewLight(HBaseView *view);
368  void BuildMagnifyController(float pos);
369 
370 
376  void ChangeMagnification(HBaseView *view, HPoint & p);
381  void Magnify(HBaseView *view);
382 
386  void ShowPointer();
392  bool IsInCloseArea(HPoint &point);
398  bool IsInDragArea(HPoint &point);
399 
403  void BuildBorder();
409  bool IsInMoveArea(HPoint &point);
415  void ChangeMagnification(HBaseView *view, float magnification);
419  void MakeKeyframe();
420 
424  void MakeScaleKeyframe();
425 
426  HC_KEY m_OuterKey;
427  HC_KEY m_WindowKey;
430  float m_Left;
431  float m_Right;
432  float m_Bottom;
433  float m_Top;
435  int m_Type;
440  int m_Action;
442 };
443 
444 
445 #ifdef H_PACK_8
446 #pragma pack(pop)
447 #endif
448 
449 #endif
450 
451 
452 
453 
454 
455 
456 
457 
458 
virtual int OnLButtonDownAndMove(HEventInfo &hevent)
virtual const char * GetName()
The HObject is the base class for generic MVO objects.
Definition: HEventManager.h:115
long m_Appearance
Definition: HUtilitySubwindow.h:438
virtual int OnLButtonUp(HEventInfo &hevent)
The HSubwindow class encapsulates interactive floating subwindows.
Definition: HUtilitySubwindow.h:59
#define SW_BACKGROUND_BOX
Subwindow has a shadow.
Definition: HUtilitySubwindow.h:47
HC_KEY m_WindowKey
Definition: HUtilitySubwindow.h:427
#define SW_BORDER
Subwindow has borders.
Definition: HUtilitySubwindow.h:41
#define SW_SIZE_FIELD
Subwindow has a resize area.
Definition: HUtilitySubwindow.h:42
virtual int GetType()
Definition: HUtilitySubwindow.h:249
#define SW_MOVE_FIELD
Subwindow can be moved.
Definition: HUtilitySubwindow.h:43
float m_Top
Definition: HUtilitySubwindow.h:433
The HBaseOperator class serves as a base for classes which handle user input and operate on the scene...
Definition: HBaseOperator.h:60
#define SUBWINDOW_NOTYPE
The basic window type.
Definition: HUtilitySubwindow.h:28
float m_OldMagnification
Definition: HUtilitySubwindow.h:437
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
int m_Action
Definition: HUtilitySubwindow.h:440
float m_Right
Definition: HUtilitySubwindow.h:431
The HEventInfo class stores and manages event information.
Definition: HEventInfo.h:207
virtual HC_KEY GetKey()
Definition: HUtilitySubwindow.h:255
#define SW_DELETE_FIELD
Subwindow has a close button.
Definition: HUtilitySubwindow.h:45
virtual int OnLButtonDown(HEventInfo &hevent)
float m_Bottom
Definition: HUtilitySubwindow.h:432
HC_KEY m_OuterKey
Definition: HUtilitySubwindow.h:426
float m_Magnification
Definition: HUtilitySubwindow.h:436
HPoint m_ptLast
Definition: HUtilitySubwindow.h:441
#define SW_MAGNIFIER_FIELD
Subwindow has a magnifier slider.
Definition: HUtilitySubwindow.h:46
float m_Left
Definition: HUtilitySubwindow.h:430
#define SW_DRAG_FIELD
Subwindow allows the scene to be moved inside the window.
Definition: HUtilitySubwindow.h:44
int m_Type
Definition: HUtilitySubwindow.h:435
HPoint m_Pointer
Definition: HUtilitySubwindow.h:439