IMP logo

IMP::display::Writer Class Reference


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.

Inheritance diagram for IMP::display::Writer:

Inheritance graph
[legend]

Public Member Functions

def __disown__
void close ()
 Close the stream. You shouldn't need this, but it doesn't hurt.
bool get_stream_is_open ()
 Return whether a file is open for writing.
virtual void set_file_name (std::string name)
 Open a new file with the given name.
virtual void set_output (TextOutput f)
 Writer (std::string name)
 Writer (TextOutput fn, std::string name)
 Create a writer opening the file with the passed name.
virtual ~Writer ()
 Write the data and close the file.
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:
UsageException if it doesn't know how to write that particular sort of geometry.


void add_geometry (const Geometries &g)
void add_geometry (Geometry *g)

Protected Member Functions

std::ostream & get_stream ()
 Get the stream for inhereting classes to write to.
virtual void on_close ()=0
 A hook for implementation classes to use to take actions on file close.
virtual void on_open ()=0
 A hook for implementation classes to use to take actions on file open.

Member Function Documentation

virtual void IMP::display::Writer::set_file_name ( std::string  name  )  [virtual]

Open a new file with the given name.

Set it to "" to close.


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

Generated on Mon Mar 8 23:09:00 2010 for IMP by doxygen 1.5.8