SketchAPI_Sketch.h
SketchAPI_SketchEntity.h
SketchAPI_Point.h
+ SketchAPI_Rotation.h
SketchAPI_Translation.h
)
SketchAPI_Sketch.cpp
SketchAPI_SketchEntity.cpp
SketchAPI_Point.cpp
+ SketchAPI_Rotation.cpp
SketchAPI_Translation.cpp
)
%shared_ptr(SketchAPI_Sketch)
%shared_ptr(SketchAPI_SketchEntity)
%shared_ptr(SketchAPI_Point)
+%shared_ptr(SketchAPI_Rotation)
%shared_ptr(SketchAPI_Translation)
// TODO(spo): move typemaps into ModelHighAPI package
%include "SketchAPI_Arc.h"
%include "SketchAPI_Mirror.h"
%include "SketchAPI_Translation.h"
+%include "SketchAPI_Rotation.h"
%include "SketchAPI_Sketch.h"
--- /dev/null
+// Name : SketchAPI_Rotation.cpp
+// Purpose:
+//
+// History:
+// 16/06/16 - Sergey POKHODENKO - Creation of the file
+
+//--------------------------------------------------------------------------------------
+#include "SketchAPI_Rotation.h"
+//--------------------------------------------------------------------------------------
+#include <ModelHighAPI_Tools.h>
+//--------------------------------------------------------------------------------------
+SketchAPI_Rotation::SketchAPI_Rotation(
+ const std::shared_ptr<ModelAPI_Feature> & theFeature)
+: SketchAPI_SketchEntity(theFeature)
+{
+ initialize();
+}
+
+SketchAPI_Rotation::SketchAPI_Rotation(
+ const std::shared_ptr<ModelAPI_Feature> & theFeature,
+ const std::list<std::shared_ptr<ModelAPI_Object> > & theObjects,
+ const ModelHighAPI_RefAttr & theCenter,
+ const ModelHighAPI_Double & theAngle,
+ const ModelHighAPI_Integer & theNumberOfObjects,
+ bool theFullValue)
+: SketchAPI_SketchEntity(theFeature)
+{
+ if (initialize()) {
+ fillAttribute(theObjects, rotationList());
+ fillAttribute(theCenter, center());
+ fillAttribute(theAngle, angle());
+ fillAttribute(theNumberOfObjects, numberOfObjects());
+ if (theFullValue)
+ fillAttribute("SingleAngle", valueType());
+
+ execute();
+ }
+}
+
+SketchAPI_Rotation::~SketchAPI_Rotation()
+{
+
+}
+
+//--------------------------------------------------------------------------------------
--- /dev/null
+// Name : SketchAPI_Rotation.h
+// Purpose:
+//
+// History:
+// 16/06/16 - Sergey POKHODENKO - Creation of the file
+
+#ifndef SRC_SKETCHAPI_SKETCHAPI_ROTATION_H_
+#define SRC_SKETCHAPI_SKETCHAPI_ROTATION_H_
+
+//--------------------------------------------------------------------------------------
+#include "SketchAPI.h"
+
+#include <list>
+
+#include <SketchPlugin_MultiRotation.h>
+
+#include "SketchAPI_SketchEntity.h"
+//--------------------------------------------------------------------------------------
+class ModelAPI_Object;
+class ModelHighAPI_Double;
+class ModelHighAPI_Integer;
+class ModelHighAPI_RefAttr;
+//--------------------------------------------------------------------------------------
+/**\class SketchAPI_Rotation
+ * \ingroup CPPHighAPI
+ * \brief Interface for Rotation feature
+ */
+class SketchAPI_Rotation : public SketchAPI_SketchEntity
+{
+public:
+ /// Constructor without values
+ SKETCHAPI_EXPORT
+ explicit SketchAPI_Rotation(const std::shared_ptr<ModelAPI_Feature> & theFeature);
+ /// Constructor with values
+ SKETCHAPI_EXPORT
+ SketchAPI_Rotation(const std::shared_ptr<ModelAPI_Feature> & theFeature,
+ const std::list<std::shared_ptr<ModelAPI_Object> > & theObjects,
+ const ModelHighAPI_RefAttr & theCenter,
+ const ModelHighAPI_Double & theAngle,
+ const ModelHighAPI_Integer & theNumberOfObjects,
+ bool theFullValue = false);
+ /// Destructor
+ SKETCHAPI_EXPORT
+ virtual ~SketchAPI_Rotation();
+
+ INTERFACE_7(SketchPlugin_MultiRotation::ID(),
+ rotationList, SketchPlugin_MultiRotation::ROTATION_LIST_ID(), ModelAPI_AttributeRefList, /** Rotation list */,
+ center, SketchPlugin_MultiRotation::CENTER_ID(), ModelAPI_AttributeRefAttr, /** Center */,
+ angle, SketchPlugin_MultiRotation::ANGLE_ID(), ModelAPI_AttributeDouble, /** Angle */,
+ numberOfObjects, SketchPlugin_MultiRotation::NUMBER_OF_OBJECTS_ID(), ModelAPI_AttributeInteger, /** Number of objects */,
+ valueType, SketchPlugin_MultiRotation::ANGLE_TYPE(), ModelAPI_AttributeString, /** Value type */,
+ referenceObjects, SketchPlugin_MultiRotation::ENTITY_A(), ModelAPI_AttributeRefList, /** Reference objects */,
+ rotatedObjects, SketchPlugin_MultiRotation::ENTITY_B(), ModelAPI_AttributeRefList, /** Rotated objects */
+ )
+
+};
+
+//! Pointer on Rotation object
+typedef std::shared_ptr<SketchAPI_Rotation> RotationPtr;
+
+//--------------------------------------------------------------------------------------
+//--------------------------------------------------------------------------------------
+#endif /* SRC_SKETCHAPI_SKETCHAPI_ROTATION_H_ */
#include "SketchAPI_Line.h"
#include "SketchAPI_Mirror.h"
#include "SketchAPI_Point.h"
+#include "SketchAPI_Rotation.h"
#include "SketchAPI_Translation.h"
//--------------------------------------------------------------------------------------
SketchAPI_Sketch::SketchAPI_Sketch(
return TranslationPtr(new SketchAPI_Translation(aFeature, theObjects, thePoint1, thePoint2, theNumberOfObjects, theFullValue));
}
+//--------------------------------------------------------------------------------------
+std::shared_ptr<SketchAPI_Rotation> SketchAPI_Sketch::addRotation(
+ const std::list<std::shared_ptr<ModelAPI_Object> > & theObjects,
+ const ModelHighAPI_RefAttr & theCenter,
+ const ModelHighAPI_Double & theAngle,
+ const ModelHighAPI_Integer & theNumberOfObjects,
+ bool theFullValue)
+{
+ std::shared_ptr<ModelAPI_Feature> aFeature = compositeFeature()->addFeature(SketchPlugin_MultiRotation::ID());
+ return RotationPtr(new SketchAPI_Rotation(aFeature, theObjects, theCenter, theAngle, theNumberOfObjects, theFullValue));
+}
+
//--------------------------------------------------------------------------------------
std::shared_ptr<ModelAPI_Feature> SketchAPI_Sketch::setAngle(
const ModelHighAPI_RefAttr & theLine1,
class SketchAPI_Line;
class SketchAPI_Mirror;
class SketchAPI_Point;
+class SketchAPI_Rotation;
class SketchAPI_Translation;
//--------------------------------------------------------------------------------------
/**\class SketchAPI_Sketch
const ModelHighAPI_Integer & theNumberOfObjects,
bool theFullValue = false);
+ /// Add rotation
+ SKETCHAPI_EXPORT
+ std::shared_ptr<SketchAPI_Rotation> addRotation(
+ const std::list<std::shared_ptr<ModelAPI_Object> > & theObjects,
+ const ModelHighAPI_RefAttr & theCenter,
+ const ModelHighAPI_Double & theAngle,
+ const ModelHighAPI_Integer & theNumberOfObjects,
+ bool theFullValue = false);
+
/// Set angle
SKETCHAPI_EXPORT
std::shared_ptr<ModelAPI_Feature> setAngle(
std::shared_ptr<ModelAPI_Feature> setVertical(
const ModelHighAPI_RefAttr & theLine);
- // TODO(spo): addRectagle, projection, Translation, Rotation
+ // TODO(spo): addRectagle, projection
/// Set constraint value
SKETCHAPI_EXPORT
#include "SketchAPI_Sketch.h"
#include "SketchAPI_SketchEntity.h"
#include "SketchAPI_Point.h"
+ #include "SketchAPI_Rotation.h"
#include "SketchAPI_Translation.h"
#endif /* SRC_SKETCHAPI_SKETCHAPI_SWIG_H_ */