KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Attributes | List of all members
kjb::Cylinder Class Reference

#include <g_cylinder.h>

Inheritance diagram for kjb::Cylinder:
kjb::Readable kjb::Writeable kjb::Cylinder_section

Public Member Functions

 Cylinder (const Vector &p1, const Vector &p2, double radius)
 
 Cylinder (const char *filename)
 
 Cylinder (std::istream &in)
 
virtual Cylinderoperator= (const Cylinder &c)
 Copies a Cylinder into this one. More...
 
virtual void read (std::istream &in)
 Reads this Readable from an input stream. More...
 
virtual void read (const char *filename)
 Reads this Readable from a file. More...
 
virtual void write (std::ostream &out) const
 Writes this Writeable to an output stream. More...
 
virtual void write (const char *filename) const
 Writes this Writeable to a file. More...
 
const Vectorget_p1 () const
 
const Vectorget_p2 () const
 
double get_radius () const
 
double get_length () const
 
double get_width () const
 
Vector get_direction () const
 
- Public Member Functions inherited from kjb::Readable
virtual ~Readable ()
 Deletes this Readable. More...
 
- Public Member Functions inherited from kjb::Writeable
virtual ~Writeable ()
 Deletes this Writeable. More...
 

Protected Attributes

Vector p1_
 
Vector p2_
 
double r_
 

Additional Inherited Members

- Static Public Member Functions inherited from kjb::Readable
static const char * read_field_value (std::istream &in, const char *field_name, char *field_buf, size_t buf_len, char separator=':')
 Reads a line off in into a buffer and returns a pointer to the field value in the buffer. More...
 
static const char * read_field_value (std::istream &in, const char *field_name, char separator=':')
 Reads a line off in into an internal buffer and returns a pointer to the field value in the buffer. More...
 

Constructor & Destructor Documentation

kjb::Cylinder::Cylinder ( const Vector p1,
const Vector p2,
double  radius 
)
inline
kjb::Cylinder::Cylinder ( const char *  filename)
inline
kjb::Cylinder::Cylinder ( std::istream &  in)
inline

Member Function Documentation

Vector kjb::Cylinder::get_direction ( ) const
inline
double kjb::Cylinder::get_length ( ) const
inline
const Vector& kjb::Cylinder::get_p1 ( ) const
inline
const Vector& kjb::Cylinder::get_p2 ( ) const
inline
double kjb::Cylinder::get_radius ( ) const
inline
double kjb::Cylinder::get_width ( ) const
inline
Cylinder & Cylinder::operator= ( const Cylinder c)
virtual

Copies a Cylinder into this one.

Performs a deep copy of the center points of the bases of the cylinder and of the radius.

Parameters
cCylinder to copy into this one.
Returns
A reference to this cylinder.
void Cylinder::read ( std::istream &  in)
virtual

Reads this Readable from an input stream.

Implements kjb::Readable.

Reimplemented in kjb::Cylinder_section.

virtual void kjb::Cylinder::read ( const char *  fname)
inlinevirtual

Reads this Readable from a file.

Parameters
fnameInput file to read from.
Exceptions
kjb::IO_errorCould not read from fname.
kjb::Illegal_argumentInvalid arguments in the file to read from.

Reimplemented from kjb::Readable.

void Cylinder::write ( std::ostream &  out) const
virtual

Writes this Writeable to an output stream.

Implements kjb::Writeable.

Reimplemented in kjb::Cylinder_section.

virtual void kjb::Cylinder::write ( const char *  fname) const
inlinevirtual

Writes this Writeable to a file.

Parameters
fnameOutput file to write to.
Exceptions
kjb::IO_errorCould not write to fname.

Reimplemented from kjb::Writeable.

Member Data Documentation

Vector kjb::Cylinder::p1_
protected
Vector kjb::Cylinder::p2_
protected
double kjb::Cylinder::r_
protected

The documentation for this class was generated from the following files: