render_target.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2010, Willow Garage, Inc.
00003  * All rights reserved.
00004  *
00005  * Redistribution and use in source and binary forms, with or without
00006  * modification, are permitted provided that the following conditions are met:
00007  *
00008  *     * Redistributions of source code must retain the above copyright
00009  *       notice, this list of conditions and the following disclaimer.
00010  *     * Redistributions in binary form must reproduce the above copyright
00011  *       notice, this list of conditions and the following disclaimer in the
00012  *       documentation and/or other materials provided with the distribution.
00013  *     * Neither the name of the Willow Garage, Inc. nor the names of its
00014  *       contributors may be used to endorse or promote products derived from
00015  *       this software without specific prior written permission.
00016  *
00017  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00018  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00019  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00020  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
00021  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
00022  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
00023  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00024  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
00025  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00026  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00027  * POSSIBILITY OF SUCH DAMAGE.
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 } // namespace rve_render_client
00097 
00098 #endif // RVE_RENDER_CLIENT_RENDER_TARGET_H
00099 


rve_render_client
Author(s): Josh Faust
autogenerated on Wed Dec 11 2013 14:31:32