IMP
2.0.1
The Integrative Modeling Platform
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
SaveOptimizerState.h
Go to the documentation of this file.
1
/**
2
* \file IMP/rmf/SaveOptimizerState.h
3
* \brief Handle read/write of Model data from/to files.
4
*
5
* Copyright 2007-2013 IMP Inventors. All rights reserved.
6
*
7
*/
8
9
#ifndef IMPRMF_SAVE_OPTIMIZER_STATE_H
10
#define IMPRMF_SAVE_OPTIMIZER_STATE_H
11
12
#include <IMP/rmf/rmf_config.h>
13
#include "
atom_io.h
"
14
#include "
restraint_io.h
"
15
#include "
particle_io.h
"
16
#include "
geometry_io.h
"
17
#include <
IMP/core/PeriodicOptimizerState.h
>
18
#include <
IMP/core/periodic_optimizer_state_macros.h
>
19
#include <
IMP/atom/Simulator.h
>
20
21
IMPRMF_BEGIN_NAMESPACE
22
23
/** Periodically call the save_frame() method to save the everything
24
associated with the RMF file to file.
25
*/
26
class
IMPRMFEXPORT
SaveOptimizerState
:
27
public
core::PeriodicOptimizerState
{
28
RMF::FileHandle fh_;
29
base::WeakPointer<atom::Simulator>
sim_;
30
public
:
31
SaveOptimizerState
(RMF::FileHandle fh);
32
#ifndef IMP_DOXYGEN
33
IMP_LIST_ACTION(
public
, Hierarchy, Hierarchies,
34
hierarchy, hierarchies,
Particle
*,
35
Particles,
36
{
37
rmf::add_hierarchy
(fh_,
atom::Hierarchy
(obj));
38
},{},
39
{});
40
IMP_LIST_ACTION(
public
,
Restraint
,
Restraints
,
41
restraint, restraints,
Restraint
*,
42
Restraints
,
43
{
44
rmf::add_restraints
(fh_, RestraintsTemp(1,obj));
45
},{},
46
{});
47
IMP_LIST_ACTION(
public
,
Particle
, Particles,
48
particle, particles,
Particle
*,
49
Particles,
50
{
51
rmf::add_particles
(fh_, ParticlesTemp(1,obj));
52
},{},
53
{});
54
IMP_LIST_ACTION(
public
, Geometry,
Geometries
,
55
geometry, geometries,
display::Geometry
*,
56
display::Geometries
,
57
{
58
rmf::add_geometries
(fh_, display::GeometriesTemp(1,obj));
59
},{},
60
{});
61
#endif
62
//! Use the simulator to tag frames with current time
63
/** \note This may change to a more general mechanism at some point
64
in the future.
65
*/
66
void
set_simulator(
atom::Simulator
*sim);
67
//! Write a frame with a given name
68
void
update_always
(std::string name);
69
// to prevent it from being hidden
70
void
update_always
() {
71
core::PeriodicOptimizerState::update_always
();
72
}
73
virtual
void
do_update
(
unsigned
int
call_num) IMP_OVERRIDE;
74
IMP_OBJECT_METHODS
(
SaveOptimizerState
);
75
};
76
77
78
IMPRMF_END_NAMESPACE
79
80
#endif
/* IMPRMF_SAVE_OPTIMIZER_STATE_H */