ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TGLQuadric.cxx
Go to the documentation of this file.
1 // @(#)root/gl:$Id$
2 
3 /*************************************************************************
4  * Copyright (C) 1995-2005, Rene Brun and Fons Rademakers. *
5  * All rights reserved. *
6  * *
7  * For the licensing terms see $ROOTSYS/LICENSE. *
8  * For the list of contributors see $ROOTSYS/README/CREDITS. *
9  *************************************************************************/
10 
11 #include "TGLQuadric.h"
12 #include "TGLIncludes.h"
13 #include "TError.h"
14 
15 /** \class TGLQuadric
16 \ingroup opengl
17 Wrapper class for GLU quadric shape drawing object. Lazy creation of
18 internal GLU raw quadric on first call to TGLQuadric::Get()
19 */
20 
22 
23 ////////////////////////////////////////////////////////////////////////////////
24 /// Construct quadric
25 
27  fQuad(0)
28 {
29 }
30 
31 ////////////////////////////////////////////////////////////////////////////////
32 /// Destroy quadric
33 
35 {
36  if (fQuad) {
37  gluDeleteQuadric(fQuad);
38  }
39 }
40 
41 ////////////////////////////////////////////////////////////////////////////////
42 /// Get the internal raw GLU quadric object. Created on first call.
43 
44 GLUquadric * TGLQuadric::Get()
45 {
46  if (!fQuad) {
47  fQuad = gluNewQuadric();
48  if (!fQuad) {
49  Error("TGLQuadric::Get", "create failed");
50  } else {
51  gluQuadricOrientation(fQuad, (GLenum)GLU_OUTSIDE);
52  gluQuadricNormals(fQuad, (GLenum)GLU_SMOOTH);
53  }
54  }
55  return fQuad;
56 }
virtual ~TGLQuadric()
Destroy quadric.
Definition: TGLQuadric.cxx:34
GLUquadric * Get()
Get the internal raw GLU quadric object. Created on first call.
Definition: TGLQuadric.cxx:44
Wrapper class for GLU quadric shape drawing object.
Definition: TGLQuadric.h:29
ClassImp(TGLQuadric) TGLQuadric
Construct quadric.
Definition: TGLQuadric.cxx:21
void Error(const char *location, const char *msgfmt,...)
GLUquadric * fQuad
Definition: TGLQuadric.h:32