Alphabetical Class Index  Class Hierarchy   File Members   Compound Members   File List  

HObjects.h
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: e5202255f29107fce7fef0d3337a5364d5549bc8 $
13 //
14 
15 
16 
17 #ifndef _HOBJECTS_H
18 #define _HOBJECTS_H
19 
20 #ifdef H_PACK_8
21 #pragma pack(push)
22 #pragma pack(8)
23 #endif
24 
25 #include "HTools.h"
26 #include "HEventListener.h"
27 #include "HEventManager.h"
28 #include "HBaseOperator.h"
29 
30 class HBaseView;
31 class HTClient;
32 class HBaseOperator;
33 class HImagePanel;
34 
35 enum HButtonState
36 {
37  ButtonDown,
38  ButtonPressed,
39  ButtonUp
40 };
41 
43 
48 class MVO_API HEdgeVertexSelectionObject : public HObject, public HMouseListener
49 {
50 public:
58 
65  virtual int OnMouseMove(HEventInfo &hevent);
72  virtual int OnLButtonDown(HEventInfo &hevent);
79  virtual int OnLButtonUp(HEventInfo &hevent);
80 
87  void IncludeEntity(HBaseView *view, HC_KEY movekey);
88 
92  static const char * GetStaticName();
93 
97  const char * GetName();
98 
99 
100 protected:
107 private:
108  bool m_bFound;
109  bool m_blButtonDown;
110 
111 };
112 
113 
115 class MVO_API HImageRegion
116 {
117 public:
118 
124  HImageRegion(int identifier, char const * const name);
125  ~HImageRegion();
126 
136  bool IsSelected(float x, float y, HC_KEY region_image_key, int width, int height);
137 
142  char const * GetName() { return m_Name; }
147  int GetID() { return m_Id; }
148 private:
149  bool m_bHighlighted;
150  char *m_Name;
151  int m_Id;
152 };
154 class MVO_API HImagePanelManagerObject : public HObject
155 {
156 public:
157 
158 
164 
168  static const char * GetStaticName();
169 
173  const char * GetName();
174 
179  void AddImagePanel(HImagePanel *ip);
187  bool DeleteImagePanel(char const * name, bool doDelete = true, HImagePanel **ip = 0);
194  bool DeleteImagePanel(HImagePanel *ip, bool doDelete = true);
200  HImagePanel * GetImagePanelByName(char const * name);
201 
202 protected:
203 
204 
205  struct vlist_s* m_ImagePanelList;
207 };
208 
209 
211 
219 class MVO_API HImagePanel : public HBaseOperator
220 {
221 public:
222 
223 
234  HImagePanel(HBaseView *view, HC_KEY startkey, int width, int height, float xpos, float ypos, char const * const name);
235  virtual ~HImagePanel();
236 
243  HImageRegion * FindSelectedRegion(float xpos, float ypos);
244 
249  virtual int OnLButtonDownAndMove(HEventInfo &hevent);
254  virtual int OnLButtonDown(HEventInfo &hevent);
259  virtual int OnLButtonUp(HEventInfo &hevent);
260 
266  void AddImageRegion(int identifier, char const * const name);
271  char const * GetPanelName() { return m_Name; }
272 
278  void SetImageAction(int (* image_action)(HImageRegion *ii, void *data, HButtonState button_state), void *data)
279  {
280  m_ImageAction = image_action;
281  m_ImageActionData = data;
282  }
286  static bool ButtonTimerClbk(float request_time, float actual_time, void * user_data);
287 
301  void SetImagesFromFile(char const * normal_image_path, char const * highlighted_image_path, char const * region_image_path);
302  void SetImages(HC_KEY NormalImageKey, HC_KEY HighlightedImageKey, HC_KEY RegionImageKey);
303 
304  void ZoomIn();
305  void ZoomOut();
306 
307  void SetPosition(float x, float y, float z = 0.0f);
308 
309 private:
315  void SetImageFromFile(char const * path, HC_KEY &image_key);
320  void ComposeWorkerImage(HImageRegion *reg);
321  HC_KEY m_Key;
322  HBaseView *m_pView;
323  struct vlist_s* m_ImageRegionList;
324  int m_width;
325  int m_height;
327  int (* m_ImageAction)(HImageRegion *ii,void *data, HButtonState button_state);
328  void * m_ImageActionData;
329  HTClient* m_pButtonTimer;
330  HImageRegion *m_CurrentImage;
331  HC_KEY m_NormalImageKey;
332  HC_KEY m_HighlightedImageKey;
333  HC_KEY m_RegionImageKey;
334  HC_KEY m_WorkerImageKey;
335  bool m_bFound;
336  bool m_blButtonDown;
337  HPoint m_ptLast;
338  char *m_Name;
339 };
340 
342 class MVO_API HInfoWindowObject : public HObject
343 {
344 public:
353  HInfoWindowObject(HBaseView *view, float startposx = -0.95f, float startposy = 0.3, int maxlines = 20, int displaylength = 7);
355 
359  static const char *GetStaticName();
360 
364  const char *GetName();
372  void AddLine(char const * text, char const * font = 0, char const * color = 0, bool EraseAfterDisplay = false, int DisplayLength = -1);
374  void UpdateInfoBox();
376  void Flush();
377 
379  static void WindowResizeCallback(int signal, void * signal_data, void * user_data);
380 
381 protected:
384  char * m_InfoText[25];
385  char * m_InfoTextFont[25];
386  char * m_InfoTextColor[25];
387  int m_LineNum;
388  int m_LineMax;
389  float m_StartPosX;
390  float m_StartPosY;
397  static bool InfowWindowTimerClbk(float request_time, float actual_time, void * user_data);
400  void DoTimer();
402  void FlushInternal();
403 
404  float m_TimeStamp;
405  float m_transmission;
410 };
411 
412 
414 
419 class MVO_API HLightsObject : public HObject, public HObjectManipulationListener
420 {
421 public:
426  HLightsObject(HBaseView *view);
427  ~HLightsObject();
431  static const char * GetStaticName();
432 
436  const char * GetName();
437 
445  int SetupHandlesEvent(HBaseView *view, HC_KEY key, bool complex);
446 
454  static void InsertLocalLight(HBaseView *view, HPoint &pos);
463  static void InsertDistantLight(HBaseView *view, HPoint &pos);
473  static void InsertSpotLight(HBaseView *view, HPoint &pos);
474 
480  static void TurnLightsOnOff(HBaseView *view,bool onoff);
481 
482 protected:
491  static void SetupLightSegment(HBaseView *view, HPoint &pos, HC_KEY &outerkey, HC_KEY &geometrykey);
492 
501  static void SetupLightSegmentFromKey(HBaseView *view, HPoint &pos, HC_KEY &outerkey, HC_KEY &geometrykey);
502 
503 
506 };
507 
508 
510 
515 class MVO_API HDraggerObject : public HObject, public HObjectManipulationListener
516 {
517 public:
523  HDraggerObject(HBaseView *view = 0);
524  ~HDraggerObject();
528  static const char * GetStaticName();
532  const char * GetName();
542  void SetupDraggerSegment(HBaseView *view, HPoint &pos, float *rotmat, HC_KEY &outerkey, HC_KEY &geometrykey);
555  HC_KEY Insert(HBaseView *view, HPoint &pos, float *rot, HBhvAnimation *ani, HBhvAnimation *rotani, int kfr, bool allowpos);
556 
564  int SetupHandlesEvent(HBaseView *view, HC_KEY key, bool complex);
573  int ObjectMovedEvent(HBaseView *view, HC_KEY key, HPoint *pos);
574 
575 protected:
578 };
579 
580 
581 
582 #ifdef H_PACK_8
583 #pragma pack(pop)
584 #endif
585 
586 #endif
587 
588 
589 
virtual int OnLButtonDownAndMove(HEventInfo &hevent)
The HInfoWindowObject class displays is a floating window that can display any text information that ...
Definition: HObjects.h:342
HBaseView * m_pView
Definition: HObjects.h:104
HBaseView * m_pView
Definition: HObjects.h:504
The HObject is the base class for generic MVO objects.
Definition: HEventManager.h:121
HBaseView * m_pView
The HOOPS view corresponding to this operator.
Definition: HBaseOperator.h:79
float m_TimeStamp
Definition: HObjects.h:404
virtual int OnLButtonUp(HEventInfo &hevent)
HTClient * m_InfoWindowTimer
Definition: HObjects.h:391
The HDraggerObject class encapsulates interactive dragger objects.
Definition: HObjects.h:515
char const * GetName()
Definition: HObjects.h:142
HBaseView * m_pView
Definition: HObjects.h:382
virtual const char * GetName()=0
#define HC_KEY
bool m_bEraseAfterDisplay
Definition: HObjects.h:406
HPoint m_Point2
Definition: HObjects.h:102
int m_TempDisplayLength
Definition: HObjects.h:407
The HImagePanelManagerObject class manages multipe image panels.
Definition: HObjects.h:154
Definition: HTManager.h:162
HC_KEY m_SegKey
Definition: HObjects.h:103
The HEdgeVertexSelectionObject class handles interactive "mouse-over" selection of triangles inside a...
Definition: HObjects.h:48
The HImagePanel class displays an image usually representing buttons which a user can highlight with ...
Definition: HObjects.h:219
int GetID()
Definition: HObjects.h:147
int m_LineNum
Definition: HObjects.h:387
The HImageRegion class represents selectable regions inside an image panel.
Definition: HObjects.h:115
void SetImageAction(int(*image_action)(HImageRegion *ii, void *data, HButtonState button_state), void *data)
Definition: HObjects.h:278
The HBaseOperator class serves as a base for classes which handle user input and operate on the scene...
Definition: HBaseOperator.h:65
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
float m_StartPosX
Definition: HObjects.h:389
HPoint m_Point1
Definition: HObjects.h:101
HC_KEY m_InfoWindowKey
Definition: HObjects.h:383
The HBhvAnimation class defines an animation.
Definition: HBhvAnimation.h:47
The HEventInfo class stores and manages event information.
Definition: HEventInfo.h:214
virtual int OnLButtonDown(HEventInfo &hevent)
char const * GetPanelName()
Definition: HObjects.h:271
struct vlist_s * m_ImagePanelList
Definition: HObjects.h:205
int m_LineMax
Definition: HObjects.h:388
HBaseView * m_pView
Definition: HObjects.h:576
float m_StartPosY
Definition: HObjects.h:390
int m_DefaultDisplayLength
Definition: HObjects.h:408
The HLightsObject class encapsulates interactive light objects.
Definition: HObjects.h:419