#ifndef _SCREEN_MODEL_H_ #define _SCREEN_MODEL_H_ #include "screen/ScreenShape.h" #include #include "glm/glm.h" // Only requiered to be able to retireve a GUI-Pointer #include "Screen.h" #include "ProjectionModel.h" #include "GUIControler.h" namespace projection { /** * Model screen class. */ class ScreenModel : public ScreenShape { Q_OBJECT public: /** * Constructor. * * @param pScreen Screen data. */ ScreenModel(Screen* pScreen); /** * Destructor. */ virtual ~ScreenModel(); /** * Retrieve name of the sceen shape. * * @return Name of the screen shape. */ QString getName() const { return "Model"; } /** * Load a model file. * * @param fileName File name of a model to load. */ void setFileName(const QString& fileName); /** * Retrieve file name of the model. * * @return File name of the model. */ QString getFileName() const; /** * 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: QString m_fileName; //!< File name of the model. GLMmodel* m_pModel; //!< glm model data structure. GLuint m_modelIndex; //!< gml model display list index. Screen* m_pScreen; }; }; // projection #endif // _SCREEN_MODEL_H_