1 /**
2  * UGENE - Integrated Bioinformatics Tools.
3  * Copyright (C) 2008-2021 UniPro <ugene@unipro.ru>
4  * http://ugene.net
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19  * MA 02110-1301, USA.
20  */
21 
22 #ifndef _U2_DOT_PLOT_DIALOG_H_
23 #define _U2_DOT_PLOT_DIALOG_H_
24 
25 #include <ui_DotPlotDialog.h>
26 
27 #include <QDialog>
28 
29 #include <U2Algorithm/RepeatFinderSettings.h>
30 
31 namespace U2 {
32 
33 class ADVSequenceObjectContext;
34 class GObject;
35 class Document;
36 class AnnotatedDNAView;
37 class U2SequenceObject;
38 
39 class DotPlotDialog : public QDialog, public Ui_DotPlotDialog {
40     Q_OBJECT
41 public:
42     DotPlotDialog(QWidget *parent, AnnotatedDNAView *currentADV, int minLen, int identity, ADVSequenceObjectContext *seqX, ADVSequenceObjectContext *seqY, bool dir, bool inv, const QColor &dColor = QColor(), const QColor &iColor = QColor(), bool hideLoadSequences = false);
43 
44     virtual void accept();
45 
getXSeq()46     ADVSequenceObjectContext *getXSeq() const {
47         return xSeq;
48     }
getYSeq()49     ADVSequenceObjectContext *getYSeq() const {
50         return ySeq;
51     }
52 
53     int getMinLen() const;
54     int getMismatches() const;
55     RFAlgorithm getAlgo() const;
56 
57     bool isDirect() const;
58     bool isInverted() const;
59 
getDirectColor()60     const QColor &getDirectColor() const {
61         return directColor;
62     }
getInvertedColor()63     const QColor &getInvertedColor() const {
64         return invertedColor;
65     }
66 
67 protected slots:
68     void sl_minLenHeuristics();
69 
70     void sl_hundredPercent();
71 
72     void sl_directInvertedCheckBox();
73 
74     void sl_directColorButton();
75     void sl_invertedColorButton();
76 
77     void sl_directDefaultColorButton();
78     void sl_invertedDefaultColorButton();
79 
80     void sl_loadSequenceButton();
81 
82     void sl_loadTaskStateChanged(Task *t);
83 
84     void sl_documentAddedOrRemoved();
85     void sl_objectAddedOrRemoved();
86     void sl_loadedStateChanged();
87 
88     void sl_sequenceSelectorIndexChanged();
89 
90 private:
91     void reconnectAllProjectDocuments();
92     void updateSequenceSelectors();
93 
94     ADVSequenceObjectContext *xSeq, *ySeq;
95     AnnotatedDNAView *adv;
96 
97     QColor directColor, invertedColor;
98 
99     void updateColors();
100 
101     bool isObjectInADV(GObject *obj);
102     GObject *getGObjectByName(const QString &gObjectName);
103 
104     Task *openSequenceTask;
105 };
106 
107 }  // namespace U2
108 
109 #endif
110