BALL  1.4.79
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Protected Member Functions | Protected Attributes | List of all members
BALL::CCP4File Class Reference

#include <BALL/FORMAT/CCP4File.h>

Inheritance diagram for BALL::CCP4File:
BALL::File

Public Member Functions

Constructors and Destructor
 CCP4File ()
 Default constructor. More...
 
 CCP4File (const String &name, File::OpenMode open_mode=std::ios::in)
 
virtual ~CCP4File ()
 Destructor. More...
 
Assignment
virtual void clear ()
 Clear method. More...
 
Predicates
bool operator== (const CCP4File &file) const
 Equality operator. More...
 
Public methods for file handling
virtual bool open (const String &name, File::OpenMode open_mode=std::ios::in)
 
virtual bool readHeader ()
 
virtual bool readSymmetryRecords ()
 
virtual bool read (RegularData3D &map)
 
virtual bool writeHeader ()
 
virtual bool write (RegularData3D &map)
 
- Public Member Functions inherited from BALL::File
 File ()
 
 File (const String &name, OpenMode open_mode=std::ios::in)
 
virtual ~File ()
 
bool isValid () const
 
bool open (const String &name, File::OpenMode open_mode=std::ios::in)
 
bool reopen ()
 
bool reopen (File::OpenMode open_mode)
 
void close ()
 
const StringgetName () const
 
void setName (const String &name)
 
const StringgetOriginalName () const
 
Size getSize ()
 
File::OpenMode getOpenMode () const
 
Type getType (bool trace_link) const
 
bool copyTo (const String &destination_name, Size buffer_size=4096)
 
bool moveTo (const String &destination_name)
 
bool remove ()
 
bool renameTo (const String &new_path)
 
bool truncate (Size size=0)
 
std::fstream & getFileStream ()
 
TransformationManagergetTransformationManager ()
 
const TransformationManagergetTransformationManager () const
 
bool operator== (const File &file) const
 
bool operator!= (const File &file) const
 
bool isOpen () const
 
bool isClosed () const
 
bool isAccessible () const
 
bool isCanonized () const
 
bool isReadable () const
 
bool isWritable () const
 
bool isExecutable () const
 

Protected Member Functions

int readBinValueasInt_ (char *header, Position pos)
 
float readBinValueasFloat_ (char *header, Position pos)
 

Protected Attributes

bool swap_bytes_
 flag indicating that we have to swap bytes when reading header values More...
 
Distance offset_symops_
 number of bytes used for storing symmetry operations More...
 
Size col_axis_
 how do columns, rows and sections correspond to specific axes: 0=x, 1=y, 2=z More...
 
Size row_axis_
 
Size sec_axis_
 
Vector3 start_
 the start coordinates in grid coordinates, i.e. indices More...
 
Vector3 extent_
 the extent of the map More...
 
Vector3 sampling_rate_
 the sampling rates used for the map More...
 
Vector3 cell_dimension_
 dimension of the crystal unit cell in Angstrom/sample More...
 
Angle alpha_
 angles of the crystal unit cell More...
 
Angle beta_
 
Angle gamma_
 
float mean_density_
 mean density value More...
 
float deviation_sigma_
 rms deviation of whole map from mean density value More...
 
Index space_group_
 space group number More...
 
Vector3 origin_
 geometry in cartesian coordinates More...
 
Vector3 xaxis_
 
Vector3 yaxis_
 
Vector3 zaxis_
 
- Protected Attributes inherited from BALL::File
String name_
 
String original_name_
 
OpenMode open_mode_
 
bool is_open_
 
bool is_temporary_
 

Additional Inherited Members

- Public Types inherited from BALL::File
typedef std::ios::openmode OpenMode
 
enum  Transformation { TRANSFORMATION__EXEC = 1, TRANSFORMATION__FILTER = 2, TRANSFORMATION__URL = 3 }
 
enum  Type {
  TYPE__UNKNOWN = 0, TYPE__DIRECTORY = 1, TYPE__CHAR_SPECIAL_FILE = 2, TYPE__BLOCK_SPECIAL_FILE = 3,
  TYPE__REGULAR_FILE = 4, TYPE__SYMBOLIC_LINK = 5, TYPE__SOCKET = 6, TYPE__FIFO_SPECIAL_FILE = 7
}
 
- Static Public Member Functions inherited from BALL::File
static Size getSize (String name)
 
static Type getType (String name, bool trace_link)
 
static bool copy (String source_name, String destination_name, Size buffer_size=4096)
 
static bool move (const String &source_name, const String &destination_name)
 
static bool remove (String name)
 
static bool rename (String old_path, String new_path)
 
static bool truncate (String path, Size size=0)
 
static bool createTemporaryFilename (String &temporary, const String &suffix=".TMP")
 
static void enableTransformation (Transformation transformation)
 
static void disableTransformation (Transformation transformation)
 
static bool isTransformationEnabled (Transformation transformation)
 
static void registerTransformation (const String &pattern, const String &exec)
 
static void unregisterTransformation (const String &pattern)
 
static bool isAccessible (String name)
 
static bool isReadable (String name)
 
static bool isWritable (String name)
 
static bool isExecutable (String name)
 
- Static Public Attributes inherited from BALL::File
static const OpenMode MODE_IN
 Open for input (default) More...
 
static const OpenMode MODE_OUT
 Open for output. More...
 
static const OpenMode MODE_APP
 Append. Seek to end before each write operation. More...
 
