X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchAPI%2FSketchAPI_Sketch.h;h=843630f5bd9eaf9744d198ccd61efaff6dff49d9;hb=099946a7d91982c9a2c4ca2ccdd934320f196413;hp=dcf06446dc2d42b4dd03a17e5775e1102cf7b65a;hpb=086aa81da7d411db27b5f8a51ecba2dd0804b847;p=modules%2Fshaper.git diff --git a/src/SketchAPI/SketchAPI_Sketch.h b/src/SketchAPI/SketchAPI_Sketch.h index dcf06446d..843630f5b 100644 --- a/src/SketchAPI/SketchAPI_Sketch.h +++ b/src/SketchAPI/SketchAPI_Sketch.h @@ -1,5 +1,6 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : SketchAPI_Sketch.h -// Purpose: +// Purpose: // // History: // 07/06/16 - Sergey POKHODENKO - Creation of the file @@ -23,9 +24,12 @@ class ModelAPI_Object; class ModelHighAPI_Double; class ModelHighAPI_Integer; class ModelHighAPI_RefAttr; +class ModelHighAPI_Reference; class ModelHighAPI_Selection; class SketchAPI_Arc; +class SketchAPI_MacroArc; class SketchAPI_Circle; +class SketchAPI_MacroCircle; class SketchAPI_IntersectionPoint; class SketchAPI_Line; class SketchAPI_Mirror; @@ -53,18 +57,29 @@ public: SKETCHAPI_EXPORT SketchAPI_Sketch(const std::shared_ptr & theFeature, const ModelHighAPI_Selection & theExternal); + /// Constructor with values + SKETCHAPI_EXPORT + SketchAPI_Sketch(const std::shared_ptr & theFeature, + std::shared_ptr thePlaneObject); /// Destructor SKETCHAPI_EXPORT virtual ~SketchAPI_Sketch(); INTERFACE_7(SketchPlugin_Sketch::ID(), - origin, SketchPlugin_Sketch::ORIGIN_ID(), GeomDataAPI_Point, /** Origin point */, - dirX, SketchPlugin_Sketch::DIRX_ID(), GeomDataAPI_Dir, /** Direction of X */, - normal, SketchPlugin_Sketch::NORM_ID(), GeomDataAPI_Dir, /** Normal */, - features, SketchPlugin_Sketch::FEATURES_ID(), ModelAPI_AttributeRefList, /** Features */, - external, SketchPlugin_SketchEntity::EXTERNAL_ID(), ModelAPI_AttributeSelection, /** External */, - solverError, SketchPlugin_Sketch::SOLVER_ERROR(), ModelAPI_AttributeString, /** Solver error */, - solverDOF, SketchPlugin_Sketch::SOLVER_DOF(), ModelAPI_AttributeString, /** Solver DOF */ + origin, SketchPlugin_Sketch::ORIGIN_ID(), + GeomDataAPI_Point, /** Origin point */, + dirX, SketchPlugin_Sketch::DIRX_ID(), + GeomDataAPI_Dir, /** Direction of X */, + normal, SketchPlugin_Sketch::NORM_ID(), + GeomDataAPI_Dir, /** Normal */, + features, SketchPlugin_Sketch::FEATURES_ID(), + ModelAPI_AttributeRefList, /** Features */, + external, SketchPlugin_SketchEntity::EXTERNAL_ID(), + ModelAPI_AttributeSelection, /** External */, + solverError, SketchPlugin_Sketch::SOLVER_ERROR(), + ModelAPI_AttributeString, /** Solver error */, + solverDOF, SketchPlugin_Sketch::SOLVER_DOF(), + ModelAPI_AttributeString, /** Solver DOF */ ) /// Set plane @@ -75,6 +90,10 @@ public: SKETCHAPI_EXPORT void setExternal(const ModelHighAPI_Selection & theExternal); + /// Set external + SKETCHAPI_EXPORT + void setExternal(std::shared_ptr thePlaneObject); + /// Add point SKETCHAPI_EXPORT std::shared_ptr addPoint( @@ -92,10 +111,12 @@ public: /// Add intersection point SKETCHAPI_EXPORT - std::shared_ptr addIntersectionPoint(const ModelHighAPI_Selection & theExternal); + std::shared_ptr + addIntersectionPoint(const ModelHighAPI_Selection & theExternal); /// Add point SKETCHAPI_EXPORT - std::shared_ptr addIntersectionPoint(const std::string & theExternalName); + std::shared_ptr + addIntersectionPoint(const std::string & theExternalName); /// Add line SKETCHAPI_EXPORT @@ -135,13 +156,23 @@ public: double theRadius); /// Add circle SKETCHAPI_EXPORT - std::shared_ptr addCircle( + std::shared_ptr addCircle( + double theCenterX, double theCenterY, + double thePassedX, double thePassedY); + /// Add circle + SKETCHAPI_EXPORT + std::shared_ptr addCircle( + const std::shared_ptr& theCenterPoint, + const std::shared_ptr& thePassedPoint); + /// Add circle + SKETCHAPI_EXPORT + std::shared_ptr addCircle( double theX1, double theY1, double theX2, double theY2, double theX3, double theY3); /// Add circle SKETCHAPI_EXPORT - std::shared_ptr addCircle( + std::shared_ptr addCircle( const std::shared_ptr& thePoint1, const std::shared_ptr& thePoint2, const std::shared_ptr& thePoint3); @@ -170,28 +201,28 @@ public: /// Add arc SKETCHAPI_EXPORT - std::shared_ptr addArc( + std::shared_ptr addArc( double theStartX, double theStartY, double theEndX, double theEndY, double thePassedX, double thePassedY); /// Add arc SKETCHAPI_EXPORT - std::shared_ptr addArc( + std::shared_ptr addArc( const std::shared_ptr& theStart, const std::shared_ptr& theEnd, const std::shared_ptr& thePassed); /// Add arc SKETCHAPI_EXPORT - std::shared_ptr addArc( + std::shared_ptr addArc( const ModelHighAPI_RefAttr& theTangentPoint, double theEndX, double theEndY, bool theInversed); /// Add arc SKETCHAPI_EXPORT - std::shared_ptr addArc( + std::shared_ptr addArc( const ModelHighAPI_RefAttr& theTangentPoint, const std::shared_ptr& theEnd, bool theInversed); @@ -237,113 +268,131 @@ public: const ModelHighAPI_Integer & theNumberOfObjects, bool theFullValue = false); + /// Add split + SKETCHAPI_EXPORT + std::shared_ptr addSplit( + const ModelHighAPI_Reference& theFeature, + const ModelHighAPI_RefAttr& thePoint1, + const ModelHighAPI_RefAttr& thePoint2); + + /// Add trim + SKETCHAPI_EXPORT + std::shared_ptr addTrim( + const ModelHighAPI_Reference& theFeature, + const std::shared_ptr& thePositionPoint); + /// Set angle SKETCHAPI_EXPORT - std::shared_ptr setAngle( + std::shared_ptr setAngle( const ModelHighAPI_RefAttr & theLine1, const ModelHighAPI_RefAttr & theLine2, const ModelHighAPI_Double & theValue); /// Set complementary angle SKETCHAPI_EXPORT - std::shared_ptr setAngleComplementary( + std::shared_ptr setAngleComplementary( const ModelHighAPI_RefAttr & theLine1, const ModelHighAPI_RefAttr & theLine2, const ModelHighAPI_Double & theValue); /// Set backward angle (= 360 - angle) SKETCHAPI_EXPORT - std::shared_ptr setAngleBackward( + std::shared_ptr setAngleBackward( const ModelHighAPI_RefAttr & theLine1, const ModelHighAPI_RefAttr & theLine2, const ModelHighAPI_Double & theValue); /// Set coincident SKETCHAPI_EXPORT - std::shared_ptr setCoincident( + std::shared_ptr setCoincident( const ModelHighAPI_RefAttr & thePoint1, const ModelHighAPI_RefAttr & thePoint2); /// Set collinear SKETCHAPI_EXPORT - std::shared_ptr setCollinear( + std::shared_ptr setCollinear( const ModelHighAPI_RefAttr & theLine1, const ModelHighAPI_RefAttr & theLine2); /// Set distance SKETCHAPI_EXPORT - std::shared_ptr setDistance( + std::shared_ptr setDistance( const ModelHighAPI_RefAttr & thePoint, const ModelHighAPI_RefAttr & thePointOrLine, const ModelHighAPI_Double & theValue); /// Set equal SKETCHAPI_EXPORT - std::shared_ptr setEqual( + std::shared_ptr setEqual( const ModelHighAPI_RefAttr & theObject1, const ModelHighAPI_RefAttr & theObject2); /// Set fillet SKETCHAPI_EXPORT - std::shared_ptr setFillet( - const std::list & thePoints, + std::shared_ptr setFillet( + const ModelHighAPI_RefAttr & thePoint); + + /// Set fillet with additional radius constraint + SKETCHAPI_EXPORT + std::shared_ptr setFilletWithRadius( + const ModelHighAPI_RefAttr & thePoint, const ModelHighAPI_Double & theRadius); /// Set fixed SKETCHAPI_EXPORT - std::shared_ptr setFixed( + std::shared_ptr setFixed( const ModelHighAPI_RefAttr & theObject); /// Set horizontal SKETCHAPI_EXPORT - std::shared_ptr setHorizontal( + std::shared_ptr setHorizontal( const ModelHighAPI_RefAttr & theLine); /// Set length SKETCHAPI_EXPORT - std::shared_ptr setLength( + std::shared_ptr setLength( const ModelHighAPI_RefAttr & theLine, const ModelHighAPI_Double & theValue); /// Set middle SKETCHAPI_EXPORT - std::shared_ptr setMiddlePoint( + std::shared_ptr setMiddlePoint( const ModelHighAPI_RefAttr & thePoint, const ModelHighAPI_RefAttr & theLine); /// Set parallel SKETCHAPI_EXPORT - std::shared_ptr setParallel( + std::shared_ptr setParallel( const ModelHighAPI_RefAttr & theLine1, const ModelHighAPI_RefAttr & theLine2); /// Set perpendicular SKETCHAPI_EXPORT - std::shared_ptr setPerpendicular( + std::shared_ptr setPerpendicular( const ModelHighAPI_RefAttr & theLine1, const ModelHighAPI_RefAttr & theLine2); /// Set radius SKETCHAPI_EXPORT - std::shared_ptr setRadius( + std::shared_ptr setRadius( const ModelHighAPI_RefAttr & theCircleOrArc, const ModelHighAPI_Double & theValue); /// Set tangent SKETCHAPI_EXPORT - std::shared_ptr setTangent( + std::shared_ptr setTangent( const ModelHighAPI_RefAttr & theLine, const ModelHighAPI_RefAttr & theCircle); /// Set vertical SKETCHAPI_EXPORT - std::shared_ptr setVertical( + std::shared_ptr setVertical( const ModelHighAPI_RefAttr & theLine); /// Set constraint value SKETCHAPI_EXPORT void setValue( - const std::shared_ptr & theConstraint, + const std::shared_ptr & theConstraint, const ModelHighAPI_Double & theValue); // TODO(spo): rename to selectFaces() or faces() (or add faces() -> list to SWIG) @@ -384,6 +433,13 @@ SKETCHAPI_EXPORT SketchPtr addSketch(const std::shared_ptr & thePart, const std::string & theExternalName); +/**\ingroup CPPHighAPI + * \brief Create Sketch feature + */ +SKETCHAPI_EXPORT +SketchPtr addSketch(const std::shared_ptr & thePart, + std::shared_ptr thePlaneObject); + //-------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------- #endif /* SRC_SKETCHAPI_SKETCHAPI_SKETCH_H_ */