+ Attribute to get continuity of curve

This commit is contained in:
wmayer 2013-10-24 18:11:24 +02:00
parent d22772d5fd
commit 34d1e45f35
2 changed files with 43 additions and 0 deletions

View File

@ -66,6 +66,14 @@ of the nearest orthogonal projection of the point.</UserDocu>
</UserDocu> </UserDocu>
</Documentation> </Documentation>
</Methode> </Methode>
<Attribute Name="Continuity" ReadOnly="true">
<Documentation>
<UserDocu>
Returns the global continuity of the curve.
</UserDocu>
</Documentation>
<Parameter Name="Continuity" Type="String"/>
</Attribute>
<Attribute Name="FirstParameter" ReadOnly="true"> <Attribute Name="FirstParameter" ReadOnly="true">
<Documentation> <Documentation>
<UserDocu> <UserDocu>

View File

@ -367,6 +367,41 @@ PyObject* GeometryCurvePy::toBSpline(PyObject * args)
return 0; return 0;
} }
Py::String GeometryCurvePy::getContinuity(void) const
{
GeomAbs_Shape c = Handle_Geom_Curve::DownCast
(getGeometryPtr()->handle())->Continuity();
std::string str;
switch (c) {
case GeomAbs_C0:
str = "C0";
break;
break;
case GeomAbs_G1:
str = "G1";
break;
case GeomAbs_C1:
str = "C1";
break;
case GeomAbs_G2:
str = "G2";
break;
case GeomAbs_C2:
str = "C2";
break;
case GeomAbs_C3:
str = "C3";
break;
case GeomAbs_CN:
str = "CN";
break;
default:
str = "Unknown";
break;
}
return Py::String(str);
}
Py::Float GeometryCurvePy::getFirstParameter(void) const Py::Float GeometryCurvePy::getFirstParameter(void) const
{ {
return Py::Float(Handle_Geom_Curve::DownCast return Py::Float(Handle_Geom_Curve::DownCast