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

#include <camera_frustum.h>

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

Public Member Functions

 Parametric_frustum (unsigned int inv=6, double ix=0.0, double iy=0.0, double iz=0.0, double iw=1.0, double il=1.0, double iratio_top_bottom=1.0, double ih=1.0, double ipitch=0.0, double iyaw=0.0, double iroll=0.0) throw (kjb::Illegal_argument)
 
 Parametric_frustum (const char *fname) throw (kjb::Illegal_argument, kjb::IO_error)
 Constructs a parametric_frustum from an input file. More...
 
 Parametric_frustum (std::istream &in) throw (kjb::Illegal_argument, kjb::IO_error)
 Constructs a parametric_frustum from an input stream. More...
 
 Parametric_frustum (const Parametric_frustum &src)
 
Parametric_frustumoperator= (const Parametric_frustum &src)
 
virtual void read (std::istream &in) throw (kjb::Illegal_argument, kjb::IO_error)
 Reads this Parametric_frustum from an input stream. More...
 
virtual void read (const char *fname) throw (kjb::IO_error, kjb::Illegal_argument)
 Reads this Parametric_frustum from a file. More...
 
virtual void write (std::ostream &out) const throw (kjb::IO_error)
 Writes this Parametric_frustum to a file. More...
 
virtual void write (const char *fname) const throw (kjb::IO_error)
 Writes this Parametric_frustum to an output stream. More...
 
virtual Abstract_renderableget_rendering_interface () const
 returns the rendering interface used to render this Parametric_frustum More...
 
Polymeshget_polymesh () const
 returns the polymesh used to render this Parametric_frustum More...
 
virtual void update_rendering_representation () const throw (kjb::KJB_error)
 updates the rendering representation so that it reflects the current values of the parameters. This is not done any time a parameter changes for efficiency reasons More...
 
virtual Parametric_frustumclone () const
 Processes an Option from program command-line arguments. More...
 
virtual ~Parametric_frustum ()
 
double get_width () const
 Returns the width of this parametric frustum. More...
 
double get_length () const
 Returns the length of this parametric frustum. More...
 
double get_ratio_top_bottom () const
 Returns the ratio of the top and bottom surface of this parametric frustum. More...
 
double get_height () const
 Returns the height of this parametric frustum. More...
 
double get_pitch () const
 Returns the pitch of this parametric frustum. More...
 
double get_yaw () const
 Returns the yaw of this parametric frustum. More...
 
double get_roll () const
 Returns the roll of this parametric frustum. More...
 
const Vectorget_centre () const
 Returns the centre of this Parametric_frustum. More...
 
double get_centre_x () const
 Returns the x coordinate of the centre of this Parametric_frustum. More...
 
double get_centre_y () const
 Returns the x coordinate of the centre of this Parametric_frustum. More...
 
double get_centre_z () const
 Returns the x coordinate of the centre of this Parametric_frustum. More...
 
void set_width (double iwidth) throw (kjb::Illegal_argument)
 Sets the width of the base of this Parametric_frustum. More...
 
void set_length (double ilength) throw (kjb::Illegal_argument)
 Sets the length of the base of this Parametric_frustum. More...
 
void set_ratio_top_bottom (double iratio_top_bottom) throw (kjb::Illegal_argument)
 Sets the ratio between the top and the base of this Parametric_frustum. More...
 
void set_height (double iheight) throw (kjb::Illegal_argument)
 Sets the height of this Parametric_frustum. More...
 
void set_pitch (double ip)
 Sets the pitch of this Parametric_frustum. More...
 
void set_yaw (double iy)
 Sets the yaw of this Parametric_frustum. More...
 
void set_roll (double ir)
 Sets the roll of this Parametric_frustum. More...
 
virtual void rotate_around_x_axis (double theta)
 rotates the truncated cone around its x-axis More...
 
virtual void rotate_around_y_axis (double theta)
 rotates the truncated cone around its x-axis More...
 
virtual void rotate_around_z_axis (double theta)
 rotates the parapiped around its x-axis More...
 
virtual void rotate_around_frustum_axes (double thetax, double thetay, double thetaz)
 rotates the parapiped around its x,y,z axes in this order More...
 
void set_centre (const kjb::Vector &icentre) throw (kjb::Illegal_argument)
 Sets the centre of this parametric_frustum. More...
 
void set_centre_x (double ix) throw (kjb::Illegal_argument)
 Sets the x coordinate of the centre of this parametric_frustum. More...
 
void set_centre_y (double iy) throw (kjb::Illegal_argument)
 Sets the y coordinate of the centre of this parametric_frustum. More...
 
