Classes | Functions | Variables
vcg::trackutils Namespace Reference

This namespace contains some support functions used by TrackMode subclassess. More...

Classes

class  DrawingHint
 Drawing hints for manipulators. More...

Functions

void DrawCircle (bool planehandle=true)
 Draw a circle with 2 squares, used by DrawSphereIcon().
void DrawPlaneHandle ()
 Draw 2 squares, used by DrawCircle().
void DrawSphereIcon (Trackball *tb, bool active, bool planeshandle=false)
 Draw a spherical manipulator icon.
void DrawUglyAreaMode (Trackball *tb, const std::vector< Point3f > &points, Point3f status, Point3f old_status, Plane3f plane, const std::vector< Point3f > &path, Point3f rubberband_handle)
 AreaMode drawing function, member of the DrawUgly series.
void DrawUglyAxisMode (Trackball *tb, Line3f axis)
 AxisMode drawing function, member of the DrawUgly series.
void DrawUglyCylinderMode (Trackball *tb, Line3f axis)
 CylinderMode drawing function, member of the DrawUgly series.
void DrawUglyLetter (Trackball *tb, std::vector< Point3f > ugly_letter)
 Support function for the DrawUgly series of functions.
void DrawUglyPanMode (Trackball *tb)
 PanMode drawing function, member of the DrawUgly series.
void DrawUglyPathMode (Trackball *tb, const std::vector< Point3f > &points, Point3f current_point, Point3f prev_point, Point3f next_point, Point3f old_hitpoint, bool wrap)
 PathMode drawing function, member of the DrawUgly series.
void DrawUglyPlaneMode (Trackball *tb, Plane3f plane)
 PlaneMode drawing function, member of the DrawUgly series.
void DrawUglyScaleMode (Trackball *tb)
 ScaleMode drawing function, member of the DrawUgly series.
void DrawUglyZMode (Trackball *tb)
 ZMode drawing function, member of the DrawUgly series.
float getDeltaY (Trackball *tb, Point3f new_point)
 Computes the verical component of an user mouse drag.
Plane3f GetViewPlane (const View< float > &camera, const Point3f &center)
 Compute the plane perpedicular to view dir and passing through the manipulator center.
bool HitHyper (Point3f center, float radius, Point3f viewpoint, Plane3f viewplane, Point3f hitOnViewplane, Point3f &hit)
 Project a window coordinate point on the rotational hyperboloid relative to the manipulator.
bool HitHyperOrtho (Point3f center, float radius, Point3f viewpoint, Plane3f viewplane, Point3f hitOnViewplane, Point3f &hit)
 HitHyperOrtho.
std::pair< Point3f, bool > HitNearestPointOnAxis (Trackball *tb, Line3f axis, Point3f point)
 Calculates the minimal distance between 2 segments.
std::pair< Point3f, bool > HitPlane (Trackball *tb, Point3f point, Plane3f plane)
 Project a window coordinate point on a plane.
Point3f HitSphere (Trackball *tb, const Point3f &p)
 Project a window coordinate point on the sphere relative to the manipulator.
Point3f HitViewPlane (Trackball *tb, const Point3f &p)
 Project a window coordinate point on the plane perpedicular to view dir and passing through the manipulator center.
template<class T >
bool IntersectionRayPlane (const Plane3< T > &pl, const Ray3< T > &ray, Point3< T > &po)
 Computes the intersection between a ray and a plane.
Ray3f line2ray (const Line3f &l)
 Convert a line to a normalized ray.
std::pair< float, bool > LineLineDistance (const Line3f &P, const Line3f &Q, Point3f &P_s, Point3f &Q_t)
 Calculates the minimal distance between 2 lines.
void prepare_attrib ()
 Support function for the DrawUgly series of functions.
Line3f ProjectLineOnPlane (const Line3f &ln, const Plane3f &pl)
 Project a line into a plane.
