#include "TEveFrameBox.h"
#include "TColor.h"
ClassImp(TEveFrameBox);
TEveFrameBox::TEveFrameBox() :
fFrameType (kFT_None),
fFrameSize (0),
fFramePoints (0),
fFrameWidth (1),
fFrameColor (1),
fBackColor (0),
fFrameFill (kFALSE),
fDrawBack (kFALSE)
{
fFrameRGBA[0] = fFrameRGBA[1] = fFrameRGBA[2] = 0; fFrameRGBA[3] = 255;
fBackRGBA [0] = fBackRGBA [1] = fBackRGBA [2] = 255; fBackRGBA [3] = 255;
}
TEveFrameBox::~TEveFrameBox()
{
delete [] fFramePoints;
}
void TEveFrameBox::SetAAQuadXY(Float_t x, Float_t y, Float_t z,
Float_t dx, Float_t dy)
{
fFrameType = kFT_Quad;
fFrameSize = 12;
delete [] fFramePoints;
fFramePoints = new Float_t [fFrameSize];
Float_t* p = fFramePoints;
p[0] = x; p[1] = y; p[2] = z; p += 3;
p[0] = x+dx; p[1] = y; p[2] = z; p += 3;
p[0] = x+dx; p[1] = y+dy; p[2] = z; p += 3;
p[0] = x ; p[1] = y+dy; p[2] = z; p += 3;
}
void TEveFrameBox::SetAAQuadXZ(Float_t x, Float_t y, Float_t z,
Float_t dx, Float_t dz)
{
fFrameType = kFT_Quad;
fFrameSize = 12;
delete [] fFramePoints;
fFramePoints = new Float_t [fFrameSize];
Float_t* p = fFramePoints;
p[0] = x; p[1] = y; p[2] = z; p += 3;
p[0] = x+dx; p[1] = y; p[2] = z; p += 3;
p[0] = x+dx; p[1] = y; p[2] = z+dz; p += 3;
p[0] = x ; p[1] = y; p[2] = z+dz; p += 3;
}
void TEveFrameBox::SetQuadByPoints(const Float_t* pointArr, Int_t nPoints)
{
fFrameType = kFT_Quad;
fFrameSize = 3*nPoints;
delete [] fFramePoints;
fFramePoints = new Float_t [fFrameSize];
memcpy(fFramePoints, pointArr, fFrameSize*sizeof(Float_t));
}
void TEveFrameBox::SetAABox(Float_t x, Float_t y, Float_t z,
Float_t dx, Float_t dy, Float_t dz)
{
fFrameType = kFT_Box;
fFrameSize = 24;
delete [] fFramePoints;
fFramePoints = new Float_t [fFrameSize];
Float_t* p = fFramePoints;
p[0] = x; p[1] = y + dy; p[2] = z; p += 3;
p[0] = x + dx; p[1] = y + dy; p[2] = z; p += 3;
p[0] = x + dx; p[1] = y; p[2] = z; p += 3;
p[0] = x; p[1] = y; p[2] = z; p += 3;
p[0] = x; p[1] = y + dy; p[2] = z + dz; p += 3;
p[0] = x + dx; p[1] = y + dy; p[2] = z + dz; p += 3;
p[0] = x + dx; p[1] = y; p[2] = z + dz; p += 3;
p[0] = x; p[1] = y; p[2] = z + dz;
}
void TEveFrameBox::SetAABoxCenterHalfSize(Float_t x, Float_t y, Float_t z,
Float_t dx, Float_t dy, Float_t dz)
{
fFrameType = kFT_Box;
fFrameSize = 24;
delete [] fFramePoints;
fFramePoints = new Float_t [fFrameSize];
Float_t* p = fFramePoints;
p[0] = x - dx; p[1] = y + dy; p[2] = z - dz; p += 3;
p[0] = x + dx; p[1] = y + dy; p[2] = z - dz; p += 3;
p[0] = x + dx; p[1] = y - dy; p[2] = z - dz; p += 3;
p[0] = x - dx; p[1] = y - dy; p[2] = z - dz; p += 3;
p[0] = x - dx; p[1] = y + dy; p[2] = z + dz; p += 3;
p[0] = x + dx; p[1] = y + dy; p[2] = z + dz; p += 3;
p[0] = x + dx; p[1] = y - dy; p[2] = z + dz; p += 3;
p[0] = x - dx; p[1] = y - dy; p[2] = z + dz;
}
void TEveFrameBox::SetFrameColor(Color_t ci)
{
fFrameColor = ci;
TEveUtil::ColorFromIdx(ci, fFrameRGBA, kTRUE);
}
void TEveFrameBox::SetFrameColorPixel(Pixel_t pix)
{
SetFrameColor(Color_t(TColor::GetColor(pix)));
}
void TEveFrameBox::SetFrameColorRGBA(UChar_t r, UChar_t g, UChar_t b, UChar_t a)
{
fFrameColor = Color_t(TColor::GetColor(r, g, b));
fFrameRGBA[0] = r;
fFrameRGBA[1] = g;
fFrameRGBA[2] = b;
fFrameRGBA[3] = a;
}
void TEveFrameBox::SetBackColor(Color_t ci)
{
fBackColor = ci;
TEveUtil::ColorFromIdx(ci, fBackRGBA, kTRUE);
}
void TEveFrameBox::SetBackColorPixel(Pixel_t pix)
{
SetBackColor(Color_t(TColor::GetColor(pix)));
}
void TEveFrameBox::SetBackColorRGBA(UChar_t r, UChar_t g, UChar_t b, UChar_t a)
{
fBackColor = Color_t(TColor::GetColor(r, g, b));
fBackRGBA[0] = r;
fBackRGBA[1] = g;
fBackRGBA[2] = b;
fBackRGBA[3] = a;
}
Last change: Tue Aug 26 17:15:05 2008
Last generated: 2008-08-26 17:15
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.