00001 #ifndef POLYGONSETWATERSURFACE_H
00002 #define POLYGONSETWATERSURFACE_H
00003
00004 #include <vrs/environment/config.h>
00005 #include <vrs/environment/watersurface.h>
00006 #include <vrs/polygonset.h>
00007
00008 #include <vrs/container/iterator.h>
00009
00010 using VRS::SO;
00011 using VRS::Iterator;
00012 using VRS::PolygonSet;
00013 using VRS::Vector;
00014
00015 typedef VRS::VertexData<2, float> VertexData2f;
00016
00017 namespace EnvironmentRenderer {
00018
00024 class VRS_ENV_API PolygonSetWaterSurface : public EnvironmentRenderer::WaterSurface
00025 {
00026 public:
00027 PolygonSetWaterSurface(VRS::SO<VRS::Iterator<VRS::SO<VRS::PolygonSet> > > surface,
00028 const VRS::Vector& flowDirection,
00029 const VRS::Color& waterColor = VRS::Color::slate_blue,
00030 float fresnelBias = 0.0f,
00031 const VertexData2f& reflectionScale = VertexData2f(0.2f, 0.2f),
00032 const VertexData2f& refractionScale = VertexData2f(0.2f, 0.2f),
00033 double junctionSize = 0.0,
00034 bool refracting = false,
00035 const VRS::Matrix& waveTf = VRS::Matrix::identity);
00036
00037 virtual VRS::Bounds boundingBox() const { return m_boundingBox; }
00038
00042 double getAverageDeviation() const { return m_averageDeviation; }
00043
00044 void setPolygonSetSurface(VRS::SO<VRS::Iterator<VRS::SO<VRS::PolygonSet> > > surface);
00045 VRS::SO<VRS::Iterator<VRS::SO<VRS::PolygonSet> > > getPolygonSetSurface() const { return m_pSetSurface; }
00046
00047
00048 VRS_TYPEINFO(PolygonSetWaterSurface, EnvironmentRenderer::WaterSurface);
00049 VRS_SERIALIZABLE(PolygonSetWaterSurface);
00050
00051 private:
00052 PolygonSetWaterSurface();
00053
00054 VRS::SO<VRS::Iterator<VRS::SO<VRS::Facet> > > getSurface() const;
00055 void setSurface(VRS::SO<VRS::Iterator<VRS::SO<VRS::Facet> > > surface);
00056
00057 void setupWaterSurface();
00058
00059 VRS::SO<VRS::Iterator<VRS::SO<VRS::PolygonSet> > > m_pSetSurface;
00060 VRS::Bounds m_boundingBox;
00061
00062 double m_averageDeviation;
00063 };
00064
00065 }
00066
00067 #endif // POLYGONSETWATERSURFACE_H
00068