CloudyDay
 All Classes Functions Variables Enumerations
ImportExport.h
1 #pragma once
2 #include <osg/Array>
3 #include <osg/Ref_Ptr>
4 #include <iostream>
5 #include <stdio.h>
6 #include <string>
7 
8 namespace osgCloudyDay
9 {
14  class Box
15  {
16  public:
20  Box(){};
24  ~Box(){};
25 
26  osg::ref_ptr<osg::Vec3Array> vertices;
27  osg::ref_ptr<osg::Vec4Array> rotation;
28  osg::ref_ptr<osg::Vec4Array> ids;
29 
30  osg::Vec3 box_center;
31  };
32 
36  class Cloud
37  {
38  public:
43  {
44 
45  };
50  {
51  //delete[] m_boxes;
52  };
53 
54  std::vector<Box> m_boxes;
55 
56  osg::Vec3 cloud_center;
57 
58  osg::ref_ptr<osg::Vec3Array> ambientlight_color;
59  osg::ref_ptr<osg::Vec3Array> diffuselight_h;
60  osg::ref_ptr<osg::Vec3Array> diffuselight_t;
61 
62  float timeOfDay;
63  float fading;
64 
65  int num_boxes;
66 
67  };
68 
73  {
74  public:
78  ImportExport(void);
82  ~ImportExport(void);
83 
91  void AddCloud(osg::ref_ptr<osg::Vec3Array> vertices, osg::ref_ptr<osg::Vec4Array> rotation, osg::ref_ptr<osg::Vec4Array> center, osg::ref_ptr<osg::Vec4Array> ids, osg::ref_ptr<osg::Vec4Array> box_centers, int num_boxes);
96  void AddCloud(Cloud c);
104  void GetData(int at, osg::ref_ptr<osg::Vec3Array> &vertices, osg::ref_ptr<osg::Vec4Array> &rotation, osg::ref_ptr<osg::Vec4Array> &center, osg::ref_ptr<osg::Vec4Array> &ids);
109  unsigned int NumClouds();
110 
114  virtual void Perform() = 0;
115 
116  protected:
117  std::vector<Cloud> m_cloud;
118  };
119 }