Logo ROOT  
Reference Guide
TEvePolygonSetProjected.h
Go to the documentation of this file.
1// @(#)root/eve:$Id$
2// Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3
4/*************************************************************************
5 * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT_TEvePolygonSetProjected
13#define ROOT_TEvePolygonSetProjected
14
15#include "TEveVector.h"
16#include "TEveShape.h"
17#include <list>
18
19class TBuffer3D;
20
22 public TEveProjected
23{
26
27private:
30
31protected:
32 struct Polygon_t
33 {
34 Int_t fNPnts; // number of points
35 Int_t* fPnts; // point indices
36
37 Polygon_t() : fNPnts(0), fPnts(0) {}
38 virtual ~Polygon_t() { delete [] fPnts; fNPnts=0; fPnts=0; }
39
41 { fNPnts = x.fNPnts; fPnts = x.fPnts; return *this; }
42
44 {
45 for (Int_t i=0; i<fNPnts; ++i) {
46 if (fPnts[i] == pi) return i;
47 }
48 return -1;
49 }
50 };
51
52 typedef std::list<Polygon_t> vpPolygon_t;
53 typedef vpPolygon_t::iterator vpPolygon_i;
54 typedef vpPolygon_t::const_iterator vpPolygon_ci;
55
56private:
57 TBuffer3D* fBuff; // buffer of projectable object
58
60 Float_t AddPolygon(std::list<Int_t, std::allocator<Int_t> >& pp, std::list<Polygon_t, std::allocator<Polygon_t> >& p);
61
65
66protected:
67 vpPolygon_t fPols; // polygons
68 vpPolygon_t fPolsBS; // polygons build from TBuffer3D segments
69 vpPolygon_t fPolsBP; // polygons build from TBuffer3D polygons
70
71 Int_t fNPnts; // number of reduced and projected points
72 TEveVector* fPnts; // reduced and projected points
73
74 virtual void SetDepthLocal(Float_t d);
75
76 Float_t PolygonSurfaceXY(const Polygon_t& poly) const;
77
78public:
79 TEvePolygonSetProjected(const char* n="TEvePolygonSetProjected", const char* t="");
81
82 virtual void ComputeBBox();
83
84 virtual void SetProjection(TEveProjectionManager* mng, TEveProjectable* model);
85 virtual void UpdateProjection();
86 virtual TEveElement* GetProjectedAsElement() { return this; }
87
88 void ProjectBuffer3D();
89
90 virtual void DumpPolys() const;
91 void DumpBuffer3D();
92
93 ClassDef(TEvePolygonSetProjected,0); // Set of projected polygons with outline; typically produced from a TBuffer3D.
94
95};
96
97#endif
int Int_t
Definition: CPyCppyy.h:43
#define d(i)
Definition: RSha256.hxx:102
#define s0(x)
Definition: RSha256.hxx:90
#define s1(x)
Definition: RSha256.hxx:91
bool Bool_t
Definition: RtypesCore.h:63
float Float_t
Definition: RtypesCore.h:57
#define ClassDef(name, id)
Definition: Rtypes.h:325
Generic 3D primitive description class.
Definition: TBuffer3D.h:18
Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and...
Definition: TEveElement.h:36
GL-renderer for TEvePolygonSetProjected class.
A set of projected polygons.
virtual void ComputeBBox()
Override of virtual method from TAttBBox.
TEvePolygonSetProjected & operator=(const TEvePolygonSetProjected &)=delete
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
virtual TEveElement * GetProjectedAsElement()
Returns this projected dynamic-casted to TEveElement.
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.
Abstract base class for classes that hold results of a non-linear projection transformation.
Manager class for steering of projections and managing projected objects.
Abstract base-class for 2D/3D shapes.
Definition: TEveShape.h:26
Double_t x[n]
Definition: legend1.C:17
const Int_t n
Definition: legend1.C:16
static constexpr double pi
Polygon_t & operator=(const Polygon_t &x)