CMS 3D CMS Logo

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

List of all members.

Public Member Functions

virtual void addTo (FWConfiguration &) const
 FW3DViewBase (TEveWindowSlot *, FWViewType::EType)
FW3DViewDistanceMeasureToolgetDMT ()
virtual void populateController (ViewerParameterGUI &) const
virtual bool requestGLHandlerPick () const
virtual void setContext (const fireworks::Context &)
void setCurrentDMTVertex (double x, double y, double z)
virtual void setFrom (const FWConfiguration &)
void updateGlobalSceneScaleParameters ()
virtual ~FW3DViewBase ()

Private Member Functions

 FW3DViewBase (const FW3DViewBase &)
const FW3DViewBaseoperator= (const FW3DViewBase &)
void rnrStyle (long)
void sceneClip (bool)
void selectable (bool)
void setCameraType (long)
void showMuonBarrel (long)

Private Attributes

FWEnumParameter m_cameraType
FWBoolParameter m_clipParam
FW3DViewDistanceMeasureToolm_DMT
TEveLine * m_DMTline
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

Detailed Description

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

Usage: <usage>

Definition at line 41 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_cameraType, m_clipParam, m_DMT, m_rnrStyle, m_selectable, m_showMuonBarrel, rnrStyle(), sceneClip(), selectable(), setCameraType(), showMuonBarrel(), and FWEveView::viewerGL().

                                                                         :
   FWEveView(iParent, typeId, 8),
   m_geometry(0),
   m_glClip(0),
   m_showMuonBarrel(this, "Show Muon Barrel",  0l, 0l, 2l ),
   m_showMuonEndcap(this, "Show Muon Endcap", false ),
   m_showPixelBarrel(this, "Show Pixel Barrel", false ),
   m_showPixelEndcap(this, "Show Pixel Endcap", false),
   m_showTrackerBarrel(this, "Show Tracker Barrel", false ),
   m_showTrackerEndcap(this, "Show Tracker Endcap", false),
   m_rnrStyle(this, "Render Style", 0l, 0l, 2l),
   m_clipParam(this, "View dependent Clip", false),
   m_selectable(this, "Enable Tooltips", false),
   m_cameraType(this, "Camera Type", 0l, 0l, 5l),
   m_DMT(0),
   m_DMTline(0)
{
   viewerGL()->SetCurrentCamera(TGLViewer::kCameraPerspXOZ);
   m_DMT = new FW3DViewDistanceMeasureTool();

   m_showMuonBarrel.addEntry(0, "Hide");
   m_showMuonBarrel.addEntry(1, "Simplified");
   m_showMuonBarrel.addEntry(2, "Full");
   m_showMuonBarrel.changed_.connect(boost::bind(&FW3DViewBase::showMuonBarrel,this,_1));

   m_rnrStyle.addEntry(TGLRnrCtx::kFill, "Fill");
   m_rnrStyle.addEntry(TGLRnrCtx::kOutline, "Outline");
   m_rnrStyle.addEntry(TGLRnrCtx::kWireFrame, "WireFrame");
   m_rnrStyle.changed_.connect(boost::bind(&FW3DViewBase::rnrStyle,this, _1));
   m_clipParam.changed_.connect(boost::bind(&FW3DViewBase::sceneClip,this, _1));

   m_selectable.changed_.connect(boost::bind(&FW3DViewBase::selectable,this, _1));


   m_cameraType.addEntry(TGLViewer::kCameraPerspXOZ,"PerspXOZ" );
   m_cameraType.addEntry(TGLViewer::kCameraOrthoXOY,"OrthoXOY");
   m_cameraType.addEntry(TGLViewer::kCameraOrthoXOZ,"OrthoXOZ");
   m_cameraType.addEntry(TGLViewer::kCameraOrthoZOY,"OrthoZOY" );  
   m_cameraType.addEntry(TGLViewer::kCameraOrthoXnOY,"OrthoXnOY");
   m_cameraType.addEntry(TGLViewer::kCameraOrthoXnOZ,"OrthoXnOZ");
   m_cameraType.addEntry(TGLViewer::kCameraOrthoZnOY,"OrthoZnOY" );  
   m_cameraType.changed_.connect(boost::bind(&FW3DViewBase::setCameraType,this, _1));
}
FW3DViewBase::~FW3DViewBase ( ) [virtual]

Definition at line 152 of file FW3DViewBase.cc.

References m_glClip.

