+ public:
+ SMESH_subMesh(int Id,
+ SMESH_Mesh * father,
+ SMESHDS_Mesh * meshDS,
+ const TopoDS_Shape & aSubShape);
+ virtual ~ SMESH_subMesh();
+
+ int GetId() const; // == meshDS->ShapeToIndex( aSubShape )
+
+ SMESH_Mesh* GetFather() { return _father; }
+
+ SMESHDS_SubMesh * GetSubMeshDS();
+ const SMESHDS_SubMesh * GetSubMeshDS() const;
+
+ SMESHDS_SubMesh* CreateSubMeshDS();
+ // Explicit SMESHDS_SubMesh creation method, required for persistence mechanism
+
+ SMESH_subMesh *GetFirstToCompute();
+
+ SMESH_Algo* GetAlgo() const;
+
+ const std::map < int, SMESH_subMesh * >& DependsOn();
+ bool DependsOn( const SMESH_subMesh* other ) const;
+ /*!
+ * \brief Return iterator on the sub-meshes this one depends on. By default
+ * most simple sub-meshes go first.
+ */
+ SMESH_subMeshIteratorPtr getDependsOnIterator(const bool includeSelf,
+ const bool complexShapeFirst=false) const;
+
+ const TopoDS_Shape & GetSubShape() const;
+
+ enum compute_state
+ {
+ NOT_READY, READY_TO_COMPUTE,
+ COMPUTE_OK, FAILED_TO_COMPUTE
+ };
+ enum algo_state
+ {
+ NO_ALGO, MISSING_HYP, HYP_OK
+ };
+ enum algo_event
+ {
+ ADD_HYP , ADD_ALGO,
+ REMOVE_HYP , REMOVE_ALGO,
+ ADD_FATHER_HYP , ADD_FATHER_ALGO,
+ REMOVE_FATHER_HYP, REMOVE_FATHER_ALGO,
+ MODIF_HYP
+ };
+ enum compute_event
+ {
+ MODIF_ALGO_STATE, COMPUTE, COMPUTE_SUBMESH, COMPUTE_CANCELED,
+ CLEAN, SUBMESH_COMPUTED, SUBMESH_RESTORED, SUBMESH_LOADED,
+ MESH_ENTITY_REMOVED, CHECK_COMPUTE_STATE
+ };
+ enum event_type
+ {
+ ALGO_EVENT, COMPUTE_EVENT
+ };
+
+ // ==================================================================
+ // Members to track non hierarchical dependencies between submeshes
+ // ==================================================================
+
+ /*!
+ * \brief Sets an event listener and its data to a submesh
+ * \param listener - the listener to store
+ * \param data - the listener data to store
+ * \param where - the submesh to store the listener and it's data
+ *
+ * The method remembers the submesh \awhere it puts the listener in order to delete
+ * it when HYP_OK algo_state is lost
+ * After being set, event listener is notified on each event of \awhere submesh.
+ */
+ void SetEventListener(EventListener* listener,
+ EventListenerData* data,
+ SMESH_subMesh* where);
+
+ /*!
+ * \brief Return an event listener data
+ * \param listener - the listener whose data is
+ * \retval EventListenerData* - found data, maybe NULL
+ */
+ EventListenerData* GetEventListenerData(EventListener* listener) const;
+
+ /*!
+ * \brief Return an event listener data
+ * \param listenerName - the listener name
+ * \retval EventListenerData* - found data, maybe NULL
+ */
+ EventListenerData* GetEventListenerData(const std::string& listenerName) const;
+
+ /*!
+ * \brief Unregister the listener and delete it and it's data
+ * \param listener - the event listener to delete
+ */
+ void DeleteEventListener(EventListener* listener);
+
+protected:
+
+ //!< event listeners to notify
+ std::map< EventListener*, EventListenerData* > _eventListeners;