BALL  1.5.0
ballAndStickModel.h
Go to the documentation of this file.
1 // -*- Mode: C++; tab-width: 2; -*-
2 // vi: set ts=2:
3 //
4 // $Id: ballAndStickModel.h,v 1.17.18.1 2007/03/25 21:26:05 oliver Exp $
5 //
6 
7 #ifndef BALL_VIEW_MODELS_BALLANDSTICKMODEL_H
8 #define BALL_VIEW_MODELS_BALLANDSTICKMODEL_H
9 
10 #ifndef BALL_VIEW_MODELS_ATOMBONDMODELBASEPROCESSOR_H
12 #endif
13 
14 #ifndef BALL_KERNEL_ATOM_H
15  #include <BALL/KERNEL/atom.h>
16 #endif
17 
18 namespace BALL
19 {
20  class Atom;
21 
22  namespace VIEW
23  {
36  {
37  public:
38 
40 
41 
44 
52 
55  AddBallAndStickModel(const AddBallAndStickModel& add_ball_and_stick_model);
56 
59  virtual ~AddBallAndStickModel();
60 
68  virtual void clear();
69 
71 
74 
78  void set(const AddBallAndStickModel& add_ball_and_stick_model);
79 
83  const AddBallAndStickModel& operator = (const AddBallAndStickModel& processor);
84 
86 
94 
99  void setBallRadius(const float radius);
100 
103  float getBallRadius() const;
104 
109  void setStickRadius(const float radius);
110 
113  float getStickRadius() const;
114 
117  void enableBallAndStickModel();
118 
121  void enableStickModel();
122 
124 
127 
144  virtual Processor::Result operator() (Composite& composite);
145 
147 
150 
154  bool isBallAndStickModel() const;
155 
159  bool isStickModel() const;
160 
162  bool dashedBondsEnabled() const
163  { return dashed_bonds_;}
164 
166  void enableDashedBonds(bool state)
167  { dashed_bonds_ = state;}
168 
170 
173 
181  virtual void dump(std::ostream& s = std::cout, Size depth = 0) const;
182 
184 
185  virtual bool createGeometricObjects();
186 
187  protected:
188 
189  void visualiseBond_(const Bond& bond);
190 
191  virtual void visualiseRings_();
192 
193  inline void renderStandardBond_(const Bond& bond);
194 
195  inline void renderMultipleBond_(const Bond& bond, Vector3 normal, Vector3 dir);
196 
198  inline void renderDashedBond_(const Bond& bond, Vector3 n);
199 
200  void collectRingBonds_();
201 
202  Vector3 getSP2Plane_(const Atom& atom, const Bond& bond, const Vector3& dir) const;
203 
204  private:
205 
206  float ball_radius_;
207  float stick_radius_;
208  float special_radius_;
209 
210  bool ball_and_stick_;
211  bool dashed_bonds_;
212 
213  vector<vector<Bond*> > ring_bonds_;
214  };
215 
216 # ifndef BALL_NO_INLINE_FUNCTIONS
217 # include <BALL/VIEW/MODELS/ballAndStickModel.iC>
218 # endif
219 
220  } // namespace VIEW
221 } // namespace BALL
222 
223 #endif // BALL_VIEW_MODELS_BALLANDSTICKMODEL_H
BALL::Bond
Definition: bond.h:54
BALL::VIEW::AtomBondModelBaseProcessor
Definition: atomBondModelBaseProcessor.h:31
BALL::Atom
Definition: atom.h:87
BALL
Definition: constants.h:12
BALL::PDB::Atom
char Atom[5]
Definition: PDBdefs.h:257
BALL::Composite
Definition: composite.h:71
BALL_SIZE_TYPE
BALL::TVector3< float >
atom.h
BALL_VIEW_EXPORT
#define BALL_VIEW_EXPORT
Definition: COMMON/global.h:52
BALL_CREATE
#define BALL_CREATE(name)
Definition: create.h:62
BALL::Processor::Result
int Result
Definition: processor.h:36
BALL::VIEW::AddBallAndStickModel::enableDashedBonds
void enableDashedBonds(bool state)
Definition: ballAndStickModel.h:166
BALL::VIEW::AddBallAndStickModel
Definition: ballAndStickModel.h:35
atomBondModelBaseProcessor.h
BALL::VIEW::AddBallAndStickModel::dashedBondsEnabled
bool dashedBondsEnabled() const
Definition: ballAndStickModel.h:162