CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
FWGlimpseView Class Reference

#include <Fireworks/Core/interface/FWGlimpseView.h>

Inheritance diagram for FWGlimpseView:
FWEveView FWViewBase FWConfigurableParameterizable FWParameterizable FWConfigurable

Public Member Functions

virtual void addTo (FWConfiguration &) const
 
 FWGlimpseView (TEveWindowSlot *, FWViewType::EType)
 
virtual void setFrom (const FWConfiguration &)
 
virtual ~FWGlimpseView ()
 
- Public Member Functions inherited from FWEveView
const fireworks::Contextcontext ()
 
virtual
FWViewContextMenuHandlerBase
contextMenuHandler () const
 
virtual void eventBegin ()
 
virtual void eventEnd ()
 
TEveScene * eventScene ()
 
 FWEveView (TEveWindowSlot *, FWViewType::EType, unsigned int version=7)
 
TEveScene * geoScene ()
 
virtual bool isEnergyScaleGlobal () const
 
TEveElement * ownedProducts ()
 
virtual void populateController (ViewerParameterGUI &) const
 
virtual void saveImageTo (const std::string &iName) const
 
virtual void setBackgroundColor (Color_t)
 
virtual void setContext (const fireworks::Context &x)
 
virtual void setupEnergyScale ()
 
virtual void useGlobalEnergyScaleChanged ()
 
FWViewContextviewContext ()
 
TEveViewer * viewer ()
 
TGLViewer * viewerGL () const
 
virtual void voteCaloMaxVal ()
 
virtual ~FWEveView ()
 
- Public Member Functions inherited from FWViewBase
void destroy ()
 
 FWViewBase (FWViewType::EType, unsigned int iVersion=1)
 
void promptForSaveImageTo (TGFrame *) const
 
FWViewType::EType typeId () const
 
const std::string & typeName () const
 
- Public Member Functions inherited from FWConfigurableParameterizable
 FWConfigurableParameterizable (unsigned int iVersion=1)
 
unsigned int version () const
 
virtual ~FWConfigurableParameterizable ()
 
- Public Member Functions inherited from FWParameterizable
void add (FWParameterBase *)
 
const_iterator begin () const
 
const_iterator end () const
 
 FWParameterizable ()
 
virtual ~FWParameterizable ()
 
- Public Member Functions inherited from FWConfigurable
 FWConfigurable ()
 
virtual ~FWConfigurable ()
 

Private Member Functions

void createAxis ()
 
 FWGlimpseView (const FWGlimpseView &)
 
const FWGlimpseViewoperator= (const FWGlimpseView &)
 
void showAxes ()
 
void showCylinder ()
 

Private Attributes

TEveGeoShape * m_cylinder
 
FWBoolParameter m_showAxes
 
FWBoolParameter m_showCylinder
 

Additional Inherited Members

- Public Types inherited from FWParameterizable
typedef std::vector
< FWParameterBase * >
::const_iterator 
const_iterator
 
- Public Attributes inherited from FWViewBase
sigc::signal< void, const
FWViewBase * > 
beingDestroyed_
 
sigc::signal< void, Int_t, Int_t > openSelectedModelContextMenu_
 
- Protected Member Functions inherited from FWEveView
void addToOrthoCamera (TGLOrthoCamera *, FWConfiguration &) const
 
void addToPerspectiveCamera (TGLPerspectiveCamera *, const std::string &, FWConfiguration &) const
 
virtual void cameraGuideChanged ()
 
virtual TEveCaloViz * getEveCalo () const
 
virtual void pointLineScalesChanged ()
 
virtual void resetCamera ()
 
void setFromOrthoCamera (TGLOrthoCamera *, const FWConfiguration &)
 
void setFromPerspectiveCamera (TGLPerspectiveCamera *, const std::string &, const FWConfiguration &)
 
- Protected Member Functions inherited from FWViewBase
virtual ~FWViewBase ()
 
- Protected Attributes inherited from FWViewBase
FWViewType m_type
 

Detailed Description

Description: <one line="" class="" summary>="">

Usage: <usage>

Definition at line 36 of file FWGlimpseView.h.

Constructor & Destructor Documentation

FWGlimpseView::FWGlimpseView ( TEveWindowSlot *  iParent,
FWViewType::EType  typeId 
)

Definition at line 50 of file FWGlimpseView.cc.

References FWGenericParameter< T >::changed_, createAxis(), fireworks::getShape(), m_cylinder, m_showAxes, m_showCylinder, showAxes(), showCylinder(), FWViewBase::typeName(), FWEveView::viewer(), and FWEveView::viewerGL().

