ROOT
6.14/05
Reference Guide
graf3d
gl
src
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
21
ClassImp
(
TGLQuadric
);
22
23
////////////////////////////////////////////////////////////////////////////////
24
/// Construct quadric
25
26
TGLQuadric::TGLQuadric
() :
27
fQuad(0)
28
{
29
}
30
31
////////////////////////////////////////////////////////////////////////////////
32
/// Destroy quadric
33
34
TGLQuadric::~TGLQuadric
()
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
}
TGLQuadric::~TGLQuadric
virtual ~TGLQuadric()
Destroy quadric.
Definition:
TGLQuadric.cxx:34
TGLQuadric::Get
GLUquadric * Get()
Get the internal raw GLU quadric object. Created on first call.
Definition:
TGLQuadric.cxx:44
TGLQuadric
Wrapper class for GLU quadric shape drawing object.
Definition:
TGLQuadric.h:27
Error
void Error(const char *location, const char *msgfmt,...)
TGLIncludes.h
TError.h
TGLQuadric.h
TGLQuadric::TGLQuadric
TGLQuadric()
Construct quadric.
Definition:
TGLQuadric.cxx:26
ClassImp
#define ClassImp(name)
Definition:
Rtypes.h:359
TGLQuadric::fQuad
GLUquadric * fQuad
Definition:
TGLQuadric.h:30