]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/mapping/AliMpVPainter.cxx
- Use new AliMpSlatMotifMap::Instance() function to instantiate
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpVPainter.cxx
index adabb8c2dfd7822b592274a03289938eb6c36c2d..d69991b70c561e5350ebc94ba2db4cc7e25ae448 100755 (executable)
  **************************************************************************/
 
 // $Id$
-// $MpId: AliMpVPainter.cxx,v 1.8 2005/08/26 15:43:36 ivana Exp $
+// $MpId: AliMpVPainter.cxx,v 1.10 2006/05/24 13:58:32 ivana Exp $
 // Category: graphics
-//
+
+//-----------------------------------------------------------------------------
 // Class AliMpVPainter
 // --------------
 // Class for drawing objects into canvas
 // Included in AliRoot: 2003/05/02
 // Authors: David Guez, IPN Orsay
+//-----------------------------------------------------------------------------
   
-#include <TROOT.h>
-#include <TList.h>
-#include <TVirtualX.h>
-#include <TPad.h>
-#include <TError.h>
-
 #include "AliMpVPainter.h"
 #include "AliMpGraphContext.h"
 #include "AliMpSector.h"
 #include "AliMpSubZonePainter.h"
 #include "AliMpRowSegmentPainter.h"
 #include "AliMpMotifPainter.h"
+#include "AliMpMotifType.h"
 #include "AliMpPCB.h"
 #include "AliMpPCBPainter.h"
 #include "AliMpSlat.h"
 #include "AliMpSlatPainter.h"
+#include "AliMpIteratorPainter.h"
+#include "AliMpVPadIterator.h"
+#include "AliMpSlatSegmentation.h"
+//#include "AliMpSectorSegmentation.h"
+
+#include <TList.h>
+#include <TVirtualX.h>
+#include <TPad.h>
+#include <TROOT.h>
 
+/// \cond CLASSIMP
 ClassImp(AliMpVPainter)
+/// \endcond
 
 //_______________________________________________________________________
 AliMpVPainter::AliMpVPainter()
   : TObject(),
-    fColor(2)
+    fColor(2),
+    fPadPosition(),
+    fPadDimensions(),
+    fTrashList(0)
 {
   /// Default constructor
 
@@ -64,15 +75,6 @@ AliMpVPainter::AliMpVPainter()
   fTrashList = new TList;
 }
 
-//_____________________________________________________________________________
-AliMpVPainter::AliMpVPainter(const AliMpVPainter& right) 
-  : TObject(right) 
-{  
-  /// Protected copy constructor (not provided)
-
-  Fatal("AliMpVPainter", "Copy constructor not provided.");
-}
-
 //_______________________________________________________________________
 AliMpVPainter::~AliMpVPainter()
 {
@@ -84,23 +86,10 @@ AliMpVPainter::~AliMpVPainter()
   }
 }
 
-//_____________________________________________________________________________
-AliMpVPainter& AliMpVPainter::operator=(const AliMpVPainter& right)
-{
-  /// Assignment operator (not provided)
-
-  // check assignment to self
-  if (this == &right) return *this;
-
-  Fatal("operator =", "Assignment operator not provided.");
-    
-  return *this;  
-}    
-
 //_______________________________________________________________________
 Bool_t AliMpVPainter::IsInside(const TVector2 &point,const TVector2& pos,const TVector2& dim)
 {
-  /// Is the point <point> inside the area (pos,dim)?
+  /// Is the point \a point inside the \a area (pos,dim)?
 
   return ( (TMath::Abs(point.X()-pos.X())<dim.X() ) && (TMath::Abs(point.Y()-pos.Y())<dim.Y() ) );
 }
@@ -175,10 +164,28 @@ AliMpVPainter *AliMpVPainter::CreatePainter(TObject *object)
     painter = new AliMpRowSegmentPainter((AliMpVRowSegment *)object);
   else if (object->InheritsFrom(AliMpMotifPosition::Class()))
     painter = new AliMpMotifPainter((AliMpMotifPosition *)object);
+  else if (object->InheritsFrom(AliMpMotifType::Class()))
+    painter = new AliMpMotifPainter((AliMpMotifType *)object);
   else if (object->InheritsFrom(AliMpPCB::Class()))
     painter = new AliMpPCBPainter((AliMpPCB *)object);
   else if (object->InheritsFrom(AliMpSlat::Class()))
     painter = new AliMpSlatPainter((AliMpSlat*)object);
+  else if (object->InheritsFrom(AliMpVPadIterator::Class()))
+    painter = new AliMpIteratorPainter((AliMpVPadIterator*)object);
+  else if (object->InheritsFrom(AliMpVSegmentation::Class()))
+  {
+ //   const AliMpSectorSegmentation* sectorSegmentation = dynamic_cast<const AliMpSectorSegmentation*>(object);
+//    if (sectorSegmentation)
+//    {
+//      return new AliMpSectorPainter(sectorSegmentation->GetSector());
+//    }
+
+    const AliMpSlatSegmentation* slatSegmentation = dynamic_cast<const AliMpSlatSegmentation*>(object);
+    if (slatSegmentation)
+    {
+      return new AliMpSlatPainter(slatSegmentation->Slat());
+    }
+  }
   return painter;
 }