[TD]Add Show/Hide invisible lines tool

This commit is contained in:
wandererfan
2019-07-17 18:14:46 -04:00
committed by WandererFan
parent e406b2f3e6
commit 3104854826
7 changed files with 255 additions and 5 deletions

View File

@@ -355,6 +355,7 @@ void QGIViewPart::drawViewPart()
float lineWidthHid = vp->HiddenWidth.getValue() * lineScaleFactor;
float lineWidthIso = vp->IsoWidth.getValue() * lineScaleFactor;
// float lineWidthExtra = viewPart->ExtraWidth.getValue() * lineScaleFactor;
bool showAll = vp->ShowAllEdges.getValue();
prepareGeometryChange();
removePrimitives(); //clean the slate
@@ -418,6 +419,12 @@ void QGIViewPart::drawViewPart()
#endif //#if MOD_TECHDRAW_HANDLE_FACES
// Draw Edges
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter().GetGroup("BaseApp")->
GetGroup("Preferences")->GetGroup("Mod/TechDraw/Colors");
App::Color fcEdgeColor;
fcEdgeColor.setPackedValue(hGrp->GetUnsigned("NormalColor", 0x00000000));
QColor edgeColor = fcEdgeColor.asValue<QColor>();
const std::vector<TechDraw::BaseGeom *> &geoms = viewPart->getEdgeGeometry();
std::vector<TechDraw::BaseGeom *>::const_iterator itGeom = geoms.begin();
QGIEdge* item;
@@ -441,9 +448,11 @@ void QGIViewPart::drawViewPart()
}
}
bool showItem = true;
if (showEdge) {
if (showEdge) { //based on hard/seam/hidden/etc
item = new QGIEdge(i);
item->setWidth(lineWidth);
item->setNormalColor(edgeColor);
item->setStyle(Qt::SolidLine);
if ((*itGeom)->cosmetic == true) {
int source = (*itGeom)->source();
int sourceIndex = (*itGeom)->sourceIndex();
@@ -455,7 +464,6 @@ void QGIViewPart::drawViewPart()
Base::Console().Message("QGIVP::drawVP - edge: %d is confused - source: %d\n",i,source);
}
} else {
//TODO: implement formats for geom lines.
TechDraw::GeomFormat* gf = viewPart->getGeomFormatByGeom(i);
if (gf != nullptr) {
item->setNormalColor(gf->m_format.m_color.asValue<QColor>());
@@ -478,8 +486,10 @@ void QGIViewPart::drawViewPart()
item->setWidth(lineWidthIso);
}
item->setPrettyNormal();
if (!showItem) {
item->hide();
if (!showAll) { //view level "show" status
if (!showItem) { //individual edge "show" status
item->hide();
}
}
//debug a path
// QPainterPath edgePath=drawPainterPath(*itGeom);
@@ -491,7 +501,7 @@ void QGIViewPart::drawViewPart()
// Draw Vertexs:
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter().GetGroup("BaseApp")->
hGrp = App::GetApplication().GetUserParameter().GetGroup("BaseApp")->
GetGroup("Preferences")->GetGroup("Mod/TechDraw/General");
double vertexScaleFactor = hGrp->GetFloat("VertexScale", 3.0);
hGrp = App::GetApplication().GetUserParameter().GetGroup("BaseApp")->