Salome HOME
Apply warning icon to folder only in case if it is not expanded
[modules/shaper.git] / src / PartSet / PartSet_TreeNodes.h
index 7ab9337ad70781455ec2ca568749791e0070202a..5961121e99e4acd9f62bdfa15c060ee612f57049 100644 (file)
@@ -71,10 +71,25 @@ 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;
 
 protected:
   ObjectPtr myObject;
@@ -311,11 +326,6 @@ public:
   /// \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);
-
-private:
-  FeaturePtr getFeature(const std::string& theId) const;
-
-  void getFirstAndLastIndex(int& theFirst, int& theLast) const;
 };
 
 
@@ -324,32 +334,33 @@ private:
 * \ingroup Modules
 * Implementation of a node for compsolid representation
 */
-class PartSet_CompsolidNode : public PartSet_ObjectNode
+class PartSet_StepNode : public PartSet_TreeNode
 {
 public:
-  PartSet_CompsolidNode(const ObjectPtr& theObj, ModuleBase_ITreeNode* theParent);
+  PartSet_StepNode(ModelAPI_Entity* theEnt, ModuleBase_ITreeNode* theParent) :
+    PartSet_TreeNode(theParent), myEntity(theEnt) {}
 
   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();
+  /// Returns the node representation according to theRole.
+  virtual QVariant data(int theColumn, int theRole) 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);
+  ModelAPI_Entity* entity() const {
+    return myEntity;
+  }
 
-  /// 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);
+  void setEntity(ModelAPI_Entity* theEnt) {
+    myEntity = theEnt;
+  }
 
+private:
+  ModelAPI_Entity* myEntity;
 };
 
 #endif