#include <string>
#include <list>
+const static char* SKETCH_TAB_NAME = "Sketch";
+
/*!
* \class Config_Prop
* \brief Class which describes a one property
aBuf[1] = theColor[6];
aRes[2] = strtol(aBuf, &aP, 16);
} else {
- int aPos = theColor.find(",");
+ int aPos = (int)theColor.find(",");
char aBuf[10];
// Get Red
std::size_t length = theColor.copy(aBuf, aPos, 0);
aRes[0] = atoi(aBuf);
// Get Green
- int aNPos = theColor.find(",", aPos + 1);
+ int aNPos = (int)theColor.find(",", aPos + 1);
length = theColor.copy(aBuf, aNPos - aPos - 1, aPos + 1);
aBuf[length] = '\0';
aRes[1] = atoi(aBuf);
std::shared_ptr<GeomAPI_Pln> aPlane =
std::shared_ptr<GeomAPI_Pln>(new GeomAPI_Pln(aA, aB, aC, aD));
std::string kDefaultPlaneSize = "200";
- double aSize = Config_PropManager::integer("Sketch planes", "planes_size", kDefaultPlaneSize);
+ double aSize = Config_PropManager::integer(SKETCH_TAB_NAME, "planes_size", kDefaultPlaneSize);
aSize *= 4.;
aPlaneFace = GeomAlgoAPI_FaceBuilder::squareFace(aPlane, aSize);
}
{
bool anEnabled = true;
if (myIsValueEnabled == DefinedInPreferences) {
- bool aCanDisable = Config_PropManager::boolean("Sketch planes", "disable_input_fields", "true");
+ bool aCanDisable = Config_PropManager::boolean(SKETCH_TAB_NAME, "disable_input_fields", "true");
if (aCanDisable)
anEnabled = false;
}
PartSet_CustomPrs::OPERATION_HIGHLIGHT_COLOR());
- Config_PropManager::registerProp("Sketch planes", "disable_input_fields", "Disable input fields",
+ Config_PropManager::registerProp(SKETCH_TAB_NAME, "disable_input_fields", "Disable input fields",
Config_Prop::Boolean, "true");
}
void PartSet_Module::registerProperties()
{
- Config_PropManager::registerProp("Sketch planes", "planes_size", "Size", Config_Prop::Double,
+ Config_PropManager::registerProp(SKETCH_TAB_NAME, "planes_size", "Size", Config_Prop::Double,
PLANE_SIZE);
- Config_PropManager::registerProp("Sketch planes", "planes_thickness", "Thickness",
+ Config_PropManager::registerProp(SKETCH_TAB_NAME, "planes_thickness", "Thickness",
Config_Prop::Integer, SKETCH_WIDTH);
- Config_PropManager::registerProp("Sketch planes", "rotate_to_plane", "Rotate to plane when selected",
+ Config_PropManager::registerProp(SKETCH_TAB_NAME, "rotate_to_plane", "Rotate to plane when selected",
Config_Prop::Boolean, "false");
}
std::shared_ptr<GeomAPI_Dir> theNorm,
const int theRGB[3])
{
- double aSize = Config_PropManager::integer("Sketch planes", "planes_size", PLANE_SIZE);
+ double aSize = Config_PropManager::integer(SKETCH_TAB_NAME, "planes_size", PLANE_SIZE);
std::shared_ptr<GeomAPI_Shape> aFace = GeomAlgoAPI_FaceBuilder::squareFace(theOrigin, theNorm, aSize);
AISObjectPtr aAIS = AISObjectPtr(new GeomAPI_AISObject());
aAIS->createShape(aFace);
- aAIS->setWidth(Config_PropManager::integer("Sketch planes", "planes_thickness", SKETCH_WIDTH));
+ aAIS->setWidth(Config_PropManager::integer(SKETCH_TAB_NAME, "planes_thickness", SKETCH_WIDTH));
aAIS->setColor(theRGB[0], theRGB[1], theRGB[2]);
return aAIS;
}
// Rotate view if the sketcher plane is selected only from preview planes
// Preview planes are created only if there is no any shape
- bool aRotate = Config_PropManager::boolean("Sketch planes", "rotate_to_plane", "false");
+ bool aRotate = Config_PropManager::boolean(SKETCH_TAB_NAME, "rotate_to_plane", "false");
if (aRotate) {
myWorkshop->viewer()->setViewProjection(aXYZ.X(), aXYZ.Y(), aXYZ.Z(), aTwist);
PartSet_Module* aModule = dynamic_cast<PartSet_Module*>(myWorkshop->module());