X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FModelGeomAlgo%2FModelGeomAlgo_Point2D.h;h=afa13b127a1c63d1f6356eca43345e2daf6cbffc;hb=ff4d5d0f42cf5d24b86b2bd2b6e1f58e74f52032;hp=d8fd556c4bae435178767250e4537747a3d11a56;hpb=5b6031b015602aa07f5a6fc668c13ac3faf7a8a9;p=modules%2Fshaper.git diff --git a/src/ModelGeomAlgo/ModelGeomAlgo_Point2D.h b/src/ModelGeomAlgo/ModelGeomAlgo_Point2D.h index d8fd556c4..afa13b127 100755 --- a/src/ModelGeomAlgo/ModelGeomAlgo_Point2D.h +++ b/src/ModelGeomAlgo/ModelGeomAlgo_Point2D.h @@ -24,8 +24,9 @@ class GeomDataAPI_Point2D; #include -namespace ModelGeomAlgo_Point2D { - +class ModelGeomAlgo_Point2D +{ +public: /// Searches Point2D attribute of reference of the attribute of given feature /// \param theFeature a feature to obtain AttributeRefAttr /// \param theAttribute a name of AttributeRefAttr on the given feature @@ -33,7 +34,7 @@ namespace ModelGeomAlgo_Point2D { /// \param theObjectFeatureAttribute a feature attribute in object that satisfies the search /// \param isSkipFeatureAttributes a boolean value if coincidences to the feature attributes /// \returns found point attribute or NULL - MODELGEOMALGO_EXPORT std::shared_ptr getPointOfRefAttr( + static MODELGEOMALGO_EXPORT std::shared_ptr getPointOfRefAttr( ModelAPI_Feature* theFeature, const std::string& theAttribute, const std::string& theObjectFeatureKind = "", @@ -50,13 +51,32 @@ namespace ModelGeomAlgo_Point2D { /// \param isSkipFeatureAttributes a boolean value if coincidences to the feature attributes /// should be skipped /// \returns found point attribute or NULL - MODELGEOMALGO_EXPORT void getPointsOfReference(const std::shared_ptr& theObject, + static MODELGEOMALGO_EXPORT + void getPointsOfReference(const std::shared_ptr& theObject, const std::string& theReferenceFeatureKind, std::set >& theAttributes, const std::string& theObjectFeatureKind = "", const std::string& theObjectFeatureAttribute = "", const bool isSkipFeatureAttributes = true); + /// Find points of intersection between the shape of the feature and all features in the sketch + /// \param theBaseFeature a feature: line, arc or circle that will be intersected + /// \param theFeatures a container of features to intersect with the base feature + /// \param thePoints a container of 3D points belong to the shape + /// \param theObjectToPoint a container of object to point + typedef std::map, + std::pair >, + std::list > > > PointToRefsMap; + + static MODELGEOMALGO_EXPORT void getPointsIntersectedShape( + const std::shared_ptr& theBaseFeature, + const std::list >& theFeatures, + PointToRefsMap& thePointToAttributeOrObject); + + static MODELGEOMALGO_EXPORT std::list > getSetOfPntIntersectedShape( + const std::shared_ptr& theBaseFeature, + const std::list >& theFeatures); + /// Removes attributes which points are out of the base shape /// \param theBaseShape a shape of check /// \param theAttributes a container of point 2D attributes @@ -64,7 +84,24 @@ namespace ModelGeomAlgo_Point2D { /// \param theDirX plane X direction to generate 3D point by 2D attribute point /// \param theDirY plane X direction to generate 3D point by 2D attribute point /// \param thePoints a container of 3D points belong to the shape - MODELGEOMALGO_EXPORT void getPointsInsideShape( + /// \param theAttributeToPoint a container of attribute to point + static MODELGEOMALGO_EXPORT void getPointsInsideShape( + const std::shared_ptr theBaseShape, + const std::set >& theAttributes, + const std::shared_ptr& theOrigin, + const std::shared_ptr& theDirX, + const std::shared_ptr& theDirY, + PointToRefsMap& thePointToAttributeOrObject); + + /// Removes attributes which points are out of the base shape + /// \param theBaseShape a shape of check + /// \param theAttributes a container of point 2D attributes + /// \param theOrigin origin of a plane to generate 3D point by 2D attribute point + /// \param theDirX plane X direction to generate 3D point by 2D attribute point + /// \param theDirY plane X direction to generate 3D point by 2D attribute point + /// \param thePoints a container of 3D points belong to the shape + /// \param theAttributeToPoint a container of attribute to point + static MODELGEOMALGO_EXPORT void getPointsInsideShape_p( const std::shared_ptr theBaseShape, const std::set >& theAttributes, const std::shared_ptr& theOrigin, @@ -73,31 +110,31 @@ namespace ModelGeomAlgo_Point2D { std::list >& thePoints, std::map, std::shared_ptr >& theAttributeToPoint); - /// Finds projected point to the given shape line /// \param theBaseShape a shape of check /// \param thePoint [in] a point to project /// \param theProjectedPoint [out] a projected point - MODELGEOMALGO_EXPORT bool isPointOnEdge(const std::shared_ptr theBaseShape, + static MODELGEOMALGO_EXPORT bool isPointOnEdge(const std::shared_ptr theBaseShape, const std::shared_ptr& thePoint, std::shared_ptr& theProjectedPoint); + #ifdef _DEBUG /// Return feature name, kind and point values united in a string info /// \param theFeature an investigated feature /// \param theAttributesOnly a container of necessary attributes, if empty, all /// \return string value - MODELGEOMALGO_EXPORT std::string getPontAttributesInfo( - const std::shared_ptr& theFeature, - const std::set >& theAttributesOnly); + static MODELGEOMALGO_EXPORT std::string getPontAttributesInfo( + const std::shared_ptr& theFeature, + const std::set >& theAttributesOnly); /// Return point attribute string info /// \param theAttribute an investigated attribute /// \return string value - MODELGEOMALGO_EXPORT std::string getPointAttributeInfo( - const std::shared_ptr& theAttribute); + static MODELGEOMALGO_EXPORT std::string getPointAttributeInfo( + const std::shared_ptr& theAttribute); #endif -} +}; #endif