Commit 49bdfe23 authored by Marcus D. Hanwell's avatar Marcus D. Hanwell
Browse files

ENH: Removed the snprintf usage in Atom and Bond.

Change-Id: Ic9e2bd7c61aace8284e18ae9cc8d004a49727969
parent 7cb8e808
......@@ -15,6 +15,7 @@ PURPOSE. See the above copyright notice for more information.
#include "vtkMolecule.h"
#include "vtkVector.h"
#include "vtkVectorOperators.h"
#include <assert.h>
......@@ -34,13 +35,10 @@ vtkAtom::~vtkAtom()
//----------------------------------------------------------------------------
void vtkAtom::PrintSelf(ostream &os, vtkIndent indent)
{
char buffer[80];
double coord[3];
this->GetPosition(coord);
snprintf(buffer, 80, "Molecule: %p Id: %4d Ele: %3d Pos: %9.5f %9.5f %9.5f\n",
this->Molecule, this->Id, this->GetAtomicNumber(),
coord[0], coord[1], coord[2]);
os << indent << buffer;
os << indent << "Molecule: " << this->Molecule
<< " Id: " << this->Id
<< " Element: " << this->GetAtomicNumber()
<< " Position: " << this->GetPositionAsVector3f() << endl;
}
//----------------------------------------------------------------------------
......
......@@ -39,19 +39,12 @@ vtkBond::~vtkBond()
//----------------------------------------------------------------------------
void vtkBond::PrintSelf(ostream &os, vtkIndent indent)
{
char buffer[80];
double coord[3];
snprintf(buffer, 80,
"Parent: %p Id: %4d Order: %1d Len: %9.5f BeginAtomId: %d "
"EndAtomId: %d\n", this->Molecule, this->Id, this->GetBondOrder(),
this->GetBondLength(), this->BeginAtomId, this->EndAtomId);
os << indent << buffer;
os << indent << "Bonded Atoms:\n";
this->Molecule->GetAtom(this->BeginAtomId).PrintSelf
(os, indent.GetNextIndent());
this->Molecule->GetAtom(this->EndAtomId).PrintSelf
(os, indent.GetNextIndent());
os << indent << "Molecule: " << this->Molecule
<< " Id: " << this->Id
<< " Order: " << this->GetBondOrder()
<< " Length: " << this->GetBondLength()
<< " BeginAtomId: " << this->BeginAtomId
<< " EndAtomId: " << this->EndAtomId << endl;
}
//----------------------------------------------------------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment