#ifndef _SCREEN_PLANE_H_ #define _SCREEN_PLANE_H_ #include "screen/ScreenShape.h" namespace projection { /** * Plane screen class. */ class ScreenPlane : public ScreenShape { public: /** * Constructor. * * @param pScreen Screen data. */ ScreenPlane(Screen* pScreen); /** * Destructor. */ virtual ~ScreenPlane(); /** * Retrieve name of the sceen shape. * * @return Name of the screen shape. */ QString getName() const { return "Plane"; } /** * Set width of the plane screen. * * @param width Width of the plane screen. */ void setWidth(double width); /** * Retrieve width of the plane screen. * * @return Width of the plane screen. */ double getWidth() const { return m_width; } /** * Set height of the plane screen. * * @param height Height of the plane screen. */ void setHeight(double height); /** * Retrieve height of the plane screen. * * @return Height of the plane screen. */ double getHeight() const { return m_height; } /** * Set horizontal resolution of the plane screen. * * @param resolution Horizontal resolution of the plane screen. */ void setHorResolution(unsigned int resolution); /** * Retrieve horizontal resolution of the plane screen. * * @return Horizontal resolution of the plane screen. */ unsigned int getHorResolution() const { return m_horResolution; } /** * Set vertical resolution of the plane screen. * * @param resolution Vertical resolution of the plane screen. */ void setVertResolution(unsigned int resolution); /** * Retrieve vertical resolution of the plane screen. * * @return Vertical resolution of the plane screen. */ unsigned int getVertResolution() const { return m_vertResolution; } /** * 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); /** * Check whether the shape needs clipping for projection image. * * @return True if the projection requires clipping. */ virtual bool isClippingRequired() const { return false; } /** * 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. unsigned int m_horResolution; //!< Horizontal resolution. unsigned int m_vertResolution; //!< Vertical resolution. }; }; // projection #endif // _SCREEN_PLANE_H_