00001 #ifndef FRAME_H 00002 #define FRAME_H 00003 #include <iostream> 00004 #include <stdio.h> 00005 #include "sphere.h" 00006 #include "cylinder.h" 00007 #include "array.cpp" 00008 00020 class ap_frame 00021 { 00022 public: 00026 ap_array<sphere_f> *spheres; 00027 00031 ap_array<cylinder_f> *cylinders; 00032 00036 ap_array<gl_cylinder_f> *gl_cylinders; 00037 00041 ap_array<sphere_s> *short_spheres; 00042 00046 ap_array<cylinder_s> *short_cylinders; 00047 00051 ap_array<gl_cylinder_s> *short_gl_cylinders; 00052 00061 int read ( FILE *fp ); 00062 00071 int write (); 00072 00076 void print(); 00077 00085 void add ( sphere_s s ); 00086 00094 void add ( sphere_f s ); 00095 00103 void add ( cylinder_s c ); 00104 00112 void add ( cylinder_f c ); 00113 00138 void add ( double x[], double y[], double z[], int n, 00139 double sphere_size, double tube_size, 00140 int sphere_color, int tube_color, 00141 int max_length=100 ); 00142 void add ( float x[], float y[], float z[], int n, 00143 double sphere_size, double tube_size, 00144 int sphere_color, int tube_color, 00145 int max_length=100 ); 00146 void add ( int x[], int y[], int z[], int n, 00147 int sphere_size, int tube_size, 00148 int sphere_color, int tube_color, 00149 int max_length=100 ); 00150 00151 00152 ap_frame(); 00153 ap_frame ( int n ); 00154 00160 void free() { 00161 if ( spheres ) delete spheres; 00162 if ( cylinders ) delete cylinders; 00163 if ( gl_cylinders ) delete gl_cylinders; 00164 if ( spheres ) delete short_spheres; 00165 if ( cylinders ) delete short_cylinders; 00166 if ( gl_cylinders ) delete short_gl_cylinders; 00167 } 00168 00172 ~ap_frame() { 00173 free(); 00174 } 00175 }; 00176 00177 #endif