NOTE: We don't implement raw tesselation of sphere - hence this will not appear in viewers which don't support directly (non-OpenGL) Shows that viewers can at least deal gracefully with these cases
Our abstract base shape class.
#if defined(__CINT__) && !defined(__MAKECINT__)
{
}
#else
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
R__EXTERN TSystem * gSystem
virtual int CompileMacro(const char *filename, Option_t *opt="", const char *library_name="", const char *build_dir="", UInt_t dirmode=0)
This method compiles and loads a shared library containing the code from the file "filename".
#include <vector>
public:
protected:
};
class Sphere : public Shape {
public:
private:
};
: Shape(color,
x,
y, z), fRadius(
radius)
{
}
{
}
}
}
}
}
return buffer;
}
class Box : public Shape {
public:
private:
};
: Shape(color,
x,
y, z), fDX(
dX), fDY(
dY), fDZ(
dZ)
{
}
{
}
}
}
buffer.
fPnts[0] = fX - fDX;
buffer.
fPnts[1] = fY - fDY;
buffer.
fPnts[2] = fZ - fDZ;
buffer.
fPnts[3] = fX + fDX;
buffer.
fPnts[4] = fY - fDY;
buffer.
fPnts[5] = fZ - fDZ;
buffer.
fPnts[6] = fX + fDX;
buffer.
fPnts[7] = fY + fDY;
buffer.
fPnts[8] = fZ - fDZ;
buffer.
fPnts[9] = fX - fDX;
buffer.
fPnts[10] = fY + fDY;
buffer.
fPnts[11] = fZ - fDZ;
buffer.
fPnts[12] = fX - fDX;
buffer.
fPnts[13] = fY - fDY;
buffer.
fPnts[14] = fZ + fDZ;
buffer.
fPnts[15] = fX + fDX;
buffer.
fPnts[16] = fY - fDY;
buffer.
fPnts[17] = fZ + fDZ;
buffer.
fPnts[18] = fX + fDX;
buffer.
fPnts[19] = fY + fDY;
buffer.
fPnts[20] = fZ + fDZ;
buffer.
fPnts[21] = fX - fDX;
buffer.
fPnts[22] = fY + fDY;
buffer.
fPnts[23] = fZ + fDZ;
buffer.
fSegs[0] = fColor;
buffer.
fSegs[3] = fColor;
buffer.
fSegs[6] = fColor;
buffer.
fSegs[9] = fColor;
buffer.
fSegs[12] = fColor;
buffer.
fSegs[15] = fColor;
buffer.
fSegs[18] = fColor;
buffer.
fSegs[21] = fColor;
buffer.
fSegs[24] = fColor;
buffer.
fSegs[27] = fColor;
buffer.
fSegs[30] = fColor;
buffer.
fSegs[33] = fColor;
buffer.
fPols[0] = fColor;
buffer.
fPols[6] = fColor;
buffer.
fPols[12] = fColor;
buffer.
fPols[18] = fColor;
buffer.
fPols[24] = fColor;
buffer.
fPols[30] = fColor;
}
return buffer;
}
public:
private:
};
: Shape(color,
x,
y, z), fDX(
dX), fDY(
dY), fDZ(
dZ)
{
}
{
}
}
}
buffer.
fPnts[0] = fX - fDX;
buffer.
fPnts[1] = fY - fDY;
buffer.
fPnts[3] = fX + fDX;
buffer.
fPnts[4] = fY - fDY;
buffer.
fPnts[6] = fX + fDX;
buffer.
fPnts[7] = fY + fDY;
buffer.
fPnts[9] = fX - fDX;
buffer.
fPnts[10] = fY + fDY;
buffer.
fPnts[14] = fZ + fDZ;
buffer.
fSegs[0] = fColor;
buffer.
fSegs[3] = fColor;
buffer.
fSegs[6] = fColor;
buffer.
fSegs[9] = fColor;
buffer.
fSegs[12] = fColor;
buffer.
fSegs[15] = fColor;
buffer.
fSegs[18] = fColor;
buffer.
fSegs[21] = fColor;
buffer.
fPols[0] = fColor;
buffer.
fPols[6] = fColor;
buffer.
fPols[11] = fColor;
buffer.
fPols[16] = fColor;
buffer.
fPols[21] = fColor;
}
return buffer;
}
public:
private:
std::vector<Shape *> fShapes;
};
MyGeom::MyGeom()
{
aShape =
new Box(
kRed, 0.0, 0.0, 0.0, 20.0, 20.0, 20.0);
aShape =
new Box(
kBlue, 50.0, 100.0, 200.0, 5.0, 10.0, 15.0);
}
MyGeom::~MyGeom()
{
}
{
gPad->GetViewer3D(option);
}
{
std::vector<Shape *>::const_iterator
ShapeIt = fShapes.
begin();
Shape *shape;
}
}
}
{
printf(
"\n\nviewer3DLocal: This frame demonstates local frame use of 3D viewer architecture.\n");
printf(
"Creates sphere, two boxes and a square based pyramid, described in local frame.\n");
printf(
"We do not implement raw tesselation of sphere - hence will not appear in viewers\n");
printf(
"which do not support in natively (non-GL viewer).\n\n");
}
#define ClassDefOverride(name, id)
const_iterator begin() const
const_iterator end() const
Use this attribute class when an object should have 3D capabilities.
Sphere description class - see TBuffer3DTypes for producer classes Supports hollow and cut spheres.
Generic 3D primitive description class.
void SetLocalMasterIdentity()
Set kRaw tessellation section of buffer with supplied sizes.
Double_t fLocalMaster[16]
void ClearSectionsValid()
Clear any sections marked valid.
void SetSectionsValid(UInt_t mask)
void SetAABoundingBox(const Double_t origin[3], const Double_t halfLengths[3])
Set fBBVertex in kBoundingBox section to a axis aligned (local) BB using supplied origin and box half...
Bool_t SetRawSizes(UInt_t reqPnts, UInt_t reqPntsCapacity, UInt_t reqSegs, UInt_t reqSegsCapacity, UInt_t reqPols, UInt_t reqPolsCapacity)
Set kRaw tessellation section of buffer with supplied sizes.
Mother of all ROOT objects.
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
Abstract 3D shapes viewer.