-
- static Handle_Standard_Type aType1 = STANDARD_TYPE(TFunction_Driver);
- if ( aType1.IsNull()) aType1 = STANDARD_TYPE(TFunction_Driver);
- static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared);
- if ( aType2.IsNull()) aType2 = STANDARD_TYPE(MMgt_TShared);
- static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient);
- if ( aType3.IsNull()) aType3 = STANDARD_TYPE(Standard_Transient);
-
-
- static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
- static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_SplineDriver",
- sizeof(GEOMImpl_SplineDriver),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
-
- return _aType;
-}
-
-//=======================================================================
-//function : DownCast
-//purpose :
-//=======================================================================
-const Handle(GEOMImpl_SplineDriver) Handle(GEOMImpl_SplineDriver)::DownCast(const Handle(Standard_Transient)& AnObject)
-{
- Handle(GEOMImpl_SplineDriver) _anOtherObject;
-
- if (!AnObject.IsNull()) {
- if (AnObject->IsKind(STANDARD_TYPE(GEOMImpl_SplineDriver))) {
- _anOtherObject = Handle(GEOMImpl_SplineDriver)((Handle(GEOMImpl_SplineDriver)&)AnObject);
- }
+ if (Label().IsNull()) return 0;
+ Handle(GEOM_Function) function = GEOM_Function::GetFunction(Label());
+
+ GEOMImpl_ISpline aCI( function );
+ GEOMImpl_ICurveParametric aPI( function );
+ Standard_Integer aType = function->GetType();
+
+ theOperationName = "CURVE";
+
+ switch ( aType ) {
+ case SPLINE_BEZIER:
+ case SPLINE_INTERPOLATION:
+ case SPLINE_INTERPOL_TANGENTS:
+
+ AddParam( theParams, "Type", ( aType == SPLINE_BEZIER ? "Bezier" : "Interpolation"));
+
+ if ( aPI.HasData() )
+ {
+ AddParam( theParams, "X(t) equation", aPI.GetExprX() );
+ AddParam( theParams, "Y(t) equation", aPI.GetExprY() );
+ AddParam( theParams, "Z(t) equation", aPI.GetExprZ() );
+ AddParam( theParams, "Min t", aPI.GetParamMin() );
+ AddParam( theParams, "Max t", aPI.GetParamMax() );
+ if ( aPI.GetParamNbStep() )
+ AddParam( theParams, "Number of steps", aPI.GetParamNbStep() );
+ else
+ AddParam( theParams, "t step", aPI.GetParamStep() );
+ }
+ else
+ {
+ if ( aCI.GetConstructorType() == COORD_CONSTRUCTOR )
+ {
+ Handle(TColStd_HArray1OfReal) coords = aCI.GetCoordinates();
+ GEOM_Param& pntParam = AddParam( theParams, "Points");
+ pntParam << ( coords->Length() ) / 3 << " points: ";
+ for ( int i = coords->Lower(), nb = coords->Upper(); i <= nb; )
+ pntParam << "( " << coords->Value( i++ )
+ << ", " << coords->Value( i++ )
+ << ", " << coords->Value( i++ ) << " ) ";
+ }
+ else
+ {
+ AddParam( theParams, "Points", aCI.GetPoints() );
+ }
+ Handle(GEOM_Function) v1 = aCI.GetFirstVector();
+ Handle(GEOM_Function) v2 = aCI.GetLastVector();
+ if ( !v1.IsNull() ) AddParam( theParams, "First tangent vector", v1 );
+ if ( !v2.IsNull() ) AddParam( theParams, "Last tangent vector", v2 );
+ }
+ break;
+ default:
+ return false;