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 rnrStyle (long)
 
void sceneClip (bool)
 
void selectable (bool)
 
void showMuonBarrel (long)
 

Private Attributes

FWBoolParameter m_clipParam
 
FW3DViewGeometrym_geometry
 
TGLClip * m_glClip
 
FWEnumParameter m_rnrStyle
 
FWBoolParameter m_selectable
 
FWEnumParameter m_showMuonBarrel
 
FWBoolParameter m_showMuonEndcap
 
FWBoolParameter m_showPixelBarrel
 
FWBoolParameter m_showPixelEndcap
 
FWBoolParameter m_showTrackerBarrel
 
FWBoolParameter m_showTrackerEndcap
 

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

Constructor & Destructor Documentation

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

Definition at line 108 of file FW3DViewBase.cc.

References FWEnumParameter::addEntry(), FWGenericParameter< T >::changed_, m_clipParam, m_rnrStyle, m_selectable, m_showMuonBarrel, rnrStyle(), sceneClip(), selectable(), showMuonBarrel(), and FWEveView::viewerGL().

108  :
109  FWEveView(iParent, typeId, 8),
110  m_geometry(0),
111  m_glClip(0),
112  m_showMuonBarrel(this, "Show Muon Barrel", 0l, 0l, 2l ),
113  m_showMuonEndcap(this, "Show Muon Endcap", false ),
114  m_showPixelBarrel(this, "Show Pixel Barrel", false ),
115  m_showPixelEndcap(this, "Show Pixel Endcap", false),
116  m_showTrackerBarrel(this, "Show Tracker Barrel", false ),
117  m_showTrackerEndcap(this, "Show Tracker Endcap", false),
118  m_rnrStyle(this, "Render Style", 0l, 0l, 2l),
119  m_clipParam(this, "View dependent Clip", false),
120  m_selectable(this, "Enable Tooltips", false)
121 {
122  viewerGL()->SetCurrentCamera(TGLViewer::kCameraPerspXOZ);
123 
124  m_showMuonBarrel.addEntry(0, "Hide");
125  m_showMuonBarrel.addEntry(1, "Simplified");
126  m_showMuonBarrel.addEntry(2, "Full");
127  m_showMuonBarrel.changed_.connect(boost::bind(&FW3DViewBase::showMuonBarrel,this,_1));
128 
129  m_rnrStyle.addEntry(TGLRnrCtx::kFill, "Fill");
130  m_rnrStyle.addEntry(TGLRnrCtx::kOutline, "Outline");
131  m_rnrStyle.addEntry(TGLRnrCtx::kWireFrame, "WireFrame");
132  m_rnrStyle.changed_.connect(boost::bind(&FW3DViewBase::rnrStyle,this, _1));
133  m_clipParam.changed_.connect(boost::bind(&FW3DViewBase::sceneClip,this, _1));
134 
135  m_selectable.changed_.connect(boost::bind(&FW3DViewBase::selectable,this, _1));
136 
137 }
void sceneClip(bool)
void showMuonBarrel(long)
void rnrStyle(long)
FWBoolParameter m_showMuonEndcap
Definition: FW3DViewBase.h:70
FWBoolParameter m_clipParam
Definition: FW3DViewBase.h:77
FWBoolParameter m_showTrackerBarrel
Definition: FW3DViewBase.h:73
TGLViewer * viewerGL() const
Definition: FWEveView.cc:198
sigc::signal< void, T > changed_
void selectable(bool)
FWEnumParameter m_rnrStyle
Definition: FW3DViewBase.h:76
FWBoolParameter m_showPixelEndcap
Definition: FW3DViewBase.h:72
bool addEntry(Long_t id, const std::string &txt)
FWEveView(TEveWindowSlot *, FWViewType::EType, unsigned int version=7)
Definition: FWEveView.cc:80
TGLClip * m_glClip
Definition: FW3DViewBase.h:66
FWEnumParameter m_showMuonBarrel
Definition: FW3DViewBase.h:69
FW3DViewGeometry * m_geometry
Definition: FW3DViewBase.h:65
FWBoolParameter m_selectable
Definition: FW3DViewBase.h:78
FWBoolParameter m_showTrackerEndcap
Definition: FW3DViewBase.h:74
FWBoolParameter m_showPixelBarrel
Definition: FW3DViewBase.h:71
FWViewType::EType typeId() const
Definition: FWViewBase.h:42
FW3DViewBase::~FW3DViewBase ( )
virtual

Definition at line 139 of file FW3DViewBase.cc.

References m_glClip.

140 {
141  delete m_glClip;
142 }
TGLClip * m_glClip
Definition: FW3DViewBase.h:66
FW3DViewBase::FW3DViewBase ( const FW3DViewBase )
private

Member Function Documentation

void FW3DViewBase::addTo ( FWConfiguration iTo) const
virtual

