old data
This commit is contained in:
@@ -28,45 +28,45 @@
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Model.Step;
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
namespace StgSharp.Modeling.Items
|
||||
{
|
||||
public class StepEllipse : StepConic, IExpConvertableFrom<StepEllipse>
|
||||
public class StepEllipse : StepConic
|
||||
{
|
||||
|
||||
private StepAxis2Placement _position;
|
||||
|
||||
private StepEllipse( StepModel model ) : base( model ) { }
|
||||
private StepEllipse() : base( string.Empty ) { }
|
||||
|
||||
public StepEllipse(
|
||||
StepModel model,
|
||||
string name,
|
||||
StepAxis2Placement position,
|
||||
float semiAxis1,
|
||||
float semiAxis2 )
|
||||
: base( model )
|
||||
double semiAxis1,
|
||||
double semiAxis2 )
|
||||
: base( name )
|
||||
{
|
||||
Position = position;
|
||||
SemiAxis1 = semiAxis1;
|
||||
SemiAxis2 = semiAxis2;
|
||||
}
|
||||
|
||||
public float SemiAxis1 { get; set; }
|
||||
public double SemiAxis1 { get; set; }
|
||||
|
||||
public float SemiAxis2 { get; set; }
|
||||
public double SemiAxis2 { get; set; }
|
||||
|
||||
public StepAxis2Placement Position
|
||||
{
|
||||
get { return _position; }
|
||||
set
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull( value );
|
||||
if( value == null ) {
|
||||
throw new ArgumentNullException();
|
||||
}
|
||||
|
||||
_position = value;
|
||||
}
|
||||
@@ -74,23 +74,22 @@ namespace StgSharp.Model.Step
|
||||
|
||||
public override StepItemType ItemType => StepItemType.Ellipse;
|
||||
|
||||
public void FromInstance( StepEllipse entity )
|
||||
internal static StepEllipse CreateFromSyntaxList( StepBinder binder, ExpNode syntaxList )
|
||||
{
|
||||
base.FromInstance( entity );
|
||||
SemiAxis1 = entity.SemiAxis1;
|
||||
SemiAxis2 = entity.SemiAxis2;
|
||||
ExpNodeNextEnumerator enumerator = new ExpNodeNextEnumerator( syntaxList );
|
||||
StepEllipse ellipse = new StepEllipse();
|
||||
enumerator.AssertEnumeratorCount( 4 );
|
||||
ellipse.Name = enumerator.Values[ 0 ].CodeConvertTemplate;
|
||||
binder.BindValue(
|
||||
enumerator.Values[ 1 ], v => ellipse.Position = v.AsType<StepAxis2Placement>() );
|
||||
ellipse.SemiAxis1 = ( enumerator.Values[ 2 ] as ExpRealNumberNode )!.Value;
|
||||
ellipse.SemiAxis2 = ( enumerator.Values[ 3 ] as ExpRealNumberNode )!.Value;
|
||||
return ellipse;
|
||||
}
|
||||
|
||||
internal static StepEllipse FromSyntax( StepModel binder, ExpSyntaxNode syntaxList )
|
||||
internal override IEnumerable<StepRepresentationItem> GetReferencedItems()
|
||||
{
|
||||
ExpNodePresidentEnumerator enumerator = new ExpNodePresidentEnumerator( syntaxList );
|
||||
StepEllipse ellipse = new StepEllipse( binder );
|
||||
enumerator.AssertEnumeratorCount( 4 );
|
||||
ellipse.Name = ( enumerator[ 0 ]as ExpStringNode )!.Value;
|
||||
ellipse.Position = binder[ ( enumerator[ 1 ] as StepEntityInstanceNode )!.Id ]as StepAxis2Placement2D;
|
||||
ellipse.SemiAxis1 = ( enumerator[ 2 ] as ExpRealNumberNode )!.Value;
|
||||
ellipse.SemiAxis2 = ( enumerator[ 3 ] as ExpRealNumberNode )!.Value;
|
||||
return ellipse;
|
||||
yield return Position;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user