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_parapiped Class Reference

#include <st_parapiped.h>

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

Public Member Functions

 Parametric_parapiped (double ix=0.0, double iy=0.0, double iz=0.0, double iw=1.0, double ih=1.0, double il=1.0, double ipitch=0.0, double iyaw=0.0, double iroll=0.0) throw (kjb::Illegal_argument)
 
 Parametric_parapiped (const char *fname) throw (kjb::Illegal_argument, kjb::IO_error)
 Constructs a parametric_parapiped from an input file. More...
 
 Parametric_parapiped (std::istream &in) throw (kjb::Illegal_argument, kjb::IO_error)
 Constructs a parametric_parapiped from an input stream. More...
 
 Parametric_parapiped (const Parametric_parapiped &src)
 
virtual Parametric_parapipedoperator= (const Parametric_parapiped &src)
 
virtual void read (std::istream &in) throw (kjb::Illegal_argument, kjb::IO_error)
 Reads this parametric_parapiped from an input stream. More...
 
virtual void read (const char *fname) throw (kjb::IO_error, kjb::Illegal_argument)
 Reads this parametric_parapiped from a file. More...
 
virtual void write (std::ostream &out) const throw (kjb::IO_error)
 Writes this parametric_parapiped to a file. More...
 
virtual void write (const char *fname) const throw (kjb::IO_error)
 Writes this parametric_parapiped to an output stream. More...
 
virtual Abstract_renderableget_rendering_interface () const
 returns the rendering interface used to render this parametric_parapiped More...
 
Polymeshget_polymesh () const
 returns the polymesh used to render this parametric_parapiped 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_parapipedclone () const
 Processes an Option from program command-line arguments. More...
 
virtual ~Parametric_parapiped ()
 
double get_width () const
 Returns the width of this parametric_parapiped. More...
 
double get_height () const
 Returns the height of this parametric_parapiped. More...
 
double get_length () const
 Returns the length of this parametric_parapiped. More...
 
double get_pitch () const
 Returns the pitch of this parametric_parapiped. More...
 
double get_yaw () const
 Returns the yaw of this parametric_parapiped. More...
 
double get_roll () const
 Returns the roll of this parametric_parapiped. More...
 
const Vectorget_centre () const
 Returns the centre of this parametric_parapiped. More...
 
double get_centre_x () const
 Returns the x coordinate of the centre of this parametric_parapiped. More...
 
double get_centre_y () const
 Returns the x coordinate of the centre of this parametric_parapiped. More...
 
double get_centre_z () const
 Returns the x coordinate of the centre of this parametric_parapiped. More...
 
void set_width (double iwidth) throw (kjb::Illegal_argument)
 Sets the width of this parametric_parapiped. More...
 
void set_height (double iheight) throw (kjb::Illegal_argument)
 Sets the height of this parametric_parapiped. More...
 
void set_length (double ilength) throw (kjb::Illegal_argument)
 Sets the length of this parametric_parapiped. More...
 
void set_pitch (double ip)
 Sets the pitch of this parametric_parapiped. More...
 
void set_yaw (double iy)
 Sets the yaw of this parametric_parapiped. More...
 
void set_roll (double ir)
 Sets the roll of this parametric_parapiped. More...
 
virtual void rotate_around_x_axis (double theta)
 rotates the parapiped around its x-axis More...
 
virtual void rotate_around_y_axis (double theta)
 rotates the parapiped 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_parapiped_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_parapiped. More...
 
void set_centre_x (double ix) throw (kjb::Illegal_argument)
 Sets the x coordinate of the centre of this parametric_parapiped. More...
 
void set_centre_y (double iy) throw (kjb::Illegal_argument)
 Sets the y coordinate of the centre of this parametric_parapiped. More...
 
void set_centre_z (double iz) throw (kjb::Illegal_argument)
 Sets the z coordinate of the centre of this parametric_parapiped. 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 draw_orientation_map () const
 
void draw_left_right_orientation_map () const
 
void draw_CMU_orientation_map () const
 
void draw_geometric_context_map () const
 
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 ()
 
static void get_rendering_interface_edge_indexes (std::vector< int > &base_edge_indexes, std::vector< int > &vertical_edge_indexes, std::vector< int > &top_edge_indexes)
 
- 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...
 

Detailed Description

Cone parametrized in terms of the number of vertices of the polygon to approximate the circle, the radius of the bottom surface and the top surface, the center of the cone, its height and rotation angles around its axes (pitch, yaw and roll using classic Tait-Bryan formulation).

