Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
vgui_projection_inspector Class Reference

#include <vgui_projection_inspector.h>

List of all members.

Public Member Functions

 vgui_projection_inspector ()
 Constructor - with default projection and modelview matrices.
 ~vgui_projection_inspector ()
 Destructor.
vnl_double_4x4 const & projection_matrix () const
 Returns the projection matrix.
vnl_double_4x4 const & modelview_matrix () const
 Returns the modelview matrix.
int const * viewport () const
 Returns the viewport.
void print (vcl_ostream &) const
 Send info on this projection_inspector to the given stream.
vnl_double_4x4 total_transformation () const
 Returns projection matrix multiplied by modelview matrix.
void window_to_image_coordinates (int, int, float &, float &) const
 Convert window coords (eg. from vgui_event) to image coords.
void image_to_window_coordinates (float, float, float &, float &) const
 Convert image coords to window coords.
bool image_viewport (float &bottom_left_x, float &bottom_left_y, float &top_right_x, float &top_right_y)
 Returns the corners of the backprojection of the viewport onto z=0.
bool compute_as_2d_affine (int width, int height, float *offsetX, float *offsetY, float *scaleX, float *scaleY)
 Offset and scaling to transform window (x,y) to image (ix, iy) coords.
void window_to_image_coordinates (int wx, int wy, float *ix, float *iy) const
 Convert window coords (eg. from vgui_event) to image coords.
void image_to_window_coordinates (float ix, float iy, float *wx, float *wy) const
 Convert image coords to window coords.
bool back_project (double const x[3], double const p[4], double X[4]) const
 Back-projection of a given point onto a given plane p.
vnl_vector< double > back_project (double x, double y, vnl_double_4 const &p) const
 Back-projection of a given point onto a given plane p.
vnl_vector< double > back_project (double x, double y, double z, vnl_double_4 const &p) const
 Back-projection of a given point onto a given plane p.
vnl_vector< double > back_project (vnl_double_2 const &x, vnl_double_4 const &p) const
 Back-projection of a given point onto a given plane p.
vnl_vector< double > back_project (vnl_double_3 const &x, vnl_double_4 const &p) const
 Back-projection of a given point onto a given plane p.

Public Attributes

bool diagonal_scale_3d
 Returns true if the projection matrix has a special form.
float x1
float y1
float x2
float y2
float s [3]
float t [3]

Private Member Functions

void inspect ()

Private Attributes

int vp [4]
vnl_double_4x4 P
vnl_double_4x4 M

Detailed Description

Definition at line 21 of file vgui_projection_inspector.h.


Constructor & Destructor Documentation

vgui_projection_inspector::vgui_projection_inspector ( ) [inline]

Constructor - with default projection and modelview matrices.

Definition at line 25 of file vgui_projection_inspector.h.

vgui_projection_inspector::~vgui_projection_inspector ( ) [inline]

Destructor.

Definition at line 28 of file vgui_projection_inspector.h.


Member Function Documentation

bool vgui_projection_inspector::back_project ( double const  x[3],
double const  p[4],
double  X[4] 
) const

Back-projection of a given point onto a given plane p.

From homogeneous viewport coordinates to homogeneous world coordinates.

Definition at line 31 of file vgui_projection_inspector.cxx.

vnl_vector< double > vgui_projection_inspector::back_project ( double  x,
double  y,
vnl_double_4 const &  p 
) const

Back-projection of a given point onto a given plane p.

Returns a 3-vcl_vector.

Definition at line 102 of file vgui_projection_inspector.cxx.

vnl_vector< double > vgui_projection_inspector::back_project ( double  x,
double  y,
double  z,
vnl_double_4 const &  p 
) const

Back-projection of a given point onto a given plane p.

Returns a 4-vcl_vector.

Definition at line 109 of file vgui_projection_inspector.cxx.

vnl_vector< double > vgui_projection_inspector::back_project ( vnl_double_2 const &  x,
vnl_double_4 const &  p 
) const

Back-projection of a given point onto a given plane p.

x is a 2-vector (Euclidean coordinates), and the returned 3-vector is also Euclidean.

Definition at line 85 of file vgui_projection_inspector.cxx.

