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
FW3DViewBase Class Reference

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

Inheritance diagram for FW3DViewBase:
FWEveView FWViewBase FWConfigurableParameterizable FWParameterizable FWConfigurable FW3DView FWISpyView

Public Member Functions

virtual void addTo (FWConfiguration &) const
 
 FW3DViewBase (TEveWindowSlot *, FWViewType::EType)
 
virtual void populateController (ViewerParameterGUI &) const
 
virtual void setContext (const fireworks::Context &)
 
virtual void setFrom (const FWConfiguration &)
 
void updateGlobalSceneScaleParameters ()
 
virtual ~FW3DViewBase ()
 
- 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 saveImageTo (const std::string &iName) const
 
virtual void setBackgroundColor (Color_t)
 
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

 FW3DViewBase (const FW3DViewBase &)
 
const FW3DViewBaseoperator= (const FW3DViewBase &)
 
void showWireFrame (bool)
 

Private Attributes

FW3DViewGeometrym_geometry
 
FWBoolParameter m_showMuonBarrel
 
FWBoolParameter m_showMuonEndcap
 
FWBoolParameter m_showPixelBarrel
 
FWBoolParameter m_showPixelEndcap
 
FWBoolParameter m_showTrackerBarrel
 
FWBoolParameter m_showTrackerEndcap
 
FWBoolParameter m_showWireFrame
 

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 38 of file FW3DViewBase.h.

Constructor & Destructor Documentation

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

Definition at line 44 of file FW3DViewBase.cc.

References FWEveView::viewerGL().

44  :
45  FWEveView(iParent, typeId),
46  m_geometry(0),
47  m_showMuonBarrel(this, "Show Muon Barrel", false ),
48  m_showMuonEndcap(this, "Show Muon Endcap", false),
49  m_showPixelBarrel(this, "Show Pixel Barrel", false ),
50  m_showPixelEndcap(this, "Show Pixel Endcap", false),
51  m_showTrackerBarrel(this, "Show Tracker Barrel", false ),
52  m_showTrackerEndcap(this, "Show Tracker Endcap", false),
53  m_showWireFrame(this, "Show Wire Frame", true)
54 {
55  viewerGL()->SetCurrentCamera(TGLViewer::kCameraPerspXOZ);
56 }
FWBoolParameter m_showMuonEndcap
Definition: FW3DViewBase.h:68
FWBoolParameter m_showTrackerBarrel
Definition: FW3DViewBase.h:71
TGLViewer * viewerGL() const
Definition: FWEveView.cc:197
FWBoolParameter m_showWireFrame
Definition: FW3DViewBase.h:73
FWBoolParameter m_showPixelEndcap
Definition: FW3DViewBase.h:70
FWEveView(TEveWindowSlot *, FWViewType::EType, unsigned int version=7)
Definition: FWEveView.cc:80
FWBoolParameter m_showMuonBarrel
Definition: FW3DViewBase.h:67
FW3DViewGeometry * m_geometry
Definition: FW3DViewBase.h:64
FWBoolParameter m_showTrackerEndcap
Definition: FW3DViewBase.h:72
FWBoolParameter m_showPixelBarrel
Definition: FW3DViewBase.h:69
FWViewType::EType typeId() const
Definition: FWViewBase.h:42
FW3DViewBase::~FW3DViewBase ( )
virtual

Definition at line 58 of file FW3DViewBase.cc.

References m_geometry.

59 {
60  delete m_geometry;
61 }
FW3DViewGeometry * m_geometry
Definition: FW3DViewBase.h:64
FW3DViewBase::FW3DViewBase ( const FW3DViewBase )
private

Member Function Documentation

void FW3DViewBase::addTo ( FWConfiguration iTo) const
virtual

Reimplemented from FWEveView.

Definition at line 89 of file FW3DViewBase.cc.

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