{
  delete m_glClip;
}
FW3DViewBase::FW3DViewBase ( const FW3DViewBase ) [private]

Member Function Documentation

void FW3DViewBase::addTo ( FWConfiguration iTo) const [virtual]

Reimplemented from FWEveView.

Definition at line 234 of file FW3DViewBase.cc.

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

{
   // take care of parameters
   FWEveView::addTo(iTo);
   TGLPerspectiveCamera* camera = dynamic_cast<TGLPerspectiveCamera*>(&(viewerGL()->CurrentCamera()));
   if (camera)
      addToPerspectiveCamera(camera, "Plain3D", iTo);   
}
FW3DViewDistanceMeasureTool* FW3DViewBase::getDMT ( ) [inline]

Definition at line 61 of file FW3DViewBase.h.

References m_DMT.

{ return m_DMT;}
const FW3DViewBase& FW3DViewBase::operator= ( const FW3DViewBase ) [private]
void FW3DViewBase::populateController ( ViewerParameterGUI gui) const [virtual]

Reimplemented from FWEveView.

Definition at line 284 of file FW3DViewBase.cc.

References ViewerParameterGUI::addParam(), FW3DViewDistanceMeasureTool::buildGUI(), ViewerParameterGUI::getTabContainer(), m_cameraType, m_clipParam, m_DMT, m_rnrStyle, m_selectable, m_showMuonBarrel, m_showMuonEndcap, m_showPixelBarrel, m_showPixelEndcap, m_showTrackerBarrel, m_showTrackerEndcap, ViewerParameterGUI::requestTab(), ViewerParameterGUI::separator(), and FWEveView::viewerGL().

{
   FWEveView::populateController(gui);

   gui.requestTab("Detector").
      addParam(&m_showMuonBarrel).
      addParam(&m_showMuonEndcap).
      addParam(&m_showTrackerBarrel).
      addParam(&m_showTrackerEndcap).
      addParam(&m_showPixelBarrel).
      addParam(&m_showPixelEndcap).  
      separator().
      addParam(&m_rnrStyle).
      addParam(&m_clipParam).
      addParam(&m_selectable);


   gui.requestTab("Style").separator();
   gui.getTabContainer()->AddFrame(new TGTextButton(gui.getTabContainer(), "Root controls",
                                                    Form("TEveGedEditor::SpawnNewEditor((TGLViewer*)0x%lx)", (unsigned long)viewerGL())));

   gui.requestTab("Tools").addParam(&m_cameraType).separator();
   gui.getTabContainer()->AddFrame(m_DMT->buildGUI( gui.getTabContainer()), new TGLayoutHints(kLHintsExpandX, 2, 2, 2, 2));

}
bool FW3DViewBase::requestGLHandlerPick ( ) const [virtual]

Reimplemented from FWEveView.

Definition at line 265 of file FW3DViewBase.cc.

References WDecay::kNone, FW3DViewDistanceMeasureTool::m_action, and m_DMT.

void FW3DViewBase::rnrStyle ( long  x) [private]

Definition at line 204 of file FW3DViewBase.cc.

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

Referenced by FW3DViewBase().

{
   geoScene()->GetGLScene()->SetStyle(x);  
   viewerGL()->Changed();
   gEve->Redraw3D();
}
void FW3DViewBase::sceneClip ( bool  x) [private]

Definition at line 217 of file FW3DViewBase.cc.

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

Referenced by FW3DViewBase().

{
   if (m_glClip == 0)  {
      m_glClip = new Clipsi(viewerGL()->GetRnrCtx());
   }

   geoScene()->GetGLScene()->SetClip(x ? m_glClip : 0);
   for (TEveElement::List_i it =gEve->GetScenes()->BeginChildren(); it != gEve->GetScenes()->EndChildren(); ++it )
   {
      if (strncmp((*it)->GetElementName(), "TopGeoNodeScene", 15) == 0)
         ((TEveScene*)(*it))->GetGLScene()->SetClip(x ? m_glClip : 0);
   }
   viewerGL()->RequestDraw();
}
void FW3DViewBase::selectable ( bool  x) [private]

Definition at line 212 of file FW3DViewBase.cc.

References FWEveView::geoScene().

Referenced by FW3DViewBase().

{
      geoScene()->GetGLScene()->SetSelectable(x);
}
void FW3DViewBase::setCameraType ( long  x) [private]

Definition at line 194 of file FW3DViewBase.cc.

