IMP
2.2.0
The Integrative Modeling Platform
IMP Mainpage
All IMP Modules
Related Pages
Modules
Namespaces
Classes
Files
Examples
Indexes
File List
File Members
PymolWriter.h
Go to the documentation of this file.
1
/**
2
* \file IMP/display/PymolWriter.h
3
* \brief Implement PymolWriter
4
*
5
* Copyright 2007-2014 IMP Inventors. All rights reserved.
6
*/
7
8
#ifndef IMPDISPLAY_PYMOL_WRITER_H
9
#define IMPDISPLAY_PYMOL_WRITER_H
10
11
#include <IMP/display/display_config.h>
12
#include "
writer_macros.h
"
13
14
#include <
IMP/PairContainer.h
>
15
#include <
IMP/SingletonContainer.h
>
16
#include <
IMP/display/Writer.h
>
17
18
IMPDISPLAY_BEGIN_NAMESPACE
19
20
//! Write a CGO file with the geometry
21
/** The cgo file format is a simple format for displaying geometry in Pymol.
22
The cgo writer supports points, spheres, cyliners, and segments.
23
The file name should end in ".pym".
24
25
The geometry is assembled into objects in pymol based on the passed
26
names. For example, all geometry named "box" becomes one pymol object.
27
If many files are loaded into python defining the same objects, they
28
become sequential frames in a movie. The frame numbers are determined
29
sequentially from the file load order (so they can form a subset of
30
the generated files).
31
32
This writer will write many frames to the same file.
33
*/
34
class
IMPDISPLAYEXPORT
PymolWriter
:
public
TextWriter
{
35
std::string lastname_;
36
int
last_frame_;
37
enum
Type {
38
NONE
= 0,
39
LINES,
40
TRIANGLES,
41
OTHER
42
};
43
Type open_type_;
44
friend
class
CGOAnimationWriter;
45
void
setup(std::string name, Type type,
bool
opendata =
true
);
46
void
cleanup(std::string name,
bool
close =
true
);
47
bool
handle_sphere(
SphereGeometry
*g,
Color
color, std::string name);
48
bool
handle_cylinder(
CylinderGeometry
*g,
Color
color, std::string name);
49
bool
handle_point(
PointGeometry
*g,
Color
color, std::string name);
50
bool
handle_segment(
SegmentGeometry
*g,
Color
color, std::string name);
51
bool
handle_polygon(
PolygonGeometry
*g,
Color
color, std::string name);
52
bool
handle_triangle(
TriangleGeometry
*g,
Color
color, std::string name);
53
bool
handle_label(
LabelGeometry
*g,
Color
color, std::string name);
54
bool
handle_surface(
SurfaceMeshGeometry
*g,
Color
color, std::string name);
55
56
void
do_set_frame
();
57
58
public
:
59
IMP_TEXT_WRITER
(
PymolWriter
);
60
};
61
62
IMPDISPLAY_END_NAMESPACE
63
64
#endif
/* IMPDISPLAY_PYMOL_WRITER_H */
IMP::base::NONE
Definition:
base/enums.h:58
IMP::display::Color
Represent an RGB color.
Definition:
Color.h:24
SingletonContainer.h
Import IMP/kernel/SingletonContainer.h in the namespace.
IMP::display::SegmentGeometry
Display a segment.
Definition:
primitive_geometries.h:47
IMP::display::SurfaceMeshGeometry
Display a surface mesh.
Definition:
primitive_geometries.h:87
IMP::display::PointGeometry
Display a point.
Definition:
primitive_geometries.h:43
IMP::display::TriangleGeometry
Display a triangule.
Definition:
primitive_geometries.h:56
writer_macros.h
macros for display classes
PairContainer.h
Import IMP/kernel/PairContainer.h in the namespace.
IMP::display::SphereGeometry
Display a sphere.
Definition:
primitive_geometries.h:32
IMP::display::TextWriter::do_set_frame
virtual void do_set_frame()
in case you want to take action on a new frame
Writer.h
Base class for writing geometry to a file.
IMP::display::TextWriter
Definition:
Writer.h:92
IMP::display::CylinderGeometry
Display a cylinder.
Definition:
primitive_geometries.h:36
IMP::display::PolygonGeometry
Definition:
primitive_geometries.h:52
IMP::display::PymolWriter
Write a CGO file with the geometry.
Definition:
PymolWriter.h:34
IMP_TEXT_WRITER
#define IMP_TEXT_WRITER(Name)
Define information for an TextWriter object.
Definition:
writer_macros.h:18
IMP::display::LabelGeometry
A text label for a ball in space.
Definition:
primitive_geometries.h:71