#include "TGLSphere.h"
#include "TGLRnrCtx.h"
#include "TGLQuadric.h"
#include "TGLIncludes.h"
#include "TBuffer3D.h"
#include "TBuffer3DTypes.h"
#include "TClass.h"
#include "TError.h"
ClassImp(TGLSphere);
TGLSphere::TGLSphere(const TBuffer3DSphere &buffer) :
TGLLogicalShape(buffer)
{
fDLSize = 14;
fRadius = buffer.fRadiusOuter;
}
UInt_t TGLSphere::DLOffset(Short_t lod) const
{
UInt_t off = 0;
if (lod >= 100) off = 0;
else if (lod < 10) off = lod / 2;
else off = lod / 10 + 4;
return off;
}
Short_t TGLSphere::QuantizeShapeLOD(Short_t shapeLOD, Short_t combiLOD) const
{
Int_t lod = ((Int_t)shapeLOD * (Int_t)combiLOD) / 100;
if (lod >= 100)
{
lod = 100;
}
else if (lod > 10)
{
Double_t quant = 0.1 * ((static_cast<Double_t>(lod)) + 0.5);
lod = 10 * static_cast<Int_t>(quant);
}
else
{
Double_t quant = 0.5 * ((static_cast<Double_t>(lod)) + 0.5);
lod = 2 * static_cast<Int_t>(quant);
}
return static_cast<Short_t>(lod);
}
void TGLSphere::DirectDraw(TGLRnrCtx & rnrCtx) const
{
if (gDebug > 4) {
Info("TGLSphere::DirectDraw", "this %d (class %s) LOD %d", this, IsA()->GetName(), rnrCtx.ShapeLOD());
}
UInt_t divisions = rnrCtx.ShapeLOD();
if (divisions < 4) {
divisions = 4;
}
gluSphere(rnrCtx.GetGluQuadric(), fRadius, divisions, divisions);
}
Last change: Tue Nov 18 08:46:34 2008
Last generated: 2008-11-18 08:46
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.