glcanvas2d.cpp
上传用户:yhdzpy8989
上传日期:2007-06-13
资源大小:13604k
文件大小:4k
- /*
- * ===========================================================================
- * PRODUCTION $Log: glcanvas2d.cpp,v $
- * PRODUCTION Revision 1000.1 2004/06/01 20:50:33 gouriano
- * PRODUCTION PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.5
- * PRODUCTION
- * ===========================================================================
- */
- /* $Id: glcanvas2d.cpp,v 1000.1 2004/06/01 20:50:33 gouriano Exp $
- * ===========================================================================
- *
- * PUBLIC DOMAIN NOTICE
- * National Center for Biotechnology Information
- *
- * This software/database is a "United States Government Work" under the
- * terms of the United States Copyright Act. It was written as part of
- * the author's official duties as a United States Government employee and
- * thus cannot be copyrighted. This software/database is freely available
- * to the public for use. The National Library of Medicine and the U.S.
- * Government have not placed any restriction on its use or reproduction.
- *
- * Although all reasonable efforts have been taken to ensure the accuracy
- * and reliability of the software and data, the NLM and the U.S.
- * Government do not and cannot warrant the performance or results that
- * may be obtained by using this software or data. The NLM and the U.S.
- * Government disclaim all warranties, express or implied, including
- * warranties of performance, merchantability or fitness for any particular
- * purpose.
- *
- * Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- * Authors: Mike DiCuccio
- *
- * File Description:
- * CGlCanvas2d -- provide standardized OpenGL view setup for FLTK
- */
- #include <ncbi_pch.hpp>
- #include <gui/opengl/glcanvas2d.hpp>
- BEGIN_NCBI_SCOPE
- CGlCanvas2d::CGlCanvas2d(int x, int y, int width, int height, const char* label)
- : CGlCanvas(x, y, width, height, label)
- {
- m_Camera.SetLayout(CGlCamera::eOrtho);
- m_Camera.SetNearPlane ( 0.1f);
- m_Camera.SetFarPlane (1000.0f);
- m_Camera.SetLeftPlane ( 100.0f);
- m_Camera.SetRightPlane (-100.0f);
- m_Camera.SetTopPlane ( 100.0f);
- m_Camera.SetBottomPlane(-100.0f);
- }
- CGlCanvas2d::~CGlCanvas2d(void)
- {
- }
- //
- // CGlCanvas2d::setupView(void)
- // this function is responsible for establishing the standard view
- // setup parameters, including viewport and viewing matrices
- //
- void CGlCanvas2d::x_SetupView(void)
- {
- // set up a standard viewport
- glViewport(0, 0, w(), h());
- // set our viewing matrices. we don't save the old matrices, so there is
- // no need to call ReleaseCurrent()
- m_Camera.MakeCurrent();
- // always leave in modelview matrix
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- }
- END_NCBI_SCOPE
- /*
- * ===========================================================================
- * $Log: glcanvas2d.cpp,v $
- * Revision 1000.1 2004/06/01 20:50:33 gouriano
- * PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.5
- *
- * Revision 1.5 2004/05/21 22:27:44 gorelenk
- * Added PCH ncbi_pch.hpp
- *
- * Revision 1.4 2003/09/29 15:44:40 dicuccio
- * Deprecated gui/scope.hpp. Merged gui/core/types.hpp into gui/types.hpp
- *
- * Revision 1.3 2003/07/21 19:31:34 dicuccio
- * Added NULL callback for CGlCanvas - works around interenting problem with
- * Fl_Gl_Window's default callback. Removed unused ctor.
- *
- * Revision 1.2 2003/06/03 17:42:06 dicuccio
- * Added texture support. Added classes to handle OpenGL camera setup and
- * viewport specification.
- *
- * Revision 1.1 2003/05/06 16:00:33 dicuccio
- * Initial revision
- *
- * ===========================================================================
- */