Commit 7d64bb9c authored by Vedran Miletić's avatar Vedran Miletić

Fixed compiling on Windows with MSVC

Defined M_PI where needed, added include <iterator> and <functional>
where they are missing, replaced static variable size array allocation
with dynamic allocation, and avoided using macro names from winbase.h
(and possibly others):
- max -> fintmax
- FindAtom -> FindAtomInList
- GetAtomName -> GetName
- GetCurrentDirectory -> GetCurrentWorkingDirectory
parent 18f7474a
......@@ -15,10 +15,10 @@ public:
long GetSeed() { return randx; }
// magic numbers chosen to use 31 bits of a 32-bit long:
int abs(int x) { return x & 0x7fffffff; }
static double max() { return 2147483648.0; }
static double fintmax() { return 2147483648.0; }
int draw() { return randx = randx * 1103515245 + 12345; }
double fdraw() { return abs(draw()) / max(); }
double fdraw() { return abs(draw()) / fintmax(); }
int operator()() { return abs(draw()); }
};
......
......@@ -36,8 +36,8 @@ std::string GetBuild();
std::string GetProduct();
// GetTime - returns current time and date as an RbtString
std::string GetTime();
// GetCurrentDirectory - returns current working directory
std::string GetCurrentDirectory();
// GetCurrentWorkingDirectory - returns current working directory
std::string GetCurrentWorkingDirectory();
//
////////////////////////////////////////////////////////////////
......
......@@ -112,7 +112,7 @@ public:
void SetAtomicNo(const int nAtomicNo) { m_nAtomicNo = nAtomicNo; }
// AtomName
std::string GetAtomName() const { return m_strAtomName; }
std::string GetName() const { return m_strAtomName; }
void SetAtomName(const std::string strAtomName) {
m_strAtomName = strAtomName;
}
......@@ -545,9 +545,7 @@ class isAtomName_eq : public std::unary_function<RbtAtom *, bool> {
public:
explicit isAtomName_eq(const std::string &ss) : s(ss) {}
bool operator()(const RbtAtom *pAtom) const {
return pAtom->GetAtomName() == s;
}
bool operator()(const RbtAtom *pAtom) const { return pAtom->GetName() == s; }
};
// Is Subunit name equal to s ?
......@@ -615,7 +613,7 @@ public:
bool operator()(const RbtAtom *pAtom1, const RbtAtom *pAtom2) const {
return ((pAtom1->GetSubunitId() == pAtom2->GetSubunitId()) &&
(pAtom1->GetSubunitName() == pAtom2->GetSubunitName()) &&
(pAtom1->GetAtomName() == pAtom2->GetAtomName()));
(pAtom1->GetName() == pAtom2->GetName()));
}
};
......@@ -886,7 +884,7 @@ public:
class RbtAtomPtrCmp_AtomName {
public:
bool operator()(RbtAtom *pAtom1, RbtAtom *pAtom2) const {
return pAtom1->GetAtomName() < pAtom2->GetAtomName();
return pAtom1->GetName() < pAtom2->GetName();
}
};
......@@ -1017,9 +1015,9 @@ RbtAtomList GetAtomList(const RbtAtomList &atomList, const Predicate &pred) {
return newAtomList;
}
// Generic template version of FindAtom, passing in your own predicate
// Generic template version of FindAtomInList, passing in your own predicate
template <class Predicate>
RbtAtomListIter FindAtom(RbtAtomList &atomList, const Predicate &pred) {
RbtAtomListIter FindAtomInList(RbtAtomList &atomList, const Predicate &pred) {
return std::find_if(atomList.begin(), atomList.end(), pred);
}
......
......@@ -19,8 +19,13 @@
#include <algorithm> //for min,max
#include <cmath> //for sqrt
#include <iterator> //for back_inserter
#include <numeric> //for accumulate
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#include "RbtConfig.h"
extern std::istream &eatSeps(std::istream &is);
......
......@@ -67,7 +67,7 @@ RbtReturnType RbtGPParser::Parse1Output(RbtGPChromosomePtr chrom, int output) {
int startCell = (nFunctionsInputs + 1) * (output - nProgramInputs);
int ncomm = (*chrom)[startCell + nFunctionsInputs];
int nargs = commands[ncomm]->GetNArgs();
RbtReturnType args[nargs];
RbtReturnType *args = new RbtReturnType[nargs];
// I had this two loops as one before, but because is a
// recursive function, they MUST be separated, otherwise the command
// can get the arguments from another cell
......@@ -76,6 +76,7 @@ RbtReturnType RbtGPParser::Parse1Output(RbtGPChromosomePtr chrom, int output) {
for (int i = 0; i < nargs; i++)
commands[ncomm]->SetArg(i, args[i]);
RbtReturnType f2 = commands[ncomm]->Execute();
delete[] args;
return (commands[ncomm]->Execute());
}
......
......@@ -30,7 +30,7 @@ RbtAtomListList DT::QueryModel(RbtModelPtr spModel, const std::string &strSmart,
for (RbtAtomListConstIter at = atomList.begin(); at != atomList.end(); at++) {
// ignore all hydrogens
if (isH(*at)) {
// std::cout << "Atom: " << (*at)->GetAtomName() << "; ignored" <<
// std::cout << "Atom: " << (*at)->GetName() << "; ignored" <<
// std::endl;
continue;
}
......@@ -56,7 +56,7 @@ RbtAtomListList DT::QueryModel(RbtModelPtr spModel, const std::string &strSmart,
((*at)->GetGroupCharge() > -1.0))) {
dt_setcharge(atoms.back(), (*at)->GetFormalCharge());
}
// std::cout << "Atom: " << (*at)->GetAtomName() << "; rID = " << rID << ";
// std::cout << "Atom: " << (*at)->GetName() << "; rID = " << rID << ";
// dID = " << dID << std::endl;
}
......@@ -66,8 +66,8 @@ RbtAtomListList DT::QueryModel(RbtModelPtr spModel, const std::string &strSmart,
RbtAtomPtr at2 = (*bd)->GetAtom2Ptr();
// ignore all bonds to hydrogen
if (isH(at1) || isH(at2)) {
// std::cout << "Bond: " << at1->GetAtomName() << "-" <<
// at2->GetAtomName() <<
// std::cout << "Bond: " << at1->GetName() << "-" <<
// at2->GetName() <<
// "; ignored" << std::endl;
continue;
}
......@@ -88,7 +88,7 @@ RbtAtomListList DT::QueryModel(RbtModelPtr spModel, const std::string &strSmart,
// Use lookup to get the Daylight numbering
int dID1 = r2d[rID1];
int dID2 = r2d[rID2];
// std::cout << "Bond: " << at1->GetAtomName() << "-" << at2->GetAtomName()
// std::cout << "Bond: " << at1->GetName() << "-" << at2->GetName()
// << "; rID = " << rID1 << "-" << rID2 << "; dID = " << dID1 << "-" <<
// dID2 << std::endl; Finally create the Daylight bond Define formal bond
// order except for terminal charged acids, see above
......
......@@ -15,7 +15,10 @@
#include <iomanip>
#include <algorithm>
#ifdef _WIN32
#else
#include <unistd.h>
#endif
#include "RbtBiMolWorkSpace.h"
#include "RbtCrdFileSink.h"
......
......@@ -14,7 +14,10 @@
#include <iomanip>
#include <cerrno>
#ifdef _WIN32
#else
#include <unistd.h>
#endif
#include "RbtBiMolWorkSpace.h"
#include "RbtCrdFileSink.h"
......@@ -388,7 +391,7 @@ int main(int argc, char *argv[]) {
RbtVariant vExe(strExeName + EXEVERSION);
RbtVariant vRecep(spRecepPrmSource->GetFileName());
RbtVariant vPrm(spParamSource->GetFileName());
RbtVariant vDir(Rbt::GetCurrentDirectory());
RbtVariant vDir(Rbt::GetCurrentWorkingDirectory());
spRecepPrmSource->SetSection();
// Read docking site from file and register with workspace
......
......@@ -15,6 +15,7 @@
#include "RbtMdlFileSink.h"
#include "RbtMdlFileSource.h"
#include <algorithm> //for min,max
#include <functional>
#include <iomanip>
const std::string EXEVERSION =
......@@ -94,17 +95,17 @@ void CheckAmideBonds(RbtModelPtr spModel) {
// Find bonded O_SP2 and H (if any)
RbtAtomList bondedAtomsN = Rbt::GetBondedAtomList(spN);
RbtAtomList bondedAtomsC = Rbt::GetBondedAtomList(spC);
RbtAtomListIter oIter = Rbt::FindAtom(bondedAtomsC, bIsO_SP2);
RbtAtomListIter hIter = Rbt::FindAtom(bondedAtomsN, bIsH);
RbtAtomListIter oIter = Rbt::FindAtomInList(bondedAtomsC, bIsO_SP2);
RbtAtomListIter hIter = Rbt::FindAtomInList(bondedAtomsN, bIsH);
if ((oIter != bondedAtomsC.end()) && (hIter != bondedAtomsN.end())) {
RbtAtomPtr spH = (*hIter);
RbtAtomPtr spO = (*oIter);
double phi = Rbt::BondDihedral(spH, spN, spC, spO);
std::cout << spH->GetAtomName() << "(" << spH->GetFFType() << ") - "
<< spN->GetAtomName() << "(" << spN->GetFFType() << ") - "
<< spC->GetAtomName() << "(" << spC->GetFFType() << ") - "
<< spO->GetAtomName() << "(" << spO->GetFFType() << "): " << phi
std::cout << spH->GetName() << "(" << spH->GetFFType() << ") - "
<< spN->GetName() << "(" << spN->GetFFType() << ") - "
<< spC->GetName() << "(" << spC->GetFFType() << ") - "
<< spO->GetName() << "(" << spO->GetFFType() << "): " << phi
<< " deg" << std::endl;
double deltaPhi = 180.0 - phi;
std::cout << "Rotating bond by " << deltaPhi << " deg" << std::endl;
......@@ -112,9 +113,9 @@ void CheckAmideBonds(RbtModelPtr spModel) {
phi = Rbt::BondDihedral(spH, spN, spC, spO);
std::cout << "Dihedral is now " << phi << " deg" << std::endl;
} else {
std::cout << spN->GetAtomName() << "(" << spN->GetFFType() << ") - "
<< spC->GetAtomName() << "(" << spC->GetFFType()
<< "): TERTIARY" << std::endl;
std::cout << spN->GetName() << "(" << spN->GetFFType() << ") - "
<< spC->GetName() << "(" << spC->GetFFType() << "): TERTIARY"
<< std::endl;
}
}
}
......@@ -317,8 +318,8 @@ int main(int argc, char *argv[]) {
bIter != rotatableBondList.end(); bIter++) {
RbtAtomPtr spAtom1 = (*bIter)->GetAtom1Ptr();
RbtAtomPtr spAtom2 = (*bIter)->GetAtom2Ptr();
std::cout << spAtom1->GetAtomName() << "(" << spAtom1->GetFFType()
<< ") - " << spAtom2->GetAtomName() << "("
std::cout << spAtom1->GetName() << "(" << spAtom1->GetFFType()
<< ") - " << spAtom2->GetName() << "("
<< spAtom2->GetFFType() << ")" << std::endl;
}
} else {
......
......@@ -11,7 +11,10 @@
***********************************************************************/
#include <fstream>
#include <iomanip>
#ifdef _WIN32
#else
#include <unistd.h>
#endif
#include "RbtBiMolWorkSpace.h"
#include "RbtMOEGrid.h"
......
......@@ -12,6 +12,7 @@
// Calculates atomic RMSD of each SD record with record #1
#include <functional>
#include <sstream>
#include "RbtMdlFileSink.h"
......
......@@ -146,7 +146,7 @@ int main(int argc, char *argv[]) {
alli != tetherAtoms.end(); alli++) {
std::cout << "Path: ";
for (RbtAtomListIter ali = alli->begin(); ali != alli->end(); ali++) {
std::cout << (*ali)->GetAtomName() << "\t";
std::cout << (*ali)->GetName() << "\t";
}
std::cout << std::endl;
}
......@@ -193,7 +193,7 @@ int main(int argc, char *argv[]) {
RbtVariant vLib(Rbt::GetProduct() + " (" + Rbt::GetVersion() + ", Build" +
Rbt::GetBuild() + ")");
RbtVariant vExe(strExeName + EXEVERSION);
RbtVariant vDir(Rbt::GetCurrentDirectory());
RbtVariant vDir(Rbt::GetCurrentWorkingDirectory());
///////////////////////////////////
// MAIN LOOP OVER LIGAND RECORDS
///////////////////////////////////
......@@ -246,7 +246,7 @@ int main(int argc, char *argv[]) {
alli != tetherAtoms.end(); alli++) {
std::cout << "Path: ";
for (RbtAtomListIter ali = alli->begin(); ali != alli->end(); ali++) {
std::cout << (*ali)->GetAtomName() << "\t";
std::cout << (*ali)->GetName() << "\t";
}
std::cout << std::endl;
/////////////////////////////////
......
......@@ -18,7 +18,12 @@
#include <ctime> //For time functions
#include <dirent.h> //For directory handling
#include <fstream> //For ifstream
#include <unistd.h> //For POSIX getcwd
#ifdef _WIN32
#include <direct.h>
#define getcwd _getcwd //CRT library getcwd
#else
#include <unistd.h> //For POSIX getcwd
#endif
//#include <ios>
#include "Rbt.h"
#include "RbtFileError.h"
......@@ -30,7 +35,7 @@ std::string Rbt::GetRbtRoot() {
if (szRbtRoot != (char *)nullptr) {
return std::string(szRbtRoot);
} else {
return GetCurrentDirectory();
return GetCurrentWorkingDirectory();
}
}
......@@ -47,7 +52,7 @@ std::string Rbt::GetRbtHome() {
if (szRbtHome != (char *)nullptr) {
return std::string(szRbtHome);
} else {
return GetCurrentDirectory();
return GetCurrentWorkingDirectory();
}
}
}
......@@ -66,8 +71,9 @@ std::string Rbt::GetTime() {
tm *pLocalTime = std::localtime(&t); // Convert to local time struct
return std::string(std::asctime(pLocalTime)); // Convert to ascii string
}
// GetCurrentDirectory - returns current working directory
std::string Rbt::GetCurrentDirectory() {
// GetCurrentWorkingDirectory - returns current working directory
std::string Rbt::GetCurrentWorkingDirectory() {
std::string strCwd(".");
char *szCwd = new char[PATH_MAX + 1]; // Allocate a temp char* array
if (::getcwd(szCwd, PATH_MAX) != (char *)nullptr) { // Get the cwd
......@@ -306,7 +312,7 @@ std::ostream &Rbt::PrintStdHeader(std::ostream &s,
<< std::endl;
s << "RBT_ROOT:\t" << GetRbtRoot() << std::endl;
s << "RBT_HOME:\t" << GetRbtHome() << std::endl;
s << "Current dir:\t" << GetCurrentDirectory() << std::endl;
s << "Current dir:\t" << GetCurrentWorkingDirectory() << std::endl;
s << "Date:\t\t" << GetTime();
s << "***********************************************" << std::endl;
return s;
......
......@@ -13,6 +13,8 @@
#include "RbtAnnotation.h"
#include "RbtPseudoAtom.h"
#include <functional>
////////////////////////////////////////
// Constructors/destructors
RbtAnnotation::RbtAnnotation(const RbtAtom *pAtom1, const RbtAtom *pAtom2,
......
......@@ -15,6 +15,8 @@
#include "RbtModel.h"
#include "RbtPseudoAtom.h"
#include <functional>
///////////////////////////////////////////////
// Constructors / destructors
///////////////////////////////////////////////
......@@ -853,11 +855,10 @@ void Rbt::PrintQuantaCSDFormat(const RbtAtomList &atomList, std::ostream &s,
switch (nFormat) {
case 0:
s << "zone " << spAtom->GetSegmentName() << ":" << spAtom->GetSubunitId()
<< " # pick " << spAtom->GetAtomName() << " = col " << nColor
<< std::endl;
<< " # pick " << spAtom->GetName() << " = col " << nColor << std::endl;
break;
default:
s << "pick " << spAtom->GetAtomName() << " .and. segm "
s << "pick " << spAtom->GetName() << " .and. segm "
<< spAtom->GetSegmentName() << " = col " << nColor << std::endl;
}
}
......
......@@ -13,6 +13,8 @@
#include "RbtBaseMolecularFileSource.h"
#include "RbtFileError.h"
#include <functional>
// Constructors
// RbtBaseMolecularFileSource::RbtBaseMolecularFileSource(const char* fileName,
// const char* sourceName) :
......@@ -242,8 +244,8 @@ void RbtBaseMolecularFileSource::RemoveAtom(RbtAtomPtr spAtom) {
if (bIter != m_bondList.end()) {
#ifdef _DEBUG
std::cout << "Removing bond #" << (*bIter)->GetBondId() << " ("
<< (*bIter)->GetAtom1Ptr()->GetAtomName() << "-"
<< (*bIter)->GetAtom2Ptr()->GetAtomName() << ")" << std::endl;
<< (*bIter)->GetAtom1Ptr()->GetName() << "-"
<< (*bIter)->GetAtom2Ptr()->GetName() << ")" << std::endl;
#endif //_DEBUG
m_bondList.erase(bIter); // Erase the bond
}
......@@ -253,13 +255,13 @@ void RbtBaseMolecularFileSource::RemoveAtom(RbtAtomPtr spAtom) {
// Find the atom in the FileSource atom list
// DM 2 Aug 1999 - search by atom attributes, not by memory location (v
// risky) RbtAtomListIter aIter =
// Rbt::FindAtom(m_atomList,std::bind2nd(Rbt::isAtomPtr_eq(),spAtom));
// Rbt::FindAtomInList(m_atomList,std::bind2nd(Rbt::isAtomPtr_eq(),spAtom));
RbtAtomListIter aIter =
Rbt::FindAtom(m_atomList, std::bind2nd(Rbt::isAtom_eq(), spAtom));
Rbt::FindAtomInList(m_atomList, std::bind2nd(Rbt::isAtom_eq(), spAtom));
if (aIter != m_atomList.end()) {
#ifdef _DEBUG
std::cout << "Removing atom #" << (*aIter)->GetAtomId() << ", "
<< (*aIter)->GetAtomName() << std::endl;
<< (*aIter)->GetName() << std::endl;
#endif //_DEBUG
m_atomList.erase(aIter); // Erase the atom
}
......
......@@ -17,6 +17,8 @@
#include "RbtSolventFlexData.h"
#include "RbtWorkSpace.h"
#include <functional>
// Static data members
std::string RbtCavityGridSF::_CT("RbtCavityGridSF");
std::string RbtCavityGridSF::_RMAX("RMAX");
......
......@@ -14,6 +14,8 @@
#include "RbtAtomFuncs.h"
#include "RbtModel.h"
#include <functional>
std::string RbtChromDihedralRefData::_CT = "RbtChromDihedralRefData";
RbtChromDihedralRefData::RbtChromDihedralRefData(RbtBondPtr spBond,
......@@ -101,20 +103,20 @@ void RbtChromDihedralRefData::Setup(RbtBondPtr spBond,
// std::cout << "Inverted: " <<
// Rbt::GetNumSelectedAtoms(m_pModel->m_atomList) << " atoms now selected"
// << std::endl; std::cout << "Dihedral spec: " <<
// bondedAtoms3.front()->GetAtomName() << "\t" << pAtom3->GetAtomName() <<
// bondedAtoms3.front()->GetName() << "\t" << pAtom3->GetName() <<
// "\t"
// << pAtom2->GetAtomName() << "\t" <<
// bondedAtoms2.front()->GetAtomName() << std::endl;
// << pAtom2->GetName() << "\t" <<
// bondedAtoms2.front()->GetName() << std::endl;
} else {
m_atom1 = bondedAtoms2.front();
m_atom2 = pAtom2;
m_atom3 = pAtom3;
m_atom4 = bondedAtoms3.front();
// std::cout << "Dihedral spec: " << bondedAtoms2.front()->GetAtomName() <<
// std::cout << "Dihedral spec: " << bondedAtoms2.front()->GetName() <<
// "\t"
// << pAtom2->GetAtomName() << "\t"
// << pAtom3->GetAtomName() << "\t" <<
// bondedAtoms3.front()->GetAtomName() << std::endl;
// << pAtom2->GetName() << "\t"
// << pAtom3->GetName() << "\t" <<
// bondedAtoms3.front()->GetName() << std::endl;
}
// Store the smaller atom list (or free atom list in tethered mode) for this
......
......@@ -12,6 +12,7 @@
#include "RbtConstraint.h"
#include "RbtLigandError.h"
#include <functional>
#include <sstream>
// initialization of the static data of RbtConstraint
......
......@@ -13,6 +13,7 @@
#include "RbtContext.h"
#include "RbtDebug.h"
#include <cstring>
#include <functional>
std::string RbtContext::_CT("RbtContext");
// std::string RbtStringContext::_CT("RbtStringContext");
......
......@@ -117,7 +117,7 @@ void RbtCrdFileSink::Render() {
<< std::setw(0) << " ";
ostr.setf(std::ios_base::left, std::ios_base::adjustfield);
ostr << std::setw(4) << spAtom->GetSubunitName().c_str() << std::setw(0)
<< " " << std::setw(4) << spAtom->GetAtomName().c_str();
<< " " << std::setw(4) << spAtom->GetName().c_str();
ostr.setf(std::ios_base::right, std::ios_base::adjustfield);
ostr << std::setw(10) << spAtom->GetX() << std::setw(10) << spAtom->GetY()
<< std::setw(10) << spAtom->GetZ() << std::setw(0) << " ";
......
......@@ -12,6 +12,8 @@
#include "RbtDihedralSF.h"
#include <functional>
RbtDihedral::RbtDihedral(RbtAtom *pAtom1, RbtAtom *pAtom2, RbtAtom *pAtom3,
RbtAtom *pAtom4, const prms &dihprms)
: m_pAtom1(pAtom1), m_pAtom2(pAtom2), m_pAtom3(pAtom3), m_pAtom4(pAtom4) {
......@@ -32,10 +34,10 @@ double RbtDihedral::operator()() const {
score +=
m_prms[i].k *
(1.0 + m_prms[i].sign * std::cos(m_prms[i].s * dih1 * M_PI / 180.0));
// std::cout << m_pAtom1->GetAtomName() << "," << m_pAtom2->GetAtomName() <<
// std::cout << m_pAtom1->GetName() << "," << m_pAtom2->GetName() <<
// ","
// << m_pAtom3->GetAtomName() << ","
// << m_pAtom4->GetAtomName() << "\t" << m_prms[i].sign << "\t" <<
// << m_pAtom3->GetName() << ","
// << m_pAtom4->GetName() << "\t" << m_prms[i].sign << "\t" <<
// m_prms[i].s << "\t" << m_prms[i].k << "\t"
// << dih << "\t" << dih1 << "\t" << score << std::endl;
}
......@@ -104,9 +106,8 @@ RbtDihedralList RbtDihedralSF::CreateDihedralList(const RbtBondList &bondList) {
dihprms.offset = offset2[i1];
if (iTrace > 1) {
std::cout << _CT << ": <H" << i1 + 1 << ">-"
<< pAtom2->GetAtomName() << "-"
<< pAtom3->GetAtomName() << "-"
<< pAtom4->GetAtomName()
<< pAtom2->GetName() << "-" << pAtom3->GetName()
<< "-" << pAtom4->GetName()
<< "\toffset = " << dihprms.offset << std::endl;
}
pDih->AddTerm(dihprms);
......@@ -127,8 +128,8 @@ RbtDihedralList RbtDihedralSF::CreateDihedralList(const RbtBondList &bondList) {
dihprms.offset += 360.0;
if (iTrace > 1) {
std::cout << _CT << ": <H" << i1 + 1 << ">-"
<< pAtom2->GetAtomName() << "-"
<< pAtom3->GetAtomName() << "-<H" << i4 + 1
<< pAtom2->GetName() << "-" << pAtom3->GetName()
<< "-<H" << i4 + 1
<< ">\toffset = " << dihprms.offset << std::endl;
}
pDih->AddTerm(dihprms);
......@@ -146,10 +147,9 @@ RbtDihedralList RbtDihedralSF::CreateDihedralList(const RbtBondList &bondList) {
// bond so sign is inverted
dihprms.offset = offset3[i4];
if (iTrace > 1) {
std::cout << _CT << ": " << pAtom1->GetAtomName() << "-"
<< pAtom2->GetAtomName() << "-"
<< pAtom3->GetAtomName() << "-"
<< pAtom4->GetAtomName()
std::cout << _CT << ": " << pAtom1->GetName() << "-"
<< pAtom2->GetName() << "-" << pAtom3->GetName()
<< "-" << pAtom4->GetName()
<< "\toffset = " << dihprms.offset << std::endl;
}
pDih->AddTerm(dihprms);
......@@ -281,9 +281,8 @@ void RbtDihedralSF::CalcBondedAtoms(RbtAtom *pAtom1, RbtAtom *pAtom2,
if (nH == 0)
return;
if (GetTrace() > 2) {
std::cout << _CT << ": determining impl H offsets for "
<< pAtom1->GetAtomName() << " - " << pAtom2->GetAtomName()
<< std::endl;
std::cout << _CT << ": determining impl H offsets for " << pAtom1->GetName()
<< " - " << pAtom2->GetName() << std::endl;
}
RbtAtom::eHybridState hybrid = pAtom1->GetHybridState();
if (hybrid == RbtAtom::SP3) {
......@@ -295,7 +294,7 @@ void RbtDihedralSF::CalcBondedAtoms(RbtAtom *pAtom1, RbtAtom *pAtom2,
Rbt::BondDihedral(bondedAtoms[0], pAtom1, pAtom2, bondedAtoms[1]);
double offset = -improper;
if (GetTrace() > 2) {
std::cout << _CT << ": offset for SP3 atom " << pAtom1->GetAtomName()
std::cout << _CT << ": offset for SP3 atom " << pAtom1->GetName()
<< " = " << offset << std::endl;
}
offsets.push_back(offset);
......@@ -303,7 +302,7 @@ void RbtDihedralSF::CalcBondedAtoms(RbtAtom *pAtom1, RbtAtom *pAtom2,
// SP3: 1 heavy atom plus 2 implicit H, return both offsets of +/- 120 deg
else if ((nH == 2) && (bondedAtoms.size() == 1)) {
if (GetTrace() > 2) {
std::cout << _CT << ": offsets for SP3 atom " << pAtom1->GetAtomName()
std::cout << _CT << ": offsets for SP3 atom " << pAtom1->GetName()
<< " = -120,+120" << std::endl;
}
offsets.push_back(-120.0);
......@@ -317,7 +316,7 @@ void RbtDihedralSF::CalcBondedAtoms(RbtAtom *pAtom1, RbtAtom *pAtom2,
// hydrogen Offset is always 180 deg.
if ((nH == 1) && (bondedAtoms.size() == 1)) {
if (GetTrace() > 2) {
std::cout << _CT << ": offset for SP2 atom " << pAtom1->GetAtomName()
std::cout << _CT << ": offset for SP2 atom " << pAtom1->GetName()
<< " = 180" << std::endl;
}
offsets.push_back(-180.0);
......
......@@ -15,6 +15,8 @@
#include "RbtMdlFileSource.h"
#include "RbtWorkSpace.h"
#include <functional>
// Static data member for class type
std::string RbtLigandSiteMapper::_CT("RbtLigandSiteMapper");
std::string RbtLigandSiteMapper::_REF_MOL("REF_MOL");
......
......@@ -12,6 +12,7 @@
// XB cctype for check atom in MOL2 is number
//#include <cctype>
#include <functional>
#include <sstream>
#include "RbtAtomFuncs.h"
......@@ -510,7 +511,7 @@ void RbtMOL2FileSource::FixHybridState() {
case 8: // O
case 16: // S
bondedAtomList = Rbt::GetBondedAtomList(*iter);
if (Rbt::FindAtom(bondedAtomList, Rbt::isPiAtom()) !=
if (Rbt::FindAtomInList(bondedAtomList, Rbt::isPiAtom()) !=
bondedAtomList.end()) {
(*iter)->SetHybridState(RbtAtom::TRI);
// std::cout << "Changing " << (*iter)->GetFullAtomName() << " from SP3
......
This diff is collapsed.
......@@ -18,6 +18,7 @@
#include "RbtFlexData.h"
#include "RbtModelError.h"
#include "RbtQuat.h"
#include <functional>
#include <iomanip>
RbtModel::RbtModel(RbtBaseMolecularFileSource *pMolSource)
......
......@@ -14,6 +14,8 @@
#include "RbtAtomFuncs.h"
#include "RbtModel.h"
#include <functional>
#ifdef _DEBUG
namespace Tmp {
void PrintAtomList(RbtAtomRListConstIter i1, RbtAtomRListConstIter i2) {
......@@ -115,21 +117,21 @@ void RbtModelMutator::Setup() {
// std::cout << "Inverted: " <<
// Rbt::GetNumSelectedAtoms(m_pModel->m_atomList)
// << " atoms now selected" << std::endl; std::cout << "Dihedral spec: "
// << bondedAtoms3.front()->GetAtomName() << "\t" << pAtom3->GetAtomName()
// << bondedAtoms3.front()->GetName() << "\t" << pAtom3->GetName()
// <<
// "\t"
// << pAtom2->GetAtomName() << "\t" <<
// bondedAtoms2.front()->GetAtomName() << std::endl;
// << pAtom2->GetName() << "\t" <<
// bondedAtoms2.front()->GetName() << std::endl;
} else {
m_dih1Atoms.push_back(bondedAtoms2.front());
m_dih2Atoms.push_back(pAtom2);
m_dih3Atoms.push_back(pAtom3);
m_dih4Atoms.push_back(bondedAtoms3.front());
// std::cout << "Dihedral spec: " << bondedAtoms2.front()->GetAtomName()
// std::cout << "Dihedral spec: " << bondedAtoms2.front()->GetName()
// <<
// "\t" << pAtom2->GetAtomName() << "\t"
// << pAtom3->GetAtomName() << "\t" <<
// bondedAtoms3.front()->GetAtomName() << std::endl;
// "\t" << pAtom2->GetName() << "\t"
// << pAtom3->GetName() << "\t" <<
// bondedAtoms3.front()->GetName() << std::endl;
}
// Store the smaller atom list (or free atom list in tethered mode) for this
......
......@@ -14,6 +14,8 @@
#include "RbtNmrRestraintFileSource.h"
#include "RbtWorkSpace.h"
#include <functional>
// Static data members
std::string RbtNmrSF::_CT("RbtNmrSF");
std::string RbtNmrSF::_FILENAME("FILENAME");
......
......@@ -14,6 +14,8 @@
#include "RbtFileError.h"
#include "RbtWorkSpace.h"
#include <functional>
std::string RbtPMFGridSF::_CT("RbtPMFGridSF");
std::string RbtPMFGridSF::_GRID("GRID");
std::string RbtPMFGridSF::_SMOOTHED("SMOOTHED");
......
......@@ -15,6 +15,8 @@
#include "RbtPMFDirSource.h"
#include "RbtWorkSpace.h"
#include <functional>
// the PMFs are defined only in this range in the Muegge database
const double cPMFStart = 0.2; // closest PMF distance
const double cPMFRes = 0.2; // PMF resolution
......
......@@ -14,6 +14,8 @@
#include "RbtPlane.h"
#include "RbtWorkSpace.h"
#include <functional>
// Static data members
std::string RbtPolarIdxSF::_CT("RbtPolarIdxSF");
std::string RbtPolarIdxSF::_INCR("INCR");
......
......@@ -14,6 +14,8 @@
#include "RbtPlane.h"
#include "RbtWorkSpace.h"
#include <functional>
// Static data members
std::string RbtPolarSF::_CT("RbtPolarSF");
std::string RbtPolarSF::_R12FACTOR("R12FACTOR");
......
......@@ -37,8 +37,7 @@ RbtPseudoAtom::RbtPseudoAtom(const RbtAtomList &atomList, int nAtomId,
RbtAtomPtr spAtom1(atomList.front()); // 1st atom in list
RbtAtomPtr spAtomN(atomList.back()); // Last atom in list
// Pseudo-atom name is i the format [C1..N4]
strAtomName +=
"[" + spAtom1->GetAtomName() + ".." + spAtomN->GetAtomName() + "]";
strAtomName += "[" + spAtom1->GetName() + ".." + spAtomN->GetName() + "]";
SetAtomName(strAtomName);
SetSubunitId(spAtom1->GetSubunitId());
SetSubunitName(spAtom1->GetSubunitName());
......
......@@ -87,7 +87,7 @@ void RbtPsfFileSink::Render() {
sprintf(line, "%8d %-4.4s %-4.4s %-4.4s %-4.4s %-4.4s%15.3f%10.3f%12.1f",
spAtom->GetAtomId(), spAtom->GetSegmentName().c_str(),
spAtom->GetSubunitId().c_str(), spAtom->GetSubunitName().c_str(),
spAtom->GetAtomName().c_str(), spAtom->GetFFType().c_str(),
spAtom->GetName().c_str(), spAtom->GetFFType().c_str(),
spAtom->GetPartialCharge(), spAtom->GetAtomicMass(), 0.0);
AddLine(line);
// Render the atom to a string stream