00001 /*************************************************************************** 00002 * Copyright (c) 2007 * 00003 * Joachim Zettler <Joachim.Zettler@gmx.de> * 00004 * Werner Mayer <wmayer@users.sourceforge.net> * 00005 * This file is part of the FreeCAD CAx development system. * 00006 * * 00007 * This library is free software; you can redistribute it and/or * 00008 * modify it under the terms of the GNU Library General Public * 00009 * License as published by the Free Software Foundation; either * 00010 * version 2 of the License, or (at your option) any later version. * 00011 * * 00012 * This library is distributed in the hope that it will be useful, * 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00015 * GNU Library General Public License for more details. * 00016 * * 00017 * You should have received a copy of the GNU Library General Public * 00018 * License along with this library; see the file COPYING.LIB. If not, * 00019 * write to the Free Software Foundation, Inc., 59 Temple Place, * 00020 * Suite 330, Boston, MA 02111-1307, USA * 00021 * * 00022 ***************************************************************************/ 00023 00024 #ifndef CAMGUI_CUTTING_H 00025 #define CAMGUI_CUTTING_H 00026 00027 #include "ui_Cutting.h" 00028 00029 #include <Base/Vector3D.h> 00030 #include <QProcess> 00031 #include <Mod/Mesh/App/Core/Grid.h> 00032 #include <Mod/Cam/App/cutting_tools.h> 00033 #include <Inventor/nodes/SoEventCallback.h> 00034 #include <Mod/Cam/App/mergedata.h> 00035 #include <zlib.h> 00036 00037 class best_fit; 00038 class cutting_tools; 00039 class path_simulate; 00040 class SpringbackCorrection; 00041 class UniGridApprox; 00042 class TopoDS_Shape; 00043 class Approximate; 00044 class Deviation; 00045 class MergeData; 00046 00047 namespace CamGui 00048 { 00049 00050 class Cutting : public QDialog, public Ui_Cutting 00051 { 00052 Q_OBJECT 00053 00054 public: 00055 Cutting(QWidget* parent,Qt::WFlags = 0); 00056 ~Cutting(); 00057 protected Q_SLOTS: 00058 void on_CalculateZLevel_clicked(); 00059 void on_CalculateFeatureBased_clicked(); 00060 void on_CalculateSpiralBased_clicked(); 00061 void on_select_shape_z_level_button_clicked(); 00062 void on_select_shape_feature_based_button_clicked(); 00063 void on_select_shape_spiral_based_button_clicked(); 00064 void on_toolpath_calculation_highest_level_button_clicked(); 00065 void on_toolpath_calculation_middle_level_button_clicked(); 00066 void on_toolpath_calculation_lowest_level_button_clicked(); 00067 void on_toolpath_calculation_go_button_clicked(); 00068 void on_GenSimOut_clicked(); 00069 void on_GenRobotOut_clicked(); 00070 void on_adaptdynainput_clicked(); 00071 void on_start_simulation_clicked(); 00072 void on_BestFitButton_clicked(); 00073 void on_SpringbackButton_clicked(); 00074 void on_Approximate_button_clicked(); 00075 void on_best_fit_cad_button_clicked(); 00076 void on_best_fit_mesh_button_clicked(); 00077 void on_best_fit_mesh2_button_clicked(); 00078 void on_SelectFace_button_clicked(); 00079 void on_best_fit_go_button_clicked(); 00080 void on_Deviation_button_clicked(); 00081 void on_deviation_geometry1_button_clicked(); 00082 void on_deviation_geometry2_button_clicked(); 00083 void on_deviation_go_button_clicked(); 00084 void on_error_accumulation_go_button_clicked(); 00085 void on_error_accumulation_select_files_button_clicked(); 00086 00087 00088 void selectShape(); 00089 void selectMesh(); 00090 bool getProcessOutput(); 00091 const CuttingToolsSettings& getSettings(); 00092 void setFace(const TopoDS_Shape &aFace, const float , const float,const float); 00093 00094 private: 00095 static void zLevelCallback(void * ud, SoEventCallback * n); 00096 void DisplayCAMOutput(); 00097 void DisplayMeshOutput(const MeshCore::MeshKernel &mesh); 00098 void DisplayShapeOutput(); 00099 00100 00101 private: 00102 00103 SpringbackCorrection *m_Spring; 00104 cutting_tools *m_CuttingAlgo; //Instanz von der cutting-klasse auf dem Heap erzeugen 00105 path_simulate *m_PathSimulate; 00106 best_fit *m_BestFit; 00107 UniGridApprox *m_Approx; 00108 Approximate *m_App; 00109 Deviation *m_Deviation; 00110 MergeData *m_MergeData; 00111 00112 CuttingToolsSettings m_Settings; 00113 00114 QProcess *m_Process; 00115 TopoDS_Shape m_Shape; 00116 MeshCore::MeshKernel m_Mesh; 00117 MeshCore::MeshKernel m_MeshOut; 00118 MeshCore::MeshKernel m_MeshCad; 00119 bool m_timer; 00120 //1 means Standard, 2 means Feature Based, 3 means Spiral Based 00121 unsigned int m_Mode; 00122 00123 enum support_selection 00124 { 00125 BestFit, 00126 Springback, 00127 Approx, 00128 ToolpathCalculation 00129 }; 00130 support_selection m_selection; 00131 00132 00133 }; 00134 00135 } 00136 00137 #endif