}
} else if (myMethodType == MethodType::BOX_POINTS) {
if (!myFirstPoint.get()) {
- myError = "Box builder with points :: the first point is not correct.";
+ myError = "Box builder with points :: the first point is not valid.";
return false;
}
if (!mySecondPoint.get()) {
- myError = "Box builder with points :: the second point is not correct.";
+ myError = "Box builder with points :: the second point is not valid.";
return false;
}
if (myFirstPoint->distance(mySecondPoint) < Precision::Confusion()) {
bool GeomAlgoAPI_Cylinder::check()
{
if (!myAxis) {
- myError = "Cylinder builder :: axis is invalid.";
+ myError = "Cylinder builder :: axis is not valid.";
return false;
}
if (myRadius < Precision::Confusion()) {
std::shared_ptr<GeomAPI_Pnt> theBasePoint, std::shared_ptr<GeomAPI_Edge> theEdge,
double theRadius, double theHeight) throw (GeomAlgoAPI_Exception)
{
+ // Check if the base point is OK
+ if (!theBasePoint) {
+ throw GeomAlgoAPI_Exception("Cylinder builder :: the base point is not valid.");
+ }
+ // Check if the edge is OK
+ if (!theEdge) {
+ throw GeomAlgoAPI_Exception("Cylinder builder :: the axis is not valid.");
+ }
+
std::shared_ptr<GeomAPI_Ax2> anAxis;
anAxis = std::shared_ptr<GeomAPI_Ax2>(new GeomAPI_Ax2(theBasePoint,
theEdge->line()->direction()));
switch (myMethodType) {
case BY_DISTANCE: {
if (!myAxis) {
- myError = "Translation builder :: axis is invalid.";
+ myError = "Translation builder :: axis is not valid.";
return false;
}
if (!mySourceShape) {
- myError = "Translation builder :: source shape is invalid.";
+ myError = "Translation builder :: source shape is not valid.";
return false;
}
return true;
}
case BY_DIM: {
if (!mySourceShape) {
- myError = "Translation builder :: source shape is invalid.";
+ myError = "Translation builder :: source shape is not valid.";
return false;
}
return true;
}
case BY_POINTS: {
if (!myStartPoint) {
- myError = "Translation builder :: start point is invalid.";
+ myError = "Translation builder :: start point is not valid.";
return false;
}
if (!myEndPoint) {
- myError = "Translation builder :: start point is invalid.";
+ myError = "Translation builder :: start point is not valid.";
return false;
}
if (!mySourceShape) {
aShape->setImpl(new TopoDS_Shape(aResult));
setShape(aShape);
setDone(true);
-}
\ No newline at end of file
+}
assert(ec.what() == "Box builder with points :: the points belong both to one of the OXY, OYZ or OZX planes.")
try :
- Box_13 = shaperpy.makeBox(pnt2,None)
+ Box_13 = shaperpy.makeBox(None, pnt2)
except myExcept,ec:
- assert(ec.what() == "Box builder with points :: the second point is not correct.")
+ assert(ec.what() == "Box builder with points :: the first point is not valid.")
try :
- Box_14 = shaperpy.makeBox(None,pnt2)
+ Box_14 = shaperpy.makeBox(pnt2, None)
except myExcept,ec:
- assert(ec.what() == "Box builder with points :: the first point is not correct.")
+ assert(ec.what() == "Box builder with points :: the second point is not valid.")