#ifndef _SCREEN_BOX_H_ #define _SCREEN_BOX_H_ #include "screen/ScreenShape.h" namespace projection { /** * Box screen class. */ class ScreenBox : public ScreenShape { public: /** * Constructor. * * @param pScreen Screen data. */ ScreenBox(Screen* pScreen); /** * Destructor. */ virtual ~ScreenBox(); /** * Retrieve name of the sceen shape. * * @return Name of the screen shape. */ QString getName() const { return "Box"; } /** * Set width of the box screen. * * @param width Width of the box screen. */ void setWidth(double width); /** * Retrieve width of the box screen. * * @return Width of the box screen. */ double getWidth() const { return m_width; } /** * Set height of the box screen. * * @param height Height of the box screen. */ void setHeight(double height); /** * Retrieve height of the box screen. * * @return Height of the box screen. */ double getHeight() const { return m_height; } /** * Set depth of the box screen. * * @param depth Depth of the box screen. */ void setDepth(double depth); /** * Retrieve depth of the box screen. * * @return Depth of the box screen. */ double getDepth() const { return m_depth; } /** * Set horizontal resolution of the box screen. * * @param resolution Horizontal resolution of the box screen. */ void setHorResolution(unsigned int resolution); /** * Retrieve horizontal resolution of the box screen. * * @return Horizontal resolution of the box screen. */ unsigned int getHorResolution() const { return m_horResolution; } /** * Set vertical resolution of the box screen. * * @param resolution Vertical resolution of the box screen. */ void setVertResolution(unsigned int resolution); /** * Retrieve vertical resolution of the box screen. * * @return Vertical resolution of the box screen. */ unsigned int getVertResolution() const { return m_vertResolution; } /** * Set depth resolution of the box screen. * * @param resolution Depth resolution of the box screen. */ void setDepthResolution(unsigned int resolution); /** * Retrieve depth resolution of the box screen. * * @return Depth resolution of the box screen. */ unsigned int getDepthResolution() const { return m_depthResolution; } /** * Retrieve bounding box of the screen shape. * * @param min One corner of the screen shape. * @param max Another corner of the screen shape. */ void getBoundingBox(gmtl::Vec3f& min, gmtl::Vec3f& max); /** * Restore the screen shape from XML data. * * @param element Parent XML element of the screen shape data. */ virtual bool initFromDOMElement(const QDomElement& element); /** * Store the current screen shape as XML data. * * @param name XML node name of the data. * @param doc XML document to store the data. * @return Current screen shape data as XML data. */ virtual QDomElement domElement(const QString& name, QDomDocument& doc) const; protected: /** * Draw the shape model in inherited class. * * @param bFrame True to draw a wire frame mesh. False to draw as a polygon model. */ void drawShape(bool bFrame); protected: double m_width; //!< Width. double m_height; //!< Height. double m_depth; //!< Depth. unsigned int m_horResolution; //!< Horizontal resolution. unsigned int m_vertResolution; //!< Vertical resolution. unsigned int m_depthResolution; //!< Depth resolution. }; }; // projection #endif // _SCREEN_BOX_H_