2025-05-02 10:31:47 +02:00
|
|
|
#include "bind_geodetic.h"
|
2025-04-12 09:07:02 +02:00
|
|
|
#include "bind_satdump.h"
|
|
|
|
|
#include "common/geodetic/geodetic_coordinates.h"
|
|
|
|
|
|
|
|
|
|
namespace satdump
|
|
|
|
|
{
|
|
|
|
|
namespace script
|
|
|
|
|
{
|
|
|
|
|
namespace
|
|
|
|
|
{
|
|
|
|
|
static CScriptGeodeticCoords *ScriptGeodecticCoordsFactory() { return new CScriptGeodeticCoords(); }
|
2025-05-02 10:31:47 +02:00
|
|
|
static CScriptGeodeticCoords *ScriptGeodecticCoordsFactory2(double lat, double lon, double alt) { return new CScriptGeodeticCoords(lat, lon, alt); }
|
|
|
|
|
} // namespace
|
2025-04-12 09:07:02 +02:00
|
|
|
|
|
|
|
|
namespace pro
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void registerGeodetic(asIScriptEngine *engine)
|
|
|
|
|
{
|
|
|
|
|
engine->SetDefaultNamespace("geodetic");
|
|
|
|
|
|
|
|
|
|
////////////////////////////////
|
|
|
|
|
//////// Core Image Class
|
|
|
|
|
////////////////////////////////
|
|
|
|
|
|
|
|
|
|
// Base type
|
|
|
|
|
engine->RegisterObjectType("geodetic_coords_t", sizeof(CScriptGeodeticCoords), asOBJ_REF);
|
|
|
|
|
|
|
|
|
|
// Constructors
|
|
|
|
|
engine->RegisterObjectBehaviour("geodetic_coords_t", asBEHAVE_FACTORY, "geodetic_coords_t@ f()", asFUNCTION(ScriptGeodecticCoordsFactory), asCALL_CDECL);
|
2025-05-02 10:31:47 +02:00
|
|
|
engine->RegisterObjectBehaviour("geodetic_coords_t", asBEHAVE_FACTORY, "geodetic_coords_t@ f(double, double, double)", asFUNCTION(ScriptGeodecticCoordsFactory2), asCALL_CDECL);
|
2025-04-12 09:07:02 +02:00
|
|
|
|
|
|
|
|
// Angelscript stuff
|
|
|
|
|
engine->RegisterObjectBehaviour("geodetic_coords_t", asBEHAVE_ADDREF, "void f()", asMETHOD(CScriptGeodeticCoords, AddRef), asCALL_THISCALL);
|
|
|
|
|
engine->RegisterObjectBehaviour("geodetic_coords_t", asBEHAVE_RELEASE, "void f()", asMETHOD(CScriptGeodeticCoords, Release), asCALL_THISCALL);
|
|
|
|
|
|
|
|
|
|
// Copy operator
|
2025-05-02 10:31:47 +02:00
|
|
|
engine->RegisterObjectMethod("geodetic_coords_t", "geodetic_coords_t &opAssign(const geodetic_coords_t &in)",
|
|
|
|
|
asMETHODPR(CScriptGeodeticCoords, operator=, (const CScriptGeodeticCoords &), CScriptGeodeticCoords &), asCALL_THISCALL);
|
2025-04-12 09:07:02 +02:00
|
|
|
|
|
|
|
|
// Other funcs
|
|
|
|
|
engine->RegisterObjectMethod("geodetic_coords_t", "geodetic_coords_t@ toRads()", asMETHOD(CScriptGeodeticCoords, toRads), asCALL_THISCALL);
|
|
|
|
|
engine->RegisterObjectMethod("geodetic_coords_t", "geodetic_coords_t@ toDegs()", asMETHOD(CScriptGeodeticCoords, toDegs), asCALL_THISCALL);
|
2025-05-02 10:31:47 +02:00
|
|
|
|
|
|
|
|
// Values
|
|
|
|
|
engine->RegisterObjectProperty("geodetic_coords_t", "double lat", asOFFSET(geodetic::geodetic_coords_t, lat), asOFFSET(CScriptGeodeticCoords, p), true);
|
|
|
|
|
engine->RegisterObjectProperty("geodetic_coords_t", "double lon", asOFFSET(geodetic::geodetic_coords_t, lon), asOFFSET(CScriptGeodeticCoords, p), true);
|
|
|
|
|
engine->RegisterObjectProperty("geodetic_coords_t", "double alt", asOFFSET(geodetic::geodetic_coords_t, alt), asOFFSET(CScriptGeodeticCoords, p), true);
|
2025-04-12 09:07:02 +02:00
|
|
|
}
|
2025-05-02 10:31:47 +02:00
|
|
|
} // namespace script
|
|
|
|
|
} // namespace satdump
|