std::pair< float, bool > RayLineDistance (const Ray3f &R, const Line3f &Q, Point3f &R_s, Point3f &Q_t)
 Calculates the minimal distance between a ray and a line.
float signedDistance (Line3f line, Point3f pt, Point3f positive_dir)
 Computes a signed line-point distance.

Variables

DrawingHint DH
 the drawing hint used by the manipulators

Detailed Description

This namespace contains some support functions used by TrackMode subclassess.

Warning:
Many of these functions shouldn't be here and are supposed to be moved to some appropriate place by the library administrator.
The DrawUgly series of functions is a TEMPORARY solution, used while waiting for the DrawBeautiful series...

Function Documentation

void vcg::trackutils::DrawCircle ( bool  planehandle = true)

Draw a circle with 2 squares, used by DrawSphereIcon().

Definition at line 656 of file trackutils.h.

Draw 2 squares, used by DrawCircle().

Definition at line 630 of file trackutils.h.

void vcg::trackutils::DrawSphereIcon ( Trackball *  tb,
bool  active,
bool  planeshandle = false 
)

Draw a spherical manipulator icon.

Parameters:
tbthe manipulator.
activeboolean to be set to true if the icon is active.

Definition at line 676 of file trackutils.h.

void vcg::trackutils::DrawUglyAreaMode ( Trackball *  tb,
const std::vector< Point3f > &  points,
Point3f  status,
Point3f  old_status,
Plane3f  plane,
const std::vector< Point3f > &  path,
Point3f  rubberband_handle 
)

AreaMode drawing function, member of the DrawUgly series.

Draw an AreaMode manipulator in an ugly way.

Warning:
this method is part of the DrawUgly series of functions, which is a TEMPORARY solution, used while waiting for the DrawBeautiful series...
Parameters:
tbthe manipulator.
pointsAreaMode's points.
statusAreaMode's status.
old_statusAreaMode's old status.
planeAreaMode's plane.
pathAreaMode's path.
rubberband_handleAreaMode's rubberband handle.

Definition at line 1050 of file trackutils.h.

void vcg::trackutils::DrawUglyAxisMode ( Trackball *  tb,
Line3f  axis 
)

AxisMode drawing function, member of the DrawUgly series.

Draw an AxisMode manipulator in an ugly way.

Warning:
this method is part of the DrawUgly series of functions, which is a TEMPORARY solution, used while waiting for the DrawBeautiful series...
Parameters:
tbthe manipulator.
axisAxisMode's axis.

Definition at line 843 of file trackutils.h.

void vcg::trackutils::DrawUglyCylinderMode ( Trackball *  tb,
Line3f  axis 
)

CylinderMode drawing function, member of the DrawUgly series.

Draw a CylinderMode manipulator in an ugly way.

Warning:
this method is part of the DrawUgly series of functions, which is a TEMPORARY solution, used while waiting for the DrawBeautiful series...
Parameters:
tbthe manipulator.
axisCylinderMode's axis.

Definition at line 931 of file trackutils.h.

void vcg::trackutils::DrawUglyLetter ( Trackball *  tb,
std::vector< Point3f ugly_letter 
)

Support function for the DrawUgly series of functions.

Draw a coordinate vector, usually a letter, near the manipulator icon in a user readable oriantation.

Warning:
this method is part of the DrawUgly series of functions, which is a TEMPORARY solution, used while waiting for the DrawBeautiful series...
Parameters:
tbthe manipulator.
ugly_letterthe coordinate vector.

Definition at line 752 of file trackutils.h.

void vcg::trackutils::DrawUglyPanMode ( Trackball *  tb)

PanMode drawing function, member of the DrawUgly series.

Draw a PanMode manipulator in an ugly way.

Warning:
this method is part of the DrawUgly series of functions, which is a TEMPORARY solution, used while waiting for the DrawBeautiful series...
Parameters:
tbthe manipulator.

Definition at line 787 of file trackutils.h.

