00001 #ifndef RENDERGROUPPROXYCONTAINER_H 00002 #define RENDERGROUPPROXYCONTAINER_H 00003 00004 #include "Types.h" 00005 #include "PropertyProxy.h" 00006 00007 namespace RenderTools { 00008 00009 template< class T > 00010 class PropertyProxyContainer : public PropertyContainer< PropertyProxy< T > > { 00011 public: 00012 PropertyProxyContainer( void ): 00013 PropertyContainer< PropertyProxy< T > >( ){ 00014 } 00015 00016 virtual void onInitialize( void ){ 00017 AbstractPropertyContainer::onInitialize(); 00018 } 00019 00020 virtual const PropertyPtr addProperty( const PropertyPtr & p, bool send ){ 00021 return( AbstractPropertyContainer::addProperty( p, send ) ); 00022 } 00023 00024 virtual const PropertyPtr addProperty( const string name, bool send ){ 00025 PropertyPtr p( new PropertyProxy< T >( ) ); 00026 p->createProperties(); 00027 p->setValue( name ); 00028 addProperty( p, send ); 00029 return( p ); 00030 } 00031 00032 virtual const shared_ptr< PropertyProxy< T > > getItem( unsigned int i ) const { 00033 return( dynamic_pointer_cast< PropertyProxy< T >, AbstractProperty >( getProperty( i ) ) ); 00034 } 00035 00036 }; 00037 00038 template< class T > 00039 inline ostream & operator << ( ostream & os, const PropertyProxyContainer<T> * rhs ){ 00040 return( os ); 00041 } 00042 00043 template< class T > 00044 inline const istream & operator >> ( const istream & is, PropertyProxyContainer<T> * rhs ){ 00045 return( is ); 00046 } 00047 00048 typedef PropertyProxyContainer< Camera > CameraProxyContainer; 00049 typedef PropertyProxyContainer< Stateset > StatesetProxyContainer; 00050 typedef PropertyProxyContainer< Sampler > SamplerProxyContainer; 00051 typedef PropertyProxyContainer< Rendernode > RendernodeProxyContainer; 00052 typedef PropertyProxyContainer< Framebuffer > FramebufferProxyContainer; 00053 typedef PropertyProxyContainer< Renderbuffer > RenderbufferProxyContainer; 00054 typedef PropertyProxyContainer< Vertexbuffer > VertexbufferProxyContainer; 00055 typedef PropertyProxyContainer< Renderpass > RenderpassProxyContainer; 00056 00057 typedef shared_ptr< CameraProxyContainer > CameraProxyContainerPtr; 00058 typedef shared_ptr< StatesetProxyContainer > StatesetProxyContainerPtr; 00059 typedef shared_ptr< SamplerProxyContainer > SamplerProxyContainerPtr; 00060 typedef shared_ptr< FramebufferProxyContainer > FramebufferProxyContainerPtr; 00061 typedef shared_ptr< RenderbufferProxyContainer > RenderbufferProxyContainerPtr; 00062 typedef shared_ptr< VertexbufferProxyContainer > VertexbufferProxyContainerPtr; 00063 typedef shared_ptr< RendernodeProxyContainer > RendernodeProxyContainerPtr; 00064 typedef shared_ptr< RenderpassProxyContainer > RenderpassProxyContainerPtr; 00065 00066 #ifndef RT_GLES1 00067 typedef PropertyProxyContainer< Program > ProgramProxyContainer; 00068 typedef shared_ptr< ProgramProxyContainer > ProgramProxyPtrContainerPtr; 00069 #endif 00070 00071 }; // namespace RenderTools 00072 00073 #endif