[TechDraw] - Cosmetic edge fixes

This commit is contained in:
pavltom
2023-10-24 19:59:00 +02:00
committed by WandererFan
parent 2c5d90daea
commit 0ded3994c5
2 changed files with 9 additions and 3 deletions

View File

@@ -1066,11 +1066,12 @@ void execLine2Points(Gui::Command* cmd)
//check if editing existing edge
if (!edgeNames.empty() && (edgeNames.size() == 1)) {
TechDraw::CosmeticEdge* ce = baseFeat->getCosmeticEdgeBySelection(edgeNames.front());
if (!ce) {
if (!ce || ce->m_geometry->getGeomType() != TechDraw::GeomType::GENERIC) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong Selection"),
QObject::tr("Selection is not a Cosmetic Line."));
return;
}
Gui::Control().showDialog(new TaskDlgCosmeticLine(baseFeat,
edgeNames.front()));
return;
@@ -1208,11 +1209,14 @@ void execCosmeticCircle(Gui::Command* cmd)
//check if editing existing edge
if (!edgeNames.empty() && (edgeNames.size() == 1)) {
TechDraw::CosmeticEdge* ce = baseFeat->getCosmeticEdgeBySelection(edgeNames.front());
if (!ce) {
if (!ce
|| !(ce->m_geometry->getGeomType() == TechDraw::GeomType::CIRCLE
|| ce->m_geometry->getGeomType() == TechDraw::GeomType::ARCOFCIRCLE)) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong Selection"),
QObject::tr("Selection is not a Cosmetic edge."));
QObject::tr("Selection is not a Cosmetic Circle or a Cosmetic Arc of Circle."));
return;
}
Gui::Control().showDialog(new TaskDlgCosmeticCircle(baseFeat,
edgeNames.front()));
return;

View File

@@ -289,6 +289,8 @@ void QGIViewPart::drawAllEdges()
item->setNormalColor(PreferencesGui::getAccessibleQColor(PreferencesGui::normalQColor()));
item->setStyle(Qt::SolidLine);
if ((*itGeom)->getCosmetic()) {
item->setCosmetic(true);
// cosmetic edge - format appropriately
int source = (*itGeom)->source();
if (source == COSMETICEDGE) {