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

Txq2dVector.h

Go to the documentation of this file.
00001 //---------------------------------------------------------------------------
00002 // File:    Txq2dVector.h
00003 //
00004 // Purpose: Draw a vector on the Txq2dCanvas
00005 //           A vector consists of Txq2dLineSeg segments which make the
00006 //           shaft and the arrow of the vector.
00007 //
00008 // Version: $Id: Txq2dVector.h,v 1.6 2002/01/17 19:44:52 kgl Exp $
00009 //
00010 // Author:  Kelly G. Luetkemeyer
00011 //
00012 //---------------------------------------------------------------------------
00013 
00014 
00015 #ifndef TXQ2D_VECTOR_H
00016 #define TXQ2D_VECTOR_H
00017 
00018 // std includes
00019 #include <vector>
00020 
00021 // Tx includes
00022 #include "Txq2dLineSeg.h"
00023 
00024 // Qt includes
00025 #include <qpoint.h>
00026 
00039 class Txq2dVector: public Txq2dLineSeg 
00040 { 
00041 
00042 public:
00043 
00047   Txq2dVector();
00048 
00059   Txq2dVector(const std::vector<double> & xstart, const std::vector<double> &ystart, 
00060             const std::vector<double> & xend, const std::vector<double> &yend) ;
00061 
00065   virtual ~Txq2dVector();
00066 
00077   void setPoints(const std::vector<double> & xstart, const std::vector<double> &ystart,
00078                  const std::vector<double> & xend, const std::vector<double> &yend) ;
00079 
00084   void paint(QPainter* g ); 
00085 
00090  void setColor(QColor c);
00091 
00096  void setPrintColor(QColor c);
00097 
00098 protected:
00099 
00103   void makeVectors();
00104 
00108   void initialize();
00109 
00115   void dump(QTextStream *ts);
00116 
00117 private:
00118 
00124   void Txq2dVector::addPoint(TxqDoublePoint start, TxqDoublePoint end);
00125 
00129   std::vector<Txq2dLineSeg*> lineSeg;
00130 
00134   int lineSegPoints;
00135 
00136 };
00137 
00138 #endif
00139 
Copyright Tech-X Corporation, all rights reserved.