path_simulate.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 Path_Simulate_h
00024 #define Path_Simulate_h
00025
00026
00027 #include <Base/Vector3D.h>
00028 #include <Base/Builder3D.h>
00029 #include <TColStd_Array1OfReal.hxx>
00030 #include "cutting_tools.h"
00031 #include <sstream>
00032
00033
00034
00048 class CamExport path_simulate
00049 {
00050 public:
00051
00061 path_simulate(const std::vector<Handle_Geom_BSplineCurve>& BSplineTop,
00062 const std::vector<Handle_Geom_BSplineCurve>& BSplineBottom,
00063 struct CuttingToolsSettings& set);
00064 ~path_simulate();
00065
00071 bool ParameterCalculation_Line(double wirelength);
00072
00078 bool ParameterCalculation_Curve(double wirelength);
00079
00084 bool ConnectPaths_xy(bool outputstyle);
00085
00090 bool ConnectPaths_z(bool outputstyle);
00091
00100 bool ConnectPaths_Feat(bool tool, bool robo, bool connection_type);
00101
00103 bool UpdateParam();
00104
00112 bool WriteOutput_Feat(ofstream &anOutputFile_1, ofstream &anOutputFile_2, int &c, bool outputstyle);
00113
00115
00116
00128 bool WriteOutputSingle(ofstream &anOutputFile, int &c, bool outputstyle, bool tool, bool beamfl);
00129
00140 bool WriteOutputDouble(ofstream &anOutputFile_1,ofstream &nOutputFile_2, int &c1, int &c2, bool outputstyle,bool beamfl);
00141
00146 bool Gen_Path();
00147
00158 bool MakePathSingle(bool outputstyle, double length, bool part, bool curveType);
00159
00163 bool MakePathSimulate();
00164
00172 bool MakePathSimulate_Feat(const std::vector<float> &flatAreas, bool spiral);
00173
00176 bool MakePathRobot();
00177
00181 bool MakePathRobot_Feat(const std::vector<float> &flatAreas);
00182
00187 bool Correction(bool b);
00188
00192 bool TimeCorrection();
00193
00195 int Detect_FeatCurve(bool tool);
00196
00197 private:
00199 std::vector<Handle_Geom_BSplineCurve> m_BSplineTop;
00201 std::vector<Handle_Geom_BSplineCurve> m_BSplineBottom;
00203 std::vector<gp_Pnt> m_StartPnts1;
00205 std::vector<gp_Pnt> m_StartPnts2;
00206
00207
00208
00211 std::vector< std::vector<Base::Vector3d> > m_Output;
00214 std::vector< std::vector<Base::Vector3d> > m_Output2;
00217 std::vector<Base::Vector3d> m_Output_robo1;
00220 std::vector<Base::Vector3d> m_Output_robo2;
00223 std::vector<int> RoboFlag_Master;
00226 std::vector<int> RoboFlag_Slave;
00229 std::vector<double> m_Output_time;
00232 std::vector<double> m_Output_time2;
00234 double m_step;
00236 TColStd_Array1OfReal *m_Knots;
00238 double m_curMax;
00240 CuttingToolsSettings m_set;
00241
00243 std::vector<Handle_Geom_BSplineCurve>::iterator m_it1;
00245 std::vector<Handle_Geom_BSplineCurve>::iterator m_it2;
00247 double m_blech;
00249 double m_pretension;
00251 int m_clip;
00253 bool beam;
00255 bool m_single;
00258 bool m_dir;
00261 std::vector<std::vector<double> > m_length_ma;
00264 std::vector<std::vector<double> > m_length_sl;
00267 std::vector<std::vector<double> > m_accel_ma;
00270 std::vector<std::vector<double> > m_accel_sl;
00272 std::vector<std::vector<std::vector<double> > > m_velocity_ma;
00275 std::vector<std::vector<std::vector<double> > > m_velocity_sl;
00277 double m_vmax;
00279 double m_amax;
00282 double m_boundTol;
00285 double m_a;
00288 double m_v[3];
00290 double m_vmid;
00293 std::vector<double> m_StartParam;
00295 double m_t0;
00297 double m_t1;
00299 double m_t2;
00301 double m_T;
00303 double m_del_t;
00305 double GetVelocity(double time);
00308 double GetDistance(double t);
00310 bool CheckConnect();
00315 bool CheckConnect(bool tool);
00323 std::vector<std::vector<double> > CompBounds(bool tool, std::vector<double> knots);
00325 bool CompPath(bool tool);
00327 bool StartingTool();
00329 std::vector<std::pair<float,float> > m_PathTimes_Master;
00331 std::vector<std::pair<float,float> > m_PathTimes_Slave;
00332
00333
00334
00335
00337 bool m_conn;
00339 bool m_Feat;
00340 };
00341
00342
00343 #endif //Path_Simulate_h
00344
00345
00346
00347