TQtMarker.h

Go to the documentation of this file.
00001 // @(#)root/qt:$Id: TQtMarker.h 36066 2010-10-04 19:41:50Z brun $
00002 // Author: Valeri Fine   21/01/2002
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers.               *
00006  * Copyright (C) 2002 by Valeri Fine.                                    *
00007  * All rights reserved.                                                  *
00008  *                                                                       *
00009  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00010  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00011  *************************************************************************/
00012 
00013 #ifndef ROOT_TQtMarker
00014 #define ROOT_TQtMarker
00015 
00016 #ifndef ROOT_TPoint
00017 #include "TPoint.h"
00018 #endif
00019 
00020 #ifndef __CINT__
00021 #include <QPolygon>
00022 #else
00023    class QPointArray;
00024    class QPolygon;
00025 #endif
00026 
00027 class TAttMarker;
00028 class QPainter;
00029 
00030 ////////////////////////////////////////////////////////////////////////
00031 //
00032 // TQtMarker - class-utility to convert the ROOT TMarker object shape 
00033 //             in to the Qt QPolygon.
00034 //
00035 ////////////////////////////////////////////////////////////////////////
00036 
00037 class TQtMarker {
00038 
00039 private:
00040 
00041    int     fNumNode;       // Number of chain in the marker shape
00042    QPolygon  fChain;       // array of the n chains to build a shaped marker
00043    Color_t fCindex;        // Color index of the marker;
00044    int     fMarkerType;    // Type of the current marker
00045    int     fLineWidth;     // The width of the line used to outline the markers
00046    int     fLineOption;    // Connect the markers with the segments
00047 
00048 public:
00049 
00050    TQtMarker(int n=0, TPoint *xy=0,int type=0);
00051    TQtMarker &operator=(const TQtMarker&);
00052    TQtMarker(const TQtMarker&);
00053    TQtMarker &operator=(const TAttMarker&);
00054    TQtMarker(const TAttMarker&);
00055    virtual ~TQtMarker();
00056         void  DrawPolyMarker(QPainter &p, int n, TPoint *xy);
00057         void  SetMarkerAttributes(const TAttMarker& markerAttributes);
00058         void  SetColor(Color_t mcolor);
00059    void  SetPenAttributes(int type);
00060         Color_t  GetColor() const;
00061 
00062    int     GetNumber()  const;
00063    const   QPolygon &GetNodes() const;
00064    int     GetType()    const;
00065    int     GetWidth()   const;
00066    void    SetMarker(int n, TPoint *xy, int type);
00067    ClassDef(TQtMarker,0) //  Convert  ROOT TMarker objects on to QPointArray
00068 };
00069 
00070 //_________________________________________________________
00071 inline TQtMarker &TQtMarker::operator=(const TQtMarker&m) 
00072 {
00073    fNumNode  = m.fNumNode;
00074    fChain    = m.fChain; 
00075    fCindex   = m.fCindex;
00076    fMarkerType=m.fMarkerType;
00077    fLineWidth =m.fLineWidth;
00078         return *this;
00079 }
00080 //_________________________________________________________
00081 inline TQtMarker::TQtMarker(const TQtMarker&m) : fNumNode(m.fNumNode),
00082 fChain(m.fChain), fCindex(m.fCindex),fMarkerType(m.fMarkerType),fLineWidth(m.fLineWidth) 
00083 , fLineOption()
00084 {}
00085 
00086 //_________________________________________________________
00087 inline void  TQtMarker::SetColor(Color_t mcolor) { fCindex = mcolor; }
00088 //_________________________________________________________
00089 inline Color_t  TQtMarker::GetColor() const { return fCindex; }
00090 
00091 #endif

Generated on Tue Jul 5 14:14:32 2011 for ROOT_528-00b_version by  doxygen 1.5.1