Alphabetical Class Index  Class Hierarchy   File Members   Compound Members   File List  

HUtilitySubwindow.h
Go to the documentation of this file.
1 //
2 // Copyright (c) 2000 by Tech Soft 3D, LLC.
3 // The information contained herein is confidential and proprietary to
4 // Tech Soft 3D, LLC., and considered a trade secret as defined under
5 // civil and criminal statutes. Tech Soft 3D shall pursue its civil
6 // and criminal remedies in the event of unauthorized use or misappropriation
7 // of its trade secrets. Use of this information by anyone other than
8 // authorized employees of Tech Soft 3D, LLC. is granted only under a
9 // written non-disclosure agreement, expressly prescribing the scope and
10 // manner of such use.
11 //
12 // $Id: cce130e47e02217230b0beee4572dc312e562cfb $
13 //
18 #ifndef _H_HUtilitySubwindow_H
19 #define _H_HUtilitySubwindow_H
20 
21 #ifdef H_PACK_8
22 #pragma pack(push)
23 #pragma pack(8)
24 #endif
25 
26 #include "HTools.h"
27 #include "HEventListener.h"
28 #include "HBaseOperator.h"
29 #include "HEventManager.h"
30 
31 
32 #define SUBWINDOW_NOTYPE 0
33 #define SUBWINDOW_MAGNIFIER 1
34 #define SUBWINDOW_SNAPSHOT 2
35 #define SUBWINDOW_POINTER 3
36 
37 
38 #define SW_ACTION_NOACTION 0
39 #define SW_ACTION_MOVE 1
40 #define SW_ACTION_SIZING 2
41 #define SW_ACTION_MAGNIFYING 3
42 #define SW_ACTION_POINTERMOVE 4
43 #define SW_ACTION_DRAGGING 5
44 
45 #define SW_BORDER 1
46 #define SW_SIZE_FIELD 2
47 #define SW_MOVE_FIELD 4
48 #define SW_DRAG_FIELD 8
49 #define SW_DELETE_FIELD 16
50 #define SW_MAGNIFIER_FIELD 32
51 #define SW_BACKGROUND_BOX 64
52 
53 
54 class HBaseView;
55 
56 
58 class MVO_API HSubwindow : public HObject, public HBaseOperator, public HUpdateListener, public HFitWorldListener, public HObjectManipulationListener
64 {
65 
66 public:
67 
75  HSubwindow (HBaseView* view, int DoRepeat=0, int DoCapture=1);
79  HSubwindow ();
80  virtual ~HSubwindow();
81 
82 
93  virtual void Insert(float left, float right, float bottom, float top, int type = SUBWINDOW_NOTYPE, long appearance =
95 
100  virtual void Reset();
101 
102 
106  virtual bool IsActive();
107 
112  virtual void GetFromKey(HC_KEY key);
113 
118  virtual bool IsSubwindow(HC_KEY key);
119 
127  virtual bool FindSubwindow(HBaseView *view, HPoint pos, bool &pointerselected);
128 
134  virtual HC_KEY FindSubwindowFromSegment(HC_KEY key);
135 
141  virtual void GetPosition(float &x,float &y);
142 
148  virtual void SetPosition(float x,float y);
149 
150 
154  virtual HC_KEY GetWindowKey();
155 
161  virtual void GetSize(float &x,float &y);
162 
168  virtual void SetSize(float deltax, float deltay);
169 
170 
175  virtual void MakeCameraSnapshot(HBaseView *view);
176 
182  virtual void ConvertFromSubwindowToView(HPoint &in_point, HPoint &out_point);
183 
189  virtual void ConvertFromViewToSubwindow(HPoint const & in_point, HPoint & out_point);
190 
191 
198  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);
199 
205  virtual void GetPointerPosition(float &x,float &y);
206 
212  virtual void SetPointerPosition(float x,float y);
213 
221  virtual void SetSize(float left, float right, float bottom, float top);
222 
232  virtual void ComputeCoordinates(HBaseView *view, const char *in_system, HPoint &from, const char *out_system, HPoint &to);
233 
234 
241  virtual void Drag(HBaseView *view, HPoint p1, HPoint p2);
242 
247  virtual void SyncViewToWindow(HBaseView *view);
248 
253  virtual int GetType() { return m_Type; }
254 
259  virtual HC_KEY GetKey() { return m_OuterKey; }
260 
264  virtual const char * GetName();
268  static const char * GetStaticName();
269 
276  virtual int OnLButtonDown (HEventInfo &hevent);
283  virtual int OnLButtonUp (HEventInfo &hevent);
284 
291  virtual int CameraChangedEvent(HBaseView *view);
298  virtual int PreFitWorldEvent(HBaseView *view);
299 
306  virtual int PostFitWorldEvent(HBaseView *view);
307 
308 
317  virtual int OnLButtonDownAndMove(HEventInfo &hevent);
318 
326  virtual int SetupHandlesEvent(HBaseView *view, HC_KEY key, bool complex);
327 
335  virtual int ObjectMovedEvent(HBaseView *view, HC_KEY key, HPoint *p);
343  virtual int ObjectScaledEvent(HBaseView *view, HC_KEY key, HPoint &scale);
344 
345 protected:
346 
350  void GetParameters();
356  bool IsInSizeArea(HPoint &point);
362  bool IsInMagnifyArea(HPoint &point);
367  void CopyViewLight(HBaseView *view);
372  void BuildMagnifyController(float pos);
373 
374 
380  void ChangeMagnification(HBaseView *view, HPoint & p);
385  void Magnify(HBaseView *view);
386 
390  void ShowPointer();
396  bool IsInCloseArea(HPoint &point);
402  bool IsInDragArea(HPoint &point);
403 
407  void BuildBorder();
413  bool IsInMoveArea(HPoint &point);
419  void ChangeMagnification(HBaseView *view, float magnification);
423  void MakeKeyframe();
424 
428  void MakeScaleKeyframe();
429 
434  float m_Left;
435  float m_Right;
436  float m_Bottom;
437  float m_Top;
439  int m_Type;
444  int m_Action;
446 };
447 
448 
449 #ifdef H_PACK_8
450 #pragma pack(pop)
451 #endif
452 
453 #endif
454 
455 
456 
457 
458 
459 
460 
461 
462 
virtual int OnLButtonDownAndMove(HEventInfo &hevent)
virtual const char * GetName()
The HObject is the base class for generic MVO objects.
Definition: HEventManager.h:121
long m_Appearance
Definition: HUtilitySubwindow.h:442
virtual int OnLButtonUp(HEventInfo &hevent)
#define HC_KEY
The HSubwindow class encapsulates interactive floating subwindows.
Definition: HUtilitySubwindow.h:63
#define SW_BACKGROUND_BOX
Subwindow has a shadow.
Definition: HUtilitySubwindow.h:51
HC_KEY m_WindowKey
Definition: HUtilitySubwindow.h:431
#define SW_BORDER
Subwindow has borders.
Definition: HUtilitySubwindow.h:45
#define SW_SIZE_FIELD
Subwindow has a resize area.
Definition: HUtilitySubwindow.h:46
virtual int GetType()
Definition: HUtilitySubwindow.h:253
#define SW_MOVE_FIELD
Subwindow can be moved.
Definition: HUtilitySubwindow.h:47
float m_Top
Definition: HUtilitySubwindow.h:437
The HBaseOperator class serves as a base for classes which handle user input and operate on the scene...
Definition: HBaseOperator.h:65
#define SUBWINDOW_NOTYPE
The basic window type.
Definition: HUtilitySubwindow.h:32
float m_OldMagnification
Definition: HUtilitySubwindow.h:441
The HPoint class is the data type of a three-dimensional point.
Definition: HGlobals.h:126
The HBaseView class defines and manages a view of model information.
Definition: HBaseView.h:337
int m_Action
Definition: HUtilitySubwindow.h:444
float m_Right
Definition: HUtilitySubwindow.h:435
The HEventInfo class stores and manages event information.
Definition: HEventInfo.h:214
virtual HC_KEY GetKey()
Definition: HUtilitySubwindow.h:259
#define SW_DELETE_FIELD
Subwindow has a close button.
Definition: HUtilitySubwindow.h:49
virtual int OnLButtonDown(HEventInfo &hevent)
float m_Bottom
Definition: HUtilitySubwindow.h:436
HC_KEY m_OuterKey
Definition: HUtilitySubwindow.h:430
float m_Magnification
Definition: HUtilitySubwindow.h:440
HPoint m_ptLast
Definition: HUtilitySubwindow.h:445
#define SW_MAGNIFIER_FIELD
Subwindow has a magnifier slider.
Definition: HUtilitySubwindow.h:50
float m_Left
Definition: HUtilitySubwindow.h:434
#define SW_DRAG_FIELD
Subwindow allows the scene to be moved inside the window.
Definition: HUtilitySubwindow.h:48
int m_Type
Definition: HUtilitySubwindow.h:439
HPoint m_Pointer
Definition: HUtilitySubwindow.h:443