00001
00013 #ifndef CYLINDER_H
00014 #define CYLINDER_H
00015
00016 #include <iostream>
00017 #include <stdio.h>
00018 #include <stdlib.h>
00019 #include <string.h>
00020 #include <math.h>
00021 #include "my_types.h"
00022 #include "array.cpp"
00023 #include "sphere.h"
00024
00025 #ifdef GRAPHICS
00026 #include <FL/Fl.h>
00027 #include <FL/Fl_Window.h>
00028 #include <FL/Fl_Double_Window.h>
00029 #include <FL/Fl_Gl_Window.h>
00030 #include <FL/Fl_Input.h>
00031 #include <FL/Fl_Box.h>
00032 #include <FL/Fl_Choice.h>
00033 #include <FL/fl_ask.h>
00034 #include <FL/fl_draw.h>
00035 #include <FL/fl_file_chooser.h>
00036 #include <FL/Fl_Color_Chooser.H>
00037 #include <FL/Fl_Menu_Bar.h>
00038 #include <FL/Fl_Button.h>
00039 #include <FL/Fl_Menu_Button.h>
00040 #include <FL/Fl_Counter.h>
00041 #endif
00042
00057 template <class T, class S>
00058 class cylinder
00059 {
00060 public:
00061 T x1;
00062 T y1;
00063 T z1;
00064 T x2;
00065 T y2;
00066 T z2;
00067 S size1;
00068 S size2;
00069 S size;
00070
00073 byte color;
00074
00092 cylinder<T,S> ( double x1, double y1, double z1, double size1,
00093 double x2, double y2, double z2, double size2,
00094 double size, int color );
00095
00101 cylinder<T,S> ();
00102 };
00103
00121 template <class T, class S>
00122 class gl_cylinder
00123 {
00124 public:
00125 double x;
00126 double y;
00127 double z;
00128 double height;
00129 double axis[3];
00130 double angle;
00131 double radius;
00132 int color;
00133
00140 static ap_array<gl_cylinder<T,S> > *convert(ap_array<cylinder<T,S> >*c);
00141
00148 static void convert ( ap_array<cylinder<T,S> > *c,
00149 ap_array<gl_cylinder<T,S> > *g );
00150
00154 gl_cylinder<T,S> ( cylinder<T,S> *c );
00155
00159 gl_cylinder<T,S>();
00160 };
00161
00165 template <class T, class S>
00166 ostream & operator << ( ostream & out, cylinder<T,S> & c );
00167
00171 typedef cylinder<float,float> cylinder_f;
00172
00176 typedef gl_cylinder<float,float> gl_cylinder_f;
00177
00181 typedef cylinder<short,byte> cylinder_s;
00182
00186 typedef gl_cylinder<short,byte> gl_cylinder_s;
00187 #endif