vnl_vector< double > vgui_projection_inspector::back_project ( vnl_double_3 const &  x,
vnl_double_4 const &  p 
) const

Back-projection of a given point onto a given plane p.

x is a 3-vector (projective coordinates), and the returned 4-vector is also projective.

Definition at line 93 of file vgui_projection_inspector.cxx.

bool vgui_projection_inspector::compute_as_2d_affine ( int  width,
int  height,
float *  offsetX,
float *  offsetY,
float *  scaleX,
float *  scaleY 
)

Offset and scaling to transform window (x,y) to image (ix, iy) coords.

ix = (x - token.offsetX) / token.scaleX; iy = (y - token.offsetY) / token.scaleY;

Definition at line 241 of file vgui_projection_inspector.cxx.

void vgui_projection_inspector::image_to_window_coordinates ( float  ix,
float  iy,
float &  wx,
float &  wy 
) const

Convert image coords to window coords.

Definition at line 218 of file vgui_projection_inspector.cxx.

void vgui_projection_inspector::image_to_window_coordinates ( float  ix,
float  iy,
float *  wx,
float *  wy 
) const [inline]

Convert image coords to window coords.

Some people prefer to put &s on "return value" parameters.

Definition at line 93 of file vgui_projection_inspector.h.

bool vgui_projection_inspector::image_viewport ( float &  bottom_left_x,
float &  bottom_left_y,
float &  top_right_x,
float &  top_right_y 
)

Returns the corners of the backprojection of the viewport onto z=0.

Definition at line 261 of file vgui_projection_inspector.cxx.

void vgui_projection_inspector::inspect ( ) [private]

Definition at line 130 of file vgui_projection_inspector.cxx.

vnl_double_4x4 const& vgui_projection_inspector::modelview_matrix ( ) const [inline]

Returns the modelview matrix.

Definition at line 34 of file vgui_projection_inspector.h.

void vgui_projection_inspector::print ( vcl_ostream &  strm) const

Send info on this projection_inspector to the given stream.

Definition at line 20 of file vgui_projection_inspector.cxx.

vnl_double_4x4 const& vgui_projection_inspector::projection_matrix ( ) const [inline]

Returns the projection matrix.

Definition at line 31 of file vgui_projection_inspector.h.

vnl_double_4x4 vgui_projection_inspector::total_transformation ( ) const [inline]

Returns projection matrix multiplied by modelview matrix.

Definition at line 43 of file vgui_projection_inspector.h.

int const* vgui_projection_inspector::viewport ( ) const [inline]

Returns the viewport.

Definition at line 37 of file vgui_projection_inspector.h.

void vgui_projection_inspector::window_to_image_coordinates ( int  x,
int  y,
float &  xi,
float &  yi 
) const

Convert window coords (eg. from vgui_event) to image coords.

Definition at line 191 of file vgui_projection_inspector.cxx.

void vgui_projection_inspector::window_to_image_coordinates ( int  wx,
int  wy,
float *  ix,
float *  iy 
) const [inline]

Convert window coords (eg. from vgui_event) to image coords.

Some people prefer to put &s on "return value" parameters.

Definition at line 88 of file vgui_projection_inspector.h.


Member Data Documentation

Returns true if the projection matrix has a special form.

True iff the current total projection matrix has the form

   s0       t0
      s1    t1
         s2 t2
            1
   

in which case x1,y1, x2,y2 will contain the corners of the backprojection of the viewport onto the plane z=0 in the world and s,t will contain the nonzero entries.

Definition at line 56 of file vgui_projection_inspector.h.

Definition at line 119 of file vgui_projection_inspector.h.

Definition at line 118 of file vgui_projection_inspector.h.

Definition at line 67 of file vgui_projection_inspector.h.

Definition at line 67 of file vgui_projection_inspector.h.

Definition at line 117 of file vgui_projection_inspector.h.

Definition at line 59 of file vgui_projection_inspector.h.

Definition at line 63 of file vgui_projection_inspector.h.

Definition at line 61 of file vgui_projection_inspector.h.

Definition at line 65 of file vgui_projection_inspector.h.


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