VR-Forces 4.7 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 
28 {
29 public:
30  typedef std::vector<DtLocation3D> Points;
31 
32  static boost::shared_ptr<DtLuaPathJob> Make(
33  DtSimManager* mgr,
34  DtString obstacleType,
35  DtString pathType,
36  const DtLocation3D& start,
37  const DtLocation3D& dest,
38  double buffer);
39 
41  DtLuaPathJob();
42 
44  ~DtLuaPathJob();
45 
47  luabind::object getObject(lua_State* L, int& index, std::string& message);
48 
50  luabind::object getDebugObject(lua_State* L) {return luabind::newtable(L);}
51 
53  virtual void cancel(lua_State* L) {};
54 
56  void addMessage(DtAlgorithmManager::Severity, std::string);
57 
61 
62  static DtAsciiSerializable* creator();
63 
65  bool deserialize(const DtString&);
66  DtString objectType() const;
67 
68  boost::shared_ptr<DtLuaPathJob> shared_from_this();
69  boost::shared_ptr<const DtLuaPathJob> shared_from_this() const;
70 
71 protected:
72  class PathTask;
73  friend class PathTask;
74 
77  DtSimManager* mgr,
78  DtString obstacles,
79  DtString paths,
80  const DtLocation3D& start,
81  const DtLocation3D& dest,
82  double buffer);
83 
84  void start();
85  void run(const DtAlgorithmManager& mgr = DtAlgorithmManager());
86 
88  void taskComplete();
89 
90  typedef DtMutex Mutex;
91 
92  mutable Mutex myMutex;
93  std::string myObstaclesType;
94  std::string myPathType;
97  double myBuffer;
98  boost::scoped_ptr<Points> myPoints;
99  boost::shared_ptr<DtAsyncJobMapEntry> myJobEntry;
100  std::string myMessage;
101 };

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)