void set_centre_z (double iz) throw (kjb::Illegal_argument)
 Sets the z coordinate of the centre of this parametric_frustum. More...
 
virtual void set_angles_from_quaternion (const kjb::Quaternion &q)
 sets the rotation angles from an input quaternion More...
 
const kjb::Quaternionget_rotations_as_a_quaternion () const
 returns the rotations of this parapiped as a quaternion More...
 
void set_rotation_mode (kjb::Quaternion::Euler_mode imode)
 
void stretch_along_axis (unsigned int axis, double amount, bool direction)
 
void get_point_in_parapiped_coordinates (const kjb::Vector &point_in_world_coordinates, kjb::Vector &point_in_parapiped_coordinates) const
 
void get_point_in_world_coordinates (const kjb::Vector &point_in_parapiped_coordinates, kjb::Vector &point_in_world_coordinates) const
 Transforms a point in parapiped coordinates to world coordinates. More...
 
void get_lines (std::vector< Line3d > &lines)
 
void get_vertices (std::vector< Vector > &vertices)
 
- 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...
 

Static Public Member Functions

static int get_num_rendering_interface_edges (int num_facets)
 
static int get_rendering_interface_edge_indexes (std::vector< int > &base_edge_indexes, std::vector< int > &vertical_edge_indexes, std::vector< int > &top_edge_indexes, int num_facets)
 
- 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...
 

Additional Inherited Members

- 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_frustum::Parametric_frustum ( unsigned int  inv = 6,
double  ix = 0.0,
double  iy = 0.0,
double  iz = 0.0,
double  iw = 1.0,
double  il = 1.0,
double  iratio_top_bottom = 1.0,
double  ih = 1.0,
double  ipitch = 0.0,
double  iyaw = 0.0,
double  iroll = 0.0 
)
throw (kjb::Illegal_argument
)
Parametric_frustum::Parametric_frustum ( const char *  fname)
throw (kjb::Illegal_argument,
kjb::IO_error
)

Constructs a parametric_frustum from an input file.

Parametric_frustum::Parametric_frustum ( std::istream &  in)
throw (kjb::Illegal_argument,
kjb::IO_error
)

Constructs a parametric_frustum from an input stream.

Parametric_frustum::Parametric_frustum ( const Parametric_frustum src)
virtual kjb::Parametric_frustum::~Parametric_frustum ( )
inlinevirtual

Member Function Documentation

Parametric_frustum * Parametric_frustum::clone ( ) const
virtual

Processes an Option from program command-line arguments.

Implements kjb::Cloneable.

const Vector& kjb::Parametric_frustum::get_centre ( ) const
inline

Returns the centre of this Parametric_frustum.

double kjb::Parametric_frustum::get_centre_x ( ) const
inline

Returns the x coordinate of the centre of this Parametric_frustum.

double kjb::Parametric_frustum::get_centre_y ( ) const
inline

Returns the x coordinate of the centre of this Parametric_frustum.

double kjb::Parametric_frustum::get_centre_z ( ) const
inline

Returns the x coordinate of the centre of this Parametric_frustum.

double kjb::Parametric_frustum::get_height ( ) const
inline

Returns the height of this parametric frustum.

double kjb::Parametric_frustum::get_length ( ) const
inline

Returns the length of this parametric frustum.

void Parametric_frustum::get_lines ( std::vector< Line3d > &  lines)
static int kjb::Parametric_frustum::get_num_rendering_interface_edges ( int  num_facets)
inlinestatic
double kjb::Parametric_frustum::get_pitch ( ) const
inline

Returns the pitch of this parametric frustum.

