Add edge thickness option for results and groups.
data()->addAttribute(BASE_REF_ID(), ModelAPI_AttributeReference::typeId());
data()->addAttribute(DEFLECTION_ID(), ModelAPI_AttributeDouble::typeId());
data()->addAttribute(TRANSPARENCY_ID(), ModelAPI_AttributeDouble::typeId());
+ data()->addAttribute(EDGE_THICKNESS_ID(), ModelAPI_AttributeInteger::typeId());
data()->addAttribute(ISO_LINES_ID(), ModelAPI_AttributeIntArray::typeId());
if (aDocRef->isInitialized() && // initialized immediately means already exist and will be loaded
#include <ModelAPI_Events.h>
#include <ModelAPI_Data.h>
#include <ModelAPI_Attribute.h>
+#include <ModelAPI_AttributeInteger.h>
#include <ModelAPI_AttributeIntArray.h>
#include <ModelAPI_AttributeDouble.h>
#include <ModelAPI_AttributeBoolean.h>
aData->addAttribute(ISO_LINES_ID(), ModelAPI_AttributeIntArray::typeId())->setIsArgument(false);
aData->addAttribute(SHOW_ISO_LINES_ID(), ModelAPI_AttributeBoolean::typeId())->setIsArgument(false);
aData->addAttribute(SHOW_EDGES_DIRECTION_ID(), ModelAPI_AttributeBoolean::typeId())->setIsArgument(false);
+ aData->addAttribute(EDGE_THICKNESS_ID(), ModelAPI_AttributeInteger::typeId());
// Add the "Bring To Front" attribute to the Result base class, as we may support it in the future
// for all type of results. Actually, only ResultGroups are supported.
aData->addAttribute(BRING_TO_FRONT_ID(), ModelAPI_AttributeBoolean::typeId())->setIsArgument(false);
return MY_SHOW_EDGES_DIRECTION_ID;
}
+ /// Reference to the edge thickness of the result.
+ /// The integer value is used. The value is in [1, 5] range
+ inline static const std::string& EDGE_THICKNESS_ID()
+ {
+ static const std::string MY_EDGE_THICKNESS_ID("Edge_Thickness");
+ return MY_EDGE_THICKNESS_ID;
+ }
+
/// Reference to the BringToFront flag of the result.
/// The bool value is used.
inline static const std::string& BRING_TO_FRONT_ID()
Config_PropManager::registerProp("Visualization", "shaper_default_transparency",
"Default transparency (%)", Config_Prop::IntSpin, "0", "0", "100");
+ Config_PropManager::registerProp("Visualization", "shaper_default_edge_thickness",
+ "Default edge thickness (pt)", Config_Prop::IntSpin, "3", "1", "5");
+
}
return MY_MANAGER;
}
#include <ModelAPI_AttributeDouble.h>
#include <ModelAPI_AttributeImage.h>
#include <ModelAPI_AttributeIntArray.h>
+#include <ModelAPI_AttributeInteger.h>
#include <ModelAPI_AttributeSelectionList.h>
#include <ModelAPI_CompositeFeature.h>
#include <ModelAPI_Document.h>
return false;
}
+//**************************************************************
+int getEdgeThickness(const std::shared_ptr<ModelAPI_Result>& theResult)
+{
+ int aThickness = -1;
+ if (theResult.get() != NULL &&
+ theResult->data()->attribute(ModelAPI_Result::EDGE_THICKNESS_ID()).get() != NULL) {
+ AttributeIntegerPtr aIntAttr = theResult->data()->integer(ModelAPI_Result::EDGE_THICKNESS_ID());
+ if (aIntAttr.get() && aIntAttr->isInitialized()) {
+ aThickness = aIntAttr->value();
+ }
+ }
+ return aThickness;
+}
+
+void setEdgeThickness(ResultPtr theResult, int theEdgeThickness)
+{
+ if (!theResult.get())
+ return;
+
+ AttributeIntegerPtr anAttribute = theResult->data()->integer(ModelAPI_Result::EDGE_THICKNESS_ID());
+ if (anAttribute.get() != NULL) {
+ anAttribute->setValue(theEdgeThickness);
+ }
+}
+
//******************************************************
void bringToFront(std::shared_ptr<ModelAPI_Result> theResult, bool theFlag)
{
MODELAPI_EXPORT bool isShowEdgesDirection(std::shared_ptr<ModelAPI_Result> theResult);
+/*! Returns current edge thickness in the given result
+* \param theResult a result object
+* \return an egde thickness value or -1 if it was not defined
+*/
+MODELAPI_EXPORT int getEdgeThickness(const std::shared_ptr<ModelAPI_Result>& theResult);
+
+/*! Set edge thickness for the given result
+* \param theResult a result object
+* \param theEdgeThickness edge thickness value
+*/
+MODELAPI_EXPORT void setEdgeThickness(std::shared_ptr<ModelAPI_Result> theResult,
+ int theEdgeThickness);
+
/*! Set flag to bring result in front of other results
* \param[in] theResult a result object
* \param[in] theFlag is a flag
*myDumpStorage << ".setTransparency(" << aTransparencyAttr->value() << ")\n";
}
}
+ // set result edge thickness
+ if (isEdgeThicknessDefined(*aResIt)) {
+ const auto aAttr =
+ (*aResIt)->data()->integer(ModelAPI_Result::EDGE_THICKNESS_ID());
+ if(aAttr.get() && aAttr->isInitialized()) {
+ *this << *aResIt;
+ *myDumpStorage << ".setEdgeThickness(" << aAttr->value() << ")\n";
+ }
+ }
}
myNames[aLastDumped.myEntity].myIsDumped = true;
return fabs(anAttribute->value()) < 1.e-12;
}
+bool ModelHighAPI_Dumper::isEdgeThicknessDefined(const ResultPtr& theResult) const
+{
+ const auto anAttribute = theResult->data()->integer(ModelAPI_Result::EDGE_THICKNESS_ID());
+ if(!anAttribute || !anAttribute->isInitialized()) {
+ return false;
+ }
+ return true;
+}
+
bool ModelHighAPI_Dumper::dumpCommentBeforeFeature(const FeaturePtr& theFeature) const
{
// currently, the comment should not be dumped only before the filters
if (!myNames[theEntity].myIsDumped) {
bool isUserDefinedName = !myNames[theEntity].myIsDefault;
// store results if they have user-defined names or colors
- std::list<ResultPtr> aResultsWithNameOrColor;
+ std::list<ResultPtr> aResultsWithNonDefaultAttr;
std::list<ResultPtr> allRes;
ModelAPI_Tools::allResults(theEntity, allRes);
for(std::list<ResultPtr>::iterator aRes = allRes.begin(); aRes != allRes.end(); aRes++) {
if(!myNames[*aRes].myIsDefault || !isDefaultColor(*aRes) ||
- !isDefaultDeflection(*aRes) || !isDefaultTransparency(*aRes))
- aResultsWithNameOrColor.push_back(*aRes);
+ !isDefaultDeflection(*aRes) || !isDefaultTransparency(*aRes) || isEdgeThicknessDefined(*aRes))
+ aResultsWithNonDefaultAttr.push_back(*aRes);
}
// store just dumped entity to stack
if (myEntitiesStack.empty() || myEntitiesStack.top().myEntity != theEntity)
myEntitiesStack.push(
- LastDumpedEntity(theEntity, isUserDefinedName, aResultsWithNameOrColor));
+ LastDumpedEntity(theEntity, isUserDefinedName, aResultsWithNonDefaultAttr));
}
// remove entity from the list of not dumped items
/// Check the result feature has default transparency
bool isDefaultTransparency(const ResultPtr& theResult) const;
+ /// Check the result feature has edge thickness attribute
+ bool isEdgeThicknessDefined(const ResultPtr& theResult) const;
+
/// Dump postponed entities
void dumpPostponed(bool theDumpFolders = false);
#include "ModelHighAPI_Selection.h"
#include <ModelAPI_AttributeDouble.h>
+#include <ModelAPI_AttributeInteger.h>
#include <ModelAPI_AttributeIntArray.h>
#include <ModelAPI_AttributeSelection.h>
#include <ModelAPI_AttributeSelectionList.h>
}
// LCOV_EXCL_STOP
+void ModelHighAPI_Selection::setEdgeThickness(int theValue) {
+ if (myVariantType != VT_ResultSubShapePair || !myResultSubShapePair.first.get())
+ return;
+
+ const auto attr =
+ myResultSubShapePair.first->data()->integer(ModelAPI_Result::EDGE_THICKNESS_ID());
+
+ attr->setValue(theValue);
+}
+
int ModelHighAPI_Selection::numberOfSubs() const
{
if (myVariantType != VT_ResultSubShapePair)
MODELHIGHAPI_EXPORT
void setTransparency(double theValue);
+ /// Change edge thickness of result
+ MODELHIGHAPI_EXPORT
+ void setEdgeThickness(int theValue);
+
/// Returns the number of sub-elements.
MODELHIGHAPI_EXPORT
int numberOfSubs() const;
return aDeflection;
}
-
double PartSet_Tools::getDefaultTransparency()
{
return Config_PropManager::integer("Visualization", "shaper_default_transparency") / 100.;
}
+int PartSet_Tools::getDefaultEdgeThickness()
+{
+ return Config_PropManager::integer("Visualization", "shaper_default_edge_thickness");
+}
+
QCursor PartSet_Tools::getOperationCursor()
{
int aId = Config_PropManager::integer(SKETCH_TAB_NAME, "operation_cursor");
*/
static double getDefaultTransparency();
+ /**
+ * Returns user-defined default edge thickness value
+ */
+ static int getDefaultEdgeThickness();
+
/**
* Returns cursor according to (SKETCH_TAB_NAME, "operation_cursor") property value
*/
<parameter name="scalar_bar_nb_intervals" value="20" />
<parameter name="scalar_bar_text_color" value="#000000" />
<parameter name="shaper_default_transparency" value="0"/>
+ <parameter name="shaper_default_edge_thickness" value="3"/>
<parameter name="group_names_display" value="true" />
<parameter name="group_names_font" value="Times-bold" />
<parameter name="group_names_size" value="12" />
XGUI_DataModel.h
XGUI_DeflectionDialog.h
XGUI_Displayer.h
+ XGUI_EdgeThicknessWidget.h
XGUI_ErrorDialog.h
XGUI_ErrorMgr.h
XGUI_FacesPanel.h
XGUI_DataModel.h
XGUI_DeflectionDialog.h
XGUI_Displayer.h
+ XGUI_EdgeThicknessWidget.h
XGUI_ErrorDialog.h
XGUI_ErrorMgr.h
XGUI_FacesPanel.h
XGUI_DataModel.cpp
XGUI_DeflectionDialog.cpp
XGUI_Displayer.cpp
+ XGUI_EdgeThicknessWidget.cpp
XGUI_ErrorDialog.cpp
XGUI_ErrorMgr.cpp
XGUI_FacesPanel.cpp
tr("Transparency..."), aDesktop);
addAction("TRANSPARENCY_CMD", anAction);
+ anAction = ModuleBase_Tools::createAction(QIcon(), tr("Edge Thickness..."), aDesktop);
+ addAction("EDGE_THICKNESS_CMD", anAction);
+
anAction = ModuleBase_Tools::createAction(QIcon(":pictures/eye_pencil.png"),
tr("Show"), aDesktop);
addAction("SHOW_CMD", anAction);
action("COLOR_CMD")->setEnabled(myWorkshop->canChangeProperty("COLOR_CMD"));
action("DEFLECTION_CMD")->setEnabled(myWorkshop->canChangeProperty("DEFLECTION_CMD"));
action("TRANSPARENCY_CMD")->setEnabled(myWorkshop->canChangeProperty("TRANSPARENCY_CMD"));
+ action("EDGE_THICKNESS_CMD")->setEnabled(myWorkshop->canChangeProperty("EDGE_THICKNESS_CMD"));
action("AUTOCOLOR_CMD")->setEnabled(myWorkshop->canChangeProperty("AUTOCOLOR_CMD"));
#ifdef _DEBUG
if (myWorkshop->canChangeProperty("TRANSPARENCY_CMD"))
action("TRANSPARENCY_CMD")->setEnabled(true);
+
+ if (myWorkshop->canChangeProperty("EDGE_THICKNESS_CMD"))
+ action("EDGE_THICKNESS_CMD")->setEnabled(true);
action("DELETE_CMD")->setEnabled(true);
}
aList.append(action("COLOR_CMD"));
aList.append(action("DEFLECTION_CMD"));
aList.append(action("TRANSPARENCY_CMD"));
+ aList.append(action("EDGE_THICKNESS_CMD"));
aList.append(action("SHOW_FEATURE_CMD"));
aList.append(mySeparator2);
aList.append(action("DELETE_CMD"));
aList.append(action("COLOR_CMD"));
aList.append(action("DEFLECTION_CMD"));
aList.append(action("TRANSPARENCY_CMD"));
+ aList.append(action("EDGE_THICKNESS_CMD"));
aList.append(action("SHOW_ISOLINES_CMD"));
aList.append(action("ISOLINES_CMD"));
aList.append(action("SHOW_FEATURE_CMD"));
aList.append(action("COLOR_CMD"));
aList.append(action("DEFLECTION_CMD"));
aList.append(action("TRANSPARENCY_CMD"));
+ aList.append(action("EDGE_THICKNESS_CMD"));
aList.append(action("SHOW_ISOLINES_CMD"));
aList.append(action("ISOLINES_CMD"));
aList.append(action("SHOW_FEATURE_CMD"));
aList.append(action("COLOR_CMD"));
aList.append(action("DEFLECTION_CMD"));
aList.append(action("TRANSPARENCY_CMD"));
+ aList.append(action("EDGE_THICKNESS_CMD"));
aList.append(mySeparator3);
aList.append(action("SET_VIEW_NORMAL_CMD"));
aList.append(action("SET_VIEW_INVERTEDNORMAL_CMD"));
aList.append(action("COLOR_CMD"));
aList.append(action("DEFLECTION_CMD"));
aList.append(action("TRANSPARENCY_CMD"));
+ aList.append(action("EDGE_THICKNESS_CMD"));
aList.append(action("SHOW_ISOLINES_CMD"));
aList.append(action("ISOLINES_CMD"));
aList.append(mySeparator3);
aList.append(action("COLOR_CMD"));
aList.append(action("DEFLECTION_CMD"));
aList.append(action("TRANSPARENCY_CMD"));
+ aList.append(action("EDGE_THICKNESS_CMD"));
aList.append(action("SHOW_ISOLINES_CMD"));
aList.append(action("ISOLINES_CMD"));
aList.append(mySeparator3);
anActions.append(action("COLOR_CMD"));
anActions.append(action("DEFLECTION_CMD"));
anActions.append(action("TRANSPARENCY_CMD"));
+ anActions.append(action("EDGE_THICKNESS_CMD"));
anActions.append(action("SHOW_ISOLINES_CMD"));
anActions.append(action("ISOLINES_CMD"));
anActions.append(action("CLEAN_HISTORY_CMD"));
anActions.append(action("COLOR_CMD"));
anActions.append(action("DEFLECTION_CMD"));
anActions.append(action("TRANSPARENCY_CMD"));
+ anActions.append(action("EDGE_THICKNESS_CMD"));
anActions.append(mySeparator1);
anActions.append(action("SHOW_ONLY_CMD"));
anActions.append(action("HIDE_CMD"));
// appear "behind" the Groups.
aContext->SetDisplayPriority(anAISIO, FRONT_DISPLAY_PRIORITY);
}
+
+ // Set edge thickness, if deserialization is done before Shaper is activated.
+ {
+ int aThickness = ModelAPI_Tools::getEdgeThickness(aResult);
+ if (aThickness == -1)
+ aThickness = Config_PropManager::integer("Visualization", "shaper_default_edge_thickness");
+
+ aContext->SetWidth(anAISIO, aThickness, theUpdateViewer);
+ }
#ifdef TINSPECTOR
if (getCallBack()) getCallBack()->Display(anAISIO);
#endif
if ((aTransparency >= 0) && (aTransparency != aAISObj->getTransparency()))
aAISObj->setTransparency(aTransparency);
+ // Set edge thickness
+ const int aEdgeThickness = ModelAPI_Tools::getEdgeThickness(aResult);
+ std::cout << "aEdgeThickness " << aEdgeThickness << "\t";
+ std::cout << "aAISObj->width() " << aAISObj->width() << std::endl;
+ if ((aEdgeThickness > 0) && (aEdgeThickness != aAISObj->width()))
+ aAISObj->setWidth(aEdgeThickness);
+
// Set Iso-Lines
Handle(ModuleBase_ResultPrs) aResPrs = Handle(ModuleBase_ResultPrs)::DownCast(aAISIO);
if (!aResPrs.IsNull())
--- /dev/null
+// Copyright (C) 2014-2023 CEA, EDF
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "XGUI_EdgeThicknessWidget.h"
+
+
+#include <QHBoxLayout>
+#include <SalomeApp_IntSpinBox.h>
+
+
+XGUI_EdgeThicknessWidget::XGUI_EdgeThicknessWidget(QWidget* theParent)
+ : QWidget(theParent)
+{
+ auto aLayout = new QHBoxLayout(this);
+ aLayout->setContentsMargins(0, 0, 0, 0);
+
+ mySpinBox = new SalomeApp_IntSpinBox();
+ mySpinBox->setRange(1, 5);
+ mySpinBox->setDefaultValue(1);
+ mySpinBox->setSingleStep(1);
+ mySpinBox->setObjectName("EdgeThicknessSpinBox");
+ mySpinBox->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
+ mySpinBox->setValue(1);
+ aLayout->addWidget(mySpinBox, 0, Qt::AlignCenter);
+
+ connect(mySpinBox, SIGNAL(valueChanged(int)), this, SLOT(thicknessValueChanged(int)));
+}
+
+void XGUI_EdgeThicknessWidget::setValue(int theValue)
+{
+ bool isSpinBoxBlocked = mySpinBox->blockSignals(true);
+ mySpinBox->setValue(theValue);
+ mySpinBox->blockSignals(isSpinBoxBlocked);
+}
+
+int XGUI_EdgeThicknessWidget::getValue() const
+{
+ return mySpinBox->value();
+}
\ No newline at end of file
--- /dev/null
+// Copyright (C) 2014-2023 CEA, EDF
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef XGUI_EdgeThicknessWidget_H
+#define XGUI_EdgeThicknessWidget_H
+
+#include "XGUI.h"
+#include <QWidget>
+
+class SalomeApp_IntSpinBox;
+
+/**
+* \ingroup GUI
+* A class of a widget to chose edge thickness. Range of values is Natural:[0; 5].
+*/
+class XGUI_EdgeThicknessWidget : public QWidget
+{
+ Q_OBJECT
+
+public:
+/// Constructor
+ /// \param theParent a parent widget for the dialog
+ /// \param theLabelText if not empty, the information label will be shown in the widget
+ XGUI_EXPORT XGUI_EdgeThicknessWidget(QWidget* theParent);
+ XGUI_EXPORT ~XGUI_EdgeThicknessWidget() = default;
+
+ /// Initializes the dialog with the given value.
+ /// \param theValue edge thickness value
+ void setValue(int theValue);
+
+ /// Returns the current edge thickness value.
+ /// \return value
+ int getValue() const;
+
+ signals:
+ void thicknessValueChanged();
+
+private:
+ SalomeApp_IntSpinBox* mySpinBox;
+};
+
+#endif // XGUI_EdgeThicknessWidget_H
\ No newline at end of file
#include "XGUI_ColorDialog.h"
#include "XGUI_DeflectionDialog.h"
#include "XGUI_TransparencyWidget.h"
+#include "XGUI_EdgeThicknessWidget.h"
#include "XGUI_ContextMenuMgr.h"
#include "XGUI_Displayer.h"
#include "XGUI_ErrorDialog.h"
changeDeflection(anObjects);
else if (theId == "TRANSPARENCY_CMD")
changeTransparency(anObjects);
+ else if (theId == "EDGE_THICKNESS_CMD")
+ changeEdgeThickness(anObjects);
else if (theId == "SHOW_CMD") {
showObjects(anObjects, true);
mySelector->updateSelectionBy(ModuleBase_ISelection::Browser);
{
if (theActionName == "COLOR_CMD" ||
theActionName == "DEFLECTION_CMD" ||
- theActionName == "TRANSPARENCY_CMD") {
+ theActionName == "TRANSPARENCY_CMD" ||
+ theActionName == "EDGE_THICKNESS_CMD") {
QObjectPtrList anObjects = mySelector->selection()->selectedObjects();
std::set<std::string> aTypes;
myViewerProxy->update();
}
+//**************************************************************
+
+/// Returns user-defined default edge thickness.
+int getDefaultEdgeThickness()
+{
+ return Config_PropManager::integer("Visualization", "shaper_default_edge_thickness");
+}
+
+//**************************************************************
+void setEdgeThickness(int theThickness, const QObjectPtrList& theObjects)
+{
+ foreach(ObjectPtr anObj, theObjects) {
+ ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(anObj);
+ if (aResult.get() != NULL) {
+ ResultBodyPtr aBodyResult = std::dynamic_pointer_cast<ModelAPI_ResultBody>(aResult);
+ if (aBodyResult.get() != NULL) { // change property for all sub-solids
+ std::list<ResultPtr> allRes;
+ ModelAPI_Tools::allSubs(aBodyResult, allRes);
+ std::list<ResultPtr>::iterator aRes;
+ for(aRes = allRes.begin(); aRes != allRes.end(); aRes++) {
+ ModelAPI_Tools::setEdgeThickness(*aRes, theThickness);
+ }
+ }
+ ModelAPI_Tools::setEdgeThickness(aResult, theThickness);
+ }
+ }
+}
+
+//**************************************************************
+void XGUI_Workshop::changeEdgeThickness(const QObjectPtrList& theObjects)
+{
+ AttributeIntegerPtr aDoubleAttr;
+ // 1. Get current value.
+ int aCurrentValue = -1;
+ foreach(ObjectPtr anObject, theObjects) {
+ ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(anObject);
+ if (aResult.get()) {
+ aCurrentValue = ModelAPI_Tools::getEdgeThickness(aResult);
+ if (aCurrentValue < 0)
+ aCurrentValue = getDefaultEdgeThickness();
+ }
+ if (aCurrentValue > 0)
+ break;
+ }
+ if (aCurrentValue < 0)
+ return;
+
+ if (!abortAllOperations())
+ return;
+
+ // 2. Show the dialog.
+ XGUI_PropertyDialog* aDlg = new XGUI_PropertyDialog(desktop());
+ aDlg->setWindowTitle(tr("Edge Thickness"));
+ XGUI_EdgeThicknessWidget* aEdgeThicknessWidget = new XGUI_EdgeThicknessWidget(aDlg);
+ connect(aEdgeThicknessWidget, SIGNAL(thicknessValueChanged()), this, SLOT(onEdgeThicknessValueChanged()));
+ aDlg->setContent(aEdgeThicknessWidget);
+ aEdgeThicknessWidget->setValue(aCurrentValue);
+
+ // 3. Abort the previous operation and start a new one.
+ SessionPtr aMgr = ModelAPI_Session::get();
+ QString aDescription = contextMenuMgr()->action("EDGE_THICKNESS_CMD")->text();
+ aMgr->startOperation(aDescription.toStdString());
+
+ if (aDlg->exec() == QDialog::Accepted) {
+ // 4. Set the value to all results.
+ aCurrentValue = aEdgeThicknessWidget->getValue();
+ setEdgeThickness(aCurrentValue, theObjects);
+ aMgr->finishOperation();
+ } else {
+ aMgr->abortOperation();
+ Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY));
+ }
+
+ updateCommandStatus();
+}
+
+//**************************************************************
+void XGUI_Workshop::onEdgeThicknessValueChanged()
+{
+ XGUI_EdgeThicknessWidget* aWidget = (XGUI_EdgeThicknessWidget*)sender();
+ if (!aWidget)
+ return;
+
+ QObjectPtrList anObjects = mySelector->selection()->selectedObjects();
+ setEdgeThickness(aWidget->getValue(), anObjects);
+ static const Events_ID kRedisplayEvent =
+ Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY);
+ Events_Loop::loop()->flush(kRedisplayEvent);
+
+ myViewerProxy->update();
+}
//******************************************************
void XGUI_Workshop::showObjects(const QObjectPtrList& theList, bool isVisible)
/// theObjects a list of selected objects
void changeTransparency(const QObjectPtrList& theObjects);
+ /// Change edge thickness of the results if it is possible.
+ /// The operation is available for construction, body and group results.
+ /// \param theObjects refers to selected objects.
+ void changeEdgeThickness(const QObjectPtrList& theObjects);
+
/// Change number of iso-lines for the given objects
/// theObjects a list of selected objects
void changeIsoLines(const QObjectPtrList& theObjects);
/// Apply the current transparency value if preview in transparency dialog is switched on
void onTransparencyValueChanged();
+
+ void onEdgeThicknessValueChanged();
protected:
/// Sets the granted operations for the parameter operation. Firstly, it finds the nested features
<source>Transparency...</source>
<translation>Transparence...</translation>
</message>
+ <message>
+ <source>Edge Thickness...</source>
+ <translation>Epaisseur Des Aretes...</translation>
+ </message>
<message>
<source>Show</source>
<translation>Voir</translation>
<translation>Transparent</translation>
</message>
</context>
+<context>
+ <name>XGUI_EdgeThicknessWidget</name>
+</context>
<context>
<name>XGUI_Workshop</name>
<message>