KJB
|
#include <camera_frustum.h>
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_frustum & | operator= (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_renderable & | get_rendering_interface () const |
returns the rendering interface used to render this Parametric_frustum More... | |
Polymesh & | get_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_frustum * | clone () 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 Vector & | get_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::Quaternion & | get_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_model & | operator= (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... | |
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 | ) |
|
inlinevirtual |
|
virtual |
Processes an Option from program command-line arguments.
Implements kjb::Cloneable.
|
inline |
Returns the centre of this Parametric_frustum.
|
inline |
Returns the x coordinate of the centre of this Parametric_frustum.
|
inline |
Returns the x coordinate of the centre of this Parametric_frustum.
|
inline |
Returns the x coordinate of the centre of this Parametric_frustum.
|
inline |
Returns the height of this parametric frustum.
|
inline |
Returns the length of this parametric frustum.
void Parametric_frustum::get_lines | ( | std::vector< Line3d > & | lines | ) |
|
inlinestatic |
|
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.
|
inline |
returns the polymesh used to render this Parametric_frustum
|
inline |
Returns the ratio of the top and bottom surface of this parametric frustum.
|
virtual |
returns the rendering interface used to render this Parametric_frustum
Implements kjb::Renderable_model.
|
inlinestatic |
|
inline |
Returns the roll of this parametric frustum.
|
inline |
returns the rotations of this parapiped as a quaternion
void Parametric_frustum::get_vertices | ( | std::vector< Vector > & | vertices | ) |
|
inline |
Returns the width of this parametric frustum.
|
inline |
Returns the yaw of this parametric frustum.
Parametric_frustum & Parametric_frustum::operator= | ( | const Parametric_frustum & | src | ) |
|
virtual |
Reads this Parametric_frustum from an input stream.
Implements kjb::Readable.
|
inlinevirtual |
Reads this Parametric_frustum from a file.
Reimplemented from kjb::Readable.
|
virtual |
rotates the parapiped around its x,y,z axes in this order
|
virtual |
rotates the truncated cone around its x-axis
|
virtual |
rotates the truncated cone around its x-axis
|
virtual |
rotates the parapiped around its x-axis
|
virtual |
sets the rotation angles from an input quaternion
Sets the rotation angles from an input quaternion
q | the 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.
|
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 | ||
) |
|
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.
|
virtual |
Writes this Parametric_frustum to a file.
Implements kjb::Writeable.
|
inlinevirtual |
Writes this Parametric_frustum to an output stream.
Reimplemented from kjb::Writeable.