Alphabetical Class Index  Class Hierarchy   File Members   Compound Members   File List  

HBhvSensor.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: ee1d519237f236d03d9bbbe8d5c7fac43170559b $
13 //
14 
15 #ifndef _H_HBhvSensor_H
16 #define _H_HBhvSensor_H
17 
18 #ifdef H_PACK_8
19 #pragma pack(push)
20 #pragma pack(8)
21 #endif
22 
23 #include "HTools.h"
24 #include "HEventListener.h"
25 
27 class HBhvCondition;
28 class HBhvAction;
29 class HBhvTargetObject;
30 
31 
32 
34 
38 class MVO_API HBhvSensor
39 {
40 public:
41 
48  HBhvSensor(const char *name, bool active, HBhvBehaviorManager *BehaviorManager);
49  virtual ~HBhvSensor();
50 
55  void AddCondition(HBhvCondition *condition);
56 
60  static void *XMLCallback(HUtilityXMLTag *xt, bool open, void *m_pExtraData);
61 
65  void Serialize(HUtilityXMLGenerator *xmlgen);
66 
68  HBhvBehaviorManager * GetBehaviorManager() { return m_pBehaviorManager; }
69 
75  void Activate(int delay = 0);
76 
80  void DeActivate();
81 
83  bool GetDefaultActive() { return m_bDefaultActive; }
84 
86  bool GetCurrentlyActive() { return m_bCurrentlyActive; }
87 
92  bool Evaluate();
93 
98  void AddAction(HBhvAction *action);
99 
101  const char * GetName() { return m_Name; }
102 
106  void Tick();
107 
108 
109 protected:
110  char m_Name[256];
113  struct vlist_s* m_ConditionList;
114  struct vlist_s* m_ActionList;
119  int m_Delay;
120 };
121 
122 
124 class MVO_API HBhvCondition
125 {
126 public:
127 
136  HBhvCondition(const char *target, const char *hevent, bool invert, HBhvSensor *sensor);
137  virtual ~HBhvCondition();
138 
143  virtual void SetTarget(const char *target);
144 
146  virtual HBhvSensor * GetSensor() { return m_pSensor; }
147 
151  virtual void Register() { }
152 
156  virtual void UnRegister() { }
157 
163  virtual void Evaluate(bool &and_flag, bool &or_flag);
164 
168  static void *XMLCallback(HUtilityXMLTag *xt, bool open, void *m_pExtraData);
169 
173  virtual void Serialize(HUtilityXMLGenerator *xmlgen, HUtilityXMLTag *xmlt);
174 
178  virtual void Serialize(HUtilityXMLGenerator *xmlgen);
179 
180  protected:
181  char m_Event[256];
185  bool m_bInvert;
186  char m_Value[256];
188 };
189 
190 
193 {
194 public:
203  HBhvConditionAnimationRunning(const char *target, const char *hevent, bool invert, HBhvSensor *sensor);
204 
211  virtual void Evaluate(bool &and_flag, bool &or_flag);
212 
216  virtual void Serialize(HUtilityXMLGenerator *xmlgen);
217 
218 };
219 
222 {
223 public:
224 
233  HBhvConditionSensorActive(const char *target, const char *hevent, bool invert, HBhvSensor *sensor);
234 
241  virtual void Evaluate(bool &and_flag, bool &or_flag);
242 
246  virtual void Serialize(HUtilityXMLGenerator *xmlgen);
247 
248 protected:
249 };
250 
251 
252 
254 class MVO_API HBhvConditionMouse : public HBhvCondition, public HMouseListener
255 {
256 public:
257 
266  HBhvConditionMouse(const char *target, const char *hevent, bool invert, HBhvSensor *sensor);
267 
271  virtual void Register();
272 
276  virtual void UnRegister();
277 
278 
286  bool IsClicked(HC_KEY target, float x, float y);
287 
288 
289 };
290 
292 class MVO_API HBhvConditionAnimation : public HBhvCondition, public HAnimationListener
293 {
294 public:
295 
304  HBhvConditionAnimation(const char *target, const char *hevent, bool invert, HBhvSensor *sensor);
305 
309  virtual void Register();
310 
314  virtual void UnRegister();
315 protected:
316 };
317 
319 class MVO_API HBhvConditionSensor : public HBhvCondition, public HSensorListener
320 {
321 public:
322 
331  HBhvConditionSensor(const char *target, const char *hevent, bool invert, HBhvSensor *sensor);
332 
336  virtual void Register();
337 
341  virtual void UnRegister();
342 };
343 
344 
347 {
348 public:
349 
358  HBhvConditionSensorActivated(const char *target, const char *hevent, bool invert, HBhvSensor *sensor);
359 
364  virtual int SensorActivatedEvent(HBhvSensor * ainst);
365 
369  virtual void Serialize(HUtilityXMLGenerator *xmlgen);
370 
371 };
372 
373 
374 
377 {
378 public:
387  HBhvConditionSensorAction(const char *target, const char *hevent, bool invert, HBhvSensor *sensor);
388 
393  virtual int SensorActionEvent(const char * action);
394 
398  virtual void Serialize(HUtilityXMLGenerator *xmlgen);
399 
400 };
401 
404 {
405 public:
414  HBhvConditionAnimationFinished(const char *target, const char *hevent, bool invert, HBhvSensor *sensor);
415 
420  virtual int AnimationFinishedEvent(HBhvAnimation * animation);
421 
425  virtual void Serialize(HUtilityXMLGenerator *xmlgen);
426 
427 
428 };
429 
430 
431 
434 {
435 public:
436 
445  HBhvConditionONLCLICK(const char *target, const char *hevent, bool invert, HBhvSensor *sensor);
446 
454  virtual int OnLButtonDown(HEventInfo &hevent);
455 
459  virtual void Serialize(HUtilityXMLGenerator *xmlgen);
460 
461 protected:
462 };
463 
464 
465 
468 {
469 public:
470 
479  HBhvConditionONMOUSEENTER(const char *target, const char *hevent, bool invert, HBhvSensor *sensor);
480 
486  virtual int OnMouseMove(HEventInfo &hevent);
487 
491  void UnRegister();
492 
496  virtual void Serialize(HUtilityXMLGenerator *xmlgen);
497 
498 protected:
500 };
501 
504 {
505 public:
506 
515  HBhvConditionONMOUSELEAVE(const char *target, const char *hevent, bool invert, HBhvSensor *sensor);
516 
522  virtual int OnMouseMove(HEventInfo &hevent);
523 
527  void UnRegister();
528 
532  virtual void Serialize(HUtilityXMLGenerator *xmlgen);
533 
534 protected:
536 };
537 
538 
539 
541 
577 class MVO_API HBhvAction
578 {
579 public:
580 
588  HBhvAction(const char *target, const char *type, const char *value, HBhvSensor *sensor);
589 
593  virtual ~HBhvAction();
594 
595 
600  void SetTargetByPath(const char *targetpath);
601 
605  static void *XMLCallback(HUtilityXMLTag *xt, bool open, void *m_pExtraData);
606 
607 
611  void DoAction();
612 
616  void Serialize(HUtilityXMLGenerator *xmlgen);
617 
618 protected:
619  char m_Type[256];
620  char m_Value[MVO_BUFFER_SIZE];
625 };
626 
627 
628 
629 
630 #ifdef H_PACK_8
631 #pragma pack(pop)
632 #endif
633 
634 #endif
The HBhvConditionSensorActivated class evaluates if a sensor has been activated.
Definition: HBhvSensor.h:346
int m_Delay
Definition: HBhvSensor.h:119
The HBhvConditionAnimationFinished class evaluates if an animation has finished executing.
Definition: HBhvSensor.h:403
The HBhvConditionONMOUSEENTER class evaluates if the mouse pointer has entered the bounding box of th...
Definition: HBhvSensor.h:467
The HBhvConditionMouse class is the base class for all mouse related conditions.
Definition: HBhvSensor.h:254
bool m_bDefaultActive
Definition: HBhvSensor.h:117
HBhvBehaviorManager * GetBehaviorManager()
Definition: HBhvSensor.h:68
The HBhvBehaviorManager class stores and manages all animation related data.
Definition: HBhvBehaviorManager.h:241
struct vlist_s * m_ActionList
Definition: HBhvSensor.h:114
virtual void UnRegister()
The HBhvCondition class is the base class for all condition types.
Definition: HBhvSensor.h:124
struct vlist_s * m_ConditionList
Definition: HBhvSensor.h:113
HC_KEY m_OldKey
Definition: HBhvSensor.h:499
#define HC_KEY
HC_KEY m_OldKey
Definition: HBhvSensor.h:535
The HBhvConditionSensorAction class evaluates if the target sensor has performed an action...
Definition: HBhvSensor.h:376
bool m_bInvert
Definition: HBhvSensor.h:185
The HBhvConditionSensor class is the base class for sensor related conditions.
Definition: HBhvSensor.h:319
virtual HBhvSensor * GetSensor()
Definition: HBhvSensor.h:146
const char * GetName()
Definition: HBhvSensor.h:101
The HBhvTargetObject class encapsulates various target types for animations and sensors.
Definition: HBhvBehaviorManager.h:86
The HBhvSensor class encapsulates an animation sensor.
Definition: HBhvSensor.h:38
virtual void UnRegister()
Definition: HBhvSensor.h:156
The HBhvConditionONLCLICK class evaluates if the given target was selected when the left mouse button...
Definition: HBhvSensor.h:433
virtual void Evaluate(bool &and_flag, bool &or_flag)
HBhvTargetObject * m_pTarget
Definition: HBhvSensor.h:182
HBhvSensor * m_pSensor
Definition: HBhvSensor.h:621
The HBhvAnimation class defines an animation.
Definition: HBhvAnimation.h:47
HBhvSensor * m_pSensor
Definition: HBhvSensor.h:184
The HBhvConditionONMOUSEENTER class evaluates if the mouse pointer has left the bounding box of the t...
Definition: HBhvSensor.h:503
The HEventInfo class stores and manages event information.
Definition: HEventInfo.h:214
virtual void Serialize(HUtilityXMLGenerator *xmlgen, HUtilityXMLTag *xmlt)
The HBhvConditionAnimationRunning class evaluates if an animation is currently running for a given ta...
Definition: HBhvSensor.h:192
bool GetCurrentlyActive()
Definition: HBhvSensor.h:86
HBhvBehaviorManager * m_pBehaviorManager
Definition: HBhvSensor.h:111
bool m_bConditionMet
Definition: HBhvSensor.h:183
The HBhvAction class encapsulates an animation action.
Definition: HBhvSensor.h:577
virtual void Register()
Definition: HBhvSensor.h:151
The HBhvConditionSensorActive class evaluates if the given sensor is currently active.
Definition: HBhvSensor.h:221
bool GetDefaultActive()
Definition: HBhvSensor.h:83
The HBhvConditionAnimation class is the base class for all animation related conditions.
Definition: HBhvSensor.h:292
bool m_bCurrentlyActive
Definition: HBhvSensor.h:116
HBhvTargetObject * m_pTarget
Definition: HBhvSensor.h:622