添加项目文件。

This commit is contained in:
GG Z
2026-02-28 21:01:57 +08:00
parent 9fe4e5a9aa
commit 7a229067cc
175 changed files with 18060 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
#include "../pch.h"
#include "ElementHelper.h"
#include <vector>
#include <msclr/marshal.h>
#include "../Native/CElementHelper.h"
void BRDI::MstnAPI::ElementHelper::CreateLineElement(GeomNet::DPoint3d startPoint, GeomNet::DPoint3d endPoint)
{
DPoint3dCP pStartPoint = reinterpret_cast<DPoint3dCP>(&startPoint); // GeomNet::DPoint3d是值类型位于调用栈不需要固定直接取地址
DPoint3dCP pEndPoint = reinterpret_cast<DPoint3dCP>(&endPoint);
CElementHelper elemHelper;
elemHelper.CreateLineElement(pStartPoint, pEndPoint);
}
void BRDI::MstnAPI::ElementHelper::CreateLineStringElement(array<GeomNet::DPoint3d>^ points)
{
pin_ptr<GeomNet::DPoint3d> pPoints = &points[0]; // array<GeomNet::DPoint3d>^位于托管堆,需要先固定
DPoint3dCP pNativePoint = reinterpret_cast<DPoint3dCP>(pPoints);
int pointCount = points->Length;
CElementHelper elemHelper;
elemHelper.CreateLineStringElement(pNativePoint, pointCount);
}
void BRDI::MstnAPI::ElementHelper::CreateCurveElement(GeomNet::CurveVector^ curveVector)
{
CurveVectorCP pCurveVector = static_cast<CurveVectorCP>(GeomNet::CurveVector::DereferenceToNative(curveVector, false).ToPointer());
CElementHelper elemHelper;
elemHelper.CreateCurveElement(pCurveVector);
}
void BRDI::MstnAPI::ElementHelper::BodyFromLoft(array<GeomNet::CurveVector^>^ profiles, DgnPlatformNET::DgnModelRef^ dgnModelRef)
{
std::vector<CurveVectorPtr> curveVectorPtrs;
for each (GeomNet::CurveVector ^ profile in profiles)
{
CurveVectorPtr pCurveVector = static_cast<CurveVectorP>(GeomNet::CurveVector::DereferenceToNative(profile, false).ToPointer());
curveVectorPtrs.push_back(pCurveVector);
}
int profileCount = profiles->Length;
DgnModelRefP pDgnModelRef = static_cast<DgnModelRefP>(dgnModelRef->GetNative().ToPointer());
CElementHelper elemHelper;
elemHelper.BodyFromLoft(&curveVectorPtrs[0], profileCount, pDgnModelRef);
}
void BRDI::MstnAPI::ElementHelper::ShowMessage(String^ message)
{
msclr::interop::marshal_context context;
WCharCP msg = context.marshal_as<WCharCP>(message);
CElementHelper elemHelper;
elemHelper.ShowMessage(msg);
}