Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

Txq2dPointArray.h

Go to the documentation of this file.
00001 //---------------------------------------------------------------------------
00002 //
00003 // File:    Txq2dPointArray.h
00004 //
00005 // Purpose:  A class for drawing points.
00006 //           using the Qt QPointArray class
00007 //
00008 // Version: $Id: Txq2dPointArray.h,v 1.5 2002/01/17 19:29:21 kgl Exp $
00009 //
00010 // Author: Kelly G. Luetkemeyer
00011 //
00012 //---------------------------------------------------------------------------
00013 
00014 #ifndef TXQ2D_POINTARRAY_H
00015 #define TXQ2D_POINTARRAY_H
00016 
00017 // std includes
00018 #include <vector>
00019 
00020 // Tx includes
00021 #include "Txq2dPoint.h"
00022 #include "TxqDoublePoint.h"
00023 
00036 class Txq2dPointArray: public Txq2dPoint
00037 {
00038 
00039 public:
00043  Txq2dPointArray();
00044 
00049   Txq2dPointArray(const std::vector<TxqDoublePoint> &p);
00050  
00056   Txq2dPointArray(const std::vector<double> &x, const std::vector<double> &y);
00057  
00063   Txq2dPointArray(const std::vector<int> &x, const std::vector<int> &y);
00064  
00069   Txq2dPointArray(const std::vector<QPoint> &p);
00070 
00074  virtual ~Txq2dPointArray(){}
00075 
00080   void addPoint(TxqDoublePoint point);
00081 
00087   void addPoint(int x, int y);
00088 
00094   void addPoint(double x, double y);
00095 
00099   void erasePoints();
00100 
00105   void setPoints(const std::vector<TxqDoublePoint> &p);
00106 
00112   void setPoints(const std::vector<double> &x, const std::vector<double> &y);
00113 
00119   void setPoints(const std::vector<int> &x, const std::vector<int> &y);
00120 
00125   void setPoints(const std::vector<QPoint> &p);
00126 
00131   std::vector<TxqDoublePoint> getPoints(); 
00132 
00137   void setLocation(int x, int y); 
00138   
00142   void paint(QPainter* g );
00143 
00144 
00145 protected:
00146 
00150  void initialize();
00151 
00156   void dump(QTextStream *ts);
00157 
00158 private:
00159 
00163   std::vector<QColor> colors;
00164 
00168   std::vector<int> colors_index;
00169 
00170 };
00171 #endif
Copyright Tech-X Corporation, all rights reserved.