1
/*****************************************************************
2
* Unipro UGENE - Integrated Bioinformatics Suite
3
* Copyright (C) 2008 Unipro, Russia (http://ugene.unipro.ru)
6
* This source code is distributed under the terms of the
7
* GNU General Public License. See the files COPYING and LICENSE
9
*****************************************************************/
2
* UGENE - Integrated Bioinformatics Tools.
3
* Copyright (C) 2008-2011 UniPro <ugene@unipro.ru>
4
* http://ugene.unipro.ru
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.
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.
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,
11
#ifndef _GB2_BIOSTRUCT3D_WORMS_RENDERER_H_
12
#define _GB2_BIOSTRUCT3D_WORMS_RENDERER_H_
22
#ifndef _U2_BIOSTRUCT3D_WORMS_RENDERER_H_
23
#define _U2_BIOSTRUCT3D_WORMS_RENDERER_H_
14
25
#include <QtCore/QSharedDataPointer>
15
26
#include <QtCore/QVector>
16
27
#include <QtCore/QMap>
17
28
#include <QtCore/QPair>
19
#include <core_api/Vector3D.h>
30
#include <U2Core/Vector3D.h>
20
31
#include "BioStruct3DGLRender.h"
21
32
#include "GraphicUtils.h"
28
class WormsGLRenderer : public BioStruct3DGLRenderer {
31
Monomer() : alphaCarbon(NULL), carbonylOxygen(NULL) {}
32
QSharedDataPointer<AtomData> alphaCarbon;
33
QSharedDataPointer<AtomData> carbonylOxygen;
37
QMap<int,Monomer> monomerMap;
40
QMap<int, BioPolymer> bioPolymerMap;
44
CoordData(const Vector3D& v, const Color4f& c, int id) : site(v), color(c), redisueId(id) { }
50
// Alpha carbon coords
51
QMap< int, QVector<CoordData> > coordsDataMap;
39
class WormsGLRenderer : public BioStruct3DGLRenderer {
42
// BioPolymer molecule
46
Monomer() : alphaCarbon(NULL), carbonylOxygen(NULL) {}
47
QSharedDataPointer<AtomData> alphaCarbon;
48
QSharedDataPointer<AtomData> carbonylOxygen;
51
struct BioPolymerModel
53
QMap<int,Monomer> monomerMap;
59
QVector<BioPolymerModel> bpModels;
62
QMap<int, BioPolymer > bioPolymerMap;
67
typedef QVector<SharedAtom> AtomsVector;
52
70
//! These coords required to draw worms endings correctly
53
QMap<int, QPair<Vector3D, Vector3D> > fakeAtomCoords;
55
void createObjects3D();
56
void createWormCoordsData();
60
void drawSecondaryStructure();
62
QVector<Object3D* > objects;
66
WormsGLRenderer(const BioStruct3D& struc, const BioStruct3DColorScheme* s);
70
void drawBioStruct3D();
72
void updateColorScheme(const BioStruct3DColorScheme* s);
74
RENDERER_FACTORY(WormsGLRenderer)
71
Vector3D openingAtom, closingAtom;
72
// Worm building atom coords
74
// Objects representing secondary structure
75
QVector<Object3D*> objects;
79
QVector<WormModel> models;
82
QMap<int, Worm> wormMap;
86
void createObjects3D();
87
Object3D* createStrand3D( int startId, int endId, const BioPolymerModel &bpModel );
88
Object3D* createHelix3D( int startId, int endId, const BioPolymerModel &bpModel );
91
void drawSecondaryStructure();
92
const float* getAtomColor(const SharedAtom& atom);
95
WormsGLRenderer(const BioStruct3D& struc, const BioStruct3DColorScheme* s, const QList<int> &shownModels, const BioStruct3DRendererSettings *settings);
98
virtual ~WormsGLRenderer();
100
virtual void create();
101
virtual void drawBioStruct3D();
103
virtual void updateColorScheme();
104
virtual void updateShownModels();
105
virtual void updateSettings();
108
static bool isAvailableFor(const BioStruct3D &);
110
RENDERER_FACTORY(WormsGLRenderer)
80
#endif // _GB2_BIOSTRUCT3D_WORMS_RENDERER_H_
115
#endif // _U2_BIOSTRUCT3D_WORMS_RENDERER_H_