taxplot3d_widget4x.cpp
上传用户:yhdzpy8989
上传日期:2007-06-13
资源大小:13604k
文件大小:5k
- /*
- * ===========================================================================
- * PRODUCTION $Log: taxplot3d_widget4x.cpp,v $
- * PRODUCTION Revision 1000.1 2004/06/01 21:13:49 gouriano
- * PRODUCTION PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.5
- * PRODUCTION
- * ===========================================================================
- */
- /* $Id: taxplot3d_widget4x.cpp,v 1000.1 2004/06/01 21:13:49 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: Vladimir Tereshkov
- *
- * File Description:
- * Tiled 4 instances of taxplot widget, representing different projections.
- */
- #include <ncbi_pch.hpp>
- #include <gui/opengl/glfont.hpp>
- #include <gui/graph/igraph_utils.hpp>
- #include <gui/widgets/taxplot3d/taxplot3d_widget4x.hpp>
- #include <gui/widgets/taxplot3d/taxplot3d_widget.hpp>
- #include <gui/types.hpp>
- #include <gui/widgets/fl/splitter.hpp>
- #include <FL/Fl.H>
- #include <FL/Fl_Tile.H>
- #include <FL/Fl_Box.H>
- #include "taxplot3d_pane.hpp"
-
- BEGIN_NCBI_SCOPE
- CTaxplot3dWidget4x::CTaxplot3dWidget4x(int x, int y, int w, int h,
- const char* label)
- : Fl_Group(x, y, w, h, label)
- {
- // Fl_Tile* tile = new Fl_Tile(x, y, w, h);
- // tile->box(FL_DOWN_BOX);
- // tile->align(FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
- m_Widgets.clear();
- m_Widgets.push_back(new CTaxplot3dWidget(x, y, w/2, h/2, "XY View"));
- m_Widgets.push_back(new CTaxplot3dWidget(x+w/2, y, w/2, h/2, "YZ View"));
- m_Widgets.push_back(new CTaxplot3dWidget(x, y+h/2, w/2, h/2, "Camera View"));
- m_Widgets.push_back(new CTaxplot3dWidget(x+w/2, y+h/2, w/2, h/2, "XZ View"));
-
- Fl_Group* curr = Fl_Group::current();
- vector<int> widths(2, w /2);
- vector<int> heights(2, h /2);
- CSplitter* splitter = new CSplitter(x, y, w, h);
- splitter->Create(CSplitter::eGrid, widths, heights);
-
-
- for (vector <CTaxplot3dWidget*>::iterator it=m_Widgets.begin(); it!=m_Widgets.end(); it++){
- (*it)->box(FL_NO_BOX);
- //(*it)->align(FL_ALIGN_CLIP);
- (*it)->labeltype(FL_NO_LABEL);
- (*it)->getPanel()->SetAutomation(this);
- (*it)->SetViewMode(it - m_Widgets.begin());
- splitter->add(*it);
- }
- // Fl_Group::current()->resizable(splitter);
- curr->resizable(splitter);
- // Fl_Group::current()->resizable(tile);
- end();
- }
- CTaxplot3dWidget4x::~CTaxplot3dWidget4x()
- {
- m_Widgets.clear();
- }
- void CTaxplot3dWidget4x::SetDataSource(CTaxplot3dDataSource * ds)
- {
- for (vector <CTaxplot3dWidget*>::iterator it=m_Widgets.begin(); it!=m_Widgets.end(); it++) (*it)->SetDataSource(ds);
- }
- void CTaxplot3dWidget4x::fireEvent(Fl_Widget * pWid, ITaxplot3dCP::eEventType eType)
- {
- for (vector <CTaxplot3dWidget*>::iterator it=m_Widgets.begin(); it!=m_Widgets.end(); it++){
- if (pWid!=(*it)->getPanel()) { // do not automate yourself
- switch (eType){
- case ITaxplot3dCP::eTransform:
- // (*it)->SetTransformationFrom((CTaxplot3dWidget*)pWid);
- break;
- case ITaxplot3dCP::eSelection:
- (*it)->SlowRedraw();
- break;
- }
- }
- }
- }
- void CTaxplot3dWidget4x::resize(int x, int y, int w, int h)
- {
- Fl_Group::resize(x, y, w, h);
- }
- END_NCBI_SCOPE
- /*
- * ===========================================================================
- * $Log: taxplot3d_widget4x.cpp,v $
- * Revision 1000.1 2004/06/01 21:13:49 gouriano
- * PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.5
- *
- * Revision 1.5 2004/05/21 22:27:55 gorelenk
- * Added PCH ncbi_pch.hpp
- *
- * Revision 1.4 2004/03/11 17:54:04 dicuccio
- * Deprecated typedefs TDimension, TPosition
- *
- * Revision 1.3 2004/01/28 17:12:38 tereshko
- * Adapted for different CSplitter interface
- *
- * Revision 1.2 2004/01/28 15:55:26 tereshko
- * Fl_Tile replaced with CSplitter control
- *
- * Revision 1.1 2004/01/05 16:20:50 tereshko
- * Initial revision
- *
- * ===========================================================================
- */