29 Seg_t(
Int_t i1=-1,
Int_t i2=-1) : fV1(i1), fV2(i2) {}
32 typedef std::list<Seg_t> LSeg_t;
33 typedef std::list<Seg_t>::iterator LSegIt_t;
111 if (
fBuff == 0)
return;
126 return v0 != v2 && v0 != v3;
138 for (
Int_t i = 0; i < buffN; ++i)
141 projection->
ProjectPoint(pnts[i].fX, pnts[i].fY, pnts[i].fZ, 0,
191 if (pp.size() <= 2)
return 0;
193 Float_t bbox[4] = { 1e6, -1e6, 1e6, -1e6 };
194 for (std::list<Int_t>::iterator u = pp.begin(); u != pp.end(); ++u)
204 if ((bbox[1]-bbox[0]) < eps || (bbox[3]-bbox[2]) < eps)
return 0;
207 for (
vpPolygon_i poi = pols.begin(); poi != pols.end(); ++poi)
217 if (++start_idx >= refP.
fNPnts) start_idx = 0;
221 std::list<Int_t>::iterator u = ++pp.begin();
222 Int_t pidx = start_idx;
223 while (u != pp.end())
225 if ((*u) != refP.
fPnts[pidx])
228 if (++pidx >= refP.
fNPnts) pidx = 0;
230 if (u == pp.end())
return 0;
234 std::list<Int_t>::iterator u = --pp.end();
235 Int_t pidx = start_idx;
236 while (u != pp.begin())
238 if ((*u) != refP.
fPnts[pidx])
241 if (++pidx >= refP.
fNPnts) pidx = 0;
243 if (u == pp.begin())
return 0;
249 for (std::list<Int_t>::iterator u = pp.begin(); u != pp.end(); ++u)
256 pols.back().fNPnts = pp.size();
257 pols.back().fPnts = &pv[0];
259 return (bbox[1]-bbox[0]) * (bbox[3]-bbox[2]);
274 Int_t *seg = &bpols[2];
290 for (
UInt_t s = 1; s < segN; ++s)
293 for (LSegIt_t it = segs.begin(); it != segs.end(); ++it)
295 Int_t mv1 = idxMap[(*it).fV1];
296 Int_t mv2 = idxMap[(*it).fV2];
303 if (tail != pp.back()) pp.push_back(tail);
304 tail = (mv1 == tail) ? mv2 : mv1;
310 if (pp.front() == pp.back()) pp.pop_front();
338 if (vor1 == vor2)
continue;
340 for (it = segs.begin(); it != segs.end(); ++it)
342 Int_t vv1 = (*it).fV1;
343 Int_t vv2 = (*it).fV2;
344 if((vv1 == vor1 && vv2 == vor2) || (vv1 == vor2 && vv2 == vor1))
351 segs.push_back(Seg_t(vor1, vor2));
354 while ( ! segs.empty())
357 pp.push_back(segs.front().fV1);
358 Int_t tail = segs.front().fV2;
361 while (match && ! segs.empty())
363 for (LSegIt_t k = segs.begin(); k != segs.end(); ++k)
365 Int_t cv1 = (*k).fV1;
366 Int_t cv2 = (*k).fV2;
367 if (cv1 == tail || cv2 == tail)
370 tail = (cv1 == tail) ? cv2 : cv1;
380 if (tail == pp.front())
442 for (
Int_t i = 0; i < nPnts - 1; ++i)
456 printf(
"TEvePolygonSetProjected %d polygons\n", (
Int_t)
fPols.size());
460 Int_t nPnts = (*i).fNPnts;
461 printf(
"Points of polygon %d [Np = %d]:\n", ++cnt, nPnts);
462 for (
Int_t vi = 0; vi<nPnts; ++vi) {
480 printf(
"%d polygon of %d has %d segments \n",
pi,
fBuff->
NbPols(), segN);
482 Int_t* seg = &bpols[2];
487 printf(
"(%d, %d) \n", a1, a2);
488 printf(
"ORIG points :(%f, %f, %f) (%f, %f, %f)\n",
Int_t FindPoint(Int_t pi)
Abstract base-class for 2D/3D shapes.
std::list< Polygon_t > vpPolygon_t
TEvePolygonSetProjected(const TEvePolygonSetProjected &)
void Set(const Float_t *v)
virtual void SetProjection(TEveProjectionManager *mng, TEveProjectable *model)
Sets projection manager and reference in the projectable object.
virtual Bool_t AcceptSegment(TEveVector &, TEveVector &, Float_t) const
virtual void ComputeBBox()
Override of virtual method from TAttBBox.
Float_t AddPolygon(std::list< Int_t, std::allocator< Int_t > > &pp, std::list< Polygon_t, std::allocator< Polygon_t > > &p)
Check if polygon has dimensions above TEveProjection::fgEps and add it to a list if it is not a dupli...
void DumpBuffer3D()
Dump information about currently projected buffer.
void BBoxCheckPoint(Float_t x, Float_t y, Float_t z)
virtual void ProjectPoint(Float_t &x, Float_t &y, Float_t &z, Float_t d, EPProc_e p=kPP_Full)=0
A set of projected polygons.
Base-class for non-linear projections.
Manager class for steering of projections and managing projected objects.
Abstract base-class for non-linear projectable objects.
Float_t MakePolygonsFromBP(Int_t *idxMap)
Build polygons from list of buffer polygons.
virtual void DumpPolys() const
Dump information about built polygons.
virtual void SetProjection(TEveProjectionManager *mng, TEveProjectable *model)
This is virtual method from base-class TEveProjected.
TEveProjectionManager * fManager
void BBoxZero(Float_t epsilon=0, Float_t x=0, Float_t y=0, Float_t z=0)
Create cube of volume (2*epsilon)^3 at (x,y,z).
Float_t MakePolygonsFromBS(Int_t *idxMap)
Build polygons from the set of buffer segments.
EGeoMode_e GetGeoMode() const
TEveProjection * GetProjection()
Int_t * ProjectAndReducePoints()
Project and reduce buffer points.
vpPolygon_t::const_iterator vpPolygon_ci
virtual void CopyVizParams(const TEveElement *el)
Copy visualization parameters from element el.
void ProjectBuffer3D()
Project current buffer.
virtual void SetDepthLocal(Float_t d)
Set depth (z-coordinate) of the projected points.
void SetDepthCommon(Float_t d, TEveElement *el, Float_t *bbox)
Utility function to update the z-values of the bounding-box.
Wrapper for TGeoShape with absolute positioning and color attributes allowing display of extracted TG...
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
virtual ~TEvePolygonSetProjected()
Destructor.
vpPolygon_t::iterator vpPolygon_i
virtual TBuffer3D * MakeBuffer3D()
Create a TBuffer3D suitable for presentation of the shape.
Float_t PolygonSurfaceXY(const Polygon_t &poly) const
Calculate XY surface of a polygon.
virtual void UpdateProjection()
This is virtual method from base-class TEveProjected.
void BBoxInit(Float_t infinity=1e6)
Dynamic Float_t[6] X(min,max), Y(min,max), Z(min,max)
Bool_t IsFirstIdxHead(Int_t s0, Int_t s1)
Compare the two segments and check if the first index of first segment is starting.