void Parametric_frustum::get_point_in_parapiped_coordinates ( const kjb::Vector point_in_world_coordinates,
kjb::Vector point_in_parapiped_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 parapiped axes

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

void Parametric_frustum::get_point_in_world_coordinates ( const kjb::Vector point_in_parapiped_coordinates,
kjb::Vector point_in_world_coordinates 
) const

Transforms a point in parapiped coordinates to world coordinates.

Polymesh& kjb::Parametric_frustum::get_polymesh ( ) const
inline

returns the polymesh used to render this Parametric_frustum

double kjb::Parametric_frustum::get_ratio_top_bottom ( ) const
inline

Returns the ratio of the top and bottom surface of this parametric frustum.

Abstract_renderable & Parametric_frustum::get_rendering_interface ( ) const
virtual

returns the rendering interface used to render this Parametric_frustum

Implements kjb::Renderable_model.

static int kjb::Parametric_frustum::get_rendering_interface_edge_indexes ( std::vector< int > &  base_edge_indexes,
std::vector< int > &  vertical_edge_indexes,
std::vector< int > &  top_edge_indexes,
int  num_facets 
)
inlinestatic
double kjb::Parametric_frustum::get_roll ( ) const
inline

Returns the roll of this parametric frustum.

const kjb::Quaternion& kjb::Parametric_frustum::get_rotations_as_a_quaternion ( ) const
inline

returns the rotations of this parapiped as a quaternion

void Parametric_frustum::get_vertices ( std::vector< Vector > &  vertices)
double kjb::Parametric_frustum::get_width ( ) const
inline

Returns the width of this parametric frustum.

double kjb::Parametric_frustum::get_yaw ( ) const
inline

Returns the yaw of this parametric frustum.

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

Reads this Parametric_frustum from an input stream.

Implements kjb::Readable.

virtual void kjb::Parametric_frustum::read ( const char *  fname)
throw (kjb::IO_error,
kjb::Illegal_argument
)
inlinevirtual

Reads this Parametric_frustum from a file.

Reimplemented from kjb::Readable.

void Parametric_frustum::rotate_around_frustum_axes ( double  thetax,
double  thetay,
double  thetaz 
)
virtual

rotates the parapiped around its x,y,z axes in this order

void Parametric_frustum::rotate_around_x_axis ( double  theta)
virtual

rotates the truncated cone around its x-axis

void Parametric_frustum::rotate_around_y_axis ( double  theta)
virtual

rotates the truncated cone around its x-axis

void Parametric_frustum::rotate_around_z_axis ( double  theta)
virtual

rotates the parapiped around its x-axis

void Parametric_frustum::set_angles_from_quaternion ( const kjb::Quaternion q)
virtual

sets the rotation angles from an input quaternion

Sets the rotation angles from an input quaternion

Parameters
qthe input quaternion
void Parametric_frustum::set_centre ( const kjb::Vector icentre)
throw (kjb::Illegal_argument
)

Sets the centre of this parametric_frustum.

void Parametric_frustum::set_centre_x ( double  ix)
throw (kjb::Illegal_argument
)

Sets the x coordinate of the centre of this parametric_frustum.

void Parametric_frustum::set_centre_y ( double  iy)
throw (kjb::Illegal_argument
)

Sets the y coordinate of the centre of this parametric_frustum.

void Parametric_frustum::set_centre_z ( double  iz)
throw (kjb::Illegal_argument
)

Sets the z coordinate of the centre of this parametric_frustum.

void Parametric_frustum::set_height ( double  iheight)
throw (kjb::Illegal_argument
)

Sets the height of this Parametric_frustum.

void Parametric_frustum::set_length ( double  ilength)
throw (kjb::Illegal_argument
)

Sets the length of the base of this Parametric_frustum.

void Parametric_frustum::set_pitch ( double  ip)

Sets the pitch of this Parametric_frustum.

void Parametric_frustum::set_ratio_top_bottom ( double  iratio_top_bottom)
throw (kjb::Illegal_argument
)

Sets the ratio between the top and the base of this Parametric_frustum.

void Parametric_frustum::set_roll ( double  ir)

Sets the roll of this Parametric_frustum.

void kjb::Parametric_frustum::set_rotation_mode ( kjb::Quaternion::Euler_mode  imode)
inline

Sets the rotation mode. This will have an impact on how pitch, yaw and roll are interpreted (standard is Euler Mode XYZ with rotating axes, see class Quaternion). No matter what mode you specify here, pitch will be interpreted as Euler angle 1, yaw as Euler angle 2, and roll as Euler angle 3. This function (except for standard mode XYZR) is not adequately tested

void Parametric_frustum::set_width ( double  iwidth)
throw (kjb::Illegal_argument
)

Sets the width of the base of this Parametric_frustum.

void Parametric_frustum::set_yaw ( double  iy)

Sets the yaw of this Parametric_frustum.

void Parametric_frustum::stretch_along_axis ( unsigned int  axis,
double  amount,
bool  direction 
)
void Parametric_frustum::update_rendering_representation ( ) const
throw (kjb::KJB_error
)
virtual

updates the rendering representation so that it reflects the current values of the parameters. This is not done any time a parameter changes for efficiency reasons

Implements kjb::Renderable_model.

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

Writes this Parametric_frustum to a file.

Implements kjb::Writeable.

virtual void kjb::Parametric_frustum::write ( const char *  fname) const
throw (kjb::IO_error
)
inlinevirtual

Writes this Parametric_frustum to an output stream.

Reimplemented from kjb::Writeable.


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