alnvec_multi_ds.cpp
上传用户:yhdzpy8989
上传日期:2007-06-13
资源大小:13604k
文件大小:5k
- /*
- * ===========================================================================
- * PRODUCTION $Log: alnvec_multi_ds.cpp,v $
- * PRODUCTION Revision 1000.2 2004/06/01 21:07:18 gouriano
- * PRODUCTION PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.8
- * PRODUCTION
- * ===========================================================================
- */
- /* $Id: alnvec_multi_ds.cpp,v 1000.2 2004/06/01 21:07:18 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: Andrey Yazhuk
- *
- * File Description:
- *
- */
- #include <ncbi_pch.hpp>
- #include <gui/widgets/aln_multiple/alnvec_multi_ds.hpp>
- #include <objects/seqloc/Seq_loc.hpp>
- #include <objects/seqloc/Seq_interval.hpp>
- BEGIN_NCBI_SCOPE
- USING_SCOPE(ncbi::objects);
- CAlnVecMultiDataSource::CAlnVecMultiDataSource()
- {
- }
- CAlnVecMultiDataSource::~CAlnVecMultiDataSource()
- {
- x_ClearHandles();
- }
- int CAlnVecMultiDataSource::GetConsensusRow() const
- {
- return x_GetConsensusRow();
- }
- CAlnVecMultiDataSource::TNumrow CAlnVecMultiDataSource::GetNumRows (void) const
- {
- return (TNumrow) m_AlnMgr->GetNumRows();
- }
- TSeqPos CAlnVecMultiDataSource::GetAlnStart (void) const
- {
- return m_AlnMgr->GetAlnStart();
- }
- TSeqPos CAlnVecMultiDataSource::GetAlnStop (void) const
- {
- return m_AlnMgr->GetAlnStop();
- }
- bool CAlnVecMultiDataSource::IsSetAnchor (void) const
- {
- return m_AlnMgr->IsSetAnchor();
- }
- CAlnVecMultiDataSource::TNumrow CAlnVecMultiDataSource::GetAnchor (void) const
- {
- return m_AlnMgr->GetAnchor();
- }
- void CAlnVecMultiDataSource::SetAnchor (TNumrow anchor)
- {
- m_AlnMgr->SetAnchor(anchor);
- }
- void CAlnVecMultiDataSource::UnsetAnchor (void)
- {
- m_AlnMgr->UnsetAnchor();
- }
- bool CAlnVecMultiDataSource::CanGetId(TNumrow row) const
- {
- return (row >= 0 && row < m_AlnMgr->GetNumRows());
- }
- const CSeq_id& CAlnVecMultiDataSource::GetSeqId(TNumrow row) const
- {
- return m_AlnMgr->GetSeqId(row);
- }
- const CBioseq_Handle & CAlnVecMultiDataSource::GetBioseqHandle(TNumrow row) const
- {
- return m_AlnMgr->GetBioseqHandle(row);
- }
- TSignedSeqPos CAlnVecMultiDataSource::GetAlnPosFromSeqPos(TNumrow for_row, TSeqPos aln_pos,
- ESearchDirection dir,
- bool try_reverse_dir) const
- {
- return m_AlnMgr->GetAlnPosFromSeqPos(for_row, aln_pos, (CAlnVec::ESearchDirection) dir, try_reverse_dir);
- }
- TSignedSeqPos CAlnVecMultiDataSource::GetSeqPosFromAlnPos(TNumrow row, TSeqPos seq_pos,
- ESearchDirection dir,
- bool try_reverse_dir) const
- {
- return m_AlnMgr->GetSeqPosFromAlnPos(row, seq_pos, (CAlnVec::ESearchDirection) dir, try_reverse_dir);
- }
- void CAlnVecMultiDataSource::SetGapChar (TResidue gap_char)
- {
- m_AlnMgr->SetGapChar(gap_char);
- }
- const IAlignRowHandle* CAlnVecMultiDataSource::GetRowHandle(TNumrow row) const
- {
- return static_cast<const IAlignRowHandle*>(m_Handles[row]);
- }
- void CAlnVecMultiDataSource::x_ClearHandles()
- {
- NON_CONST_ITERATE(THandleVector, it, m_Handles) {
- delete *it;
- }
- m_Handles.clear();
- }
- void CAlnVecMultiDataSource::x_CreateHandles()
- {
- TNumrow row_n = m_AlnMgr->GetNumRows();
- m_Handles.resize(row_n);
- for( TNumrow r = 0; r < row_n; r++ ) {
- m_Handles[r] = new CAlnVecRowHandle(m_AlnMgr, r);
- }
- }
- END_NCBI_SCOPE
- /*
- * ===========================================================================
- * $Log: alnvec_multi_ds.cpp,v $
- * Revision 1000.2 2004/06/01 21:07:18 gouriano
- * PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.8
- *
- * Revision 1.8 2004/05/21 22:27:52 gorelenk
- * Added PCH ncbi_pch.hpp
- *
- * Revision 1.7 2004/04/06 13:37:31 dicuccio
- * Removed dead code
- *
- * Revision 1.6 2004/03/24 19:20:02 yazhuk
- * Commented traces
- *
- * Revision 1.5 2004/02/11 15:26:55 yazhuk
- * Removed constructors with arguments
- *
- * Revision 1.4 2003/12/10 19:03:46 yazhuk
- * Added const specifier to CanGetId() and GetSeqId().
- *
- * Revision 1.3 2003/12/10 17:04:59 yazhuk
- * Changed row identification from mandatory CBioseqHandle to optional CSeq_id.
- * Clean-up
- *
- * Revision 1.2 2003/12/08 15:13:47 yazhuk
- * Moved constructors from .hpp
- *
- * Revision 1.1 2003/10/29 23:29:48 yazhuk
- * Initial revision
- *
- * ===========================================================================
- */