VR-Forces 4.6 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
luaPathJob.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2013 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
8 #include "vrfLua/vrfLuaDefines.h"
9 #include "vrfLua/luaAsyncJob.h"
10 #include "vrfutil/scriptGeometry.h"
13 
14 #include "vlutil/vlMutex.h"
15 
17 #include "features/pathPlanner.h"
18 
19 #include <luabind/luabind.hpp>
20 
21 #include <boost/scoped_ptr.hpp>
22 
23 class DtSimManager;
24 class DtAsyncJobMapEntry;
25 
26 namespace MAKVRinTerra
27 {
28  class DtSharedMemoryFeaturesDebugDrawer;
29 }
30 
33 {
34 public:
35  typedef std::vector<DtLocation3D> Points;
36 
37  static boost::shared_ptr<DtLuaPathJob> Make(
38  DtSimManager* mgr,
39  DtString obstacleType,
40  DtString pathType,
41  const DtLocation3D& start,
42  const DtLocation3D& dest,
43  double buffer);
44 
46  DtLuaPathJob();
47 
49  ~DtLuaPathJob();
50 
52  luabind::object getObject(lua_State* L, int& index, std::string& message);
53 
55  luabind::object getDebugObject(lua_State* L) {return luabind::newtable(L);}
56 
58  virtual void cancel(lua_State* L) {};
59 
61  void addMessage(DtAlgorithmManager::Severity, std::string);
62 
66 
67  static DtAsciiSerializable* creator();
68 
70  bool deserialize(const DtString&);
71  DtString objectType() const;
72 
73  boost::shared_ptr<DtLuaPathJob> shared_from_this();
74  boost::shared_ptr<const DtLuaPathJob> shared_from_this() const;
75 
76 protected:
77  class PathTask;
78  friend class PathTask;
79 
82  DtSimManager* mgr,
83  DtString obstacles,
84  DtString paths,
85  const DtLocation3D& start,
86  const DtLocation3D& dest,
87  double buffer);
88 
89  void start();
90  void run(const DtAlgorithmManager& mgr = DtAlgorithmManager());
91 
93  void taskComplete();
94 
95  typedef DtMutex Mutex;
96 
97  mutable Mutex myMutex;
98  std::string myObstaclesType;
99  std::string myPathType;
102  double myBuffer;
103  boost::scoped_ptr<Points> myPoints;
104  boost::shared_ptr<DtAsyncJobMapEntry> myJobEntry;
105  std::string myMessage;
106 };

Document ID: Generated on Thu Apr 12 03:15:37 EDT 2018 from SVN revision 187986
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)