IMP logo
IMP Reference Guide  develop.63b38c487d,2024/12/21
The Integrative Modeling Platform
IMP::display::Writer Class Referenceabstract

Base class for writing geometry to a file. More...

#include <IMP/display/Writer.h>

+ Inheritance diagram for IMP::display::Writer:

Detailed Description

Base class for writing geometry to a file.

A writer object accumulates geometry and then writes a file when the object is destroyed. You must set the name of the file being written to before writing using the IMP::display::Writer::set_file_name() method.

Definition at line 28 of file Writer.h.

Public Member Functions

 Writer (std::string name)
 Create a writer opening the file with the passed name. More...
 
virtual ~Writer ()
 Write the data and close the file. More...
 
- Public Member Functions inherited from IMP::Object
virtual void clear_caches ()
 
CheckLevel get_check_level () const
 
LogLevel get_log_level () const
 
virtual VersionInfo get_version_info () const
 Get information about the module and version of the object. More...
 
void set_check_level (CheckLevel l)
 
void set_log_level (LogLevel l)
 Set the logging level used in this object. More...
 
void set_was_used (bool tf) const
 
void show (std::ostream &out=std::cout) const
 
const std::string & get_name () const
 
void set_name (std::string name)
 
virtual std::string get_type_name () const
 

Protected Member Functions

virtual void do_close ()=0
 A hook for implementation classes to use to take actions on file close. More...
 
virtual void do_open ()=0
 A hook for implementation classes to use to take actions on file open. More...
 
virtual void do_set_frame ()
 in case you want to take action on a new frame More...
 
- Protected Member Functions inherited from IMP::display::GeometryProcessor
virtual bool handle_anything (Geometry *, Color, std::string)
 
virtual bool handle_bounding_box (BoundingBoxGeometry *, Color, std::string)
 
virtual bool handle_cylinder (CylinderGeometry *, Color, std::string)
 
virtual bool handle_ellipsoid (EllipsoidGeometry *, Color, std::string)
 
void handle_geometry (Geometry *g)
 
virtual bool handle_label (LabelGeometry *, Color, std::string)
 
virtual bool handle_point (PointGeometry *, Color, std::string)
 
virtual bool handle_polygon (PolygonGeometry *, Color, std::string)
 
virtual bool handle_segment (SegmentGeometry *, Color, std::string)
 
virtual bool handle_sphere (SphereGeometry *, Color, std::string)
 
virtual bool handle_surface_mesh (SurfaceMeshGeometry *, Color, std::string)
 
virtual bool handle_triangle (TriangleGeometry *, Color, std::string)
 
- Protected Member Functions inherited from IMP::Object
 Object (std::string name)
 Construct an object with the given name. More...
 
virtual void do_destroy ()
 

Frames

The writer has a concept of the current frame. Depending on the implementation, each frame might be stored in a separate file or they might all be in one file. If using a writer that stores frames in multiple files, you should include a %1% in the filename which will get replaced by the frame number.

void set_frame (unsigned int i)
 
int get_frame () const
 

Geometry Addition methods

These methods can be used to add geometry to the model. If you do not want the geometry objects to be destroyed upon addition, make sure you store an IMP::Pointer to them externally.

Exceptions
UsageExceptionif it doesn't know how to write that particular sort of geometry.
void add_geometry (Geometry *g)
 
void add_geometry (const Geometries &g)
 

Constructor & Destructor Documentation

IMP::display::Writer::Writer ( std::string  name)

Create a writer opening the file with the passed name.

virtual IMP::display::Writer::~Writer ( )
virtual

Write the data and close the file.

Member Function Documentation

virtual void IMP::display::Writer::do_close ( )
protectedpure virtual

A hook for implementation classes to use to take actions on file close.

Implemented in IMP::display::PymolWriter.

virtual void IMP::display::Writer::do_open ( )
protectedpure virtual

A hook for implementation classes to use to take actions on file open.

Implemented in IMP::display::PymolWriter.

virtual void IMP::display::Writer::do_set_frame ( )
protectedvirtual

in case you want to take action on a new frame

Reimplemented in IMP::display::TextWriter.

Definition at line 78 of file Writer.h.


The documentation for this class was generated from the following file: