X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchSolver%2FPlaneGCSSolver%2FPlaneGCSSolver_UpdateCoincidence.h;fp=src%2FSketchSolver%2FPlaneGCSSolver%2FPlaneGCSSolver_UpdateCoincidence.h;h=d5acf494af430a2776bb1750a644678d0e3f5773;hb=15cea9df7b45e3e1fb5581b538bc820e82f106d3;hp=558756492fa68c7406ad86e8ab59d57bf65dd04b;hpb=399b8cd0e06149b1de0ca75dec1a6c90ac87bc8c;p=modules%2Fshaper.git diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_UpdateCoincidence.h b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_UpdateCoincidence.h index 558756492..d5acf494a 100644 --- a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_UpdateCoincidence.h +++ b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_UpdateCoincidence.h @@ -43,9 +43,9 @@ public: /// \brief Send notification about update of the feature to all interested virtual void update(const FeaturePtr& theFeature); - /// \brief Verifies the entities are not coincident yet - /// \return \c true if the entities does not coincident - bool checkCoincidence(const EntityWrapperPtr& theEntity1, const EntityWrapperPtr& theEntity2); + /// \brief Set coincidence between two given entities + /// \return \c true if the entities does not coincident yet + bool addCoincidence(const EntityWrapperPtr& theEntity1, const EntityWrapperPtr& theEntity2); /// \brief Verifies the point is coincident to the feature /// \return \c true if the point is on the feature @@ -63,21 +63,31 @@ private: bool isExist(const EntityWrapperPtr& theEntity) const; /// Verify the point is already in the list bool isExist(const GCS::Point& thePoint) const; - /// Check the coincidence is not in list yet - bool isNewCoincidence(const EntityWrapperPtr& theEntityExist, - const EntityWrapperPtr& theOtherEntity); - bool isNewCoincidence(const EntityWrapperPtr& theEntityExist, - const CoincidentEntities& theOtherGroup, - const EntityWrapperPtr& theEntityInOtherGroup); - private: - bool hasExternal() const; + /// Add entity to group + bool add(const EntityWrapperPtr& theEntity); + + /// Remove entity from group + void remove(const EntityWrapperPtr& theEntity); + + /// Merge two groups + void merge(const CoincidentEntities& theOther); private: - /// external entity and set of entities connected to it - std::map > myExternalAndConnected; + std::set myPoints; ///< coincident points + std::set myExternalPoints; //< external points coincident to other points + std::set myFeatures; ///< other entities containing points }; + /// \brief Search the group of coincidences containing given entity. + /// Searches points only. + std::list::iterator findGroupOfCoincidence(const EntityWrapperPtr& theEntity); + + /// \brief Add entity to group of coincidences + /// \reutrn \c true if the entity is added, thus the coincidence is new + bool addToGroupOfCoincidence(CoincidentEntities& theGroup, const EntityWrapperPtr& theEntity); + +private: std::list myCoincident; ///< list of coincidences };