47 #ifndef _MIRA_IRIGIDMODELPROVIDER_H_ 48 #define _MIRA_IRIGIDMODELPROVIDER_H_ 57 namespace mira {
namespace model {
62 bool compress, uint32 maxFileSize);
76 template<
typename Reflector>
81 void reflect(RPCServer::RPCReflector& r) {
83 if (mServiceRegistered)
86 r.interface(
"IRigidModelProvider");
88 "Return the current rigid model");
90 r.interface(
"IResourceFileProvider");
91 r.property(
"MaxTransferFileSize", mMaxFileSize,
92 "Max size of files to transfer", std::numeric_limits<uint32>::max());
94 "Return a buffer containing the content of a resource file",
95 "filename",
"The file's filename",
"MyModel.mesh",
96 "compress",
"Whether to compress the returned buffer",
true);
98 mServiceRegistered =
true;
118 bool mServiceRegistered;
139 template<
typename Reflector>
144 "The name of the service that provides a rigid model " 145 "(if empty, a suitable service should be chosen automatically)",
148 r.method(
"getModelProviderChannel",
150 "Query channel where the service publishes changes of ModelProvider.");
152 r.interface(
"IRigidModelConsumer");
void initialize()
Must be called in service's initialize() method, after initializing mModelProvider.
IRigidModelProvider()
Definition: IRigidModelProvider.h:73
ServiceProperty mModelProvider
Definition: IRigidModelProvider.h:179
virtual Authority * getAuthority()=0
Must be implemented and return a valid authority.
void reflect(Reflector &r)
Reflect method for serialization.
Definition: IRigidModelProvider.h:140
A rigid model representation.
void reflect(RPCServer::RPCReflector &r)
Definition: IRigidModelProvider.h:81
Setter< T > setter(void(*f)(const T &))
virtual model::RigidModelPtr getRigidModel()=0
Return the used rigid model pointer.
IRigidModelConsumer is a unit that has a ServiceProperty 'ModelProvider' for an IRigidModelProvider s...
Definition: IRigidModelProvider.h:129
Buffer< uint8 > findAndLoadResourceFile(const std::string &filename, bool compress, uint32 maxFileSize)
boost::shared_ptr< RigidModel > RigidModelPtr
Definition: RigidModel.h:205
Channel< std::string > mModelProviderChannel
Definition: IRigidModelProvider.h:181
virtual ~IRigidModelConsumer()
Definition: IRigidModelProvider.h:136
virtual void setModelProviderInternal(ServiceProperty service)=0
Must be implemented in subclasses and must set mModelProvider.
virtual Buffer< uint8 > getResourceFile(const std::string &filename, bool compress)
Return the content of a resource file (may be required to display the model).
Definition: IRigidModelProvider.h:113
void setModelProvider(ServiceProperty service)
IRigidModelConsumer()
Definition: IRigidModelProvider.h:135
void reflect(Reflector &r)
Reflect method for serialization.
Definition: IRigidModelProvider.h:77
Interface for rigid model provider services.
Definition: IRigidModelProvider.h:69
virtual ~IRigidModelProvider()
The destructor.
Definition: IRigidModelProvider.h:102
virtual std::string getModelProviderChannel()
virtual std::string getModelProviderChannelInternal()
Can be implemented in subclasses to override the default channel name "<namespace/of/service>/ModelPr...