/********************************************************************/ /* Copyright (c) 2017 System fugen G.K. and Yuzi Mizuno */ /* All rights reserved. */ /********************************************************************/ #ifndef _MGPlaneImage_HH_ #define _MGPlaneImage_HH_ #include #include "mg/Plane.h" #include "mgGL/Image.h" #include "mgGL/texture.h" // //Define MGPlaneImage Class. class MGOfstream; class MGIfstream; /** @addtogroup GLAttrib * @{ */ ///MGPlaneImage defines square image plane. ///This is displayed using texture mapping. ///The plane's root point is the (left, bottom) point of the image(m_image). ///m_uderiv and m_vderiv of the plane are always defined as unit_vectors. ///The pixel sizes are also defined as m_pixelSizeWidth and m_pixelSizeHeight. ///This implies width and hight can be different size. class MG_DLL_DECLR MGPlaneImage:public MGPlane{ public: MGImage m_image;/// skeleton(int density=1)const; std::string whoami()const{return "PlaneImage";}; ///Read all member data. void ReadMembers(MGIfstream& buf); ///Write all member data void WriteMembers(MGOfstream& buf)const; /// Output function. std::ostream& out(std::ostream&) const; //Get the one pixel size in world coordinate for width. double pixelSizeWidth()const{return m_pixelSizeWidth;}; //Get the one pixel size in world coordinate for height. double pixelSeizeHeight()const{return m_pixelSizeHeight;}; //Get total image size in world coordnate for width. double totalWidth()const; //Get total image size in world coordnate for height. double totalHeight()const; private: mutable mgTexture m_texture;//Texture to draw this image. double m_pixelSizeWidth, m_pixelSizeHeight; ///