You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

772 lines
19 KiB
C++

1 month ago
#include "pch.h"
#include "AppFunc.h"
#include "Interface.h"
typedef void(*CPPCallbackMousePos)(double mouseX, double mouseY);
typedef void(*CPPCallbackViewStatus)(double pX, double pY, double scale);
CPPCallbackMousePos mouseMoveEvent = nullptr;
CPPCallbackViewStatus viewStatusEvent = nullptr;
extern "C" __declspec(dllexport)
void SetMouseMoveEvent(CPPCallbackMousePos callback) {
mouseMoveEvent = callback;
}
extern "C" __declspec(dllexport)
void SetViewStatusEvent(CPPCallbackViewStatus callback) {
viewStatusEvent = callback;
}
extern "C" __declspec(dllexport)
void Editor_InitView(void* hwnd, LPCTSTR imagePath)
{
char caImagePath[256];
memset(caImagePath, 0, sizeof(char) * 256);
CString strImgPath(imagePath);
if (!strImgPath.IsEmpty()) {
strncpy_s(caImagePath, imagePath, strImgPath.GetLength());
}
Func_InitView(hwnd, caImagePath);
}
extern "C" __declspec(dllexport)
void Editor_InitViewWithColor(void* hwnd, int r, int g, int b)
{
Func_InitViewWithColor(hwnd, r, g, b);
}
extern "C" __declspec(dllexport)
void Editor_RenderView()
{
Func_RenderView();
}
extern "C" __declspec(dllexport)
void Editor_ZoomView()
{
Func_ZoomView();
}
extern "C" __declspec(dllexport)
int Editor_CreateMesh(CXy* pXy, LPCTSTR contourLayer, LPCTSTR faultLayer, LPCTSTR pointLayer, LPCTSTR otherLineLayer) {
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> z ֵС<D6B5><D0A1> 0 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ 0
POSITION meshPos = pXy->FindFirstElement(DOUBLEFOX_MESH);
if (meshPos == nullptr)
{
return 0;
}
COne *pOne = pXy->GetAt(meshPos);
CMesh* pMesh = (CMesh*)(pOne->GetValue());
CDimension3D* pDimension = pMesh->GetDfg();
int numx = pDimension->xnum();
int numy = pDimension->ynum();
double dx0 = pDimension->xmin();
double dy0 = pDimension->ymin();
double dStepX = pDimension->dx();
double dStepY = pDimension->dy();
double* pU = pDimension->u;
// <20><><EFBFBD><EFBFBD><5A><D6B5>Χ
Func_SetZRange(pDimension->range[0], pDimension->range[1]);
//int nReturn = Func_LoadFile("C:\\temp\\k12.kev");
int nReturn = Func_CreateMesh(numx, numy, dx0, dy0, dStepX, dStepY, pU);
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ
vector<ColorItem> colors;
int nColorCount = pMesh->color.GetCount();
for (int i = 0; i < nColorCount; i++) {
CColorItem colorMesh = pMesh->color.GetColorItem(i);
ColorItem colorItem;
colorItem.r = colorMesh.R();
colorItem.g = colorMesh.G();
colorItem.b = colorMesh.B();
colorItem.a = 1;
colorItem.c = colorMesh.m_bContinue;
colorItem.val = colorMesh.z;
colors.push_back(colorItem);
}
Func_SetColorList(colors);
// <20><><EFBFBD>öϲ<C3B6>
std::vector<PlineList> vecFault;
TakeLayerLines(pXy, faultLayer, vecFault, false);
if (vecFault.size() > 0)
{
Func_SetFaultList(vecFault, false);
}
// <20><><EFBFBD>õ<EFBFBD>ֵ<EFBFBD><D6B5>
std::vector<PlineList> vecContour;
TakeLayerLines(pXy, contourLayer, vecContour, true);
if (vecContour.size() > 0) {
Func_SetContourList(vecContour);
}
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
std::vector<PlineList> vecOtherLines;
TakeLayerLines(pXy, otherLineLayer, vecOtherLines, false);
if (vecOtherLines.size() > 0)
{
Func_SetOtherLines(vecOtherLines[0]);
}
// <20><><EFBFBD>ÿ<EFBFBD><C3BF>Ƶ<EFBFBD>
if (pointLayer && lstrlen(pointLayer) > 0)
{
std::vector<ControlPoint2d> ptControl;
NBase::CPositionList lstPoint;
pXy->GetElement(pointLayer, lstPoint, true, false);
if (lstPoint.GetCount() > 0)
{
POSITION pos = lstPoint.GetHeadPosition();
POSITION pt;
std::string strLayer;
while (pos) {
pt = lstPoint.GetNext(pos);
COne *pOne = (COne *)pXy->GetAt(pt);
if (pOne->GetType() != DOUBLEFOX_POINT) {
continue;
}
CPointNameEx* pPoint = (CPointNameEx*)(pOne->GetValue());
Point2D pt(pPoint->x0, pPoint->y0);
CString cstrName = pPoint->GetName();
std::string strName;
strName.assign(cstrName.GetBuffer(), cstrName.GetLength());
ControlPoint2d cpt2d(pt, pPoint->z0, strName);
cstrName.ReleaseBuffer();
ptControl.push_back(cpt2d);
}
}
if (ptControl.size() > 0)
{
Func_SetControlPoint(ptControl);
}
}
Func_ShowMesh(true);
Func_ShowMeshVertex(false);
Func_ZoomView();
return nReturn;
}
extern "C" __declspec(dllexport)
void Editor_StartCommand() {
Func_StartCommand();
}
extern "C" __declspec(dllexport)
void Editor_EndCommand() {
Func_EndCommand();
}
extern "C" __declspec(dllexport)
void Editor_StrechUp(int ipx, int ipy, float rad, float per, int type, float wellrad =0) {
Func_StrechUp(ipx, ipy, rad, per, type, wellrad);
}
extern "C" __declspec(dllexport)
void Editor_StrechDown(int ipx, int ipy, float rad, float per, int type, float wellrad = 0) {
Func_PushDown(ipx, ipy, rad, per, type, wellrad);
}
extern "C" __declspec(dllexport)
void Editor_DragAway(int startx, int starty, int endx, int endy, float rad, float per, int type, float wellrad = 0)
{
Func_DragAway(startx, starty, endx, endy, rad, per, type, wellrad);
}
extern "C" __declspec(dllexport)
void Editor_Smooth(int ipx, int ipy, float rad, float per, int type, float wellrad = 0)
{
Func_Smooth(ipx, ipy, rad, per, type, wellrad);
}
extern "C" __declspec(dllexport)
void Editor_DrawCircle(int ipx, int ipy, float rad) {
Func_DrawCircle(ipx, ipy, rad);
}
extern "C" __declspec(dllexport)
void Editor_ClearCircle() {
Func_ClearCircle();
}
extern "C" __declspec(dllexport)
void Editor_OffsetFault()
{
Func_OffsetFault();
}
extern "C" __declspec(dllexport)
void Editor_FreeAll() {
Func_FreeAll();
}
extern "C" __declspec(dllexport)
bool Editor_CanUndo()
{
return Func_CanUndo();
}
extern "C" __declspec(dllexport)
bool Editor_CanRedo()
{
return Func_CanRedo();
}
extern "C" __declspec(dllexport)
void Editor_Undo() {
Func_Undo();
}
extern "C" __declspec(dllexport)
void Editor_Redo() {
Func_Redo();
}
bool HaveCurveViewName(CLayer* pLayer) {
CHowToViewCurve* pHowToView = pLayer->HowToViewCurve;
if (pHowToView == nullptr || pHowToView->GetCount() == 0) {
return false;
}
for (int i = 0; i < pHowToView->GetCount(); i++) {
CCurveView* pView = pHowToView->GetAt(i);
if (pView->GetType() == CurveInName || pView->GetType() == CurveInNameAny) {
return true;
}
}
return false;
}
extern "C" __declspec(dllexport)
void Editor_DeleteArray(int64_t* array)
{
delete[] array;
}
/**
* <EFBFBD><EFBFBD><EFBFBD>ܵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݻ<EFBFBD>д
*
* \param pXy ͼ<EFBFBD><EFBFBD>
* \param curveLayer Ҫд<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><EFBFBD>
* \param destroyArray Ҫ<EFBFBD>Ƴ<EFBFBD><EFBFBD><EFBFBD>ͼԪ POSITION<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼԪ<EFBFBD><EFBFBD>δ<EFBFBD><EFBFBD><EFBFBD>Ƴ<EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>ϲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> Editor_DeleteArray <EFBFBD>ͷ<EFBFBD><EFBFBD>ڴ<EFBFBD>
* \param destroyLength Ҫ<EFBFBD>Ƴ<EFBFBD><EFBFBD><EFBFBD>
* \param insertedArray <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼԪ POSITION<EFBFBD><EFBFBD>ͼԪ<EFBFBD>Ѿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> Editor_DeleteArray <EFBFBD>ͷ<EFBFBD><EFBFBD>ڴ<EFBFBD>
* \param insertedLength
* \param layerName <EFBFBD><EFBFBD>ֵ<EFBFBD>߱<EFBFBD>עͼ<EFBFBD><EFBFBD>
* \param layerNoName <EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD>ޱ<EFBFBD>עͼ<EFBFBD><EFBFBD>
* \return
*/
extern "C" __declspec(dllexport)
bool Editor_PushbackData(CXy * pXy, LPCTSTR curveLayer, int64_t** destroyArray, int64_t& destroyLength, int64_t** insertedArray, int64_t& insertedLength,
LPCTSTR layerName, LPCTSTR layerNoName) {
double* pValues = Func_GetValue();
double zMin = Func_GetZMin();
double zMax = Func_GetZMax();
POSITION meshPos = pXy->FindFirstElement(DOUBLEFOX_MESH);
if (meshPos == nullptr)
{
return false;
}
COne *pOne = pXy->GetAt(meshPos);
CMesh* pMesh = (CMesh*)(pOne->GetValue());
//CDimension3D* pDimension = pMesh->GetDfg();
CSize size = pMesh->size();
for (int i = 0; i < size.cx; i++) {
for (int j = 0; j < size.cy; j++)
{
((CMeshBase *)pMesh)->SetValue(i, j, pValues[i + j * size.cx]);
}
}
pMesh->SetM(zMin, zMax);
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ
1 month ago
//double dZMinOld = 0;
//double dZMaxOld = 0;
//pMesh->color.GetZRange(dZMinOld, dZMaxOld);
//CArray<CColorItem, CColorItem> ColorList;
//vector<ColorItem> colors;
//int nColorCount = pMesh->color.GetCount();
//for (int i = 0; i < nColorCount; i++) {
// CColorItem colorMesh = pMesh->color.GetColorItem(i);
// colorMesh.z = zMin + ((zMax - zMin) * (colorMesh.z - dZMinOld) / (dZMaxOld - dZMinOld));
// ColorList.Add(colorMesh);
//}
//pMesh->color.SetZRange(zMin, zMax);
//pMesh->color.SetColor(ColorList);
//pMesh->UpdateColorRuler();
//pMesh->GetBitmap();
// <20><>ȡ<EFBFBD>ɵ<EFBFBD><C9B5><EFBFBD>ɫ<EFBFBD><C9AB>Χ
1 month ago
double dZMinOld = 0;
double dZMaxOld = 0;
pMesh->color.GetZRange(dZMinOld, dZMaxOld);
1 month ago
// <20><><EFBFBD><EFBFBD><EFBFBD>ɷ<EFBFBD>Χ<EFBFBD><CEA7><EFBFBD>·<EFBFBD>Χ<EFBFBD><CEA7>ͬ<EFBFBD><CDAC>ֻ<EFBFBD><D6BB><EFBFBD>·<EFBFBD>Χ<EFBFBD><CEA7><EFBFBD><EFBFBD><EFBFBD>ط<EFBFBD><D8B7><EFBFBD><EFBFBD><EFBFBD>ɫ
if (fabs(dZMinOld - zMin) > 1e-6 || fabs(dZMaxOld - zMax) > 1e-6)
{
pMesh->color.SetZRange(zMin, zMax);
//pMesh->UpdateColorRuler();
1 month ago
}
pMesh->GetBitmap();
// <20><>ֵ<EFBFBD><D6B5>
CLayer* pLayerName = nullptr;
CLayer* pLayerNoName = nullptr;
pLayerName = pXy->FindLayer(layerName);
pLayerNoName = pXy->FindLayer(layerNoName);
if (pLayerName == nullptr || pLayerNoName == nullptr)
{
CPtrList lstLayer;
pXy->FindLayers(curveLayer, lstLayer, true);
POSITION posPos = lstLayer.GetHeadPosition();
while (posPos != nullptr)
{
CLayer* pLayerFind = (CLayer*)lstLayer.GetNext(posPos);
bool bViewName = HaveCurveViewName(pLayerFind);
if (bViewName)
{
pLayerName = pLayerFind;
}
else
{
pLayerNoName = pLayerFind;
}
}
}
if (pLayerNoName == nullptr&& pLayerName == nullptr) {
pLayerNoName = pXy->FindAddLayer(curveLayer);
pLayerName = pLayerNoName;
}
else if (pLayerName == nullptr) {
pLayerName = pLayerNoName;
}
else if (pLayerNoName == nullptr) {
pLayerNoName = pLayerName;
}
NBase::CPositionList lstPos;
pXy->GetElement(curveLayer, lstPos, true, false);
// <20><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>
POSITION posInsert = pXy->GetValueList()->GetTailPosition();
if (lstPos.GetCount() > 0) {
posInsert = lstPos.GetHead();
//POSITION pos = lstPos.GetHeadPosition();
//POSITION pt;
//while (pos) {
// pt = lstPos.GetNext(pos);
// pXy->RemoveAt(pt);
//}
}
std::vector<PlineList> contourList;
Func_GetContourList(contourList);
std::vector<POSITION> insertedPositions;
insertedPositions.clear();
for (int i = 0; i < contourList.size(); i++) {
PlineList lstLine = contourList[i];
std::string strLayerName = lstLine.GetName();
//CLayer * pLayer = pXy->FindAddLayer(strLayerName.c_str());
double dLayerValue = lstLine.GetValue();
CString strValue;
strValue.Format("%lg", dLayerValue);
vector<PlineList::Polyline2d> vctLine = lstLine.GetPaths();
for (int j = 0; j < vctLine.size(); j++) {
PlineList::Polyline2d line = vctLine[j];
CPointList pointList;
for (int k = 0; k < line.size(); k++)
{
dfPoint point;
point.x0 = line[k].x();
point.y0 = line[k].y();
pointList.AddTail(point);
}
CCurveEx* pCurve = new CCurveEx();
pCurve->SetPoints(pointList, 2);
pCurve->SetName(strValue);
//POSITION pos = pXy->AddElement(pCurve, DOUBLEFOX_CURVE);
POSITION pos = pXy->InsertElementAfter(posInsert, pCurve, DOUBLEFOX_CURVE);
insertedPositions.push_back(pos);
COne* pOne = pXy->GetAt(pos);
CLayer * pLayer = pLayerName;
if (strLayerName == "<EFBFBD>ޱ<EFBFBD>ע") {
pLayer = pLayerNoName;
}
pOne->SetLayer(pLayer);
posInsert = pos;
}
}
// <20><><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD>ͼԪ
destroyLength = lstPos.GetCount();
*destroyArray = new int64_t[destroyLength];
int32_t destroyIndex = 0;
for (POSITION pos = lstPos.GetHeadPosition(); pos != nullptr; lstPos.GetNext(pos))
{
POSITION pt = lstPos.GetAt(pos);
(*destroyArray)[destroyIndex++] = reinterpret_cast<int64_t>(pt);
}
// <20><><EFBFBD><EFBFBD>Ҫ<EFBFBD>²<EFBFBD><C2B2><EFBFBD><EFBFBD><EFBFBD>ͼԪ
insertedLength = insertedPositions.size();
*insertedArray = new int64_t[insertedLength];
int32_t insertedIndex = 0;
for (POSITION pos : insertedPositions)
{
(*insertedArray)[insertedIndex++] = reinterpret_cast<int64_t>(pos);
}
return true;
}
extern "C" __declspec(dllexport)
void Editor_ShowMesh(bool visible)
{
Func_ShowMesh(visible);
}
extern "C" __declspec(dllexport)
void Editor_ShowMeshVertex(bool bShow)
{
Func_ShowMeshVertex(bShow);
}
extern "C" __declspec(dllexport)
void Editor_ShowIsopleth(bool visible)
{
Func_ShowIsopleth(visible);
}
extern "C" __declspec(dllexport)
void Editor_ShowControlPoint(bool visible) {
Func_ShowControlPoint(visible);
}
extern "C" __declspec(dllexport)
void Editor_ShowFault(bool visible)
{
Func_ShowFault(visible);
}
extern "C" __declspec(dllexport)
void Editor_ShowBound(bool visible) {
Func_ShowBound(visible);
}
extern "C" __declspec(dllexport)
void Editor_ShowOtherLines(bool visible) {
Func_ShowOtherLines(visible);
}
extern "C" __declspec(dllexport)
void Editor_GetProperty(double& isopStep, int& markStep, double& minIsop, double& maxIsop,
double& zMin, double& zMax) {
Func_GetProperty(isopStep, markStep, minIsop, maxIsop, zMin, zMax);
}
extern "C" __declspec(dllexport)
void Editor_SetProperty(double isopStep, int markStep, double minIsop, double maxIsop,
double zMin, double zMax)
{
Func_SetProperty(isopStep, markStep, minIsop, maxIsop, zMin, zMax);
}
bool HaveCurveViewName(CXy* pxy, COne* pOne) {
CHowToViewCurve* pHowToView = pOne->GetLayer()->HowToViewCurve;
if (pHowToView == nullptr || pHowToView->GetCount()==0) {
return false;
}
for (int i = 0; i < pHowToView->GetCount(); i++) {
CCurveView* pView = pHowToView->GetAt(i);
if (pView->GetType() == CurveInName || pView->GetType() == CurveInNameAny) {
return true;
}
}
return false;
}
void TakeLayerLines(CXy * pXy, const LPCTSTR &layerName, std::vector<PlineList> &vecPline, bool isContour)
{
if (layerName == nullptr || lstrlen(layerName) == 0)
{
return;
}
NBase::CPositionList lstFault;
pXy->GetElement(layerName, lstFault, true, false);
if (lstFault.GetCount() > 0) {
POSITION pos = lstFault.GetHeadPosition();
POSITION pt;
std::string strLayer;
while (pos) {
pt = lstFault.GetNext(pos);
COne *pOne = (COne *)pXy->GetAt(pt);
if (pOne->GetType() != DOUBLEFOX_CURVE) {
continue;
}
bool bViewName = HaveCurveViewName(pXy, pOne);
if (bViewName == true) {
strLayer = "<EFBFBD><EFBFBD>ע";
}
else {
strLayer = "<EFBFBD>ޱ<EFBFBD>ע";
}
CCurveEx* pCurve = (CCurveEx*)(pOne->GetValue());
CString cstrName = pCurve->GetName();
PlineList::Polyline2d pline2D;
if (isContour)
{ // <20><>ֵ<EFBFBD>ߣ<EFBFBD><DFA3><EFBFBD><EFBFBD><EFBFBD><5A><D6B5>ͼ<EFBFBD><CDBC>
if (cstrName.IsEmpty())
{
continue;
}
double z = _tcstod(cstrName, nullptr);
bool bFind = false;
for (size_t i = 0; i < vecPline.size(); i++) {
auto contourList = vecPline[i];
if (abs(contourList.GetValue() - z) < 1E-5) {
contourList.AddPath(pline2D);
bFind = true;
break;
}
}
if (bFind == false) {
CString cstrLayer = pOne->GetLayer()->GetName();
//std::string strLayer = CT2A(cstrLayer);
PlineList lineList;
lineList.AddPath(pline2D);
lineList.SetValue(z);
lineList.SetName(strLayer);
vecPline.push_back(lineList);
}
}
else {
for (int i = 0; i < pCurve->num; i++)
{
Point2D point{ pCurve->x[i], pCurve->y[i] };
pline2D.push_back(point);
}
if (vecPline.size() == 0) {
PlineList lineList;
vecPline.push_back(lineList);
}
PlineList& lineList = vecPline[0];
lineList.AddPath(pline2D);
//lineList.SetName(strLayer);
}
}
}
}
#pragma region <20><><EFBFBD>ڹ<EFBFBD><DAB9>ܽӿ<DCBD>
//<2F><><EFBFBD><EFBFBD><5A>󶨹<EFBFBD><F3B6A8B9><EFBFBD>
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֧<EFBFBD><D6A7>undo/redo,<2C><><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD>֮ǰ<D6AE><C7B0>Func_StartCommand<6E><64><EFBFBD><EFBFBD><EFBFBD>ý<EFBFBD><C3BD><EFBFBD><EFBFBD><EFBFBD>Func_EndCommand
extern "C" __declspec(dllexport)
void Editor_WellAdaptiveAdjust(float rad, float range, float miu)
{
Func_WellAdaptiveAdjust(rad, range, miu);
}
//<2F><><EFBFBD><EFBFBD><EFBFBD>鿴Zֵ
extern "C" __declspec(dllexport)
void Editor_EnablePickMeshZ(bool bEnable)
{
Func_EnablePickMeshZ(bEnable);
}
//<2F><><EFBFBD>þ<EFBFBD><C3BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ
extern "C" __declspec(dllexport)
void Editor_SetWellColor(int r = 255, int g = 255, int b = 255)
{
Func_SetWellColor(r, g, b);
}
extern "C" __declspec(dllexport)
void Editor_SetWellTxtSize(float size)
{
Func_SetWellTxtSize(size);
}
//<2F><><EFBFBD><EFBFBD><EFBFBD>ϲ<EFBFBD>
extern "C" __declspec(dllexport)
void Editor_EnableFillFault(bool bEnable)
{
Func_EnableFillFault(bEnable);
}
//<2F><><EFBFBD>˵<EFBFBD>ֵ<EFBFBD><D6B5>
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֧<EFBFBD><D6A7>undo/redo,<2C><><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD>֮ǰ<D6AE><C7B0>Func_StartCommand<6E><64><EFBFBD><EFBFBD><EFBFBD>ý<EFBFBD><C3BD><EFBFBD><EFBFBD><EFBFBD>Func_EndCommand
extern "C" __declspec(dllexport)
void Editor_FilterMesh(float throld)
{
Func_FilterMesh(throld);
}
//<2F><><EFBFBD><EFBFBD>/<2F>˳<EFBFBD><CBB3><EFBFBD><EFBFBD>ƶ<EFBFBD><C6B6><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD>ڶ<EFBFBD><DAB6><EFBFBD><EFBFBD>β<EFBFBD><CEB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڳ<EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>򿪣<EFBFBD><F2BFAAA3><EFBFBD><EFBFBD>ڹرյ<D8B1>ʱ<EFBFBD><CAB1><EFBFBD>˳<EFBFBD>)
extern "C" __declspec(dllexport)
void Editor_EnableDrawPolygon(bool bEnable)
{
Func_EnableDrawPolygon(bEnable);
}
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//<2F>պ϶<D5BA><CFB6><EFBFBD><EFBFBD>κ󣬾Ϳ<F3A3ACBE><CDBF>Ե<EFBFBD><D4B5><EFBFBD><EFBFBD><EFBFBD>
//per:ǿ<>ȣ<EFBFBD>wellRad:<3A><><EFBFBD><EFBFBD>Լ<EFBFBD><D4BC><EFBFBD><EFBFBD><EBBEB6>Ĭ<EFBFBD><C4AC>Ϊ0<CEAA><30><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE>Լ<EFBFBD><D4BC>
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֧<EFBFBD><D6A7>undo/redo,<2C><><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD>֮ǰ<D6AE><C7B0>Func_StartCommand<6E><64><EFBFBD><EFBFBD><EFBFBD>ý<EFBFBD><C3BD><EFBFBD><EFBFBD><EFBFBD>Func_EndCommand
extern "C" __declspec(dllexport)
void Editor_StretchUpPolygon(float per, bool state, float wellRad = 0)
{
Func_StretchlUpPolygon(per, state, wellRad);
}
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD>÷<EFBFBD>ͬ<EFBFBD><CDAC>
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֧<EFBFBD><D6A7>undo/redo,<2C><><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD>֮ǰ<D6AE><C7B0>Func_StartCommand<6E><64><EFBFBD><EFBFBD><EFBFBD>ý<EFBFBD><C3BD><EFBFBD><EFBFBD><EFBFBD>Func_EndCommand
extern "C" __declspec(dllexport)
void Editor_PushDownPolygon(float per, bool state, float wellRad = 0)
{
Func_PushDownPolygon(per, state, wellRad);
}
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƽ<EFBFBD><C6BD><EFBFBD><EFBFBD><EFBFBD>÷<EFBFBD>ͬ<EFBFBD><CDAC>
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֧<EFBFBD><D6A7>undo/redo,<2C><><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD>֮ǰ<D6AE><C7B0>Func_StartCommand<6E><64><EFBFBD><EFBFBD><EFBFBD>ý<EFBFBD><C3BD><EFBFBD><EFBFBD><EFBFBD>Func_EndCommand
extern "C" __declspec(dllexport)
void Editor_SmoothPolygon(float per, bool state, float wellRad = 0)
{
Func_SmoothPolygon(per, state, wellRad);
}
//<2F><><EFBFBD><EFBFBD><EFBFBD>Ż<EFBFBD><C5BB><EFBFBD><EFBFBD>÷<EFBFBD>ͬFunc_StrechUp
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֧<EFBFBD><D6A7>undo/redo,<2C><><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD>֮ǰ<D6AE><C7B0>Func_StartCommand<6E><64><EFBFBD><EFBFBD><EFBFBD>ý<EFBFBD><C3BD><EFBFBD><EFBFBD><EFBFBD>Func_EndCommand
extern "C" __declspec(dllexport)
void Editor_OptimizeMesh(int startx, int starty, int endx, int endy, float rad, float per)
{
Func_OptimizeMesh(startx, starty, endx, endy, rad, per);
}
//<2F><>ȡ<EFBFBD><C8A1>ʾλ<CABE><CEBB>
//<2F><>px,py<70><79><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϽǶ<CFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD><EFBFBD>
// scale<6C><65>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ű<EFBFBD><C5B1><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD><D8B6><EFBFBD><EFBFBD>ף<EFBFBD>
extern "C" __declspec(dllexport)
void Editor_GetViewPos(double& px, double& py, double& scale)
{
Func_GetViewPos(px, py, scale);
}
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾλ<CABE><CEBB>
extern "C" __declspec(dllexport)
void Editor_SetViewPos(double px, double py, double scale)
{
Func_SetViewPos(px, py, scale);
}
//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>
extern "C" __declspec(dllexport)
void Editor_GetMousePos(double& px, double& py)
{
Func_GetMousePos(px, py);
}
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>
extern "C" __declspec(dllexport)
void Editor_SetMousePos(double px, double py)
{
Func_SetMousePos(px, py);
}
#pragma endregion
1 month ago
//<2F><><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>
extern "C" __declspec(dllexport)
bool Editor_CompileExpressionZ(LPCTSTR expressionString)
{
char expressionStr[256];
memset(expressionStr, 0, sizeof(char) * 256);
CString str(expressionString);
if (!str.IsEmpty()) {
strncpy_s(expressionStr, expressionString, str.GetLength());
}
bool state = Func_CompileExpressionZ(expressionStr);
return state;
}
1 month ago
//Zֵ<5A><D6B5><EFBFBD><EFBFBD>
extern "C" __declspec(dllexport)
bool Editor_CalculateZByExpression(LPCTSTR expressionString)
{
char expressionStr[256];
memset(expressionStr, 0, sizeof(char) * 256);
CString str(expressionString);
if (!str.IsEmpty()) {
strncpy_s(expressionStr, expressionString, str.GetLength());
}
bool state = Func_CalculateZByExpression(expressionStr);
return state;
}
//<2F><>ȡ<EFBFBD><C8A1>С
extern "C" __declspec(dllexport)
double Editor_GetZMin()
{
return Func_GetZMin();
}
//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>
extern "C" __declspec(dllexport)
double Editor_GetZMax()
{
return Func_GetZMax();
}
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾС<CABE><D0A1>λ<EFBFBD><CEBB>
extern "C" __declspec(dllexport)
void Editor_SetDecimalNumber(int num)
{
Func_SetDecimalNumber(num);
}
//<2F><>ȡ<EFBFBD><C8A1>ʾ<EFBFBD><CABE>С<EFBFBD><D0A1>λ<EFBFBD><CEBB>
extern "C" __declspec(dllexport)
int Editor_GetDecimalNumber()
{
return Func_GetDecimalNumber();
}
//<2F><><EFBFBD>öϲ<C3B6><CFB2><EFBFBD><EFBFBD><EFBFBD>״̬
extern "C" __declspec(dllexport)
void Editor_SetFaultControlState(bool state)
{
Func_SetFaultControlState(state);
}
//<2F><>ȡ<EFBFBD>ϲ<EFBFBD><CFB2><EFBFBD><EFBFBD><EFBFBD>״̬
extern "C" __declspec(dllexport)
bool Editor_GetFaultControlState()
{
return Func_GetFaultControlState();
}
//<2F><><EFBFBD><EFBFBD>У<EFBFBD><D0A3>
extern "C" __declspec(dllexport)
bool Editor_RectificationMeshWellCompute(double deltaz, int type, double factor)
{
return Func_RectificationMeshWellCompute(deltaz, type, factor);
}
//<2F><><EFBFBD><EFBFBD>У<EFBFBD><D0A3> <20>߳<EFBFBD><DFB3><EFBFBD>ֹ
extern "C" __declspec(dllexport)
void Editor_MeshWellThreadStop()
{
Func_MeshWellThreadStop();
}
//<2F><><EFBFBD><EFBFBD>У<EFBFBD><D0A3> <20><><EFBFBD><EFBFBD>
extern "C" __declspec(dllexport)
int Editor_GetWellRectificationProgress()
{
return Func_GetWellRectificationProgress();
}
//ˢ<>½<EFBFBD><C2BD><EFBFBD>
extern "C" __declspec(dllexport)
void Editor_UpdateObjectView()
{
return Func_UpdateObjectView();
}