SketchAPI_Sketch.h
SketchAPI_SketchEntity.h
SketchAPI_Point.h
+ SketchAPI_Projection.h
SketchAPI_Rotation.h
SketchAPI_Translation.h
)
SketchAPI_Sketch.cpp
SketchAPI_SketchEntity.cpp
SketchAPI_Point.cpp
+ SketchAPI_Projection.cpp
SketchAPI_Rotation.cpp
SketchAPI_Translation.cpp
)
%shared_ptr(SketchAPI_Sketch)
%shared_ptr(SketchAPI_SketchEntity)
%shared_ptr(SketchAPI_Point)
+%shared_ptr(SketchAPI_Projection)
%shared_ptr(SketchAPI_Rotation)
%shared_ptr(SketchAPI_Translation)
%include "SketchAPI_Line.h"
%include "SketchAPI_Circle.h"
%include "SketchAPI_Arc.h"
+%include "SketchAPI_Projection.h"
%include "SketchAPI_Mirror.h"
%include "SketchAPI_Translation.h"
%include "SketchAPI_Rotation.h"
--- /dev/null
+// Name : SketchAPI_Projection.cpp
+// Purpose:
+//
+// History:
+// 16/06/16 - Sergey POKHODENKO - Creation of the file
+
+//--------------------------------------------------------------------------------------
+#include "SketchAPI_Projection.h"
+//--------------------------------------------------------------------------------------
+#include <ModelHighAPI_Tools.h>
+//--------------------------------------------------------------------------------------
+SketchAPI_Projection::SketchAPI_Projection(
+ const std::shared_ptr<ModelAPI_Feature> & theFeature)
+: SketchAPI_SketchEntity(theFeature)
+{
+ initialize();
+}
+
+SketchAPI_Projection::SketchAPI_Projection(
+ const std::shared_ptr<ModelAPI_Feature> & theFeature,
+ const ModelHighAPI_Selection & theExternalFeature )
+: SketchAPI_SketchEntity(theFeature)
+{
+ if (initialize()) {
+ setExternalFeature(theExternalFeature);
+ }
+}
+
+SketchAPI_Projection::~SketchAPI_Projection()
+{
+
+}
+
+//--------------------------------------------------------------------------------------
+void SketchAPI_Projection::setExternalFeature(const ModelHighAPI_Selection & theExternalFeature)
+{
+ fillAttribute(theExternalFeature, externalFeature());
+
+ execute();
+}
+
+//--------------------------------------------------------------------------------------
--- /dev/null
+// Name : SketchAPI_Projection.h
+// Purpose:
+//
+// History:
+// 16/06/16 - Sergey POKHODENKO - Creation of the file
+
+#ifndef SRC_SKETCHAPI_SKETCHAPI_PROJECTION_H_
+#define SRC_SKETCHAPI_SKETCHAPI_PROJECTION_H_
+
+//--------------------------------------------------------------------------------------
+#include "SketchAPI.h"
+
+#include <SketchPlugin_Projection.h>
+
+#include "SketchAPI_SketchEntity.h"
+//--------------------------------------------------------------------------------------
+class ModelHighAPI_Selection;
+//--------------------------------------------------------------------------------------
+/**\class SketchAPI_Projection
+ * \ingroup CPPHighAPI
+ * \brief Interface for Projection feature
+ */
+class SketchAPI_Projection : public SketchAPI_SketchEntity
+{
+public:
+ /// Constructor without values
+ SKETCHAPI_EXPORT
+ explicit SketchAPI_Projection(const std::shared_ptr<ModelAPI_Feature> & theFeature);
+ /// Constructor with values
+ SKETCHAPI_EXPORT
+ SketchAPI_Projection(const std::shared_ptr<ModelAPI_Feature> & theFeature,
+ const ModelHighAPI_Selection & theExternalFeature);
+ /// Destructor
+ SKETCHAPI_EXPORT
+ virtual ~SketchAPI_Projection();
+
+ INTERFACE_3(SketchPlugin_Projection::ID(),
+ externalFeature, SketchPlugin_Projection::EXTERNAL_FEATURE_ID(), ModelAPI_AttributeSelection, /** External feature */,
+ projectedFeature, SketchPlugin_Projection::EXTERNAL_FEATURE_ID(), ModelAPI_AttributeRefAttr, /** Projected feature */,
+ external, SketchPlugin_Projection::EXTERNAL_ID(), ModelAPI_AttributeSelection, /** External */
+ )
+
+ /// Set external feature
+ SKETCHAPI_EXPORT
+ void setExternalFeature(const ModelHighAPI_Selection & theExternalLine);
+};
+
+//! Pointer on Projection object
+typedef std::shared_ptr<SketchAPI_Projection> ProjectionPtr;
+
+//--------------------------------------------------------------------------------------
+//--------------------------------------------------------------------------------------
+#endif /* SRC_SKETCHAPI_SKETCHAPI_PROJECTION_H_ */
#include "SketchAPI_Line.h"
#include "SketchAPI_Mirror.h"
#include "SketchAPI_Point.h"
+#include "SketchAPI_Projection.h"
#include "SketchAPI_Rotation.h"
#include "SketchAPI_Translation.h"
//--------------------------------------------------------------------------------------
return ArcPtr(new SketchAPI_Arc(aFeature, theExternalName));
}
+//--------------------------------------------------------------------------------------
+std::shared_ptr<SketchAPI_Projection> SketchAPI_Sketch::addProjection(
+ const ModelHighAPI_Selection & theExternalFeature)
+{
+ std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_Projection::ID());
+ return ProjectionPtr(new SketchAPI_Projection(aFeature, theExternalFeature));
+}
+
//--------------------------------------------------------------------------------------
std::shared_ptr<SketchAPI_Mirror> SketchAPI_Sketch::addMirror(
const ModelHighAPI_RefAttr & theMirrorLine,
class SketchAPI_Line;
class SketchAPI_Mirror;
class SketchAPI_Point;
+class SketchAPI_Projection;
class SketchAPI_Rotation;
class SketchAPI_Translation;
//--------------------------------------------------------------------------------------
SKETCHAPI_EXPORT
std::shared_ptr<SketchAPI_Arc> addArc(const std::string & theExternalName);
+ /// Add projection
+ SKETCHAPI_EXPORT
+ std::shared_ptr<SketchAPI_Projection> addProjection(
+ const ModelHighAPI_Selection & theExternalFeature);
+
/// Add mirror
SKETCHAPI_EXPORT
std::shared_ptr<SketchAPI_Mirror> addMirror(
#include "SketchAPI_Sketch.h"
#include "SketchAPI_SketchEntity.h"
#include "SketchAPI_Point.h"
+ #include "SketchAPI_Projection.h"
#include "SketchAPI_Rotation.h"
#include "SketchAPI_Translation.h"