VR-Forces 4.5 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DtForceManager.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2014 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
8 #include <vrvVrl/vrvVrl.h>
10 
12 #include <vrvUtil/event_signal.h>
13 
17 
18 #include <vlpi/disEnums.h>
19 
20 #include <vlutil/vlMachineTypes.h>
21 #include <vlutil/vlString.h>
22 #include <vector>
23 #include <map>
24 
25 namespace makVrv
26 {
27 
28  class DtSharedSettingsManager;
29 
30 #define FRIENDLY_COLOR .5f,224.f / 255.f, 1.f ,0.8f
31 #define FRIENDLY_PRIMARY_COLOR 0.f, 0.f, 1.f, 0.8f
32 #define OPPOSING_COLOR 1.f,.5f,.5f,0.8f
33 #define OPPOSING_PRIMARY_COLOR 1.f, 0.f, 0.f, 0.8f
34 #define NEUTRAL_COLOR 170.f / 255.f,1.f, 170.f / 255.f,0.8f
35 #define NEUTRAL_PRIMARY_COLOR 0.f, 1.f, 0.f, 0.8f
36 #define UNKNOWN_COLOR 1.f, 1.f, .5f, 0.8f
37 #define UNKNOWN_PRIMARY_COLOR 1.f, 1.f, 0.f, 0.8f
38 
43  {
44  public:
45 
46  struct RGBAColor
47  {
48  RGBAColor(float r, float g, float b, float a)
49  : R(r), G(g), B(b), A(a)
50  {
51  }
52 
54  : R(0.f), G(0.f), B(0.f), A(0.f)
55  {
56  }
57 
58  float R, G, B, A;
59  };
60 
61  public:
62 
65 
67  virtual ~DtForceManager();
68 
69  static std::string className();
70 
73  virtual void addForce(DtForceType force, const std::string& forceName,
74  const RGBAColor& forceColor, const RGBAColor& forcePrimaryColor,
75  bool includeInDialogs = true);
76 
78  virtual DtForceType nextAvailableId();
79 
81  virtual void removeForce(DtForceType);
82 
84  virtual int numForces() const;
85 
87  virtual DtForceType forceAt(int iIndex) const;
88 
90  virtual RGBAColor colorForForce(DtForceType force,
91  bool usePrimaryColors=false) const;
92 
94  virtual std::string nameForForce(DtForceType force) const;
95 
97  virtual DtForceType forceFromName(const std::string& name) const;
98 
100  virtual bool includeInDialogs(DtForceType force) const;
101 
102  // Used by the entity editor
104  virtual void setHostility(DtU8 force, DtU8 targetForce, bool hostile);
105  virtual bool hostile(DtU8 force, DtU8 targetForce);
107 
109  virtual void clearForces();
110 
111  protected:
112 
113  struct ForceInfo
114  {
115  std::string myForceName;
119  std::vector<int> myHostilityList;
120  };
121 
122  // Information for a specific force
123  virtual const ForceInfo& forceInformation(DtForceType force) const;
124  virtual ForceInfo& forceInformation(DtForceType force);
125 
126 
128  std::map<DtForceType, ForceInfo> myForces;
129  };
130 
133  {
134  public:
135 
141  instance( const DtSharedSettingsManager& mgr );
142 
147  instance( DtEventQueueInterface& eqi );
148 
155  findInstance( DtEventQueueInterface* eqi );
156 
158  virtual ~DtSharedForceManagerSignaler();
159 
162 
165 
168 
170 
171  protected:
172 
175 
176  private:
177 
180 
183  operator = ( const DtSharedForceManagerSignaler& sig);
184 
185  };
186 }

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)