HObjects.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 _HOBJECTS_H
11 #define _HOBJECTS_H
12 
13 #ifdef H_PACK_8
14 #pragma pack(push)
15 #pragma pack(8)
16 #endif
17 
18 #include "HTools.h"
19 #include "HEventListener.h"
20 #include "HEventManager.h"
21 #include "HBaseOperator.h"
22 
23 class HBaseView;
24 class HTClient;
25 class HBaseOperator;
26 class HImagePanel;
27 
28 enum HButtonState
29 {
30  ButtonDown,
31  ButtonPressed,
32  ButtonUp
33 };
34 
36 
41 class MVO_API HEdgeVertexSelectionObject : public HObject, public HMouseListener
42 {
43 public:
51 
58  virtual int OnMouseMove(HEventInfo &hevent);
65  virtual int OnLButtonDown(HEventInfo &hevent);
72  virtual int OnLButtonUp(HEventInfo &hevent);
73 
80  void IncludeEntity(HBaseView *view, HC_KEY movekey);
81 
85  static const char * GetStaticName();
86 
90  const char * GetName();
91 
92 
93 protected:
96  HC_KEY m_SegKey;
100 private:
101  bool m_bFound;
102  bool m_blButtonDown;
103 
104 };
105 
106 
108 class MVO_API HImageRegion
109 {
110 public:
111 
117  HImageRegion(int identifier, char const * const name);
118  ~HImageRegion();
119 
129  bool IsSelected(float x, float y, HC_KEY region_image_key, int width, int height);
130 
135  char const * GetName() { return m_Name; }
140  int GetID() { return m_Id; }
141 private:
142  bool m_bHighlighted;
143  char *m_Name;
144  int m_Id;
145 };
147 class MVO_API HImagePanelManagerObject : public HObject
148 {
149 public:
150 
151 
157 
161  static const char * GetStaticName();
162 
166  const char * GetName();
167 
172  void AddImagePanel(HImagePanel *ip);
180  bool DeleteImagePanel(char const * name, bool doDelete = true, HImagePanel **ip = 0);
187  bool DeleteImagePanel(HImagePanel *ip, bool doDelete = true);
193  HImagePanel * GetImagePanelByName(char const * name);
194 
195 protected:
196 
197 
198  struct vlist_s* m_ImagePanelList;
200 };
201 
202 
204 
212 class MVO_API HImagePanel : public HBaseOperator
213 {
214 public:
215 
216 
227  HImagePanel(HBaseView *view, HC_KEY startkey, int width, int height, float xpos, float ypos, char const * const name);
228  virtual ~HImagePanel();
229 
236  HImageRegion * FindSelectedRegion(float xpos, float ypos);
237 
242  virtual int OnLButtonDownAndMove(HEventInfo &hevent);
247  virtual int OnLButtonDown(HEventInfo &hevent);
252  virtual int OnLButtonUp(HEventInfo &hevent);
253 
259  void AddImageRegion(int identifier, char const * const name);
264  char const * GetPanelName() { return m_Name; }
265 
271  void SetImageAction(int (* image_action)(HImageRegion *ii, void *data, HButtonState button_state), void *data)
272  {
273  m_ImageAction = image_action;
274  m_ImageActionData = data;
275  }
279  static bool ButtonTimerClbk(float request_time, float actual_time, void * user_data);
280 
294  void SetImagesFromFile(char const * normal_image_path, char const * highlighted_image_path, char const * region_image_path);
295  void SetImages(HC_KEY NormalImageKey, HC_KEY HighlightedImageKey, HC_KEY RegionImageKey);
296 
297  void ZoomIn();
298  void ZoomOut();
299 
300  void SetPosition(float x, float y, float z = 0.0f);
301 
302 private:
308  void SetImageFromFile(char const * path, HC_KEY &image_key);
313  void ComposeWorkerImage(HImageRegion *reg);
314  HC_KEY m_Key;
315  HBaseView *m_pView;
316  struct vlist_s* m_ImageRegionList;
317  int m_width;
318  int m_height;
320  int (* m_ImageAction)(HImageRegion *ii,void *data, HButtonState button_state);
321  void * m_ImageActionData;
322  HTClient* m_pButtonTimer;
323  HImageRegion *m_CurrentImage;
324  HC_KEY m_NormalImageKey;
325  HC_KEY m_HighlightedImageKey;
326  HC_KEY m_RegionImageKey;
327  HC_KEY m_WorkerImageKey;
328  bool m_bFound;
329  bool m_blButtonDown;
330  HPoint m_ptLast;
331  char *m_Name;
332 };
333 
335 class MVO_API HInfoWindowObject : public HObject
336 {
337 public:
346  HInfoWindowObject(HBaseView *view, float startposx = -0.95f, float startposy = 0.3, int maxlines = 20, int displaylength = 7);
348 
352  static const char *GetStaticName();
353 
357  const char *GetName();
365  void AddLine(char const * text, char const * font = 0, char const * color = 0, bool EraseAfterDisplay = false, int DisplayLength = -1);
367  void UpdateInfoBox();
369  void Flush();
370 
372  static void WindowResizeCallback(int signal, void * signal_data, void * user_data);
373 
374 protected:
377  char * m_InfoText[25];
378  char * m_InfoTextFont[25];
379  char * m_InfoTextColor[25];
380  int m_LineNum;
381  int m_LineMax;
382  float m_StartPosX;
383  float m_StartPosY;
390  static bool InfowWindowTimerClbk(float request_time, float actual_time, void * user_data);
393  void DoTimer();
395  void FlushInternal();
396 
397  float m_TimeStamp;
398  float m_transmission;
403 };
404 
405 
407 
412 class MVO_API HLightsObject : public HObject, public HObjectManipulationListener
413 {
414 public:
419  HLightsObject(HBaseView *view);
420  ~HLightsObject();
424  static const char * GetStaticName();
425 
429  const char * GetName();
430 
438  int SetupHandlesEvent(HBaseView *view, HC_KEY key, bool complex);
439 
447  static void InsertLocalLight(HBaseView *view, HPoint &pos);
456  static void InsertDistantLight(HBaseView *view, HPoint &pos);
466  static void InsertSpotLight(HBaseView *view, HPoint &pos);
467 
473  static void TurnLightsOnOff(HBaseView *view,bool onoff);
474 
475 protected:
484  static void SetupLightSegment(HBaseView *view, HPoint &pos, HC_KEY &outerkey, HC_KEY &geometrykey);
485 
494  static void SetupLightSegmentFromKey(HBaseView *view, HPoint &pos, HC_KEY &outerkey, HC_KEY &geometrykey);
495 
496 
499 };
500 
501 
503 
508 class MVO_API HDraggerObject : public HObject, public HObjectManipulationListener
509 {
510 public:
516  HDraggerObject(HBaseView *view = 0);
517  ~HDraggerObject();
521  static const char * GetStaticName();
525  const char * GetName();
535  void SetupDraggerSegment(HBaseView *view, HPoint &pos, float rotmat[], HC_KEY &outerkey, HC_KEY &geometrykey);
548  HC_KEY Insert(HBaseView *view, HPoint &pos, float rotmat[], HBhvAnimation *ani, HBhvAnimation *rotani, int kfr, bool allowpos);
549 
557  int SetupHandlesEvent(HBaseView *view, HC_KEY key, bool complex);
566  int ObjectMovedEvent(HBaseView *view, HC_KEY key, HPoint *pos);
567 
568 protected:
571 };
572 
573 
574 
575 #ifdef H_PACK_8
576 #pragma pack(pop)
577 #endif
578 
579 #endif
580 
581 
582 
virtual int OnLButtonDownAndMove(HEventInfo &hevent)
The HInfoWindowObject class displays is a floating window that can display any text information that ...
Definition: HObjects.h:335
HBaseView * m_pView
Definition: HObjects.h:97
HBaseView * m_pView
Definition: HObjects.h:497
The HObject is the base class for generic MVO objects.
Definition: HEventManager.h:115
HBaseView * m_pView
The HOOPS view corresponding to this operator.
Definition: HBaseOperator.h:74
float m_TimeStamp
Definition: HObjects.h:397
virtual int OnLButtonUp(HEventInfo &hevent)
HTClient * m_InfoWindowTimer
Definition: HObjects.h:384
The HDraggerObject class encapsulates interactive dragger objects.
Definition: HObjects.h:508
char const * GetName()
Definition: HObjects.h:135
HBaseView * m_pView
Definition: HObjects.h:375
virtual const char * GetName()=0
bool m_bEraseAfterDisplay
Definition: HObjects.h:399
HPoint m_Point2
Definition: HObjects.h:95
int m_TempDisplayLength
Definition: HObjects.h:400
The HImagePanelManagerObject class manages multipe image panels.
Definition: HObjects.h:147
Definition: HTManager.h:157
HC_KEY m_SegKey
Definition: HObjects.h:96
The HEdgeVertexSelectionObject class handles interactive "mouse-over" selection of triangles inside a...
Definition: HObjects.h:41
The HImagePanel class displays an image usually representing buttons which a user can highlight with ...
Definition: HObjects.h:212
int GetID()
Definition: HObjects.h:140
int m_LineNum
Definition: HObjects.h:380
The HImageRegion class represents selectable regions inside an image panel.
Definition: HObjects.h:108
void SetImageAction(int(*image_action)(HImageRegion *ii, void *data, HButtonState button_state), void *data)
Definition: HObjects.h:271
The HBaseOperator class serves as a base for classes which handle user input and operate on the scene...
Definition: HBaseOperator.h:60
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
float m_StartPosX
Definition: HObjects.h:382
HPoint m_Point1
Definition: HObjects.h:94
HC_KEY m_InfoWindowKey
Definition: HObjects.h:376
The HBhvAnimation class defines an animation.
Definition: HBhvAnimation.h:43
The HEventInfo class stores and manages event information.
Definition: HEventInfo.h:207
virtual int OnLButtonDown(HEventInfo &hevent)
char const * GetPanelName()
Definition: HObjects.h:264
struct vlist_s * m_ImagePanelList
Definition: HObjects.h:198
int m_LineMax
Definition: HObjects.h:381
HBaseView * m_pView
Definition: HObjects.h:569
float m_StartPosY
Definition: HObjects.h:383
int m_DefaultDisplayLength
Definition: HObjects.h:401
The HLightsObject class encapsulates interactive light objects.
Definition: HObjects.h:412