VertexFieldCollection.hpp

00001 #ifndef __VERTEXFIELDCOLLECTION_HPP
00002 #define __VERTEXFIELDCOLLECTION_HPP
00003 
00004 
00005 #include <bone/BundleInput.hpp>
00006 #include <bone/FishField.hpp>
00007 //#include <bone/ScalarFunctor.hpp>
00008 
00009 //#include <ocean/plankton/VModules.hpp>
00010 #include <ocean/plankton/VCreator.hpp>
00011 //#include <ocean/GLvish/VRenderObject.hpp>
00012 #include <ocean/GLvish/BoundingBox.hpp>
00013 #include <ocean/GLvish/Colormap.hpp>
00014 #include <ocean/GLvish/ArrayTypes.hpp>
00015 #include <ocean/GLvish/Shader.hpp>
00016 
00017 #include <ocean/eagle/PhysicalSpace.hpp>
00018 
00019 #include <ocean/shrimp/VEnum.hpp>
00020 
00021 #include <GL/fieldGL.hpp>
00022 #include <GL/FieldBuffer.hpp>
00023 
00024 #include <field/Fragment.hpp>
00025 
00026 #include "VertexField.hpp"
00027 
00028 namespace Wizt
00029 {
00030 
00037 typedef Fiber::Fragment  VertexFragment;
00038 
00045 class    fisheye_API  VertexFieldCollection : public virtual Fish<VObject>
00046                                             , public virtual Fish<Fiber::Grid>
00047                                             , private std::multimap<string, RefPtr<VertexField> >
00048 {
00049         typedef std::multimap<string, RefPtr<VertexField> > map_t;
00050 
00051 public:
00052         enum 
00053         {
00063                 NumberOfInputFields = 1
00064         }; 
00065 
00067         RefPtr<VertexField>     Positions; 
00068 
00070         VertexFieldCollection(VObject*that); 
00071 
00073         ~VertexFieldCollection(); 
00074 
00076         void insertVertexField(const string&s, const RefPtr<VertexField>&); 
00077 
00079         RefPtr<VertexField>&operator[](const string&s); 
00080 
00082         RefPtr<VertexField> operator()(const string&s) const; 
00083 
00089         override Fiber::Info<Fiber::Skeleton>
00090                         getRefinementLevel(int Level,
00091                                            const RefPtr<ValuePool>&VP,
00092                                            int IndexDepth = 0,
00093                                            const Fiber::BundlePtr&SpaceTime = Fiber::BundlePtr(NullPtr() ) );
00094 
00095 
00096         Fiber::Bundle::GridInfo_t findMostRecentGrid(const RefPtr<ValuePool>&VP, 
00097                                                      const Fiber::BundlePtr&SpaceTime = Fiber::BundlePtr( NullPtr() ) ); 
00098 
00099         Fiber::Bundle::GridInfo_t findMostRecentGrid(const string&collection_name,
00100                                                      const RefPtr<ValuePool>&VP,
00101                                                      const Fiber::BundlePtr&SpaceTime = Fiber::BundlePtr( NullPtr() ) );
00102 
00108         void    retrieveFields(Fiber::FieldCollection&FieldMap,
00109                                const RefPtr<Fiber::Representation>&MyRepresentation, 
00110                                const RefPtr<ValuePool>&Context);
00111 
00118         int append(const RefPtr<VBO>&myVBO, const VertexFragment&VertexFragments,
00119                    const RefPtr<GLProgram>&Shader) const; 
00120 
00125         bool    isOlderThan(const Ageable&A, const RefPtr<ValuePool>&Context) const; 
00126 
00127         void    updateAge(Ageable&A, const RefPtr<ValuePool>&Context) const; 
00128 
00132         RefPtr<StringList> getCurrentFieldnames(const RefPtr<ValuePool>&Context) const;
00133 
00139         struct   fisheye_API  Iterator
00140         {
00141                 virtual ~Iterator() = 0;
00142 
00143                 virtual bool apply(const string&name, const RefPtr<VertexField>&VF) = 0;
00144         }; 
00145 
00147         int     iterate(Iterator&It) const;
00148 };
00149 
00150 } // namespace Wizt
00151 
00152 #endif  // __VERTEXFIELDCOLLECTION_HPP