JWS C++ Library
C++ language utility library
|
00001 /* 00002 * This work is licensed under a Creative Commons 00003 * Attribution-Noncommercial-Share Alike 3.0 United States License. 00004 * 00005 * http://creativecommons.org/licenses/by-nc-sa/3.0/us/ 00006 * 00007 * You are free: 00008 * 00009 * to Share - to copy, distribute, display, and perform the work 00010 * to Remix - to make derivative works 00011 * 00012 * Under the following conditions: 00013 * 00014 * Attribution. You must attribute the work in the manner specified by the 00015 * author or licensor (but not in any way that suggests that they endorse you 00016 * or your use of the work). 00017 * 00018 * Noncommercial. You may not use this work for commercial purposes. 00019 * 00020 * Share Alike. If you alter, transform, or build upon this work, you may 00021 * distribute the resulting work only under the same or similar license to 00022 * this one. 00023 * 00024 * For any reuse or distribution, you must make clear to others the license 00025 * terms of this work. The best way to do this is by including this header. 00026 * 00027 * Any of the above conditions can be waived if you get permission from the 00028 * copyright holder. 00029 * 00030 * Apart from the remix rights granted under this license, nothing in this 00031 * license impairs or restricts the author's moral rights. 00032 */ 00033 00034 00046 #ifndef CUBOID_H 00047 #define CUBOID_H 00048 00049 00050 #include <jwsc++/config.h> 00051 00052 #include <inttypes.h> 00053 00054 #include <jwsc/vector/vector.h> 00055 00056 #include <jwsc++/base/exception.h> 00057 #include <jwsc++/graphics/parapiped.h> 00058 00059 00060 namespace jwscxx { 00061 namespace graphics { 00062 00063 00070 class Cuboid_f : public Parapiped_f 00071 { 00072 public: 00073 00075 Cuboid_f(float width, float height, float length) 00076 throw (jwscxx::base::Arg_error); 00077 00078 00080 Cuboid_f 00081 ( 00082 float width, 00083 float height, 00084 float length, 00085 float x, 00086 float y, 00087 float z 00088 ) 00089 throw (jwscxx::base::Arg_error); 00090 00091 00093 Cuboid_f 00094 ( 00095 float width, 00096 float height, 00097 float length, 00098 const jwsc::Vector_f* p 00099 ) 00100 throw (jwscxx::base::Arg_error); 00101 00102 00104 Cuboid_f(const Cuboid_f& c); 00105 00106 00108 Cuboid_f(const char* fname) throw (jwscxx::base::Arg_error, 00109 jwscxx::base::IO_error); 00110 00111 00113 Cuboid_f(std::istream& in) throw (jwscxx::base::Arg_error, 00114 jwscxx::base::IO_error); 00115 00116 00118 virtual ~Cuboid_f(); 00119 00120 00122 virtual Cuboid_f& operator= (const Cuboid_f& c); 00123 00124 00126 virtual Cuboid_f* clone() const; 00127 }; 00128 00129 00136 class Cuboid_d : public Parapiped_d 00137 { 00138 public: 00139 00141 Cuboid_d(double width, double height, double length) 00142 throw (jwscxx::base::Arg_error); 00143 00144 00146 Cuboid_d 00147 ( 00148 double width, 00149 double height, 00150 double length, 00151 double x, 00152 double y, 00153 double z 00154 ) 00155 throw (jwscxx::base::Arg_error); 00156 00157 00159 Cuboid_d 00160 ( 00161 double width, 00162 double height, 00163 double length, 00164 const jwsc::Vector_d* p 00165 ) 00166 throw (jwscxx::base::Arg_error); 00167 00168 00170 Cuboid_d(const Cuboid_d& c); 00171 00172 00174 Cuboid_d(const char* fname) throw (jwscxx::base::Arg_error, 00175 jwscxx::base::IO_error); 00176 00177 00179 Cuboid_d(std::istream& in) throw (jwscxx::base::Arg_error, 00180 jwscxx::base::IO_error); 00181 00182 00184 virtual ~Cuboid_d(); 00185 00186 00188 virtual Cuboid_d& operator= (const Cuboid_d& c); 00189 00190 00192 virtual Cuboid_d* clone() const; 00193 }; 00194 00195 00196 }} 00197 00198 00199 #endif