00001 #ifndef MOVIE_H 00002 #define MOVIE_H 00003 #include <iostream> 00004 #include <stdio.h> 00005 #include "frame.h" 00006 #include "drawable.h" 00007 #include "color.h" 00008 #include "array.cpp" 00009 #include <vector> 00010 #include <string> 00011 00029 class movie 00030 { 00031 public: 00032 ap_array<ap_color> *colors; 00033 ap_frame *static_frame; 00034 int current_frame; 00035 ap_array<ap_frame> *frames; 00036 FILE *fp; 00037 int frame_count; 00038 00047 long count_offset; 00048 00049 bool colors_written; 00050 bool limits_started; 00051 double min_coords[3]; 00052 double max_coords[3]; 00053 00063 void get_limits ( double min_coords[3], double max_coords[3] ); 00064 00079 int read ( char *file ); 00080 00086 void movie::read ( ap_frame *f ); 00087 00100 void read ( char *text, void *data, int size ); 00101 00112 void read_pdb(); 00113 00120 int read_int ( char *text ); 00121 00127 void read (ap_array<sphere_s> *spheres); 00128 00134 void read (ap_array<sphere_f> *spheres); 00135 00141 void read (ap_array<cylinder_s> *cylinders); 00142 00148 void read (ap_array<cylinder_f> *cylinders); 00149 00157 void putback(); 00158 00167 int write ( char *file ); 00168 00177 int write(); 00178 00184 void movie::write ( ap_frame *f ); 00185 00192 void movie::write ( char *text, int n ); 00193 00202 void movie::write ( char *text, char *data ); 00203 00215 void write ( char *text, void *data, int size ); 00216 00220 void print(); 00221 00227 void add_static ( ap_frame *f ); 00228 00234 void add_static ( ap_frame & f ); 00235 00244 void add ( ap_frame *f ); 00245 00254 void add ( ap_frame & f ); 00255 00261 void add ( ap_color *c ); 00262 00268 void add ( ap_color c ); 00269 00285 void add_color ( string color_name, int r, int g, int b, int a ); 00286 00287 movie(); 00288 movie ( char *file ); 00289 movie ( int size ); 00290 00296 ~movie() { 00297 delete colors; 00298 delete static_frame; 00299 delete frames; 00300 } 00301 }; 00302 00303 #endif