50  :
51  FWEveView(iParent, typeId),
52  m_cylinder(0),
53  m_showAxes(this, "Show Axes", true ),
54  m_showCylinder(this, "Show Cylinder", true)
55 {
56  createAxis();
57 
58  // made new wireframe scene
59  TEveScene* wns = gEve->SpawnNewScene(Form("Wireframe Scene %s", typeName().c_str()));
60  viewer()->AddScene(wns);
61  TGLScene* gls = wns->GetGLScene();
62  gls->SetStyle(TGLRnrCtx::kWireFrame);
63  gls->SetLOD(TGLRnrCtx::kLODMed);
64  gls->SetSelectable(kFALSE);
65 
66  TEveGeoManagerHolder gmgr(TEveGeoShape::GetGeoMangeur());
67  TGeoTube* tube = new TGeoTube(129,130,310);
68  m_cylinder = fireworks::getShape("Detector outline", tube, kWhite);
69  m_cylinder->SetPickable(kFALSE);
70  m_cylinder->SetMainColor(kGray+3);
71  wns->AddElement(m_cylinder);
72 
73  TGLViewer* ev = viewerGL();
74  ev->SetCurrentCamera(TGLViewer::kCameraPerspXOZ);
75  m_showAxes.changed_.connect(boost::bind(&FWGlimpseView::showAxes,this));
76  m_showCylinder.changed_.connect(boost::bind(&FWGlimpseView::showCylinder,this));
77 }
const std::string & typeName() const
Definition: FWViewBase.cc:121
TGLViewer * viewerGL() const
Definition: FWEveView.cc:198
sigc::signal< void, T > changed_
TEveGeoShape * m_cylinder
Definition: FWGlimpseView.h:58
TEveViewer * viewer()
Definition: FWEveView.h:75
FWEveView(TEveWindowSlot *, FWViewType::EType, unsigned int version=7)
Definition: FWEveView.cc:80
FWBoolParameter m_showCylinder
Definition: FWGlimpseView.h:62
TEveGeoShape * getShape(const char *name, TGeoBBox *shape, Color_t color)
Definition: BuilderUtils.cc:42
FWViewType::EType typeId() const
Definition: FWViewBase.h:42
FWBoolParameter m_showAxes
Definition: FWGlimpseView.h:61
FWGlimpseView::~FWGlimpseView ( )
virtual

Definition at line 79 of file FWGlimpseView.cc.

80 {
81 }
FWGlimpseView::FWGlimpseView ( const FWGlimpseView )
private

Member Function Documentation

void FWGlimpseView::addTo ( FWConfiguration iTo) const
virtual

Reimplemented from FWEveView.

Definition at line 169 of file FWGlimpseView.cc.

References FWEveView::addTo(), FWEveView::addToPerspectiveCamera(), FWViewBase::typeName(), and FWEveView::viewerGL().

170 {
171  FWEveView::addTo(iTo);
172  TGLPerspectiveCamera* camera = dynamic_cast<TGLPerspectiveCamera*>(&(viewerGL()->CurrentCamera()));
173  if (camera)
174  addToPerspectiveCamera(camera, typeName(), iTo);
175 }
const std::string & typeName() const
Definition: FWViewBase.cc:121
TGLViewer * viewerGL() const
Definition: FWEveView.cc:198
virtual void addTo(FWConfiguration &) const
Definition: FWEveView.cc:338
void addToPerspectiveCamera(TGLPerspectiveCamera *, const std::string &, FWConfiguration &) const
Definition: FWEveView.cc:461
void FWGlimpseView::createAxis ( )
private

Definition at line 89 of file FWGlimpseView.cc.

References FWEveView::geoScene().

Referenced by FWGlimpseView().

