HUtilitySubwindow2.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 
14 #ifndef _H_HUtilitySubwindow2_H
15 #define _H_HUtilitySubwindow2_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 
30 
31 #define SW_ACTION_NOACTION 0
32 #define SW_ACTION_MOVE 1
33 #define SW_ACTION_SIZING 2
34 #define SW_ACTION_DRAGGING 5
35 #define SW_ACTION_SCROLLING 6
36 
37 #define SW_BORDER 1
38 #define SW_SIZE_FIELD 2
39 #define SW_MOVE_FIELD 4
40 #define SW_DRAG_FIELD 8
41 #define SW_DELETE_FIELD 16
42 #define SW_SCROLL_FIELD 32
43 #define SW_BACKGROUND_BOX 64
44 
45 
46 class HBaseView;
47 
48 
50 class MVO_API HSubwindow2 : public HObject, public HBaseOperator, public HUpdateListener, public HFitWorldListener, public HObjectManipulationListener
56 {
57 
58 public:
59 
67  HSubwindow2 (HBaseView* view, int DoRepeat=0, int DoCapture=1);
71  HSubwindow2 ();
72  virtual ~HSubwindow2();
73 
74 
85  virtual void Insert(float left, float right, float bottom, float top, char const * title = 0, float minwidth = 0, float minheight = 0,int type = SUBWINDOW_NOTYPE,long appearance =
87 
92  virtual void Reset();
93 
94 
98  virtual bool IsActive();
99 
104  virtual void GetFromKey(HC_KEY key);
105 
110  virtual bool IsSubwindow(HC_KEY key);
111 
119  virtual bool FindSubwindow(HBaseView *view, HPoint pos, bool &pointerselected);
120 
126  virtual HC_KEY FindSubwindowFromSegment(HC_KEY key);
127 
133  virtual void GetPosition(float &x,float &y);
134 
140  virtual void SetPosition(float x,float y);
141 
142 
146  virtual HC_KEY GetWindowKey();
147 
153  virtual void GetSize(float &x,float &y);
154 
160  virtual void SetSize(float deltax, float deltay);
161 
162 
163 
169  virtual void ConvertFromSubwindowToView(HPoint &in_point, HPoint &out_point);
170 
176  virtual void ConvertFromViewToSubwindow(HPoint const & in_point, HPoint & out_point);
177 
178 
185  virtual void ChangeType(int type, long appearance = SW_BORDER | SW_SIZE_FIELD | SW_MOVE_FIELD | SW_DRAG_FIELD | SW_DELETE_FIELD | SW_BACKGROUND_BOX);
186 
187 
188 
196  virtual void SetSize(float left, float right, float bottom, float top);
197 
207  virtual void ComputeCoordinates(HBaseView *view, const char *in_system, HPoint &from, const char *out_system, HPoint &to);
208 
209 
210 
211 
216  virtual int GetType() { return m_Type; }
217 
222  virtual HC_KEY GetKey() { return m_OuterKey; }
223 
227  virtual const char * GetName();
231  static const char * GetStaticName();
232 
239  virtual int OnLButtonDown (HEventInfo &hevent);
246  virtual int OnLButtonUp (HEventInfo &hevent);
247 
254  virtual int PreFitWorldEvent(HBaseView *view);
255 
262  virtual int PostFitWorldEvent(HBaseView *view);
263 
264 
273  virtual int OnLButtonDownAndMove(HEventInfo &hevent);
274 
282  virtual int SetupHandlesEvent(HBaseView *view, HC_KEY key, bool complex);
283 
291  virtual int ObjectMovedEvent(HBaseView *view, HC_KEY key, HPoint *p);
299  virtual int ObjectScaledEvent(HBaseView *view, HC_KEY key, HPoint &scale);
300 
301  virtual void DrawScrollBox();
302 
303 
304 protected:
305 
309  void GetParameters();
315  bool IsInSizeArea(HPoint &point);
316  bool IsInScrollArea(HPoint &point);
317 
323  bool IsInMagnifyArea(HPoint &point);
328  void CopyViewLight(HBaseView *view);
333  void BuildMagnifyController(float pos);
334 
335 
341  void ChangeMagnification(HBaseView *view, HPoint & p);
346  void Magnify(HBaseView *view);
347 
353  bool IsInCloseArea(HPoint &point);
359  bool IsInDragArea(HPoint &point);
360 
364  void BuildBorder();
370  bool IsInMoveArea(HPoint &point);
376  void ChangeMagnification(HBaseView *view, float magnification);
377 
378 
379  virtual void UpdateContent();
380 
381  HC_KEY m_OuterKey;
382  HC_KEY m_WindowKey;
385  float m_Left;
386  float m_Right;
387  float m_Bottom;
388  float m_Top;
390  int m_Type;
393  int m_Action;
395  char m_title[256];
396  int m_ScrollHeight;
397  int m_ScrollPos;
398  float m_MinWidth;
399  float m_MinHeight;
400 };
401 
402 
403 
404 
405 class MVO_API HTexturePickerWindow : public HSubwindow2
406 {
407 
408 public:
409  HTexturePickerWindow(HBaseView* view, int DoRepeat=0, int DoCapture=1);
411 
412  virtual void UpdateContent();
413  virtual int OnLButtonDown (HEventInfo &hevent);
414  virtual int OnLButtonUp (HEventInfo &hevent);
415  virtual int OnLButtonDownAndMove (HEventInfo &hevent);
416 
417 
418 };
419 
420 #ifdef H_PACK_8
421 #pragma pack(pop)
422 #endif
423 
424 #endif
425 
426 
427 
428 
429 
430 
431 
432 
433 
HPoint m_Pointer
Definition: HUtilitySubwindow2.h:392
virtual int OnLButtonDownAndMove(HEventInfo &hevent)
virtual const char * GetName()
The HObject is the base class for generic MVO objects.
Definition: HEventManager.h:115
virtual int OnLButtonUp(HEventInfo &hevent)
long m_Appearance
Definition: HUtilitySubwindow2.h:391
virtual int OnLButtonUp(HEventInfo &hevent)
virtual int OnLButtonDownAndMove(HEventInfo &hevent)
#define SW_BACKGROUND_BOX
Subwindow has a shadow.
Definition: HUtilitySubwindow.h:47
virtual int GetType()
Definition: HUtilitySubwindow2.h:216
float m_Top
Definition: HUtilitySubwindow2.h:388
float m_Left
Definition: HUtilitySubwindow2.h:385
#define SW_BORDER
Subwindow has borders.
Definition: HUtilitySubwindow.h:41
#define SW_SIZE_FIELD
Subwindow has a resize area.
Definition: HUtilitySubwindow.h:42
virtual HC_KEY GetKey()
Definition: HUtilitySubwindow2.h:222
#define SW_MOVE_FIELD
Subwindow can be moved.
Definition: HUtilitySubwindow.h:43
float m_Bottom
Definition: HUtilitySubwindow2.h:387
float m_Right
Definition: HUtilitySubwindow2.h:386
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
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 m_WindowKey
Definition: HUtilitySubwindow2.h:382
The HEventInfo class stores and manages event information.
Definition: HEventInfo.h:207
The HSubwindow2 class encapsulates interactive floating subwindows.
Definition: HUtilitySubwindow2.h:55
#define SW_DELETE_FIELD
Subwindow has a close button.
Definition: HUtilitySubwindow.h:45
virtual int OnLButtonDown(HEventInfo &hevent)
HC_KEY m_OuterKey
Definition: HUtilitySubwindow2.h:381
virtual int OnLButtonDown(HEventInfo &hevent)
HPoint m_ptLast
Definition: HUtilitySubwindow2.h:394
#define SW_DRAG_FIELD
Subwindow allows the scene to be moved inside the window.
Definition: HUtilitySubwindow.h:44
Definition: HUtilitySubwindow2.h:405
int m_Action
Definition: HUtilitySubwindow2.h:393
int m_Type
Definition: HUtilitySubwindow2.h:390