FragmentSelector.hpp

00001 #ifndef __FISH_BONE_FRAGMENT_HPP
00002 #define __FISH_BONE_FRAGMENT_HPP
00003 
00004 #include <ocean/plankton/VValue.hpp>
00005 #include <ocean/plankton/VObject.hpp>
00006 #include <field/FragmentSelector.hpp>
00007 
00008 #include "fishboneDllApi.h"
00009 
00010 namespace Wizt
00011 {
00012 
00013 typedef RefPtr<Fiber::FragmentSelector> VFragmentSelector;
00014 
00015 inline  string getExpression(const VFragmentSelector&FS, const string&fname)
00016 {
00017         if (!FS)
00018                 return "bool "+fname+"(vec4 p){return true;}"; 
00019 
00020         return FS->getExpression(fname);
00021 }
00022 
00023 template <>
00024 class fishbone_API VOutput<Fiber::FragmentSelector> : public VOutput<VFragmentSelector>
00025 {
00026 public:
00027         VOutput(const WeakPtr<VObject>&Source,
00028                 const string&initial_name,
00029                 const VFragmentSelector&FS = NullPtr(),
00030                 const RefPtr<VCreationPreferences>&CP = NullPtr() )
00031         : VOutput<VFragmentSelector>(Source, initial_name, FS, CP)
00032         {}
00033 };
00034 
00040 template <>
00041 struct  VValueCopyTrait<MemCore::RefPtr<Fiber::FragmentSelector> >
00042 {
00043 static  MemCore::RefPtr<Fiber::FragmentSelector> copy(const MemCore::RefPtr<Fiber::FragmentSelector>&Source)
00044         {
00045 //              if (!Source)
00046                 return MemCore::NullPtr(); 
00047 
00048 //              return RefPtr<Type>(new Type(*Source) );
00049         }
00050 };
00051 
00053 template <> 
00054 class fishbone_API VValueTrait<VFragmentSelector>
00055 {
00056 public:
00057 
00058 static  bool setValueFromText(VFragmentSelector&i, const string&s)
00059         {
00060                 // NOT IMPLEMENTED
00061                 return false;
00062         } 
00063 
00064 static  string Text(const VFragmentSelector&VF)
00065         {
00066                 return "<empty>";
00067         }
00068 };
00069 
00070 template <>
00071 struct  fishbone_API TypedSlot<Fiber::FragmentSelector> : TypedSlot<VFragmentSelector>
00072 {
00073         TypedSlot<Fiber::FragmentSelector>(VObject*that, const string&s, int prior=0); 
00074         ~TypedSlot();
00075 };
00076 
00077 } // namespace Wizt
00078 
00079 #endif /* __FISH_BONE_FIELD_HPP */
00080