home
about
news
download
doc
source
systems
tests
bugs
contact
IMP Reference Guide
develop.7cb8855c60,2024/10/04
The Integrative Modeling Platform
IMP Manual
Reference Guide
Tutorial Index
Modules
Classes
Examples
include
IMP
display
version 20241004.develop.7cb8855c60
PymolWriter.h
Go to the documentation of this file.
1
/**
2
* \file IMP/display/PymolWriter.h
3
* \brief Write a CGO file with the geometry.
4
*
5
* Copyright 2007-2022 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, cylinders, 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,
48
std::string name)
override
;
49
bool
handle_cylinder(
CylinderGeometry
*g,
Color
color,
50
std::string name)
override
;
51
bool
handle_point(
PointGeometry
*g,
Color
color,
52
std::string name)
override
;
53
bool
handle_segment(
SegmentGeometry
*g,
Color
color,
54
std::string name)
override
;
55
bool
handle_polygon(
PolygonGeometry
*g,
Color
color,
56
std::string name)
override
;
57
bool
handle_triangle(
TriangleGeometry
*g,
Color
color,
58
std::string name)
override
;
59
bool
handle_label(
LabelGeometry
*g,
Color
color,
60
std::string name)
override
;
61
bool
handle_surface(
SurfaceMeshGeometry
*g,
Color
color, std::string name);
62
63
void
do_set_frame
()
override
;
64
65
public
:
66
IMP_TEXT_WRITER
(
PymolWriter
);
67
};
68
69
IMPDISPLAY_END_NAMESPACE
70
71
#endif
/* IMPDISPLAY_PYMOL_WRITER_H */
IMP::display::Color
Represent an RGB color.
Definition:
Color.h:25
SingletonContainer.h
A container for Singletons.
IMP::display::SegmentGeometry
Display a segment.
Definition:
primitive_geometries.h:47
IMP::display::TextWriter::do_set_frame
virtual void do_set_frame() override
in case you want to take action on a new frame
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 triangle.
Definition:
primitive_geometries.h:56
writer_macros.h
macros for display classes
PairContainer.h
A container for Pairs.
IMP::display::SphereGeometry
Display a sphere.
Definition:
primitive_geometries.h:32
Writer.h
Base class for writing geometry to a file.
IMP::NONE
Definition:
enums.h:55
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:17
IMP::display::LabelGeometry
A text label for a ball in space.
Definition:
primitive_geometries.h:71