void vcg::trackutils::DrawUglyPathMode ( Trackball *  tb,
const std::vector< Point3f > &  points,
Point3f  current_point,
Point3f  prev_point,
Point3f  next_point,
Point3f  old_hitpoint,
bool  wrap 
)

PathMode drawing function, member of the DrawUgly series.

Draw a PathMode manipulator in an ugly way.

Warning:
this method is part of the DrawUgly series of functions, which is a TEMPORARY solution, used while waiting for the DrawBeautiful series...
Parameters:
tbthe manipulator.
pointsPathMode's points.
current_pointPathMode's current point.
prev_pointPathMode's prev point.
next_pointPathMode's next point.
old_hitpointPathMode's old hitpoint.
wrapPathMode's wrap.

Definition at line 996 of file trackutils.h.

void vcg::trackutils::DrawUglyPlaneMode ( Trackball *  tb,
Plane3f  plane 
)

PlaneMode drawing function, member of the DrawUgly series.

Draw a PlaneMode manipulator in an ugly way.

Warning:
this method is part of the DrawUgly series of functions, which is a TEMPORARY solution, used while waiting for the DrawBeautiful series...
Parameters:
tbthe manipulator.
planePlaneMode's plane.

Definition at line 875 of file trackutils.h.

void vcg::trackutils::DrawUglyScaleMode ( Trackball *  tb)

ScaleMode drawing function, member of the DrawUgly series.

Draw a ScaleMode manipulator in an ugly way.

Warning:
this method is part of the DrawUgly series of functions, which is a TEMPORARY solution, used while waiting for the DrawBeautiful series...
Parameters:
tbthe manipulator.

Definition at line 823 of file trackutils.h.

void vcg::trackutils::DrawUglyZMode ( Trackball *  tb)

ZMode drawing function, member of the DrawUgly series.

Draw a ZMode manipulator in an ugly way.

Warning:
this method is part of the DrawUgly series of functions, which is a TEMPORARY solution, used while waiting for the DrawBeautiful series...
Parameters:
tbthe manipulator.

Definition at line 806 of file trackutils.h.

float vcg::trackutils::getDeltaY ( Trackball *  tb,
Point3f  new_point 
)

Computes the verical component of an user mouse drag.

Parameters:
tbthe manipulator.
new_pointthe new mouse pointer coordinate.
Returns:
The verical component of the user mouse drag.

Definition at line 532 of file trackutils.h.

Plane3f vcg::trackutils::GetViewPlane ( const View< float > &  camera,
const Point3f center 
)

Compute the plane perpedicular to view dir and passing through the manipulator center.

Parameters:
camerathe camera of the manipulator.
centerthe center of the manipulator.
Returns:
the plane perpedicular to view dir and passing through the manipulator center.

Definition at line 57 of file trackutils.h.

bool vcg::trackutils::HitHyper ( Point3f  center,
float  radius,
Point3f  viewpoint,
Plane3f  viewplane,
Point3f  hitOnViewplane,
Point3f hit 
)

Project a window coordinate point on the rotational hyperboloid relative to the manipulator.


The original documentation (in italian) follows:

dato un punto in coordinate di schermo e.g. in pixel stile opengl
calcola il punto di intersezione tra la viewline  che passa per
viewpoint e per hitplane e l'iperboloide.
l'iperboloide si assume essere quello di rotazione attorno alla
retta viewpoint-center e di raggio rad
si assume come sistema di riferimento quello con l'origine
su center ecome x la retta center-viewpoint
eq linea
       hitplane.y
y = - ----------- * x + hitplane.y
      viewpoint.x
