// @(#)root/gl:$Id: TGLQuadric.cxx 20882 2007-11-19 11:31:26Z rdm $

/*************************************************************************
 * Copyright (C) 1995-2005, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#include "TGLQuadric.h"
#include "TGLIncludes.h"
#include "TError.h"

//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TGLOutput                                                            //
//                                                                      //
// Wrapper class for GLU quadric shape drawing object. Lazy creation of //
// internal GLU raw quadric on first call to TGLQuadric::Get()          //
//////////////////////////////////////////////////////////////////////////

ClassImp(TGLQuadric)

//______________________________________________________________________________
TGLQuadric::TGLQuadric() :
   fQuad(0)
{
   // Construct quadric
}

//______________________________________________________________________________
TGLQuadric::~TGLQuadric()
{
   // Destroy quadric
   if (fQuad) {
      gluDeleteQuadric(fQuad);
   }
}

//______________________________________________________________________________
GLUquadric * TGLQuadric::Get()
{
   // Get the internal raw GLU qaudric object. Created on first call.
   if (!fQuad) {
      fQuad = gluNewQuadric();
      if (!fQuad) {
         Error("TGLQuadric::Get", "create failed");
      } else {
         gluQuadricOrientation(fQuad, (GLenum)GLU_OUTSIDE);
         gluQuadricNormals(fQuad, (GLenum)GLU_SMOOTH);
      }
   }
   return fQuad;
}

Last change: Wed Jun 25 08:41:14 2008
Last generated: 2008-06-25 08:41

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.