COMPASSi/trunk/code/inc/OCC/OCCLib/Hull.h

310 lines
6.4 KiB
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#pragma once
//#include "Geometry.h"
#define MAX_ARRAY_SIZE11 256
//***本数据结构定义必须同\Infrastructure\Infrastructure.Data\Model\Hull.cs中数据结构定义完全一致意义一致
enum E_GEO_3D_OBJ_TYPE
{
E_GEO_3D_OBJ_TYPE_POINT3D = 0, // 点
E_GEO_3D_OBJ_TYPE_CURVE, //线
E_GEO_3D_OBJ_TYPE_SURFACE, //面
E_GEO_3D_OBJ_TYPE_SOLID, //体
E_GEO_3D_OBJ_TYPE_MAINDECKSURF, //主甲板面
E_GEO_3D_OBJ_TYPE_SHELLSURF, //外板面
E_GEO_3D_OBJ_TYPE_HULL, //主船体
E_GEO_3D_OBJ_TYPE_DECKSURF, //平台面
E_GEO_3D_OBJ_TYPE_BOUNDSURF, //上建外围面
E_GEO_3D_OBJ_TYPE_SUBDIVSURF, //分舱面
E_GEO_3D_OBJ_TYPE_OPENCARGOREGION, //开敞客货区
E_GEO_3D_OBJ_TYPE_SPACE, //舱室
E_GEO_3D_OBJ_TYPE_APPENDAGE, //附体
E_GEO_3D_OBJ_TYPE_EMPTY, //空体(删除使用)
E_GEO_3D_OBJ_TYPE_ALL,
E_GEO_3D_OBJ_TYPE_SIZE
};
struct OBJ3D
{
public:
OBJ3D()
{
m_objType = E_GEO_3D_OBJ_TYPE_POINT3D;
Name = "";
Command = "";
}
void setObjType(E_GEO_3D_OBJ_TYPE type)
{
type = m_objType;
}
E_GEO_3D_OBJ_TYPE getObjType()
{
return m_objType;
}
E_GEO_3D_OBJ_TYPE m_objType;
std::string Name;
std::string Command;
};
// 主甲板面
struct MainDeckSurf :public OBJ3D
{
public:
MainDeckSurf()
{
setObjType(E_GEO_3D_OBJ_TYPE_MAINDECKSURF);
}
int ID;
int CmdID;
// char* Name;
// char* Command;
int Visible;
int Color;
double Transparency;
int Type;
int Src[MAX_ARRAY_SIZE11] ; // 依赖:面序列
};
// 外板面
struct ShellSurf :public OBJ3D
{
public:
ShellSurf()
{
setObjType(E_GEO_3D_OBJ_TYPE_SHELLSURF);
}
int ID;
int CmdID;
// char* Name;
// char* Command;
int Visible;
int Color;
double Transparency;
int Type;
int Src[MAX_ARRAY_SIZE11] ; // 依赖:面序列
};
// 主船体
struct Hull :public OBJ3D
{
public:
Hull()
{
setObjType(E_GEO_3D_OBJ_TYPE_HULL);
}
int ID;
int CmdID;
// char* Name;
// char* Command;
int Visible;
int Color;
double Transparency;
int Type; //1面围拢2体组合10镜像
int Src[MAX_ARRAY_SIZE11] ; // 依赖:面序列
int SolidAddMode[MAX_ARRAY_SIZE11];// 体运算方式:0并,1差,2交.
//20161112 by czb
int MirrorDir; // 镜像面方向1-X, 2-Y, 3-Z
double MirrorOrgin; // 镜像面位置与MirrorDir匹配的分量坐标
double CopyOffsetX; // 复制偏移分量,20170901 新增 by czb
double CopyOffsetY;// 复制偏移分量
double CopyOffsetZ;// 复制偏移分量
};
// 平台面
struct DeckSurf :public OBJ3D
{
public:
DeckSurf()
{
setObjType(E_GEO_3D_OBJ_TYPE_DECKSURF);
}
int ID;
int CmdID;
// char* Name;
// char* Command;
int Visible;
int Color;
double Transparency;
int Type;
int GenType;// 生成方式:0来自几何面,1参数化
int Src[MAX_ARRAY_SIZE11];// 依赖:面序列
// 面的位置或面边界起止位置
double X1;
double X2;
double Y1;
double Y2;
double Z;
};
// 上建外围面
struct BoundSurf :public OBJ3D
{
public:
BoundSurf()
{
setObjType(E_GEO_3D_OBJ_TYPE_BOUNDSURF);
}
int ID;
int CmdID;
// char* Name;
// char* Command;
int Visible;
int Color;
double Transparency;
int Type;
int GenType;// 生成方式:0来自几何面,1参数化
int Src[MAX_ARRAY_SIZE11];// 依赖:面序列
// 面的位置或面边界起止位置
double X1;
double X2;
double Y1;
double Y2;
double Z1;
double Z2;
int Dir;// 上建外围面方向:0横向(X),1纵向(Y)
};
// 分舱面
struct SubdivSurf :public OBJ3D
{
public:
SubdivSurf()
{
setObjType(E_GEO_3D_OBJ_TYPE_SUBDIVSURF);
}
int ID;
int CmdID;
// char* Name;
// char* Command;
int Visible;
int Color;
double Transparency;
int Type;
int GenType;// 生成方式:0来自几何面,1参数化
int Src[MAX_ARRAY_SIZE11] ; // 依赖:面序列
double XY; // 面的位置或面边界起止位置
int Dir;// 分舱面方向:0横向(X),1纵向(Y)
// 边界定义方式:0坐标,1限制面
int BndType;
// 面边界起止位置(坐标)
double X1;
double X2;
double Y1;
double Y2;
double Z1;
double Z2;
// 面边界起止位置(限制面),若为0,则该方向以船壳(主甲板面+外板面)作为限制
int RefX1;
int RefX2;
int RefY1;
int RefY2;
int RefZ1;
int RefZ2;
int Corrugated;// 是否槽形结构:0否,1是
int CorDir;// 槽条方向:0垂向,1水平
// 槽形参数
double S;
double A;
double D;
double F;
};
// 开敞客货区
struct OpenCargoRegion :public OBJ3D
{
public:
OpenCargoRegion()
{
setObjType(E_GEO_3D_OBJ_TYPE_OPENCARGOREGION);
}
int ID;
int CmdID;
// char* Name;
// char* Command;
int Visible;
int Color;
double Transparency;
int Type;
int Src[MAX_ARRAY_SIZE11];// 依赖:面序列
};
// 舱室
struct Space :public OBJ3D
{
public:
Space()
{
setObjType(E_GEO_3D_OBJ_TYPE_SPACE);
}
int ID;
int CmdID;
// char* Name;
// char* Command;
int Visible;
int Color;
double Transparency;
int Type; //0参数化,1体组合,2面围拢,10镜像
int GenType;
int Src[MAX_ARRAY_SIZE11];// 依赖:面序列/体序列
int SolidAddMode[MAX_ARRAY_SIZE11];// 体运算方式:0并,1差,2交.
double X1; //add by yu 14,8.18 新增特征点定义舱室,尾端面位置
double X2; //首端面位置
double FCharacterPoints[MAX_ARRAY_SIZE11]; // 1000表示截止
double LCharacterPoints[MAX_ARRAY_SIZE11]; // 1000表示截止
double Y; //剪切点坐标
double Z; //剪切点坐标
int HullID;
bool isUnit;
//20161112 by czb
int MirrorDir; // 镜像面方向1-X, 2-Y, 3-Z
double MirrorOrgin; // 镜像面位置与MirrorDir匹配的分量坐标
double CopyOffsetX; // 复制偏移分量,20170901 新增 by czb
double CopyOffsetY;// 复制偏移分量
double CopyOffsetZ;// 复制偏移分量
// XUEFENG ADDED 202012
// Max 5 Sections
int numSections;
};
// 附体
struct Appendage :public OBJ3D
{
public:
Appendage()
{
setObjType(E_GEO_3D_OBJ_TYPE_APPENDAGE);
}
int ID;
int CmdID;
// char* Name;
// char* Command;
int Visible;
int Color;
double Transparency ;
int Type; //10镜像
int Src[MAX_ARRAY_SIZE11];// 依赖:体序列
int SolidAddMode[MAX_ARRAY_SIZE11];// 体运算方式:0并,1差,2交
int Minus;// 是否负体:0否,1是
//20161112 by czb
int MirrorDir; // 镜像面方向1-X, 2-Y, 3-Z
double MirrorOrgin; // 镜像面位置与MirrorDir匹配的分量坐标
double CopyOffsetX; // 复制偏移分量,20170901 新增 by czb
double CopyOffsetY;// 复制偏移分量
double CopyOffsetZ;// 复制偏移分量
};