VR-Forces 4.8 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 };
std::string myObstaclesType
Definition: luaPathJob.h:93
Severity
Definition: algorithmManager.h:29
luabind::object getDebugObject(lua_State *L)
Retrieve debug data, if available. Default return value is an empty table.
Definition: luaPathJob.h:50
DtMutex Mutex
Definition: luaPathJob.h:90
Definition: asciiSerializable.h:33
Interface for getting asynchronously computed data into Lua.
Definition: luaAsyncJob.h:29
virtual bool deserialize(const DtString &)=0
This function should take the string that was serialized via serialize() and fill this object with th...
boost::scoped_ptr< Points > myPoints
Definition: luaPathJob.h:98
std::string myMessage
Definition: luaPathJob.h:100
virtual DtString serialize()=0
The following characters are reserved and cannot be used in serialization: &#39;|&#39;, &#39;:&#39;.
virtual void cancel(lua_State *L)
Currently a no-op.
Definition: luaPathJob.h:53
std::vector< DtLocation3D > Points
Definition: luaPathJob.h:30
#define DT_DLL_vrfLua
This file is used to determine how to build.
Definition: vrfLuaDefines.h:25
virtual luabind::object getObject(lua_State *L, int &index, std::string &message)=0
Retrieve current value.
std::string myPathType
Definition: luaPathJob.h:94
DtLocation3D myDest
Definition: luaPathJob.h:96
Handle to async job.
Definition: asyncJobMapEntry.h:29
virtual DtString objectType() const =0
Should return the string name of this object.
boost::shared_ptr< DtAsyncJobMapEntry > myJobEntry
Definition: luaPathJob.h:99
DtLocation3D myStart
Definition: luaPathJob.h:95
double myBuffer
Definition: luaPathJob.h:97
The simulation engine is controlled by a single,top-level class called the Simulation Manager...
Definition: simManager.h:102
Lua object class which represents a feature navigation task.
Definition: luaPathJob.h:27
Mutex myMutex
Definition: luaPathJob.h:92
General interface which can be passed into an algorithm to control its behavior.
Definition: algorithmManager.h:24
char * dest
Definition: lz4.h:434
A location3D is a point in space, i.e. a geocentric coordinate.
Definition: scriptGeometry.h:22

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)