Merge from branch giga

This commit is contained in:
Nitload
2025-08-31 10:42:51 +08:00
parent 1fc687f7d0
commit 1a0ccdd8cb
1619 changed files with 2812 additions and 733136 deletions
+18 -19
View File
@@ -28,23 +28,24 @@
//
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
using StgSharp.Model.Step;
using StgSharp.Script;
using StgSharp.Script.Express;
using System;
using System.Collections.Generic;
namespace StgSharp.Modeling.Items
namespace StgSharp.Model.Step
{
public class StepVector : StepGeometricRepresentationItem
public class StepVector : StepGeometricRepresentationItem, IExpConvertableFrom<StepVector>
{
private StepDirection _direction;
private StepVector() : base( string.Empty ) { }
private StepVector( StepModel model ) : base( model ) { }
public StepVector( string name, StepDirection direction, double length )
: base( name )
public StepVector( StepModel model, StepDirection direction, double length )
: base( model )
{
Direction = direction;
Length = length;
@@ -57,9 +58,7 @@ namespace StgSharp.Modeling.Items
get { return _direction; }
set
{
if( value == null ) {
throw new ArgumentNullException();
}
ArgumentNullException.ThrowIfNull( value );
_direction = value;
}
@@ -67,21 +66,21 @@ namespace StgSharp.Modeling.Items
public override StepItemType ItemType => StepItemType.Vector;
internal static StepVector CreateFromSyntaxList( StepBinder binder, ExpNode syntaxList )
public void FromInstance( StepVector entity )
{
ExpNodeNextEnumerator enumerator = new ExpNodeNextEnumerator( syntaxList );
StepVector vector = new StepVector();
enumerator.AssertEnumeratorCount( 3 );
vector.Name = enumerator.Values[ 0 ].CodeConvertTemplate;
binder.BindValue(
enumerator.Values[ 1 ], v => vector.Direction = v.AsType<StepDirection>() );
vector.Length = ( enumerator.Values[ 2 ]as ExpRealNumberNode )!.Value;
return vector;
base.FromInstance( entity );
_direction = entity.Direction;
}
internal override IEnumerable<StepRepresentationItem> GetReferencedItems()
internal static StepVector FromSyntax( StepModel binder, ExpSyntaxNode syntaxList )
{
yield return Direction;
ExpNodePresidentEnumerator enumerator = new ExpNodePresidentEnumerator( syntaxList );
StepVector vector = new StepVector( binder );
enumerator.AssertEnumeratorCount( 3 );
vector.Name = ( enumerator[ 0 ]as ExpStringNode )!.Value;
vector.Direction = binder[ enumerator[ 1 ] ] as StepDirection;
vector.Length = ( enumerator[ 2 ]as ExpRealNumberNode )!.Value;
return vector;
}
}