)
SET(SWIG_MODULE_ConstructionAPI_EXTRA_DEPS ${SWIG_MODULE_ConstructionAPI_EXTRA_DEPS}
- ${PROJECT_SOURCE_DIR}/src/ModelHighAPI/ModelHighAPI.i)
+ ${PROJECT_SOURCE_DIR}/src/ModelHighAPI/ModelHighAPI.i
+ ${PROJECT_HEADERS}
+ )
SWIG_ADD_MODULE(ConstructionAPI python ConstructionAPI.i ${PROJECT_HEADERS})
SWIG_LINK_LIBRARIES(ConstructionAPI ${SWIG_LINK_LIBRARIES})
//--------------------------------------------------------------------------------------
// TODO(spo): make add* as static functions of the class
-PointPtr addPoint(
- std::shared_ptr<ModelAPI_Document> thePart)
-{
- // TODO(spo): check that thePart is not empty
- std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature("Point");
- return PointPtr(new ConstructionAPI_Point(aFeature));
-}
-
PointPtr addPoint(
std::shared_ptr<ModelAPI_Document> thePart,
const ModelHighAPI_Double& theX,
//! Pointer on point object
typedef std::shared_ptr<ConstructionAPI_Point> PointPtr;
-PointPtr addPoint(std::shared_ptr<ModelAPI_Document> thePart);
PointPtr addPoint(std::shared_ptr<ModelAPI_Document> thePart,
const ModelHighAPI_Double & theX,
const ModelHighAPI_Double & theY,
ConstructionAPI_Point aPoint(aFeature, 10, "20", std::string("x + 30"));
}
-TEST_F(ConstructionAPI_Point_Constructor_Test, addPoint) {
- DocumentPtr aDocument(&aMockDocument, &null_deleter);
-
- EXPECT_CALL(aMockDocument, addFeature("Point", true));
-
- testInitializeFeature();
-
- PointPtr aPoint = addPoint(aDocument);
-}
-
TEST_F(ConstructionAPI_Point_Constructor_Test, addPointWithValues) {
DocumentPtr aDocument(&aMockDocument, &null_deleter);
def test_assert_error_on_empty_args(self):
features = [
- "addPoint", "addAxis", "addPlane",
+ # Implemented in C++, add* without arguments doesn't exist
+ # "addPoint",
+
+ "addAxis", "addPlane",
"addImport", "exportToFile",
"addAddition", "addSubtraction", "addIntersection",
"addExtrusion",
self.fail("%s does not check empty args" % name)
def test_initialize_without_attributes(self):
+ import ConstructionAPI
model.construction.axis.Axis(self.part.addFeature("Axis"))
model.construction.plane.Plane(self.part.addFeature("Plane"))
- model.construction.point.Point(self.part.addFeature("Point"))
+ ConstructionAPI.ConstructionAPI_Point(self.part.addFeature("Point"))
model.exchange.Import(self.part.addFeature("Import"))
model.exchange.Export(self.part.addFeature("Export"))
"""Package for Construction plugin for the Parametric Geometry API of the Modeler.
"""
-from point import addPoint
+from ConstructionAPI import addPoint
from axis import addAxis
from plane import addPlane