-protected:
- /// Returns an object that is under the mouse point. Firstly it checks the highlighting,
- /// if it exists, the first object is returned. Secondly, there is an iteration on
- /// the selected list to find the point. Thirdly, if the object is not found under the
- /// the point, the first selected object is returned.
- /// \param thePoint a screen point
- /// \param theView a 3D view
- /// \param theSketch the sketch feature
- /// \param thePresentations the list of presentations
- static ObjectPtr nearestFeature(QPoint thePoint, Handle_V3d_View theView, FeaturePtr theSketch,
- const QList<ModuleBase_ViewerPrs>& thePresentations);
+ /*
+ * Finds and returns feature reerenced to the paramenter feature with the given name if found
+ * \param theFeature a source feature where refsToMe is obtained
+ * \param theFeatureId an indentifier of the searched feature
+ */
+ static FeaturePtr findRefsToMeFeature(FeaturePtr theFeature, const std::string& theFeatureId)
+ {
+ if (!theFeature.get())
+ return FeaturePtr();
+
+ // find first projected feature and edit it
+ const std::set<AttributePtr>& aRefsList = theFeature->data()->refsToMe();
+ std::set<AttributePtr>::const_iterator anIt;
+ for (anIt = aRefsList.cbegin(); anIt != aRefsList.cend(); ++anIt) {
+ FeaturePtr aRefFeature = std::dynamic_pointer_cast<ModelAPI_Feature>((*anIt)->owner());
+ if (aRefFeature && aRefFeature->getKind() == theFeatureId)
+ return aRefFeature;
+ }
+ return FeaturePtr();
+ }
+
+ /**
+ * Returns point of a coincedence
+ * \param theStartCoin the coincedence feature
+ */
+ static std::shared_ptr<GeomAPI_Pnt2d> getCoincedencePoint(FeaturePtr theStartCoin);
+
+ /// Sends redisplay event for all sub-features of the composite. Flush it.
+ static void sendSubFeaturesEvent(const CompositeFeaturePtr& theComposite,
+ const Events_ID theId);
+
+ /**
+ * Returns true if the object is a sketch entity, where auxiliary attribute has true value
+ * \param theObject a result or feature
+ * \return boolean result
+ */
+ static bool isAuxiliarySketchEntity(const ObjectPtr& theObject);
+
+ /**
+ * Returns true if the object is a sketch entity produced by projection or intersection feature
+ * and if it should not be included into the sketch result
+ */
+ static bool isIncludeIntoSketchResult(const ObjectPtr& theObject);
+
+ static ResultPtr createFixedByExternalCenter(const ObjectPtr& theObject,
+ const std::shared_ptr<GeomAPI_Edge>& theEdge,
+ ModelAPI_AttributeSelection::CenterType theType,
+ const CompositeFeaturePtr& theSketch,
+ bool theTemporary,
+ FeaturePtr& theCreatedFeature);