Small Change of the Trackball apply interface. It does no more require a bool to specify if the trackball icon has to be drawn because it is always wrong to draw the trackball at the apply time (two reasons, antialiasing and transparency and zbuffer preservation) So now the standard call is just Apply() without the useless bool parameters.

Updated also all the vcg samples using the trackball
This commit is contained in:
Paolo Cignoni 2013-01-28 15:15:14 +00:00
parent a6f71e32dd
commit 794f2f27a7
8 changed files with 17 additions and 27 deletions

View File

@ -21,12 +21,12 @@
* *
****************************************************************************/
/**
* Minimal trimesh viewer made with AntTweakBar and freglut
*
* This sample shows how to use togheter:
* - the trimesh loading and initialization
* - basic usage of the default manipulators (the "Trackball")
/**
* Minimal trimesh viewer made with AntTweakBar and freglut
*
* This sample shows how to use togheter:
* - the trimesh loading and initialization
* - basic usage of the default manipulators (the "Trackball")
*/
@ -120,7 +120,7 @@ void Display(){
track.center=vcg::Point3f(0, 0, 0);
track.radius= 1;
track.GetView();
track.Apply(false);
track.Apply();
glPushMatrix();
float d=1.0f/mesh.bbox.Diag();
vcg::glScale(d);

View File

@ -128,7 +128,7 @@ void GLWidget::paintGL ()
track.radius= 1;
track.GetView();
glPushMatrix();
track.Apply(false);
track.Apply();
glPushMatrix();
if(mesh.vert.size()>0)
{

View File

@ -271,7 +271,7 @@ void ViewDisplay (void)
if(Q==&QL) DrawLightVector();
QL.GetView();
QV.GetView();
QV.Apply(false);
QV.Apply();
if(ShowDirFlag) DrawViewVector();
float d = 2.0/m.bbox.Diag();

View File

@ -203,7 +203,7 @@ void display(){
glTranslate( -observerPos );
track.GetView();
track.Apply(false);
track.Apply();
glPushMatrix();
float d=mesh.bbox.Diag();
glScale(1.5f/d);

View File

@ -150,7 +150,7 @@ void display(){
track.radius= 1;
track.GetView();
track.Apply(false);
track.Apply();
glPushMatrix();
float d=1.0f/mesh.bbox.Diag();
glScale(d);

View File

@ -67,7 +67,7 @@ void ActiveCoordinateFrame::Render(QGLWidget* glw)
manipulator->radius=size;
manipulator->center=position;
manipulator->GetView();
manipulator->Apply(false);
manipulator->Apply();
MovableCoordinateFrame::Render(glw);

View File

@ -112,14 +112,6 @@ void Trackball::Apply () {
glTranslate (-center);
}
void Trackball::Apply(bool ToDraw) {
Apply();
if(ToDraw){
DrawPostApply();
}
}
void Trackball::ApplyInverse() {
glTranslate(center);
glMultMatrix(track.InverseMatrix());

View File

@ -248,18 +248,15 @@ public:
@brief Initialize the camera instance.
*/
void GetView();
/*!
@brief Apply the current transformation on the OpenGL modelview matrix.
@param Draw true if has to call DrawPostApply() after the application.
*/
void Apply(bool Draw);
/*!
@brief Old application of the transformation.
@brief Application of the transformation.
@warning This function does \b not draw anything. You have to call DrawPostApply() after drawing everything.
@warning This function does \b not call DrawPostApply() after the application.
*/
void Apply ();
/*!
@brief Draw the current manipulator.
@ -269,6 +266,7 @@ public:
@warning This function assumes that the OpenGL modelview matrix has been initialized with Apply ().
*/
void DrawPostApply();
/*!
@brief Apply the \b inverse of current transformation on the OpenGL modelview matrix.
*/