增加依赖
This commit is contained in:
1 parent
710566e65b
commit
c7102cfe25
47 files changed
+16656
No files matched your search
@@ -0,0 +1,150 @@
|
||||
#pragma once
|
||||
|
||||
#if defined(_WIN32)
|
||||
#if defined(MODERNGLUE_EXPORTS)
|
||||
#define GLUE_API __declspec(dllexport)
|
||||
#else
|
||||
#define GLUE_API __declspec(dllimport)
|
||||
#endif
|
||||
#else
|
||||
#define GLUE_API
|
||||
#endif
|
||||
|
||||
namespace _cgal
|
||||
{
|
||||
struct Pt2d
|
||||
{
|
||||
double x, y;
|
||||
};
|
||||
|
||||
struct Pt3d
|
||||
{
|
||||
double x, y, z;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
struct CgalArray
|
||||
{
|
||||
T *pData;
|
||||
int count;
|
||||
};
|
||||
|
||||
typedef CgalArray<Pt2d> Pt2dArr;
|
||||
typedef CgalArray<Pt3d> Pt3dArr;
|
||||
|
||||
// 多边形
|
||||
struct Polygon2d
|
||||
{
|
||||
Pt2dArr vertices;
|
||||
};
|
||||
|
||||
struct Polygon3d
|
||||
{
|
||||
Pt3dArr vertices;
|
||||
};
|
||||
|
||||
typedef CgalArray<Polygon2d> Polygon2dList;
|
||||
typedef CgalArray<Polygon3d> Polygon3dList;
|
||||
|
||||
// 多边形带泂 polygon with holes
|
||||
struct Pwh2d
|
||||
{
|
||||
Polygon2d outer_boundary;
|
||||
Polygon2dList inner_holes;
|
||||
};
|
||||
|
||||
// 带洞多边形数组
|
||||
typedef CgalArray<Pwh2d> Pwh2dList;
|
||||
|
||||
typedef CgalArray<int> IntArray;
|
||||
|
||||
enum Bounded_side
|
||||
{
|
||||
eOutside = -1,
|
||||
eIsPoint,
|
||||
eOnside,
|
||||
eInside,
|
||||
SIDE_ERROR,
|
||||
};
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
{
|
||||
// 哪个dll申请内存,就在哪个dll内部释放.
|
||||
// 当 这里的函数以参数的e形式传出了 Pt2dArr 等数据块时,需要调用下面的free函数来释放
|
||||
// 当 向这里的接口传入 Pt2dArr 等数据块时, 千万不要调用下面的free函数来释放.
|
||||
GLUE_API void mg_cgal_free_Pt2dArray(_cgal::Pt2dArr &arr);
|
||||
GLUE_API void mg_cgal_free_Pt3dArray(_cgal::Pt3dArr &arr);
|
||||
|
||||
GLUE_API void mg_cgal_free_Polygon2d(_cgal::Polygon2d &poly);
|
||||
GLUE_API void mg_cgal_free_Polygon3d(_cgal::Polygon3d &POly);
|
||||
|
||||
GLUE_API void mg_cgal_free_Polygon2dList(_cgal::Polygon2dList &arr);
|
||||
GLUE_API void mg_cgal_free_Polygon3dList(_cgal::Polygon3dList &arr);
|
||||
|
||||
GLUE_API void mg_cgal_free_Pwh2d(_cgal::Pwh2d &pwh);
|
||||
GLUE_API void mg_cgal_free_Pwh2dList(_cgal::Pwh2dList &arr);
|
||||
|
||||
GLUE_API void mg_cgal_free_IntArray(_cgal::IntArray &arr);
|
||||
|
||||
GLUE_API bool mg_cgal_less_xy(const _cgal::Pt2d &pt1, const _cgal::Pt2d &pt2);
|
||||
GLUE_API bool mg_cgal_less_xyz(const _cgal::Pt3d &pt1, const _cgal::Pt3d &pt2);
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// 对pts做delaunary三角化,并保存成GePolyFaceMesh结构
|
||||
GLUE_API void mg_cgal_delaunayTriangulationMesh(const _cgal::Pt3dArr &arPts
|
||||
, _cgal::Pt3dArr &vertexArray
|
||||
, _cgal::IntArray &faceArray);
|
||||
|
||||
GLUE_API void mg_cgal_delaunayTriangulationMeshWithHolds(const _cgal::Pt3dArr &arPts
|
||||
, const _cgal::Polygon3dList &holds
|
||||
, _cgal::Pt3dArr &vertexArray
|
||||
, _cgal::IntArray &faceArray);
|
||||
|
||||
// 计算一堆点的凸包曲线
|
||||
// 传出是一个point数组,按顺序组成一条polygon
|
||||
GLUE_API void mg_cgal_calcConvexHull2D_2d_2d(const _cgal::Pt2dArr &arPts, _cgal::Pt2dArr &poly);
|
||||
|
||||
GLUE_API void mg_cgal_calcConvexHull2D_3d_2d(const _cgal::Pt3dArr &arPts, _cgal::Pt2dArr &poly);
|
||||
|
||||
GLUE_API void mg_cgal_calcConvexHull2D_3d_3d(const _cgal::Pt3dArr &arPts, _cgal::Pt3dArr &poly);
|
||||
|
||||
GLUE_API _cgal::Bounded_side mg_cgal_boundary_check(const _cgal::Pt2d &pt, const _cgal::Pwh2d &gepwh);
|
||||
|
||||
GLUE_API bool mg_cgal_is_vaild_polygon_with_hole(const _cgal::Pwh2d &geP);
|
||||
GLUE_API bool mg_cgal_is_vaild_polygon(const _cgal::Polygon2d &geP);
|
||||
|
||||
GLUE_API bool mg_cgal_is_counterclockwise_with_hole(const _cgal::Pwh2d &geP);
|
||||
GLUE_API bool mg_cgal_is_counterclockwise(const _cgal::Pt2d &ptS
|
||||
, const _cgal::Pt2d &ptM
|
||||
, const _cgal::Pt2d &ptE );
|
||||
|
||||
GLUE_API bool mg_cgal_is_intersect(const _cgal::Pwh2d &geP, const _cgal::Pwh2d &geQ);
|
||||
|
||||
GLUE_API void mg_cgal_intersect(const _cgal::Pwh2d &geP
|
||||
, const _cgal::Pwh2d &geQ
|
||||
, _cgal::Pwh2dList &gepwhlst);
|
||||
|
||||
GLUE_API bool mg_cgal_join(const _cgal::Pwh2d &geP
|
||||
, const _cgal::Pwh2d &geQ
|
||||
, _cgal::Pwh2d &gepwh);
|
||||
|
||||
GLUE_API void mg_cgal_difference( const _cgal::Pwh2d &geP
|
||||
, const _cgal::Pwh2d &geQ
|
||||
, _cgal::Pwh2dList &gepwhlst);
|
||||
|
||||
GLUE_API void mg_cgal_symmetric_difference( const _cgal::Pwh2d &geP
|
||||
, const _cgal::Pwh2d &geQ
|
||||
, _cgal::Pwh2dList &gepwhlst);
|
||||
|
||||
GLUE_API void mg_cgal_sort_xy(const _cgal::Polygon2d &ge, _cgal::Polygon2d &out);
|
||||
|
||||
GLUE_API void mg_cgal_sort_yx(const _cgal::Polygon2d &ge, _cgal::Polygon2d &out);
|
||||
|
||||
GLUE_API void mg_cgal_convexHull2d(const _cgal::Pt2dArr &input, _cgal::Pt2dArr &output);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,55 @@
|
||||
#pragma once
|
||||
|
||||
#if defined(_WIN32)
|
||||
#if defined(MODERNGLUE_EXPORTS)
|
||||
#define GLUE_API __declspec(dllexport)
|
||||
#else
|
||||
#define GLUE_API __declspec(dllimport)
|
||||
#endif
|
||||
#else
|
||||
#define GLUE_API
|
||||
#endif
|
||||
|
||||
// 当 DLL 收到网络数据时,通过这个指针回调 ARX
|
||||
// pData: 接收到的原始字节流(注意:可能不是以 \0 结尾的!)
|
||||
// length: 字节流的长度
|
||||
// pUserData: 用户透传指针(ARX 传什么进来,这里就原样送回去)
|
||||
typedef size_t(*mg_curl_httpWriteCallback)(const char *pData, size_t length, void *pUserData);
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// 全局初始化(在 ARX 插件加载 acrxEntryPoint 的 Init 阶段调用)
|
||||
GLUE_API void mg_curl_httpGlobalInit();
|
||||
|
||||
// 全局清理(在 ARX 插件卸载阶段调用)
|
||||
GLUE_API void mg_curl_httpGlobalCleanup();
|
||||
|
||||
// 纯粹的 HTTP POST 接口
|
||||
// url: 请求地址
|
||||
// headers: 字符串数组,存放请求头 (例如 "Content-Type: application/json")
|
||||
// headerCount: 请求头的数量
|
||||
// body: 准备好的 JSON 字符串
|
||||
// cb: ARX 提供的接收数据的回调函数
|
||||
// pUserData: ARX 透传的上下文(比如 &response)
|
||||
// 返回值: CURLcode 对应的整数(0 表示成功)
|
||||
GLUE_API int mg_curl_httpPost(
|
||||
const char *url,
|
||||
const char **headers,
|
||||
int headerCount,
|
||||
const char *body,
|
||||
mg_curl_httpWriteCallback cb,
|
||||
void *pUserData);
|
||||
|
||||
// 纯粹的 HTTP GET 接口 (用于获取模型列表)
|
||||
GLUE_API int mg_curl_httpGet(
|
||||
const char *url,
|
||||
const char **headers,
|
||||
int headerCount,
|
||||
mg_curl_httpWriteCallback cb,
|
||||
void *pUserData);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,21 @@
|
||||
#pragma once
|
||||
|
||||
#if defined(_WIN32)
|
||||
#if defined(MODERNGLUE_EXPORTS)
|
||||
#define GLUE_API __declspec(dllexport)
|
||||
#else
|
||||
#define GLUE_API __declspec(dllimport)
|
||||
#endif
|
||||
#else
|
||||
#define GLUE_API
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
GLUE_API int mg_random_int(const int &min, const int &max);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
Reference in new issue
Block a user