From 0d8fb8f8d920aea9cbb565fe225ad0904c822817 Mon Sep 17 00:00:00 2001
From: Marco Biasini <marco.biasini@unibas.ch>
Date: Thu, 24 Mar 2011 17:29:18 +0100
Subject: [PATCH] global variables are *EVIL*

---
 modules/mol/alg/src/construct_cbeta.cc |  9 +++++----
 modules/mol/alg/src/construct_cbeta.hh | 12 ++++++------
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/modules/mol/alg/src/construct_cbeta.cc b/modules/mol/alg/src/construct_cbeta.cc
index c7466ef1e..f4c04f1d5 100644
--- a/modules/mol/alg/src/construct_cbeta.cc
+++ b/modules/mol/alg/src/construct_cbeta.cc
@@ -12,14 +12,16 @@ namespace detail {
 
 class CBetaInserter:public EntityVisitor {
 public:
-  CBetaInserter(mol::EntityHandle ent);
+  CBetaInserter(mol::EntityHandle ent, bool include_gly);
 
   virtual bool VisitResidue(const mol::ResidueHandle& res);
 private:
   XCSEditor edi_;
+  bool      include_gly_;
 };
-CBetaInserter::CBetaInserter(mol::EntityHandle ent) {
+CBetaInserter::CBetaInserter(mol::EntityHandle ent, bool include_gly) {
   edi_=ent.EditXCS(BUFFERED_EDIT);
+  include_gly_=include_gly;
 }
 
 bool CBetaInserter::VisitResidue(const mol::ResidueHandle& res)
@@ -53,8 +55,7 @@ bool CBetaInserter::VisitResidue(const mol::ResidueHandle& res)
 // ensure that C-betas are added to the view as well
 void ConstructCBetas(mol::EntityHandle& entity_handle, bool include_gly)
 {
-  include_gly_=include_gly;
-  detail::CBetaInserter cbi(entity_handle);
+  detail::CBetaInserter cbi(entity_handle, include_gly);
   entity_handle.Apply(cbi);
 }
 
diff --git a/modules/mol/alg/src/construct_cbeta.hh b/modules/mol/alg/src/construct_cbeta.hh
index ad59bf8d5..994dfd7a0 100644
--- a/modules/mol/alg/src/construct_cbeta.hh
+++ b/modules/mol/alg/src/construct_cbeta.hh
@@ -26,16 +26,16 @@ namespace ost { namespace mol { namespace alg {
 
 
 geom::Vec3 DLLEXPORT_OST_MOL_ALG CBetaPosition(const ResidueHandle& residue, 
-                                     Real bond_length=1.5);
+                                               Real bond_length=1.5);
 
 geom::Vec3 DLLEXPORT_OST_MOL_ALG CBetaPosition(const geom::Vec3& n_pos, 
-                                     const geom::Vec3& ca_pos, 
-                                     const geom::Vec3& c_pos, 
-                                     Real bond_length=1.5);
+                                               const geom::Vec3& ca_pos, 
+                                               const geom::Vec3& c_pos, 
+                                               Real bond_length=1.5);
 
-void DLLEXPORT_OST_MOL_ALG ConstructCBetas(EntityHandle& entity_handle, bool include_gly=false);
+void DLLEXPORT_OST_MOL_ALG ConstructCBetas(EntityHandle& entity_handle, 
+                                           bool include_gly=false);
 
-bool include_gly_;
 
 }}} // ns
 
-- 
GitLab