Files
envi-code/SourceCode/Code2026/inc/AdsXRx/SectionUtility.h
T

70 lines
3.1 KiB
C++
Raw Normal View History

2026-10-04 00:04:20 +08:00
#ifndef _SECTIONUTILITY_H_
2026-09-28 15:28:50 +08:00
#define _SECTIONUTILITY_H_
#include "SectionStructDef.h"
#include "acgiutil.h"
#include "XExplodeStreamBase.h"
namespace SectionUtility
{
2026-10-04 00:04:20 +08:00
// 线到面投影
// 返回值为1,说明线与平面垂直,则 out_pt 值有效, 返回值为0,说明 out_seg 值有效, 返回值为-1, 说明投不到平面上
2026-09-28 15:28:50 +08:00
short GEOAPI Projection_line2plane(const XSectionPlane &plane, const AcGeLineSeg3d &in_seg,
AcGeLineSeg3d &out_seg, AcGePoint3d &out_pt);
short GEOAPI Projection_line2plane(const XSectionPlane &plane, const XLine &in_seg,
XLine &out_seg, AcGePoint3d &out_pt);
2026-10-04 00:04:20 +08:00
// 线到面的投影,只处理线段两端点都在面法向方向同侧的线段
2026-09-28 15:28:50 +08:00
short GEOAPI Projection_line2Plane_sub(const XSectionPlane &plane, const AcGeLineSeg3d &in_seg,
AcGeLineSeg3d &out_seg, AcGePoint3d &out_pt);
2026-10-04 00:04:20 +08:00
// 面到面投影, 返回值为 两面之间最短距离
2026-09-28 15:28:50 +08:00
double GEOAPI Projection_plane2plane(const XSectionPlane &section, const XSectionPlane &plane, XPoly2D &poly);
2026-10-04 00:04:20 +08:00
// poly2d 到 投影面的投影
2026-09-28 15:28:50 +08:00
double GEOAPI Projection_poly2plane(const XSectionPlane &section, const XPoly2D &plane, XPoly2D &poly);
2026-10-04 00:04:20 +08:00
// 画一个箭头
2026-09-28 15:28:50 +08:00
void GEOAPI MakeArrow(AcDbPolyline &poly, const AcGePoint3d &arrowHead, const AcGePoint3d &arrowTail);
2026-10-04 00:04:20 +08:00
// 画一个画柱体
2026-09-28 15:28:50 +08:00
void GEOAPI DrawColumn3D(XExplodeDraw &dc, const AcGePoint3d& TopCenter, const AcGePoint3d &BottomCenter, const double &scale);
2026-10-04 00:04:20 +08:00
// 画一个圆锥体
2026-09-28 15:28:50 +08:00
void GEOAPI DrawTaper3D(XExplodeDraw &dc, const AcGePoint3d &BottomCenter, const AcGeVector3d &vtDir, const double &scale);
bool GEOAPI GetLine(const std::vector<std::pair<int, XLine> > &lines, const int nIndex, XLine &line);
2026-10-04 00:04:20 +08:00
// 对全部 AecDbSectionPathSign 实例 进行刷新
2026-09-28 15:28:50 +08:00
void GEOAPI RefreshSectionPath();
2026-10-04 00:04:20 +08:00
// objId - 被 clone 的 对象 ID
// sLine - 线形
2026-09-28 15:28:50 +08:00
AcDbObjectId GEOAPI CloneAndResetLineTypeForBlockTableRecord(AcDbObjectId &objId, const CString &sLine);
XCurveSegment GetSegmentOfPoly(const XPoly2D &poly, const int nIdx);
int GetCountOfSegmentForPoly(const XPoly2D &poly);
AcGeMatrix3d GEOAPI GetCoordSystem(const AcGeVector3d &vt);
2026-10-04 00:04:20 +08:00
// 跟据 xy 面上的 poly 曲线 将之上下拉伸,生成系列的面
2026-09-28 15:28:50 +08:00
void GEOAPI MakeFacesByPoly(const XPoly2D &poly, const double &elev, const double &height,
std::vector<XSectionPlane> &planes, const bool bTopFace = false);
2026-10-04 00:04:20 +08:00
// bTopface 是否需要顶面和底面.
2026-09-28 15:28:50 +08:00
2026-10-04 00:04:20 +08:00
// 跟据 xy 面上的 poly 曲线 将之上下拉伸,生成系列的面 并将这些面进行投影,添充到 ObjSectionRecord 数组中
2026-09-28 15:28:50 +08:00
void GEOAPI FillRecordsByPoly(const XPoly2D &poly, const XSectionPlane &section,
std::vector<ObjSectionRecord> &records, const double &elev, const double &height,
const AcDbEntity &ent, ObjSectionRecord::SectionType type = ObjSectionRecord::eAEC_WALL,
2026-10-04 00:04:20 +08:00
const bool bTopFace = false); // bTopface 是否需要顶面和底面.
2026-09-28 15:28:50 +08:00
// for test
void GEOAPI DrawPoly2D(const XPoly2D &poly, const int color = 7);
void GEOAPI DrawXPlane(const XSectionPlane &plane, const int color = 7);
void GEOAPI DrawLines(const std::vector<XLine> &lines, const AcCmColor color);
}
#endif