RenderOutput.h
Go to the documentation of this file.00001 /**<!--------------------------------------------------------------------> 00002 @class RenderOutput 00003 @author Travis Fischer (fisch0920@gmail.com) 00004 @author Matthew Jacobs (jacobs.mh@gmail.com) 00005 @date Fall 2008 00006 00007 @brief 00008 Records point samples from a renderer which may be used to construct 00009 an output image on a local or distributed machine 00010 <!-------------------------------------------------------------------->**/ 00011 00012 #ifndef RENDER_OUTPUT_H_ 00013 #define RENDER_OUTPUT_H_ 00014 00015 #include <utils/PropertyMap.h> 00016 #include <core/Viewport.h> 00017 #include <QMutex> 00018 00019 struct PointSample; 00020 00021 class RenderOutput : public PropertyMap { 00022 00023 public: 00024 ///@name Constructors 00025 //@{----------------------------------------------------------------- 00026 00027 inline RenderOutput(const Viewport &d) 00028 : PropertyMap(), m_viewport(d) 00029 { } 00030 00031 inline RenderOutput() 00032 : PropertyMap(), m_viewport(480, 480) 00033 { } 00034 00035 virtual ~RenderOutput() 00036 { } 00037 00038 00039 //@}----------------------------------------------------------------- 00040 ///@name Initialization 00041 //@{----------------------------------------------------------------- 00042 00043 /** 00044 * @brief 00045 * Performs any initialization which may be necessary before adding 00046 * samples with 'addSample' 00047 * 00048 * @note 00049 * Default implementation initializes the viewport with the properties 00050 * this RenderOutput has been assigned 00051 */ 00052 virtual void init(); 00053 00054 /** 00055 * @brief 00056 * Performs any post-processing on output after all samples have 00057 * been collected (called after rendering is complete) 00058 * 00059 * @note 00060 * Default implementation is blank 00061 */ 00062 virtual void finalize(); 00063 00064 00065 //@}----------------------------------------------------------------- 00066 ///@name Main usage interface 00067 //@{----------------------------------------------------------------- 00068 00069 /** 00070 * @brief 00071 * Adds the given point sample, which is assumed to have been 00072 * processed, to this output 00073 */ 00074 virtual void addSample(const PointSample &sample); 00075 00076 00077 //@}----------------------------------------------------------------- 00078 ///@name Accessors / Mutators 00079 //@{----------------------------------------------------------------- 00080 00081 inline const Viewport &getViewport() const { 00082 return m_viewport; 00083 } 00084 00085 inline void setViewport(const Viewport &d) { 00086 m_viewport = d; 00087 } 00088 00089 00090 //@}----------------------------------------------------------------- 00091 00092 protected: 00093 00094 /** 00095 * @note default implementation does nothing 00096 */ 00097 virtual void _addSample(const PointSample &sample); 00098 00099 protected: 00100 /// Provides mutual exclusion to sample storage data structure(s) 00101 QMutex m_mutex; 00102 00103 Viewport m_viewport; 00104 }; 00105 00106 #endif // RENDER_OUTPUT_H_ 00107
Generated on 28 Feb 2009 for Milton by
1.5.6