Computer Assited Medical Intervention Tool Kit  version 3.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | Private Attributes | List of all members
Atom Class Reference

An atom has an unique index in the physical model object, a 3D position, and different basic properties. More...

#include <Atom.h>

+ Inheritance diagram for Atom:

Public Member Functions

 Atom (PhysicalModel *myPM)
 Default constructor : set the position to the origin, generate a unique index. More...
 
 Atom (PhysicalModel *myPM, xmlNodePtr n, unsigned int id=-1)
 constructor from xml node: try to read and get the parameters from xml and set the index in atom SC (if possible) More...
 
 Atom (PhysicalModel *myPM, const double pos[3])
 constructor : generate a unique index More...
 
 Atom (PhysicalModel *myPM, const unsigned int ind)
 set the position to the origin More...
 
 Atom (PhysicalModel *myPM, const unsigned int ind, const double pos[3])
 constructor : generate a unique index More...
 
unsigned int getIndexInAtoms () const
 get the index of this atom in the global atom structural component, i.e. its order number in atoms More...
 
void getPosition (double pos[3]) const
 get the position of the atom (array of 3 doubles) More...
 
AtomPropertiesgetProperties () const
 Get a ptr to the AtomProperties. More...
 
virtual bool isInstanceOf (const char *) const
 return true only if the parameter is equal to "Atom" More...
 
virtual bool setIndex (const unsigned int)
 set the index. More...
 
void setPosition (const double[3])
 set the position of the atom More...
 
void setPosition (const double, const double, const double)
 set the position of the atom More...
 
void xmlPrint (std::ostream &, const StructuralComponent *)
 print to an output stream in "pseaudo" XML format. More...
 
 ~Atom ()
 std destructor More...
 
- Public Member Functions inherited from Structure
void addStructuralComponent (StructuralComponent *)
 add a particular StructuralComponent in the list More...
 
std::vector
< StructuralComponent * > 
getAllStructuralComponents ()
 get the list of all the StructuralComponent that are using this structure More...
 
unsigned int getIndex () const
 get the structure unique index (stored in its property) More...
 
std::string getName () const
 get the name of the structure More...
 
unsigned int getNumberOfStructuralComponents () const
 get the number of StructuralComponent that are using this structure More...
 
StructuralComponentgetStructuralComponent (unsigned int i)
 get a particular StructuralComponent that is using this structure More...
 
StructureProperties::GeometricType getType () const
 get the type of index More...
 
void removeStructuralComponent (StructuralComponent *)
 remove a particular StructuralComponent from the list More...
 
void setName (std::string)
 set the name of the structure More...
 
virtual void setPhysicalModel (PhysicalModel *)
 set the physical model More...
 
 Structure ()
 Base constructor. More...
 
virtual ~Structure ()
 Virtual destructor needed here as this is an abstract class (pure virtual) More...
 

Private Attributes

unsigned int indexInAtoms
 

Additional Inherited Members

- Protected Attributes inherited from Structure
StructurePropertiesproperties
 Property of the current structure. More...
 

Detailed Description

An atom has an unique index in the physical model object, a 3D position, and different basic properties.

It is the most basic structure composing a physical model. It is on an atoms that the forces and loads could be applied in order to generate dynamics.

Constructor & Destructor Documentation

Atom::Atom ( PhysicalModel myPM)

Default constructor : set the position to the origin, generate a unique index.

Parameters
myPMthe physical model the atom belongs to
Atom::Atom ( PhysicalModel myPM,
xmlNodePtr  n,
unsigned int  id = -1 
)

constructor from xml node: try to read and get the parameters from xml and set the index in atom SC (if possible)

Parameters
myPMthe physical model the atom belongs to
nthe xml node to read to get the information
idthe index in the atoms structural component (useful to directly access the memory block corresponding to the position)
See also
getIndexInAtoms()
Atom::Atom ( PhysicalModel myPM,
const double  pos[3] 
)

constructor : generate a unique index

Parameters
myPMthe physical model the atom belongs to
posthe initial position of the created atom (array of 3 double)
Atom::Atom ( PhysicalModel myPM,
const unsigned int  ind 
)

set the position to the origin

Parameters
myPMthe physical model the atom belongs to
indgive the unique index
Atom::Atom ( PhysicalModel myPM,
const unsigned int  ind,
const double  pos[3] 
)

constructor : generate a unique index

Parameters
myPMthe physical model the atom belongs to
indgive the unique index
posthe initial position of the created atom (array of 3 double)
Atom::~Atom ( )

std destructor

Member Function Documentation

unsigned int Atom::getIndexInAtoms ( ) const

get the index of this atom in the global atom structural component, i.e. its order number in atoms

void Atom::getPosition ( double  pos[3]) const
inline

get the position of the atom (array of 3 doubles)

References BasicAtomProperties::getPosition(), and getProperties().

AtomProperties * Atom::getProperties ( ) const
inline

Get a ptr to the AtomProperties.

References Structure::properties.

Referenced by getPosition(), and setPosition().

bool Atom::isInstanceOf ( const char *  className) const
inlinevirtual

return true only if the parameter is equal to "Atom"

Implements Structure.

virtual bool Atom::setIndex ( const unsigned  int)
virtual

set the index.

The index have to be unique otherwise this method has no effect. The sub-classes method will check that this index is not in use.

Returns
true only if the index of the structure was changed

Reimplemented from Structure.

void Atom::setPosition ( const double  pos[3])
inline

set the position of the atom

References getProperties(), and BasicAtomProperties::setPosition().

void Atom::setPosition ( const double  x,
const double  y,
const double  z 
)
inline

set the position of the atom

References getProperties(), and BasicAtomProperties::setPosition().

void Atom::xmlPrint ( std::ostream &  ,
const StructuralComponent  
)
virtual

print to an output stream in "pseaudo" XML format.

Implements Structure.

Member Data Documentation

unsigned int Atom::indexInAtoms
private

The documentation for this class was generated from the following file: