Sketcher: Reformat to current clang-format standard
This commit is contained in:
committed by
Chris Hennes
parent
41a1a7a8e6
commit
791fe02934
@@ -110,10 +110,12 @@ int ConstraintPy::PyInit(PyObject* args, PyObject* /*kwd*/)
|
||||
this->getConstraintPtr()->Type = InternalAlignment;
|
||||
|
||||
valid = true;
|
||||
if (strstr(ConstraintType, "EllipseMajorDiameter"))
|
||||
if (strstr(ConstraintType, "EllipseMajorDiameter")) {
|
||||
this->getConstraintPtr()->AlignmentType = EllipseMajorDiameter;
|
||||
else if (strstr(ConstraintType, "EllipseMinorDiameter"))
|
||||
}
|
||||
else if (strstr(ConstraintType, "EllipseMinorDiameter")) {
|
||||
this->getConstraintPtr()->AlignmentType = EllipseMinorDiameter;
|
||||
}
|
||||
else {
|
||||
this->getConstraintPtr()->AlignmentType = Undef;
|
||||
valid = false;
|
||||
@@ -138,8 +140,9 @@ int ConstraintPy::PyInit(PyObject* args, PyObject* /*kwd*/)
|
||||
if (PyObject_TypeCheck(index_or_value, &(Base::QuantityPy::Type))) {
|
||||
Base::Quantity q =
|
||||
*(static_cast<Base::QuantityPy*>(index_or_value)->getQuantityPtr());
|
||||
if (q.getUnit() == Base::Unit::Angle)
|
||||
if (q.getUnit() == Base::Unit::Angle) {
|
||||
Value = q.getValueAs(Base::Quantity::Radian);
|
||||
}
|
||||
}
|
||||
this->getConstraintPtr()->Type = Angle;
|
||||
valid = true;
|
||||
@@ -205,10 +208,12 @@ int ConstraintPy::PyInit(PyObject* args, PyObject* /*kwd*/)
|
||||
|
||||
valid = true;
|
||||
|
||||
if (strstr(ConstraintType, "EllipseFocus1"))
|
||||
if (strstr(ConstraintType, "EllipseFocus1")) {
|
||||
this->getConstraintPtr()->AlignmentType = EllipseFocus1;
|
||||
else if (strstr(ConstraintType, "EllipseFocus2"))
|
||||
}
|
||||
else if (strstr(ConstraintType, "EllipseFocus2")) {
|
||||
this->getConstraintPtr()->AlignmentType = EllipseFocus2;
|
||||
}
|
||||
else {
|
||||
this->getConstraintPtr()->AlignmentType = Undef;
|
||||
valid = false;
|
||||
@@ -230,8 +235,9 @@ int ConstraintPy::PyInit(PyObject* args, PyObject* /*kwd*/)
|
||||
if (PyObject_TypeCheck(index_or_value, &(Base::QuantityPy::Type))) {
|
||||
Base::Quantity q =
|
||||
*(static_cast<Base::QuantityPy*>(index_or_value)->getQuantityPtr());
|
||||
if (q.getUnit() == Base::Unit::Angle)
|
||||
if (q.getUnit() == Base::Unit::Angle) {
|
||||
Value = q.getValueAs(Base::Quantity::Radian);
|
||||
}
|
||||
}
|
||||
this->getConstraintPtr()->Type = Angle;
|
||||
this->getConstraintPtr()->First = FirstIndex;
|
||||
@@ -363,8 +369,14 @@ int ConstraintPy::PyInit(PyObject* args, PyObject* /*kwd*/)
|
||||
}
|
||||
PyErr_Clear();
|
||||
|
||||
if (PyArg_ParseTuple(
|
||||
args, "siiiiO", &ConstraintType, &intArg1, &intArg2, &intArg3, &intArg4, &oNumArg5)) {
|
||||
if (PyArg_ParseTuple(args,
|
||||
"siiiiO",
|
||||
&ConstraintType,
|
||||
&intArg1,
|
||||
&intArg2,
|
||||
&intArg3,
|
||||
&intArg4,
|
||||
&oNumArg5)) {
|
||||
// ConstraintType, GeoIndex1, PosIndex1, GeoIndex2, PosIndex2, GeoIndex3
|
||||
if (PyLong_Check(oNumArg5)) {
|
||||
intArg5 = PyLong_AsLong(oNumArg5);
|
||||
@@ -398,8 +410,9 @@ int ConstraintPy::PyInit(PyObject* args, PyObject* /*kwd*/)
|
||||
if (PyObject_TypeCheck(oNumArg5, &(Base::QuantityPy::Type))) {
|
||||
Base::Quantity q =
|
||||
*(static_cast<Base::QuantityPy*>(oNumArg5)->getQuantityPtr());
|
||||
if (q.getUnit() == Base::Unit::Angle)
|
||||
if (q.getUnit() == Base::Unit::Angle) {
|
||||
Value = q.getValueAs(Base::Quantity::Radian);
|
||||
}
|
||||
}
|
||||
this->getConstraintPtr()->Type = Angle;
|
||||
valid = true;
|
||||
@@ -408,8 +421,9 @@ int ConstraintPy::PyInit(PyObject* args, PyObject* /*kwd*/)
|
||||
if (PyObject_TypeCheck(oNumArg5, &(Base::QuantityPy::Type))) {
|
||||
Base::Quantity q =
|
||||
*(static_cast<Base::QuantityPy*>(oNumArg5)->getQuantityPtr());
|
||||
if (q.getUnit() == Base::Unit::Angle)
|
||||
if (q.getUnit() == Base::Unit::Angle) {
|
||||
Value = q.getValueAs(Base::Quantity::Radian);
|
||||
}
|
||||
}
|
||||
this->getConstraintPtr()->Type = Angle;
|
||||
// valid = true;//non-standard assignment
|
||||
@@ -525,25 +539,31 @@ std::string ConstraintPy::representation() const
|
||||
result << "'Parallel'>";
|
||||
break;
|
||||
case Tangent:
|
||||
if (this->getConstraintPtr()->Third == GeoEnum::GeoUndef)
|
||||
if (this->getConstraintPtr()->Third == GeoEnum::GeoUndef) {
|
||||
result << "'Tangent'>";
|
||||
else
|
||||
}
|
||||
else {
|
||||
result << "'TangentViaPoint'>";
|
||||
}
|
||||
break;
|
||||
case Perpendicular:
|
||||
if (this->getConstraintPtr()->Third == GeoEnum::GeoUndef)
|
||||
if (this->getConstraintPtr()->Third == GeoEnum::GeoUndef) {
|
||||
result << "'Perpendicular'>";
|
||||
else
|
||||
}
|
||||
else {
|
||||
result << "'PerpendicularViaPoint'>";
|
||||
}
|
||||
break;
|
||||
case Distance:
|
||||
result << "'Distance'>";
|
||||
break;
|
||||
case Angle:
|
||||
if (this->getConstraintPtr()->Third == GeoEnum::GeoUndef)
|
||||
if (this->getConstraintPtr()->Third == GeoEnum::GeoUndef) {
|
||||
result << "'Angle'>";
|
||||
else
|
||||
}
|
||||
else {
|
||||
result << "'AngleViaPoint'>";
|
||||
}
|
||||
break;
|
||||
case Symmetric:
|
||||
result << "'Symmetric'>";
|
||||
|
||||
Reference in New Issue
Block a user