90 {
91  // take care of parameters
92  FWEveView::addTo(iTo);
93  TGLPerspectiveCamera* camera = dynamic_cast<TGLPerspectiveCamera*>(&(viewerGL()->CurrentCamera()));
94  if (camera)
95  addToPerspectiveCamera(camera, "Plain3D", iTo);
96 }
TGLViewer * viewerGL() const
Definition: FWEveView.cc:197
virtual void addTo(FWConfiguration &) const
Definition: FWEveView.cc:337
void addToPerspectiveCamera(TGLPerspectiveCamera *, const std::string &, FWConfiguration &) const
Definition: FWEveView.cc:448
const FW3DViewBase& FW3DViewBase::operator= ( const FW3DViewBase )
private
void FW3DViewBase::populateController ( ViewerParameterGUI gui) const
virtual

Reimplemented from FWEveView.

Definition at line 122 of file FW3DViewBase.cc.

References ViewerParameterGUI::getTabContainer(), m_showMuonBarrel, m_showMuonEndcap, m_showPixelBarrel, m_showPixelEndcap, m_showTrackerBarrel, m_showTrackerEndcap, m_showWireFrame, FWEveView::populateController(), ViewerParameterGUI::requestTab(), ViewerParameterGUI::separator(), and FWEveView::viewerGL().

123 {
125 
126  gui.requestTab("Detector").
127  addParam(&m_showPixelBarrel).
128  addParam(&m_showPixelEndcap).
129  addParam(&m_showTrackerBarrel).
130  addParam(&m_showTrackerEndcap).
131  addParam(&m_showMuonBarrel).
132  addParam(&m_showMuonEndcap).
133  addParam(&m_showWireFrame);
134 
135  gui.requestTab("Style").separator();
136  gui.getTabContainer()->AddFrame(new TGTextButton(gui.getTabContainer(), "Root controls",
137  Form("TEveGedEditor::SpawnNewEditor((TGLViewer*)0x%lx)", (unsigned long)viewerGL())));
138 }
FWBoolParameter m_showMuonEndcap
Definition: FW3DViewBase.h:68
virtual void populateController(ViewerParameterGUI &) const
Definition: FWEveView.cc:530
ViewerParameterGUI & requestTab(const char *)
ViewerParameterGUI & separator()
FWBoolParameter m_showTrackerBarrel
Definition: FW3DViewBase.h:71
TGLViewer * viewerGL() const
Definition: FWEveView.cc:197
FWBoolParameter m_showWireFrame
Definition: FW3DViewBase.h:73
FWBoolParameter m_showPixelEndcap
Definition: FW3DViewBase.h:70
TGCompositeFrame * getTabContainer()
FWBoolParameter m_showMuonBarrel
Definition: FW3DViewBase.h:67
FWBoolParameter m_showTrackerEndcap
Definition: FW3DViewBase.h:72
FWBoolParameter m_showPixelBarrel
Definition: FW3DViewBase.h:69
void FW3DViewBase::setContext ( const fireworks::Context context)
virtual

Reimplemented from FWEveView.

Reimplemented in FW3DView.

Definition at line 63 of file FW3DViewBase.cc.

References FWGenericParameter< T >::changed_, FWEveView::geoScene(), m_geometry, m_showMuonBarrel, m_showMuonEndcap, m_showPixelBarrel, m_showPixelEndcap, m_showTrackerBarrel, m_showTrackerEndcap, m_showWireFrame, FWEveView::setContext(), FW3DViewGeometry::showMuonBarrel(), FW3DViewGeometry::showMuonEndcap(), FW3DViewGeometry::showPixelBarrel(), FW3DViewGeometry::showPixelEndcap(), FW3DViewGeometry::showTrackerBarrel(), FW3DViewGeometry::showTrackerEndcap(), and showWireFrame().

Referenced by FW3DView::setContext().

