Files
envi-code/SourceCode/Code2026/AdsXRx/aecroof.h
T

112 lines
2.7 KiB
C++
Raw Normal View History

2026-09-28 15:28:50 +08:00
#ifndef __AECROOF_H
#define __AECROOF_H
#ifndef _XPOINT_H_
#include "XPoint.h"
#endif
#ifndef _XLINE_H_
#include "XLine.h"
#endif
#ifndef _DLIST_H_
#include "dlist.h"
#endif
#ifndef _XPOINTLISTT_H_
#include "XPointList.h"
#endif
#ifndef _XPOLY2D_H_
#include "XPoly2D.h"
#endif
class XIntDotPair {
public:
short nFrom;
short nTo;
public:
XIntDotPair() {}
XIntDotPair(short f, short t): nFrom(f), nTo(t) {}
XIntDotPair(const XIntDotPair &src) {
nFrom = src.nFrom;
nTo = src.nTo;
}
};
class XPlanePara {
public:
double nParaA, nParaB, nParaC, nParaD; // Æ½ÃæÒ»°ã·½³Ì A*x + B*y + C*z + D = 0
public:
XPlanePara() {}
int InitPlane(const XPoint &pt1, const XPoint &pt2, const XPoint &pt3);
int InitPlane(const XPoint &pt0, const XVector3D &vt);
};
class XRoofEdge: public XLine {
public:
double m_nSlope;
};
class XRoofEdgeCompact {
public:
XPoint m_ptVertex;
double m_nSlope;
public:
XRoofEdgeCompact(const XPoint &pt, double nSlant): m_ptVertex(pt), m_nSlope(nSlant)
{}
XRoofEdgeCompact() {}
};
class XAecRoof {
public:
double m_nBottomElevation;
DList<XRoofEdgeCompact> m_lstEdges;
BOOL m_bBotVisible;
// Not Database Residential data member
DList<XPointList> m_lstSlopeFaces;
XPoly2D m_polyBoundry;
// ÁÙʱÊý¾Ý
DList<XLine> m_lstRidges;
public:
XAecRoof(BOOL bBotVis=FALSE) {m_bBotVisible=bBotVis;}
/*
XAecRoof(const XAecRoof &src) {
*this = src;
}
XAecRoof(const XPoly2D &poly, double nSlant);*/
int InitRoof(const XPoly2D &poly, double nSlant);
//XAecRoof & operator = (const XAecRoof &src);
int InitBottomPolyByEdge();
int Calculate();
int CalculateSlopeFace(int n, XPointList &slopeFace);
int DrawSlopeFaces();
double GetTotalSurfaceArea() const;
double GetBottomArea() const {
ASSERT(!!m_polyBoundry);
XPoly2D *p = (XPoly2D *)&m_polyBoundry;
return p->Area();
}
double GetSlopeArea(int n) const;
int GetEdge(int n, XRoofEdge &edge) const;
int GetPlane(int n, XPlanePara &slopePlan) const;
int GetRidge(int n, XLine &ln, int bQuickGet) const;
int GetTotalEdge() const { return m_lstEdges.Length(); }
int GetNext(int nThis, const XPlanePara &thisPlane,
int nLast, const XPlanePara &lastPlane, const XPoint &ptLast,
int *pNextIndex, XPlanePara &nextPlane, XPoint &ptNext);
int GetEdgeData(XPointList &lstVertices, DList<XIntDotPair> &lstEdgeData) const;
int GetSurfaceData(int *nVerticeNum, XPoint * &pVerticeList,
int *nFaceListLen, Adesk::Int32 * &pFaceList,
Adesk::UInt8 * &pEdgeVisArray) const;
};
#endif