Sketcher: Edges pattern and width by type.

This commit is contained in:
Paddle
2024-01-15 18:38:59 +01:00
committed by Chris Hennes
parent 90d3ede49a
commit b140feabaf
13 changed files with 1565 additions and 1102 deletions

View File

@@ -143,7 +143,7 @@ PyMOD_INIT_FUNC(SketcherGui)
QT_TRANSLATE_NOOP("QObject", "Sketcher"));
(void)new Gui::PrefPageProducer<SketcherGui::SketcherSettingsDisplay>(
QT_TRANSLATE_NOOP("QObject", "Sketcher"));
(void)new Gui::PrefPageProducer<SketcherGui::SketcherSettingsColors>(
(void)new Gui::PrefPageProducer<SketcherGui::SketcherSettingsAppearance>(
QT_TRANSLATE_NOOP("QObject", "Sketcher"));
// add resources and reloads the translators

View File

@@ -39,7 +39,7 @@ set(SketcherGui_UIC_SRCS
SketchMirrorDialog.ui
SketcherSettings.ui
SketcherSettingsGrid.ui
SketcherSettingsColors.ui
SketcherSettingsAppearance.ui
SketcherSettingsDisplay.ui
SketchRectangularArrayDialog.ui
SketcherRegularPolygonDialog.ui

View File

@@ -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<const SoLineDetail*>(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<const SoLineDetail*>(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(

View File

@@ -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();
//@}

View File

@@ -40,7 +40,6 @@
#include <Inventor/nodes/SoText2.h>
#include <Inventor/nodes/SoTranslation.h>
#include <Gui/Inventor/SmSwitchboard.h>
#include <Mod/Sketcher/App/GeoList.h>
@@ -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<SoMaterial*>& CurvesMaterials; // The materials for the curves
std::vector<SoCoordinate3*>& CurvesCoordinate; // The coordinates of the segments of the curves
std::vector<SoLineSet*>& CurveSet; // The set of curves
std::vector<std::vector<SoMaterial*>>& CurvesMaterials;
std::vector<std::vector<SoCoordinate3*>>& CurvesCoordinate;
std::vector<std::vector<SoLineSet*>>& 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<int>(isExternal ? SubLayer::External
: isInternal ? SubLayer::Internal
: isConstruction ? SubLayer::Construction
: SubLayer::Normal);
}
bool isNormalSubLayer(int t) const
{
return t == static_cast<int>(SubLayer::Normal);
}
bool isConstructionSubLayer(int t) const
{
return t == static_cast<int>(SubLayer::Construction);
}
bool isInternalSubLayer(int t) const
{
return t == static_cast<int>(SubLayer::Internal);
}
bool isExternalSubLayer(int t) const
{
return t == static_cast<int>(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<SoMaterial*> CurvesMaterials;
std::vector<SoCoordinate3*> CurvesCoordinate;
std::vector<SoDrawStyle*> CurvesDrawStyle;
std::vector<SoLineSet*> CurveSet;
std::vector<std::vector<SoMaterial*>> CurvesMaterials;
std::vector<std::vector<SoCoordinate3*>> CurvesCoordinate;
std::vector<std::vector<SoLineSet*>> 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<std::vector<int>> CurvIdToGeoId; // conversion of SoLineSet index to GeoId
std::vector<std::vector<std::vector<int>>>
CurvIdToGeoId; // conversion of SoLineSet index to GeoId
std::vector<std::vector<int>> 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

View File

@@ -1587,14 +1587,20 @@ void EditModeConstraintCoinManager::updateConstraintColor(
std::vector<int> PtNum;
std::vector<SbColor*> pcolor; // point color
std::vector<int> CurvNum;
std::vector<SbColor*> color; // curve color
std::vector<std::vector<int>> CurvNum;
std::vector<std::vector<SbColor*>> 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<int>(CurvNum.size()) && index >= 0
&& index < CurvNum[layer]) {
color[layer][index] = drawingParameters.SelectColor;
int sublayer = multifieldIndex.geoTypeId;
if (layer < static_cast<int>(CurvNum.size())
&& sublayer < static_cast<int>(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();
}
}
}

View File

@@ -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<int>(coinMapping.CurvIdToGeoId[coinLayer].size()),
coinLayer));
std::forward_as_tuple(
static_cast<int>(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<Part::GeomPoint,
EditModeGeometryCoinConverter::PointsMode::InsertSingle,
EditModeGeometryCoinConverter::CurveMode::NoCurve,
EditModeGeometryCoinConverter::AnalyseMode::BoundingBoxMagnitude>(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<Part::GeomLineSegment,
EditModeGeometryCoinConverter::PointsMode::InsertStartEnd,
EditModeGeometryCoinConverter::CurveMode::StartEndPointsOnly,
EditModeGeometryCoinConverter::AnalyseMode::BoundingBoxMagnitude>(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<Part::GeomConic,
EditModeGeometryCoinConverter::PointsMode::InsertMidOnly,
EditModeGeometryCoinConverter::CurveMode::ClosedCurve,
EditModeGeometryCoinConverter::AnalyseMode::BoundingBoxMagnitude>(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<Part::GeomArcOfConic,
EditModeGeometryCoinConverter::PointsMode::InsertStartEndMid,
EditModeGeometryCoinConverter::CurveMode::OpenCurve,
EditModeGeometryCoinConverter::AnalyseMode::BoundingBoxMagnitude>(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<Base::Vector3d>::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<unsigned int>::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<Base::Vector3d>::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<typename GeoType,
EditModeGeometryCoinConverter::CurveMode curvemode,
EditModeGeometryCoinConverter::AnalyseMode analysemode>
void EditModeGeometryCoinConverter::convert(const Sketcher::GeometryFacade* geometryfacade,
[[maybe_unused]] int geoid)
[[maybe_unused]] int geoid,
int subLayer)
{
auto geo = static_cast<const GeoType*>(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) {
//***************************************************************************************************************

View File

@@ -152,7 +152,9 @@ public:
private:
template<typename GeoType, PointsMode pointmode, CurveMode curvemode, AnalyseMode analysemode>
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<std::vector<Base::Vector3d>> Coords;
std::vector<std::vector<Base::Vector3d>> Points;
std::vector<std::vector<unsigned int>> Index;
std::vector<std::vector<std::vector<Base::Vector3d>>> Coords;
std::vector<std::vector<std::vector<unsigned int>>> Index;
// temporal counters, one per layer
std::vector<int> pointCounter;
std::vector<int> curveCounter;
// temporal global vertex counter
int vertexCounter = 0;

View File

@@ -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();
}
}
}

View File

@@ -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<int> getPenStyles()
{
QList<int> 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<qreal> binaryPatternToDashPattern(int binaryPattern)
{
QVector<qreal> 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<QPair<Qt::PenStyle, int>> styles;
styles << qMakePair(Qt::SolidLine, 0xffff) << qMakePair(Qt::DashLine, 0x0f0f)
<< qMakePair(Qt::DotLine, 0xaaaa);
QList<int> styles = getPenStyles();
ui->gridLinePattern->setIconSize(QSize(80, 12));
ui->gridDivLinePattern->setIconSize(QSize(80, 12));
for (QList<QPair<Qt::PenStyle, int>>::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<int> 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);

View File

@@ -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_SketcherSettingsColors> ui;
std::unique_ptr<Ui_SketcherSettingsAppearance> ui;
};
} // namespace SketcherGui

View File

@@ -0,0 +1,967 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>SketcherGui::SketcherSettingsAppearance</class>
<widget class="QWidget" name="SketcherGui::SketcherSettingsAppearance">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>689</width>
<height>863</height>
</rect>
</property>
<property name="windowTitle">
<string>Appearance</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Working colors</string>
</property>
<layout class="QGridLayout" name="gridLayout_7">
<item row="0" column="1">
<layout class="QGridLayout" name="gridLayout">
<item row="3" column="0">
<widget class="QLabel" name="label_6">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Creating line</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="Gui::PrefColorButton" name="CreateLineColor">
<property name="toolTip">
<string>Color used while new sketch elements are created</string>
</property>
<property name="color" stdset="0">
<color>
<red>204</red>
<green>204</green>
<blue>204</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>CreateLineColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="3" column="2">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_5">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Coordinate text</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="Gui::PrefColorButton" name="CursorTextColor">
<property name="toolTip">
<string>Text color of the coordinates</string>
</property>
<property name="color" stdset="0">
<color>
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>CursorTextColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_19">
<property name="text">
<string>Cursor crosshair</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="Gui::PrefColorButton" name="CursorCrosshairColor">
<property name="toolTip">
<string>Color of crosshair cursor.
(The one you get when creating a new sketch element.)</string>
</property>
<property name="color" stdset="0">
<color>
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>CursorCrosshairColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Geometric element colors</string>
</property>
<layout class="QGridLayout" name="gridLayout_6">
<item row="1" column="1">
<widget class="QLabel" name="label_7">
<property name="minimumSize">
<size>
<width>95</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Constrained</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLabel" name="label_9">
<property name="minimumSize">
<size>
<width>95</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Unconstrained</string>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QLabel" name="label_pattern">
<property name="text">
<string>Pattern</string>
</property>
</widget>
</item>
<item row="1" column="4">
<widget class="QLabel" name="label_width">
<property name="text">
<string>Width</string>
</property>
</widget>
</item>
<item row="1" column="5">
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Vertex</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="Gui::PrefColorButton" name="FullyConstraintConstructionPointColor">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Color of fully constrained vertex color in edit mode</string>
</property>
<property name="color" stdset="0">
<color>
<red>255</red>
<green>149</green>
<blue>128</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>FullyConstraintConstructionPointColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="Gui::PrefColorButton" name="EditedVertexColor">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Color of vertices being edited</string>
</property>
<property name="color" stdset="0">
<color>
<red>255</red>
<green>38</green>
<blue>0</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>EditedVertexColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Edge</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="Gui::PrefColorButton" name="FullyConstraintElementColor">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Color of fully constrained edge color in edit mode</string>
</property>
<property name="color" stdset="0">
<color>
<red>128</red>
<green>208</green>
<blue>160</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>FullyConstraintElementColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="Gui::PrefColorButton" name="EditedEdgeColor">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Color of edges being edited</string>
</property>
<property name="color" stdset="0">
<color>
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>EditedEdgeColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="5" column="3">
<widget class="QComboBox" name="EdgePattern">
<property name="toolTip">
<string>Line pattern of normal edges.</string>
</property>
<property name="currentIndex">
<number>-1</number>
</property>
</widget>
</item>
<item row="5" column="4">
<widget class="Gui::PrefSpinBox" name="EdgeWidth">
<property name="toolTip">
<string>Width of normal edges.</string>
</property>
<property name="unit" stdset="0">
<string notr="true">mm</string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>99</number>
</property>
<property name="value">
<number>2</number>
</property>
<property name="prefEntry" stdset="0">
<cstring>EdgeWidth</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Sketcher/View</cstring>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Construction geometry</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="Gui::PrefColorButton" name="FullyConstraintConstructionElementColor">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Color of fully constrained construction edge color in edit mode</string>
</property>
<property name="color" stdset="0">
<color>
<red>143</red>
<green>169</green>
<blue>253</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>FullyConstraintConstructionElementColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="7" column="2">
<widget class="Gui::PrefColorButton" name="ConstructionColor">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Color of construction geometry in edit mode</string>
</property>
<property name="color" stdset="0">
<color>
<red>0</red>
<green>0</green>
<blue>220</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>ConstructionColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="7" column="3">
<widget class="QComboBox" name="ConstructionPattern">
<property name="toolTip">
<string>Line pattern of construction edges.</string>
</property>
<property name="currentIndex">
<number>-1</number>
</property>
</widget>
</item>
<item row="7" column="4">
<widget class="Gui::PrefSpinBox" name="ConstructionWidth">
<property name="toolTip">
<string>Width of construction edges.</string>
</property>
<property name="unit" stdset="0">
<string notr="true">mm</string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>99</number>
</property>
<property name="value">
<number>1</number>
</property>
<property name="prefEntry" stdset="0">
<cstring>ConstructionWidth</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Sketcher/View</cstring>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_ia">
<property name="text">
<string>Internal alignment edge</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="Gui::PrefColorButton" name="FullyConstraintInternalAlignmentColor">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Color of fully constrained internal alignment edge color in edit mode</string>
</property>
<property name="color" stdset="0">
<color>
<red>222</red>
<green>222</green>
<blue>200</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>FullyConstraintInternalAlignmentColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="8" column="2">
<widget class="Gui::PrefColorButton" name="InternalAlignedGeoColor">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Color of edges of internal alignment geometry</string>
</property>
<property name="color" stdset="0">
<color>
<red>178</red>
<green>178</green>
<blue>127</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>InternalAlignedGeoColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="8" column="3">
<widget class="QComboBox" name="InternalPattern">
<property name="toolTip">
<string>Line pattern of internal aligned edges.</string>
</property>
<property name="currentIndex">
<number>-1</number>
</property>
</widget>
</item>
<item row="8" column="4">
<widget class="Gui::PrefSpinBox" name="InternalWidth">
<property name="toolTip">
<string>Width of internal aligned edges.</string>
</property>
<property name="unit" stdset="0">
<string notr="true">mm</string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>99</number>
</property>
<property name="value">
<number>1</number>
</property>
<property name="prefEntry" stdset="0">
<cstring>InternalWidth</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Sketcher/View</cstring>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="label_20">
<property name="text">
<string>External geometry</string>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="Gui::PrefColorButton" name="ExternalColor">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Color of external geometry in edit mode</string>
</property>
<property name="color" stdset="0">
<color>
<red>204</red>
<green>51</green>
<blue>115</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>ExternalColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="9" column="3">
<widget class="QComboBox" name="ExternalPattern">
<property name="toolTip">
<string>Line pattern of external edges.</string>
</property>
<property name="currentIndex">
<number>-1</number>
</property>
</widget>
</item>
<item row="9" column="4">
<widget class="Gui::PrefSpinBox" name="ExternalWidth">
<property name="toolTip">
<string>Width of external edges.</string>
</property>
<property name="unit" stdset="0">
<string notr="true">mm</string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>99</number>
</property>
<property name="value">
<number>1</number>
</property>
<property name="prefEntry" stdset="0">
<cstring>ExternalWidth</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Sketcher/View</cstring>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="label_45">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Fully constrained Sketch</string>
</property>
</widget>
</item>
<item row="10" column="1">
<widget class="Gui::PrefColorButton" name="FullyConstrainedColor">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Color of fully constrained geometry in edit mode</string>
</property>
<property name="color" stdset="0">
<color>
<red>0</red>
<green>255</green>
<blue>0</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>FullyConstrainedColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="11" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Invalid Sketch</string>
</property>
</widget>
</item>
<item row="11" column="1">
<widget class="Gui::PrefColorButton" name="InvalidSketchColor">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Color of geometry indicating an invalid sketch</string>
</property>
<property name="color" stdset="0">
<color>
<red>255</red>
<green>109</green>
<blue>0</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>InvalidSketchColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBoxSketcherColor">
<property name="title">
<string>Constraint colors</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<layout class="QGridLayout" name="gridLayout_2">
<item row="10" column="0">
<widget class="QLabel" name="label_14">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Constraint symbols</string>
</property>
</widget>
</item>
<item row="10" column="1">
<widget class="Gui::PrefColorButton" name="ConstrainedColor">
<property name="toolTip">
<string>Color of driving constraints in edit mode</string>
</property>
<property name="color" stdset="0">
<color>
<red>255</red>
<green>38</green>
<blue>0</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>ConstrainedIcoColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="11" column="0">
<widget class="QLabel" name="label_15">
<property name="text">
<string>Dimensional constraint</string>
</property>
</widget>
</item>
<item row="11" column="1">
<widget class="Gui::PrefColorButton" name="DatumColor">
<property name="toolTip">
<string>Color of dimensional driving constraints</string>
</property>
<property name="color" stdset="0">
<color>
<red>255</red>
<green>38</green>
<blue>0</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>ConstrainedDimColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="12" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Reference constraint</string>
</property>
</widget>
</item>
<item row="12" column="1">
<widget class="Gui::PrefColorButton" name="NonDrivingConstraintColor">
<property name="toolTip">
<string>Color of reference constraints in edit mode</string>
</property>
<property name="color" stdset="0">
<color>
<red>0</red>
<green>38</green>
<blue>255</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>NonDrivingConstrDimColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="13" column="0">
<widget class="QLabel" name="labelexpr">
<property name="text">
<string>Expression dependent constraint</string>
</property>
</widget>
</item>
<item row="13" column="1">
<widget class="Gui::PrefColorButton" name="ExprBasedConstrDimColor">
<property name="toolTip">
<string>Color of expression dependent constraints in edit mode</string>
</property>
<property name="color" stdset="0">
<color>
<red>255</red>
<green>127</green>
<blue>38</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>ExprBasedConstrDimColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="14" column="0">
<widget class="QLabel" name="labeldeact">
<property name="text">
<string>Deactivated constraint</string>
</property>
</widget>
</item>
<item row="14" column="1">
<widget class="Gui::PrefColorButton" name="DeactivatedConstrDimColor">
<property name="toolTip">
<string>Color of deactivated constraints in edit mode</string>
</property>
<property name="color" stdset="0">
<color>
<red>127</red>
<green>127</green>
<blue>127</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>DeactivatedConstrDimColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_3">
<property name="title">
<string>Colors outside Sketcher</string>
</property>
<layout class="QGridLayout" name="gridLayout_8">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_4">
<item row="2" column="0">
<widget class="QLabel" name="label_17">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Edge</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="Gui::PrefColorButton" name="SketchEdgeColor">
<property name="toolTip">
<string>Color of edges</string>
</property>
<property name="color" stdset="0">
<color>
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>SketchEdgeColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="2" column="2">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_18">
<property name="text">
<string>Vertex</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="Gui::PrefColorButton" name="SketchVertexColor">
<property name="toolTip">
<string>Color of vertices</string>
</property>
<property name="color" stdset="0">
<color>
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>SketchVertexColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>Gui::PrefSpinBox</class>
<extends>QSpinBox</extends>
<header>Gui/PrefWidgets.h</header>
</customwidget>
<customwidget>
<class>Gui::ColorButton</class>
<extends>QPushButton</extends>
<header>Gui/Widgets.h</header>
</customwidget>
<customwidget>
<class>Gui::PrefColorButton</class>
<extends>Gui::ColorButton</extends>
<header>Gui/PrefWidgets.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View File

@@ -1,835 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>SketcherGui::SketcherSettingsColors</class>
<widget class="QWidget" name="SketcherGui::SketcherSettingsColors">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>689</width>
<height>863</height>
</rect>
</property>
<property name="windowTitle">
<string>Colors</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Working colors</string>
</property>
<layout class="QGridLayout" name="gridLayout_7">
<item row="0" column="1">
<layout class="QGridLayout" name="gridLayout">
<item row="3" column="0">
<widget class="QLabel" name="label_6">
<property name="minimumSize">
<size>
<width>240</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Creating line</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="Gui::PrefColorButton" name="CreateLineColor">
<property name="toolTip">
<string>Color used while new sketch elements are created</string>
</property>
<property name="color" stdset="0">
<color>
<red>204</red>
<green>204</green>
<blue>204</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>CreateLineColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="3" column="2">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_5">
<property name="minimumSize">
<size>
<width>240</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Coordinate text</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="Gui::PrefColorButton" name="CursorTextColor">
<property name="toolTip">
<string>Text color of the coordinates</string>
</property>
<property name="color" stdset="0">
<color>
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>CursorTextColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_19">
<property name="text">
<string>Cursor crosshair</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="Gui::PrefColorButton" name="CursorCrosshairColor">
<property name="toolTip">
<string>Color of crosshair cursor.
(The one you get when creating a new sketch element.)</string>
</property>
<property name="color" stdset="0">
<color>
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>CursorCrosshairColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Geometric element colors</string>
</property>
<layout class="QGridLayout" name="gridLayout_6">
<item row="1" column="0">
<layout class="QGridLayout" name="gridLayout_3">
<item row="1" column="2">
<widget class="QLabel" name="label_7">
<property name="minimumSize">
<size>
<width>120</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Constrained</string>
</property>
</widget>
</item>
<item row="1" column="4">
<widget class="QLabel" name="label_9">
<property name="minimumSize">
<size>
<width>120</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Unconstrained</string>
</property>
</widget>
</item>
<item row="1" column="5">
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Edge</string>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="Gui::PrefColorButton" name="FullyConstraintElementColor">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Color of fully constrained edge color in edit mode</string>
</property>
<property name="color" stdset="0">
<color>
<red>128</red>
<green>208</green>
<blue>160</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>FullyConstraintElementColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="3" column="4">
<widget class="Gui::PrefColorButton" name="EditedEdgeColor">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Color of edges being edited</string>
</property>
<property name="color" stdset="0">
<color>
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>EditedEdgeColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Vertex</string>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="Gui::PrefColorButton" name="FullyConstraintConstructionPointColor">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Color of fully constrained vertex color in edit mode</string>
</property>
<property name="color" stdset="0">
<color>
<red>255</red>
<green>149</green>
<blue>128</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>FullyConstraintConstructionPointColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="5" column="4">
<widget class="Gui::PrefColorButton" name="EditedVertexColor">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Color of vertices being edited</string>
</property>
<property name="color" stdset="0">
<color>
<red>255</red>
<green>38</green>
<blue>0</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>EditedVertexColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Construction geometry</string>
</property>
</widget>
</item>
<item row="7" column="2">
<widget class="Gui::PrefColorButton" name="FullyConstraintConstructionElementColor">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Color of fully constrained construction edge color in edit mode</string>
</property>
<property name="color" stdset="0">
<color>
<red>143</red>
<green>169</green>
<blue>253</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>FullyConstraintConstructionElementColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="7" column="4">
<widget class="Gui::PrefColorButton" name="ConstructionColor">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Color of construction geometry in edit mode</string>
</property>
<property name="color" stdset="0">
<color>
<red>0</red>
<green>0</green>
<blue>220</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>ConstructionColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_ia">
<property name="minimumSize">
<size>
<width>240</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Internal alignment edge</string>
</property>
</widget>
</item>
<item row="8" column="2">
<widget class="Gui::PrefColorButton" name="FullyConstraintInternalAlignmentColor">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Color of fully constrained internal alignment edge color in edit mode</string>
</property>
<property name="color" stdset="0">
<color>
<red>222</red>
<green>222</green>
<blue>200</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>FullyConstraintInternalAlignmentColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="8" column="4">
<widget class="Gui::PrefColorButton" name="InternalAlignedGeoColor">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Color of edges of internal alignment geometry</string>
</property>
<property name="color" stdset="0">
<color>
<red>178</red>
<green>178</green>
<blue>127</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>InternalAlignedGeoColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="label_20">
<property name="text">
<string>External geometry</string>
</property>
</widget>
</item>
<item row="9" column="2">
<widget class="Gui::PrefColorButton" name="ExternalColor">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Color of external geometry in edit mode</string>
</property>
<property name="color" stdset="0">
<color>
<red>204</red>
<green>51</green>
<blue>115</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>ExternalColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
</layout>
</item>
<item row="2" column="0">
<layout class="QGridLayout" name="gridLayout_5">
<item row="1" column="0">
<widget class="QLabel" name="label_45">
<property name="minimumSize">
<size>
<width>240</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Fully constrained Sketch</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="Gui::PrefColorButton" name="FullyConstrainedColor">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Color of fully constrained geometry in edit mode</string>
</property>
<property name="color" stdset="0">
<color>
<red>0</red>
<green>255</green>
<blue>0</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>FullyConstrainedColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="1" column="2">
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Invalid Sketch</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="Gui::PrefColorButton" name="InvalidSketchColor">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Color of geometry indicating an invalid sketch</string>
</property>
<property name="color" stdset="0">
<color>
<red>255</red>
<green>109</green>
<blue>0</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>InvalidSketchColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBoxSketcherColor">
<property name="title">
<string>Constraint colors</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<layout class="QGridLayout" name="gridLayout_2">
<item row="10" column="0">
<widget class="QLabel" name="label_14">
<property name="minimumSize">
<size>
<width>240</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Constraint symbols</string>
</property>
</widget>
</item>
<item row="10" column="1">
<widget class="Gui::PrefColorButton" name="ConstrainedColor">
<property name="toolTip">
<string>Color of driving constraints in edit mode</string>
</property>
<property name="color" stdset="0">
<color>
<red>255</red>
<green>38</green>
<blue>0</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>ConstrainedIcoColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="11" column="0">
<widget class="QLabel" name="label_15">
<property name="text">
<string>Dimensional constraint</string>
</property>
</widget>
</item>
<item row="11" column="1">
<widget class="Gui::PrefColorButton" name="DatumColor">
<property name="toolTip">
<string>Color of dimensional driving constraints</string>
</property>
<property name="color" stdset="0">
<color>
<red>255</red>
<green>38</green>
<blue>0</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>ConstrainedDimColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="12" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Reference constraint</string>
</property>
</widget>
</item>
<item row="12" column="1">
<widget class="Gui::PrefColorButton" name="NonDrivingConstraintColor">
<property name="toolTip">
<string>Color of reference constraints in edit mode</string>
</property>
<property name="color" stdset="0">
<color>
<red>0</red>
<green>38</green>
<blue>255</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>NonDrivingConstrDimColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="13" column="0">
<widget class="QLabel" name="labelexpr">
<property name="text">
<string>Expression dependent constraint</string>
</property>
</widget>
</item>
<item row="13" column="1">
<widget class="Gui::PrefColorButton" name="ExprBasedConstrDimColor">
<property name="toolTip">
<string>Color of expression dependent constraints in edit mode</string>
</property>
<property name="color" stdset="0">
<color>
<red>255</red>
<green>127</green>
<blue>38</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>ExprBasedConstrDimColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="14" column="0">
<widget class="QLabel" name="labeldeact">
<property name="text">
<string>Deactivated constraint</string>
</property>
</widget>
</item>
<item row="14" column="1">
<widget class="Gui::PrefColorButton" name="DeactivatedConstrDimColor">
<property name="toolTip">
<string>Color of deactivated constraints in edit mode</string>
</property>
<property name="color" stdset="0">
<color>
<red>127</red>
<green>127</green>
<blue>127</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>DeactivatedConstrDimColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_3">
<property name="title">
<string>Colors outside Sketcher</string>
</property>
<layout class="QGridLayout" name="gridLayout_8">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_4">
<item row="2" column="0">
<widget class="QLabel" name="label_17">
<property name="minimumSize">
<size>
<width>240</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Edge</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="Gui::PrefColorButton" name="SketchEdgeColor">
<property name="toolTip">
<string>Color of edges</string>
</property>
<property name="color" stdset="0">
<color>
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>SketchEdgeColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="2" column="2">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_18">
<property name="text">
<string>Vertex</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="Gui::PrefColorButton" name="SketchVertexColor">
<property name="toolTip">
<string>Color of vertices</string>
</property>
<property name="color" stdset="0">
<color>
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>SketchVertexColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>Gui::ColorButton</class>
<extends>QPushButton</extends>
<header>Gui/Widgets.h</header>
</customwidget>
<customwidget>
<class>Gui::PrefColorButton</class>
<extends>Gui::ColorButton</extends>
<header>Gui/PrefWidgets.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>