00001
00002
00003 #ifndef CYLINDER_H
00004 #define CYLINDER_H
00005
00006 #include "coord.h"
00007
00025 class Cylinder {
00026
00027 private:
00028 Coord bottom;
00029 Coord top;
00030 double radius;
00031 double bottomCone;
00032 double topCone;
00033 public:
00034
00036 Cylinder():radius(DEFAULT_CYLINDER_RADIUS),bottomCone(0),topCone(0) {}
00037
00045 Cylinder(Coord bottom, Coord top, double radius, double topCone=0, double bottomCone=0) {
00046 this->bottom = bottom;
00047 this->top = top;
00048 this->radius = radius;
00049 this->topCone = topCone;
00050 this->bottomCone = bottomCone;
00051 }
00052
00057 void setLocations(Coord bottom, Coord top) {
00058 this->bottom = bottom;
00059 this->top = top;
00060 }
00061
00065 void setRadius(double radius) {
00066 this->radius = radius;
00067 }
00068
00073 void setCones(double topCone=0, double bottomCone=0) {
00074 this->topCone = topCone;
00075 this->bottomCone = bottomCone;
00076 }
00077
00085 void setParams(Coord top, Coord bottom, double radius, double topCone=0, double bottomCone=0) {
00086 this->bottom = bottom;
00087 this->top = top;
00088 this->radius = radius;
00089 this->topCone = topCone;
00090 this->bottomCone = bottomCone;
00091 }
00092
00097 void getLocations(Coord& top, Coord& bottom) const {
00098 bottom = this->bottom;
00099 top = this->top;
00100 }
00101
00105 void getRadius(double& radius) const {
00106 radius = this->radius;
00107 }
00108
00113 void getCones(double &topCone, double &bottomCone) const {
00114 topCone = this->topCone;
00115 bottomCone = this->bottomCone;
00116 }
00117
00125 void getParams(Coord& top, Coord& bottom, double& radius, double &topCone, double &bottomCone) const {
00126 bottom = this->bottom;
00127 top = this->top;
00128 radius = this->radius;
00129 topCone = this->topCone;
00130 bottomCone = this->bottomCone;
00131 }
00132
00133 };
00134
00135 #endif