Sketcher: Preference color added for External defining geometry
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
<FCUInt Name="EditedEdgeColor" Value="4294967295"/>
|
||||
<FCUInt Name="ConstructionColor" Value="56575"/>
|
||||
<FCUInt Name="ExternalColor" Value="3425924095"/>
|
||||
<FCUInt Name="ExternalDefiningColor" Value="3425924095"/>
|
||||
<FCUInt Name="InvalidSketchColor" Value="4285333759"/>
|
||||
<FCUInt Name="FullyConstrainedColor" Value="16711935"/>
|
||||
<FCUInt Name="InternalAlignedGeoColor" Value="2998042623"/>
|
||||
|
||||
@@ -241,6 +241,10 @@ void EditModeCoinManager::ParameterObserver::initParameters()
|
||||
[this, drawingParameters = Client.drawingParameters](const std::string& param) {
|
||||
updateColor(drawingParameters.CurveExternalColor, param);
|
||||
}},
|
||||
{"ExternalDefiningColor",
|
||||
[this, drawingParameters = Client.drawingParameters](const std::string& param) {
|
||||
updateColor(drawingParameters.CurveExternalDefiningColor, param);
|
||||
}},
|
||||
{"HighlightColor",
|
||||
[this, drawingParameters = Client.drawingParameters](const std::string& param) {
|
||||
updateColor(drawingParameters.PreselectColor, param);
|
||||
|
||||
@@ -82,6 +82,7 @@ SbColor DrawingParameters::PreselectColor(0.88f, 0.88f, 0.0f); // #E1E
|
||||
SbColor DrawingParameters::SelectColor(0.11f, 0.68f, 0.11f); // #1CAD1C -> ( 28,173, 28)
|
||||
SbColor DrawingParameters::PreselectSelectedColor(0.36f, 0.48f, 0.11f); // #5D7B1C -> ( 93,123, 28)
|
||||
SbColor DrawingParameters::CurveExternalColor(0.8f, 0.2f, 0.6f); // #CC3399 -> (204, 51,153)
|
||||
SbColor DrawingParameters::CurveExternalDefiningColor(1.0f, 0.5f, 0.69f); // #FF7FAF -> (255,127,175)
|
||||
SbColor DrawingParameters::CurveDraftColor(0.0f, 0.0f, 0.86f); // #0000DC -> ( 0, 0,220)
|
||||
SbColor
|
||||
DrawingParameters::FullyConstraintConstructionElementColor(0.56f,
|
||||
|
||||
@@ -117,6 +117,7 @@ struct DrawingParameters
|
||||
PreselectSelectedColor; // Color used for pre-selection when geometry is already selected
|
||||
static SbColor SelectColor; // Color used for selected geometry
|
||||
static SbColor CurveExternalColor; // Color used for external geometry
|
||||
static SbColor CurveExternalDefiningColor; // Color used for external defining geometry
|
||||
static SbColor CurveDraftColor; // Color used for construction geometry
|
||||
static SbColor FullyConstraintConstructionElementColor; // Color used for a fully constrained
|
||||
// construction element
|
||||
|
||||
@@ -135,6 +135,16 @@ void EditModeGeometryCoinManager::updateGeometryColor(const GeoListFacade& geoli
|
||||
return false;
|
||||
};
|
||||
|
||||
auto isExternalDefiningGeomPoint = [&geolistfacade](int GeoId) {
|
||||
auto geom = geolistfacade.getGeometryFacadeFromGeoId(GeoId);
|
||||
if (geom) {
|
||||
auto egf = ExternalGeometryFacade::getFacade(geom->clone());
|
||||
auto ref = egf->getRef();
|
||||
return egf->testFlag(ExternalGeometryExtension::Defining);
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
auto isCoincident = [&](int GeoId, Sketcher::PointPos PosId) {
|
||||
const std::vector<Sketcher::Constraint*>& constraints =
|
||||
ViewProviderSketchCoinAttorney::getConstraints(viewProvider);
|
||||
@@ -202,7 +212,9 @@ void EditModeGeometryCoinManager::updateGeometryColor(const GeoListFacade& geoli
|
||||
pcolor[i] = drawingParameters.ConstrIcoColor;
|
||||
}
|
||||
else {
|
||||
pcolor[i] = drawingParameters.CurveExternalColor;
|
||||
pcolor[i] = isExternalDefiningGeomPoint(GeoId)
|
||||
? drawingParameters.CurveExternalDefiningColor
|
||||
: drawingParameters.CurveExternalColor;
|
||||
}
|
||||
}
|
||||
else if (issketchinvalid) {
|
||||
@@ -423,7 +435,9 @@ void EditModeGeometryCoinManager::updateGeometryColor(const GeoListFacade& geoli
|
||||
color[i] = drawingParameters.InvalidSketchColor;
|
||||
}
|
||||
else {
|
||||
color[i] = drawingParameters.CurveExternalColor;
|
||||
color[i] = egf->testFlag(ExternalGeometryExtension::Defining)
|
||||
? drawingParameters.CurveExternalDefiningColor
|
||||
: drawingParameters.CurveExternalColor;
|
||||
}
|
||||
for (int k = j; j < k + indexes; j++) {
|
||||
verts[j].getValue(x, y, z);
|
||||
|
||||
@@ -550,6 +550,7 @@ void SketcherSettingsAppearance::saveSettings()
|
||||
ui->EditedEdgeColor->onSave();
|
||||
ui->ConstructionColor->onSave();
|
||||
ui->ExternalColor->onSave();
|
||||
ui->ExternalDefiningColor->onSave();
|
||||
ui->InvalidSketchColor->onSave();
|
||||
ui->FullyConstrainedColor->onSave();
|
||||
ui->InternalAlignedGeoColor->onSave();
|
||||
@@ -599,6 +600,7 @@ void SketcherSettingsAppearance::loadSettings()
|
||||
ui->EditedEdgeColor->onRestore();
|
||||
ui->ConstructionColor->onRestore();
|
||||
ui->ExternalColor->onRestore();
|
||||
ui->ExternalDefiningColor->onRestore();
|
||||
ui->InvalidSketchColor->onRestore();
|
||||
ui->FullyConstrainedColor->onRestore();
|
||||
ui->InternalAlignedGeoColor->onRestore();
|
||||
|
||||
@@ -555,7 +555,40 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="0">
|
||||
<item row="10" column="0">
|
||||
<widget class="QLabel" name="label_21">
|
||||
<property name="text">
|
||||
<string>External defining geometry</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="1">
|
||||
<widget class="Gui::PrefColorButton" name="ExternalDefiningColor">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Color of external defining geometry in edit mode</string>
|
||||
</property>
|
||||
<property name="color" stdset="0">
|
||||
<color>
|
||||
<red>255</red>
|
||||
<green>114</green>
|
||||
<blue>243</blue>
|
||||
</color>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>ExternalDefiningColor</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>View</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="0">
|
||||
<widget class="QLabel" name="label_45">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
@@ -568,7 +601,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="1">
|
||||
<item row="11" column="1">
|
||||
<widget class="Gui::PrefColorButton" name="FullyConstrainedColor">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||
@@ -594,14 +627,14 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="0">
|
||||
<item row="12" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Invalid sketch</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="1">
|
||||
<item row="12" column="1">
|
||||
<widget class="Gui::PrefColorButton" name="InvalidSketchColor">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||
|
||||
Reference in New Issue
Block a user