40 #ifndef GLS_RSO_LOADER_H_INCLUDED
41 #define GLS_RSO_LOADER_H_INCLUDED
51 class LiveComponentLibRef;
57 unsigned int _rsoVersion;
58 LiveComponentLibRef* _liveComponentLibRef;
84 inline void SetResource(
const char* resourceName,
const char* resourceVal ) { _rso->
SetResource( resourceName, resourceVal ); }
136 void GetBackgroundColor(
unsigned char& r,
unsigned char& g,
unsigned char& b,
unsigned char& a );
153 void SetProjection(
int controlWidth,
int controlHeight,
float depthFactor = 4.0f,
float fov = 90.0f,
bool perspective =
false );
217 bool CreateResourceHandle(
const char* resourceName, disti::RSOInterface2::ResourceHandle& resourceHandle );
236 bool SetResource( disti::RSOInterface2::ResourceHandle resourceHandle,
const char* resourceVal );
243 bool GetResource( disti::RSOInterface2::ResourceHandle resourceHandle,
const char*& resourceValue );
250 bool SetIntResource(
const char* resourceName,
long resourceVal );
256 bool SetIntResource( disti::RSOInterface2::ResourceHandle resourceHandle,
long resourceVal );
263 bool GetIntResource(
const char* resourceName,
long& resourceVal );
269 bool GetIntResource( disti::RSOInterface2::ResourceHandle resourceHandle,
long& resourceVal );
282 bool SetFloatResource( disti::RSOInterface2::ResourceHandle resourceHandle,
double resourceVal );
295 bool GetFloatResource( disti::RSOInterface2::ResourceHandle resourceHandle,
double& resourceVal );
320 RSOReference*
LoadRSO(
const char* fileName,
const char* className = 0,
bool absolutePlacement =
true );
362 Culler(
bool enabled =
true );
376 int _groupLevelsDown;
377 std::vector<std::string> _excludeList;
378 std::vector<std::string> _includeList;
400 inline void LevelsUp(
int value ) { _levelsUp = value; }
424 inline void NamesOnly(
bool value ) { _namesOnly = value; }
475 virtual bool PassFilter(
const char* name )
const;
478 GlsResourceFilter&
operator=(
const GlsResourceFilter& rhs );
488 typedef void ( T::*Callback )( disti::RSOInterface2::ResourceHandle );
496 virtual void Call( disti::RSOInterface2::ResourceHandle handle )
498 ( _object->*( _method ) )( handle );
501 virtual void Destroy()
515 template<
class Class>
RSOReference * LoadRSO(const char *fileName, const char *className=0, bool absolutePlacement=true)
Definition: rso_interface_1.h:580
bool SetIntResource(const char *resourceName, long resourceVal)
bool HandleInput(disti::RSOInterface1::Event *ev)
Definition: gls_rso_loader.h:116
void Draw()
Definition: gls_rso_loader.h:110
virtual bool SetEmittedEventHandler(EmittedEventHandler *handler)=0
Definition: rso_interface_1.h:292
bool HandleKeyDown(int key, int x, int y)
int LevelsUp() const
Definition: gls_rso_loader.h:399
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:516
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:356
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:339
void GetBackgroundColor(unsigned char &r, unsigned char &g, unsigned char &b, unsigned char &a)
void RemoveInclude(unsigned int index)
Definition: rso_interface_1.h:304
bool UnregisterResourceObserver(disti::RSOInterface2::ResourceHandle resourceHandle, disti::RSOInterface4::CallbackID id)
virtual void PreDraw(const OpenGLMatrices ¤t, Culler &culler)=0
Definition: gls_rso_loader.h:372
void Calculate(double time)
Definition: gls_rso_loader.h:101
void SetResource(const char *resourceName, const char *resourceVal)
Definition: gls_rso_loader.h:84
Definition: gls_rso_loader.h:54
Definition: rso_interface_1.h:594
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:416
void SetProjection(int controlWidth, int controlHeight, float depthFactor=4.0f, float fov=90.0f, bool perspective=false)
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:96
bool SetEmittedEventHandler(disti::RSOInterface1::EmittedEventHandler *handler)
Definition: gls_rso_loader.h:123
disti::RSOInterface1 * GetRSOInterface1()
Definition: gls_rso_loader.h:73
Definition: rso_interface_1.h:185
bool HandleMouseMove(int x, int y, int buttonMask)
virtual void Calculate(double time)=0
The RSO Interface methods.
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:107
Definition: gls_rso_loader.h:485
bool NamesOnly() const
Definition: gls_rso_loader.h:423
bool SetFloatResource(const char *resourceName, double resourceVal)
int ExcludeCount() const
Returns the number of exclude entries in the filter.
void DestroyRSO(RSOReference *)
bool GetIntResource(const char *resourceName, long &resourceVal)
void ClearIncludes()
Removes all entries from the include list.
Defines the RSO interface v4, which extends v3 to add ResourceObserver.
unsigned int GetRSOVersion()
Definition: gls_rso_loader.h:78
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)
GlsResourceFilter & operator=(const GlsResourceFilter &rhs)
assignment operator