#ifndef _APP_FUNC_H #define _APP_FUNC_H #include #include "ColorItem.h" #include "PlineList.h" #include "ControlPoint2d.h" #define FUNC_EXPORT _declspec(dllexport) //初始化场景 extern "C" FUNC_EXPORT void Func_InitView(void* hwnd, char* rootPath); extern "C" FUNC_EXPORT void Func_InitViewWithColor(void* hwnd, int r = 200, int g = 200, int b = 200); //绘制一帧 extern "C" FUNC_EXPORT void Func_RenderView(); //场景居中 extern "C" FUNC_EXPORT void Func_ZoomView(); //创建2维网格对象 extern "C" FUNC_EXPORT int Func_CreateMesh(unsigned int numx, unsigned int numy, double x0, double y0, double dx, double dy, double* values); //设置Z值范围 extern "C" FUNC_EXPORT void Func_SetZRange(double zMin, double zMax); //设置颜色列表 extern "C" FUNC_EXPORT void Func_SetColorList(const std::vector& colorList); //设置等值线 extern "C" FUNC_EXPORT void Func_SetContourList(const std::vector& contourList); //设置断层线 extern "C" FUNC_EXPORT void Func_SetFaultList(const std::vector& faultList, bool isOffset); //设置控制点 extern "C" FUNC_EXPORT void Func_SetControlPoint(const std::vector&pointList); //设置边界线 extern "C" FUNC_EXPORT void Func_SetBoundary(const PlineList& bound); //设置其它线 extern "C" FUNC_EXPORT void Func_SetOtherLines(const PlineList& otherLines); //获取Z值 extern "C" FUNC_EXPORT double* Func_GetValue(); //获取等值线 extern "C" FUNC_EXPORT void Func_GetContourList(std::vector& contourList); //释放内存 extern "C" FUNC_EXPORT void Func_FreeAll(); //屏幕上画圆 //(ipx,ipy):鼠标位置,rad:半径 extern "C" FUNC_EXPORT void Func_DrawCircle(int ipx, int ipy, float rad); extern "C" FUNC_EXPORT void Func_ClearCircle();//擦除屏幕上圆 //抬升操作 //(ipx,ipy):鼠标位置,rad:半径,per:压力,type:方式类型(0方式一,1方式二) //wellRad:井点约束半径。默认为0,表示不约束 extern "C" FUNC_EXPORT void Func_StrechUp(int ipx, int ipy, float rad, float per, int type, float wellrad = 0); //下压操作,参数同上 extern "C" FUNC_EXPORT void Func_PushDown(int ipx, int ipy, float rad, float per, int type, float wellrad = 0); //涂抹拖拽操作,(startx,starty):拖拽的鼠标起始位置,(endx,endy):拖拽的鼠标拖拽的位置,其他参数同上 extern "C" FUNC_EXPORT void Func_DragAway(int startx, int starty, int endx, int endy, float rad, float per, int type, float wellrad = 0); //平滑操作,参数同上 extern "C" FUNC_EXPORT void Func_Smooth(int ipx, int ipy, float rad, float per, int type, float wellrad = 0); //平滑操作,参数同上 extern "C" FUNC_EXPORT void Func_OffsetFault(); //平滑操作,参数同上 extern "C" FUNC_EXPORT void Func_CutContourByFault(); //显示隐藏网格,等值线,断层,控制点,边界线,网格z值顶点 //true:显示, false:隐藏 extern "C" FUNC_EXPORT void Func_ShowMesh(bool bShow); extern "C" FUNC_EXPORT void Func_ShowIsopleth(bool bShow); extern "C" FUNC_EXPORT void Func_ShowControlPoint(bool bShow); extern "C" FUNC_EXPORT void Func_ShowFault(bool bShow); extern "C" FUNC_EXPORT void Func_ShowBound(bool bShow); extern "C" FUNC_EXPORT void Func_ShowOtherLines(bool bShow); extern "C" FUNC_EXPORT void Func_ShowMeshVertex(bool bShow); //设置属性 extern "C" FUNC_EXPORT void Func_SetProperty(double isopStep, int markStep, double minIsop, double maxIsop, double zMin, double zMax); extern "C" FUNC_EXPORT void Func_GetProperty(double& isopStep, int& markStep, double& minIsop, double& maxIsop, double& zMin, double& zMax); /*******************undo/redo相关功能*******************/ //开始一次操作(抬升,下压,拖拽,平滑任意操作) extern "C" FUNC_EXPORT void Func_StartCommand(); //结束一次操作 extern "C" FUNC_EXPORT void Func_EndCommand(); //撤销上一次操作 extern "C" FUNC_EXPORT void Func_Undo(); //重做下一次操作 extern "C" FUNC_EXPORT void Func_Redo(); //是否可以撤销 extern "C" FUNC_EXPORT bool Func_CanUndo(); //是否可以重做 extern "C" FUNC_EXPORT bool Func_CanRedo(); /*******************二期新增功能*******************/ //Func_StrechUp\Func_PushDown\Func_DragAway\Func_Smooth加了井点约束范围的参数 //井点Z值绑定功能 //这个功能支持undo/redo,可以在调用之前加Func_StartCommand,调用结束加Func_EndCommand extern "C" FUNC_EXPORT void Func_WellAdaptiveAdjust(float rad, float range, float miu); //开启查看Z值 extern "C" FUNC_EXPORT void Func_EnablePickMeshZ(bool bEnable); //设置井点文字颜色 extern "C" FUNC_EXPORT void Func_SetWellColor(int r=255, int g=255, int b = 255); //设置井点文字尺寸 extern "C" FUNC_EXPORT void Func_SetWellTxtSize(float size); //填充断层 extern "C" FUNC_EXPORT void Func_EnableFillFault(bool bEnable); //过滤等值线 //这个功能支持undo/redo,可以在调用之前加Func_StartCommand,调用结束加Func_EndCommand extern "C" FUNC_EXPORT void Func_FilterMesh(float throld); //打开/退出绘制多边形(可以在多边形操作窗口初始化的时候打开,窗口关闭的时候退出) extern "C" FUNC_EXPORT void Func_EnableDrawPolygon(bool bEnable); //多边形拉升 //闭合多边形后,就可以调用了 //per:强度,wellRad:井点约束半径。默认为0,表示不约束 //这个功能支持undo/redo,可以在调用之前加Func_StartCommand,调用结束加Func_EndCommand extern "C" FUNC_EXPORT void Func_StretchlUpPolygon(float per, bool state, float wellRad = 0); //多边形下压,用法同上 //这个功能支持undo/redo,可以在调用之前加Func_StartCommand,调用结束加Func_EndCommand extern "C" FUNC_EXPORT void Func_PushDownPolygon(float per, bool state, float wellRad = 0); //多边形平滑,用法同上 //这个功能支持undo/redo,可以在调用之前加Func_StartCommand,调用结束加Func_EndCommand extern "C" FUNC_EXPORT void Func_SmoothPolygon(float per, bool state, float wellRad = 0); //网格优化,用法同Func_StrechUp //这个功能支持undo/redo,可以在调用之前加Func_StartCommand,调用结束加Func_EndCommand extern "C" FUNC_EXPORT void Func_OptimizeMesh(int startx, int starty, int endx, int endy, float rad, float per); //获取显示位置 //(px,py)表示窗口左上角对应网格上的坐标 // scale表示网格缩放比例(一个像素多少米) extern "C" FUNC_EXPORT void Func_GetViewPos(double& px, double& py, double& scale); //设置显示位置 extern "C" FUNC_EXPORT void Func_SetViewPos(double px, double py, double scale); //获取鼠标位置 extern "C" FUNC_EXPORT void Func_GetMousePos(double& px, double& py); //设置鼠标位置 extern "C" FUNC_EXPORT void Func_SetMousePos(double px, double py); //检测表达式合法性 extern "C" FUNC_EXPORT bool Func_CompileExpressionZ(char* expressionStr); //Z值运算 extern "C" FUNC_EXPORT bool Func_CalculateZByExpression(char* expressionStr); //获取最小z值 extern "C" FUNC_EXPORT double Func_GetZMin(); //获取最大z值 extern "C" FUNC_EXPORT double Func_GetZMax(); //设置显示小数位数 extern "C" FUNC_EXPORT void Func_SetDecimalNumber(int num); //获取显示的小数位数 extern "C" FUNC_EXPORT int Func_GetDecimalNumber(); //设置断层控制点状态 extern "C" FUNC_EXPORT void Func_SetFaultControlState(bool state); //断层控制点状态 extern "C" FUNC_EXPORT bool Func_GetFaultControlState(); //井点校正 extern "C" FUNC_EXPORT bool Func_RectificationMeshWellCompute(double deltaz, int type, double factor); //井点校正 线程终止 extern "C" FUNC_EXPORT void Func_MeshWellThreadStop(); //井点校正 进度 extern "C" FUNC_EXPORT int Func_GetWellRectificationProgress(); // extern "C" FUNC_EXPORT void Func_UpdateObjectView(); #endif