ROOT
v6-32
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
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(nullptr)
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
}
GLU_OUTSIDE
#define GLU_OUTSIDE
Definition
GL_glu.h:203
GLU_SMOOTH
#define GLU_SMOOTH
Definition
GL_glu.h:198
ClassImp
#define ClassImp(name)
Definition
Rtypes.h:377
TError.h
Error
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Definition
TError.cxx:185
TGLQuadric.h
TGLQuadric
Wrapper class for GLU quadric shape drawing object.
Definition
TGLQuadric.h:28
TGLQuadric::TGLQuadric
TGLQuadric()
Construct quadric.
Definition
TGLQuadric.cxx:26
TGLQuadric::Get
GLUquadric * Get()
Get the internal raw GLU quadric object. Created on first call.
Definition
TGLQuadric.cxx:44
TGLQuadric::~TGLQuadric
virtual ~TGLQuadric()
Destroy quadric.
Definition
TGLQuadric.cxx:34
TGLQuadric::fQuad
GLUquadric * fQuad
Definition
TGLQuadric.h:30
unsigned int
graf3d
gl
src
TGLQuadric.cxx
ROOT v6-32 - Reference Guide Generated on Fri Nov 1 2024 15:07:50 (GVA Time) using Doxygen 1.9.8