References FWEveView::viewerGL().

Referenced by FW3DViewBase().

{
   viewerGL()->RefCamera(TGLViewer::ECameraType(x)).IncTimeStamp();
   viewerGL()->SetCurrentCamera(TGLViewer::ECameraType(x));
   
   //if (viewerGL()->CurrentCamera().IsOrthographic())
   //   ((TGLOrthoCamera*)(&viewerGL()->CurrentCamera()))->SetEnableRotate(1);
}
void FW3DViewBase::setContext ( const fireworks::Context context) [virtual]

Reimplemented from FWEveView.

Reimplemented in FW3DView.

Definition at line 157 of file FW3DViewBase.cc.

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

{
   FWEveView::setContext(context);

   m_geometry = new FW3DViewGeometry(context);
   geoScene()->AddElement(m_geometry);
   
   m_showPixelBarrel.changed_.connect(boost::bind(&FW3DViewGeometry::showPixelBarrel,m_geometry,_1));
   m_showPixelEndcap.changed_.connect(boost::bind(&FW3DViewGeometry::showPixelEndcap,m_geometry,_1));
   m_showTrackerBarrel.changed_.connect(boost::bind(&FW3DViewGeometry::showTrackerBarrel,m_geometry,_1));
   m_showTrackerEndcap.changed_.connect(boost::bind(&FW3DViewGeometry::showTrackerEndcap,m_geometry,_1));
   m_showMuonEndcap.changed_.connect(boost::bind(&FW3DViewGeometry::showMuonEndcap,m_geometry,_1));
   
   // don't clip event scene --  ideally, would have TGLClipNoClip in root
   TGLClipPlane* c=new TGLClipPlane();
   c->Setup(TGLVector3(1e10,0,0), TGLVector3(-1,0,0));
   eventScene()->GetGLScene()->SetClip(c);

   m_DMTline = new TEveLine();
   m_DMTline->SetLineColor(1016);
   m_DMTline->SetLineStyle(5);


   m_DMTline->SetPoint(0, 0, 0, 0);
   m_DMTline->SetPoint(1, 0, 0, 0);
   eventScene()->AddElement(m_DMTline);
}
void FW3DViewBase::setCurrentDMTVertex ( double  x,
double  y,
double  z 
)
void FW3DViewBase::setFrom ( const FWConfiguration iFrom) [virtual]

Reimplemented from FWEveView.

Definition at line 245 of file FW3DViewBase.cc.

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

{
   // take care of parameters
   FWEveView::setFrom(iFrom);

   TGLPerspectiveCamera* camera = dynamic_cast<TGLPerspectiveCamera*>(&(viewerGL()->CurrentCamera()));
   if (camera)
      setFromPerspectiveCamera(camera, "Plain3D", iFrom);

   if (iFrom.version() < 5)
   {
      // transparency moved to common preferences in FWEveView version 5
      std::string tName("Detector Transparency");
      std::istringstream s(iFrom.valueForKey(tName)->value());
      int transp;
      s>> transp;
      context().colorManager()->setGeomTransparency(transp, false);
   }
}
void FW3DViewBase::showMuonBarrel ( long  x) [private]
void FW3DViewBase::updateGlobalSceneScaleParameters ( )

Member Data Documentation

Definition at line 86 of file FW3DViewBase.h.

Referenced by FW3DViewBase(), and populateController().

Definition at line 83 of file FW3DViewBase.h.

Referenced by FW3DViewBase(), and populateController().

TEveLine* FW3DViewBase::m_DMTline [private]

Definition at line 89 of file FW3DViewBase.h.

Referenced by setContext(), and setCurrentDMTVertex().

Definition at line 71 of file FW3DViewBase.h.

Referenced by setContext(), and showMuonBarrel().

TGLClip* FW3DViewBase::m_glClip [private]

Definition at line 72 of file FW3DViewBase.h.

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

Definition at line 82 of file FW3DViewBase.h.

Referenced by FW3DViewBase(), and populateController().

Definition at line 84 of file FW3DViewBase.h.

Referenced by FW3DViewBase(), and populateController().

Definition at line 75 of file FW3DViewBase.h.

Referenced by FW3DViewBase(), and populateController().

Definition at line 76 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().

Definition at line 77 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().

Definition at line 78 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().

Definition at line 79 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().

Definition at line 80 of file FW3DViewBase.h.

Referenced by populateController(), and setContext().