static const OpenMode MODE_BINARY
 Binary mode. More...
 
static const OpenMode MODE_ATE
 Seek to end directly after opening. More...
 
static const OpenMode MODE_TRUNC
 Truncate an existing file. More...
 
static const String TRANSFORMATION_EXEC_PREFIX
 Prefix for filenames that are created through the execution of commands "exec:". More...
 
static const String TRANSFORMATION_FILE_PREFIX
 Prefix for files (to mimick URL-like behavior) "file:". More...
 
static const String TRANSFORMATION_FTP_PREFIX
 Prefix for FTP-transfers "ftp://". More...
 
static const String TRANSFORMATION_HTTP_PREFIX
 Prefix for HTTP-transfer "http://". More...
 
- Static Protected Attributes inherited from BALL::File
static HashSet< Stringcreated_temp_filenames_
 
static TransformationManager transformation_manager_
 
static Size transformation_methods_
 

Detailed Description

CCP4 density map file format. This class enables BALL to read and write CCP4 - type binary electron density maps as used by the CCP4 project For detailed information on the file format CCP4 see: http://www.ccp4.ac.uk/html/maplib.html#introduction

Definition at line 26 of file CCP4File.h.

Constructor & Destructor Documentation

BALL::CCP4File::CCP4File ( )

Default constructor.

BALL::CCP4File::CCP4File ( const String name,
File::OpenMode  open_mode = std::ios::in 
)

Detailed constructor

Exceptions
Exception::FileNotFoundif the file could not be opened
virtual BALL::CCP4File::~CCP4File ( )
virtual

Destructor.

Member Function Documentation

virtual void BALL::CCP4File::clear ( )
virtual

Clear method.

Reimplemented from BALL::File.

virtual bool BALL::CCP4File::open ( const String name,
File::OpenMode  open_mode = std::ios::in 
)
virtual

open a CCP4File

Exceptions
Exception::FileNotFoundif the file could not be opened
bool BALL::CCP4File::operator== ( const CCP4File file) const

Equality operator.

virtual bool BALL::CCP4File::read ( RegularData3D map)
virtual

Read the file into a RegularData3D field.

float BALL::CCP4File::readBinValueasFloat_ ( char *  header,
Position  pos 
)
protected
int BALL::CCP4File::readBinValueasInt_ ( char *  header,
Position  pos 
)
protected
virtual bool BALL::CCP4File::readHeader ( )
virtual

Read the header of an existing file. Return true if the header could be read successfully, false ow.

virtual bool BALL::CCP4File::readSymmetryRecords ( )
virtual

Read the symmetry records of an existing file if present. Return true if the symmetry records could be read successfully, false ow.

virtual bool BALL::CCP4File::write ( RegularData3D map)
virtual

Write a RegularData3D to a CCP4 File Return true if the map could be written successfully, false ow.

virtual bool BALL::CCP4File::writeHeader ( )
virtual

Write a header Return true if the header could be written successfully, false ow.

Member Data Documentation

Angle BALL::CCP4File::alpha_
protected

angles of the crystal unit cell

Definition at line 136 of file CCP4File.h.

Angle BALL::CCP4File::beta_
protected

Definition at line 136 of file CCP4File.h.

Vector3 BALL::CCP4File::cell_dimension_
protected

dimension of the crystal unit cell in Angstrom/sample

Definition at line 133 of file CCP4File.h.

Size BALL::CCP4File::col_axis_
protected

how do columns, rows and sections correspond to specific axes: 0=x, 1=y, 2=z

Definition at line 119 of file CCP4File.h.

float BALL::CCP4File::deviation_sigma_
protected

rms deviation of whole map from mean density value

Definition at line 142 of file CCP4File.h.

Vector3 BALL::CCP4File::extent_
protected

the extent of the map

Definition at line 127 of file CCP4File.h.

Angle BALL::CCP4File::gamma_
protected

Definition at line 136 of file CCP4File.h.

float BALL::CCP4File::mean_density_
protected

mean density value

Definition at line 139 of file CCP4File.h.

Distance BALL::CCP4File::offset_symops_
protected

number of bytes used for storing symmetry operations

Definition at line 116 of file CCP4File.h.

Vector3 BALL::CCP4File::origin_
protected

geometry in cartesian coordinates

Definition at line 148 of file CCP4File.h.

Size BALL::CCP4File::row_axis_
protected

Definition at line 120 of file CCP4File.h.

Vector3 BALL::CCP4File::sampling_rate_
protected

the sampling rates used for the map

Definition at line 130 of file CCP4File.h.

Size BALL::CCP4File::sec_axis_
protected

Definition at line 121 of file CCP4File.h.

Index BALL::CCP4File::space_group_
protected

space group number

Definition at line 145 of file CCP4File.h.

Vector3 BALL::CCP4File::start_
protected

the start coordinates in grid coordinates, i.e. indices

Definition at line 124 of file CCP4File.h.

bool BALL::CCP4File::swap_bytes_
protected

flag indicating that we have to swap bytes when reading header values

Definition at line 113 of file CCP4File.h.

Vector3 BALL::CCP4File::xaxis_
protected

Definition at line 148 of file CCP4File.h.

Vector3 BALL::CCP4File::yaxis_
protected

Definition at line 148 of file CCP4File.h.

Vector3 BALL::CCP4File::zaxis_
protected

Definition at line 148 of file CCP4File.h.