~ubuntu-branches/ubuntu/karmic/ugene/karmic

« back to all changes in this revision

Viewing changes to src/core/src/util_ov_annotated_dna/PanViewRows.h

  • Committer: Bazaar Package Importer
  • Author(s): Ivan Efremov
  • Date: 2009-01-26 19:17:51 UTC
  • Revision ID: james.westby@ubuntu.com-20090126191751-9kqqevd3yf4o098r
Tags: upstream-1.3.2+repack
ImportĀ upstreamĀ versionĀ 1.3.2+repack

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*****************************************************************
 
2
* Unipro UGENE - Integrated Bioinformatics Suite
 
3
* Copyright (C) 2008 Unipro, Russia (http://ugene.unipro.ru)
 
4
* All Rights Reserved
 
5
 
6
*     This source code is distributed under the terms of the
 
7
*     GNU General Public License. See the files COPYING and LICENSE
 
8
*     for details.
 
9
*****************************************************************/
 
10
 
 
11
#ifndef  _GB2_PAN_VIEW_ROWS_H_
 
12
#define  _GB2_PAN_VIEW_ROWS_H_
 
13
 
 
14
#include <core_api/LRegion.h>
 
15
 
 
16
#include <QtCore/QString>
 
17
#include <QtCore/QMap>
 
18
#include <QtCore/QList>
 
19
 
 
20
namespace GB2 {
 
21
 
 
22
class Annotation;
 
23
 
 
24
class PVRowData {
 
25
public:
 
26
        PVRowData(const QString& _key) : key(_key), rowNum(-1), uptodate(true){}
 
27
 
 
28
        QString key;
 
29
    int rowNum;
 
30
    QList<LRegion> ranges;
 
31
    QList<Annotation*> annotations;
 
32
    bool uptodate;
 
33
};
 
34
 
 
35
class PVRowsManager {
 
36
public:    
 
37
        PVRowsManager() {}
 
38
    ~PVRowsManager();
 
39
 
 
40
    int addAnnotation(Annotation* f, const QString& key);
 
41
    void removeAnnotation(Annotation* f);
 
42
    
 
43
        int getNumRows() const;
 
44
    int getAnnotationRow(Annotation* f);
 
45
 
 
46
    bool contains(const QString& key) const;
 
47
 
 
48
    void resort();
 
49
    void clear();
 
50
    
 
51
        const QString& getRowKey(int rowNum) const;
 
52
        int getNumAnnotationsInRow(int rowNum) const;
 
53
 
 
54
private:
 
55
    bool isUpToDate() const;
 
56
    bool addToRow(Annotation* f, PVRowData* row);
 
57
    bool fitToRow(PVRowData* row, const LRegion& region);
 
58
 
 
59
    QList<PVRowData*> rows;
 
60
    QMap<Annotation*, PVRowData*> rowByAnnotaion;
 
61
};
 
62
 
 
63
 
 
64
} // namespace
 
65
 
 
66
#endif