16 #include "Selectable.h"
25 #define BMAT_NAME_PLAIN "Plain"
26 #define BMAT_NAME_WOOD "Wood"
27 #define BMAT_NAME_SIDING "Siding"
28 #define BMAT_NAME_BRICK "Brick"
29 #define BMAT_NAME_PAINTED_BRICK "Painted-Brick"
30 #define BMAT_NAME_ROLLED_ROOFING "Rolled-Roofing"
31 #define BMAT_NAME_CEMENT "Cement"
32 #define BMAT_NAME_CORRUGATED "Corrugated"
33 #define BMAT_NAME_DOOR "Door"
34 #define BMAT_NAME_WINDOW "Window"
35 #define BMAT_NAME_WINDOWWALL "WindowWall"
37 enum vtMaterialColorEnum
40 VT_MATERIAL_COLOURABLE,
41 VT_MATERIAL_SELFCOLOURED_TEXTURE,
42 VT_MATERIAL_COLOURABLE_TEXTURE
54 const vtMaterialColorEnum Colorable = VT_MATERIAL_SELFCOLOURED_TEXTURE,
55 const float fUVScaleX=-1,
56 const float fUVScaleY=-1,
57 const bool bTwoSided =
false,
58 const bool bAmbient =
false,
59 const bool bBlended =
false,
83 int GetMatType()
const
88 void SetUVScale(
const float fScaleX,
const float fScaleY)
90 m_UVScale.Set(fScaleX, fScaleY);
96 void SetMaterialIndex(
const int Index)
98 m_iMaterialIndex = Index;
100 const int GetMaterialIndex()
const
102 return m_iMaterialIndex;
104 void SetColorable(
const vtMaterialColorEnum Type)
108 const vtMaterialColorEnum GetColorable()
const
112 void SetSourceName(
const vtString &SourceName)
114 m_SourceName = SourceName;
116 const vtString& GetSourceName()
const
120 void SetRGB(
const RGBi Color)
124 const RGBi GetRGB()
const
128 void SetTwoSided(
bool bTwoSided)
130 m_bTwoSided = bTwoSided;
132 const bool GetTwoSided()
136 void SetAmbient(
bool bAmbient)
138 m_bAmbient = bAmbient;
140 const bool GetAmbient()
144 void SetBlending(
bool bBlending)
146 m_bBlending = bBlending;
148 const bool GetBlending()
155 return (*m_pName == *rhs.m_pName);
159 return (*m_pName == *rhs.m_pName);
161 void WriteToFile(FILE *fp);
166 vtMaterialColorEnum m_Colorable;
176 int m_iMaterialIndex;
186 void DestructItems(uint first, uint last)
188 for (uint i = first; i <= last; i++)
191 bool LoadExternalMaterials();
192 const vtString *FindName(
const char *matname)
const;
195 bool Load(
const char *szFileName);
196 bool Save(
const char *szFileName);
238 void SetElevationOffset(
float fOffset) { m_fElevationOffset = fOffset; }
239 float GetElevationOffset()
const {
return m_fElevationOffset; }
240 void SetAbsolute(
bool b) { m_bAbsolute = b; }
241 bool GetAbsolute()
const {
return m_bAbsolute; }
247 virtual bool GetExtents(
DRECT &rect)
const = 0;
248 virtual bool IsContainedBy(
const DRECT &rect)
const = 0;
249 virtual void WriteXML(
GZOutput &out,
bool bDegrees)
const = 0;
251 void WriteTags(
GZOutput &out)
const;
254 bool m_bIsVIAContributor;
266 float m_fElevationOffset;
299 void WriteXML(
GZOutput &out,
bool bDegrees)
const;
300 void Offset(
const DPoint2 &delta) { m_p += delta; }
302 bool GetExtents(
DRECT &rect)
const;
303 bool IsContainedBy(
const DRECT &rect)
const;
305 virtual double DistanceToPoint(
const DPoint2 &p,
float fMaxRadius)
const;
307 void SetPoint(
const DPoint2 &p) { m_p = p; }
308 DPoint2 GetPoint()
const {
return m_p; }
309 void SetRotation(
float f) { m_fRotation = f; }
310 float GetRotation()
const {
return m_fRotation; }
311 void SetScale(
float f) { m_fScale = f; }
312 float GetScale()
const {
return m_fScale; }
313 void SetItem(
vtItem *pItem) { m_pItem = pItem; }
314 vtItem *GetItem() {
return m_pItem; }
324 bool LoadGlobalMaterials();
327 void FreeGlobalMaterials();