IMP  2.1.0
The Integrative Modeling Platform
simple.cpp
1 /** \example core/simple.cpp
2 
3  Simple example of using the IMP C++ library.
4 
5  This should be equivalent to the first part of the Python example simple.py.
6 */
7 
8 #include <fstream>
9 
10 #include <IMP/kernel.h>
11 #include <IMP/algebra.h>
12 #include <IMP/core.h>
13 
14 int main()
15 {
17 
18  // Create two "untyped" kernel::Particles
21 
22  // "Decorate" the kernel::Particles with x,y,z attributes (point-like particles)
25 
26  // Use some XYZ-specific functionality (set coordinates)
27  d1.set_coordinates(IMP::algebra::Vector3D(10.0, 10.0, 10.0));
28  d2.set_coordinates(IMP::algebra::Vector3D(-10.0, -10.0, -10.0));
29  std::cout << d1 << " " << d2 << std::endl;
30 
31  return 0;
32 }
static XYZ setup_particle(kernel::Model *m, ParticleIndex pi)
Definition: XYZ.h:53
#define IMP_NEW(Typename, varname, args)
Declare a ref counted pointer to a new object.
void set_coordinates(const algebra::Vector3D &v)
set all coordinates from a vector
Definition: XYZ.h:64
A decorator for a particle with x,y,z coordinates.
Definition: XYZ.h:32
Class to handle individual model particles.
Class for storing model, its restraints, constraints, and particles.