You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kev/Drawer/Module/GeoSigmaDraw/BoundaryDetection.h

37 lines
623 B
C++

#include <vector>
#include "DrawOperator/CurveEx.h"
/**
* 闭合检测类
*/
class BoundaryDetection {
public:
BoundaryDetection() = default;
~BoundaryDetection() = default;
struct DetectionResult
{
bool isClosed;
CCurveEx* pCurve;
};
/**
* 检测是否闭合
*
* \param curves 所有参与检测的线
* \return
*/
std::vector<DetectionResult> CheckClosure(const std::vector<CCurveEx*>& curves) const
{
std::vector<DetectionResult> result;
result.reserve(curves.size());
for (CCurveEx* pCurve : curves)
{
result.push_back({ static_cast<bool>(pCurve->IsClosed()), pCurve });
}
return result;
}
};