Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
cTemplateDefBase.h
Go to the documentation of this file.
1 //
4 //
5 
6 #ifndef _INC_CTemplateDefBase_H
7 #define _INC_CTemplateDefBase_H
8 #ifndef NO_PRAGMA_ONCE
9 #pragma once
10 #endif
11 
12 #include "GrayMapData.h"
17 
18 namespace GrayMapData
19 {
21  {
24 
25  public:
27 
28 #define Template_MAXRetries_Region 10 // max fails to find a place in the region
29 #define Template_MAXRetries_MinDistance 10 // max fails to find a sparse spot in the region.
30 
31  int m_MaxElements; // max number of elements capped. irrelevant of sq meters area of region.
32  float m_MinDistanceToPeers; // in meters.
35 
36  // normal
37  // Grade of the ground (if applicable) 0 to 1, 1=flat, 0 =vertical
38  cValueRange<float> m_Grade; // Min grade in 0 to 1. 1=flat, 0 =vertical, // Max grade in 0 to 1.
39  float m_fGradeSink; // Sink into the ground if the grade is too high,
40 
41  // float m_DensityPerSqMeter; // Max number of units per square area.
42  // AltitudeMin, AltitudeMax is defined by cPolygon3f of effect.
43 
44  // How to fade near the edges of range ??
45  // Min Max Multiplier; // max at center of grade and altitude. how it tapers
46 
47  // Color range for distribution (i.e. green for grass)
48  // Other props to control distribution.
49  // List of modifications to the instances. (i.e. a tree has been cut down)
50  };
51 
53  {
57  public:
59  virtual ~CTemplateDefBase();
60 
61  STDMETHOD(s_PropGet)(const cScriptableProp* pProp, OUT cVariant& vValRet);
62  STDMETHOD(s_PropPut)(const cScriptableProp* pProp, const cVariant& vVal);
63 
64  public:
65  CSCRIPT_CLASS_DEF0(TemplateDefBase);
66  enum P_TYPE_
67  {
68 #define CTemplateDefBaseProp(a,b,c,d,e) P_##a,
69 #include "CTemplateDefBaseProps.tbl"
70 #undef CTemplateDefBaseProp
72  };
73  static cScriptableProp sm_Props[P_QTY + 1];
74 
76 
77  // If this is a template on the ground.
80  BYTE m_void;
81  };
82 };
83 #endif // _INC_CTemplateDefBase_H
#define GRAYMAPDATA_LINK
Definition: GrayMapData.h:13
Definition: cPolygon3.h:22
Definition: cScriptableObj.h:26
Definition: cScriptableInterface.h:97
Definition: cTemplateList.h:46
Definition: cVariant.h:26
Definition: cTemplateDefBase.h:53
cTemplateList m_TemplateElements
the list of potential items and probabilities
Definition: cTemplateDefBase.h:75
CSCRIPT_CLASS_DEF0(TemplateDefBase)
BYTE m_void
stub for other properties.
Definition: cTemplateDefBase.h:80
cPolygon3f m_PolyDef
relative coordinates default shape for the region polygon. instance can completely change this
Definition: cTemplateDefBase.h:79
CTemplateGroundParams m_GroundParams
distribution control params.
Definition: cTemplateDefBase.h:78
P_TYPE_
Definition: cTemplateDefBase.h:67
@ P_QTY
Definition: cTemplateDefBase.h:71
Definition: GrayMapData.cpp:12
Definition: cTemplateDefBase.h:21
float m_MinDistanceToPeers
Definition: cTemplateDefBase.h:32
bool m_bCheckAltitude
Definition: cTemplateDefBase.h:34
cValueRange< float > m_Grade
Definition: cTemplateDefBase.h:38
float m_fGradeSink
Definition: cTemplateDefBase.h:39
int m_MaxElements
Definition: cTemplateDefBase.h:31
bool m_bSnapToGround
Definition: cTemplateDefBase.h:33