Main Page | Namespace List | Class Hierarchy | Compound List | File List | Compound Members | File Members | Related Pages

ap_frame Class Reference

A class to keep track of all the objects in a frame. More...

#include <frame.h>

List of all members.

Public Member Functions

int read (FILE *fp)
 Function to read a frame from a sphere movie file.

int write ()
 Function to write a frame to a sphere movie file.

void print ()
 Function to print a frame to stdout.

void add (sphere_s s)
 Function to add a sphere with short int coordinates to a frame.

void add (sphere_f s)
 Function to add a sphere with float coordinates to a frame.

void add (cylinder_s c)
 Function to add a cylinder with short int coordinates to a frame.

void add (cylinder_f c)
 Function to add a cylinder with float coordinates to a frame.

void add (double x[], double y[], double z[], int n, double sphere_size, double tube_size, int sphere_color, int tube_color, int max_length=100)
 Function to add a chain of spheres and cylinders to a frame.

void add (float x[], float y[], float z[], int n, double sphere_size, double tube_size, int sphere_color, int tube_color, int max_length=100)
void add (int x[], int y[], int z[], int n, int sphere_size, int tube_size, int sphere_color, int tube_color, int max_length=100)
 ap_frame ()
 Default constructor.

 ap_frame (int n)
 Constructor for a frame with n spheres.

void free ()
 Function to delete the data arrays in a frame.

 ~ap_frame ()
 Destructor for a frame.


Public Attributes

ap_array< sphere_f > * spheres
 Array of spheres with float coordinates.

ap_array< cylinder_f > * cylinders
 Array of cylinders with float coordinates.

ap_array< gl_cylinder_f > * gl_cylinders
 Array of gl_cylinders with float coordinates.

ap_array< sphere_s > * short_spheres
 Array of spheres with short coordinates.

ap_array< cylinder_s > * short_cylinders
 Array of cylinders with short coordinates.

ap_array< gl_cylinder_s > * short_gl_cylinders
 Array of gl_cylinders with short coordinates.


Detailed Description

A class to keep track of all the objects in a frame.

Author:
Ray Seyfarth
This class keeps track of the objects in a frame used by the animp program.

There is a naming conflict between the more obvious class name "frame" and other code (most likely FLTK), so the class name is ap_frame.


Constructor & Destructor Documentation

ap_frame::ap_frame  ) 
 

Default constructor.

ap_frame::ap_frame int  n  ) 
 

Constructor for a frame with n spheres.

ap_frame::~ap_frame  )  [inline]
 

Destructor for a frame.


Member Function Documentation

int ap_frame::read FILE *  fp  ) 
 

Function to read a frame from a sphere movie file.

Parameters:
fp FILE pointer for the sphere movie file
This function reads the number of spheres in the frame, allocates the spheres array and reads the spheres data.

int ap_frame::write  ) 
 

Function to write a frame to a sphere movie file.

Parameters:
fp FILE pointer for the sphere movie file
This function writes the number of spheres in the frame and writes the spheres data.

void ap_frame::print  ) 
 

Function to print a frame to stdout.

void ap_frame::add sphere_s  s  ) 
 

Function to add a sphere with short int coordinates to a frame.

Parameters:
s sphere to add to the frame
The short spheres array is reallocated if needed to add s to the array.

void ap_frame::add sphere_f  s  ) 
 

Function to add a sphere with float coordinates to a frame.

Parameters:
s sphere to add to the frame
The spheres array is reallocated if needed to add s to the array.

void ap_frame::add cylinder_s  c  ) 
 

Function to add a cylinder with short int coordinates to a frame.

Parameters:
c cylinder to add to the frame
The cylinder array is reallocated if needed to add c to the array.

void ap_frame::add cylinder_f  c  ) 
 

Function to add a cylinder with float coordinates to a frame.

Parameters:
c cylinder to add to the frame
The cylinder array is reallocated if needed to add c to the array.

void ap_frame::add double  x[],
double  y[],
double  z[],
int  n,
double  sphere_size,
double  tube_size,
int  sphere_color,
int  tube_color,
int  max_length = 100
 

Function to add a chain of spheres and cylinders to a frame.

This function will add a polymer chain to a frame. The first few parameters specify the locations of the spheres on the chain. Connecting each pair of spheres is a cylinder. Since chains in the computer simulations sometimes wrap around, it could be possible to get strange cylinders connecting adjacent spheres which are on opposite sides of the lattice. To prevent this it is sensible to use the final parameter to exclude cylinders which exceed a maximum permissible length.

Parameters:
x Array of x coordinates for the spheres
y Array of x coordinates for the spheres
z Array of x coordinates for the spheres
n Number of spheres to add
sphere_size Radius for all n spheres
tube_size Radius for all cylinders
sphere_color Color index for all n spheres
tube_color Color index for all cylinders
max_length Maximum cylinder length which will be added
The cylinders array is reallocated if needed to add to the array.

void ap_frame::add float  x[],
float  y[],
float  z[],
int  n,
double  sphere_size,
double  tube_size,
int  sphere_color,
int  tube_color,
int  max_length = 100
 

void ap_frame::add int  x[],
int  y[],
int  z[],
int  n,
int  sphere_size,
int  tube_size,
int  sphere_color,
int  tube_color,
int  max_length = 100
 

void ap_frame::free  )  [inline]
 

Function to delete the data arrays in a frame.

Only arrays which have been allocated are deleted.


Member Data Documentation

ap_array<sphere_f>* ap_frame::spheres
 

Array of spheres with float coordinates.

ap_array<cylinder_f>* ap_frame::cylinders
 

Array of cylinders with float coordinates.

ap_array<gl_cylinder_f>* ap_frame::gl_cylinders
 

Array of gl_cylinders with float coordinates.

ap_array<sphere_s>* ap_frame::short_spheres
 

Array of spheres with short coordinates.

ap_array<cylinder_s>* ap_frame::short_cylinders
 

Array of cylinders with short coordinates.

ap_array<gl_cylinder_s>* ap_frame::short_gl_cylinders
 

Array of gl_cylinders with short coordinates.


The documentation for this class was generated from the following files:
Generated on Thu Nov 27 08:17:11 2003 for Animp - Animated Particles by doxygen 1.3.2