Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
17Wrapper class for GLU quadric shape drawing object. Lazy creation of
18internal GLU raw quadric on first call to TGLQuadric::Get()
19*/
20
22
23////////////////////////////////////////////////////////////////////////////////
24/// Construct quadric
25
27 fQuad(nullptr)
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
44GLUquadric * 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}
#define GLU_OUTSIDE
Definition GL_glu.h:203
#define GLU_SMOOTH
Definition GL_glu.h:198
#define ClassImp(name)
Definition Rtypes.h:382
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Definition TError.cxx:185
Wrapper class for GLU quadric shape drawing object.
Definition TGLQuadric.h:28
TGLQuadric()
Construct quadric.
GLUquadric * Get()
Get the internal raw GLU quadric object. Created on first call.
virtual ~TGLQuadric()
Destroy quadric.
GLUquadric * fQuad
Definition TGLQuadric.h:30