vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TerrainUtility.h
Go to the documentation of this file.
1 
9 #ifndef VRECKO_NATURE_TERRAIN_TERRAINUTILITY_H
10 #define VRECKO_NATURE_TERRAIN_TERRAINUTILITY_H
11 
12 #include <osg/Vec3>
13 #include <iostream>
14 #include <string>
15 
17 
18 namespace APNature
19 {
21  {
22  public:
23 
28  static void Info(const std::string& message);
29 
34  static void Error(const std::string& message);
35 
41  static inline void SetPointHeight(osg::Vec3& point, float height) { point.set(point.x(), height, point.z()); }
42 
48  static std::string LowerCase(const std::string& input);
49 
55  static std::string UpperCase(const std::string& input);
56 
66  static int GreatestCommonDivisor(int x, int y);
67 
76  static inline float LinearMapping(float fromMin, float fromMax, float fromX, float toMin, float toMax)
77  {
78  return toMin + (((toMax - toMin) * (fromX - fromMin)) / (fromMax - fromMin));
79  }
80 
89  static void ListDirectory(const std::string& dirpath, const std::string& mask, std::vector<std::string>* fileNames);
90  };
91 }
92 
93 #endif