#pragma once

#ifndef OCCTBASELAMP_H
#define OCCTBASELAMP_H
#include "referenceHeader.h"


//====================
// 系统支持的模型导出类型
//=====================

enum OCCTShapeType
{
	STL,
	STEP,
	IGES,
	NoneType,
};

OCCTShapeType str2OCCTShapeType(QString str);
QStringList getOCCTShapeTypeEmnu();
QString getOCCTShapeTypeFilterString();
QString get_STL_FilterString();
QString get_STEP_FilterString();
QString get_IGES_FilterString();
QString getOCCTShapeTypeFilterString(OCCTShapeType t);
QString getOCCTShapeTypeFilterString(QString str);

// 常用静态函数
bool SaveTopoDs_Stl(QString FilePath, const TopoDS_Shape& shape);
bool SaveTopoDs_Step(QString FilePath, const TopoDS_Shape& shape);
bool SaveTopoDs_IGES(QString FilePath,const TopoDS_Shape& shape);
bool SaveTopoDs(QString FilePath,const TopoDS_Shape& shape, OCCTShapeType type);

TopoDS_Shape ReadTopoDs_IGES(QString Filepath);
TopoDS_Shape ReadTopoDs_Stl(QString Filepath);
TopoDS_Shape ReadTopoDs_Step(QString Filepath);

OCCTShapeType ReadTopoDs_Shape(QString FilePath, TopoDS_Shape& shape_TopoDs);


// 模型合并
TopoDS_Shape MergedTopoShape(std::vector<TopoDS_Shape> TopoDS_Shapelist);


// 修改模型显示
void ChangeModelColor(Handle(AIS_Shape)& aisShape, Quantity_Color& redColor);

//// 创建箭头
TopoDS_Shape CreateArrow(const gp_Dir& direction, Standard_Real length, Standard_Real radius);
//


// OCCT 根据向量A和B,计算变换矩阵
gp_Trsf GetTransFormFromVector(const gp_Vec& A, const gp_Vec& B);

 
TopoDS_Shape Process_RotationThetaPhi_MoveXYZ(TopoDS_Shape shape, double theta, double phi,double X,double Y,double Z);


//TopoDS_Shape Createpyramid(double width=10.0,double depth=5.0, double mouthWidth=1.0, double mouthHeight=0.5, double height = 15.0);



// 创建一个笛卡尔坐标系
TopoDS_Shape CreateCartesianCoordinatesAxis(double xlength,double ylength,double zlength);
// 常见模型创建
TopoDS_Shape CreateBox(double x, double y, double z);
TopoDS_Shape CreateCylinder(double radius, double height);
TopoDS_Shape CreateCone(double radius_bottom, double radius_top, double height);
TopoDS_Shape CreateSphere(double radius);
TopoDS_Shape CreateTorus(double majorRadius, double minorRadius);

// 常见模型操作
TopoDS_Shape Cut(TopoDS_Shape& shape1, TopoDS_Shape& shape2);
TopoDS_Shape Fuse(TopoDS_Shape& shape1, TopoDS_Shape& shape2);
// 常见操作 -- 模型旋转、平移、缩放
TopoDS_Shape Rotate(TopoDS_Shape& shape, gp_Ax1 axis, double angle);
TopoDS_Shape Translate(TopoDS_Shape& shape, gp_Vec move_vec);
TopoDS_Shape Scale(TopoDS_Shape& shape, gp_Pnt refrenceCenter, double scale);


// 创建散射体雷达
// 创建一个坐标原点为圆心的
TopoDS_Shape createConicalHorn(double bottomRadius,double bottomHeight,double topRadius,double topHeight);
TopoDS_Shape createPyramidalHorn(double bottomWidth, double bottomHeight, double bottomAtl, double topWidth, double topHeight, double topAtl);





#endif // OCCTBASELAMP_H




