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;
109 if (
fBuff ==
nullptr)
return;
136 for (
Int_t i = 0; i < buffN; ++i)
139 projection->
ProjectPoint(pnts[i].fX, pnts[i].fY, pnts[i].fZ, 0,
174 fPnts[idx].Set(pnts[i]);
189 if (pp.size() <= 2)
return 0;
191 Float_t bbox[4] = { 1e6, -1e6, 1e6, -1e6 };
192 for (std::list<Int_t>::iterator u = pp.begin(); u != pp.end(); ++u)
195 if (
fPnts[idx].fX < bbox[0]) bbox[0] =
fPnts[idx].fX;
196 if (
fPnts[idx].fX > bbox[1]) bbox[1] =
fPnts[idx].fX;
198 if (
fPnts[idx].fY < bbox[2]) bbox[2] =
fPnts[idx].fY;
199 if (
fPnts[idx].fY > bbox[3]) bbox[3] =
fPnts[idx].fY;
202 if ((bbox[1]-bbox[0]) < eps || (bbox[3]-bbox[2]) < eps)
return 0;
205 for (
vpPolygon_i poi = pols.begin(); poi != pols.end(); ++poi)
215 if (++start_idx >= refP.
fNPnts) start_idx = 0;
219 std::list<Int_t>::iterator u = ++pp.begin();
220 Int_t pidx = start_idx;
221 while (u != pp.end())
223 if ((*u) != refP.
fPnts[pidx])
226 if (++pidx >= refP.
fNPnts) pidx = 0;
228 if (u == pp.end())
return 0;
232 std::list<Int_t>::iterator u = --pp.end();
233 Int_t pidx = start_idx;
234 while (u != pp.begin())
236 if ((*u) != refP.
fPnts[pidx])
239 if (++pidx >= refP.
fNPnts) pidx = 0;
241 if (u == pp.begin())
return 0;
247 for (std::list<Int_t>::iterator u = pp.begin(); u != pp.end(); ++u)
254 pols.back().fNPnts = pp.size();
255 pols.back().fPnts = &pv[0];
257 return (bbox[1]-bbox[0]) * (bbox[3]-bbox[2]);
272 Int_t *seg = &bpols[2];
277 head = idxMap[
fBuff->fSegs[3*seg[0] + 1]];
278 tail = idxMap[
fBuff->fSegs[3*seg[0] + 2]];
282 head = idxMap[
fBuff->fSegs[3*seg[0] + 2]];
283 tail = idxMap[
fBuff->fSegs[3*seg[0] + 1]];
288 for (
UInt_t s = 1; s < segN; ++s)
289 segs.push_back(Seg_t(
fBuff->fSegs[3*seg[s] + 1],
fBuff->fSegs[3*seg[s] + 2]));
291 for (LSegIt_t it =
segs.begin(); it !=
segs.end(); ++it)
293 Int_t mv1 = idxMap[(*it).fV1];
294 Int_t mv2 = idxMap[(*it).fV2];
301 if (tail != pp.back()) pp.push_back(tail);
302 tail = (mv1 == tail) ? mv2 : mv1;
308 if (pp.front() == pp.back()) pp.pop_front();
332 vo1 =
fBuff->fSegs[3*s + 1];
333 vo2 =
fBuff->fSegs[3*s + 2];
336 if (vor1 == vor2)
continue;
338 for (it =
segs.begin(); it !=
segs.end(); ++it)
340 Int_t vv1 = (*it).fV1;
341 Int_t vv2 = (*it).fV2;
342 if((vv1 == vor1 && vv2 == vor2) || (vv1 == vor2 && vv2 == vor1))
349 segs.push_back(Seg_t(vor1, vor2));
352 while ( !
segs.empty())
355 pp.push_back(
segs.front().fV1);
359 while (match && !
segs.empty())
361 for (LSegIt_t k =
segs.begin(); k !=
segs.end(); ++k)
363 Int_t cv1 = (*k).fV1;
364 Int_t cv2 = (*k).fV2;
365 if (cv1 == tail || cv2 == tail)
368 tail = (cv1 == tail) ? cv2 : cv1;
378 if (tail == pp.front())
440 for (
Int_t i = 0; i < nPnts - 1; ++i)
454 printf(
"TEvePolygonSetProjected %d polygons\n", (
Int_t)
fPols.size());
458 Int_t nPnts = (*i).fNPnts;
459 printf(
"Points of polygon %d [Np = %d]:\n", ++cnt, nPnts);
460 for (
Int_t vi = 0; vi<nPnts; ++vi) {
461 Int_t pi = (*i).fPnts[vi];
478 printf(
"%d polygon of %d has %d segments \n", pi,
fBuff->NbPols(), segN);
480 Int_t* seg = &bpols[2];
485 printf(
"(%d, %d) \n", a1, a2);
486 printf(
"ORIG points :(%f, %f, %f) (%f, %f, %f)\n",
int Int_t
Signed integer 4 bytes (int).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
float Float_t
Float 4 bytes (float).
TEveVectorT< Float_t > TEveVector
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)
Allocate and prepare for incremental filling.
Float_t * fBBox
! 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.
void SetDepthLocal(Float_t d) override
Set depth (z-coordinate) of the projected points.
~TEvePolygonSetProjected() override
Destructor.
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
void UpdateProjection() override
This is virtual method from base-class TEveProjected.
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.
void SetProjection(TEveProjectionManager *mng, TEveProjectable *model) override
This is virtual method from base-class TEveProjected.
void ProjectBuffer3D()
Project current buffer.
void ComputeBBox() override
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...
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.
TEveProjectable(const TEveProjectable &)
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.
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
virtual Bool_t AcceptSegment(TEveVector &, TEveVector &, Float_t) const
TEveShape(const TEveShape &)=delete
void CopyVizParams(const TEveElement *el) override
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)