VectorSpeckles.hpp

00001 #include <ocean/GLvish/Colormap.hpp>
00002 #include <eye/retina/SplatRenderObject.hpp>
00003 
00004 namespace VectorViz
00005 {
00006 
00007 using namespace Wizt;
00008 using namespace Fiber;
00009 using namespace Eagle;
00010 
00033 class   VectorSpeckle : public SplatRenderObject, public Colorizer
00034 {
00035 public:
00036         typedef LIST<Eagle::tvector3> InputTypes;
00037 
00038         TypedSlot<double>       scaleFactor,
00039                                 velocityFactor,
00040                                 zeroness      ;
00041 
00042         struct  LocalState : State
00043         {
00044                 Eagle::point3   LastObserverPos;
00045                 double          LastTime;
00046 
00047                 LocalState()
00048                 : LastTime(-1)
00049                 {}
00050         };
00051 
00052         override RefPtr<VObject::State> newState() const
00053         {
00054                 return new LocalState();
00055         }
00056 
00057         VectorSpeckle(const string&name, int p, const RefPtr<VCreationPreferences>&VP);
00058 
00059         override string GLCacheField(const RefPtr<ValuePool>&Context) const;
00060 
00061         override string splat_vertex_shader(VGLRenderContext&Context) const;
00062         override string splat_fragment_shader(VGLRenderContext&Context) const;
00063 
00064         override void setShaderVariables(VGLRenderContext&Context, const RefPtr<GLProgram>&ShaderProgram) const;
00065 
00066 static string createChildname(const string&parent_name)
00067         {
00068                 return "VectorSpecklesOf" + parent_name;
00069         }
00070 };
00071 
00072 } // VectorViz
00073