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

Txq3dPoints.h

Go to the documentation of this file.
00001 //---------------------------------------------------------------------------
00002 //
00003 // File:    Txq3dPoints.h
00004 //
00005 // Purpose: Draws points in 3d space.
00006 //          The points can have an optional size.
00007 // 
00008 // Version: $Id: Txq3dPoints.h,v 1.8 2002/04/16 18:23:07 kgl Exp $
00009 //
00010 // Author:  Kelly G. Luetkemeyer
00011 //
00012 //---------------------------------------------------------------------------
00013 
00014 #ifndef TXQ3D_POINTS_H
00015 #define TXQ3D_POINTS_H
00016 
00017 // STL includes
00018 #include <cmath>
00019 #include <cfloat>
00020 #include <vector>
00021 
00022 // Txq includes
00023 #include "Txq3dDrawable.h"
00024 
00035 class Txq3dPoints: public Txq3dDrawable
00036 { 
00037 
00038 public:
00039 
00043   Txq3dPoints();
00044 
00053   Txq3dPoints(const std::vector<float> & xpoints,
00054               const std::vector<float> & ypoints,
00055               const std::vector<float> & zpoints);
00056 
00060   virtual ~Txq3dPoints();
00061 
00069   void setPoints(const std::vector<float> & xpoints,
00070                  const std::vector<float> & ypoints,
00071                  const std::vector<float> & zpoints);
00072 
00077   void setEnableLighting(bool f) {enableLighting = f;}
00078 
00086   void addPoint(float x, float y, float z);
00087 
00091   void setColors(std::vector<QColor> &c) {colors = c;}
00092 
00096   void setPointSize(int ps) {pointSize = ps;}
00097 
00101   int getPointSize() {return pointSize;}
00102 
00103 protected:
00107   void initialize();
00108 
00112   void paintGL(); 
00113 
00119   void dump(QTextStream *ts);
00120 
00121 private:
00122 
00126   std::vector<float> fxpoints;
00127 
00131   std::vector<float> fypoints;
00132 
00136   std::vector<float> fzpoints;
00137 
00141   int numPoints;
00142 
00146   std::vector<QColor> colors;
00147 
00151   bool enableLighting;
00152 
00156   int pointSize;
00157 
00158 };
00159 
00160 #endif
00161 
Copyright Tech-X Corporation, all rights reserved.