📄 basic.c
字号:
# include "link.h"
Atom::Atom()
{
int i;
id=0; valid=0; part=1;
num_neib=num_nonh=0;
for(i=0;i<10;i++) neib[i]=0;
strcpy(name,"Un"); strcpy(type,"Un"); strcpy(xtype,"Un");
coor[0]=coor[1]=coor[2]=0.000;
root[0]=root[1]=root[2]=0.000;
r=0.000; eps=0.000; weight=0;
R=0.000; logp=0.000; strcpy(hb,"");
ring=0; score=0.000;
}
Atom::~Atom()
{
// deconstructor
}
void Atom::Show_Content() const
{
printf("Atom: ");
printf("%d ",id);
printf("%s ",name);
printf("%s ",type);
printf("%s ",xtype);
printf("%8.3f ",coor[0]);
printf("%8.3f ",coor[1]);
printf("%8.3f ",coor[2]);
printf("%4.2f ",r);
printf("%4.2f ",R);
printf("%5.2f ",logp);
printf("<%d> ",part);
printf("%2s ",hb);
printf("\n");
return;
}
Bond::Bond()
{
int i;
id=0; valid=0; part=1;
atom_1=atom_2=0;
strcpy(type,""); length=0.000;
ring=0;
num_neib=0;
for(i=0;i<10;i++) neib[i]=0;
}
Bond::~Bond()
{
// deconstructor
}
void Bond::Show_Content() const
{
printf("Bond %s between: %d - %d\n", type, atom_1, atom_2);
return;
}
Torsion::Torsion()
{
strcpy(type,"");
angle=0;
V=0.000; n=0; S=0;
e=0.000;
}
Torsion::~Torsion()
{
// deconstructor
}
void Torsion::Show_Content() const
{
printf("Torsion %s between:\n", type);
printf("\tAtom 1\t%d\t%s\t%s\n", atom_1.id, atom_1.name, atom_1.type);
printf("\tAtom 2\t%d\t%s\t%s\n", atom_2.id, atom_2.name, atom_2.type);
printf("\tAtom 3\t%d\t%s\t%s\n", atom_3.id, atom_3.name, atom_3.type);
printf("\tAtom 4\t%d\t%s\t%s\n", atom_4.id, atom_4.name, atom_4.type);
return;
}
Group::Group()
{
num_neib=0; num_nonh=0; num_h=0;
num_hetero=0; num_pi=0; num_car=0; num_nar=0;
db_type=0; valid=0;
}
Group::~Group()
{
// deconstructor
}
void Group::Show_Content() const
{
int i;
printf("Group center:\n");
center.Show_Content();
for(i=0;i<num_neib;i++)
{
printf("Neighbor %d\t", i+1);
printf("Atom %d\t%s\t%s\tvia Bond %s\n",
neib[i].id, neib[i].name, neib[i].type, bond[i].type);
}
return;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -