Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef RVE_RENDER_CLIENT_RENDER_TARGET_H
00031 #define RVE_RENDER_CLIENT_RENDER_TARGET_H
00032
00033 #include "forwards.h"
00034 #include <rve_common/uuid.h>
00035 #include <rve_rpc/method_response.h>
00036 #include <rve_interfaces/RenderTarget.h>
00037 #include <rve_interfaces/RenderTarget_pickResponse.h>
00038
00039 #include "context_object.h"
00040
00041 #include <ros/types.h>
00042
00043 #include <string>
00044
00045 namespace rve_interfaces
00046 {
00047 class RenderTargetProxy;
00048 }
00049
00050 namespace rve_render_client
00051 {
00052
00053 class RenderTarget : public ContextObject
00054 {
00055 public:
00056 RenderTarget(uint32_t width, uint32_t height);
00057 virtual ~RenderTarget();
00058
00059 void resize(uint32_t width, uint32_t height);
00060 void attachCamera(const CameraPtr& cam);
00061 void pick(uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2,
00062 boost::function<void(const rve_rpc::MethodResponse<rve_interfaces::RenderTarget::pickResponse>&)>);
00063
00064 void requestRender();
00065
00066 ScreenRectPtr createScreenRect(uint32_t zorder = 0, float x0 = 0.0, float y0 = 0.0, float x1 = 1.0, float y1 = 1.0);
00067
00068 virtual const rve_common::UUID& getID() { return id_; }
00069 virtual void getDependencies(V_UUID& deps) {}
00070
00071 std::string getNamespace();
00072
00073 protected:
00074 void destroyScreenRect(ScreenRect*);
00075
00076 virtual void create(ClientContext* context);
00077 virtual void destroy(ClientContext* context);
00078
00079 virtual void doCreate() = 0;
00080
00081 rve_interfaces::RenderTargetProxy* getProxy();
00082 ClientContext* getContext() { return context_; }
00083
00084 ClientContext* context_;
00085 InterfaceHandle proxy_handle_;
00086 uint32_t width_;
00087 uint32_t height_;
00088 rve_common::UUID id_;
00089 rve_common::UUID camera_id_;
00090 rve_common::UUID camera_scene_id_;
00091 rve_render_client::CameraWPtr camera_;
00092
00093 private:
00094 };
00095
00096 }
00097
00098 #endif // RVE_RENDER_CLIENT_RENDER_TARGET_H
00099