Logo ROOT   6.18/05
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
18class TBuffer3D;
19
21 public TEveProjected
22{
25
26private:
29
30protected:
31 struct Polygon_t
32 {
33 Int_t fNPnts; // number of points
34 Int_t* fPnts; // point indices
35
36 Polygon_t() : fNPnts(0), fPnts(0) {}
37 virtual ~Polygon_t() { delete [] fPnts; fNPnts=0; fPnts=0; }
38
40 { fNPnts = x.fNPnts; fPnts = x.fPnts; return *this; }
41
43 {
44 for (Int_t i=0; i<fNPnts; ++i) {
45 if (fPnts[i] == pi) return i;
46 }
47 return -1;
48 }
49 };
50
51 typedef std::list<Polygon_t> vpPolygon_t;
52 typedef vpPolygon_t::iterator vpPolygon_i;
53 typedef vpPolygon_t::const_iterator vpPolygon_ci;
54
55private:
56 TBuffer3D* fBuff; // buffer of projectable object
57
59 Float_t AddPolygon(std::list<Int_t, std::allocator<Int_t> >& pp, std::list<Polygon_t, std::allocator<Polygon_t> >& p);
60
64
65protected:
66 vpPolygon_t fPols; // polygons
67 vpPolygon_t fPolsBS; // polygons build from TBuffer3D segments
68 vpPolygon_t fPolsBP; // polygons build from TBuffer3D polygons
69
70 Int_t fNPnts; // number of reduced and projected points
71 TEveVector* fPnts; // reduced and projected points
72
73 virtual void SetDepthLocal(Float_t d);
74
75 Float_t PolygonSurfaceXY(const Polygon_t& poly) const;
76
77public:
78 TEvePolygonSetProjected(const char* n="TEvePolygonSetProjected", const char* t="");
80
81 virtual void ComputeBBox();
82
83 virtual void SetProjection(TEveProjectionManager* mng, TEveProjectable* model);
84 virtual void UpdateProjection();
85 virtual TEveElement* GetProjectedAsElement() { return this; }
86
87 void ProjectBuffer3D();
88
89 virtual void DumpPolys() const;
90 void DumpBuffer3D();
91
92 ClassDef(TEvePolygonSetProjected,0); // Set of projected polygons with outline; typically produced from a TBuffer3D.
93
94};
95
96#endif
#define d(i)
Definition: RSha256.hxx:102
#define s0(x)
Definition: RSha256.hxx:90
#define s1(x)
Definition: RSha256.hxx:91
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
float Float_t
Definition: RtypesCore.h:53
#define ClassDef(name, id)
Definition: Rtypes.h:326
Generic 3D primitive description class.
Definition: TBuffer3D.h:18
Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and...
Definition: TEveElement.h:34
GL-renderer for TEvePolygonSetProjected class.
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
virtual TEveElement * GetProjectedAsElement()
Returns this projected dynamic-casted to TEveElement.
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.
TEvePolygonSetProjected & operator=(const TEvePolygonSetProjected &)
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:25
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)