Sketcher: ViewProvider representation of (not)-fully constraint defining points

This commit is contained in:
Abdullah Tahiri
2020-12-21 19:56:38 +01:00
committed by abdullahtahiriyo
parent f1a00f7a08
commit 04337034ce

View File

@@ -2792,6 +2792,13 @@ void ViewProviderSketch::updateColor(void)
return false;
};
auto isDefinedGeomPoint = [](Sketcher::SketchObject* obj, int GeoId) -> bool {
const Part::Geometry* geom = obj->getGeometry(GeoId);
if (geom)
return geom->getTypeId() == Part::GeomPoint::getClassTypeId() && !Sketcher::GeometryFacade::getConstruction(geom);
return false;
};
auto isInternalAlignedGeom = [](Sketcher::SketchObject* obj, int GeoId) -> bool {
const Part::Geometry* geom = obj->getGeometry(GeoId);
if (geom) {
@@ -2835,10 +2842,19 @@ void ViewProviderSketch::updateColor(void)
pcolor[i] = InternalAlignedGeoColor;
}
else {
if(constrainedElement)
pcolor[i] = FullyConstraintConstructionPointColor;
else
pcolor[i] = VertexColor;
if(!isDefinedGeomPoint(getSketchObject(), GeoId)) {
if(constrainedElement)
pcolor[i] = FullyConstraintConstructionPointColor;
else
pcolor[i] = VertexColor;
}
else { // this is a defined GeomPoint
if(constrainedElement)
pcolor[i] = FullyConstraintElementColor;
else
pcolor[i] = CurveColor;
}
}
}
}