SketchAPI_Sketch.h
SketchAPI_SketchEntity.h
SketchAPI_Point.h
+ SketchAPI_Translation.h
)
SET(PROJECT_SOURCES
SketchAPI_Sketch.cpp
SketchAPI_SketchEntity.cpp
SketchAPI_Point.cpp
+ SketchAPI_Translation.cpp
)
SET(PROJECT_LIBRARIES
%shared_ptr(SketchAPI_Sketch)
%shared_ptr(SketchAPI_SketchEntity)
%shared_ptr(SketchAPI_Point)
+%shared_ptr(SketchAPI_Translation)
// TODO(spo): move typemaps into ModelHighAPI package
%include "SketchAPI_Circle.h"
%include "SketchAPI_Arc.h"
%include "SketchAPI_Mirror.h"
+%include "SketchAPI_Translation.h"
%include "SketchAPI_Sketch.h"
INTERFACE_4(SketchPlugin_ConstraintMirror::ID(),
mirrorLine, SketchPlugin_ConstraintMirror::ENTITY_A(), ModelAPI_AttributeRefAttr, /** Mirror line */,
mirrorList, SketchPlugin_ConstraintMirror::MIRROR_LIST_ID(), ModelAPI_AttributeRefList, /** Mirror list */,
- sourceObjects, SketchPlugin_ConstraintMirror::ENTITY_B(), ModelAPI_AttributeRefList, /** Source objects */,
+ referenceObjects, SketchPlugin_ConstraintMirror::ENTITY_B(), ModelAPI_AttributeRefList, /** Reference objects */,
mirroredObjects, SketchPlugin_ConstraintMirror::ENTITY_C(), ModelAPI_AttributeRefList, /** Mirrored objects */
)
#include "SketchAPI_Line.h"
#include "SketchAPI_Mirror.h"
#include "SketchAPI_Point.h"
+#include "SketchAPI_Translation.h"
//--------------------------------------------------------------------------------------
SketchAPI_Sketch::SketchAPI_Sketch(
const std::shared_ptr<ModelAPI_Feature> & theFeature)
return MirrorPtr(new SketchAPI_Mirror(aFeature, theMirrorLine, theObjects));
}
+//--------------------------------------------------------------------------------------
+std::shared_ptr<SketchAPI_Translation> SketchAPI_Sketch::addTranslation(
+ const std::list<std::shared_ptr<ModelAPI_Object> > & theObjects,
+ const ModelHighAPI_RefAttr & thePoint1,
+ const ModelHighAPI_RefAttr & thePoint2,
+ const ModelHighAPI_Integer & theNumberOfObjects,
+ bool theFullValue)
+{
+ std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_MultiTranslation::ID());
+ return TranslationPtr(new SketchAPI_Translation(aFeature, theObjects, thePoint1, thePoint2, theNumberOfObjects, theFullValue));
+}
+
//--------------------------------------------------------------------------------------
std::shared_ptr<ModelAPI_Feature> SketchAPI_Sketch::setAngle(
const ModelHighAPI_RefAttr & theLine1,
class ModelAPI_CompositeFeature;
class ModelAPI_Object;
class ModelHighAPI_Double;
+class ModelHighAPI_Integer;
class ModelHighAPI_RefAttr;
class ModelHighAPI_Selection;
class SketchAPI_Arc;
class SketchAPI_Line;
class SketchAPI_Mirror;
class SketchAPI_Point;
+class SketchAPI_Translation;
//--------------------------------------------------------------------------------------
/**\class SketchAPI_Sketch
* \ingroup CPPHighAPI
const ModelHighAPI_RefAttr & theMirrorLine,
const std::list<std::shared_ptr<ModelAPI_Object> > & theObjects);
+ /// Add translation
+ SKETCHAPI_EXPORT
+ std::shared_ptr<SketchAPI_Translation> addTranslation(
+ const std::list<std::shared_ptr<ModelAPI_Object> > & theObjects,
+ const ModelHighAPI_RefAttr & thePoint1,
+ const ModelHighAPI_RefAttr & thePoint2,
+ const ModelHighAPI_Integer & theNumberOfObjects,
+ bool theFullValue = false);
+
/// Set angle
SKETCHAPI_EXPORT
std::shared_ptr<ModelAPI_Feature> setAngle(
--- /dev/null
+// Name : SketchAPI_Translation.cpp
+// Purpose:
+//
+// History:
+// 16/06/16 - Sergey POKHODENKO - Creation of the file
+
+//--------------------------------------------------------------------------------------
+#include "SketchAPI_Translation.h"
+//--------------------------------------------------------------------------------------
+#include <ModelHighAPI_Tools.h>
+//--------------------------------------------------------------------------------------
+SketchAPI_Translation::SketchAPI_Translation(
+ const std::shared_ptr<ModelAPI_Feature> & theFeature)
+: SketchAPI_SketchEntity(theFeature)
+{
+ initialize();
+}
+
+SketchAPI_Translation::SketchAPI_Translation(
+ const std::shared_ptr<ModelAPI_Feature> & theFeature,
+ const std::list<std::shared_ptr<ModelAPI_Object> > & theObjects,
+ const ModelHighAPI_RefAttr & thePoint1,
+ const ModelHighAPI_RefAttr & thePoint2,
+ const ModelHighAPI_Integer & theNumberOfObjects,
+ bool theFullValue)
+: SketchAPI_SketchEntity(theFeature)
+{
+ if (initialize()) {
+ fillAttribute(theObjects, translationList());
+ fillAttribute(thePoint1, startPoint());
+ fillAttribute(thePoint2, endPoint());
+ fillAttribute(theNumberOfObjects, numberOfObjects());
+ if (theFullValue)
+ fillAttribute("SingleValue", valueType());
+
+ execute();
+ }
+}
+
+SketchAPI_Translation::~SketchAPI_Translation()
+{
+
+}
+
+//--------------------------------------------------------------------------------------
--- /dev/null
+// Name : SketchAPI_Translation.h
+// Purpose:
+//
+// History:
+// 16/06/16 - Sergey POKHODENKO - Creation of the file
+
+#ifndef SRC_SKETCHAPI_SKETCHAPI_TRANSLATION_H_
+#define SRC_SKETCHAPI_SKETCHAPI_TRANSLATION_H_
+
+//--------------------------------------------------------------------------------------
+#include "SketchAPI.h"
+
+#include <list>
+
+#include <SketchPlugin_MultiTranslation.h>
+
+#include "SketchAPI_SketchEntity.h"
+//--------------------------------------------------------------------------------------
+class ModelAPI_Object;
+class ModelHighAPI_Integer;
+class ModelHighAPI_RefAttr;
+//--------------------------------------------------------------------------------------
+/**\class SketchAPI_Translation
+ * \ingroup CPPHighAPI
+ * \brief Interface for Translation feature
+ */
+class SketchAPI_Translation : public SketchAPI_SketchEntity
+{
+public:
+ /// Constructor without values
+ SKETCHAPI_EXPORT
+ explicit SketchAPI_Translation(const std::shared_ptr<ModelAPI_Feature> & theFeature);
+ /// Constructor with values
+ SKETCHAPI_EXPORT
+ SketchAPI_Translation(const std::shared_ptr<ModelAPI_Feature> & theFeature,
+ const std::list<std::shared_ptr<ModelAPI_Object> > & theObjects,
+ const ModelHighAPI_RefAttr & thePoint1,
+ const ModelHighAPI_RefAttr & thePoint2,
+ const ModelHighAPI_Integer & theNumberOfObjects,
+ bool theFullValue = false);
+ /// Destructor
+ SKETCHAPI_EXPORT
+ virtual ~SketchAPI_Translation();
+
+ INTERFACE_7(SketchPlugin_MultiTranslation::ID(),
+ translationList, SketchPlugin_MultiTranslation::TRANSLATION_LIST_ID(), ModelAPI_AttributeRefList, /** Translation list */,
+ startPoint, SketchPlugin_MultiTranslation::START_POINT_ID(), ModelAPI_AttributeRefAttr, /** Start point */,
+ endPoint, SketchPlugin_MultiTranslation::END_POINT_ID(), ModelAPI_AttributeRefAttr, /** Start point */,
+ numberOfObjects, SketchPlugin_MultiTranslation::NUMBER_OF_OBJECTS_ID(), ModelAPI_AttributeInteger, /** Number of objects */,
+ valueType, SketchPlugin_MultiTranslation::VALUE_TYPE(), ModelAPI_AttributeString, /** Value type */,
+ referenceObjects, SketchPlugin_MultiTranslation::ENTITY_A(), ModelAPI_AttributeRefList, /** Reference objects */,
+ translatedObjects, SketchPlugin_MultiTranslation::ENTITY_B(), ModelAPI_AttributeRefList, /** Translationed objects */
+ )
+
+};
+
+//! Pointer on Translation object
+typedef std::shared_ptr<SketchAPI_Translation> TranslationPtr;
+
+//--------------------------------------------------------------------------------------
+//--------------------------------------------------------------------------------------
+#endif /* SRC_SKETCHAPI_SKETCHAPI_TRANSLATION_H_ */
#include "SketchAPI_Sketch.h"
#include "SketchAPI_SketchEntity.h"
#include "SketchAPI_Point.h"
+ #include "SketchAPI_Translation.h"
#endif /* SRC_SKETCHAPI_SKETCHAPI_SWIG_H_ */