return *getSingletonPtr();
}
+ /**
+ * Check whether ghost type has already been initialized.
+ */
+ static bool isInit()
+ {
+ return getSingletonPtr();
+ }
+
/**
* Register a base class for this ghost. The base class needs to be
* registers on its own before it can be used as base class.
.member("base", &DoubleDerived2::getBase)
.method("doIt", &DoubleDerived2::doSomeBaseWork);
+ VERIFY( Ghost<BasePtr>::isInit() );
nasal::to_nasal(c, DoubleDerived2Ptr());
BasePtr d( new Derived );
#include <simgear/nasal/cppbind/NasalHash.hxx>
#include <simgear/nasal/cppbind/Ghost.hxx>
+#include <simgear/math/SGMath.hxx>
#include <simgear/misc/sg_path.hxx>
#include <boost/function.hpp>
return ref;
}
+ //------------------------------------------------------------------------------
+ naRef to_nasal_helper(naContext c, const SGGeod& pos)
+ {
+ nasal::Hash hash(c);
+ hash.set("lat", pos.getLatitudeDeg());
+ hash.set("lon", pos.getLongitudeDeg());
+ hash.set("elevation", pos.getElevationM());
+ return hash.get_naRef();
+ }
+
//----------------------------------------------------------------------------
naRef to_nasal_helper(naContext c, const SGPath& path)
{
#include <string>
#include <vector>
+class SGGeod;
class SGPath;
namespace nasal
*/
naRef to_nasal_helper(naContext c, const naRef& ref);
+ naRef to_nasal_helper(naContext c, const SGGeod& pos);
+
naRef to_nasal_helper(naContext c, const SGPath& path);
/**