Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members
cartoonModel.h
00001 // -*- Mode: C++; tab-width: 2; -*- 00002 // vi: set ts=2: 00003 // 00004 // $Id: cartoonModel.h,v 1.32.18.1 2007-03-25 21:26:05 oliver Exp $ 00005 // 00006 00007 #ifndef BALL_VIEW_MODELS_CARTOONMODEL_H 00008 #define BALL_VIEW_MODELS_CARTOONMODEL_H 00009 00010 #ifndef BALL_VIEW_MODELS_BACKBONEMODEL_H 00011 # include <BALL/VIEW/MODELS/backboneModel.h> 00012 #endif 00013 00014 namespace BALL 00015 { 00016 namespace VIEW 00017 { 00018 class Mesh; 00019 00028 class BALL_VIEW_EXPORT AddCartoonModel 00029 : public AddBackboneModel 00030 { 00031 public: 00032 00033 enum Types 00034 { 00035 STRAND = NUCLEIC_ACID + 1, 00036 HELIX 00037 }; 00038 00039 BALL_CREATE(AddCartoonModel) 00040 00041 00042 AddCartoonModel() 00043 throw(); 00044 00046 AddCartoonModel(const AddCartoonModel& cartoon_model) 00047 throw(); 00048 00050 virtual ~AddCartoonModel() 00051 throw(); 00052 00054 void setHelixRadius(float radius) 00055 throw() { helix_radius_ = radius;} 00056 00058 float getHelixRadius() const 00059 throw() { return helix_radius_;} 00060 00062 void setArrowWidth(float width) 00063 throw() {arrow_width_ = width;} 00064 00066 float getArrowWidth() const 00067 throw() { return arrow_width_;} 00068 00070 void setStrandHeight(float heigth) 00071 throw() { strand_height_ = heigth;} 00072 00074 float getStrandHeight() const 00075 throw() { return strand_height_;} 00076 00078 void setStrandWidth(float w) 00079 throw() { strand_width_ = w;} 00080 00082 float getStrandWidth() const 00083 throw() { return strand_width_;} 00084 00086 void setDNABaseRadius(float r) 00087 throw() { DNA_base_radius_ = r;} 00088 00090 float getDNABaseRadius() const 00091 throw() { return DNA_base_radius_;} 00092 00094 void setDNAHelixRadius(float r) 00095 throw() { DNA_helix_radius_ = r;} 00096 00098 float getDNAHelixRadius() const 00099 throw() { return DNA_helix_radius_;} 00100 00102 void setDNALadderRadius(float r) 00103 throw() { DNA_ladder_radius_ = r;} 00104 00106 float getDNALadderRadius() const 00107 throw() { return DNA_ladder_radius_;} 00108 00110 void setDrawDNAAsLadderModel(bool state) 00111 throw() { draw_DNA_as_ladder_ = state;} 00112 00114 bool drawDNAAsLadderModel() 00115 throw() { return draw_DNA_as_ladder_;} 00116 00118 void enableRibbons(bool state) 00119 throw() { draw_ribbon_ = state;} 00120 00122 bool ribbonsEnabled() const 00123 throw() {return draw_ribbon_;} 00124 00125 protected: 00126 00127 void insertTriangle_(Position v1, Position v2, Position v3, Mesh& mesh); 00128 inline void drawStrand_(const Vector3& start, 00129 Vector3& right, 00130 Vector3& hn, 00131 float arrow_width, 00132 Position& last_vertices, 00133 Mesh& mesh); 00134 00135 void calculateComplementaryBases_(const Composite& composite) throw(); 00136 00137 bool assignNucleotideAtoms_(Residue& r, Size nr_atoms, String atom_names[10], Atom* atoms[10]) 00138 throw(); 00139 00140 void drawRiboseAtoms_(const Atom* atom1, const Atom* atom2, const Vector3& v1, const Vector3& v2); 00141 00142 void calculateModelParts(Protein& protein); 00143 void assignModelType(ModelPart& part); 00144 void createModel_(Position set_pos, Position part_pos); 00145 00146 void createStrand_(Position set_pos, Position part_pos); 00147 void createHelix_(Position set_first, Position part_pos); 00148 void createTubeHelix_(Position set_first, Position part_pos); 00149 void createWatsonCrickModel_(Position set_pos, Position part_pos); 00150 void createSimpleNucleicAcid_(Position set_pos, Position part_pos); 00151 00152 void renderNucleotideOutline_(const vector<Vector3>& positions, Vector3 uv, Mesh& mesh); 00153 Mesh* createDoubleRing_(const vector<Vector3>& positions); 00154 Mesh* create6Ring_(vector<Vector3> positions); 00155 virtual void refineGuidePoints_(); 00156 00157 float helix_radius_; 00158 float helix_height_; 00159 float helix_width_; 00160 float arrow_width_; 00161 float strand_width_; 00162 float strand_height_; 00163 float DNA_helix_radius_; 00164 float DNA_ladder_radius_; 00165 float DNA_base_radius_; 00166 float ribbon_width_; 00167 float ribbon_radius_; 00168 00169 bool draw_DNA_as_ladder_; 00170 bool draw_ribbon_; 00171 00172 HashMap<const Residue*, const Residue*> complementary_bases_; 00173 }; 00174 00175 00176 } // namespace VIEW 00177 } // namespace BALL 00178 00179 #endif // BALL_VIEW_MODELS_CARTOONMODEL_H