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

#include <st_sphere.h>

Inheritance diagram for kjb::Parametric_sphere:
kjb::Renderable_model kjb::Readable kjb::Writeable kjb::Cloneable

Public Member Functions

 Parametric_sphere (double center_x, double center_y, double center_z, double radius=1.0) throw (kjb::Illegal_argument)
 
 Parametric_sphere ()
 
 Parametric_sphere (const char *fname) throw (kjb::Illegal_argument, kjb::IO_error)
 Constructs a parametric_parapiped from an input file. More...
 
 Parametric_sphere (std::istream &in) throw (kjb::Illegal_argument, kjb::IO_error)
 
 Parametric_sphere (const Parametric_sphere &src)
 
virtual Parametric_sphereoperator= (const Parametric_sphere &src)
 
virtual void read (std::istream &in) throw (kjb::Illegal_argument, kjb::IO_error)
 Reads this Readable from an input stream. More...
 
virtual void read (const char *fname)
 Reads this Readable from a file. More...
 
virtual void write (std::ostream &out) const throw (kjb::IO_error)
 Save the Sphere parameters into a file. More...
 
virtual void write (const char *fname) const throw (kjb::IO_error)
 Writes this Writeable to a file. More...
 
virtual Abstract_renderableget_rendering_interface () const
 Returns a reference to the rendering interface used to render this model. More...
 
virtual void update_rendering_representation () const throw (kjb::KJB_error)
 Updates the rendering interface so that it reflects the paremeter values of this model to the rendering interface used to render this model. More...
 
virtual Parametric_sphereclone () const
 Processes an Option from program command-line arguments. More...
 
virtual ~Parametric_sphere ()
 
double get_center_x () const
 Returns the center location x. More...
 
double get_center_y () const
 Returns the center location y. More...
 
double get_center_z () const
 Returns the center location z. More...
 
const Vectorget_center () const
 Returns the center of the sphere. More...
 
double get_radius () const
 Returns the radius. More...
 
void set_center_x (double x)
 Sets the center location x. More...
 
void set_center_y (double y)
 Sets the center location y. More...
 
void set_center_z (double z)
 Sets the center location z. More...
 
void set_center (const Vector &center)
 Sets the center location. More...
 
void set_radius (double r)
 Sets the radius. More...
 
void get_point_in_sphere_coordinates (const kjb::Vector &point_in_world_coordinates, kjb::Vector &point_in_sphere_coordinates) const
 
void get_point_in_world_coordinates (const kjb::Vector &point_in_sphere_coordinates, kjb::Vector &point_in_world_coordinates) const
 Transforms a point in parapiped coordinates to world coordinates. More...
 
void propose_sphere_from_curve ()
 
- Public Member Functions inherited from kjb::Renderable_model
 Renderable_model (bool istatus=false)
 Constructor. More...
 
 Renderable_model (const Renderable_model &src)
 Copy constructor. More...
 
Renderable_modeloperator= (const Renderable_model &)
 Assignment operator. More...
 
virtual ~Renderable_model ()
 
virtual void wire_render () const throw (kjb::KJB_error)
 Renders this model as a wireframe. More...
 
virtual void wire_occlude_render () const throw (kjb::KJB_error)
 Renders this model into the depth buffer. More...
 
virtual void solid_render () const throw (kjb::KJB_error)
 Renders this model as a solid. More...
 
virtual void render_occluded_wireframe () const throw (kjb::KJB_error)
 Renders this model as a wireframe by removing occluded edges. More...
 
virtual void silhouette_render (const kjb::Base_gl_interface &, double width=1.0) const
 renders the silhouette of this object More...
 
void update_if_needed () const
 
void force_update () const
 
- Public Member Functions inherited from kjb::Cloneable
virtual ~Cloneable ()
 Deletes this Cloneable. More...
 
- 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 m_center_v
 
double m_radius
 

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...
 
