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

Txq2dLine.h

Go to the documentation of this file.
00001 //---------------------------------------------------------------------------
00002 //
00003 // File:    Txq2dLine.h
00004 //
00005 // Purpose: Draw a line on the Txq2dCanvas
00006 //           A line consists of one or more Txq2dLineSeg
00007 //
00008 // Version: $Id: Txq2dLine.h,v 1.5 2002/01/17 18:24:17 kgl Exp $
00009 //
00010 // Author:  Kelly G. Luetkemeyer
00011 //
00012 //---------------------------------------------------------------------------
00013 
00014 #ifndef TX2D_LINE_H
00015 #define TX2D_LINE_H
00016 
00017 // std includes
00018 #include <vector>
00019 
00020 // Tx includes
00021 #include "Txq2dLineSeg.h"
00022 
00023 // Qt includes
00024 #include <qpoint.h>
00025 
00031 class Txq2dLine: public Txq2dLineSeg 
00032 { 
00033 
00034 public:
00035 
00039   Txq2dLine();
00040 
00044  virtual ~Txq2dLine();
00045 
00053   Txq2dLine(const std::vector<int> & xpoints, const std::vector<int> & ypoints);
00054  
00061   Txq2dLine(const std::vector<QPoint> & qpoints);
00062  
00069   Txq2dLine(const std::vector<TxqDoublePoint> &txdouble);
00070  
00078   Txq2dLine(const std::vector<double> & xpoints, const std::vector<double> &ypoints);
00079  
00093   Txq2dLine(const std::vector<double> &xpoints, 
00094           const std::vector<double> &ypoints,
00095           int numPoints);
00096 
00102  void addPoint(TxqDoublePoint point);
00103 
00110  void addPoint(int x, int y);
00111 
00118  void addPoint(double x, double y);
00119   
00125  void addPoint(QPoint point);
00126 
00130  void makeLineSegments();
00131 
00139   void setPoints(const std::vector<int> &xpoints, 
00140                  const std::vector<int> & ypoints);
00141 
00148   void setPoints(const std::vector<QPoint> &qpoints);
00149 
00156   void setPoints(const std::vector<TxqDoublePoint> &txdouble);
00157 
00165   void setPoints(const std::vector<double> &xpoints, 
00166                  const std::vector<double> &ypoints);
00167 
00176   void setPoints(const std::vector<double> &xpoints, 
00177                  const std::vector<double> &ypoints,
00178                  int numPoints);
00179 
00180 
00184   void paint(QPainter* g ); 
00185 
00190  void setColor(QColor c);
00191 
00196  void setPrintColor(QColor c);
00197 
00198 
00199 protected:
00200 
00204   virtual void initialize();
00205 
00211   void dump(QTextStream *ts);
00212 
00213 private:
00214 
00218   std::vector<Txq2dLineSeg*> line;
00219 
00223   int lineSegPoints;
00224 
00228   int numLinePoints;
00229 
00230 };
00231 
00232 #endif
00233 
Copyright Tech-X Corporation, all rights reserved.