COMPASSi/trunk/code/inc/OCC/OCCModeling/DllImportOccModeling.h

224 lines
8.4 KiB
C
Raw Permalink Normal View History

2025-06-25 15:06:42 +08:00
#pragma once
#include "OCCStructDataMD.h"
#include "InterfaceCal.h"
#include "OCC/OCCLib/Calculation.h"
#include "OCC/OCCLib/Geometry.h"
#include "nlohmann/json.hpp"
#include "Common/BusinessGlobal.h"
#include <QList>
//#define DLLEXPORT extern "C" __declspec(dllexport)
namespace OCCModeling
{
/*************************** Interface Definition *****************************/
//******************** Display *************************
//*** ReInit Data重新Load数据时调用 ***
DLLEXPORT void ReInitData();
DLLEXPORT BOOL AddObjAppendage(int cmdID,
vector<int> order,
vector<Appendage> &apd);
DLLEXPORT BOOL AddObjSpace(int cmdID,
vector<int> order,
vector<Space> &sp);
DLLEXPORT BOOL AddObjHull(int cmdID,
vector<int> order,
vector<Hull> &hull);
//*** DeleteObj删除数据时调用 ***
DLLEXPORT BOOL DeleteObj(int cmdID,
vector<int> order,
vector<int> del);
//*** AddObj加载数据时调用 图元验证生成***
DLLEXPORT BOOL AddObj(int cmdID,
vector<int> order,
vector<Point3D> &pnt,
vector<Curve> &crv,
vector<Surface> &srf,
vector<Solid>& sld
// int norder, int order[] ,
// int ndel, int del[],
// int npnt,Point3D pnt[],
// int ncrv,Curve crv[],
// int nsrf,Surface srf[],
// int nsld,Solid sld[],
// int nmds, MainDeckSurf mds[],
// int nss, ShellSurf ss[],
// int nds, DeckSurf ds[],
// int nbs, BoundSurf bs[],
// int nsds, SubdivSurf sds[],
// int nocr, OpenCargoRegion ocr[],
// int nsp, Space sp[],
// int napd, Appendage apd[],
// int nh, Hull h[],
// int nrenameObj, RenameObject renameObj[]
);
//处理进水点,极限静倾角,限界线,浸水开口
DLLEXPORT BOOL AddCalObj(int cmdID,int norder, int order[] ,
int ndel, int del[],
int npnts, Point3D pnts[],
int npnt, HydroInletPoint pnt[],
int ncrv, HydroLimitAng ang[],
int nmargin, MarginLine marginpnts[],
int nopen, ImmersionOpen opens[]);
//*** RemoveObj删除数据时调用 ***
DLLEXPORT void RemoveObj(int nid,int id[]);
DLLEXPORT void UnRedo(int flag, int cmdID);
//*** InitData 打开文件架构数据时调用 ***
//DLLEXPORT bool InitData(int npnt, Point3D pnt[],
// int ncrv, Curve crv[]
/*,
int nsrf, Surface srf[],
int nsld, Solid sld[],
int nmds, MainDeckSurf mds[],
int nss, ShellSurf ss[],
int nds, DeckSurf ds[],
int nbs, BoundSurf bs[],
int nsds, SubdivSurf sds[],
int nocr, OpenCargoRegion ocr[],
int nsp, Space sp[],
int napd, Appendage apd[],
int nh, Hull h[]*/
// );
DLLEXPORT bool InitHullData(
vector<Hull>& h,
vector<Space>& sp,
vector<Appendage>& apd
);
DLLEXPORT bool InitData(vector<Point3D>& pnt,
vector<Curve>& crv,
vector<Surface>& srf,
vector<Solid>& sld
/*,
int nsrf, Surface srf[],
int nsld, Solid sld[],
int nmds, MainDeckSurf mds[],
int nss, ShellSurf ss[],
int nds, DeckSurf ds[],
int nbs, BoundSurf bs[],
int nsds, SubdivSurf sds[],
int nocr, OpenCargoRegion ocr[],
int nsp, Space sp[],
int napd, Appendage apd[],
int nh, Hull h[]*/
);
//*** InitData 打开文件关于计算的数据时调用 ***
DLLEXPORT bool InitCalData(int npnt, HydroInletPoint pnt[],
int ncrv, HydroLimitAng ang[],
int nmargin, MarginLine marginpnts[],int nopen, ImmersionOpen opens[]);
//******************** Check *************************
//*** CheckPoint点验证并返回点pnt ***
DLLEXPORT BOOL CheckPoint(Point3D *pnt);
//***GetErrInfo返回错误信息**
DLLEXPORT const char* GetErrInfo();
//重设主尺度信息
DLLEXPORT void ResetPrincipal(double loa,double lpp, double b, double d,double t, double f0x, int iFrame,int nfrm, Frame frm[],
int nsta, Station sta[],int nwl, WaterlinePos wl[],int nbl,ButtocklinePos bl[]);
//主尺度信息
DLLEXPORT void SetPrincipal(double loa,double lpp, double b, double d,double t, double f0x, int iFrame,int nfrm, Frame frm[],
int nsta, Station sta[],int nwl, WaterlinePos wl[],int nbl,ButtocklinePos bl[]);
//型值数据
DLLEXPORT int GetOffsetTableData(int upperDeckID, int foldingLinesID[], int isBilge, double BilgeHC, int shiptype, int asymmetricType,
int ids[], int lens[], OffsetTablePoint *pnts);
//面的面积
DLLEXPORT double GetS(int id);
//体的体积
DLLEXPORT double GetV(int id);
//船壳与主甲板围成的体的体积
DLLEXPORT double GetTonnageV1();
//拓扑对象保存为step格式
DLLEXPORT bool SaveTopoToStep(char* path,int ids[]);
//拓扑对象保存为step格式20161227 新增 by czb
DLLEXPORT bool SaveTopoToStep2(char* path);
//获取拓扑对象保存为brep格式时的OCIDX, 20161214 新增 by czb
DLLEXPORT void GetOCIDXOfTopo(int ids[]);
//拓扑对象保存为brep格式
DLLEXPORT bool SaveTopoToBrep(char* path);
//从step格式读取拓扑对象
DLLEXPORT bool LoadTopoFromStep(char* path,QVector<int> ids);
//从设置船壳静水力计算参数
DLLEXPORT bool SetHullPara(int zCnt,double zStep[],int xCnt,double xStep[],int heelCnt,double heelStep[],double heelC[],
double heelFMax,double heelFMin,double heelDai,int trimCnt,double trimStep[],
double trimFMax,double trimFMin,double trimDai,int startType);
//设置舱室静水力计算参数
DLLEXPORT bool SetCompartmentPara(int ComID,int CStatus);
DLLEXPORT bool CreateCompData();
DLLEXPORT bool CreateInterHullXml();
DLLEXPORT bool CreateInterCompXml();
DLLEXPORT bool CreateHullSolid();
//自动提取限界线方法是把甲板沿z轴负方向移动76mm后和船壳求交得到半船壳交线然后根据站线定义得到每站和此交线的交点
DLLEXPORT int GetMarginLineleData(int lens[], OffsetTablePoint *pnts);
DLLEXPORT bool CreateCXml();
//浸水开口根据XY和甲板相对位置取得实际Z位置
DLLEXPORT double GetImmersionOpenPos(double X, double Y, double oppositZ);
//加载静水力计算接口xml
DLLEXPORT void LoadCalculationXML(char* path);
//保存静水力计算接口xml
DLLEXPORT void SaveCalculationXML(char* path);
//保存静水力计算接口xml
DLLEXPORT void CloseCalulation();
//进水点计算接口
DLLEXPORT void SetInletPoint(int delpnts,Point3D delpnt[],int addpnts,Point3D addpnt[], int updCnt, int oldIDs[], Point3D newIDs[]);
//舭部点计算接口
DLLEXPORT void SetDeckBilgePoint(int Cnt, Point3D addDeck[], Point3D addBilge[]);
//导出船壳计算数据文件
//DLLEXPORT bool ExportHullCalFile(char* fileName, char* path, int hullCount, int hullIDs[]);
DLLEXPORT bool ExportHullCalFile(string fileName, string path, vector<int>& hullIDs);
//导出舱室计算数据文件
DLLEXPORT bool ExportSpaceCalFile(string fileName, string path, vector<int>& spaceIDs);
//导出体计算数据文件
DLLEXPORT bool ExportSolidCalFile(char* fileNameWithExtension, char* path, int count, int ids[]);//20190601 added by czb
//导出计算数据文件
//DLLEXPORT void ExportIGES(char* fileName);
//获取曲线首尾端点和肋位或站位点 type=1,肋位;type=2,站位
DLLEXPORT int GetCurvePointByFS(int curveID, int xlen, double xSet[], int lens[], Point3D *pnts);
DLLEXPORT int GetCurvePointByFSEx(int curveID, int xlen, vector<double>& xSet,vector<Point3D>& pnts);
//数据接口 Lvxj
//导入型值表
DLLEXPORT void ImportOffsetData(bool bImportCtrlPnt,float xSubSectionLen);
//导出型值表
DLLEXPORT void ExportOffsetData(double* shipSize,double* expParam, int* expType);
//导入CAD文件
DLLEXPORT void ImportCAD(char* fileName);
//导入IGES文件
DLLEXPORT long ImportIGES(char* fileName, int impType, float*transfromParams);
//导出IGES文件
DLLEXPORT void ExportIGES(char* fileName,int expOption,int selectCnt,int*selectLst);
//转换CAD型线
DLLEXPORT void TransfCADLine(int selectedCnt, int* selectLst, int lineType, float* fCADPar, int lens[], Point3D *pnts);
//计算两条线交点
DLLEXPORT int GetIntersectPnt(int selectedCnt, int* selectLst,double *pPnt);
//数据接口 Lvxj
DLLEXPORT OCCStructDataMD *GetDataMD();
DLLEXPORT bool SetObjVisibel(std::vector<int>& ids,int value);
DLLEXPORT bool SetObjVisibel(int id,int value);
}