vgui_projection_inspector Class Reference

#include <vgui_projection_inspector.h>

List of all members.


Detailed Description

Definition at line 19 of file vgui_projection_inspector.h.


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_vector< double > 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

Constructor & Destructor Documentation

vgui_projection_inspector::vgui_projection_inspector (  )  [inline]

Constructor - with default projection and modelview matrices.

Definition at line 23 of file vgui_projection_inspector.h.

vgui_projection_inspector::~vgui_projection_inspector (  )  [inline]

Destructor.

Definition at line 26 of file vgui_projection_inspector.h.


Member Function Documentation

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

Returns the projection matrix.

Definition at line 29 of file vgui_projection_inspector.h.

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

Returns the modelview matrix.

Definition at line 32 of file vgui_projection_inspector.h.

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

Returns the viewport.

Definition at line 35 of file vgui_projection_inspector.h.

void vgui_projection_inspector::print ( vcl_ostream &   )  const

Send info on this projection_inspector to the given stream.

Definition at line 20 of file vgui_projection_inspector.cxx.

vnl_double_4x4 vgui_projection_inspector::total_transformation (  )  const [inline]

Returns projection matrix multiplied by modelview matrix.

Definition at line 41 of file vgui_projection_inspector.h.

void vgui_projection_inspector::window_to_image_coordinates ( int  ,
int  ,
float &  ,
float &   
) 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::image_to_window_coordinates ( float  ,
float  ,
float &  ,
float &   
) const

Convert image coords to window coords.

Definition at line 216 of file vgui_projection_inspector.cxx.

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 259 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 239 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 86 of file vgui_projection_inspector.h.

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 91 of file vgui_projection_inspector.h.

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_vector< double > const &  x,
vnl_double_4 const &  p 
) const

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

x can be a 2 or 3-vcl_vector. The returned vcl_vector has size 1+x.size().

Definition at line 85 of file vgui_projection_inspector.cxx.

void vgui_projection_inspector::inspect (  )  [private]

Definition at line 130 of file vgui_projection_inspector.cxx.


Member Data Documentation

bool vgui_projection_inspector::diagonal_scale_3d

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 54 of file vgui_projection_inspector.h.

float vgui_projection_inspector::x1

Definition at line 57 of file vgui_projection_inspector.h.

float vgui_projection_inspector::y1

Definition at line 59 of file vgui_projection_inspector.h.

float vgui_projection_inspector::x2

Definition at line 61 of file vgui_projection_inspector.h.

float vgui_projection_inspector::y2

Definition at line 63 of file vgui_projection_inspector.h.

float vgui_projection_inspector::s[3]

Definition at line 65 of file vgui_projection_inspector.h.

float vgui_projection_inspector::t[3]

Definition at line 65 of file vgui_projection_inspector.h.

int vgui_projection_inspector::vp[4] [private]

Definition at line 111 of file vgui_projection_inspector.h.

vnl_double_4x4 vgui_projection_inspector::P [private]

Definition at line 112 of file vgui_projection_inspector.h.

vnl_double_4x4 vgui_projection_inspector::M [private]

Definition at line 113 of file vgui_projection_inspector.h.


The documentation for this class was generated from the following files:
Generated on Mon Nov 23 05:12:06 2009 for core/vgui by  doxygen 1.5.1