HLSF full functionally available. Working on Matrix.

Signed-off-by: Youmu Liu <105042599+Nitload-NSI@users.noreply.github.com>
This commit is contained in:
Youmu Liu
2025-08-25 22:13:45 +08:00
parent fe097fd94c
commit e5e4b1dd36
1479 changed files with 2083 additions and 619964 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;
}
}