TechDraw: Implement 'Area' dimension.

This commit is contained in:
PaddleStroke
2024-04-22 14:52:30 +02:00
parent 337cd39244
commit e33c983614
21 changed files with 580 additions and 60 deletions

View File

@@ -361,3 +361,35 @@ void arcPoints::dump(const std::string& text) const
DrawUtil::formatVector(arcEnds.second()).c_str());
Base::Console().Message("arcPoints - midArc: %s\n", DrawUtil::formatVector(midArc).c_str());
}
areaPoint::areaPoint() :
area(0.0),
center(Base::Vector3d())
{
}
areaPoint& areaPoint::operator=(const areaPoint& ap)
{
area = ap.area;
center = ap.center;
return *this;
}
void areaPoint::move(const Base::Vector3d& offset)
{
center = center - offset;
}
void areaPoint::project(const DrawViewPart* dvp)
{
area = area * dvp->getScale();
center = dvp->projectPoint(center) * dvp->getScale();
}
void areaPoint::dump(const std::string& text) const
{
Base::Console().Message("areaPoint - %s\n", text.c_str());
Base::Console().Message("areaPoint - area: %.3f center: %s\n", area,
DrawUtil::formatVector(center).c_str());
}