20 #ifndef MODULEBASE_MODELWIDGET_H
21 #define MODULEBASE_MODELWIDGET_H
23 #include <ModuleBase.h>
24 #include <ModuleBase_ActionType.h>
25 #include <ModuleBase_Definitions.h>
26 #include <ModuleBase_OperationFeature.h>
27 #include <ModuleBase_ActionInfo.h>
28 #include <ModuleBase_ActionParameter.h>
29 #include <ModelAPI_Feature.h>
31 #include <SelectMgr_ListOfFilter.hxx>
38 #pragma warning(disable: 4100)
72 DefinedInPreferences };
90 bool isInitialized(ObjectPtr theObject)
const;
95 virtual void selectionModes(
int& theModuleSelectionModes, QIntList& theModes);
100 virtual void selectionFilters(QIntList& theModuleSelectionFilters,
101 SelectMgr_ListOfFilter& theSelectionFilters);
125 virtual bool isValueEnabled()
const;
140 void processValueState();
157 virtual QString getError(
const bool theValueStateChecked =
true)
const;
163 virtual bool setSelection(QList<std::shared_ptr<ModuleBase_ViewerPrs>>& theValues,
164 const bool theToValidate)
171 virtual void getHighlighted(QList<std::shared_ptr<ModuleBase_ViewerPrs>>& theValues) {};
195 virtual bool focusTo();
204 virtual void deactivate();
221 QWidget* getControlAcceptingFocus(
const bool isFirst);
224 virtual bool eventFilter(
QObject* theObject,
QEvent *theEvent);
228 virtual void enableFocusProcessing();
231 virtual void setHighlighted(
bool isHighlighted);
237 return myAttributeID;
248 bool isAppendAttr =
true;
249 std::string aContext = myFeatureId;
250 if(!aContext.empty() && !myAttributeID.empty()) {
254 if (myAttributeID.find(aContext +
"__") != std::string::npos)
255 isAppendAttr =
false;
260 aContext += myAttributeID;
269 virtual void setFeature(
const FeaturePtr& theFeature,
const bool theToStoreValue =
false,
270 const bool isUpdateFlushed =
true);
281 virtual bool canProcessAction(ModuleBase_ActionType theActionType,
bool& isActionEnabled);
284 virtual bool processAction(ModuleBase_ActionType theActionType,
285 const ActionParamPtr& theParam = ActionParamPtr());
289 virtual QList<ActionInfo>
actionsList(ModuleBase_ActionType theActionType)
const
290 {
return QList<ActionInfo>(); }
294 void updateObject(ObjectPtr theObj);
297 virtual QString translate(
const std::string& theStr)
const;
327 virtual void setReadOnly(
bool isReadOnly) { setEnabled(!isReadOnly); }
329 virtual bool isReadOnly()
const {
return !isEnabled(); }
375 void setDefaultValue(
const std::string& theValue);
380 myAttributeID = theAttribute;
387 ValueState setValueState(
const ValueState& theState);
392 bool blockValueState(
const bool theBlocked);
396 virtual void initializeValueByActivate();
413 virtual bool processEnter();
416 virtual bool processEscape();
419 virtual bool processDelete();
422 virtual bool processSelection();
426 void onWidgetValuesChanged();
429 void onWidgetValuesModified();
459 bool myIsComputedDefault;
462 std::string myDefaultValue;
468 std::string myIsModifiedInEdit;
473 bool myIsValueStateBlocked;
475 bool myFlushUpdateBlocked;
477 bool myUpdateVisualAttributes;
480 bool myUseExternalParts;
An event message for sending a string message which has to be translated.
Definition: Events_InfoMessage.h:35
A class for Property panel object definition.
Definition: ModuleBase_IPropertyPanel.h:35
Class which provides access to Workshop object services.
Definition: ModuleBase_IWorkshop.h:48
Presentation.
Definition: ModuleBase_ViewerPrs.h:37