INCLUDE(XMLProcessing)
INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/src/Events
- ${PYTHON_INCLUDE_DIR})
+ ${PYTHON_INCLUDE_DIR})
SET(PROJECT_HEADERS
Config_def.h
Config_ValidatorReader.h
Config_DataModelReader.h
)
-
+
SET(PROJECT_SOURCES
Config_FeatureMessage.cpp
Config_XMLReader.cpp
SOURCE_GROUP ("Resource Files" FILES ${XML_RESOURCES})
-ADD_DEFINITIONS(-DCONFIG_EXPORTS -D_SCL_SECURE_NO_WARNINGS)
+ADD_DEFINITIONS(-DCONFIG_EXPORTS -D_SCL_SECURE_NO_WARNINGS)
# -D_SCL_SECURE_NO_WARNINGS - to disable warnings 4996
ADD_LIBRARY(Config SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS} ${XML_RESOURCES})
void Config_ModuleReader::loadScript(const std::string& theFileName)
{
- /* aquire python thread */
+ /* acquire python thread */
PyGILState_STATE gstate = PyGILState_Ensure();
PyObject* module = PyImport_ImportModule(theFileName.c_str());
if (!module) {
- std::string anErrorMsg = "An error occured while importing " + theFileName;
+ std::string anErrorMsg = "An error occurred while importing " + theFileName;
//Get detailed error message:
if (PyErr_Occurred()) {
PyObject *pstr, *ptype, *pvalue, *ptraceback;
const std::shared_ptr<Config_FeatureMessage> aMsg =
std::dynamic_pointer_cast<Config_FeatureMessage>(theMessage);
if (aMsg) {
- // proccess the plugin info, load plugin
+ // process the plugin info, load plugin
if (myPlugins.find(aMsg->id()) == myPlugins.end()) {
myPlugins[aMsg->id()] = std::pair<std::string, std::string>(
aMsg->pluginLibrary(), aMsg->documentKind());
std::string myCurrentPluginName; ///< name of the plugin that must be loaded currently
std::shared_ptr<ModelAPI_Document> myCurrentDoc; ///< current working document
bool myCheckTransactions; ///< if true, generates error if document is updated outside of transaction
- bool myOperationAttachedToNext; ///< the current operation must be commited twice, with nested
+ bool myOperationAttachedToNext; ///< the current operation must be committed twice, with nested
public:
//! Loads the OCAF document from the file.
//! Closes all documents
MODEL_EXPORT virtual void closeAll();
- //! Starts a new operation (opens a tansaction)
+ //! Starts a new operation (opens a transaction)
//! \param theAttachedToNested if it is true, it means that this transaction is attached to the nested
- //! where it is located and will be commited on the next commit with the nested
+ //! where it is located and will be committed on the next commit with the nested
MODEL_EXPORT virtual void startOperation(
const std::string& theId = "", const bool theAttachedToNested = false);
//! Finishes the previously started operation (closes the transaction)
/// Processes the configuration file reading
MODEL_EXPORT virtual void processEvent(const std::shared_ptr<Events_Message>& theMessage);
- /// Copies the document to the new one wit hthe given id
+ /// Copies the document to the new one with the given id
MODEL_EXPORT virtual std::shared_ptr<ModelAPI_Document> copy(
std::shared_ptr<ModelAPI_Document> theSource, std::string theID);
/**\class ModelAPI_Entity
* \ingroup DataModel
* \brief Represents a common parent class for Objects and documents.
- * Provided in order to make possible distingiushing of objects and documents
+ * Provided in order to make possible distinguishing of objects and documents
* by downcasting of their pointers.
*/
class ModelAPI_Entity
{
public:
- /// Empty function which is added for virtualisation of the interface
+ /// Empty function which is added for virtualiation of the interface
virtual void emptyFunction() const {}
};
//! Starts a new operation (opens a transaction)
//! \param theId of operation for history (optional)
//! \param theAttachedToNested if it is true, it means that this transaction is attached to the nested
- //! where it is located and will be commited on the next commit with the nested
+ //! where it is located and will be committed on the next commit with the nested
virtual void startOperation(
const std::string& theId = "", const bool theAttachedToNested = false) = 0;
//! Finishes the previously started operation (closes the transaction)
{
ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
(getNewOperation(theFeatureId));
- // If the operation is launched as sub-operation of another then we have to initialise
+ // If the operation is launched as sub-operation of another then we have to initialize
// parent feature
ModuleBase_OperationFeature* aCurOperation = dynamic_cast<ModuleBase_OperationFeature*>
(myWorkshop->currentOperation());
public:\r
\r
/// Constructor\r
- /// \param theParent instance of workshop intrface\r
+ /// \param theParent instance of workshop interface\r
ModuleBase_IModule(ModuleBase_IWorkshop* theParent);\r
\r
virtual ~ModuleBase_IModule() {}\r
/// \param theOperation a started operation\r
virtual ModuleBase_Operation* currentOperation() const = 0;\r
\r
- /// Add menu atems for viewer into the given menu\r
+ /// Add menu items for viewer into the given menu\r
/// \param theMenu a popup menu to be shown in the viewer\r
/// \param theStdActions a map of standard actions\r
/// \return true if items are added and there is no necessity to provide standard menu\r
virtual bool addViewerMenu(QMenu* theMenu, const QMap<QString, QAction*>& theStdActions) const { return false; }\r
\r
- /// Add menu atems for object browser into the given menu\r
+ /// Add menu items for object browser into the given menu\r
/// \param theMenu a popup menu to be shown in the object browser\r
virtual void addObjectBrowserMenu(QMenu* theMenu) const {};\r
\r
/// Creates custom widgets for property panel\r
/// \param theType a type of widget\r
/// \param theParent the parent object\r
- /// \param theWidgetApi the widget configuation. The attribute of the model widget is obtained from\r
+ /// \param theWidgetApi the widget configuration. The attribute of the model widget is obtained from\r
/// \param theParentId is Id of a parent of the current attribute\r
/// \param theModelWidgets list of widget objects\r
virtual ModuleBase_ModelWidget* createWidgetByType(const std::string& theType, QWidget* theParent,\r
//! Returns True if there are available Redos and there is not an active operation\r
virtual bool canRedo() const;\r
\r
- /// Returnas true if the action can be applyed to the object\r
+ /// Returns true if the action can be applyed to the object\r
/// \param theObject a checked object\r
/// \param theActionId an identifier of action, to be found in the menu manager like "DELETE_CMD"\r
- /// \return the a booean result\r
+ /// \return the a boolean result\r
virtual bool canApplyAction(const ObjectPtr& theObject, const QString& theActionId) const = 0;\r
\r
/// Returns True if the current operation can be committed. By default it is true.\r
* If the object is result with the color attribute value set, it is used,\r
* otherwise the customize is applyed to the object's feature if it is a custom prs\r
* \param theObject an object instance\r
- * \param theUpdateViewer the parameter whether the viewer should be update immediatelly\r
+ * \param theUpdateViewer the parameter whether the viewer should be update immediately\r
* \returns true if the object is modified\r
*/\r
virtual bool customizeObject(ObjectPtr theObject, const bool theUpdateViewer);\r
\r
- /// This method is called on object browser creation for customisation of module specific features\r
+ /// This method is called on object browser creation for customization of module specific features\r
/// \param theObjectBrowser a pinter on Object Browser widget\r
virtual void customizeObjectBrowser(QWidget* theObjectBrowser) {}\r
\r
/// Called on call of command corresponded to a feature\r
virtual void onFeatureTriggered();\r
\r
- /// Slolt called on object display\r
+ /// Slot called on object display\r
/// \param theObject a data object\r
/// \param theAIS a presentation object\r
virtual void onObjectDisplayed(ObjectPtr theObject, AISObjectPtr theAIS) {}\r
if (isComputedDefault()) {
if (myFeature->compute(myAttributeID)) {
restoreValue();
- }
+ }
}
else {
storeValue();
if (getControls().contains(aWidget)) {
emit focusInWidget(this);
}
- }
+ }
// pass the event on to the parent class
return QObject::eventFilter(theObject, theEvent);
protected:
/// The attribute name of the model feature
- std::string myAttributeID;
+ std::string myAttributeID;
/// Name of parent
- std::string myParentId;
+ std::string myParentId;
/// A feature which is processing by active operation
- FeaturePtr myFeature;
+ FeaturePtr myFeature;
/// Flag which shows that current operation is in editing mode
bool myIsEditing;
private:
/// Value should be computed on execute, like radius for circle's constraint (can not be zero)
- bool myIsComputedDefault;
-
+ bool myIsComputedDefault;
+
/// the default value, which is defined in the XML for this attribute
- std::string myDefaultValue;
+ std::string myDefaultValue;
/// the reset state. If it is false, the reset method of the widget is not performed
bool myUseReset;
/**
* \ingroup GUI
- * Implementation of IWorkshop interface which provides access to Workshop sevices at module level
+ * Implementation of IWorkshop interface which provides access to Workshop services at module level
*/
class XGUI_EXPORT XGUI_ModuleConnector : public ModuleBase_IWorkshop
{
//! \param theId an aborted operation
void abortOperation(ModuleBase_Operation* theOperation);
- //! Returns AIS opbject by data object
+ //! Returns AIS object by data object
virtual AISObjectPtr findPresentation(const ObjectPtr& theObject) const;
//! Returns data object by AIS
aWidget->setFeature(aFOperation->feature(), isStoreValue);
aWidget->enableFocusProcessing();
}
-
+
myPropertyPanel->setModelWidgets(aWidgets);
aFOperation->setPropertyPanel(myPropertyPanel);
return myViewerProxy;
}
- /// Returns the module connectory
+ /// Returns the module connector
/// \returns the instance of connector
XGUI_ModuleConnector* moduleConnector() const
{
//! Show the given features in 3d Viewer
void showOnlyObjects(const QObjectPtrList& theList);
- /// Set display mode for the given onjects
+ /// Set display mode for the given objects
/// \param theList a list of displayed objects
/// \param theMode a mode to set (see \ref XGUI_Displayer)
void setDisplayMode(const QObjectPtrList& theList, int theMode);
return myModule;
}
- /// Returns current directory whic contains data files
+ /// Returns current directory which contains data files
QString currentDataDir() const { return myCurrentDir; }
- /// Returns current directory whic contains data files
+ /// Returns current directory which contains data files
void setCurrentDataDir(const QString& theDir) { myCurrentDir = theDir; }
/**
void saveDocument(const QString& theName, std::list<std::string>& theFileNames);
/**
- * If there is an active (uncommited) operation shows a prompt to abort it
+ * If there is an active (uncommitted) operation shows a prompt to abort it
* and performs abortion if user agreed. Returns true if
* - operation aborted successfully
* - there is no active operation
/// Emitted when selection happens in Salome viewer
void salomeViewerSelection();
- /// Emitted when error in applivation happens
+ /// Emitted when error in application happens
void errorOccurred(const QString&);
//! the signal about the workshop actions states are updated.
/// update history list (undo/redo commands)
void updateHistory();
- /// Create a new dokument
+ /// Create a new document
void onNew();
/// Open document from file
void closeDocument();
protected:
- /// Sets the granted operations for the parameter operation. Firtsly, it finds the nested features
+ /// Sets the granted operations for the parameter operation. Firstly, it finds the nested features
/// and set them into the operation. Secondly, it asks the module about ids of granted operations.
/// \param theOperation an operation
void setGrantedFeatures(ModuleBase_Operation* theOperation);
/// Display all results
//void displayAllResults();
- /// Displau results from document
+ /// Display results from document
/// \param theDoc a document
void displayDocumentResults(DocumentPtr theDoc);
virtual void onOperationResumed(ModuleBase_Operation* theOperation);
/// SLOT, that is called after the operation is stopped. Update workshop state, e.g.
- /// hides the property panel and udpate the command status.
+ /// hides the property panel and update the command status.
/// \param theOpertion a stopped operation
virtual void onOperationStopped(ModuleBase_Operation* theOperation);
/// SLOT, that is called after the operation is committed.
- /// \param theOpertion a commmitted operation
+ /// \param theOpertion a committed operation
virtual void onOperationCommitted(ModuleBase_Operation* theOperation);
/// SLOT, that is called after the operation is aborted.
void onStartWaiting();
/// Called by Ok button clicked in the property panel. Asks the error manager whether
- /// the operation can be commited and do it if it returns true.
+ /// the operation can be committed and do it if it returns true.
void onAcceptActionClicked();
/// Listens the corresponded signal from operation manager and send it with the Ok