Reimplemented from FWEveView.

Definition at line 203 of file FW3DViewBase.cc.

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

204 {
205  // take care of parameters
206  FWEveView::addTo(iTo);
207  TGLPerspectiveCamera* camera = dynamic_cast<TGLPerspectiveCamera*>(&(viewerGL()->CurrentCamera()));
208  if (camera)
209  addToPerspectiveCamera(camera, "Plain3D", iTo);
210 }
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
const FW3DViewBase& FW3DViewBase::operator= ( const FW3DViewBase )
private
void FW3DViewBase::populateController ( ViewerParameterGUI gui) const
virtual

Reimplemented from FWEveView.

Definition at line 236 of file FW3DViewBase.cc.

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

237 {
239 
240  gui.requestTab("Detector").
241  addParam(&m_showMuonBarrel).
242  addParam(&m_showMuonEndcap).
243  addParam(&m_showTrackerBarrel).
244  addParam(&m_showTrackerEndcap).
245  addParam(&m_showPixelBarrel).
246  addParam(&m_showPixelEndcap).
247  separator().
248  addParam(&m_rnrStyle).
249  addParam(&m_clipParam).
250  addParam(&m_selectable);
251 
252 
253  gui.requestTab("Style").separator();
254  gui.getTabContainer()->AddFrame(new TGTextButton(gui.getTabContainer(), "Root controls",
255  Form("TEveGedEditor::SpawnNewEditor((TGLViewer*)0x%lx)", (unsigned long)viewerGL())));
256 }
FWBoolParameter m_showMuonEndcap
Definition: FW3DViewBase.h:70
virtual void populateController(ViewerParameterGUI &) const
Definition: FWEveView.cc:543
FWBoolParameter m_clipParam
Definition: FW3DViewBase.h:77
ViewerParameterGUI & requestTab(const char *)
ViewerParameterGUI & separator()
FWBoolParameter m_showTrackerBarrel
Definition: FW3DViewBase.h:73
TGLViewer * viewerGL() const
Definition: FWEveView.cc:198
FWEnumParameter m_rnrStyle
Definition: FW3DViewBase.h:76
FWBoolParameter m_showPixelEndcap
Definition: FW3DViewBase.h:72
TGCompositeFrame * getTabContainer()
FWEnumParameter m_showMuonBarrel
Definition: FW3DViewBase.h:69
FWBoolParameter m_selectable
Definition: FW3DViewBase.h:78
FWBoolParameter m_showTrackerEndcap
Definition: FW3DViewBase.h:74
FWBoolParameter m_showPixelBarrel
Definition: FW3DViewBase.h:71
void FW3DViewBase::rnrStyle ( long  x)
private

Definition at line 173 of file FW3DViewBase.cc.

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

Referenced by FW3DViewBase().

174 {
175  geoScene()->GetGLScene()->SetStyle(x);
176  viewerGL()->Changed();
177  gEve->Redraw3D();
178 }
TGLViewer * viewerGL() const
Definition: FWEveView.cc:198
TEveScene * geoScene()
Definition: FWEveView.h:77
Definition: DDAxes.h:10
void FW3DViewBase::sceneClip ( bool  x)
private

Definition at line 186 of file FW3DViewBase.cc.

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

Referenced by FW3DViewBase().

187 {
188  if (m_glClip == 0) {
189  m_glClip = new Clipsi(viewerGL()->GetRnrCtx());
190  }
191 
192  geoScene()->GetGLScene()->SetClip(x ? m_glClip : 0);
193  for (TEveElement::List_i it =gEve->GetScenes()->BeginChildren(); it != gEve->GetScenes()->EndChildren(); ++it )
194  {
195  if (strncmp((*it)->GetElementName(), "TopGeoNodeScene", 15) == 0)
196  ((TEveScene*)(*it))->GetGLScene()->SetClip(x ? m_glClip : 0);
197  }
198  viewerGL()->RequestDraw();
199 }
TGLViewer * viewerGL() const
Definition: FWEveView.cc:198
TEveScene * geoScene()
Definition: FWEveView.h:77
TGLClip * m_glClip
Definition: FW3DViewBase.h:66
Definition: DDAxes.h:10
void FW3DViewBase::selectable ( bool  x)
private

Definition at line 181 of file FW3DViewBase.cc.

References FWEveView::geoScene().

Referenced by FW3DViewBase().

182 {
183  geoScene()->GetGLScene()->SetSelectable(x);
184 }
TEveScene * geoScene()
Definition: FWEveView.h:77
Definition: DDAxes.h:10
void FW3DViewBase::setContext ( const fireworks::Context context)
virtual

Reimplemented from FWEveView.

Reimplemented in FW3DView.

Definition at line 144 of file FW3DViewBase.cc.

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

Referenced by FW3DView::setContext().

