CloudyDay
 All Classes Functions Variables Enumerations
WangCloud.h
1 #pragma once
2 #include "Scene.h"
3 #include "CloudCreateVolume.h"
4 #include <osgViewer/Viewer>
5 
6 #include <osg/ShapeDrawable>
7 #include <osgViewer/ViewerEventHandlers>
8 #include <osgDB/ReadFile>
9 #include <osg/Texture2D>
10 #include <osgGA/StateSetManipulator>
11 #include <osg/Program>
12 #include <osg/PolygonMode>
13 #include <osg/Notify>
14 #include <osg/ref_ptr>
15 #include <osg/Geode>
16 #include <osg/Geometry>
17 #include <osg/Point>
18 #include <osg/Vec3>
19 #include <osg/Vec4>
20 #include <osg/Program>
21 #include <osg/Shader>
22 #include <osg/Uniform>
23 #include <osg/BlendFunc>
24 #include <osg/Depth>
25 #include <osgViewer/Viewer>
26 
27 #include <iostream>
28 #include <algorithm>
29 
30 namespace osgCloudyDay
31 {
32  class CloudGenerator;
33 
37  class WangCloud
38  {
39  public:
43  WangCloud(void);
48  WangCloud(int category);
61  WangCloud(int category,
62  osg::ref_ptr<osg::Vec3Array> vertices,
63  osg::ref_ptr<osg::Vec4Array> rotation,
64  osg::ref_ptr<osg::Vec4Array> center,
65  osg::ref_ptr<osg::Vec4Array> ids,
66  osg::ref_ptr<osg::Vec4Array> boxcenters,
67  osg::ref_ptr<osg::Vec3Array> ambientlight_h,
68  osg::ref_ptr<osg::Vec3Array> ambientlight_t,
69  osg::ref_ptr<osg::Vec3Array> diffuselight,
70  osg::ref_ptr<osg::Vec4Array> color);
74  ~WangCloud(void);
75 
81 
85  void GetBoundingBox();
86 
91  osg::Vec3 BoundingBoxMax();
96  osg::Vec3 BoundingBoxMin();
97 
101  void Setup();
102 
107  osg::Vec3Array* GetVertices();
112  osg::Vec4Array* GetRotation();
117  osg::Vec4Array* GetColor();
122  osg::Vec4Array* GetCenter();
127  osg::Vec4Array* GetIds();
132  osg::Vec4Array* GetBoxCenters();
137  int& GetNumberOfIndices();
138 
143  void SetCloudGenerator(CloudGenerator* generator);
144 
150 
151  protected:
152  CloudGenerator* m_generator;
153 
154  int num_indices;
155  osg::ref_ptr<osg::Vec3Array> vertices;
156  osg::ref_ptr<osg::Vec4Array> rotation;
157  osg::ref_ptr<osg::Vec4Array> center;
158  osg::ref_ptr<osg::Vec4Array> ids;
159  osg::ref_ptr<osg::Vec4Array> box_centers;
160  osg::ref_ptr<osg::Vec4Array> color;
161 
162  osg::Vec3 bb_min;
163  osg::Vec3 bb_max;
164 
165  unsigned int m_type;
166 
167  };
168 }