view_multialign.cpp

来自「ncbi源码」· C++ 代码 · 共 576 行 · 第 1/2 页

CPP
576
字号
        ITERATE (CAlnMultiWidget::TRangeColl, iter, range_coll) {            CRef<CSeq_loc> loc(new CSeq_loc());            loc.SetInt().SetFrom(iter->GetFrom());            loc.SetInt().SetTo  (iter->GetTo());        }        **/    }       if ( !GetSelBuffer() ) {        SetSelBuffer().AddSelection(GetDocument(),                                    m_DataSource->GetAlnMgr().GetDenseg());    }    m_ViewMenuMgr->AddActiveViews(m_Document);    m_ViewMenuMgr->AddNewViews();//   (GetSelBuffer());    m_AlgoMenuMgr->AddAlgoMenu();//   (GetSelBuffer());    m_ViewMenuMgr->AddActiveViews(m_Document);}void CAlnMultiView::OnUnMarkAll(void){    if (m_AlnWidget) {        m_AlnWidget->OnUnMarkAll();    }    SetSelBuffer().Clear();    SetSelBuffer().AddSelection(GetDocument(),                                m_DataSource->GetAlnMgr().GetDenseg());    m_ViewMenuMgr->AddActiveViews(m_Document);    m_ViewMenuMgr->AddNewViews();//   (GetSelBuffer());    m_AlgoMenuMgr->AddAlgoMenu();//   (GetSelBuffer());}void  CAlnMultiView :: SendSelChangedEvent(){ /*     CObjectFor< vector<CRef<objects::CSeq_id> > > csid;      //csid = m_pDataSource->ConvertId2SeqId(m_pMatrixPane->GetSelectedIDs());      // fire external event      FireEvent(CViewEvent::CreateEvent(CViewEvent::eSelectionChanged,                                          CViewEvent::eEventViews,                                         CViewEvent::TEventObject(&csid), this)); */}typedef vector<CConstRef<CSeq_id> > TRSeqIdVector;void  CAlnMultiView :: OnSelChangedEvent(CViewEvent::TEventObject obj){         m_bBlockEvents = true;    CObjectFor<TRSeqIdVector>* p_ids =         dynamic_cast< CObjectFor<TRSeqIdVector> *>(obj.GetPointer());    if(p_ids) {        CScope& scope = m_Document->GetScope();        /*const vector<CConstRef<CSeq_id> >& ids = p_ids->GetData();        vector<CAlnVec::TNumrow> sel_rows;        int n_ids = ids.size();        for( int i = 0; i < n_ids; i++ )    {            const CSeq_id& id = *ids[i];            //find row corresponding to id            int n_rows = m_DataSource->GetNumRows();            for( CAlnVec::TNumrow row = 0; row < n_rows; row++ )  {                const CSeq_id&  row_id = m_DataSource->GetSeqId(row);                if(CSeqUtils::Match(row_id, id, scope)) {                    sel_rows.push_back(row);                    break;                }            }        }        //select rows        m_AlnWidget->Select(sel_rows, true);  */        m_AlnWidget->SetSelectedIds(*p_ids, scope);    }    m_bBlockEvents = false;}    void    CAlnMultiView::OnNotify(IAlnMultiPaneParent::ENotification notification){    if(! m_bBlockEvents)    {        switch(notification)    {        case    IAlnMultiPaneParent::eRowSelChanged:    {            CObjectFor<TRSeqIdVector> vids;            m_AlnWidget->GetSelectedIds(vids.GetData());            // fire external event            FireEvent(CViewEvent::CreateEvent(CViewEvent::eSelectionChanged,                                      CViewEvent::eEventViews,                                     CViewEvent::TEventObject(&vids), this));         }; break;        }    }}END_NCBI_SCOPE/* * =========================================================================== * $Log: view_multialign.cpp,v $ * Revision 1000.6  2004/06/01 20:59:28  gouriano * PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.51 * * Revision 1.51  2004/05/21 22:27:49  gorelenk * Added PCH ncbi_pch.hpp * * Revision 1.50  2004/05/03 17:52:36  dicuccio * gui/utils -->gui/objutils where needed * * Revision 1.49  2004/04/16 14:44:17  dicuccio * Pass appropriate ISelection interface to dynamic menus * * Revision 1.48  2004/04/07 13:05:10  dicuccio * Changed view API - require CPluginMessage instead of CPluginArgSet * * Revision 1.47  2004/04/06 16:27:44  yazhuk * Added eCmdMoveSelectedUp command * * Revision 1.46  2004/04/02 19:44:17  dicuccio * CHanged handling of default object if no selections present * * Revision 1.45  2004/04/02 16:45:21  yazhuk * Implemented selection broadcasting * * Revision 1.44  2004/03/30 17:13:08  tereshko * Added support for events broadcasting * * Revision 1.43  2004/03/25 13:19:30  dicuccio * Call CAlnVecWidget::Create() to intialize the widget * * Revision 1.42  2004/03/09 22:09:23  ucko * Add missing inclulde of <align_row.hpp> (once indirectly included?) * * Revision 1.41  2004/02/11 16:13:24  yazhuk * Removed #include "view_multialign_ds.hpp" * * Revision 1.40  2004/02/11 15:24:03  yazhuk * Replaced constructor with arguments with default constructor and Init() call; * Replaced CViewMultiAlignDS with CAlnVecMultiDataSource * * Revision 1.39  2004/01/27 18:45:01  dicuccio * Let multiple alignment viewer handle multiple input alignments * * Revision 1.38  2004/01/09 01:16:34  ucko * Remove extra semicolon after END_MENU() [breaks on WorkShop] * * Revision 1.37  2004/01/08 20:25:13  yazhuk * Migrated from FLTK-style menus to CMenuBar and CComandTraget, cleaned-up * obsolete code. Fixed bugs in consensus row creation. * * Revision 1.36  2003/12/22 19:33:16  dicuccio * Lots of changes.  Changed to match new APIs in IView.  Added better handling of messages received from other views * * Revision 1.35  2003/12/19 20:00:41  yazhuk * Added Catalog setup * * Revision 1.34  2003/11/24 15:45:43  dicuccio * Renamed CVersion to CPluginVersion * * Revision 1.33  2003/11/19 20:45:27  friedman * Added handling a visible range change event * * Revision 1.32  2003/11/04 12:51:27  friedman * Added event message pool callbacks for the document all-view message pool. * * Revision 1.31  2003/10/30 17:08:53  yazhuk * In SetDataSource replaced references with pointers * * Revision 1.30  2003/10/27 20:03:26  dicuccio * Rearranged Update() to be consistent * * Revision 1.29  2003/10/10 19:30:15  yazhuk * Added x_OnZoomAll(), x_OnSetConsensusMaster(), x_OnZoomSequnce() * * Revision 1.28  2003/10/10 17:20:27  dicuccio * Implemented OnExit() as callback for all views when closed from system icon * * Revision 1.27  2003/10/07 13:47:06  dicuccio * Renamed CPluginURL* to CPluginValue* * * Revision 1.26  2003/09/30 20:22:37  dicuccio * Exposed marking interface.  Implemented consensus creation * * Revision 1.25  2003/09/24 18:26:47  dicuccio * Large clean-ups to alignment viewers.  Reimplemented data sources and alignment * generation mechanism to be more generic. * * Revision 1.24  2003/09/12 12:55:41  dicuccio * Switched to use Andrey's new viewer. * * Revision 1.23  2003/09/04 14:54:21  dicuccio * Use IDocument instead of CDocument.  Changed APIs to match changes in IView * * Revision 1.22  2003/07/22 15:32:16  dicuccio * Changed to make use of new API in plugin_utils.hpp - GetArgValue() * * Revision 1.21  2003/06/26 15:33:41  dicuccio * Moved GetURLValue() from PluginURL.hpp to plugin_utils.hpp.  Fixed compilation * errors relating to missing #includes * * Revision 1.20  2003/06/25 17:03:00  dicuccio * Split CPluginHandle into a handle (pointer-to-implementation) and * implementation file.  Lots of #include file clean-ups. * * Revision 1.19  2003/06/23 13:23:13  dicuccio * Deprecated seq_utils.[h,c]pp - moved functions into gui.utils/utils.hpp * * Revision 1.18  2003/06/20 14:53:52  dicuccio * Revised plugin registration - moved GetInfo() into the plugin handler * * Revision 1.17  2003/06/02 16:06:22  dicuccio * Rearranged src/objects/ subtree.  This includes the following shifts: *     - src/objects/asn2asn --> arc/app/asn2asn *     - src/objects/testmedline --> src/objects/ncbimime/test *     - src/objects/objmgr --> src/objmgr *     - src/objects/util --> src/objmgr/util *     - src/objects/alnmgr --> src/objtools/alnmgr *     - src/objects/flat --> src/objtools/flat *     - src/objects/validator --> src/objtools/validator *     - src/objects/cddalignview --> src/objtools/cddalignview * In addition, libseq now includes six of the objects/seq... libs, and libmmdb * replaces the three libmmdb? libs. * * Revision 1.16  2003/05/22 18:50:04  dicuccio * Standardized construction, argument specification for all alignment views * * Revision 1.15  2003/05/19 13:43:32  dicuccio * Moved gui/core/plugin --> gui/plugin/.  Merged core libraries into libgui_core * * Revision 1.14  2003/04/24 16:40:38  dicuccio * Updated to reflect changes in plugin API.  Added new common alignment view base * class - handles notions of creating alignment manager in a standard way * * Revision 1.13  2003/03/17 14:54:14  dicuccio * Changed base class CView - added member variable for FLTK gui component for * child windows, which is now maintained via an auto_ptr<>.  Eliminated * Show()/Hide() as a pure virtual requirement. * * Revision 1.12  2003/03/03 14:54:05  dicuccio * Fixed initialization of CAlnMix to avoid creation of alternale object manager * * Revision 1.11  2003/02/20 19:49:58  dicuccio * Created new plugin architecture, based on ASN.1 spec.  Moved GBENCH frameowrk * over to use new plugin architecture. * * Revision 1.10  2003/01/13 13:10:08  dicuccio * Namespace clean-up.  Retired namespace gui -> converted all to namespace ncbi. * Moved all FLUID-generated code into namespace ncbi. * * Revision 1.9  2003/01/10 17:37:48  dicuccio * Regenerated code with fluid-1.1.2 * * Revision 1.8  2003/01/09 14:50:41  dicuccio * Use 'const CBioseq_Handle&' instead of 'CBioseq_Handle&' * * Revision 1.7  2002/12/20 19:52:21  dicuccio * Cnaged TRange::SetFrom()/TRange::SetTo() --> TRange::Set() * * Revision 1.6  2002/12/20 19:22:51  dicuccio * Lots of changes to the menus.  Standardized the menu syntax across all views. * Changed to use new dynamic menu managers. * * Revision 1.5  2002/12/13 13:18:52  dicuccio * Added work-around for inlining problems in some versions of gcc: directly * include a FLUID-generated '*_.cpp' file in the corresponding '*.cpp' and * remove this file from the build.  Thanks Aaron! * * Revision 1.4  2002/12/09 20:37:14  dicuccio * Switch to using CSeq_id::GetStringDescr() * * Revision 1.3  2002/11/29 16:08:34  dicuccio * Removed BEGIN/END_SCOPE - use USING_SCOPE instead.  FIxed some function * overload resolution issues for Windows. * * Revision 1.2  2002/11/22 18:05:07  dicuccio * Fixed memory leak - must remember to delete main window. * * Revision 1.1  2002/11/19 17:04:36  dicuccio * Initial revision. * * =========================================================================== */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?