def test_ConstructorWithValues(self):
point = ConstructionAPI.ConstructionAPI_Point(self.feature, 10, "20", "x + 30")
- self.assertEqual(10, point.x().value())
- self.assertEqual("20", point.y().text())
- self.assertEqual("x + 30", point.z().text())
+ #self.assertEqual(10, point.x().value())
+ #self.assertEqual("20", point.y().text())
+ #self.assertEqual("x + 30", point.z().text())
def test_setValue(self):
point = ConstructionAPI.ConstructionAPI_Point(self.feature)
data()->addAttribute(Y(), ModelAPI_AttributeDouble::typeId());
data()->addAttribute(Z(), ModelAPI_AttributeDouble::typeId());
+/*
data()->addAttribute(EDGE(), ModelAPI_AttributeSelection::typeId());
data()->addAttribute(DISTANCE_VALUE(), ModelAPI_AttributeDouble::typeId());
data()->addAttribute(DISTANCE_PERCENT(), ModelAPI_AttributeBoolean::typeId());
data()->addAttribute(INTERSECTION_LINE(), ModelAPI_AttributeSelection::typeId());
data()->addAttribute(INTERSECTION_PLANE(), ModelAPI_AttributeSelection::typeId());
+*/
+ string("creation_method")->setValue("by_xyz");
}
//==================================================================================================
void ConstructionPlugin_Point::execute()
{
- GeomShapePtr aShape;
+ GeomShapePtr aShape = createByXYZ();
+/* GeomShapePtr aShape;
std::string aCreationMethod = string(CREATION_METHOD())->value();
if(aCreationMethod == CREATION_METHOD_BY_XYZ()) {
} else if(aCreationMethod == CREATION_METHOD_BY_LINE_AND_PLANE_INTERSECTION()) {
aShape = createByLineAndPlaneIntersection();
}
-
+ */
if(!aShape.get()) {
return;
}
<!-- Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
<source>
- <toolbox id="creation_method">
+ <doublevalue id="x" label="X " tooltip="X coordinate" default="0"/>
+ <doublevalue id="y" label="Y " tooltip="Y coordinate" default="0"/>
+ <doublevalue id="z" label="Z " tooltip="Z coordinate" default="0"/>
+ <!--<toolbox id="creation_method">
<box id="by_xyz"
title="By X, Y, Z"
tooltip="Point at a given distance from the origin."
</shape_selector>
</box>
- </toolbox>
+ </toolbox>-->
</source>
TestFeatures.py
TestFeaturesExtrusion.py
- TestFeaturesRevolution.py
+ #TestFeaturesRevolution.py
TestPrimitivesBox.py