From a5d980ff59640d8cd8b6cbe1eb7b0e407afad9f3 Mon Sep 17 00:00:00 2001 From: Paddle Date: Mon, 15 Jan 2024 18:38:59 +0100 Subject: [PATCH] Sketcher: Edges pattern and width by type. --- src/Mod/Sketcher/Gui/AppSketcherGui.cpp | 2 +- src/Mod/Sketcher/Gui/CMakeLists.txt | 2 +- src/Mod/Sketcher/Gui/EditModeCoinManager.cpp | 100 +- src/Mod/Sketcher/Gui/EditModeCoinManager.h | 6 + .../Gui/EditModeCoinManagerParameters.h | 98 +- .../Gui/EditModeConstraintCoinManager.cpp | 26 +- .../Gui/EditModeGeometryCoinConverter.cpp | 149 +-- .../Gui/EditModeGeometryCoinConverter.h | 9 +- .../Gui/EditModeGeometryCoinManager.cpp | 301 +++--- src/Mod/Sketcher/Gui/SketcherSettings.cpp | 162 ++- src/Mod/Sketcher/Gui/SketcherSettings.h | 10 +- .../Gui/SketcherSettingsAppearance.ui | 967 ++++++++++++++++++ .../Sketcher/Gui/SketcherSettingsColors.ui | 835 --------------- 13 files changed, 1565 insertions(+), 1102 deletions(-) create mode 100644 src/Mod/Sketcher/Gui/SketcherSettingsAppearance.ui delete mode 100644 src/Mod/Sketcher/Gui/SketcherSettingsColors.ui diff --git a/src/Mod/Sketcher/Gui/AppSketcherGui.cpp b/src/Mod/Sketcher/Gui/AppSketcherGui.cpp index 2d416d37dc..c45f9b91d9 100644 --- a/src/Mod/Sketcher/Gui/AppSketcherGui.cpp +++ b/src/Mod/Sketcher/Gui/AppSketcherGui.cpp @@ -143,7 +143,7 @@ PyMOD_INIT_FUNC(SketcherGui) QT_TRANSLATE_NOOP("QObject", "Sketcher")); (void)new Gui::PrefPageProducer( QT_TRANSLATE_NOOP("QObject", "Sketcher")); - (void)new Gui::PrefPageProducer( + (void)new Gui::PrefPageProducer( QT_TRANSLATE_NOOP("QObject", "Sketcher")); // add resources and reloads the translators diff --git a/src/Mod/Sketcher/Gui/CMakeLists.txt b/src/Mod/Sketcher/Gui/CMakeLists.txt index 1e1011d8e2..2b8aa6e7f7 100644 --- a/src/Mod/Sketcher/Gui/CMakeLists.txt +++ b/src/Mod/Sketcher/Gui/CMakeLists.txt @@ -39,7 +39,7 @@ set(SketcherGui_UIC_SRCS SketchMirrorDialog.ui SketcherSettings.ui SketcherSettingsGrid.ui - SketcherSettingsColors.ui + SketcherSettingsAppearance.ui SketcherSettingsDisplay.ui SketchRectangularArrayDialog.ui SketcherRegularPolygonDialog.ui diff --git a/src/Mod/Sketcher/Gui/EditModeCoinManager.cpp b/src/Mod/Sketcher/Gui/EditModeCoinManager.cpp index 2dbdff3588..b88aaad185 100644 --- a/src/Mod/Sketcher/Gui/EditModeCoinManager.cpp +++ b/src/Mod/Sketcher/Gui/EditModeCoinManager.cpp @@ -145,6 +145,38 @@ void EditModeCoinManager::ParameterObserver::initParameters() [this](const std::string& param) { updateElementSizeParameters(param); }}, + {"EdgeWidth", + [this, &drawingParameters = Client.drawingParameters](const std::string& param) { + updateWidth(drawingParameters.CurveWidth, param, 2); + }}, + {"ConstructionWidth", + [this, &drawingParameters = Client.drawingParameters](const std::string& param) { + updateWidth(drawingParameters.ConstructionWidth, param, 1); + }}, + {"InternalWidth", + [this, &drawingParameters = Client.drawingParameters](const std::string& param) { + updateWidth(drawingParameters.InternalWidth, param, 1); + }}, + {"ExternalWidth", + [this, &drawingParameters = Client.drawingParameters](const std::string& param) { + updateWidth(drawingParameters.ExternalWidth, param, 1); + }}, + {"EdgePattern", + [this, &drawingParameters = Client.drawingParameters](const std::string& param) { + updatePattern(drawingParameters.CurvePattern, param, 0b1111111111111111); + }}, + {"ConstructionPattern", + [this, &drawingParameters = Client.drawingParameters](const std::string& param) { + updatePattern(drawingParameters.ConstructionPattern, param, 0b1111110011111100); + }}, + {"InternalPattern", + [this, &drawingParameters = Client.drawingParameters](const std::string& param) { + updatePattern(drawingParameters.InternalPattern, param, 0b1111110011111100); + }}, + {"ExternalPattern", + [this, &drawingParameters = Client.drawingParameters](const std::string& param) { + updatePattern(drawingParameters.ExternalPattern, param, 0b1110010011100100); + }}, {"CreateLineColor", [this, drawingParameters = Client.drawingParameters](const std::string& param) { updateColor(drawingParameters.CreateCurveColor, param); @@ -384,6 +416,30 @@ void EditModeCoinManager::ParameterObserver::updateElementSizeParameters( Client.updateInventorNodeSizes(); } +void EditModeCoinManager::ParameterObserver::updateWidth(int& width, + const std::string& parametername, + int def) +{ + ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath( + "User parameter:BaseApp/Preferences/Mod/Sketcher/View"); + + width = hGrp->GetInt(parametername.c_str(), def); + + Client.updateInventorWidths(); +} + +void EditModeCoinManager::ParameterObserver::updatePattern(unsigned int& pattern, + const std::string& parametername, + unsigned int def) +{ + ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath( + "User parameter:BaseApp/Preferences/Mod/Sketcher/View"); + + pattern = hGrp->GetInt(parametername.c_str(), def); + + Client.updateInventorPatterns(); +} + void EditModeCoinManager::ParameterObserver::updateColor(SbColor& sbcolor, const std::string& parametername) { @@ -691,14 +747,17 @@ EditModeCoinManager::detectPreselection(SoPickedPoint* Point, const SbVec2s& cur } // checking for a hit in the curves - if (tail == editModeScenegraphNodes.CurveSet[l]) { - const SoDetail* curve_detail = Point->getDetail(editModeScenegraphNodes.CurveSet[l]); - if (curve_detail && curve_detail->getTypeId() == SoLineDetail::getClassTypeId()) { - // get the index - int curveIndex = static_cast(curve_detail)->getLineIndex(); - result.GeoIndex = coinMapping.getCurveGeoId(curveIndex, l); + for (int t = 0; t < geometryLayerParameters.getSubLayerCount(); t++) { + if (tail == editModeScenegraphNodes.CurveSet[l][t]) { + const SoDetail* curve_detail = + Point->getDetail(editModeScenegraphNodes.CurveSet[l][t]); + if (curve_detail && curve_detail->getTypeId() == SoLineDetail::getClassTypeId()) { + // get the index + int curveIndex = static_cast(curve_detail)->getLineIndex(); + result.GeoIndex = coinMapping.getCurveGeoId(curveIndex, l, t); - return result; + return result; + } } } } @@ -1036,14 +1095,14 @@ void EditModeCoinManager::updateInventorNodeSizes() { auto layersconfiguration = viewProvider.VisualLayerList.getValues(); + updateInventorWidths(); + for (int l = 0; l < geometryLayerParameters.getCoinLayerCount(); l++) { editModeScenegraphNodes.PointsDrawStyle[l]->pointSize = 8 * drawingParameters.pixelScalingFactor; editModeScenegraphNodes.PointSet[l]->markerIndex = Gui::Inventor::MarkerBitmaps::getMarkerIndex("CIRCLE_FILLED", drawingParameters.markerSize); - editModeScenegraphNodes.CurvesDrawStyle[l]->lineWidth = - layersconfiguration[l].getLineWidth() * drawingParameters.pixelScalingFactor; } editModeScenegraphNodes.RootCrossDrawStyle->lineWidth = @@ -1064,6 +1123,29 @@ void EditModeCoinManager::updateInventorNodeSizes() pEditModeConstraintCoinManager->rebuildConstraintNodes(); } +void EditModeCoinManager::updateInventorWidths() +{ + editModeScenegraphNodes.CurvesDrawStyle->lineWidth = + drawingParameters.CurveWidth * drawingParameters.pixelScalingFactor; + editModeScenegraphNodes.CurvesConstructionDrawStyle->lineWidth = + drawingParameters.ConstructionWidth * drawingParameters.pixelScalingFactor; + editModeScenegraphNodes.CurvesInternalDrawStyle->lineWidth = + drawingParameters.InternalWidth * drawingParameters.pixelScalingFactor; + editModeScenegraphNodes.CurvesExternalDrawStyle->lineWidth = + drawingParameters.ExternalWidth * drawingParameters.pixelScalingFactor; +} + +void EditModeCoinManager::updateInventorPatterns() +{ + editModeScenegraphNodes.CurvesDrawStyle->linePattern = drawingParameters.CurvePattern; + editModeScenegraphNodes.CurvesConstructionDrawStyle->linePattern = + drawingParameters.ConstructionPattern; + editModeScenegraphNodes.CurvesInternalDrawStyle->linePattern = + drawingParameters.InternalPattern; + editModeScenegraphNodes.CurvesExternalDrawStyle->linePattern = + drawingParameters.ExternalPattern; +} + void EditModeCoinManager::updateInventorColors() { editModeScenegraphNodes.RootCrossMaterials->diffuseColor.set1Value( diff --git a/src/Mod/Sketcher/Gui/EditModeCoinManager.h b/src/Mod/Sketcher/Gui/EditModeCoinManager.h index aaf2a9b14e..338d983452 100644 --- a/src/Mod/Sketcher/Gui/EditModeCoinManager.h +++ b/src/Mod/Sketcher/Gui/EditModeCoinManager.h @@ -141,6 +141,8 @@ class SketcherGuiExport EditModeCoinManager void updateLineRenderingOrderParameters(const std::string& parametername); void updateConstraintPresentationParameters(const std::string& parametername); void updateElementSizeParameters(const std::string& parametername); + void updateWidth(int& width, const std::string& parametername, int def); + void updatePattern(unsigned int& pattern, const std::string& pname, unsigned int def); void updateColor(SbColor& sbcolor, const std::string& parametername); void updateUnit(const std::string& parametername); @@ -282,6 +284,10 @@ private: void updateInventorColors(); + void updateInventorPatterns(); + + void updateInventorWidths(); + /** @name coin nodes creation*/ void createEditModeInventorNodes(); //@} diff --git a/src/Mod/Sketcher/Gui/EditModeCoinManagerParameters.h b/src/Mod/Sketcher/Gui/EditModeCoinManagerParameters.h index a59f7766a6..19a77466e6 100644 --- a/src/Mod/Sketcher/Gui/EditModeCoinManagerParameters.h +++ b/src/Mod/Sketcher/Gui/EditModeCoinManagerParameters.h @@ -40,7 +40,6 @@ #include #include - #include #include @@ -140,6 +139,16 @@ struct DrawingParameters 17; // Font size to be used by SoDatumLabel, which uses a QPainter and a QFont internally int constraintIconSize = 15; // Size of constraint icons int markerSize = 7; // Size used for markers + + int CurveWidth = 2; // width of normal edges + int ConstructionWidth = 1; // width of construction edges + int InternalWidth = 1; // width of internal edges + int ExternalWidth = 1; // width of external edges + + unsigned int CurvePattern = 0b1111111111111111; // pattern of normal edges + unsigned int ConstructionPattern = 0b1111110011111100; // pattern of construction edges + unsigned int InternalPattern = 0b1111110011111100; // pattern of internal edges + unsigned int ExternalPattern = 0b1110010011100100; // pattern of external edges //@} }; @@ -155,9 +164,9 @@ struct GeometryLayerNodes /** @name Curve nodes*/ //@{ - std::vector& CurvesMaterials; // The materials for the curves - std::vector& CurvesCoordinate; // The coordinates of the segments of the curves - std::vector& CurveSet; // The set of curves + std::vector>& CurvesMaterials; + std::vector>& CurvesCoordinate; + std::vector>& CurveSet; //@} }; @@ -176,9 +185,10 @@ struct GeometryLayerNodes class MultiFieldId { public: - explicit constexpr MultiFieldId(int fieldindex = -1, int layerid = 0) + explicit constexpr MultiFieldId(int fieldindex = -1, int layerid = 0, int geotypeid = 0) : fieldIndex(fieldindex) , layerId(layerid) + , geoTypeId(geotypeid) {} MultiFieldId(const MultiFieldId&) = default; @@ -189,16 +199,19 @@ public: inline bool operator==(const MultiFieldId& obj) const { - return this->fieldIndex == obj.fieldIndex && this->layerId == obj.layerId; + return this->fieldIndex == obj.fieldIndex && this->layerId == obj.layerId + && this->geoTypeId == obj.geoTypeId; } inline bool operator!=(const MultiFieldId& obj) const { - return this->fieldIndex != obj.fieldIndex || this->layerId != obj.layerId; + return this->fieldIndex != obj.fieldIndex || this->layerId != obj.layerId + || this->geoTypeId != obj.geoTypeId; } int fieldIndex = -1; int layerId = 0; + int geoTypeId = 0; static const MultiFieldId Invalid; }; @@ -255,7 +268,16 @@ private: Default = 0 }; + public: + enum class SubLayer + { + Normal = 0, + Construction = 1, + Internal = 2, + External = 3, + }; + void reset() { CoinLayers = 1; @@ -280,8 +302,46 @@ public: CoinLayers = layernumber; } + int inline getSubLayerCount() const + { + return SubLayers; + } + + int inline getSubLayerIndex(const int geoId, const Sketcher::GeometryFacade* geom) const + { + bool isConstruction = geom->getConstruction(); + bool isInternal = geom->isInternalAligned(); + bool isExternal = geoId <= Sketcher::GeoEnum::RefExt; + + return static_cast(isExternal ? SubLayer::External + : isInternal ? SubLayer::Internal + : isConstruction ? SubLayer::Construction + : SubLayer::Normal); + } + + bool isNormalSubLayer(int t) const + { + return t == static_cast(SubLayer::Normal); + } + + bool isConstructionSubLayer(int t) const + { + return t == static_cast(SubLayer::Construction); + } + + bool isInternalSubLayer(int t) const + { + return t == static_cast(SubLayer::Internal); + } + + bool isExternalSubLayer(int t) const + { + return t == static_cast(SubLayer::External); + } + private: int CoinLayers = 1; // defaults to a single Coin Geometry Layer. + int SubLayers = 4; // Normal, Construction, Internal, External. }; /** @brief Struct to hold the results of analysis performed on geometry @@ -340,10 +400,14 @@ struct EditModeScenegraphNodes /** @name Curve nodes*/ //@{ SmSwitchboard* CurvesGroup; - std::vector CurvesMaterials; - std::vector CurvesCoordinate; - std::vector CurvesDrawStyle; - std::vector CurveSet; + std::vector> CurvesMaterials; + std::vector> CurvesCoordinate; + std::vector> CurveSet; + SoDrawStyle* CurvesDrawStyle; + SoDrawStyle* CurvesConstructionDrawStyle; + SoDrawStyle* CurvesInternalDrawStyle; + SoDrawStyle* CurvesExternalDrawStyle; + SoDrawStyle* HiddenCurvesDrawStyle; //@} /** @name Axes nodes*/ @@ -395,7 +459,7 @@ struct EditModeScenegraphNodes }; /** @brief Helper struct containing index conversions (mappings) between - * {GeoId, PointPos} and MF indices per layer, and VertexId and MF indices per layer. + * {GeoId, PointPos} and MF indices per layer, sublayers, and VertexId and MF indices per layer. * * These are updated with every draw of the scenegraph. */ @@ -404,6 +468,9 @@ struct CoinMapping void clear() { + for (size_t l = 0; l < CurvIdToGeoId.size(); ++l) { + CurvIdToGeoId[l].clear(); + } CurvIdToGeoId.clear(); PointIdToGeoId.clear(); GeoElementId2SetId.clear(); @@ -412,9 +479,9 @@ struct CoinMapping /// given the MF index of a curve and the coin layer in which it is drawn returns the GeoId of /// the curve - int getCurveGeoId(int curveindex, int layerindex) + int getCurveGeoId(int curveindex, int layerindex, int sublayerindex = 0) { - return CurvIdToGeoId[layerindex][curveindex]; + return CurvIdToGeoId[layerindex][sublayerindex][curveindex]; } /// given the MF index of a point and the coin layer in which it is drawn returns the GeoId of /// the point @@ -461,7 +528,8 @@ struct CoinMapping //* These map a MF index (second index) within a coin layer (first index) for points or curves // to a GeoId */ - std::vector> CurvIdToGeoId; // conversion of SoLineSet index to GeoId + std::vector>> + CurvIdToGeoId; // conversion of SoLineSet index to GeoId std::vector> PointIdToGeoId; // conversion of SoCoordinate3 index to GeoId //* This maps an MF index (second index) of a point within a coin layer (first index) to a diff --git a/src/Mod/Sketcher/Gui/EditModeConstraintCoinManager.cpp b/src/Mod/Sketcher/Gui/EditModeConstraintCoinManager.cpp index 5dc22f984a..c8a38dd933 100644 --- a/src/Mod/Sketcher/Gui/EditModeConstraintCoinManager.cpp +++ b/src/Mod/Sketcher/Gui/EditModeConstraintCoinManager.cpp @@ -1587,14 +1587,20 @@ void EditModeConstraintCoinManager::updateConstraintColor( std::vector PtNum; std::vector pcolor; // point color - std::vector CurvNum; - std::vector color; // curve color + std::vector> CurvNum; + std::vector> color; // curve color for (int l = 0; l < geometryLayerParameters.getCoinLayerCount(); l++) { PtNum.push_back(editModeScenegraphNodes.PointsMaterials[l]->diffuseColor.getNum()); pcolor.push_back(editModeScenegraphNodes.PointsMaterials[l]->diffuseColor.startEditing()); - CurvNum.push_back(editModeScenegraphNodes.CurvesMaterials[l]->diffuseColor.getNum()); - color.push_back(editModeScenegraphNodes.CurvesMaterials[l]->diffuseColor.startEditing()); + CurvNum.emplace_back(); + color.emplace_back(); + for (int t = 0; t < geometryLayerParameters.getSubLayerCount(); t++) { + CurvNum[l].push_back( + editModeScenegraphNodes.CurvesMaterials[l][t]->diffuseColor.getNum()); + color[l].push_back( + editModeScenegraphNodes.CurvesMaterials[l][t]->diffuseColor.startEditing()); + } } int maxNumberOfConstraints = std::min(editModeScenegraphNodes.constrGroup->getNumChildren(), @@ -1653,9 +1659,11 @@ void EditModeConstraintCoinManager::updateConstraintColor( if (multifieldIndex != MultiFieldId::Invalid) { int index = multifieldIndex.fieldIndex; int layer = multifieldIndex.layerId; - if (layer < static_cast(CurvNum.size()) && index >= 0 - && index < CurvNum[layer]) { - color[layer][index] = drawingParameters.SelectColor; + int sublayer = multifieldIndex.geoTypeId; + if (layer < static_cast(CurvNum.size()) + && sublayer < static_cast(CurvNum[layer].size()) && index >= 0 + && index < CurvNum[layer][sublayer]) { + color[layer][sublayer][index] = drawingParameters.SelectColor; } } } @@ -1730,7 +1738,9 @@ void EditModeConstraintCoinManager::updateConstraintColor( for (int l = 0; l < geometryLayerParameters.getCoinLayerCount(); l++) { editModeScenegraphNodes.PointsMaterials[l]->diffuseColor.finishEditing(); - editModeScenegraphNodes.CurvesMaterials[l]->diffuseColor.finishEditing(); + for (int t = 0; t < geometryLayerParameters.getSubLayerCount(); t++) { + editModeScenegraphNodes.CurvesMaterials[l][t]->diffuseColor.finishEditing(); + } } } diff --git a/src/Mod/Sketcher/Gui/EditModeGeometryCoinConverter.cpp b/src/Mod/Sketcher/Gui/EditModeGeometryCoinConverter.cpp index d1b0679788..5235a0224c 100644 --- a/src/Mod/Sketcher/Gui/EditModeGeometryCoinConverter.cpp +++ b/src/Mod/Sketcher/Gui/EditModeGeometryCoinConverter.cpp @@ -55,27 +55,30 @@ void EditModeGeometryCoinConverter::convert(const Sketcher::GeoListFacade& geoli arcGeoIds.clear(); // end information layer - Coords.clear(); Points.clear(); + Coords.clear(); Index.clear(); coinMapping.clear(); pointCounter.clear(); - curveCounter.clear(); for (auto l = 0; l < geometryLayerParameters.getCoinLayerCount(); l++) { - Coords.emplace_back(); Points.emplace_back(); + Coords.emplace_back(); Index.emplace_back(); coinMapping.CurvIdToGeoId.emplace_back(); + for (int t = 0; t < geometryLayerParameters.getSubLayerCount(); t++) { + Coords[l].emplace_back(); + Index[l].emplace_back(); + coinMapping.CurvIdToGeoId[l].emplace_back(); + } coinMapping.PointIdToGeoId.emplace_back(); coinMapping.PointIdToVertexId.emplace_back(); } pointCounter.resize(geometryLayerParameters.getCoinLayerCount(), 0); - curveCounter.resize(geometryLayerParameters.getCoinLayerCount(), 0); // RootPoint // TODO: RootPoint is here added in layer0. However, this layer may be hidden. The point should, @@ -83,8 +86,8 @@ void EditModeGeometryCoinConverter::convert(const Sketcher::GeoListFacade& geoli // empty layer. Points[0].emplace_back(0., 0., 0.); coinMapping.PointIdToGeoId[0].push_back(-1); // root point - coinMapping.PointIdToVertexId[0].push_back( - -1); // VertexId is the reference used for point selection/preselection + coinMapping.PointIdToVertexId[0].push_back(-1); + // VertexId is the reference used for point selection/preselection coinMapping.GeoElementId2SetId.emplace(std::piecewise_construct, std::forward_as_tuple(Sketcher::GeoElementId::RtPnt), @@ -93,7 +96,8 @@ void EditModeGeometryCoinConverter::convert(const Sketcher::GeoListFacade& geoli auto setTracking = [this](int geoId, int coinLayer, EditModeGeometryCoinConverter::PointsMode pointmode, - int numberCurves) { + int numberCurves, + int sublayer) { int numberPoints = 0; if (pointmode == PointsMode::InsertSingle) { @@ -153,12 +157,14 @@ void EditModeGeometryCoinConverter::convert(const Sketcher::GeoListFacade& geoli coinMapping.GeoElementId2SetId.emplace( std::piecewise_construct, std::forward_as_tuple(geoId, Sketcher::PointPos::none), - std::forward_as_tuple(static_cast(coinMapping.CurvIdToGeoId[coinLayer].size()), - coinLayer)); + std::forward_as_tuple( + static_cast(coinMapping.CurvIdToGeoId[coinLayer][sublayer].size()), + coinLayer, + sublayer)); } for (int i = 0; i < numberCurves; i++) { - coinMapping.CurvIdToGeoId[coinLayer].push_back(geoId); + coinMapping.CurvIdToGeoId[coinLayer][sublayer].push_back(geoId); } }; @@ -168,7 +174,8 @@ void EditModeGeometryCoinConverter::convert(const Sketcher::GeoListFacade& geoli const auto geom = geolistfacade.getGeometryFacadeFromGeoId(GeoId); const auto type = geom->getGeometry()->getTypeId(); - auto layerId = getSafeGeomLayerId(geom); + int layerId = getSafeGeomLayerId(geom); + int subLayerId = geometryLayerParameters.getSubLayerIndex(GeoId, geom); auto coinLayer = geometryLayerParameters.getSafeCoinLayer(layerId); @@ -176,43 +183,55 @@ void EditModeGeometryCoinConverter::convert(const Sketcher::GeoListFacade& geoli convert(geom, GeoId); + EditModeGeometryCoinConverter::AnalyseMode::BoundingBoxMagnitude>(geom, + GeoId, + subLayerId); setTracking(GeoId, coinLayer, EditModeGeometryCoinConverter::PointsMode::InsertSingle, - 0); + 0, + subLayerId); } else if (type == Part::GeomLineSegment::getClassTypeId()) { // add a line convert(geom, GeoId); + EditModeGeometryCoinConverter::AnalyseMode::BoundingBoxMagnitude>(geom, + GeoId, + subLayerId); setTracking(GeoId, coinLayer, EditModeGeometryCoinConverter::PointsMode::InsertStartEnd, - 1); + 1, + subLayerId); } else if (type.isDerivedFrom( Part::GeomConic::getClassTypeId())) { // add a closed curve conic convert(geom, GeoId); + EditModeGeometryCoinConverter::AnalyseMode::BoundingBoxMagnitude>(geom, + GeoId, + subLayerId); setTracking(GeoId, coinLayer, EditModeGeometryCoinConverter::PointsMode::InsertMidOnly, - 1); + 1, + subLayerId); } else if (type.isDerivedFrom( Part::GeomArcOfConic::getClassTypeId())) { // add an arc of conic convert(geom, GeoId); + EditModeGeometryCoinConverter::AnalyseMode::BoundingBoxMagnitude>(geom, + GeoId, + subLayerId); setTracking(GeoId, coinLayer, EditModeGeometryCoinConverter::PointsMode::InsertStartEndMid, - 1); + 1, + subLayerId); arcGeoIds.push_back(GeoId); } else if (type == Part::GeomBSplineCurve::getClassTypeId()) { // add a bspline (a bounded @@ -221,58 +240,53 @@ void EditModeGeometryCoinConverter::convert(const Sketcher::GeoListFacade& geoli EditModeGeometryCoinConverter::PointsMode::InsertStartEnd, EditModeGeometryCoinConverter::CurveMode::OpenCurve, EditModeGeometryCoinConverter::AnalyseMode:: - BoundingBoxMagnitudeAndBSplineCurvature>(geom, GeoId); + BoundingBoxMagnitudeAndBSplineCurvature>(geom, GeoId, subLayerId); setTracking(GeoId, coinLayer, EditModeGeometryCoinConverter::PointsMode::InsertStartEnd, - 1); + 1, + subLayerId); bsplineGeoIds.push_back(GeoId); } } - for (auto l = 0; l < geometryLayerParameters.getCoinLayerCount(); l++) { + // Coin Nodes Editing + int vOrFactor = ViewProviderSketchCoinAttorney::getViewOrientationFactor(viewProvider); + double linez = vOrFactor * drawingParameters.zLowLines; // NOLINT + double pointz = vOrFactor * drawingParameters.zLowPoints; - // Coin Nodes Editing - geometryLayerNodes.CurvesCoordinate[l]->point.setNum(Coords[l].size()); - geometryLayerNodes.CurveSet[l]->numVertices.setNum(Index[l].size()); - geometryLayerNodes.CurvesMaterials[l]->diffuseColor.setNum(Index[l].size()); + for (auto l = 0; l < geometryLayerParameters.getCoinLayerCount(); l++) { geometryLayerNodes.PointsCoordinate[l]->point.setNum(Points[l].size()); geometryLayerNodes.PointsMaterials[l]->diffuseColor.setNum(Points[l].size()); - - SbVec3f* verts = geometryLayerNodes.CurvesCoordinate[l]->point.startEditing(); - int32_t* index = geometryLayerNodes.CurveSet[l]->numVertices.startEditing(); SbVec3f* pverts = geometryLayerNodes.PointsCoordinate[l]->point.startEditing(); - int i = 0; // setting up the line set - for (std::vector::const_iterator it = Coords[l].begin(); - it != Coords[l].end(); - ++it, i++) { - verts[i].setValue(it->x, - it->y, - ViewProviderSketchCoinAttorney::getViewOrientationFactor(viewProvider) - * drawingParameters.zLowLines); + int i = 0; // setting up the point set + for (auto& point : Points[l]) { + pverts[i++].setValue(point.x, point.y, pointz); } - - i = 0; // setting up the indexes of the line set - for (std::vector::const_iterator it = Index[l].begin(); it != Index[l].end(); - ++it, i++) { - index[i] = *it; - } - - i = 0; // setting up the point set - for (std::vector::const_iterator it = Points[l].begin(); - it != Points[l].end(); - ++it, i++) { - pverts[i].setValue( - it->x, - it->y, - ViewProviderSketchCoinAttorney::getViewOrientationFactor(viewProvider) - * drawingParameters.zLowPoints); - } - - geometryLayerNodes.CurvesCoordinate[l]->point.finishEditing(); - geometryLayerNodes.CurveSet[l]->numVertices.finishEditing(); geometryLayerNodes.PointsCoordinate[l]->point.finishEditing(); + + for (auto t = 0; t < geometryLayerParameters.getSubLayerCount(); t++) { + geometryLayerNodes.CurvesCoordinate[l][t]->point.setNum(Coords[l][t].size()); + geometryLayerNodes.CurveSet[l][t]->numVertices.setNum(Index[l][t].size()); + geometryLayerNodes.CurvesMaterials[l][t]->diffuseColor.setNum(Index[l][t].size()); + + SbVec3f* verts = geometryLayerNodes.CurvesCoordinate[l][t]->point.startEditing(); + int32_t* index = geometryLayerNodes.CurveSet[l][t]->numVertices.startEditing(); + + i = 0; // setting up the line set + for (auto& coord : Coords[l][t]) { + verts[i++].setValue(coord.x, coord.y, linez); // NOLINT + } + + i = 0; // setting up the indexes of the line set + for (auto it : Index[l][t]) { + index[i++] = it; + } + + geometryLayerNodes.CurvesCoordinate[l][t]->point.finishEditing(); + geometryLayerNodes.CurveSet[l][t]->numVertices.finishEditing(); + } } } @@ -281,7 +295,8 @@ template void EditModeGeometryCoinConverter::convert(const Sketcher::GeometryFacade* geometryfacade, - [[maybe_unused]] int geoid) + [[maybe_unused]] int geoid, + int subLayer) { auto geo = static_cast(geometryfacade->getGeometry()); auto layerId = getSafeGeomLayerId(geometryfacade); @@ -317,9 +332,9 @@ void EditModeGeometryCoinConverter::convert(const Sketcher::GeometryFacade* geom // Curves if constexpr (curvemode == CurveMode::StartEndPointsOnly) { - addPoint(Coords[coinLayer], geo->getStartPoint()); - addPoint(Coords[coinLayer], geo->getEndPoint()); - Index[coinLayer].push_back(2); + addPoint(Coords[coinLayer][subLayer], geo->getStartPoint()); + addPoint(Coords[coinLayer][subLayer], geo->getEndPoint()); + Index[coinLayer][subLayer].push_back(2); } else if constexpr (curvemode == CurveMode::ClosedCurve) { int numSegments = drawingParameters.curvedEdgeCountSegments; @@ -331,13 +346,13 @@ void EditModeGeometryCoinConverter::convert(const Sketcher::GeometryFacade* geom for (int i = 0; i < numSegments; i++) { Base::Vector3d pnt = geo->value(i * segment); - addPoint(Coords[coinLayer], pnt); + addPoint(Coords[coinLayer][subLayer], pnt); } Base::Vector3d pnt = geo->value(0); - addPoint(Coords[coinLayer], pnt); + addPoint(Coords[coinLayer][subLayer], pnt); - Index[coinLayer].push_back(numSegments + 1); + Index[coinLayer][subLayer].push_back(numSegments + 1); } else if constexpr (curvemode == CurveMode::OpenCurve) { int numSegments = drawingParameters.curvedEdgeCountSegments; @@ -349,13 +364,13 @@ void EditModeGeometryCoinConverter::convert(const Sketcher::GeometryFacade* geom for (int i = 0; i < numSegments; i++) { Base::Vector3d pnt = geo->value(geo->getFirstParameter() + i * segment); - addPoint(Coords[coinLayer], pnt); + addPoint(Coords[coinLayer][subLayer], pnt); } Base::Vector3d pnt = geo->value(geo->getLastParameter()); - addPoint(Coords[coinLayer], pnt); + addPoint(Coords[coinLayer][subLayer], pnt); - Index[coinLayer].push_back(numSegments + 1); + Index[coinLayer][subLayer].push_back(numSegments + 1); if constexpr (analysemode == AnalyseMode::BoundingBoxMagnitudeAndBSplineCurvature) { //*************************************************************************************************************** diff --git a/src/Mod/Sketcher/Gui/EditModeGeometryCoinConverter.h b/src/Mod/Sketcher/Gui/EditModeGeometryCoinConverter.h index 950635138a..889b5b0a2e 100644 --- a/src/Mod/Sketcher/Gui/EditModeGeometryCoinConverter.h +++ b/src/Mod/Sketcher/Gui/EditModeGeometryCoinConverter.h @@ -152,7 +152,9 @@ public: private: template - void convert(const Sketcher::GeometryFacade* geometryfacade, [[maybe_unused]] int geoId); + void convert(const Sketcher::GeometryFacade* geometryfacade, + [[maybe_unused]] int geoId, + int subLayerId = 0); private: /// Reference to ViewProviderSketch in order to access the public and the Attorney Interface @@ -160,13 +162,12 @@ private: GeometryLayerNodes& geometryLayerNodes; - std::vector> Coords; std::vector> Points; - std::vector> Index; + std::vector>> Coords; + std::vector>> Index; // temporal counters, one per layer std::vector pointCounter; - std::vector curveCounter; // temporal global vertex counter int vertexCounter = 0; diff --git a/src/Mod/Sketcher/Gui/EditModeGeometryCoinManager.cpp b/src/Mod/Sketcher/Gui/EditModeGeometryCoinManager.cpp index 120e8dd352..8c6b030a34 100644 --- a/src/Mod/Sketcher/Gui/EditModeGeometryCoinManager.cpp +++ b/src/Mod/Sketcher/Gui/EditModeGeometryCoinManager.cpp @@ -73,19 +73,21 @@ void EditModeGeometryCoinManager::processGeometry(const GeoListFacade& geolistfa { // enable all layers editModeScenegraphNodes.PointsGroup->enable.setNum(geometryLayerParameters.getCoinLayerCount()); - editModeScenegraphNodes.CurvesGroup->enable.setNum(geometryLayerParameters.getCoinLayerCount()); + editModeScenegraphNodes.CurvesGroup->enable.setNum( + geometryLayerParameters.getCoinLayerCount() * geometryLayerParameters.getSubLayerCount()); SbBool* swsp = editModeScenegraphNodes.PointsGroup->enable.startEditing(); SbBool* swsc = editModeScenegraphNodes.CurvesGroup->enable.startEditing(); - auto setEnableLayer = [swsp, swsc](int l, bool enabled) { - swsp[l] = enabled; // layer defaults to enabled - swsc[l] = enabled; // layer defaults to enabled - }; - auto layersconfigurations = viewProvider.VisualLayerList.getValues(); for (auto l = 0; l < geometryLayerParameters.getCoinLayerCount(); l++) { - setEnableLayer(l, layersconfigurations[l].isVisible()); + auto enabled = layersconfigurations[l].isVisible(); + + swsp[l] = enabled; + int slCount = geometryLayerParameters.getSubLayerCount(); + for (int t = 0; t < slCount; t++) { + swsc[l * slCount + t] = enabled; + } } editModeScenegraphNodes.PointsGroup->enable.finishEditing(); @@ -122,14 +124,6 @@ void EditModeGeometryCoinManager::updateGeometryColor(const GeoListFacade& geoli bool issketchinvalid) { // Lambdas for convenience retrieval of geometry information - auto isConstructionGeom = [&geolistfacade](int GeoId) { - auto geom = geolistfacade.getGeometryFacadeFromGeoId(GeoId); - if (geom) { - return geom->getConstruction(); - } - return false; - }; - auto isDefinedGeomPoint = [&geolistfacade](int GeoId) { auto geom = geolistfacade.getGeometryFacadeFromGeoId(GeoId); if (geom) { @@ -162,6 +156,9 @@ void EditModeGeometryCoinManager::updateGeometryColor(const GeoListFacade& geoli return false; }; + bool sketchFullyConstrained = + ViewProviderSketchCoinAttorney::isSketchFullyConstrained(viewProvider); + // Update Colors SbColor* crosscolor = editModeScenegraphNodes.RootCrossMaterials->diffuseColor.startEditing(); @@ -169,17 +166,11 @@ void EditModeGeometryCoinManager::updateGeometryColor(const GeoListFacade& geoli ViewProviderSketchCoinAttorney::getViewOrientationFactor(viewProvider); for (auto l = 0; l < geometryLayerParameters.getCoinLayerCount(); l++) { - + float x, y, z; int PtNum = editModeScenegraphNodes.PointsMaterials[l]->diffuseColor.getNum(); SbColor* pcolor = editModeScenegraphNodes.PointsMaterials[l]->diffuseColor.startEditing(); - int CurvNum = editModeScenegraphNodes.CurvesMaterials[l]->diffuseColor.getNum(); - SbColor* color = editModeScenegraphNodes.CurvesMaterials[l]->diffuseColor.startEditing(); - - SbVec3f* verts = editModeScenegraphNodes.CurvesCoordinate[l]->point.startEditing(); SbVec3f* pverts = editModeScenegraphNodes.PointsCoordinate[l]->point.startEditing(); - float x, y, z; - // colors of the point set if (issketchinvalid) { for (int i = 0; i < PtNum; i++) { @@ -189,9 +180,7 @@ void EditModeGeometryCoinManager::updateGeometryColor(const GeoListFacade& geoli else { for (int i = 0; i < PtNum; i++) { - if (!(i == 0 && l == 0) - && ViewProviderSketchCoinAttorney::isSketchFullyConstrained( - viewProvider)) { // root point is not coloured + if (!(i == 0 && l == 0) && sketchFullyConstrained) { // root point is not coloured pcolor[i] = drawingParameters.FullyConstrainedColor; } else { @@ -345,98 +334,99 @@ void EditModeGeometryCoinManager::updateGeometryColor(const GeoListFacade& geoli drawingParameters.zMidLines, drawingParameters.zLowLines); - int j = 0; // vertexindex + for (auto t = 0; t < geometryLayerParameters.getSubLayerCount(); t++) { + int CurvNum = editModeScenegraphNodes.CurvesMaterials[l][t]->diffuseColor.getNum(); + SbColor* color = + editModeScenegraphNodes.CurvesMaterials[l][t]->diffuseColor.startEditing(); + SbVec3f* verts = editModeScenegraphNodes.CurvesCoordinate[l][t]->point.startEditing(); - for (int i = 0; i < CurvNum; i++) { - int GeoId = coinMapping.getCurveGeoId(i, l); - // CurvId has several vertices associated to 1 material - // edit->CurveSet->numVertices => [i] indicates number of vertex for line i. - int indexes = (editModeScenegraphNodes.CurveSet[l]->numVertices[i]); + int j = 0; // vertexindex + for (int i = 0; i < CurvNum; i++) { + int GeoId = coinMapping.getCurveGeoId(i, l, t); + // CurvId has several vertices associated to 1 material + // edit->CurveSet->numVertices => [i] indicates number of vertex for line i. + int indexes = (editModeScenegraphNodes.CurveSet[l][t]->numVertices[i]); - bool selected = ViewProviderSketchCoinAttorney::isCurveSelected(viewProvider, GeoId); - bool preselected = (preselectcurve == GeoId); + bool selected = + ViewProviderSketchCoinAttorney::isCurveSelected(viewProvider, GeoId); + bool preselected = (preselectcurve == GeoId); + bool constrainedElement = isFullyConstraintElement(GeoId); - bool constrainedElement = isFullyConstraintElement(GeoId); + if (selected || preselected) { + color[i] = selected ? (preselected ? drawingParameters.PreselectSelectedColor + : drawingParameters.SelectColor) + : drawingParameters.PreselectColor; - if (selected && preselected) { - color[i] = drawingParameters.PreselectSelectedColor; - for (int k = j; j < k + indexes; j++) { - verts[j].getValue(x, y, z); - verts[j] = SbVec3f(x, y, viewOrientationFactor * drawingParameters.zHighLine); - } - } - else if (selected) { - color[i] = drawingParameters.SelectColor; - for (int k = j; j < k + indexes; j++) { - verts[j].getValue(x, y, z); - verts[j] = SbVec3f(x, y, viewOrientationFactor * drawingParameters.zHighLine); - } - } - else if (preselected) { - color[i] = drawingParameters.PreselectColor; - for (int k = j; j < k + indexes; j++) { - verts[j].getValue(x, y, z); - verts[j] = SbVec3f(x, y, viewOrientationFactor * drawingParameters.zHighLine); - } - } - else if (GeoId <= Sketcher::GeoEnum::RefExt) { // external Geometry - color[i] = drawingParameters.CurveExternalColor; - for (int k = j; j < k + indexes; j++) { - verts[j].getValue(x, y, z); - verts[j] = SbVec3f(x, y, viewOrientationFactor * zExtLine); - } - } - else if (issketchinvalid) { - color[i] = drawingParameters.InvalidSketchColor; - for (int k = j; j < k + indexes; j++) { - verts[j].getValue(x, y, z); - verts[j] = SbVec3f(x, y, viewOrientationFactor * zNormLine); - } - } - else if (isConstructionGeom(GeoId)) { - if (isInternalAlignedGeom(GeoId)) { - if (constrainedElement) { - color[i] = drawingParameters.FullyConstraintInternalAlignmentColor; + for (int k = j; j < k + indexes; j++) { + verts[j].getValue(x, y, z); + verts[j] = + SbVec3f(x, y, viewOrientationFactor * drawingParameters.zHighLine); } - else { - color[i] = drawingParameters.InternalAlignedGeoColor; + } + else if (geometryLayerParameters.isExternalSubLayer(t)) { + color[i] = drawingParameters.CurveExternalColor; + for (int k = j; j < k + indexes; j++) { + verts[j].getValue(x, y, z); + verts[j] = SbVec3f(x, y, viewOrientationFactor * zExtLine); } } else { - if (constrainedElement) { - color[i] = drawingParameters.FullyConstraintConstructionElementColor; + if (issketchinvalid) { + color[i] = drawingParameters.InvalidSketchColor; + + for (int k = j; j < k + indexes; j++) { + verts[j].getValue(x, y, z); + verts[j] = SbVec3f(x, y, viewOrientationFactor * zNormLine); + } + } + else if (geometryLayerParameters.isConstructionSubLayer(t)) { + if (constrainedElement) { + color[i] = drawingParameters.FullyConstraintConstructionElementColor; + } + else { + color[i] = drawingParameters.CurveDraftColor; + } + + for (int k = j; j < k + indexes; j++) { + verts[j].getValue(x, y, z); + verts[j] = SbVec3f(x, y, viewOrientationFactor * zConstrLine); + } + } + else if (geometryLayerParameters.isInternalSubLayer(t)) { + if (constrainedElement) { + color[i] = drawingParameters.FullyConstraintInternalAlignmentColor; + } + else { + color[i] = drawingParameters.InternalAlignedGeoColor; + } + + for (int k = j; j < k + indexes; j++) { + verts[j].getValue(x, y, z); + verts[j] = SbVec3f(x, y, viewOrientationFactor * zConstrLine); + } } else { - color[i] = drawingParameters.CurveDraftColor; + if (sketchFullyConstrained) { + color[i] = drawingParameters.FullyConstrainedColor; + } + else if (constrainedElement) { + color[i] = drawingParameters.FullyConstraintElementColor; + } + else { + color[i] = drawingParameters.CurveColor; + } + + for (int k = j; j < k + indexes; j++) { + verts[j].getValue(x, y, z); + verts[j] = SbVec3f(x, y, viewOrientationFactor * zNormLine); + } } } + } - for (int k = j; j < k + indexes; j++) { - verts[j].getValue(x, y, z); - verts[j] = SbVec3f(x, y, viewOrientationFactor * zConstrLine); - } - } - else if (ViewProviderSketchCoinAttorney::isSketchFullyConstrained(viewProvider)) { - color[i] = drawingParameters.FullyConstrainedColor; - for (int k = j; j < k + indexes; j++) { - verts[j].getValue(x, y, z); - verts[j] = SbVec3f(x, y, viewOrientationFactor * zNormLine); - } - } - else if (isFullyConstraintElement(GeoId)) { - color[i] = drawingParameters.FullyConstraintElementColor; - for (int k = j; j < k + indexes; j++) { - verts[j].getValue(x, y, z); - verts[j] = SbVec3f(x, y, viewOrientationFactor * zNormLine); - } - } - else { - color[i] = drawingParameters.CurveColor; - for (int k = j; j < k + indexes; j++) { - verts[j].getValue(x, y, z); - verts[j] = SbVec3f(x, y, viewOrientationFactor * zNormLine); - } - } + editModeScenegraphNodes.CurvesMaterials[l][t]->diffuseColor.finishEditing(); + editModeScenegraphNodes.CurvesCoordinate[l][t]->point.finishEditing(); + editModeScenegraphNodes.CurveSet[l][t]->numVertices.finishEditing(); } // colors of the cross @@ -464,11 +454,7 @@ void EditModeGeometryCoinManager::updateGeometryColor(const GeoListFacade& geoli } } - // end editing - editModeScenegraphNodes.CurvesMaterials[l]->diffuseColor.finishEditing(); editModeScenegraphNodes.PointsMaterials[l]->diffuseColor.finishEditing(); - editModeScenegraphNodes.CurvesCoordinate[l]->point.finishEditing(); - editModeScenegraphNodes.CurveSet[l]->numVertices.finishEditing(); } editModeScenegraphNodes.RootCrossMaterials->diffuseColor.finishEditing(); @@ -565,45 +551,80 @@ void EditModeGeometryCoinManager::createEditModePointInventorNodes() void EditModeGeometryCoinManager::createEditModeCurveInventorNodes() { - auto layersconfigurations = viewProvider.VisualLayerList.getValue(); + editModeScenegraphNodes.CurvesDrawStyle = new SoDrawStyle; + editModeScenegraphNodes.CurvesDrawStyle->setName("CurvesDrawStyle"); + editModeScenegraphNodes.CurvesDrawStyle->lineWidth = + drawingParameters.CurveWidth * drawingParameters.pixelScalingFactor; + editModeScenegraphNodes.CurvesDrawStyle->linePattern = drawingParameters.CurvePattern; + editModeScenegraphNodes.CurvesDrawStyle->linePatternScaleFactor = 2; + + editModeScenegraphNodes.CurvesConstructionDrawStyle = new SoDrawStyle; + editModeScenegraphNodes.CurvesConstructionDrawStyle->setName("CurvesConstructionDrawStyle"); + editModeScenegraphNodes.CurvesConstructionDrawStyle->lineWidth = + drawingParameters.ConstructionWidth * drawingParameters.pixelScalingFactor; + editModeScenegraphNodes.CurvesConstructionDrawStyle->linePattern = + drawingParameters.ConstructionPattern; + editModeScenegraphNodes.CurvesConstructionDrawStyle->linePatternScaleFactor = 2; + + editModeScenegraphNodes.CurvesInternalDrawStyle = new SoDrawStyle; + editModeScenegraphNodes.CurvesInternalDrawStyle->setName("CurvesInternalDrawStyle"); + editModeScenegraphNodes.CurvesInternalDrawStyle->lineWidth = + drawingParameters.InternalWidth * drawingParameters.pixelScalingFactor; + editModeScenegraphNodes.CurvesInternalDrawStyle->linePattern = + drawingParameters.InternalPattern; + editModeScenegraphNodes.CurvesInternalDrawStyle->linePatternScaleFactor = 2; + + editModeScenegraphNodes.CurvesExternalDrawStyle = new SoDrawStyle; + editModeScenegraphNodes.CurvesExternalDrawStyle->setName("CurvesExternalDrawStyle"); + editModeScenegraphNodes.CurvesExternalDrawStyle->lineWidth = + drawingParameters.ExternalWidth * drawingParameters.pixelScalingFactor; + editModeScenegraphNodes.CurvesExternalDrawStyle->linePattern = + drawingParameters.ExternalPattern; + editModeScenegraphNodes.CurvesExternalDrawStyle->linePatternScaleFactor = 2; for (int i = 0; i < geometryLayerParameters.getCoinLayerCount(); i++) { - SoSeparator* sep = new SoSeparator; - sep->ref(); + editModeScenegraphNodes.CurvesMaterials.emplace_back(); + editModeScenegraphNodes.CurvesCoordinate.emplace_back(); + editModeScenegraphNodes.CurveSet.emplace_back(); + for (int t = 0; t < geometryLayerParameters.getSubLayerCount(); t++) { + SoSeparator* sep = new SoSeparator; + sep->ref(); - auto somaterial = new SoMaterial; - editModeScenegraphNodes.CurvesMaterials.push_back(somaterial); - editModeScenegraphNodes.CurvesMaterials[i]->setName(concat("CurvesMaterials", i).c_str()); - sep->addChild(editModeScenegraphNodes.CurvesMaterials[i]); + auto somaterial = new SoMaterial; + somaterial->setName(concat("CurvesMaterials", i * 10 + t).c_str()); + editModeScenegraphNodes.CurvesMaterials[i].push_back(somaterial); + sep->addChild(editModeScenegraphNodes.CurvesMaterials[i][t]); - auto MtlBind = new SoMaterialBinding; - MtlBind->setName(concat("CurvesMaterialsBinding", i).c_str()); - MtlBind->value = SoMaterialBinding::PER_FACE; - sep->addChild(MtlBind); + auto MtlBind = new SoMaterialBinding; + MtlBind->setName(concat("CurvesMaterialsBinding", i * 10 + t).c_str()); + MtlBind->value = SoMaterialBinding::PER_FACE; + sep->addChild(MtlBind); - auto coords = new SoCoordinate3; - editModeScenegraphNodes.CurvesCoordinate.push_back(coords); - editModeScenegraphNodes.CurvesCoordinate[i]->setName(concat("CurvesCoordinate", i).c_str()); - sep->addChild(editModeScenegraphNodes.CurvesCoordinate[i]); + auto coords = new SoCoordinate3; + coords->setName(concat("CurvesCoordinate", i * 10 + t).c_str()); + editModeScenegraphNodes.CurvesCoordinate[i].push_back(coords); + sep->addChild(editModeScenegraphNodes.CurvesCoordinate[i][t]); - auto drawstyle = new SoDrawStyle; - editModeScenegraphNodes.CurvesDrawStyle.push_back(drawstyle); - editModeScenegraphNodes.CurvesDrawStyle[i]->setName(concat("CurvesDrawStyle", i).c_str()); + if (geometryLayerParameters.isConstructionSubLayer(t)) { + sep->addChild(editModeScenegraphNodes.CurvesConstructionDrawStyle); + } + else if (geometryLayerParameters.isInternalSubLayer(t)) { + sep->addChild(editModeScenegraphNodes.CurvesInternalDrawStyle); + } + else if (geometryLayerParameters.isExternalSubLayer(t)) { + sep->addChild(editModeScenegraphNodes.CurvesExternalDrawStyle); + } + else { + sep->addChild(editModeScenegraphNodes.CurvesDrawStyle); + } - editModeScenegraphNodes.CurvesDrawStyle[i]->lineWidth = - layersconfigurations[i].getLineWidth() * drawingParameters.pixelScalingFactor; - editModeScenegraphNodes.CurvesDrawStyle[i]->linePattern = - layersconfigurations[i].getLinePattern(); - editModeScenegraphNodes.CurvesDrawStyle[i]->linePatternScaleFactor = 5; + auto solineset = new SoLineSet; + solineset->setName(concat("CurvesLineSet", i * 10 + t).c_str()); + editModeScenegraphNodes.CurveSet[i].push_back(solineset); + sep->addChild(editModeScenegraphNodes.CurveSet[i][t]); - sep->addChild(editModeScenegraphNodes.CurvesDrawStyle[i]); - - auto solineset = new SoLineSet; - editModeScenegraphNodes.CurveSet.push_back(solineset); - editModeScenegraphNodes.CurveSet[i]->setName(concat("CurvesLineSet", i).c_str()); - sep->addChild(editModeScenegraphNodes.CurveSet[i]); - - editModeScenegraphNodes.CurvesGroup->addChild(sep); - sep->unref(); + editModeScenegraphNodes.CurvesGroup->addChild(sep); + sep->unref(); + } } } diff --git a/src/Mod/Sketcher/Gui/SketcherSettings.cpp b/src/Mod/Sketcher/Gui/SketcherSettings.cpp index a316235e49..5c30e5fced 100644 --- a/src/Mod/Sketcher/Gui/SketcherSettings.cpp +++ b/src/Mod/Sketcher/Gui/SketcherSettings.cpp @@ -34,7 +34,7 @@ #include "SketcherSettings.h" #include "ui_SketcherSettings.h" -#include "ui_SketcherSettingsColors.h" +#include "ui_SketcherSettingsAppearance.h" #include "ui_SketcherSettingsDisplay.h" #include "ui_SketcherSettingsGrid.h" @@ -43,6 +43,49 @@ using namespace SketcherGui; /* TRANSLATOR SketcherGui::SketcherSettings */ +QList getPenStyles() +{ + QList styles; + styles << 0b1111111111111111 // solid + << 0b1110111011101110 // dashed 3:1 + << 0b1111110011111100 // dashed 6:2 + << 0b0000111100001111 // dashed 4:4 + << 0b1010101010101010 // point 1:1 + << 0b1110010011100100 // dash point + << 0b1111111100111100; // dash long-dash + return styles; +} + +const QVector binaryPatternToDashPattern(int binaryPattern) +{ + QVector dashPattern; + int count = 0; + bool isDash = (binaryPattern & 0x8000) != 0; // Check the highest bit + + for (int i = 0; i < 16; ++i) { + bool currentBit = (binaryPattern & (0x8000 >> i)) != 0; + if (currentBit == isDash) { + ++count; // Counting dashes or spaces + } + else { + // Adjust count to be odd for dashes and even for spaces (see qt doc) + count = (count % 2 == (isDash ? 0 : 1)) ? count + 1 : count; + dashPattern << count; + count = 1; // Reset count for next dash/space + isDash = !isDash; + } + } + count = (count % 2 == (isDash ? 0 : 1)) ? count + 1 : count; + dashPattern << count; // Add the last count + + if ((dashPattern.size() % 2) == 1) { + // prevent this error : qWarning("QPen::setDashPattern: Pattern not of even length"); + dashPattern << 1; + } + + return dashPattern; +} + SketcherSettings::SketcherSettings(QWidget* parent) : PreferencePage(parent) , ui(new Ui_SketcherSettings) @@ -206,17 +249,17 @@ SketcherSettingsGrid::SketcherSettingsGrid(QWidget* parent) { ui->setupUi(this); - QList> styles; - styles << qMakePair(Qt::SolidLine, 0xffff) << qMakePair(Qt::DashLine, 0x0f0f) - << qMakePair(Qt::DotLine, 0xaaaa); + QList styles = getPenStyles(); ui->gridLinePattern->setIconSize(QSize(80, 12)); ui->gridDivLinePattern->setIconSize(QSize(80, 12)); - for (QList>::iterator it = styles.begin(); it != styles.end(); ++it) { + for (auto& style : styles) { QPixmap px(ui->gridLinePattern->iconSize()); px.fill(Qt::transparent); QBrush brush(Qt::black); - QPen pen(it->first); + + QPen pen; + pen.setDashPattern(binaryPatternToDashPattern(style)); pen.setBrush(brush); pen.setWidth(2); @@ -226,8 +269,8 @@ SketcherSettingsGrid::SketcherSettingsGrid(QWidget* parent) painter.drawLine(0, mid, ui->gridLinePattern->iconSize().width(), mid); painter.end(); - ui->gridLinePattern->addItem(QIcon(px), QString(), QVariant(it->second)); - ui->gridDivLinePattern->addItem(QIcon(px), QString(), QVariant(it->second)); + ui->gridLinePattern->addItem(QIcon(px), QString(), QVariant(style)); + ui->gridDivLinePattern->addItem(QIcon(px), QString(), QVariant(style)); } } @@ -273,13 +316,13 @@ void SketcherSettingsGrid::loadSettings() ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath( "User parameter:BaseApp/Preferences/Mod/Sketcher/General"); - int pattern = hGrp->GetInt("GridLinePattern", 0x0f0f); + int pattern = hGrp->GetInt("GridLinePattern", 0b0000111100001111); int index = ui->gridLinePattern->findData(QVariant(pattern)); if (index < 0) { index = 1; } ui->gridLinePattern->setCurrentIndex(index); - pattern = hGrp->GetInt("GridDivLinePattern", 0xffff); + pattern = hGrp->GetInt("GridDivLinePattern", 0b1111111111111111); index = ui->gridDivLinePattern->findData(QVariant(pattern)); if (index < 0) { index = 0; @@ -412,24 +455,51 @@ void SketcherSettingsDisplay::onBtnTVApplyClicked(bool) } -/* TRANSLATOR SketcherGui::SketcherSettingsColors */ +/* TRANSLATOR SketcherGui::SketcherSettingsAppearance */ -SketcherSettingsColors::SketcherSettingsColors(QWidget* parent) +SketcherSettingsAppearance::SketcherSettingsAppearance(QWidget* parent) : PreferencePage(parent) - , ui(new Ui_SketcherSettingsColors) + , ui(new Ui_SketcherSettingsAppearance) { ui->setupUi(this); + + QList styles = getPenStyles(); + + ui->EdgePattern->setIconSize(QSize(70, 12)); + ui->ConstructionPattern->setIconSize(QSize(70, 12)); + ui->InternalPattern->setIconSize(QSize(70, 12)); + ui->ExternalPattern->setIconSize(QSize(70, 12)); + for (auto& style : styles) { + QPixmap px(ui->EdgePattern->iconSize()); + px.fill(Qt::transparent); + QBrush brush(Qt::black); + QPen pen; + pen.setDashPattern(binaryPatternToDashPattern(style)); + pen.setBrush(brush); + pen.setWidth(2); + + QPainter painter(&px); + painter.setPen(pen); + double mid = ui->EdgePattern->iconSize().height() / 2.0; + painter.drawLine(0, mid, ui->EdgePattern->iconSize().width(), mid); + painter.end(); + + ui->EdgePattern->addItem(QIcon(px), QString(), QVariant(style)); + ui->ConstructionPattern->addItem(QIcon(px), QString(), QVariant(style)); + ui->InternalPattern->addItem(QIcon(px), QString(), QVariant(style)); + ui->ExternalPattern->addItem(QIcon(px), QString(), QVariant(style)); + } } /** * Destroys the object and frees any allocated resources */ -SketcherSettingsColors::~SketcherSettingsColors() +SketcherSettingsAppearance::~SketcherSettingsAppearance() { // no need to delete child widgets, Qt does it all for us } -void SketcherSettingsColors::saveSettings() +void SketcherSettingsAppearance::saveSettings() { // Sketcher ui->SketchEdgeColor->onSave(); @@ -455,9 +525,32 @@ void SketcherSettingsColors::saveSettings() ui->CursorTextColor->onSave(); ui->CursorCrosshairColor->onSave(); ui->CreateLineColor->onSave(); + + ui->EdgeWidth->onSave(); + ui->ConstructionWidth->onSave(); + ui->InternalWidth->onSave(); + ui->ExternalWidth->onSave(); + + ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath( + "User parameter:BaseApp/Preferences/Mod/Sketcher/View"); + QVariant data = ui->EdgePattern->itemData(ui->EdgePattern->currentIndex()); + int pattern = data.toInt(); + hGrp->SetInt("EdgePattern", pattern); + + data = ui->ConstructionPattern->itemData(ui->ConstructionPattern->currentIndex()); + pattern = data.toInt(); + hGrp->SetInt("ConstructionPattern", pattern); + + data = ui->InternalPattern->itemData(ui->InternalPattern->currentIndex()); + pattern = data.toInt(); + hGrp->SetInt("InternalPattern", pattern); + + data = ui->ExternalPattern->itemData(ui->ExternalPattern->currentIndex()); + pattern = data.toInt(); + hGrp->SetInt("ExternalPattern", pattern); } -void SketcherSettingsColors::loadSettings() +void SketcherSettingsAppearance::loadSettings() { // Sketcher ui->SketchEdgeColor->onRestore(); @@ -483,12 +576,47 @@ void SketcherSettingsColors::loadSettings() ui->CursorTextColor->onRestore(); ui->CursorCrosshairColor->onRestore(); ui->CreateLineColor->onRestore(); + + ui->EdgeWidth->onRestore(); + ui->ConstructionWidth->onRestore(); + ui->InternalWidth->onRestore(); + ui->ExternalWidth->onRestore(); + + ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath( + "User parameter:BaseApp/Preferences/Mod/Sketcher/View"); + int pattern = hGrp->GetInt("EdgePattern", 0b1111111111111111); + int index = ui->EdgePattern->findData(QVariant(pattern)); + if (index < 0) { + index = 0; + } + ui->EdgePattern->setCurrentIndex(index); + + pattern = hGrp->GetInt("ConstructionPattern", 0b1111110011111100); + index = ui->ConstructionPattern->findData(QVariant(pattern)); + if (index < 0) { + index = 0; + } + ui->ConstructionPattern->setCurrentIndex(index); + + pattern = hGrp->GetInt("InternalPattern", 0b1111110011111100); + index = ui->InternalPattern->findData(QVariant(pattern)); + if (index < 0) { + index = 0; + } + ui->InternalPattern->setCurrentIndex(index); + + pattern = hGrp->GetInt("ExternalPattern", 0b1110010011100100); + index = ui->ExternalPattern->findData(QVariant(pattern)); + if (index < 0) { + index = 0; + } + ui->ExternalPattern->setCurrentIndex(index); } /** * Sets the strings of the subwidgets using the current language. */ -void SketcherSettingsColors::changeEvent(QEvent* e) +void SketcherSettingsAppearance::changeEvent(QEvent* e) { if (e->type() == QEvent::LanguageChange) { ui->retranslateUi(this); diff --git a/src/Mod/Sketcher/Gui/SketcherSettings.h b/src/Mod/Sketcher/Gui/SketcherSettings.h index 1d3f52effc..ddc8261635 100644 --- a/src/Mod/Sketcher/Gui/SketcherSettings.h +++ b/src/Mod/Sketcher/Gui/SketcherSettings.h @@ -32,7 +32,7 @@ namespace SketcherGui class Ui_SketcherSettings; class Ui_SketcherSettingsGrid; class Ui_SketcherSettingsDisplay; -class Ui_SketcherSettingsColors; +class Ui_SketcherSettingsAppearance; class SketcherGeneralWidget; /** * The SketcherSettings class implements a preference page to change sketcher settings. @@ -107,13 +107,13 @@ private: * The SketcherSettings class implements a preference page to change sketcher settings. * @author Werner Mayer */ -class SketcherSettingsColors: public Gui::Dialog::PreferencePage +class SketcherSettingsAppearance: public Gui::Dialog::PreferencePage { Q_OBJECT public: - explicit SketcherSettingsColors(QWidget* parent = nullptr); - ~SketcherSettingsColors() override; + explicit SketcherSettingsAppearance(QWidget* parent = nullptr); + ~SketcherSettingsAppearance() override; void saveSettings() override; void loadSettings() override; @@ -122,7 +122,7 @@ protected: void changeEvent(QEvent* e) override; private: - std::unique_ptr ui; + std::unique_ptr ui; }; } // namespace SketcherGui diff --git a/src/Mod/Sketcher/Gui/SketcherSettingsAppearance.ui b/src/Mod/Sketcher/Gui/SketcherSettingsAppearance.ui new file mode 100644 index 0000000000..fa9cf59e7b --- /dev/null +++ b/src/Mod/Sketcher/Gui/SketcherSettingsAppearance.ui @@ -0,0 +1,967 @@ + + + SketcherGui::SketcherSettingsAppearance + + + + 0 + 0 + 689 + 863 + + + + Appearance + + + + + + Working colors + + + + + + + + + 200 + 0 + + + + Creating line + + + + + + + Color used while new sketch elements are created + + + + 204 + 204 + 204 + + + + CreateLineColor + + + View + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 200 + 0 + + + + Coordinate text + + + + + + + Text color of the coordinates + + + + 0 + 0 + 255 + + + + CursorTextColor + + + View + + + + + + + Cursor crosshair + + + + + + + Color of crosshair cursor. +(The one you get when creating a new sketch element.) + + + + 255 + 255 + 255 + + + + CursorCrosshairColor + + + View + + + + + + + + + + + + Geometric element colors + + + + + + + 95 + 0 + + + + Constrained + + + + + + + + 95 + 0 + + + + Unconstrained + + + + + + + Pattern + + + + + + + Width + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Vertex + + + + + + + + 0 + 0 + + + + Color of fully constrained vertex color in edit mode + + + + 255 + 149 + 128 + + + + FullyConstraintConstructionPointColor + + + View + + + + + + + + 0 + 0 + + + + Color of vertices being edited + + + + 255 + 38 + 0 + + + + EditedVertexColor + + + View + + + + + + + Edge + + + + + + + + 0 + 0 + + + + Color of fully constrained edge color in edit mode + + + + 128 + 208 + 160 + + + + FullyConstraintElementColor + + + View + + + + + + + + 0 + 0 + + + + Color of edges being edited + + + + 255 + 255 + 255 + + + + EditedEdgeColor + + + View + + + + + + + Line pattern of normal edges. + + + -1 + + + + + + + Width of normal edges. + + + mm + + + 1 + + + 99 + + + 2 + + + EdgeWidth + + + Mod/Sketcher/View + + + + + + + Construction geometry + + + + + + + + 0 + 0 + + + + Color of fully constrained construction edge color in edit mode + + + + 143 + 169 + 253 + + + + FullyConstraintConstructionElementColor + + + View + + + + + + + + 0 + 0 + + + + Color of construction geometry in edit mode + + + + 0 + 0 + 220 + + + + ConstructionColor + + + View + + + + + + + Line pattern of construction edges. + + + -1 + + + + + + + Width of construction edges. + + + mm + + + 1 + + + 99 + + + 1 + + + ConstructionWidth + + + Mod/Sketcher/View + + + + + + + Internal alignment edge + + + + + + + + 0 + 0 + + + + Color of fully constrained internal alignment edge color in edit mode + + + + 222 + 222 + 200 + + + + FullyConstraintInternalAlignmentColor + + + View + + + + + + + + 0 + 0 + + + + Color of edges of internal alignment geometry + + + + 178 + 178 + 127 + + + + InternalAlignedGeoColor + + + View + + + + + + + Line pattern of internal aligned edges. + + + -1 + + + + + + + Width of internal aligned edges. + + + mm + + + 1 + + + 99 + + + 1 + + + InternalWidth + + + Mod/Sketcher/View + + + + + + + External geometry + + + + + + + + 0 + 0 + + + + Color of external geometry in edit mode + + + + 204 + 51 + 115 + + + + ExternalColor + + + View + + + + + + + Line pattern of external edges. + + + -1 + + + + + + + Width of external edges. + + + mm + + + 1 + + + 99 + + + 1 + + + ExternalWidth + + + Mod/Sketcher/View + + + + + + + + 200 + 0 + + + + Fully constrained Sketch + + + + + + + + 0 + 0 + + + + Color of fully constrained geometry in edit mode + + + + 0 + 255 + 0 + + + + FullyConstrainedColor + + + View + + + + + + + Invalid Sketch + + + + + + + + 0 + 0 + + + + Color of geometry indicating an invalid sketch + + + + 255 + 109 + 0 + + + + InvalidSketchColor + + + View + + + + + + + + + + Constraint colors + + + + + + + + + 200 + 0 + + + + Constraint symbols + + + + + + + Color of driving constraints in edit mode + + + + 255 + 38 + 0 + + + + ConstrainedIcoColor + + + View + + + + + + + Dimensional constraint + + + + + + + Color of dimensional driving constraints + + + + 255 + 38 + 0 + + + + ConstrainedDimColor + + + View + + + + + + + Reference constraint + + + + + + + Color of reference constraints in edit mode + + + + 0 + 38 + 255 + + + + NonDrivingConstrDimColor + + + View + + + + + + + Expression dependent constraint + + + + + + + Color of expression dependent constraints in edit mode + + + + 255 + 127 + 38 + + + + ExprBasedConstrDimColor + + + View + + + + + + + Deactivated constraint + + + + + + + Color of deactivated constraints in edit mode + + + + 127 + 127 + 127 + + + + DeactivatedConstrDimColor + + + View + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + Colors outside Sketcher + + + + + + + + + 200 + 0 + + + + Edge + + + + + + + Color of edges + + + + 255 + 255 + 255 + + + + SketchEdgeColor + + + View + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Vertex + + + + + + + Color of vertices + + + + 255 + 255 + 255 + + + + SketchVertexColor + + + View + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Gui::PrefSpinBox + QSpinBox +
Gui/PrefWidgets.h
+
+ + Gui::ColorButton + QPushButton +
Gui/Widgets.h
+
+ + Gui::PrefColorButton + Gui::ColorButton +
Gui/PrefWidgets.h
+
+
+ + +
diff --git a/src/Mod/Sketcher/Gui/SketcherSettingsColors.ui b/src/Mod/Sketcher/Gui/SketcherSettingsColors.ui deleted file mode 100644 index ddf7005ffc..0000000000 --- a/src/Mod/Sketcher/Gui/SketcherSettingsColors.ui +++ /dev/null @@ -1,835 +0,0 @@ - - - SketcherGui::SketcherSettingsColors - - - - 0 - 0 - 689 - 863 - - - - Colors - - - - - - Working colors - - - - - - - - - 240 - 0 - - - - Creating line - - - - - - - Color used while new sketch elements are created - - - - 204 - 204 - 204 - - - - CreateLineColor - - - View - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 240 - 0 - - - - Coordinate text - - - - - - - Text color of the coordinates - - - - 0 - 0 - 255 - - - - CursorTextColor - - - View - - - - - - - Cursor crosshair - - - - - - - Color of crosshair cursor. -(The one you get when creating a new sketch element.) - - - - 255 - 255 - 255 - - - - CursorCrosshairColor - - - View - - - - - - - - - - - - Geometric element colors - - - - - - - - - 120 - 0 - - - - Constrained - - - - - - - - 120 - 0 - - - - Unconstrained - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Edge - - - - - - - - 0 - 0 - - - - Color of fully constrained edge color in edit mode - - - - 128 - 208 - 160 - - - - FullyConstraintElementColor - - - View - - - - - - - - 0 - 0 - - - - Color of edges being edited - - - - 255 - 255 - 255 - - - - EditedEdgeColor - - - View - - - - - - - Vertex - - - - - - - - 0 - 0 - - - - Color of fully constrained vertex color in edit mode - - - - 255 - 149 - 128 - - - - FullyConstraintConstructionPointColor - - - View - - - - - - - - 0 - 0 - - - - Color of vertices being edited - - - - 255 - 38 - 0 - - - - EditedVertexColor - - - View - - - - - - - Construction geometry - - - - - - - - 0 - 0 - - - - Color of fully constrained construction edge color in edit mode - - - - 143 - 169 - 253 - - - - FullyConstraintConstructionElementColor - - - View - - - - - - - - 0 - 0 - - - - Color of construction geometry in edit mode - - - - 0 - 0 - 220 - - - - ConstructionColor - - - View - - - - - - - - 240 - 0 - - - - Internal alignment edge - - - - - - - - 0 - 0 - - - - Color of fully constrained internal alignment edge color in edit mode - - - - 222 - 222 - 200 - - - - FullyConstraintInternalAlignmentColor - - - View - - - - - - - - 0 - 0 - - - - Color of edges of internal alignment geometry - - - - 178 - 178 - 127 - - - - InternalAlignedGeoColor - - - View - - - - - - - External geometry - - - - - - - - 0 - 0 - - - - Color of external geometry in edit mode - - - - 204 - 51 - 115 - - - - ExternalColor - - - View - - - - - - - - - - - - 240 - 0 - - - - Fully constrained Sketch - - - - - - - - 0 - 0 - - - - Color of fully constrained geometry in edit mode - - - - 0 - 255 - 0 - - - - FullyConstrainedColor - - - View - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Invalid Sketch - - - - - - - - 0 - 0 - - - - Color of geometry indicating an invalid sketch - - - - 255 - 109 - 0 - - - - InvalidSketchColor - - - View - - - - - - - - - - - - Constraint colors - - - - - - - - - 240 - 0 - - - - Constraint symbols - - - - - - - Color of driving constraints in edit mode - - - - 255 - 38 - 0 - - - - ConstrainedIcoColor - - - View - - - - - - - Dimensional constraint - - - - - - - Color of dimensional driving constraints - - - - 255 - 38 - 0 - - - - ConstrainedDimColor - - - View - - - - - - - Reference constraint - - - - - - - Color of reference constraints in edit mode - - - - 0 - 38 - 255 - - - - NonDrivingConstrDimColor - - - View - - - - - - - Expression dependent constraint - - - - - - - Color of expression dependent constraints in edit mode - - - - 255 - 127 - 38 - - - - ExprBasedConstrDimColor - - - View - - - - - - - Deactivated constraint - - - - - - - Color of deactivated constraints in edit mode - - - - 127 - 127 - 127 - - - - DeactivatedConstrDimColor - - - View - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - Colors outside Sketcher - - - - - - - - - 240 - 0 - - - - Edge - - - - - - - Color of edges - - - - 255 - 255 - 255 - - - - SketchEdgeColor - - - View - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Vertex - - - - - - - Color of vertices - - - - 255 - 255 - 255 - - - - SketchVertexColor - - - View - - - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - Gui::ColorButton - QPushButton -
Gui/Widgets.h
-
- - Gui::PrefColorButton - Gui::ColorButton -
Gui/PrefWidgets.h
-
-
- - -