CrossSections.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef PARTGUI_CROSSSECTIONS_H
00024 #define PARTGUI_CROSSSECTIONS_H
00025
00026 #include <Gui/TaskView/TaskDialog.h>
00027 #include <Gui/TaskView/TaskView.h>
00028 #include <Base/BoundBox.h>
00029 #include <QDialog>
00030 #include <QPointer>
00031
00032 namespace Gui {
00033 class View3DInventor;
00034 }
00035
00036 namespace PartGui {
00037
00038 class ViewProviderCrossSections;
00039 class Ui_CrossSections;
00040 class CrossSections : public QDialog
00041 {
00042 Q_OBJECT
00043
00044 enum Plane { XY, XZ, YZ };
00045
00046 public:
00047 CrossSections(const Base::BoundBox3d& bb, QWidget* parent = 0, Qt::WFlags fl = 0);
00048 ~CrossSections();
00049 void accept();
00050 void apply();
00051
00052 protected:
00053 void changeEvent(QEvent *e);
00054
00055 private Q_SLOTS:
00056 void on_xyPlane_clicked();
00057 void on_xzPlane_clicked();
00058 void on_yzPlane_clicked();
00059 void on_position_valueChanged(double);
00060 void on_distance_valueChanged(double);
00061 void on_countSections_valueChanged(int);
00062 void on_checkBothSides_toggled(bool);
00063 void on_sectionsBox_toggled(bool);
00064
00065 private:
00066 std::vector<double> getPlanes() const;
00067 void calcPlane(Plane, double);
00068 void calcPlanes(Plane);
00069 void makePlanes(Plane, const std::vector<double>&, double[4]);
00070 Plane plane() const;
00071
00072 private:
00073 Ui_CrossSections* ui;
00074 Base::BoundBox3d bbox;
00075 ViewProviderCrossSections* vp;
00076 QPointer<Gui::View3DInventor> view;
00077 };
00078
00079 class TaskCrossSections : public Gui::TaskView::TaskDialog
00080 {
00081 Q_OBJECT
00082
00083 public:
00084 TaskCrossSections(const Base::BoundBox3d& bb);
00085 ~TaskCrossSections();
00086
00087 public:
00088 bool accept();
00089 void clicked(int id);
00090
00091 virtual QDialogButtonBox::StandardButtons getStandardButtons() const
00092 { return QDialogButtonBox::Ok | QDialogButtonBox::Apply | QDialogButtonBox::Cancel; }
00093
00094 private:
00095 CrossSections* widget;
00096 Gui::TaskView::TaskBox* taskbox;
00097 };
00098
00099 }
00100
00101 #endif // PARTGUI_CROSSSECTIONS_H