eq hiperboloide di raggio r (e.g. che passa per (r/sqrt2,r/sqrt2)
     1
y = --- * (r^2 /2.0)
     x
 hitplane.y
 ----------- * x^2 - hitplane.y *x + (r^2/2.0) == 0
 viewpoint.x
Parameters:
centerthe center of the manipulator.
radiusthe radius of the manipulator.
viewpointthe view point.
vpthe view plane.
hitplanethe projection of the window coordinate point on the view plane.
hitthe projection of hitplane on the rotational hyperboloid relative to the manipulator.
Returns:
true if and only if hit is valid.

Definition at line 135 of file trackutils.h.

bool vcg::trackutils::HitHyperOrtho ( Point3f  center,
float  radius,
Point3f  viewpoint,
Plane3f  viewplane,
Point3f  hitOnViewplane,
Point3f hit 
)

HitHyperOrtho.

Parameters:
center
radius
viewpoint
viewplane
hitOnViewplane
hit
Returns:
true if the hit is valid

Specialized version of the HitHyper(); in the simple ortho case, the hit point is just the value of y = 1/x * (r^2 /2 ) on the hitOnViewPlane

Definition at line 179 of file trackutils.h.

std::pair< Point3f,bool > vcg::trackutils::HitNearestPointOnAxis ( Trackball *  tb,
Line3f  axis,
Point3f  point 
)

Calculates the minimal distance between 2 segments.

R e Q are the segments, R_s and Q_t are set to be the closest points on the segments.

it's returned the distance from R_s and Q_t, and a boolean value which is true if the segments are parallel enough.

Parameters:
Rthe first segment.
Qthe second segment.
R_sthe point on R closest to Q.
Q_tthe point on Q closest to R.
Returns:
a std::pair made with the distance from R_s to Q_t and a boolean value, true if and only if P and Q are almost parallel.

Compute the point on a line closest to the ray projection of a window coordinate point.

Given a window coordinate point, computes a ray starting from the manipulator camera eye and passing through the point's projection on the viewplane, then uses RayLineDistance() to get the closest point to ray on a given line.

See also:
RayLineDistance(const Ray3f & R,const Line3f & Q,Point3f & R_s, Point3f & Q_t)
Parameters:
tbthe manipulator.
axisthe axis.
pointthe window coordinate point.
Returns:
a std::pair made with the point on axis closest to the ray projection of point and a boolean true if and only if the ray doesn't diverges respect to the axis.

Definition at line 479 of file trackutils.h.

std::pair< Point3f, bool > vcg::trackutils::HitPlane ( Trackball *  tb,
Point3f  point,
Plane3f  plane 
)

Project a window coordinate point on a plane.

Given a window coordinate point, computes a ray starting from the manipulator camera eye and passing through the point's projection on the viewplane, then uses IntersectionRayPlane() to get the ray intersection with a given plane.

See also:
IntersectionRayPlane()
Parameters:
tbthe manipulator.
pointthe window coordinate point.
planethe plane.
Returns:
a std::pair made with p's projection on the.plane and a boolean true if and only if the ray doesn't diverges respect to the plane.

Definition at line 573 of file trackutils.h.

Point3f vcg::trackutils::HitSphere ( Trackball *  tb,
const Point3f p 
)

Project a window coordinate point on the sphere relative to the manipulator.


The original documentation (in italian) follows:

dato un punto in coordinate di schermo e.g. in pixel stile opengl
restituisce un punto in coordinate di mondo sulla superficie
della trackball.
La superficie della trackball e' data da una sfera + una porzione
di iperboloide di rotazione.
Assumiamo la sfera di raggio unitario e centrata sull'origine e
di guardare lungo la y negativa.
                                    X   0   sqrt(1/2)  1
eq sfera:              y=sqrt(1-x*x);   1   sqrt(1/2)  0
eq iperboloide :       y=1/2*x;         inf  sqrt(1/2)  1/2
eq cono                y=x+sqrt(2);
Parameters:
tbthe manipulator.
pthe window coordinate point.
Returns:
the projection of p on the sphere relative to the manipulator.

Definition at line 221 of file trackutils.h.

Point3f vcg::trackutils::HitViewPlane ( Trackball *  tb,
const Point3f p 
)

Project a window coordinate point on the plane perpedicular to view dir and passing through the manipulator center.

Parameters:
tbthe manipulator.
pthe window coordinate point.
Returns:
p's projection on plane perpedicular to view dir and passing through the manipulator center.

Definition at line 87 of file trackutils.h.

template<class T >
bool vcg::trackutils::IntersectionRayPlane ( const Plane3< T > &  pl,
const Ray3< T > &  ray,
Point3< T > &  po 
) [inline]

Computes the intersection between a ray and a plane.

Parameters:
plthe plane.
raythe ray.
pothe intersection point.
Returns:
true if and only if there is intersection (po is valid).

Definition at line 547 of file trackutils.h.

Ray3f vcg::trackutils::line2ray ( const Line3f &  l)

Convert a line to a normalized ray.

Parameters:
lthe line to be converted.
Returns:
the normalized ray.

Definition at line 73 of file trackutils.h.

std::pair< float, bool > vcg::trackutils::LineLineDistance ( const Line3f &  P,
const Line3f &  Q,
Point3f P_s,
Point3f Q_t 
)

Calculates the minimal distance between 2 lines.

P and Q are the lines, P_s and Q_t are set to be the closest points on these lines.

it's returned the distance from P_s and Q_t, and a boolean value which is true if the lines are parallel enough.

if P and Q are parallel P_s and Q_t aren't set.

the formula is taken from pages 81-83 of "Eric Lengyel - Mathematics for 3D Game Programming & Computer Graphics"

Parameters:
Pthe first line.
Qthe second line.
P_sthe point on P closest to Q.
Q_tthe point on Q closest to P.
Returns:
a std::pair made with the distance from P_s to Q_t and a boolean value, true if and only if P and Q are almost parallel.

Definition at line 321 of file trackutils.h.

Support function for the DrawUgly series of functions.

Prepare the OpenGL attributes.

Warning:
this method is part of the DrawUgly series of functions, which is a TEMPORARY solution, used while waiting for the DrawBeautiful series...

Definition at line 731 of file trackutils.h.

Line3f vcg::trackutils::ProjectLineOnPlane ( const Line3f &  ln,
const Plane3f &  pl 
)

Project a line into a plane.

Given a line and a plane, returns the line projection on the plane.

The line returned is not normalized.

Parameters:
lnthe line.
plthe plane.
Returns:
the (non normalized) line projected.

Definition at line 500 of file trackutils.h.

std::pair< float, bool > vcg::trackutils::RayLineDistance ( const Ray3f &  R,
const Line3f &  Q,
Point3f R_s,
Point3f Q_t 
)

Calculates the minimal distance between a ray and a line.

R is the ray and Q is the line, R_s and Q_t are set to be the closest points on the ray and the line.

it's returned the distance from R_s and Q_t, and a boolean value which is true if the ray and the line are parallel enough.

if R and Q are parallel R_s and Q_t aren't set.

Parameters:
Rthe ray.
Qthe line.
R_sthe point on R closest to Q.
Q_tthe point on Q closest to R.
Returns:
a std::pair made with the distance from R_s to Q_t and a boolean value, true if and only if P and Q are almost parallel.

Definition at line 357 of file trackutils.h.

float vcg::trackutils::signedDistance ( Line3f  line,
Point3f  pt,
Point3f  positive_dir 
)

Computes a signed line-point distance.

Given a line, a point and a positivity direction, computes the signed distance between the line and the point.

Parameters:
linethe line.
ptthe point.
positive_dirthe positivity direction.
Returns:
the signed distance.

Definition at line 520 of file trackutils.h.


Variable Documentation

the drawing hint used by the manipulators

Definition at line 623 of file trackutils.h.



shape_reconstruction
Author(s): Roberto Martín-Martín
autogenerated on Sat Jun 8 2019 18:41:51