/********************************************************************/ /* Copyright (c) 2017 System fugen G.K. and Yuzi Mizuno */ /* All rights reserved. */ /********************************************************************/ #ifndef _MGGLViewAttrib_HH_ #define _MGGLViewAttrib_HH_ #include "mg/Position.h" #include "mgGL/ConstructionPlane.h" #include class MGOfstream; class MGIfstream; class MGBox; class MGOpenGLView; /** @file */ /** @addtogroup DisplayHandling * @{ */ ///MGglViewAttrib is a class to serialize MGOpenGLView. ///MGglViewAttrib is used by MGOpenGLView and MGContext to define ///view-mode, construction plane's geometry data, and viewing transformation ///matrix data. class MG_DLL_DECLR MGglViewAttrib{ public: ///Debug Function. MG_DLL_DECLR friend std::ostream& operator<< (std::ostream& out, const MGglViewAttrib& atr); /// Serialization fucntion. MG_DLL_DECLR friend MGOfstream& operator<< (MGOfstream& buf, const MGglViewAttrib& atr); MG_DLL_DECLR friend MGIfstream& operator>> (MGIfstream& buf, MGglViewAttrib& atr); //////////////////////////////////METHOD///////////////////// MGglViewAttrib(bool is_perspective=true); MGglViewAttrib(const MGBox& box, const MGColor* gridColors=0); MGglViewAttrib(const MGOpenGLView& glview); ///~MGglViewAttrib(); ///////////////////////////////////////////////////////////////////////////////// ///Copy the informations of glview2 into this. void copy(const MGOpenGLView& glview); ///return the center of the box of this view. const MGPosition& center()const{return m_center;}; MGPosition& center(){return m_center;}; ///Compute the viewing environment the parameter box. ///compute_viewing_environment() uses (eye_position,view_up_vector) as input. ///They must be set before compute_viewing_environment. ///eye_position is used only to get the direction from the origin. void compute_viewing_environment( const MGPosition& center, double diameter ); ///Compute the viewing environment the parameter box. ///compute_viewing_environment() uses (eye_position,view_up_vector) as input. ///They must be set before compute_viewing_environment. void compute_viewing_environment( const MGBox& box///