ROOT logo
// @(#)root/qt:$Id: TQtMarker.h 36066 2010-10-04 19:41:50Z brun $
// Author: Valeri Fine   21/01/2002

/*************************************************************************
 * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers.               *
 * Copyright (C) 2002 by Valeri Fine.                                    *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TQtMarker
#define ROOT_TQtMarker

#ifndef ROOT_TPoint
#include "TPoint.h"
#endif

#ifndef __CINT__
#include <QPolygon>
#else
   class QPointArray;
   class QPolygon;
#endif

class TAttMarker;
class QPainter;

////////////////////////////////////////////////////////////////////////
//
// TQtMarker - class-utility to convert the ROOT TMarker object shape 
//             in to the Qt QPolygon.
//
////////////////////////////////////////////////////////////////////////

class TQtMarker {

private:

   int     fNumNode;       // Number of chain in the marker shape
   QPolygon  fChain;       // array of the n chains to build a shaped marker
   Color_t fCindex;        // Color index of the marker;
   int     fMarkerType;    // Type of the current marker
   int     fLineWidth;     // The width of the line used to outline the markers
   int     fLineOption;    // Connect the markers with the segments

public:

   TQtMarker(int n=0, TPoint *xy=0,int type=0);
   TQtMarker &operator=(const TQtMarker&);
   TQtMarker(const TQtMarker&);
   TQtMarker &operator=(const TAttMarker&);
   TQtMarker(const TAttMarker&);
   virtual ~TQtMarker();
	void  DrawPolyMarker(QPainter &p, int n, TPoint *xy);
	void  SetMarkerAttributes(const TAttMarker& markerAttributes);
	void  SetColor(Color_t mcolor);
   void  SetPenAttributes(int type);
	Color_t  GetColor() const;

   int     GetNumber()  const;
   const   QPolygon &GetNodes() const;
   int     GetType()    const;
   int     GetWidth()   const;
   void    SetMarker(int n, TPoint *xy, int type);
   ClassDef(TQtMarker,0) //  Convert  ROOT TMarker objects on to QPointArray
};

//_________________________________________________________
inline TQtMarker &TQtMarker::operator=(const TQtMarker&m) 
{
   fNumNode  = m.fNumNode;
   fChain    = m.fChain; 
   fCindex   = m.fCindex;
   fMarkerType=m.fMarkerType;
   fLineWidth =m.fLineWidth;
	return *this;
}
//_________________________________________________________
inline TQtMarker::TQtMarker(const TQtMarker&m) : fNumNode(m.fNumNode),
fChain(m.fChain), fCindex(m.fCindex),fMarkerType(m.fMarkerType),fLineWidth(m.fLineWidth) 
, fLineOption()
{}

//_________________________________________________________
inline void  TQtMarker::SetColor(Color_t mcolor) { fCindex = mcolor; }
//_________________________________________________________
inline Color_t  TQtMarker::GetColor() const { return fCindex; }

#endif
 TQtMarker.h:1
 TQtMarker.h:2
 TQtMarker.h:3
 TQtMarker.h:4
 TQtMarker.h:5
 TQtMarker.h:6
 TQtMarker.h:7
 TQtMarker.h:8
 TQtMarker.h:9
 TQtMarker.h:10
 TQtMarker.h:11
 TQtMarker.h:12
 TQtMarker.h:13
 TQtMarker.h:14
 TQtMarker.h:15
 TQtMarker.h:16
 TQtMarker.h:17
 TQtMarker.h:18
 TQtMarker.h:19
 TQtMarker.h:20
 TQtMarker.h:21
 TQtMarker.h:22
 TQtMarker.h:23
 TQtMarker.h:24
 TQtMarker.h:25
 TQtMarker.h:26
 TQtMarker.h:27
 TQtMarker.h:28
 TQtMarker.h:29
 TQtMarker.h:30
 TQtMarker.h:31
 TQtMarker.h:32
 TQtMarker.h:33
 TQtMarker.h:34
 TQtMarker.h:35
 TQtMarker.h:36
 TQtMarker.h:37
 TQtMarker.h:38
 TQtMarker.h:39
 TQtMarker.h:40
 TQtMarker.h:41
 TQtMarker.h:42
 TQtMarker.h:43
 TQtMarker.h:44
 TQtMarker.h:45
 TQtMarker.h:46
 TQtMarker.h:47
 TQtMarker.h:48
 TQtMarker.h:49
 TQtMarker.h:50
 TQtMarker.h:51
 TQtMarker.h:52
 TQtMarker.h:53
 TQtMarker.h:54
 TQtMarker.h:55
 TQtMarker.h:56
 TQtMarker.h:57
 TQtMarker.h:58
 TQtMarker.h:59
 TQtMarker.h:60
 TQtMarker.h:61
 TQtMarker.h:62
 TQtMarker.h:63
 TQtMarker.h:64
 TQtMarker.h:65
 TQtMarker.h:66
 TQtMarker.h:67
 TQtMarker.h:68
 TQtMarker.h:69
 TQtMarker.h:70
 TQtMarker.h:71
 TQtMarker.h:72
 TQtMarker.h:73
 TQtMarker.h:74
 TQtMarker.h:75
 TQtMarker.h:76
 TQtMarker.h:77
 TQtMarker.h:78
 TQtMarker.h:79
 TQtMarker.h:80
 TQtMarker.h:81
 TQtMarker.h:82
 TQtMarker.h:83
 TQtMarker.h:84
 TQtMarker.h:85
 TQtMarker.h:86
 TQtMarker.h:87
 TQtMarker.h:88
 TQtMarker.h:89
 TQtMarker.h:90
 TQtMarker.h:91