Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes

WCSimDisplayFactory Class Reference

#include "WCSimDisplayFactory.hh"

List of all members.

Public Member Functions

WCSimDisplayMakeDisplay (const char *name="default")

Static Public Member Functions

static WCSimDisplayFactoryInstance ()

Private Member Functions

 WCSimDisplayFactory ()
 ~WCSimDisplayFactory ()

Private Attributes

WCSimDisplayfDisplayAB
WCSimDisplayfDisplayEve
WCSimDisplayfDisplayVtx

Detailed Description

Definition at line 8 of file WCSimDisplayFactory.hh.


Constructor & Destructor Documentation

WCSimDisplayFactory::WCSimDisplayFactory (  )  [private]

Definition at line 77 of file WCSimDisplayFactory.cc.

References fDisplayAB, fDisplayEve, and fDisplayVtx.

{
  // list of possible displays
  fDisplayAB = 0;
  fDisplayEve = 0;
  fDisplayVtx = 0;
}

WCSimDisplayFactory::~WCSimDisplayFactory (  )  [private]

Definition at line 85 of file WCSimDisplayFactory.cc.

References fDisplayAB, fDisplayEve, and fDisplayVtx.

{
  if( fDisplayAB )  delete fDisplayAB;
  if( fDisplayEve ) delete fDisplayEve;
  if( fDisplayVtx ) delete fDisplayVtx;
}


Member Function Documentation

WCSimDisplayFactory * WCSimDisplayFactory::Instance (  )  [static]

Definition at line 15 of file WCSimDisplayFactory.cc.

Referenced by WCSimDisplayViewer::BuildDisplay().

{
  if(!fgDisplayFactory){
    fgDisplayFactory = new WCSimDisplayFactory();
  }

  // die if finder hasn't actually been created
  if(!fgDisplayFactory){
    assert(fgDisplayFactory);
  }

  // can do re-setting here
  if(fgDisplayFactory){

  }

  return fgDisplayFactory;
}

WCSimDisplay * WCSimDisplayFactory::MakeDisplay ( const char *  name = "default"  ) 

Definition at line 34 of file WCSimDisplayFactory.cc.

References fDisplayAB, fDisplayEve, and fDisplayVtx.

Referenced by WCSimDisplayViewer::BuildDisplay().

{
  std::cout << " *** WCSimDisplayFactory::MakeDisplay(...) *** " << std::endl;

  if( strcmp(name,"AB")==0 
   || strcmp(name,"default")==0 ) {
    if( fDisplayAB==0 ){
      std::cout << "   Building Display: " << name << std::endl;
      fDisplayAB = new WCSimDisplayAB();
    }
    std::cout << "   Returning Display: " << name << std::endl;
    return fDisplayAB;
  }  

  else if( strcmp(name,"Eve")==0 
        || strcmp(name,"EVE")==0 
        || strcmp(name,"3D")==0 ) {
    if( fDisplayEve==0 ){
      std::cout << "   Building Display: " << name << std::endl;
      fDisplayEve = new WCSimEveDisplay();
    }
    std::cout << "   Returning Display: " << name << std::endl;
    return fDisplayEve;
  }

  else if( strcmp(name,"Vtx")==0 
        || strcmp(name,"VTX")==0
        || strcmp(name,"Vertex")==0 ) { 
    if( fDisplayVtx==0 ){
      std::cout << "   Building Display: " << name << std::endl;
      fDisplayVtx = new WCSimVertexViewer();
    }
    std::cout << "   Returning Display: " << name << std::endl;
    return fDisplayVtx;
  }

  else {
    std::cout << "   <warning> unknown display: " << name << std::endl;
  }

  return 0;
}


Member Data Documentation

Definition at line 21 of file WCSimDisplayFactory.hh.

Referenced by MakeDisplay(), WCSimDisplayFactory(), and ~WCSimDisplayFactory().

Definition at line 22 of file WCSimDisplayFactory.hh.

Referenced by MakeDisplay(), WCSimDisplayFactory(), and ~WCSimDisplayFactory().

Definition at line 23 of file WCSimDisplayFactory.hh.

Referenced by MakeDisplay(), WCSimDisplayFactory(), and ~WCSimDisplayFactory().


The documentation for this class was generated from the following files: