28 Seg_t(
Int_t i1=-1,
Int_t i2=-1) : fV1(i1), fV2(i2) {}
31 typedef std::list<Seg_t> LSeg_t;
32 typedef std::list<Seg_t>::iterator LSegIt_t;
110 if (
fBuff == 0)
return;
137 for (
Int_t i = 0; i < buffN; ++i)
140 projection->
ProjectPoint(pnts[i].fX, pnts[i].fY, pnts[i].fZ, 0,
190 if (pp.size() <= 2)
return 0;
192 Float_t bbox[4] = { 1e6, -1e6, 1e6, -1e6 };
193 for (std::list<Int_t>::iterator u = pp.begin(); u != pp.end(); ++u)
203 if ((bbox[1]-bbox[0]) < eps || (bbox[3]-bbox[2]) < eps)
return 0;
206 for (
vpPolygon_i poi = pols.begin(); poi != pols.end(); ++poi)
216 if (++start_idx >= refP.
fNPnts) start_idx = 0;
220 std::list<Int_t>::iterator u = ++pp.begin();
221 Int_t pidx = start_idx;
222 while (u != pp.end())
224 if ((*u) != refP.
fPnts[pidx])
227 if (++pidx >= refP.
fNPnts) pidx = 0;
229 if (u == pp.end())
return 0;
233 std::list<Int_t>::iterator u = --pp.end();
234 Int_t pidx = start_idx;
235 while (u != pp.begin())
237 if ((*u) != refP.
fPnts[pidx])
240 if (++pidx >= refP.
fNPnts) pidx = 0;
242 if (u == pp.begin())
return 0;
248 for (std::list<Int_t>::iterator u = pp.begin(); u != pp.end(); ++u)
255 pols.back().fNPnts = pp.size();
256 pols.back().fPnts = &pv[0];
258 return (bbox[1]-bbox[0]) * (bbox[3]-bbox[2]);
273 Int_t *seg = &bpols[2];
289 for (
UInt_t s = 1; s < segN; ++s)
292 for (LSegIt_t it =
segs.begin(); it !=
segs.end(); ++it)
294 Int_t mv1 = idxMap[(*it).fV1];
295 Int_t mv2 = idxMap[(*it).fV2];
302 if (tail != pp.back()) pp.push_back(tail);
303 tail = (mv1 == tail) ? mv2 : mv1;
309 if (pp.front() == pp.back()) pp.pop_front();
337 if (vor1 == vor2)
continue;
339 for (it =
segs.begin(); it !=
segs.end(); ++it)
341 Int_t vv1 = (*it).fV1;
342 Int_t vv2 = (*it).fV2;
343 if((vv1 == vor1 && vv2 == vor2) || (vv1 == vor2 && vv2 == vor1))
350 segs.push_back(Seg_t(vor1, vor2));
353 while ( !
segs.empty())
356 pp.push_back(
segs.front().fV1);
360 while (match && !
segs.empty())
362 for (LSegIt_t k =
segs.begin(); k !=
segs.end(); ++k)
364 Int_t cv1 = (*k).fV1;
365 Int_t cv2 = (*k).fV2;
366 if (cv1 == tail || cv2 == tail)
369 tail = (cv1 == tail) ? cv2 : cv1;
379 if (tail == pp.front())
441 for (
Int_t i = 0; i < nPnts - 1; ++i)
455 printf(
"TEvePolygonSetProjected %d polygons\n", (
Int_t)
fPols.size());
459 Int_t nPnts = (*i).fNPnts;
460 printf(
"Points of polygon %d [Np = %d]:\n", ++cnt, nPnts);
461 for (
Int_t vi = 0; vi<nPnts; ++vi) {
462 Int_t pi = (*i).fPnts[vi];
479 printf(
"%d polygon of %d has %d segments \n", pi,
fBuff->
NbPols(), segN);
481 Int_t* seg = &bpols[2];
486 printf(
"(%d, %d) \n", a1, a2);
487 printf(
"ORIG points :(%f, %f, %f) (%f, %f, %f)\n",
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char mode
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.
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.
TEvePolygonSetProjected(const TEvePolygonSetProjected &)=delete
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)
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
Int_t FindPoint(Int_t pi)