Salome HOME
updated copyright message
[modules/shaper.git] / src / PartSet / PartSet_TreeNodes.h
index 7ab9337ad70781455ec2ca568749791e0070202a..f00fa9b41cac2db56dcf1c5c9e907b1eae58b9a5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2023  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
 //
 // 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
+// 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>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef PartSet_TreeNodes_H
@@ -38,6 +37,9 @@ public:
 
   /// Returns the node representation according to theRole.
   virtual QVariant data(int theColumn, int theRole) const;
+
+  // Returns color of the Item when it is active
+  virtual QColor activeItemColor() const;
 };
 
 /**
@@ -71,10 +73,28 @@ public:
   /// theObj a new object
   void setObject(ObjectPtr theObj) { myObject = theObj; }
 
+  virtual VisibilityState visibilityState() const;
+
   /// Updates sub-nodes of the node
-  virtual void update() {}
+  virtual void update();
 
-  virtual VisibilityState visibilityState() const;
+  /// Process creation of objects.
+  /// \param theObjects a list of created objects
+  /// \return a list of nodes which corresponds to the created objects
+  virtual QTreeNodesList objectCreated(const QObjectPtrList& theObjects);
+
+  /// Process deletion of objects.
+  /// \param theDoc a document where objects were deleted
+  /// \param theGroup a name of group where objects were deleted
+  virtual QTreeNodesList objectsDeleted(const DocumentPtr& theDoc, const QString& theGroup);
+
+  /// Returns number of sub-objects of the current object
+  virtual int numberOfSubs() const;
+
+  virtual ObjectPtr subObject(int theId) const;
+
+  // Returns color of the Item when it is active
+  virtual QColor activeItemColor() const;
 
 protected:
   ObjectPtr myObject;
@@ -312,10 +332,8 @@ public:
   /// \param theGroup a name of group where objects were deleted
   virtual QTreeNodesList objectsDeleted(const DocumentPtr& theDoc, const QString& theGroup);
 
-private:
-  FeaturePtr getFeature(const std::string& theId) const;
-
-  void getFirstAndLastIndex(int& theFirst, int& theLast) const;
+  /// Returns the node representation according to theRole.
+  virtual QVariant data(int theColumn, int theRole) const;
 };
 
 
@@ -324,32 +342,24 @@ private:
 * \ingroup Modules
 * Implementation of a node for compsolid representation
 */
-class PartSet_CompsolidNode : public PartSet_ObjectNode
+class PartSet_StepNode : public PartSet_ObjectNode
 {
 public:
-  PartSet_CompsolidNode(const ObjectPtr& theObj, ModuleBase_ITreeNode* theParent);
+  PartSet_StepNode(const ObjectPtr& theObj, ModuleBase_ITreeNode* theParent) :
+    PartSet_ObjectNode(theObj, theParent) {}
 
   static std::string typeId()
   {
-    static std::string myType = "CompSolid";
+    static std::string myType = "FieldStep";
     return myType;
   }
 
   virtual std::string type() const { return typeId(); }
 
-  /// Updates sub-nodes of the node
-  virtual void update();
-
-  /// Process creation of objects.
-  /// \param theObjects a list of created objects
-  /// \return a list of nodes which corresponds to the created objects
-  virtual QTreeNodesList objectCreated(const QObjectPtrList& theObjects);
-
-  /// Process deletion of objects.
-  /// \param theDoc a document where objects were deleted
-  /// \param theGroup a name of group where objects were deleted
-  virtual QTreeNodesList objectsDeleted(const DocumentPtr& theDoc, const QString& theGroup);
+  /// Returns the node representation according to theRole.
+  virtual QVariant data(int theColumn, int theRole) const;
 
+  virtual VisibilityState visibilityState() const;
 };
 
 #endif