- Protected Member Functions inherited from kjb::Renderable_model
void set_rendering_representation_dirty () const
 This method is called to whenever the model parameters where changed without updating the rendering interface accordingly. This means that the rendering interface has to be updated before calling any rendering method, otherwise the rendering will not match the parameter values of the model. More...
 

Constructor & Destructor Documentation

Parametric_sphere::Parametric_sphere ( double  center_x,
double  center_y,
double  center_z,
double  radius = 1.0 
)
throw (kjb::Illegal_argument
)
kjb::Parametric_sphere::Parametric_sphere ( )
inline
Parametric_sphere::Parametric_sphere ( const char *  fname)
throw (kjb::Illegal_argument,
kjb::IO_error
)

Constructs a parametric_parapiped from an input file.

Parametric_sphere::Parametric_sphere ( std::istream &  in)
throw (kjb::Illegal_argument,
kjb::IO_error
)
kjb::Parametric_sphere::Parametric_sphere ( const Parametric_sphere src)
virtual kjb::Parametric_sphere::~Parametric_sphere ( )
inlinevirtual

Member Function Documentation

virtual Parametric_sphere* kjb::Parametric_sphere::clone ( ) const
inlinevirtual

Processes an Option from program command-line arguments.

Implements kjb::Cloneable.

const Vector& kjb::Parametric_sphere::get_center ( ) const
inline

Returns the center of the sphere.

double kjb::Parametric_sphere::get_center_x ( ) const
inline

Returns the center location x.

double kjb::Parametric_sphere::get_center_y ( ) const
inline

Returns the center location y.

double kjb::Parametric_sphere::get_center_z ( ) const
inline

Returns the center location z.

void kjb::Parametric_sphere::get_point_in_sphere_coordinates ( const kjb::Vector point_in_world_coordinates,
kjb::Vector point_in_sphere_coordinates 
) const

a point in world coordinates to a coordinate system where the parapiped centre is the origin, and the axes are defined by the sphere axes

void kjb::Parametric_sphere::get_point_in_world_coordinates ( const kjb::Vector point_in_sphere_coordinates,
kjb::Vector point_in_world_coordinates 
) const

Transforms a point in parapiped coordinates to world coordinates.

double kjb::Parametric_sphere::get_radius ( ) const
inline

Returns the radius.

virtual Abstract_renderable& kjb::Parametric_sphere::get_rendering_interface ( ) const
virtual

Returns a reference to the rendering interface used to render this model.

Implements kjb::Renderable_model.

virtual Parametric_sphere& kjb::Parametric_sphere::operator= ( const Parametric_sphere src)
virtual
void kjb::Parametric_sphere::propose_sphere_from_curve ( )
void Parametric_sphere::read ( std::istream &  in)
throw (kjb::Illegal_argument,
kjb::IO_error
)
virtual

Reads this Readable from an input stream.

Implements kjb::Readable.

virtual void kjb::Parametric_sphere::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 kjb::Parametric_sphere::set_center ( const Vector center)
inline

Sets the center location.

void kjb::Parametric_sphere::set_center_x ( double  x)
inline

Sets the center location x.

void kjb::Parametric_sphere::set_center_y ( double  y)
inline

Sets the center location y.

void kjb::Parametric_sphere::set_center_z ( double  z)
inline

Sets the center location z.

void kjb::Parametric_sphere::set_radius ( double  r)
inline

Sets the radius.

virtual void kjb::Parametric_sphere::update_rendering_representation ( ) const
throw (kjb::KJB_error
)
virtual

Updates the rendering interface so that it reflects the paremeter values of this model to the rendering interface used to render this model.

Implements kjb::Renderable_model.

void Parametric_sphere::write ( std::ostream &  out) const
throw (kjb::IO_error
)
virtual

Save the Sphere parameters into a file.

Implements kjb::Writeable.

virtual void kjb::Parametric_sphere::write ( const char *  fname) const
throw (kjb::IO_error
)
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::Parametric_sphere::m_center_v
protected
double kjb::Parametric_sphere::m_radius
protected

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