#include "TEveLine.h"
#include "TEveProjectionManager.h"
ClassImp(TEveLine);
Bool_t TEveLine::fgDefaultSmooth = kFALSE;
TEveLine::TEveLine(Int_t n_points, ETreeVarType_e tv_type) :
TEvePointSet("Line", n_points, tv_type),
fRnrLine (kTRUE),
fRnrPoints (kFALSE),
fSmooth (fgDefaultSmooth)
{
fMainColorPtr = &fLineColor;
}
TEveLine::TEveLine(const Text_t* name, Int_t n_points, ETreeVarType_e tv_type) :
TEvePointSet(name, n_points, tv_type),
fRnrLine (kTRUE),
fRnrPoints (kFALSE),
fSmooth (fgDefaultSmooth)
{
fMainColorPtr = &fLineColor;
}
void TEveLine::CopyVizParams(const TEveElement* el)
{
const TEveLine* m = dynamic_cast<const TEveLine*>(el);
if (m)
{
TAttLine::operator=(*m);
fRnrLine = m->fRnrLine;
fRnrPoints = m->fRnrPoints;
fSmooth = m->fSmooth;
}
TEvePointSet::CopyVizParams(el);
}
void TEveLine::WriteVizParams(ostream& out, const TString& var)
{
TEvePointSet::WriteVizParams(out, var);
TString t = " " + var + "->";
TAttLine::SaveLineAttributes(out, var);
out << t << "SetRnrLine(" << fRnrLine << ");\n";
out << t << "SetRnrPoints(" << fRnrPoints << ");\n";
out << t << "SetSmooth(" << fSmooth << ");\n";
}
TClass* TEveLine::ProjectedClass() const
{
return TEveLineProjected::Class();
}
ClassImp(TEveLineProjected);
TEveLineProjected::TEveLineProjected() :
TEveLine (),
TEveProjected ()
{
}
void TEveLineProjected::SetProjection(TEveProjectionManager* mng,
TEveProjectable* model)
{
TEveProjected::SetProjection(mng, model);
* (TAttMarker*)this = * dynamic_cast<TAttMarker*>(fProjectable);
* (TAttLine*) this = * dynamic_cast<TAttLine*> (fProjectable);
}
void TEveLineProjected::SetDepth(Float_t d)
{
SetDepthCommon(d, this, fBBox);
Int_t n = Size();
Float_t *p = GetP();
for (Int_t i = 0; i < n; ++i, p+=3)
p[2] = fDepth;
}
void TEveLineProjected::UpdateProjection()
{
TEveProjection& proj = * fManager->GetProjection();
TEveLine & als = * dynamic_cast<TEveLine*>(fProjectable);
Int_t n = als.Size();
Reset(n);
fLastPoint = n - 1;
Float_t *o = als.GetP(), *p = GetP();
for (Int_t i = 0; i < n; ++i, o+=3, p+=3)
{
p[0] = o[0]; p[1] = o[1]; p[2] = o[2];
proj.ProjectPoint(p[0], p[1], p[2]);
p[2] = fDepth;
}
}
Last change: Wed Jun 25 08:37:19 2008
Last generated: 2008-06-25 08:37
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.