5 #ifndef BALL_VIEW_RENDERING_RENDERERS_RTFACTRENDERER_H
6 #define BALL_VIEW_RENDERING_RENDERERS_RTFACTRENDERER_H
8 #define BALLVIEW_RTFACTRENDERER_THROW(exceptionName, message) (throw BALL::Exception::##exceptionName##(__FILE__, __LINE__, message))
20 #include <RTpieCpp/RayTracerHandle.hpp>
21 #include <RTfact/Model/Image/BasicImage2D.hpp>
22 #include <RTfact/Model/Framebuffer/Image2DFramebuffer.hpp>
23 #include <RTfact/Utils/FPSMeter.hpp>
28 struct hash< RTpieCpp::MeshHandle >
37 size_t operator()(
const RTpieCpp::MeshHandle& x )
const throw() {
45 struct hash< RTpieCpp::InstanceHandle >
54 size_t operator()(
const RTpieCpp::InstanceHandle& x )
const throw() {
112 rtfact_needs_update_(false)
121 virtual bool hasFPScounter();
123 virtual double getFPS();
128 virtual bool init(
Scene& scene);
132 return "RTfact-RTRemote Ray Tracer";
141 std::list<GeometricObject*>& objects);
145 virtual void setSize(
float width,
float height);
147 virtual void setupStereo(
float eye_separation,
float focal_length);
149 virtual void getFrustum(
float& near_f,
float& far_f,
float& left_f,
float& right_f,
float& top_f,
float& bottom_f);
150 virtual void setFrustum(
float near_f,
float far_f,
float left_f,
float right_f,
float top_f,
float bottom_f);
152 virtual void prepareBufferedRendering(
const Stage& stage);
155 virtual void useContinuousLoop(
bool use_loop);
161 void setLights(
bool reset_all =
false);
163 void updateCamera(
const Camera* camera = 0);
165 void updateBackgroundColor();
167 void setupEnvironmentMap(
const QImage& image);
174 void updateMaterialFromStage(RTpieCpp::AppearanceHandle& material);
175 void convertMaterial(
Stage::Material const& rt_material, RTpieCpp::AppearanceHandle& material);
187 virtual std::vector<float> intersectRaysWithGeometry(
const std::vector<Vector3>& origins,
const std::vector<Vector3>& directions);
193 static const float vectorDifferenceTolerance_;
197 template<
typename taPixelType>
198 void renderImpl(taPixelType* buffer,
const unsigned int width,
const unsigned int height,
const unsigned int pitch);
200 void renderImpl(
float* buffer,
const unsigned int width,
const unsigned int height,
const unsigned int pitch)
204 std::vector<RTpieCpp::LightHandle> lights_;
206 typedef RTfact::BasicImage2D<float> t_ColorImage;
207 typedef RTfact::BasicImage2D<float> t_DistanceImage;
208 typedef RTfact::Image2DFramebuffer<
210 t_DistanceImage> t_Framebuffer;
212 typedef RTfact::BasicImage2D<unsigned char> t_ByteColorImage;
213 typedef RTfact::BasicImage2D<unsigned char> t_ByteDistanceImage;
214 typedef RTfact::Image2DFramebuffer<
216 t_ByteDistanceImage> t_ByteFramebuffer;
218 RTpieCpp::SceneHandle sceneHandle;
219 RTpieCpp::RayTracerHandle rayTracer;
220 RTpieCpp::CameraHandle cameraHandle;
221 RTpieCpp::FrameBufferHandle renderBuffer;
222 RTpieCpp::RenderTaskHandle renderTask;
223 t_Framebuffer framebuffer;
224 t_ByteFramebuffer byteFramebuffer;
227 RTfact::FPSMeter fpsMeter;
228 RTpieCpp::PickTaskHandle pickTask;
237 bool rtfact_needs_update_;
251 #endif // BALL_VIEW_RENDERING_RTFACTRENDERER_H
std::vector< RTpieCpp::AppearanceHandle > material_handles
The materials.
std::vector< RTpieCpp::GeometryHandle > object_handles
The object handles (all objects)
boost::shared_ptr< FrameBuffer > FrameBufferPtr
std::vector< RTpieCpp::MeshHandle > cutPlaneMeshes
Cut-plane meshes.
virtual ~RTfactRenderer()
Destructor.
std::vector< RTpieCpp::GeometryHandle > cutPlanes
Cut-plane geometries.
BALL_EXTERN_VARIABLE const double c
std::vector< RTpieCpp::InstanceHandle > cutPlaneInstances
Cut-plane instances.
size_t operator()(const RTpieCpp::MeshHandle &x) const
RTfactRenderer()
Default Constructor.
std::vector< RTpieCpp::MeshHandle > mesh_handles
The meshes.
bool has_been_disabled
Mark previously disabled representations.
size_t operator()(const RTpieCpp::InstanceHandle &x) const
std::vector< RTpieCpp::InstanceHandle > instance_handles
The instances (visible objects)
RTpieCpp::AppearanceHandle cutPlaneShader
Cut-planes material.
virtual String getRenderer()
HashMap class based on the STL map (containing serveral convenience functions)
virtual void formatUpdated()