VR-Forces 4.1 Class Documentation
DtForceManager.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2011 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 /*******************************************************************************
6 ** $RCSfile: DtForceManager.h,v $ $Revision: 1.7 $ $State: Exp $
7 *******************************************************************************/
8 
9 #ifndef DtForceManager_H_
10 #define DtForceManager_H_
11 
12 #include <vrvVrl/vrvVrl.h>
14 
18 
19 #include <vlpi/disEnums.h>
20 
21 #include <vlutil/vlMachineTypes.h>
22 #include <vlutil/vlString.h>
23 #include <vector>
24 #include <map>
25 
26 namespace makVrv
27 {
28 
29  class DtSharedSettingsManager;
30 
31 
36  {
37  public:
38 
39  struct RGBAColor
40  {
41  RGBAColor(float r, float g, float b, float a)
42  : R(r), G(g), B(b), A(a)
43  {
44  }
45 
47  : R(0.f), G(0.f), B(0.f), A(0.f)
48  {
49  }
50 
51  float R, G, B, A;
52  };
53 
54  public:
55 
58 
60  virtual ~DtForceManager();
61 
62  static std::string className();
63 
66  virtual void addForce(DtForceType force, const std::string& forceName,
67  const RGBAColor& forceColor, const RGBAColor& forcePrimaryColor,
68  bool includeInDialogs = true);
69 
71  virtual DtForceType nextAvailableId();
72 
74  virtual void removeForce(DtForceType);
75 
77  virtual int numForces() const;
78 
80  virtual DtForceType forceAt(int iIndex) const;
81 
83  virtual RGBAColor colorForForce(DtForceType force,
84  bool usePrimaryColors=false) const;
85 
87  virtual std::string nameForForce(DtForceType force) const;
88 
90  virtual DtForceType forceFromName(const std::string& name) const;
91 
93  virtual bool includeInDialogs(DtForceType force) const;
94 
95  // Used by the entity editor
97  virtual void setHostility(DtU8 force, DtU8 targetForce, bool hostile);
98  virtual bool hostile(DtU8 force, DtU8 targetForce);
100 
102  virtual void clearForces();
103 
104  protected:
105 
106  struct ForceInfo
107  {
108  std::string myForceName;
112  std::vector<int> myHostilityList;
113  };
114 
115  // Information for a specific force
116  virtual const ForceInfo& forceInformation(DtForceType force) const;
117  virtual ForceInfo& forceInformation(DtForceType force);
118 
119 
121  std::map<DtForceType, ForceInfo> myForces;
122  };
123 }
124 
125 #endif

Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)