ModuleBase_WidgetNameEdit.h
ModuleBase_WidgetRadiobox.h
ModuleBase_WidgetPointInput.h
+ ModuleBase_ITreeNode.h
)
SET(PROJECT_MOC_HEADERS
class QKeyEvent;
class QMenu;
class Config_WidgetAPI;
+
class ModuleBase_ModelWidget;
class ModuleBase_Operation;
class ModuleBase_ViewerPrs;
-
+class ModuleBase_ITreeNode;
class ModuleBase_IWorkshop;
+
class ModelAPI_Result;
class Events_Message;
void getXMLRepresentation(const std::string& theFeatureId, std::string& theXmlCfg,
std::string& theDescription);
+ /// Returns root tree node which represents a data model
+ virtual ModuleBase_ITreeNode* rootNode() const = 0;
+
signals:
/// Segnal emitted when an operation is resumed
/// \param theOp a resumed operation
--- /dev/null
+// Copyright (C) 2014-2017 CEA/DEN, EDF R&D
+//
+// 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<mailto:webmaster.salome@opencascade.com>
+//
+
+#ifndef ModuleBase_ITreeNode_H
+#define ModuleBase_ITreeNode_H
+
+#include "ModuleBase.h"
+
+#include <ModelAPI_Object.h>
+
+#include <QList>
+#include <QString>
+#include <QIcon>
+
+class ModuleBase_ITreeNode;
+
+typedef QList<ModuleBase_ITreeNode*> QTreeNodesList;
+
+class ModuleBase_ITreeNode
+{
+public:
+ /// Default constructor
+ ModuleBase_ITreeNode() : myParent(0) {}
+
+ /// Returns name of the node
+ virtual QString name() const { return "Item"; }
+
+ /// Returns icon of the node
+ virtual QIcon icon() const { return QIcon(); }
+
+ /// Returns foreground color of the node
+ virtual QColor color() const { return Qt::black; }
+
+ /// Returns properties flag of the item
+ virtual Qt::ItemFlags falg() const { return Qt::ItemIsSelectable | Qt::ItemIsEnabled; }
+
+ /// Returns parent node of the current node
+ ModuleBase_ITreeNode* parent() const { return myParent; }
+
+ /// Returns list of the node children
+ QTreeNodesList children() const { return myChildren; }
+
+ /// Returns object referenced by the node (can be null)
+ virtual ObjectPtr object() const { return ObjectPtr(); }
+
+protected:
+ ModuleBase_ITreeNode* myParent; //!< Parent of the node
+ QTreeNodesList myChildren; //!< Children of the node
+};
+
+#endif
\ No newline at end of file
PartSet_WidgetSketchLabel.h
PartSet_CenterPrs.h
PartSet_ExternalPointsMgr.h
+ PartSet_DataModel.h
+ PartSet_TreeNodes.h
)
SET(PROJECT_MOC_HEADERS
PartSet_WidgetSketchLabel.cpp
PartSet_CenterPrs.cpp
PartSet_ExternalPointsMgr.cpp
+ PartSet_DataModel.cpp
+ PartSet_TreeNodes.cpp
)
SET(PROJECT_RESOURCES
--- /dev/null
+// Copyright (C) 2014-2017 CEA/DEN, EDF R&D
+//
+// 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<mailto:webmaster.salome@opencascade.com>
+//
+
+#include "PartSet_DataModel.h"
+
+#include <ModelAPI_Events.h>
+
+#include <Events_Loop.h>
+
+PartSet_DataModel::PartSet_DataModel()
+{
+ Events_Loop* aLoop = Events_Loop::loop();
+ aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OBJECT_CREATED));
+ aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OBJECT_DELETED));
+ aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OBJECT_UPDATED));
+ aLoop->registerListener(this, Events_Loop::eventByName(EVENT_ORDER_UPDATED));
+ aLoop->registerListener(this, Events_Loop::eventByName(EVENT_DOCUMENT_CHANGED));
+}
+
+
+void PartSet_DataModel::processEvent(const std::shared_ptr<Events_Message>& theMessage)
+{
+
+}
--- /dev/null
+// Copyright (C) 2014-2017 CEA/DEN, EDF R&D
+//
+// 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<mailto:webmaster.salome@opencascade.com>
+//
+
+#ifndef PartSet_DataModel_H
+#define PartSet_DataModel_H
+
+#include "PartSet.h"
+
+#include <Events_Listener.h>
+
+
+class ModuleBase_ITreeNode;
+
+class PartSet_DataModel : public Events_Listener
+{
+public:
+ PartSet_DataModel();
+
+ /// Event Listener method
+ /// \param theMessage an event message
+ virtual void processEvent(const std::shared_ptr<Events_Message>& theMessage);
+
+ ModuleBase_ITreeNode* root() const { return myRoot; }
+
+private:
+ ModuleBase_ITreeNode* myRoot;
+};
+
+#endif
\ No newline at end of file
#include "PartSet_CustomPrs.h"
#include "PartSet_IconFactory.h"
#include "PartSet_OverconstraintListener.h"
+#include "PartSet_DataModel.h"
#include "PartSet_Filters.h"
#include "PartSet_FilterInfinite.h"
mySketchMgr = new PartSet_SketcherMgr(this);
mySketchReentrantMgr = new PartSet_SketcherReentrantMgr(theWshop);
+ myDataModel = new PartSet_DataModel();
+
XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(theWshop);
XGUI_Workshop* aWorkshop = aConnector->workshop();
// customize sketch dimension constraint presentation
if (!aCustomized) {
if (!aColor.empty()) { // otherwise presentation has the default color
- AttributeIntArrayPtr aColorAttr = theResult->data()->intArray(ModelAPI_Result::COLOR_ID());
- aColorAttr->setSize(3);
- // Set the color attribute in order do not use default colors in the perasentation object
- for (int i = 0; i < 3; i++)
- aColorAttr->setValue(i, aColor[i]);
aCustomized = thePrs->setColor(aColor[0], aColor[1], aColor[2]);
}
}
return aConnector->workshop();
}
-//******************************************************
void PartSet_Module::setDefaultConstraintShown()
{
myHasConstraintShown[PartSet_Tools::Geometrical] = true;
myHasConstraintShown[PartSet_Tools::Dimensional] = true;
myHasConstraintShown[PartSet_Tools::Expressions] = false;
}
+
+//******************************************************
+ModuleBase_ITreeNode* PartSet_Module::rootNode() const
+{
+ return myDataModel->root();
+}
class PartSet_CustomPrs;
class PartSet_SketcherMgr;
class PartSet_SketcherReentrantMgr;
+class PartSet_DataModel;
class ModelAPI_Result;
class QAction;
/// \param theMessage a message of reentrant operation
virtual void setReentrantPreSelection(const std::shared_ptr<Events_Message>& theMessage);
+ /// Returns root tree node which represents a data model
+ virtual ModuleBase_ITreeNode* rootNode() const;
+
/// Returns the workshop
XGUI_Workshop* getWorkshop() const;
/// redisplay and restore it after
PartSet_SketcherMgr::FeatureToSelectionMap myCurrentSelection;
QModelIndex myActivePartIndex;
+
+ PartSet_DataModel* myDataModel;
};
#endif
--- /dev/null
+// Copyright (C) 2014-2017 CEA/DEN, EDF R&D
+//
+// 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<mailto:webmaster.salome@opencascade.com>
+//
+
+#include "PartSet_TreeNodes.h"
+
+
+PartSet_RootNode::PartSet_RootNode()
+{
+
+}
\ No newline at end of file
--- /dev/null
+// Copyright (C) 2014-2017 CEA/DEN, EDF R&D
+//
+// 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<mailto:webmaster.salome@opencascade.com>
+//
+
+#ifndef PartSet_TreeNodes_H
+#define PartSet_TreeNodes_H
+
+#include "PartSet.h"
+
+#include <ModuleBase_ITreeNode.h>
+
+class PartSet_RootNode : public ModuleBase_ITreeNode
+{
+public:
+ PartSet_RootNode();
+
+};
+
+
+#endif
\ No newline at end of file