theMenu->addAction(anAction);
}
}
- bool isConstruction;
- if (mySketchMgr->canChangeConstruction(isConstruction)) {
- QAction* anAction = action("CONSTRUCTION_CMD");
+ bool isAuxiliary;
+ if (mySketchMgr->canSetAuxiliary(isAuxiliary)) {
+ QAction* anAction = action("AUXILIARY_CMD");
theMenu->addAction(anAction);
- anAction->setChecked(isConstruction);
+ anAction->setChecked(isAuxiliary);
}
}
{
QAction* anAction;
- anAction = new QAction(tr("Construction"), this);
+ anAction = new QAction(tr("Auxiliary"), this);
anAction->setCheckable(true);
- addAction("CONSTRUCTION_CMD", anAction);
+ addAction("AUXILIARY_CMD", anAction);
}
QAction* PartSet_Module::action(const QString& theId) const
QAction* aAction = static_cast<QAction*>(sender());
QString anId = aAction->data().toString();
- if (anId == "CONSTRUCTION_CMD") {
- mySketchMgr->setConstruction(isChecked);
+ if (anId == "AUXILIARY_CMD") {
+ mySketchMgr->setAuxiliary(isChecked);
}
}
return aCanDisplay;
}
-bool PartSet_SketcherMgr::canChangeConstruction(bool& isConstruction) const
+bool PartSet_SketcherMgr::canSetAuxiliary(bool& theValue) const
{
bool anEnabled = false;
ModuleBase_Operation* anOperation = getCurrentOperation();
return anEnabled;
QObjectPtrList anObjects;
- // 1. change construction type of a created feature
+ // 1. change auxiliary type of a created feature
if (PartSet_SketcherMgr::isNestedCreateOperation(anOperation) &&
PartSet_SketcherMgr::isEntityOperation(anOperation) ) {
anObjects.append(anOperation->feature());
else {
if (PartSet_SketcherMgr::isNestedSketchOperation(anOperation))
anOperation->abort();
- // 2. change construction type of selected sketch entities
+ // 2. change auxiliary type of selected sketch entities
ModuleBase_ISelection* aSelection = myModule->workshop()->selection();
anObjects = aSelection->selectedPresentations();
}
anEnabled = anObjects.size() > 0;
- bool isNotConstructedFound = false;
+ bool isNotAuxiliaryFound = false;
if (anObjects.size() > 0) {
QObjectPtrList::const_iterator anIt = anObjects.begin(), aLast = anObjects.end();
- for (; anIt != aLast && !isNotConstructedFound; anIt++) {
+ for (; anIt != aLast && !isNotAuxiliaryFound; anIt++) {
FeaturePtr aFeature = ModelAPI_Feature::feature(*anIt);
if (aFeature.get() != NULL) {
std::shared_ptr<SketchPlugin_Feature> aSketchFeature =
std::dynamic_pointer_cast<SketchPlugin_Feature>(aFeature);
if (aSketchFeature.get() != NULL) {
- std::string anAttribute = SketchPlugin_SketchEntity::CONSTRUCTION_ID();
+ std::string anAttribute = SketchPlugin_SketchEntity::AUXILIARY_ID();
- std::shared_ptr<ModelAPI_AttributeBoolean> aConstructionAttr =
+ std::shared_ptr<ModelAPI_AttributeBoolean> anAuxiliaryAttr =
std::dynamic_pointer_cast<ModelAPI_AttributeBoolean>(aSketchFeature->data()->attribute(anAttribute));
- isNotConstructedFound = !aConstructionAttr->value();
+ isNotAuxiliaryFound = !anAuxiliaryAttr->value();
}
}
}
}
- isConstruction = anObjects.size() && !isNotConstructedFound;
+ theValue = anObjects.size() && !isNotAuxiliaryFound;
return anEnabled;
}
-void PartSet_SketcherMgr::setConstruction(const bool isChecked)
+void PartSet_SketcherMgr::setAuxiliary(const bool isChecked)
{
ModuleBase_Operation* anOperation = getCurrentOperation();
QObjectPtrList anObjects;
bool isUseTransaction = false;
- // 1. change construction type of a created feature
+ // 1. change auxiliary type of a created feature
if (PartSet_SketcherMgr::isNestedCreateOperation(anOperation) &&
PartSet_SketcherMgr::isEntityOperation(anOperation) ) {
anObjects.append(anOperation->feature());
}
else {
isUseTransaction = true;
- // 2. change construction type of selected sketch entities
+ // 2. change auxiliary type of selected sketch entities
ModuleBase_ISelection* aSelection = myModule->workshop()->selection();
anObjects = aSelection->selectedPresentations();
}
- QAction* anAction = myModule->action("CONSTRUCTION_CMD");
+ QAction* anAction = myModule->action("AUXILIARY_CMD");
SessionPtr aMgr = ModelAPI_Session::get();
if (isUseTransaction) {
if (PartSet_SketcherMgr::isNestedSketchOperation(anOperation))
std::shared_ptr<SketchPlugin_Feature> aSketchFeature =
std::dynamic_pointer_cast<SketchPlugin_Feature>(aFeature);
if (aSketchFeature.get() != NULL) {
- std::string anAttribute = SketchPlugin_SketchEntity::CONSTRUCTION_ID();
+ std::string anAttribute = SketchPlugin_SketchEntity::AUXILIARY_ID();
- std::shared_ptr<ModelAPI_AttributeBoolean> aConstructionAttr =
+ std::shared_ptr<ModelAPI_AttributeBoolean> anAuxiliaryAttr =
std::dynamic_pointer_cast<ModelAPI_AttributeBoolean>(aSketchFeature->data()->attribute(anAttribute));
- aConstructionAttr->setValue(isChecked);
+ anAuxiliaryAttr->setValue(isChecked);
}
}
}
bool canDisplayObject() const;
/// Returns true if the current operation is sketch entity create operation
- /// \param isConstruction the current construction state
+ /// \param theValue the current auxiliary value
/// \return the boolean result
- bool canChangeConstruction(bool& isConstruction) const;
+ bool canSetAuxiliary(bool& theValue) const;
/// Changes the sketcher entity construction argument value
/// \param isChecked if true, the feature is a construction
- void setConstruction(const bool isChecked);
+ void setAuxiliary(const bool isChecked);
public slots:
/// Process sketch plane selected event
Config_PropManager::registerProp("Visualization", "sketch_external_color", "Sketch external entity color",
Config_Prop::Color, SKETCH_EXTERNAL_COLOR);
- Config_PropManager::registerProp("Visualization", "sketch_construction_color", "Sketch construction color",
- Config_Prop::Color, SKETCH_CONSTRUCTION_COLOR);
+ Config_PropManager::registerProp("Visualization", "sketch_auxiliary_color", "Sketch auxiliary entity color",
+ Config_Prop::Color, SKETCH_AUXILIARY_COLOR);
Config_PropManager::registerProp("Visualization", "sketch_constraint_color", "Sketch constraint color",
Config_Prop::Color, SKETCH_CONSTRAINT_COLOR);
continue;
}
// do not include the construction entities in the result
- if (aFeature->data()->attribute(SketchPlugin_SketchEntity::CONSTRUCTION_ID())) {
- if (aFeature->data()->boolean(SketchPlugin_SketchEntity::CONSTRUCTION_ID())->value())
+ if (aFeature->data()->attribute(SketchPlugin_SketchEntity::AUXILIARY_ID())) {
+ if (aFeature->data()->boolean(SketchPlugin_SketchEntity::AUXILIARY_ID())->value())
continue;
}
void SketchPlugin_SketchEntity::initAttributes()
{
- data()->addAttribute(CONSTRUCTION_ID(), ModelAPI_AttributeBoolean::type());
- ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), CONSTRUCTION_ID());
+ data()->addAttribute(AUXILIARY_ID(), ModelAPI_AttributeBoolean::type());
+ ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), AUXILIARY_ID());
}
#define SKETCH_ENTITY_COLOR "#ff0000"
#define SKETCH_EXTERNAL_COLOR "#00ff00"
-#define SKETCH_CONSTRUCTION_COLOR "#000000"
+#define SKETCH_AUXILIARY_COLOR "#000000"
/**\class SketchPlugin_SketchEntity
* \ingroup Plugins
{
public:
/// Reference to the construction type of the feature
- inline static const std::string& CONSTRUCTION_ID()
+ inline static const std::string& AUXILIARY_ID()
{
- static const std::string MY_CONSTRUCTION_ID("Construction");
- return MY_CONSTRUCTION_ID;
+ static const std::string MY_AUXILIARY_ID("Auxiliary");
+ return MY_AUXILIARY_ID;
}
/// Reference to the external edge or vertex as a AttributeSelection
// set color from preferences
std::vector<int> aColor;
- std::shared_ptr<ModelAPI_AttributeBoolean> aConstructionAttr =
- data()->boolean(SketchPlugin_SketchEntity::CONSTRUCTION_ID());
- bool isConstruction = aConstructionAttr.get() != NULL && aConstructionAttr->value();
+ std::shared_ptr<ModelAPI_AttributeBoolean> anAuxiliaryAttr =
+ data()->boolean(SketchPlugin_SketchEntity::AUXILIARY_ID());
+ bool isConstruction = anAuxiliaryAttr.get() != NULL && anAuxiliaryAttr->value();
if (isConstruction) {
- aColor = Config_PropManager::color("Visualization", "sketch_construction_color",
- SKETCH_CONSTRUCTION_COLOR);
+ aColor = Config_PropManager::color("Visualization", "sketch_auxiliary_color",
+ SKETCH_AUXILIARY_COLOR);
}
else if (isExternal()) {
aColor = Config_PropManager::color("Visualization", "sketch_external_color",
</feature>
<feature id="SketchPoint" title="Point" tooltip="Create a new point" icon=":icons/point.png">
<sketch-2dpoint_selector id="PointCoordindates" title="Point" tooltip="Point coordinates"/>
- <boolvalue id="Construction" label="Construction" default="false" tooltip="Construction element" obligatory="0"/>
+ <boolvalue id="Auxiliary" label="Auxiliary" default="false" tooltip="Construction element" obligatory="0"/>
</feature>
<feature id="SketchLine" title="Line" tooltip="Create a new line" icon=":icons/line.png">
<sketch-2dpoint_selector id="StartPoint" title="Start point" tooltip="Start point coordinates" previous_feature_param="EndPoint"/>
<sketch-2dpoint_selector id="EndPoint" title="End point" tooltip="End point coordinates"/>
- <boolvalue id="Construction" label="Construction" default="false" tooltip="Construction element" obligatory="0"/>
+ <boolvalue id="Auxiliary" label="Auxiliary" default="false" tooltip="Construction element" obligatory="0"/>
</feature>
<feature id="SketchCircle" title="Circle" tooltip="Create a new circle" icon=":icons/circle.png">
<sketch-2dpoint_selector id="CircleCenter" title="Center" tooltip="Center coordinates"/>
<point2ddistance id="CircleRadius" first_point="CircleCenter" label="Radius:" min="0" step="1.0" default="0" icon=":icons/radius.png" tooltip="Set radius">
<validator id="GeomValidators_Positive"/>
</point2ddistance>
- <boolvalue id="Construction" label="Construction" default="false" tooltip="Construction element" obligatory="0"/>
+ <boolvalue id="Auxiliary" label="Auxiliary" default="false" tooltip="Construction element" obligatory="0"/>
</feature>
<feature id="SketchArc" title="Arc" tooltip="Create a new arc" icon=":icons/arc.png">
<sketch-2dpoint_selector id="ArcCenter" title="Center" tooltip="Center of a circle"/>
<sketch-2dpoint_selector id="ArcStartPoint" title="Start point" tooltip="Start point"/>
<sketch-2dpoint_selector id="ArcEndPoint" title="End point" tooltip="End point"/>
- <boolvalue id="Construction" label="Construction" default="false" tooltip="Construction element" obligatory="0"/>
+ <boolvalue id="Auxiliary" label="Auxiliary" default="false" tooltip="Construction element" obligatory="0"/>
</feature>
</group>