22 #ifndef KJB_G_CPP_CYLINDER_H
23 #define KJB_G_CPP_CYLINDER_H
45 "Cylinder() both points must be 3-dimensional.");
64 virtual void read(std::istream & in);
66 virtual void read(
const char * filename)
71 virtual void write(std::ostream & out)
const;
73 virtual void write(
const char * filename)
const
Abstract class to write this object to an output stream.
Definition: l_writeable.h:41
double get_length() const
Definition: g_cylinder.h:83
double r_
Definition: g_cylinder.h:93
size_type size() const
Alias to get_length(). Required to comply with stl Container concept.
Definition: m_vector.h:510
Abstract class to read this object from an input stream.
Definition: l_readable.h:39
virtual void write(std::ostream &out) const
Writes this Writeable to an output stream.
Definition: g_cylinder.cpp:94
This class implements vectors, in the linear-algebra sense, with real-valued elements.
Definition: m_vector.h:87
virtual void write(std::ostream &out) const =0
Writes this Writeable to an output stream.
virtual Cylinder & operator=(const Cylinder &c)
Copies a Cylinder into this one.
Definition: g_cylinder.cpp:36
double get_radius() const
Definition: g_cylinder.h:80
Cylinder(const char *filename)
Definition: g_cylinder.h:49
Cylinder(std::istream &in)
Definition: g_cylinder.h:55
Vector p1_
Definition: g_cylinder.h:91
virtual void read(std::istream &in)
Reads this Readable from an input stream.
Definition: g_cylinder.cpp:46
virtual void read(const char *filename)
Reads this Readable from a file.
Definition: g_cylinder.h:66
virtual void write(const char *filename) const
Writes this Writeable to a file.
Definition: g_cylinder.h:73
Vector get_direction() const
Definition: g_cylinder.h:87
Vector p2_
Definition: g_cylinder.h:92
#define KJB_THROW_2(ex, msg)
Definition: l_exception.h:48
Cylinder(const Vector &p1, const Vector &p2, double radius)
Definition: g_cylinder.h:35
Vector & normalize(kjb_c::Norm_method method=kjb_c::NORMALIZE_BY_MAGNITUDE)
Normalize vector in place by choice of method (default by magnitude).
Definition: m_vector.h:1524
Object thrown when an argument to a function is not acceptable.
Definition: l_exception.h:377
Definition: g_cylinder.h:32
double norm2(const Int_vector &op1)
Compute l2-norm of vector.
Definition: l_int_vector.h:1558
virtual void read(std::istream &in)=0
Reads this Readable from an input stream.
double get_width() const
Definition: g_cylinder.h:84
const Vector & get_p1() const
Definition: g_cylinder.h:78
const Vector & get_p2() const
Definition: g_cylinder.h:79
Definition for the Vector class, a thin wrapper on the KJB Vector struct and its related functionalit...