145 {
146  FWEveView::setContext(context);
147 
148  m_geometry = new FW3DViewGeometry(context);
149  geoScene()->AddElement(m_geometry);
150 
156 
157  // don't clip event scene -- ideally, would have TGLClipNoClip in root
158  TGLClipPlane* c=new TGLClipPlane();
159  c->Setup(TGLVector3(1e10,0,0), TGLVector3(-1,0,0));
160  eventScene()->GetGLScene()->SetClip(c);
161 }
TEveScene * eventScene()
Definition: FWEveView.h:76
FWBoolParameter m_showMuonEndcap
Definition: FW3DViewBase.h:70
void showTrackerEndcap(bool)
FWBoolParameter m_showTrackerBarrel
Definition: FW3DViewBase.h:73
sigc::signal< void, T > changed_
void showTrackerBarrel(bool)
void showMuonEndcap(bool)
FWBoolParameter m_showPixelEndcap
Definition: FW3DViewBase.h:72
void showPixelBarrel(bool)
TEveScene * geoScene()
Definition: FWEveView.h:77
void showPixelEndcap(bool)
FW3DViewGeometry * m_geometry
Definition: FW3DViewBase.h:65
virtual void setContext(const fireworks::Context &x)
Definition: FWEveView.cc:267
FWBoolParameter m_showTrackerEndcap
Definition: FW3DViewBase.h:74
FWBoolParameter m_showPixelBarrel
Definition: FW3DViewBase.h:71
void FW3DViewBase::setFrom ( const FWConfiguration iFrom)
virtual

Reimplemented from FWEveView.

Definition at line 214 of file FW3DViewBase.cc.

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

215 {
216  // take care of parameters
217  FWEveView::setFrom(iFrom);
218 
219  TGLPerspectiveCamera* camera = dynamic_cast<TGLPerspectiveCamera*>(&(viewerGL()->CurrentCamera()));
220  if (camera)
221  setFromPerspectiveCamera(camera, "Plain3D", iFrom);
222 
223  if (iFrom.version() < 5)
224  {
225  // transparency moved to common preferences in FWEveView version 5
226  std::string tName("Detector Transparency");
227  std::istringstream s(iFrom.valueForKey(tName)->value());
228  int transp;
229  s>> transp;
230  context().colorManager()->setGeomTransparency(transp, false);
231  }
232 }
FWColorManager * colorManager() const
Definition: Context.h:66
virtual void setFrom(const FWConfiguration &)
Definition: FWEveView.cc:356
unsigned int version() const
TGLViewer * viewerGL() const
Definition: FWEveView.cc:198
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:490
const FWConfiguration * valueForKey(const std::string &iKey) const
void FW3DViewBase::showMuonBarrel ( long  x)
private

Definition at line 163 of file FW3DViewBase.cc.

References m_geometry, FW3DViewGeometry::showMuonBarrel(), and FW3DViewGeometry::showMuonBarrelFull().

Referenced by FW3DViewBase().

164 {
165  if (m_geometry)
166  {
167  m_geometry->showMuonBarrel(x == 1);
169  }
170 }
void showMuonBarrel(bool)
void showMuonBarrelFull(bool)
FW3DViewGeometry * m_geometry
Definition: FW3DViewBase.h:65
Definition: DDAxes.h:10
void FW3DViewBase::updateGlobalSceneScaleParameters ( )

Member Data Documentation

FWBoolParameter FW3DViewBase::m_clipParam
private

Definition at line 77 of file FW3DViewBase.h.

Referenced by FW3DViewBase(), and populateController().

FW3DViewGeometry* FW3DViewBase::m_geometry
private

Definition at line 65 of file FW3DViewBase.h.

Referenced by setContext(), and showMuonBarrel().

TGLClip* FW3DViewBase::m_glClip
private

Definition at line 66 of file FW3DViewBase.h.

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

FWEnumParameter FW3DViewBase::m_rnrStyle
private

Definition at line 76 of file FW3DViewBase.h.

Referenced by FW3DViewBase(), and populateController().

FWBoolParameter FW3DViewBase::m_selectable
private

Definition at line 78 of file FW3DViewBase.h.

Referenced by FW3DViewBase(), and populateController().

FWEnumParameter FW3DViewBase::m_showMuonBarrel
private

Definition at line 69 of file FW3DViewBase.h.

Referenced by FW3DViewBase(), and populateController().

FWBoolParameter FW3DViewBase::m_showMuonEndcap
private

Definition at line 70 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().

FWBoolParameter FW3DViewBase::m_showPixelBarrel
private

Definition at line 71 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().

FWBoolParameter FW3DViewBase::m_showPixelEndcap
private

Definition at line 72 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().

FWBoolParameter FW3DViewBase::m_showTrackerBarrel
private

Definition at line 73 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().

FWBoolParameter FW3DViewBase::m_showTrackerEndcap
private

Definition at line 74 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().