33 TEveBox::TEveBox(
const char* n,
const char* t) :
48 void TEveBox::SetVertex(Int_t i, Float_t x, Float_t y, Float_t z)
59 void TEveBox::SetVertex(Int_t i,
const Float_t* v)
61 fVertices[i][0] = v[0];
62 fVertices[i][1] = v[1];
63 fVertices[i][2] = v[2];
70 void TEveBox::SetVertices(
const Float_t* vs)
72 memcpy(fVertices, vs,
sizeof(fVertices));
80 void TEveBox::ComputeBBox()
82 TEveShape::CheckAndFixBoxOrientationFv(fVertices);
85 for (Int_t i=0; i<8; ++i)
87 BBoxCheckPoint(fVertices[i]);
94 TClass* TEveBox::ProjectedClass(
const TEveProjection*)
const
96 return TEveBoxProjected::Class();
105 ClassImp(TEveBoxProjected);
107 Bool_t TEveBoxProjected::fgDebugCornerPoints = kFALSE;
112 TEveBoxProjected::TEveBoxProjected(
const char* n,
const char* t) :
121 TEveBoxProjected::~TEveBoxProjected()
128 void TEveBoxProjected::ComputeBBox()
131 for (vVector2_i i = fPoints.begin(); i != fPoints.end(); ++i)
133 BBoxCheckPoint(i->fX, i->fY, fDepth);
140 void TEveBoxProjected::SetDepthLocal(Float_t d)
142 SetDepthCommon(d,
this, fBBox);
148 void TEveBoxProjected::SetProjection(TEveProjectionManager* mng, TEveProjectable* model)
150 TEveProjected::SetProjection(mng, model);
151 CopyVizParams(dynamic_cast<TEveElement*>(model));
161 void TEveBoxProjected::UpdateProjection()
163 TEveBox *box =
dynamic_cast<TEveBox*
>(fProjectable);
165 fDebugPoints.clear();
170 TEveProjection *projection = fManager->GetProjection();
171 TEveTrans *trans = box->PtrMainTrans(kFALSE);
174 for (Int_t i = 0; i < 8; ++i)
176 projection->ProjectPointfv(trans, box->GetVertex(i), pbuf, fDepth);
177 vVector2_t& ppv = pp[projection->SubSpaceId(pbuf)];
180 Bool_t overlap = kFALSE;
181 for (vVector2_i j = ppv.begin(); j != ppv.end(); ++j)
183 if (p.SquareDistance(*j) < TEveProjection::fgEpsSqr)
192 if (fgDebugCornerPoints)
193 fDebugPoints.push_back(p);
201 if ( ! pp[0].empty())
203 FindConvexHull(pp[0], fPoints,
this);
205 if ( ! pp[1].empty())
207 fBreakIdx = fPoints.size();
208 FindConvexHull(pp[1], fPoints,
this);
215 Bool_t TEveBoxProjected::GetDebugCornerPoints()
217 return fgDebugCornerPoints;
225 void TEveBoxProjected::SetDebugCornerPoints(Bool_t d)
227 fgDebugCornerPoints = d;