40 #ifndef GLS_RSO_LOADER_H_INCLUDED
41 #define GLS_RSO_LOADER_H_INCLUDED
51 class LiveComponentLibRef;
57 unsigned int _rsoVersion;
58 LiveComponentLibRef* _liveComponentLibRef;
85 inline void SetResource(
const char* resourceName,
const char* resourceVal ) { _rso->
SetResource( resourceName, resourceVal ); }
137 void GetBackgroundColor(
unsigned char& r,
unsigned char& g,
unsigned char& b,
unsigned char& a );
154 void SetProjection(
int controlWidth,
int controlHeight,
float depthFactor = 4.0f,
float fov = 90.0f,
bool perspective =
false );
218 bool CreateResourceHandle(
const char* resourceName, disti::RSOInterface2::ResourceHandle& resourceHandle );
237 bool SetResource( disti::RSOInterface2::ResourceHandle resourceHandle,
const char* resourceVal );
244 bool GetResource( disti::RSOInterface2::ResourceHandle resourceHandle,
const char*& resourceValue );
251 bool SetIntResource(
const char* resourceName,
long resourceVal );
257 bool SetIntResource( disti::RSOInterface2::ResourceHandle resourceHandle,
long resourceVal );
264 bool GetIntResource(
const char* resourceName,
long& resourceVal );
270 bool GetIntResource( disti::RSOInterface2::ResourceHandle resourceHandle,
long& resourceVal );
283 bool SetFloatResource( disti::RSOInterface2::ResourceHandle resourceHandle,
double resourceVal );
296 bool GetFloatResource( disti::RSOInterface2::ResourceHandle resourceHandle,
double& resourceVal );
334 RSOReference*
LoadRSO(
const char* fileName,
const char* className = 0,
bool absolutePlacement =
true );
376 Culler(
bool enabled =
true );
390 int _groupLevelsDown;
391 std::vector<std::string> _excludeList;
392 std::vector<std::string> _includeList;
414 inline void LevelsUp(
int value ) { _levelsUp = value; }
438 inline void NamesOnly(
bool value ) { _namesOnly = value; }
489 virtual bool PassFilter(
const char* name )
const;
492 GlsResourceFilter&
operator=(
const GlsResourceFilter& rhs );
502 typedef void ( T::*Callback )( disti::RSOInterface2::ResourceHandle );
510 virtual void Call( disti::RSOInterface2::ResourceHandle handle )
512 ( _object->*( _method ) )( handle );
515 virtual void Destroy()
529 template<
class Class>
RSOReference * LoadRSO(const char *fileName, const char *className=0, bool absolutePlacement=true)
Definition: rso_interface_1.h:578
bool SetIntResource(const char *resourceName, long resourceVal)
bool HandleInput(disti::RSOInterface1::Event *ev)
Definition: gls_rso_loader.h:117
void Draw()
Definition: gls_rso_loader.h:111
Definition: rso_interface_5.h:64
virtual bool SetEmittedEventHandler(EmittedEventHandler *handler)=0
Definition: rso_interface_1.h:290
bool HandleKeyDown(int key, int x, int y)
Culler()
Definition: rso_interface_1.h:296
int LevelsUp() const
Definition: gls_rso_loader.h:413
bool GetBoundingBox(disti::RSOInterface1::Vector *min, disti::RSOInterface1::Vector *max, disti::RSOInterface1::MatrixD *transform=0)
virtual void SetResource(const char *resourceName, const char *resourceVal)=0
Set the string value for a given named resource.
bool GetFloatResource(const char *resourceName, double &resourceVal)
void SetOpenGLDefaultState(bool pushState)
disti::RSOInterface4::ResourceObserver * CreateResourceMethodCallback(Class *const obj, const typename ResourceMethodCallback< Class >::Callback method)
Definition: gls_rso_loader.h:530
virtual bool HandleInput(Event *ev)=0
int IncludeCount() const
Returns the number of includes in the filter.
bool HandleMouseDown(int x, int y, int button)
bool RegisterResourceObserver(disti::RSOInterface2::ResourceHandle resourceHandle, disti::RSOInterface4::ResourceObserver *obs, disti::RSOInterface4::CallbackID &id)
void AbsolutePlacement(bool value)
void ClearExcludes()
Removes all entries from the exclude list.
void RemoveExclude(unsigned int index)
const char * GetInclude(int index) const
bool CreateResourceHandle(const char *resourceName, disti::RSOInterface2::ResourceHandle &resourceHandle)
void AddInclude(const char *name)
bool IsResourceHandleValid(disti::RSOInterface2::ResourceHandle resourceHandle)
Definition: gls_rso_loader.h:370
virtual const char * GetResource(const char *resourceName)=0
Get the string value for the given resource.
bool HandleMouseWheelPlus(int x, int y, int buttonMask)
Definition: rso_interface_4.h:63
Definition: gls_rso_loader.h:353
void GetBackgroundColor(unsigned char &r, unsigned char &g, unsigned char &b, unsigned char &a)
void RemoveInclude(unsigned int index)
Definition: rso_interface_1.h:302
bool UnregisterResourceObserver(disti::RSOInterface2::ResourceHandle resourceHandle, disti::RSOInterface4::CallbackID id)
virtual void PreDraw(const OpenGLMatrices ¤t, Culler &culler)=0
Definition: gls_rso_loader.h:386
void Calculate(double time)
void SetResource(const char *resourceName, const char *resourceVal)
Definition: gls_rso_loader.h:85
Definition: gls_rso_loader.h:54
Definition: rso_interface_1.h:592
bool ReleaseResourceHandle(disti::RSOInterface2::ResourceHandle resourceHandle)
bool HandleMouseUp(int x, int y, int button)
void SetResources(const char *buf)
int GroupLevelsDown() const
Definition: gls_rso_loader.h:430
void SetProjection(int controlWidth, int controlHeight, float depthFactor=4.0f, float fov=90.0f, bool perspective=false)
bool GetRedraw()
Definition: gls_rso_loader.h:324
void Invalidate()
Definition: gls_rso_loader.h:314
bool HandleMouseWheelMinus(int x, int y, int buttonMask)
Definition: rso_interface_1.h:60
Namespace for loading RSOs.
Definition: gls_rso_loader.h:49
Definition: rso_interface_1.h:209
void RestoreOpenGLState()
const char * GetResource(const char *resourceName)
Definition: gls_rso_loader.h:97
bool SetEmittedEventHandler(disti::RSOInterface1::EmittedEventHandler *handler)
Definition: gls_rso_loader.h:124
disti::RSOInterface1 * GetRSOInterface1()
Definition: gls_rso_loader.h:74
Definition: rso_interface_1.h:185
bool HandleMouseMove(int x, int y, int buttonMask)
bool HandleKeyUp(int key, int x, int y)
virtual bool PassFilter(const char *name) const
Test a resource name against the filter.
Definition: rso_interface_1.h:242
void PreDraw(const disti::RSOInterface1::OpenGLMatrices ¤t, disti::RSOInterface1::Culler &culler)
Definition: gls_rso_loader.h:108
Definition: gls_rso_loader.h:499
bool NamesOnly() const
Definition: gls_rso_loader.h:437
bool SetFloatResource(const char *resourceName, double resourceVal)
int ExcludeCount() const
Returns the number of exclude entries in the filter.
void SetRedraw(bool redraw)
Definition: gls_rso_loader.h:319
void DestroyRSO(RSOReference *)
bool GetIntResource(const char *resourceName, long &resourceVal)
void ClearIncludes()
Removes all entries from the include list.
unsigned int GetRSOVersion()
Definition: gls_rso_loader.h:79
const char * GetExclude(int index) const
unsigned int CallbackID
Type for unique identifiers.
Definition: rso_interface_4.h:79
void AddExclude(const char *name)
void ExtractFrustum(disti::RSOInterface1::OpenGLMatrices ¤tMatrices)
Defines the RSO interface v5, which extends v4 to add conditional rendering support.
GlsResourceFilter & operator=(const GlsResourceFilter &rhs)
assignment operator