IMP  2.3.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() {
16 
17  // Create two "untyped" kernel::Particles
20 
21  // "Decorate" the kernel::Particles with x,y,z attributes (point-like
22  // 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 }
Include all non-deprecated headers in IMP.kernel.
Include all non-deprecated headers in IMP.core.
Include all non-deprecated headers in IMP.algebra.
static XYZ setup_particle(kernel::Model *m, ParticleIndex pi)
Definition: XYZ.h:51
#define IMP_NEW(Typename, varname, args)
Declare a ref counted pointer to a new object.
Definition: object_macros.h:72
void set_coordinates(const algebra::Vector3D &v)
set all coordinates from a vector
Definition: XYZ.h:62
A decorator for a particle with x,y,z coordinates.
Definition: XYZ.h:30
Class to handle individual model particles.
VectorD< 3 > Vector3D
Definition: VectorD.h:395
Class for storing model, its restraints, constraints, and particles.
Definition: kernel/Model.h:73