It provides a rendering interface to the underlying rendering representation. So far, only OpenGL is supported

parametrized in terms of width, height, length, position of the centre and rotation angles around its axes (pitch, yaw and roll using classic Tait-Bryan formulation).

It provides a rendering interface to the underlying rendering representation. So far, only OpenGL is supported

Constructor & Destructor Documentation

Parametric_parapiped::Parametric_parapiped ( double  ix = 0.0,
double  iy = 0.0,
double  iz = 0.0,
double  iw = 1.0,
double  ih = 1.0,
double  il = 1.0,
double  ipitch = 0.0,
double  iyaw = 0.0,
double  iroll = 0.0 
)
throw (kjb::Illegal_argument
)
Parametric_parapiped::Parametric_parapiped ( const char *  fname)
throw (kjb::Illegal_argument,
kjb::IO_error
)

Constructs a parametric_parapiped from an input file.

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

Constructs a parametric_parapiped from an input stream.

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

Member Function Documentation

Parametric_parapiped * Parametric_parapiped::clone ( ) const
virtual

Processes an Option from program command-line arguments.

Implements kjb::Cloneable.

void Parametric_parapiped::draw_CMU_orientation_map ( ) const
void Parametric_parapiped::draw_geometric_context_map ( ) const
void Parametric_parapiped::draw_left_right_orientation_map ( ) const
void Parametric_parapiped::draw_orientation_map ( ) const
const Vector& kjb::Parametric_parapiped::get_centre ( ) const
inline

Returns the centre of this parametric_parapiped.

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

Returns the x coordinate of the centre of this parametric_parapiped.

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

Returns the x coordinate of the centre of this parametric_parapiped.

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

Returns the x coordinate of the centre of this parametric_parapiped.

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

Returns the height of this parametric_parapiped.

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

Returns the length of this parametric_parapiped.

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

Returns the pitch of this parametric_parapiped.

void Parametric_parapiped::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 parapiped centre is the origin, and the axes are defined by the parapiped axes

void Parametric_parapiped::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_parapiped::get_polymesh ( ) const
inline

returns the polymesh used to render this parametric_parapiped

Abstract_renderable & Parametric_parapiped::get_rendering_interface ( ) const
virtual

returns the rendering interface used to render this parametric_parapiped

Implements kjb::Renderable_model.

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

Returns the roll of this parametric_parapiped.

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

returns the rotations of this parapiped as a quaternion

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

Returns the width of this parametric_parapiped.

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

Returns the yaw of this parametric_parapiped.

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

Reads this parametric_parapiped from an input stream.

Implements kjb::Readable.

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

Reads this parametric_parapiped from a file.

Reimplemented from kjb::Readable.

void Parametric_parapiped::rotate_around_parapiped_axes ( double  thetax,
double  thetay,
double  thetaz 
)
virtual

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

void Parametric_parapiped::rotate_around_x_axis ( double  theta)
virtual

rotates the parapiped around its x-axis

void Parametric_parapiped::rotate_around_y_axis ( double  theta)
virtual

rotates the parapiped around its x-axis

void Parametric_parapiped::rotate_around_z_axis ( double  theta)
virtual

rotates the parapiped around its x-axis

void Parametric_parapiped::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_parapiped::set_centre ( const kjb::Vector icentre)
throw (kjb::Illegal_argument
)

Sets the centre of this parametric_parapiped.

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

Sets the x coordinate of the centre of this parametric_parapiped.

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

Sets the y coordinate of the centre of this parametric_parapiped.

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

Sets the z coordinate of the centre of this parametric_parapiped.

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

Sets the height of this parametric_parapiped.

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

Sets the length of this parametric_parapiped.

void Parametric_parapiped::set_pitch ( double  ip)

Sets the pitch of this parametric_parapiped.

void Parametric_parapiped::set_roll ( double  ir)

Sets the roll of this parametric_parapiped.

void kjb::Parametric_parapiped::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_parapiped::set_width ( double  iwidth)
throw (kjb::Illegal_argument
)

Sets the width of this parametric_parapiped.

void Parametric_parapiped::set_yaw ( double  iy)

Sets the yaw of this parametric_parapiped.

void Parametric_parapiped::stretch_along_axis ( unsigned int  axis,
double  amount,
bool  direction 
)
void Parametric_parapiped::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_parapiped::write ( std::ostream &  out) const
throw (kjb::IO_error
)
virtual

Writes this parametric_parapiped to a file.

Implements kjb::Writeable.

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

Writes this parametric_parapiped to an output stream.

Reimplemented from kjb::Writeable.


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