90 {
91  // create 3D axes
92  TEveElementList* axisHolder = new TEveElementList("GlimpseAxisHolder");
93 
94  TGLFont::EMode fontMode = TGLFont::kPixmap;
95  Int_t fs = 14;
96  Color_t fcol = kGray+1;
97 
98  // X axis
99  TEveStraightLineSet* xAxis = new TEveStraightLineSet( "GlimpseXAxis" );
100  xAxis->SetPickable(kTRUE);
101  xAxis->SetTitle("Energy Scale, 100 GeV, X-axis (LHC center)");
102  xAxis->SetLineStyle(3);
103  xAxis->SetLineColor(fcol);
104  xAxis->AddLine(-100,0,0,100,0,0);
105  axisHolder->AddElement(xAxis);
106 
107  TEveText* xTxt = new TEveText( "X+" );
108  xTxt->PtrMainTrans()->SetPos(100-fs, -fs, 0);
109  xTxt->SetFontMode(fontMode);
110  xTxt->SetMainColor(fcol);
111  axisHolder->AddElement(xTxt);
112 
113  // Y axis
114  TEveStraightLineSet* yAxis = new TEveStraightLineSet( "GlimpseYAxis" );
115  yAxis->SetPickable(kTRUE);
116  yAxis->SetTitle("Energy Scale, 100 GeV, Y-axis (upward)");
117  yAxis->SetLineColor(fcol);
118  yAxis->SetLineStyle(3);
119  yAxis->AddLine(0,-100,0,0,100,0);
120  axisHolder->AddElement(yAxis);
121 
122  TEveText* yTxt = new TEveText( "Y+" );
123  yTxt->PtrMainTrans()->SetPos(0, 100-fs, 0);
124  yTxt->SetFontMode(fontMode);
125  yTxt->SetMainColor(fcol);
126  axisHolder->AddElement(yTxt);
127 
128  // Z axis
129  TEveStraightLineSet* zAxis = new TEveStraightLineSet( "GlimpseZAxis" );
130  zAxis->SetPickable(kTRUE);
131  zAxis->SetTitle("Energy Scale, 100 GeV, Z-axis (west, along beam)");
132  zAxis->SetLineColor(fcol);
133  zAxis->AddLine(0,0,-100,0,0,100);
134  axisHolder->AddElement(zAxis);
135 
136  TEveText* zTxt = new TEveText( "Z+" );
137  zTxt->PtrMainTrans()->SetPos(0, -fs, 100 - zTxt->GetExtrude()*2);
138  zTxt->SetFontMode(fontMode);
139  zTxt->SetMainColor(fcol);
140  axisHolder->AddElement(zTxt);
141 
142  geoScene()->AddElement(axisHolder);
143 }
TEveScene * geoScene()
Definition: FWEveView.h:77
const FWGlimpseView& FWGlimpseView::operator= ( const FWGlimpseView )
private
void FWGlimpseView::setFrom ( const FWConfiguration iFrom)
virtual

Reimplemented from FWEveView.

Definition at line 178 of file FWGlimpseView.cc.

References FWEveView::setFrom(), FWEveView::setFromPerspectiveCamera(), FWViewBase::typeName(), and FWEveView::viewerGL().

179 {
180  FWEveView::setFrom(iFrom);
181  TGLPerspectiveCamera* camera = dynamic_cast<TGLPerspectiveCamera*>(&(viewerGL()->CurrentCamera()));
182  if (camera)
183  setFromPerspectiveCamera(camera, typeName(), iFrom);
184 }
virtual void setFrom(const FWConfiguration &)
Definition: FWEveView.cc:356
const std::string & typeName() const
Definition: FWViewBase.cc:121
TGLViewer * viewerGL() const
Definition: FWEveView.cc:198
void setFromPerspectiveCamera(TGLPerspectiveCamera *, const std::string &, const FWConfiguration &)
Definition: FWEveView.cc:490
void FWGlimpseView::showAxes ( )
private

Definition at line 147 of file FWGlimpseView.cc.

References m_showAxes, FWGenericParameter< T >::value(), and FWEveView::viewerGL().

Referenced by FWGlimpseView().

148 {
149  if ( m_showAxes.value() )
150  viewerGL()->SetGuideState(TGLUtil::kAxesOrigin, kTRUE, kFALSE, 0);
151  else
152  viewerGL()->SetGuideState(TGLUtil::kAxesNone, kTRUE, kFALSE, 0);
153 }
TGLViewer * viewerGL() const
Definition: FWEveView.cc:198
FWBoolParameter m_showAxes
Definition: FWGlimpseView.h:61
void FWGlimpseView::showCylinder ( )
private

Definition at line 157 of file FWGlimpseView.cc.

References m_cylinder, m_showCylinder, and FWGenericParameter< T >::value().

Referenced by FWGlimpseView().

158 {
159  if ( m_showCylinder.value() )
160  m_cylinder->SetRnrState(kTRUE);
161  else
162  m_cylinder->SetRnrState(kFALSE);
163 
164  gEve->Redraw3D();
165 }
TEveGeoShape * m_cylinder
Definition: FWGlimpseView.h:58
FWBoolParameter m_showCylinder
Definition: FWGlimpseView.h:62

Member Data Documentation

TEveGeoShape* FWGlimpseView::m_cylinder
private

Definition at line 58 of file FWGlimpseView.h.

Referenced by FWGlimpseView(), and showCylinder().

FWBoolParameter FWGlimpseView::m_showAxes
private

Definition at line 61 of file FWGlimpseView.h.

Referenced by FWGlimpseView(), and showAxes().

FWBoolParameter FWGlimpseView::m_showCylinder
private

Definition at line 62 of file FWGlimpseView.h.

Referenced by FWGlimpseView(), and showCylinder().