[Sketcher] Make axis colors changeable
This commit is contained in:
@@ -24,6 +24,9 @@
|
||||
|
||||
#include "Mod/Sketcher/App/ExternalGeometryFacade.h"
|
||||
|
||||
#include <App/Color.h>
|
||||
#include <Gui/ViewParams.h>
|
||||
|
||||
#include "EditModeCoinManagerParameters.h"
|
||||
|
||||
|
||||
@@ -52,8 +55,17 @@ int GeometryLayerParameters::getSubLayerIndex(const int geoId,
|
||||
|
||||
SbColor DrawingParameters::InformationColor(0.0f, 1.0f, 0.0f); // #00FF00 -> ( 0,255, 0)
|
||||
SbColor DrawingParameters::CreateCurveColor(0.5f, 0.5f, 0.5f); // ##7f7f7f -> (127,127,127)
|
||||
SbColor DrawingParameters::CrossColorH(0.8f, 0.4f, 0.4f); // #CC6666 -> (204,102,102)
|
||||
SbColor DrawingParameters::CrossColorV(0.47f, 1.0f, 0.51f); // #83FF83 -> (120,255,131)
|
||||
|
||||
namespace { // Anonymous namespace to avoid making those variables global
|
||||
unsigned long HColorLong = Gui::ViewParams::instance()->getAxisXColor();
|
||||
App::Color Hcolor = App::Color(static_cast<uint32_t>(HColorLong));
|
||||
|
||||
unsigned long VColorLong = Gui::ViewParams::instance()->getAxisYColor();
|
||||
App::Color Vcolor = App::Color(static_cast<uint32_t>(VColorLong));
|
||||
}
|
||||
SbColor DrawingParameters::CrossColorH(Hcolor.r, Hcolor.g, Hcolor.b);
|
||||
SbColor DrawingParameters::CrossColorV(Vcolor.r, Vcolor.g, Vcolor.b);
|
||||
|
||||
SbColor DrawingParameters::InvalidSketchColor(1.0f, 0.42f, 0.0f); // #FF6D00 -> (255,109, 0)
|
||||
SbColor DrawingParameters::FullyConstrainedColor(0.0f, 1.0f, 0.0f); // #00FF00 -> ( 0,255, 0)
|
||||
SbColor
|
||||
|
||||
@@ -40,6 +40,8 @@
|
||||
#include <Inventor/nodes/SoText2.h>
|
||||
#include <Inventor/nodes/SoTranslation.h>
|
||||
|
||||
#include <App/Color.h>
|
||||
#include <Gui/ViewParams.h>
|
||||
#include <Gui/Inventor/SmSwitchboard.h>
|
||||
#include <Mod/Sketcher/App/GeoList.h>
|
||||
|
||||
@@ -101,7 +103,7 @@ struct DrawingParameters
|
||||
//@{
|
||||
static SbColor InformationColor; // Information Overlay Color
|
||||
static SbColor CreateCurveColor; // Color for Edit Curves during creation
|
||||
static SbColor CrossColorH; // Color for the Horizontal Axis
|
||||
static SbColor CrossColorH; // Color for the Horizontal Axis
|
||||
static SbColor CrossColorV; // Color for the Vertical Axis
|
||||
static SbColor InvalidSketchColor; // Color for rendering an invalid sketch
|
||||
static SbColor FullyConstrainedColor; // Color for a fully constrained sketch
|
||||
@@ -147,6 +149,19 @@ struct DrawingParameters
|
||||
unsigned int InternalPattern = 0b1111110011111100; // pattern of internal edges
|
||||
unsigned int ExternalPattern = 0b1111110011111100; // pattern of external edges
|
||||
//@}
|
||||
|
||||
DrawingParameters() {
|
||||
unsigned long colorLong;
|
||||
App::Color color;
|
||||
|
||||
colorLong = Gui::ViewParams::instance()->getAxisXColor();
|
||||
color = App::Color(static_cast<uint32_t>(colorLong));
|
||||
CrossColorH = SbColor(color.r, color.g, color.b);
|
||||
|
||||
colorLong = Gui::ViewParams::instance()->getAxisYColor();
|
||||
color = App::Color(static_cast<uint32_t>(colorLong));
|
||||
CrossColorV = SbColor(color.r, color.g, color.b);
|
||||
}
|
||||
};
|
||||
|
||||
/** @brief Struct for storing references to the scenegraph nodes necessary for geometry layers
|
||||
|
||||
Reference in New Issue
Block a user