Vitreous.hpp

00001 #ifndef __VITREOUS_HPP
00002 #define __VITREOUS_HPP
00003 
00004 #include <ocean/shrimp/VObjectStatus.hpp>
00005 #include <ocean/shrimp/VEnum.hpp>
00006 #include <ocean/GLvish/Shader.hpp>
00007 
00008 #include "VFieldRenderObject.hpp"
00009 #include <eye/retina/SortedFragmentIterator.hpp>
00010 
00011 
00012 namespace Wizt
00013 {
00014 
00067 class    fisheye_API Vitreous : public VFieldRenderObject
00068 {
00069 protected:
00070 public:
00071 
00072         typedef map<WeakPtr<FragmentID>, int>   LastSlices_t;
00073 
00074         struct  VolumeState : State
00075         {
00076                 RefPtr<Grid>    TheGrid;
00077                 RefPtr<Field>   Coords,
00078                                 TheField;
00079 
00080                 LastSlices_t    LastSlices;
00081         };
00082 
00083         override RefPtr<State> newState() const
00084         {
00085                 return new VolumeState();
00086         }
00087 
00088         TypedSlot<double>       Transparency; 
00089 
00090         TypedSlot<int>          nSlices,
00091                                 SubSample;
00092 
00093 public: 
00094         TypedSlot<Enum> SpecialOptions; 
00095 
00100         Vitreous(const string&name, int, const RefPtr<VCreationPreferences>&VP,
00101                  const string&inputfieldname); 
00102 
00106         ~Vitreous();
00107 
00108         override bool update(VRequest&R, double precision); 
00109 
00110         struct  FragmentRenderer : public SortedFragmentIterator
00111         {
00118                 Ageable                 Trigger;
00119 
00120                 int                     NumberOfSlices;
00121 
00122                 const Vitreous&         VR;
00123                 VGLRenderContext        &Context;
00124                 RefPtr<ValueSet>        Texture3DValues;
00125 
00126                 LastSlices_t            &LastSlices;
00127                 bool                    MaximumIntensityProjection;
00128                 RefPtr<GLProgram>       MyProgram;
00129                 int                     done;
00130 
00131                 FragmentRenderer(const Vitreous&myVR, VGLRenderContext&C, LastSlices_t&LS);
00132                 ~FragmentRenderer();
00133 
00134                 Range   myRange;
00135                 int     Left, Right, Sub;
00136 
00137                 override bool   apply(const SpatialFragment&VF);
00138         };      
00139 };
00140 
00141 } //namespace Wizt
00142 
00143 #endif // VITREOUS_HPP
00144 
00145