Go to the documentation of this file.00001
00022 #ifndef DGVLATTICEVTK_H
00023 #define DGVLATTICEVTK_H
00024
00025 #include "QVTKWidget.h"
00026
00027 #include "vtkSphereSource.h"
00028 #include "vtkPolyDataMapper.h"
00029 #include "vtkActor.h"
00030 #include "vtkCamera.h"
00031 #include "vtkAxesActor.h"
00032 #include "vtkProperty.h"
00033 #include "vtkRenderer.h"
00034 #include "vtkRenderWindow.h"
00035
00036 #include "DGVAliases.h"
00037
00038 typedef double latticeType;
00039
00045 class DGV_VTK_EXPORT DGVLatticeVTK : public QVTKWidget
00046 {
00047 Q_OBJECT
00048
00049 public:
00050 DGVLatticeVTK(QWidget *parent = 0);
00051 virtual ~DGVLatticeVTK();
00052
00057 void setName(QString filename);
00058 void setDimensions(int dimensions);
00059 void setDefaultSize(int value);
00060 inline void setLatticeParameters(Array<latticeType,1> &values)
00061 { latticeParameters = values; }
00062 inline void setLatticeSize(int x, int y)
00063 { latticeSize = x, y; }
00064 inline void setLatticeSize(Array<int,1> &sizes)
00065 { latticeSize = sizes; }
00066 inline void setLatticePointSize(latticeType value)
00067 { defaultRadius = value; }
00068 inline void setLatticeUnit(latticeType value)
00069 { unit = value; }
00070 void setBackgroundColour(double red, double green, double blue);
00071 void setLatticeColour(double red, double green, double blue);
00072 void setLatticePointColour(int x, int y, double red, double green, double blue);
00073
00074 inline int getDimension()
00075 { return dimension; }
00076 inline int getDefaultSize()
00077 { return defaultSize; }
00078 inline latticeType getLatticeUnit()
00079 { return unit; }
00080 inline Array<latticeType,1>& getLatticeParameters()
00081 { return latticeParameters; }
00082 inline Array<int,1>& getLatticeSize()
00083 { return latticeSize; }
00084
00085 void addActorToLattice(vtkActor *actorToAdd);
00086 void generateLattice();
00087 void viewAsRightHanded();
00088 void viewAsMatrix();
00089 void enableAxes();
00090 void disableAxes();
00091
00096 QString strippedName();
00101 QString strippedNamePrefix();
00102
00103 protected:
00104 Array<latticeType,1> latticeParameters;
00105 Array<int,1> latticeSize;
00106 latticeType unit;
00107 int dimension;
00108 int defaultSize;
00109 latticeType defaultRadius;
00110 bool generatedBefore;
00111 bool rightHanded;
00112 bool axesEnabledBefore;
00113 QString name;
00114
00115 vtkSphereSource *sphere;
00116 vtkPolyDataMapper *mapper;
00117 Array<vtkActor*,1> latticePoints;
00118 vtkAxesActor *axes;
00119 vtkProperty *property;
00120 vtkRenderer *renderer;
00121 vtkRenderWindow *renderWin;
00122 };
00123
00124 #endif // DGVLATTICEVTK_H