source: Revenant/geoworld/include/gwtypes.h

port/mars-tycoon
Last change on this file was 80a6a52, checked in by Jonathan Neufeld <support@…>, 3 years ago

Get to a compile state for terrain procedural generation

  • Property mode set to 100644
File size: 2.3 KB
Line 
1#ifndef __GEOWORLDTYPES_H__
2#define __GEOWORLDTYPES_H__
3
4#include <mars_grids.h>
5#include <list>
6
7#include "linalgadapt.h"
8#include "vmpdg.h"
9#include "sphpack.h"
10#include "gwtypedefs.h"
11
12namespace geoworld
13{
14 class SynthesisSession;
15 class LockedGWSection;
16 class MineralsContainer;
17 class IGeoWorldAccessor;
18 class GeoMorph;
19 class MineralClass;
20
21 class GeoNode
22 {
23 private:
24 // TODO: I think this should go in a completely separate program layer
25 // std::list <mars::ptr <MineralDefinition>> minerals;
26
27 public:
28 float compression;
29 mars::vector3Df pvec;
30 bool visited;
31
32 inline GeoNode () : compression(0.0f), visited (false) {}
33 };
34
35 enum FieldType
36 {
37 FT_Density
38 };
39
40 template <typename V>
41 class GMField
42 {
43 public:
44 typedef unsigned int IndexType;
45 typedef V ResultType;
46
47 virtual V operator () (const IndexType x, const IndexType y, const IndexType z) const = 0;
48 };
49
50 typedef GMField< VectorTag< FieldReal > ::V3 > GMGradientField;
51
52 class GMScalarField : public GMField< FieldReal >
53 {
54 public:
55 virtual const GMGradientField * queryGradient() const = 0;
56 virtual void releaseGradient (const GMGradientField * pGF) const = 0;
57 };
58
59 class IGeoWorldAccessor
60 {
61 public:
62 virtual const GeoHeightMap::Precision operator () (const long x, const long y) const = 0;
63 virtual const GeoHeightMap::Precision mean (const long x, const long y) const = 0;
64 virtual const GMScalarField * queryField (const FieldType enft) const = 0;
65 virtual GWCoords createCoords (const long x, const long y) const = 0;
66 inline GWCoords createCoords (const GWSurfacePos & pos) const
67 { return createCoords(pos.x, pos.y); }
68
69 inline void releaseField (const GMScalarField * pField) const
70 { delete pField; }
71 };
72
73 typedef std::list< mars::ptr< GeoMorph > > MorphList;
74 typedef std::list< const GMScalarField * > ScalarFieldList;
75 typedef std::list< const GMGradientField * > GradientFieldList;
76 typedef ElementalField< mars::WeakReference< MineralClass >, GeoHeightMap::Precision > GeoStratumField;
77 typedef VarriedMPDG< mars::WeakReference< MineralClass >, GeoHeightMap::Precision > GeoStratumMPDG;
78 typedef mars::MidpointDisplacementGrid< GeoHeightMap::Precision > GeoHeightMPDG;
79 typedef signed long WorldUnit;
80 typedef RandomSpherePack< WorldUnit > GeoSpherePack;
81
82 class IMineralQuery
83 {
84 public:
85
86 };
87}
88
89#endif
Note: See TracBrowser for help on using the repository browser.