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];
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);
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",
void BBoxCheckPoint(Float_t x, Float_t y, Float_t z)
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).
void BBoxInit(Float_t infinity=1e6)
Dynamic Float_t[6] X(min,max), Y(min,max), Z(min,max)
Wrapper for TGeoShape with absolute positioning and color attributes allowing display of extracted TG...
virtual TBuffer3D * MakeBuffer3D()
Create a TBuffer3D suitable for presentation of the shape.
A set of projected polygons.
virtual void ComputeBBox()
Override of virtual method from TAttBBox.
TEvePolygonSetProjected(const TEvePolygonSetProjected &)
virtual void SetDepthLocal(Float_t d)
Set depth (z-coordinate) of the projected points.
void DumpBuffer3D()
Dump information about currently projected buffer.
vpPolygon_t::iterator vpPolygon_i
vpPolygon_t::const_iterator vpPolygon_ci
Int_t * ProjectAndReducePoints()
Project and reduce buffer points.
Float_t MakePolygonsFromBS(Int_t *idxMap)
Build polygons from the set of buffer segments.
std::list< Polygon_t > vpPolygon_t
Float_t MakePolygonsFromBP(Int_t *idxMap)
Build polygons from list of buffer polygons.
Float_t PolygonSurfaceXY(const Polygon_t &poly) const
Calculate XY surface of a polygon.
virtual void SetProjection(TEveProjectionManager *mng, TEveProjectable *model)
This is virtual method from base-class TEveProjected.
void ProjectBuffer3D()
Project current buffer.
virtual void UpdateProjection()
This is virtual method from base-class TEveProjected.
virtual ~TEvePolygonSetProjected()
Destructor.
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...
virtual void DumpPolys() const
Dump information about built polygons.
Bool_t IsFirstIdxHead(Int_t s0, Int_t s1)
Compare the two segments and check if the first index of first segment is starting.
Abstract base-class for non-linear projectable objects.
TEveProjectionManager * fManager
virtual void SetProjection(TEveProjectionManager *mng, TEveProjectable *model)
Sets projection manager and reference in the projectable object.
void SetDepthCommon(Float_t d, TEveElement *el, Float_t *bbox)
Utility function to update the z-values of the bounding-box.
Manager class for steering of projections and managing projected objects.
TEveProjection * GetProjection()
Base-class for non-linear projections.
virtual void ProjectPoint(Float_t &x, Float_t &y, Float_t &z, Float_t d, EPProc_e p=kPP_Full)=0
EGeoMode_e GetGeoMode() const
virtual Bool_t AcceptSegment(TEveVector &, TEveVector &, Float_t) const
Abstract base-class for 2D/3D shapes.
virtual void CopyVizParams(const TEveElement *el)
Copy visualization parameters from element el.
void Set(const Float_t *v)
static constexpr double s
static constexpr double pi
Int_t FindPoint(Int_t pi)