93 lines
2.5 KiB
C++
93 lines
2.5 KiB
C++
#ifndef __AECROOF_H
|
|
#define __AECROOF_H
|
|
|
|
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 |