64 {
65  FWEveView::setContext(context);
66 
67  m_geometry = new FW3DViewGeometry(context);
68  geoScene()->AddElement(m_geometry);
69 
76  m_showWireFrame.changed_.connect(boost::bind(&FW3DViewBase::showWireFrame,this, _1));
77 }
FWBoolParameter m_showMuonEndcap
Definition: FW3DViewBase.h:68
void showMuonBarrel(bool)
void showTrackerEndcap(bool)
FWBoolParameter m_showTrackerBarrel
Definition: FW3DViewBase.h:71
sigc::signal< void, T > changed_
void showTrackerBarrel(bool)
void showMuonEndcap(bool)
FWBoolParameter m_showWireFrame
Definition: FW3DViewBase.h:73
FWBoolParameter m_showPixelEndcap
Definition: FW3DViewBase.h:70
void showPixelBarrel(bool)
void showWireFrame(bool)
Definition: FW3DViewBase.cc:80
TEveScene * geoScene()
Definition: FWEveView.h:77
void showPixelEndcap(bool)
FWBoolParameter m_showMuonBarrel
Definition: FW3DViewBase.h:67
FW3DViewGeometry * m_geometry
Definition: FW3DViewBase.h:64
virtual void setContext(const fireworks::Context &x)
Definition: FWEveView.cc:266
FWBoolParameter m_showTrackerEndcap
Definition: FW3DViewBase.h:72
FWBoolParameter m_showPixelBarrel
Definition: FW3DViewBase.h:69
void FW3DViewBase::setFrom ( const FWConfiguration iFrom)
virtual

Reimplemented from FWEveView.

Definition at line 100 of file FW3DViewBase.cc.

References fireworks::Context::colorManager(), FWEveView::context(), asciidump::s, FWEveView::setFrom(), FWEveView::setFromPerspectiveCamera(), FWColorManager::setGeomTransparency(), FWConfiguration::value(), FWConfiguration::valueForKey(), FWConfiguration::version(), and FWEveView::viewerGL().

101 {
102  // take care of parameters
103  FWEveView::setFrom(iFrom);
104 
105  TGLPerspectiveCamera* camera = dynamic_cast<TGLPerspectiveCamera*>(&(viewerGL()->CurrentCamera()));
106  if (camera)
107  setFromPerspectiveCamera(camera, "Plain3D", iFrom);
108 
109  if (iFrom.version() < 5)
110  {
111  // transparency moved to common preferences in FWEveView version 5
112  std::string tName("Detector Transparency");
113  std::istringstream s(iFrom.valueForKey(tName)->value());
114  int transp;
115  s>> transp;
116  context().colorManager()->setGeomTransparency(transp, false);
117  }
118 }
FWColorManager * colorManager() const
Definition: Context.h:66
virtual void setFrom(const FWConfiguration &)
Definition: FWEveView.cc:355
unsigned int version() const
TGLViewer * viewerGL() const
Definition: FWEveView.cc:197
void setGeomTransparency(Color_t idx, bool projectedType)
const std::string & value(unsigned int iIndex=0) const
const fireworks::Context & context()
Definition: FWEveView.h:65
void setFromPerspectiveCamera(TGLPerspectiveCamera *, const std::string &, const FWConfiguration &)
Definition: FWEveView.cc:477
const FWConfiguration * valueForKey(const std::string &iKey) const
string s
Definition: asciidump.py:422
void FW3DViewBase::showWireFrame ( bool  x)
private

Definition at line 80 of file FW3DViewBase.cc.

References FWEveView::geoScene(), and FWEveView::viewerGL().

Referenced by setContext().

81 {
82  geoScene()->GetGLScene()->SetStyle(x ? TGLRnrCtx::kWireFrame : TGLRnrCtx::kFill);
83  viewerGL()->Changed();
84  gEve->Redraw3D();
85 }
TGLViewer * viewerGL() const
Definition: FWEveView.cc:197
TEveScene * geoScene()
Definition: FWEveView.h:77
Definition: DDAxes.h:10
void FW3DViewBase::updateGlobalSceneScaleParameters ( )

Member Data Documentation

FW3DViewGeometry* FW3DViewBase::m_geometry
private

Definition at line 64 of file FW3DViewBase.h.

Referenced by setContext(), and ~FW3DViewBase().

FWBoolParameter FW3DViewBase::m_showMuonBarrel
private

Definition at line 67 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().

FWBoolParameter FW3DViewBase::m_showMuonEndcap
private

Definition at line 68 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().

FWBoolParameter FW3DViewBase::m_showPixelBarrel
private

Definition at line 69 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().

FWBoolParameter FW3DViewBase::m_showPixelEndcap
private

Definition at line 70 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().

FWBoolParameter FW3DViewBase::m_showTrackerBarrel
private

Definition at line 71 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().

FWBoolParameter FW3DViewBase::m_showTrackerEndcap
private

Definition at line 72 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().

FWBoolParameter FW3DViewBase::m_showWireFrame
private

Definition at line 73 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().