BALL
1.4.1
|
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 00045 AddCartoonModel(const AddCartoonModel& cartoon_model); 00046 00048 virtual ~AddCartoonModel(); 00049 00051 void setHelixRadius(float radius) 00052 { helix_radius_ = radius;} 00053 00055 float getHelixRadius() const 00056 { return helix_radius_;} 00057 00059 void setArrowWidth(float width) 00060 {arrow_width_ = width;} 00061 00063 float getArrowWidth() const 00064 { return arrow_width_;} 00065 00067 void setStrandHeight(float heigth) 00068 { strand_height_ = heigth;} 00069 00071 float getStrandHeight() const 00072 { return strand_height_;} 00073 00075 void setStrandWidth(float w) 00076 { strand_width_ = w;} 00077 00079 float getStrandWidth() const 00080 { return strand_width_;} 00081 00083 void setDNABaseRadius(float r) 00084 { DNA_base_radius_ = r;} 00085 00087 float getDNABaseRadius() const 00088 { return DNA_base_radius_;} 00089 00091 void setDNAHelixRadius(float r) 00092 { DNA_helix_radius_ = r;} 00093 00095 float getDNAHelixRadius() const 00096 { return DNA_helix_radius_;} 00097 00099 void setDNALadderRadius(float r) 00100 { DNA_ladder_radius_ = r;} 00101 00103 float getDNALadderRadius() const 00104 { return DNA_ladder_radius_;} 00105 00107 void setDrawDNAAsLadderModel(bool state) 00108 { draw_DNA_as_ladder_ = state;} 00109 00111 bool drawDNAAsLadderModel() 00112 { return draw_DNA_as_ladder_;} 00113 00115 void enableRibbons(bool state) 00116 { draw_ribbon_ = state;} 00117 00119 bool ribbonsEnabled() const 00120 {return draw_ribbon_;} 00121 00122 protected: 00123 00124 void insertTriangle_(Position v1, Position v2, Position v3, Mesh& mesh); 00125 inline void drawStrand_(const Vector3& start, 00126 Vector3& right, 00127 Vector3& hn, 00128 float arrow_width, 00129 Position& last_vertices, 00130 Mesh& mesh); 00131 00132 void calculateComplementaryBases_(const Composite& composite); 00133 00134 bool assignNucleotideAtoms_(Residue& r, Size nr_atoms, String atom_names[10], Atom* atoms[10]); 00135 00136 void drawRiboseAtoms_(const Atom* atom1, const Atom* atom2, const Vector3& v1, const Vector3& v2); 00137 00138 void calculateModelParts(Protein& protein); 00139 void assignModelType(ModelPart& part); 00140 void createModel_(Position set_pos, Position part_pos); 00141 00142 void createStrand_(Position set_pos, Position part_pos); 00143 void createHelix_(Position set_first, Position part_pos); 00144 void createTubeHelix_(Position set_first, Position part_pos); 00145 void createWatsonCrickModel_(Position set_pos, Position part_pos); 00146 void createSimpleNucleicAcid_(Position set_pos, Position part_pos); 00147 00148 void renderNucleotideOutline_(const vector<Vector3>& positions, Vector3 uv, Mesh& mesh); 00149 Mesh* createDoubleRing_(const vector<Vector3>& positions); 00150 Mesh* create6Ring_(vector<Vector3> positions); 00151 virtual void refineGuidePoints_(); 00152 00153 float helix_radius_; 00154 float helix_height_; 00155 float helix_width_; 00156 float arrow_width_; 00157 float strand_width_; 00158 float strand_height_; 00159 float DNA_helix_radius_; 00160 float DNA_ladder_radius_; 00161 float DNA_base_radius_; 00162 float ribbon_width_; 00163 float ribbon_radius_; 00164 00165 bool draw_DNA_as_ladder_; 00166 bool draw_ribbon_; 00167 00168 HashMap<const Residue*, const Residue*> complementary_bases_; 00169 }; 00170 00171 00172 } // namespace VIEW 00173 } // namespace BALL 00174 00175 #endif // BALL_VIEW_MODELS_CARTOONMODEL_H