add from giga-device, new branch added
This commit is contained in:
@@ -0,0 +1,306 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="ExpSyntaxAnalyzer.Common.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the “Software”), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED “AS IS”,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml.Schema;
|
||||
|
||||
using ExpKeyword = StgSharp.Script.Express.ExpressCompile.Keyword;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
internal partial class StepExpSyntaxAnalyzer
|
||||
{
|
||||
|
||||
private static Regex _entityTypeCheckPattern = GetEntityTypeCheckPattern();
|
||||
|
||||
private StepDependencyDetector _dependencyDetector = new StepDependencyDetector();
|
||||
|
||||
[GeneratedRegex( @"^[A-Z0-9_]+$", RegexOptions.Singleline )]
|
||||
private static partial Regex GetEntityTypeCheckPattern();
|
||||
|
||||
private bool IsSeparatorMatch( Token leftSeparator, Token rightSeparator )
|
||||
{
|
||||
return leftSeparator.Value switch
|
||||
{
|
||||
ExpKeyword.LeftBrace => rightSeparator.Value == ExpKeyword.RightBrace,
|
||||
ExpKeyword.LeftParen => rightSeparator.Value == ExpKeyword.RightParen,
|
||||
ExpKeyword.Comma => rightSeparator.Value == ExpKeyword.Comma,
|
||||
ExpKeyword.Semicolon => rightSeparator.Value == ExpKeyword.Semicolon,
|
||||
_ => false
|
||||
};
|
||||
}
|
||||
|
||||
private bool TryAppendIndexLeft( Token t )
|
||||
{
|
||||
if( t.Flag != TokenFlag.Index_Left ) {
|
||||
return false;
|
||||
}
|
||||
if( _cache.TryPeekOperand( out bool isNode, out _, out ExpSyntaxNode? node ) )
|
||||
{
|
||||
if( node.EqualityTypeConvert is not ExpCollectionBase ) {
|
||||
ExpInvalidSyntaxException.ThrowNonCollectionIndex( t );
|
||||
}
|
||||
}
|
||||
_cache.PushOperator( t );
|
||||
_cache.IncreaseDepth( ( int )ExpCompileStateCode.CollectionIndex );
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool TryAppendIndexRight( Token t )
|
||||
{
|
||||
if( t.Flag != TokenFlag.Index_Right ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
//reverse building
|
||||
ClosePrefixReverse( t );
|
||||
|
||||
//make index node
|
||||
_cache.PopOperand( out _, out ExpSyntaxNode? expNode );
|
||||
if( !_cache.PopOperand( out Token colleToken, out ExpSyntaxNode? colleNode ) ) { }
|
||||
_cache.PushOperand(
|
||||
ExpCollectionIndexNode.Create(
|
||||
t, ( colleNode as ExpCollectionInstanceBase )!, expNode ) );
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool TryAppendMember( Token t )
|
||||
{
|
||||
if( t.Flag != TokenFlag.Member ) {
|
||||
return false;
|
||||
}
|
||||
if( TryParseConstant( t ) ) {
|
||||
return true;
|
||||
}
|
||||
if( TryParseFunction( t ) ) {
|
||||
return true;
|
||||
}
|
||||
if( TryParseInstance( t ) ) {
|
||||
return true;
|
||||
}
|
||||
if( TryParseKeyword( t ) ) {
|
||||
return true;
|
||||
}
|
||||
if( TryParseElementName( t ) ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
//Many thing miss here
|
||||
_cache.PushOperand( ExpElementMemberNameNode.Create( t ) );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool TryAppendMiddleSeparator( Token t )
|
||||
{
|
||||
if( t.Flag != TokenFlag.Separator_Middle ) {
|
||||
return false;
|
||||
}
|
||||
while( _cache.OperatorAheadOfDepth > 0 )
|
||||
{
|
||||
_cache.TryPopOperator( out Token op );
|
||||
ExpSyntaxNode node = ConvertAndPushOneOperator( op );
|
||||
}
|
||||
switch( _cache.OperandAheadOfDepth )
|
||||
{
|
||||
case 0:
|
||||
if( t.Value == ";" ) {
|
||||
return true;
|
||||
}
|
||||
_cache.StatementsInDepth.Push( ExpSyntaxNode.Empty );
|
||||
goto case 1;
|
||||
case 1:
|
||||
_cache.PopOperand( out _, out ExpSyntaxNode? statement );
|
||||
if( t.Value == ";" )
|
||||
{
|
||||
StepEntityDefineSequence sequence = new StepEntityDefineSequence(
|
||||
statement, _dependencyDetector.ExportAllDependencies() );
|
||||
StepEntityInitStatements.Enqueue( sequence );
|
||||
} else
|
||||
{
|
||||
_cache.StatementsInDepth.Push( statement );
|
||||
}
|
||||
|
||||
return true;
|
||||
default:
|
||||
ExpInvalidSyntaxException.ThrowNoOperator( t );
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool TryAppendNumAndStrLiteral( Token t )
|
||||
{
|
||||
if( ( t.Flag & ( TokenFlag.String | TokenFlag.Number ) ) == 0 ) {
|
||||
return false;
|
||||
}
|
||||
_cache.PushOperand( ExpElementInstance.CreateLiteral( t ) );
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool TryAppendPrefixSeparator( Token t )
|
||||
{
|
||||
if( t.Flag != TokenFlag.Separator_Left ) {
|
||||
return false;
|
||||
}
|
||||
_cache.PushOperator( t );
|
||||
_cache.IncreaseDepth( ( int )ExpCompileStateCode.Common );
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool TryAppendPrefixSeparatorEnd( Token t )
|
||||
{
|
||||
if( t.Flag != TokenFlag.Separator_Right ) {
|
||||
return false;
|
||||
}
|
||||
ClosePrefixReverse( t );
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool TryAppendSymbol( Token t )
|
||||
{
|
||||
if( ( t.Flag & ( TokenFlag.Symbol_Unary | TokenFlag.Symbol_Binary ) ) == 0 ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int cmp = -1;
|
||||
processPrecedence:
|
||||
if( _cache.TryPeekOperator( out Token tmp ) )
|
||||
{
|
||||
cmp = CompareOperatorPrecedence( t, tmp );
|
||||
if( cmp >= 0 )
|
||||
{
|
||||
_cache.PopOperator();
|
||||
ExpSyntaxNode node = ConvertAndPushOneOperator( tmp );
|
||||
goto processPrecedence;
|
||||
}
|
||||
}
|
||||
_cache.PushOperator( t );
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool TryParseConstant( Token t )
|
||||
{
|
||||
switch( t.Value )
|
||||
{
|
||||
case "$":
|
||||
_cache.PushOperand( StepEntityInstanceNode.RegisterNull( t ) );
|
||||
return true;
|
||||
case "*":
|
||||
_cache.PushOperand( StepEntityInstanceNode.RegisterRuntimeInference( t ) );
|
||||
return true;
|
||||
case ExpKeyword.E:
|
||||
_cache.PushOperand( new ExpRealNumberNode( t, MathF.E, true ) );
|
||||
return true;
|
||||
case ExpKeyword.Pi:
|
||||
_cache.PushOperand( new ExpRealNumberNode( t, MathF.PI, true ) );
|
||||
return true;
|
||||
default:
|
||||
if( ExpElementInstance.TryCreateLiteral( t, out ExpElementInstance? node ) )
|
||||
{
|
||||
_cache.PushOperand( node );
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private bool TryParseElementName( Token t )
|
||||
{
|
||||
if( _context.TryGetType( t.Value, out ExpTypeSource? type ) )
|
||||
{
|
||||
_cache.PushOperand( ExpMetaRefNode.RefType( t, type ) );
|
||||
return true;
|
||||
}
|
||||
if( _context.TryGetEntity( t.Value, out ExpEntitySource? entity ) )
|
||||
{
|
||||
_cache.PushOperand( ExpMetaRefNode.RefEntity( t, entity ) );
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool TryParseFunction( Token t )
|
||||
{
|
||||
if( _entityTypeCheckPattern.IsMatch( t.Value ) )
|
||||
{
|
||||
if( _cache.PeekOperator().Flag == TokenFlag.Member )
|
||||
{
|
||||
Token op = _cache.PopOperator();
|
||||
ConvertAndPushOneOperator( op );
|
||||
}
|
||||
_cache.PushOperator( t );
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool TryParseInstance( Token t )
|
||||
{
|
||||
if( t.Value[ 0 ] == '#' )
|
||||
{
|
||||
StepEntityInstanceNode node = StepEntityInstanceNode.Register( t );
|
||||
if( t.Column != 0 ) {
|
||||
_dependencyDetector.AddDependency( node );
|
||||
}
|
||||
_cache.PushOperand( node );
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool TryParseKeyword( Token t )
|
||||
{
|
||||
switch( t.Value )
|
||||
{
|
||||
case ExpKeyword.Return:
|
||||
_cache.PushOperator( t );
|
||||
return true;
|
||||
case ExpKeyword.Skip:
|
||||
_cache.PushOperand( ExpProcedureControlNode.Skip( t ) );
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="ExpSyntaxAnalyzer.Enum.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the “Software”), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED “AS IS”,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
internal partial class StepExpSyntaxAnalyzer
|
||||
{
|
||||
|
||||
private static string ParseStepEnumLiteral( string source )
|
||||
{
|
||||
int length = source.Length;
|
||||
ReadOnlySpan<char> span = source.AsSpan();
|
||||
if( length > 2 && span[ 0 ] == '.' && span[ length - 1 ] == '.' ) {
|
||||
return span.Slice( 1, length - 2 ).ToString();
|
||||
}
|
||||
throw new ExpInvalidSyntaxException( $"\"{source}\" is not a valid enum syntax" );
|
||||
}
|
||||
|
||||
private void TryAppendEnum( Token e )
|
||||
{
|
||||
ExpSyntaxNode node = e.Value switch
|
||||
{
|
||||
".T." => new ExpBoolNode( e, true, true ),
|
||||
".F." => new ExpBoolNode( e, false, true ),
|
||||
".U." => new ExpLogicValueNode( e, ExpLogic.Unknown, true ),
|
||||
_ => ExpEnumLiteralNode.Create( e, ParseStepEnumLiteral ),
|
||||
};
|
||||
_cache.PushOperand( node );
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="ExpSyntaxAnalyzer.ErrorProcess.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the “Software”), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED “AS IS”,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
internal partial class StepExpSyntaxAnalyzer
|
||||
{
|
||||
|
||||
public void ThrowCompileException( int errorCode )
|
||||
{
|
||||
switch( errorCode )
|
||||
{
|
||||
case 0 or 1:
|
||||
return;
|
||||
case TokenTypeNotMatch:
|
||||
throw new Exception();
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="ExpSyntaxAnalyzer.OperatorParser.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the “Software”), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED “AS IS”,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using ExpKeyword = StgSharp.Script.Express.ExpressCompile.Keyword;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
internal partial class StepExpSyntaxAnalyzer
|
||||
{
|
||||
|
||||
public int CompareOperatorPrecedence( Token left, Token right )
|
||||
{
|
||||
ExpressCompile.TryGetOperatorPrecedence( left.Value, out int leftPrecedence );
|
||||
ExpressCompile.TryGetOperatorPrecedence( right.Value, out int rightPrecedence );
|
||||
return leftPrecedence - rightPrecedence;
|
||||
}
|
||||
|
||||
public bool TryGenerateUnaryNode( Token t, out ExpSyntaxNode node )
|
||||
{
|
||||
ExpSyntaxNode operand = GetNextOperandCache();
|
||||
switch( t.Value )
|
||||
{
|
||||
case ExpKeyword.UnaryPlus:
|
||||
node = ExpUnaryOperatorNode.UnaryPlus( t, operand );
|
||||
return true;
|
||||
case ExpKeyword.UnaryMinus:
|
||||
node = ExpUnaryOperatorNode.UnaryMinus( t, operand );
|
||||
return true;
|
||||
case ExpKeyword.Not:
|
||||
node = ExpUnaryOperatorNode.UnaryNot( t, operand );
|
||||
return true;
|
||||
default:
|
||||
node = ExpSyntaxNode.Empty;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// WARNING: This method cannot process INDEXOF, FUNCTION CALLING, LOOP and any ENDING
|
||||
/// SYMBOLS.
|
||||
/// </summary>
|
||||
private ExpSyntaxNode ConvertAndPushOneOperator( Token op )
|
||||
{
|
||||
switch( op.Flag )
|
||||
{
|
||||
case TokenFlag.Symbol_Unary:
|
||||
TryGenerateUnaryNode( op, out ExpSyntaxNode? node );
|
||||
_cache.PushOperand( node );
|
||||
return node;
|
||||
case TokenFlag.Symbol_Binary:
|
||||
TryGenerateBinaryNode( op, out node );
|
||||
_cache.PushOperand( node );
|
||||
return node;
|
||||
case TokenFlag.Member:
|
||||
_cache.PopOperand( out _, out ExpSyntaxNode? p );
|
||||
StepEntityInitCaller caller = StepEntityInitCaller.CreateCaller( op.Value );
|
||||
node = ExpFunctionCallingNode.CallFunction( op, caller, p );
|
||||
_cache.StatementsInDepth.Push( node );
|
||||
return node;
|
||||
default:
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
private bool TryGenerateBinaryNode( Token t, out ExpSyntaxNode node )
|
||||
{
|
||||
/*
|
||||
ExpSyntaxNode right = GetNextOperandCache();
|
||||
ExpSyntaxNode left = GetNextOperandCache();
|
||||
/**/
|
||||
switch( t.Value )
|
||||
{
|
||||
case "=":
|
||||
ExpSyntaxNode right = GetNextOperandCache();
|
||||
ExpSyntaxNode left;
|
||||
if( right is ExpTupleNode tuple )
|
||||
{
|
||||
right = StepComplexEntityNode.FromTuple( tuple );
|
||||
left = GetNextOperandCache();
|
||||
} else
|
||||
{
|
||||
left = right;
|
||||
right = _cache.StatementsInDepth.Pop();
|
||||
}
|
||||
|
||||
node = ExpBinaryOperatorNode.Assign( t, left, right );
|
||||
return true;
|
||||
default:
|
||||
node = ExpSyntaxNode.Empty;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="ExpSyntaxAnalyzer.PrefixReverseAnalysing.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the “Software”), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED “AS IS”,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using ExpKeyword = StgSharp.Script.Express.ExpressCompile.Keyword;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
internal partial class StepExpSyntaxAnalyzer
|
||||
{
|
||||
|
||||
private void ClosePrefixReverse( Token rightSeparator )
|
||||
{
|
||||
Token op;
|
||||
ExpSyntaxNode root;
|
||||
if( _cache.OperatorAheadOfDepth == 0 )
|
||||
{
|
||||
if( _cache.OperandAheadOfDepth == 1 )
|
||||
{
|
||||
_cache.PopOperand( out _, out ExpSyntaxNode? statement );
|
||||
_cache.StatementsInDepth.Push( statement );
|
||||
} else
|
||||
{
|
||||
_cache.StatementsInDepth.Push( ExpSyntaxNode.Empty );
|
||||
}
|
||||
} else
|
||||
{
|
||||
while( _cache.TryPopOperator( out op ) )
|
||||
{
|
||||
ExpSyntaxNode node = ConvertAndPushOneOperator( op );
|
||||
}
|
||||
if( _cache.OperandAheadOfDepth == 1 )
|
||||
{
|
||||
_cache.PopOperand( out _, out root );
|
||||
_cache.StatementsInDepth.Push( root );
|
||||
}
|
||||
}
|
||||
|
||||
root = _cache.PackAllStatements();
|
||||
_cache.DecreaseDepth();
|
||||
if( IsSeparatorMatch( _cache.PeekOperator(), rightSeparator ) )
|
||||
{
|
||||
_cache.PopOperator();
|
||||
root = ExpTupleNode.Pack( root );
|
||||
_cache.PushOperand( root );
|
||||
} else
|
||||
{
|
||||
throw new ExpCompileException(
|
||||
rightSeparator, "Ending of block does not match its begging" );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,138 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="ExpSyntaxAnalyzer.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the “Software”), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED “AS IS”,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
using StgSharp.Threading;
|
||||
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO.Pipes;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using ExpKeyword = StgSharp.Script.Express.ExpressCompile.Keyword;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
internal partial class StepExpSyntaxAnalyzer : ISyntaxAnalyzer
|
||||
{
|
||||
|
||||
private const int EndLine = 1;
|
||||
private const int TokenGenerated = 0;
|
||||
private const int TokenTypeNotMatch = -1;
|
||||
|
||||
private CompileStack<ExpSyntaxNode, IExpElementSource> _cache;
|
||||
private ExpSchema _context;
|
||||
private ExpSyntaxNode _lastStatement;
|
||||
private IExpElementSource _local;
|
||||
|
||||
public StepExpSyntaxAnalyzer()
|
||||
{
|
||||
_cache = new CompileStack<ExpSyntaxNode, IExpElementSource>();
|
||||
_context = new ExpressStepUtil();
|
||||
}
|
||||
|
||||
public ConcurrentQueue<StepEntityDefineSequence> StepEntityInitStatements { get; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// Append a token to top of cache. This method will automatically convert token to node
|
||||
/// if meets separators or operators.
|
||||
/// </summary>
|
||||
public void AppendToken( Token expToken )
|
||||
{
|
||||
switch( expToken.Flag )
|
||||
{
|
||||
case TokenFlag.Symbol_Unary or TokenFlag.Symbol_Binary:
|
||||
TryAppendSymbol( expToken );
|
||||
break;
|
||||
case TokenFlag.Number or TokenFlag.String:
|
||||
ExpElementInstance node = ExpElementInstance.CreateLiteral( expToken );
|
||||
_cache.PushOperand( node );
|
||||
break;
|
||||
case TokenFlag.Separator_Left:
|
||||
TryAppendPrefixSeparator( expToken );
|
||||
break;
|
||||
case TokenFlag.Separator_Right:
|
||||
TryAppendPrefixSeparatorEnd( expToken );
|
||||
break;
|
||||
case TokenFlag.Separator_Middle:
|
||||
TryAppendMiddleSeparator( expToken );
|
||||
break;
|
||||
case TokenFlag.Index_Left:
|
||||
TryAppendIndexLeft( expToken );
|
||||
break;
|
||||
case TokenFlag.Index_Right:
|
||||
TryAppendIndexRight( expToken );
|
||||
break;
|
||||
case TokenFlag.Member:
|
||||
TryAppendMember( expToken );
|
||||
break;
|
||||
case TokenFlag.Enum:
|
||||
TryAppendEnum( expToken );
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public ExpSyntaxNode GetNextOperandCache()
|
||||
{
|
||||
if( _cache.PopOperand( out Token t, out ExpSyntaxNode? n ) )
|
||||
{
|
||||
return n;
|
||||
} else
|
||||
{
|
||||
// process some rare case here
|
||||
}
|
||||
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public enum ExpCompileStateCode
|
||||
{
|
||||
|
||||
Common,
|
||||
ForLoop,
|
||||
RepeatLoop,
|
||||
UntilLoop,
|
||||
IfBranch,
|
||||
CaseBranch,
|
||||
CollectionIndex,
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepDataSectionsTranmitter.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the “Software”), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED “AS IS”,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Script;
|
||||
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public class StepDataSectionTransmitter : IScriptSourceProvider
|
||||
{
|
||||
|
||||
private const string EndDataText = "ENDSEC;";
|
||||
|
||||
//private bool _isEmpty;
|
||||
private ConcurrentQueue<string> _cache = new ConcurrentQueue<string>();
|
||||
private int _line = 0;
|
||||
|
||||
public StepDataSectionTransmitter() { }
|
||||
|
||||
public StepDataSectionTransmitter( int begins )
|
||||
{
|
||||
Begin = begins;
|
||||
_line = Begin;
|
||||
}
|
||||
|
||||
public bool IsEmpty => _cache.IsEmpty && !IsWriting;
|
||||
|
||||
public bool IsWriting { get; private set; } = true;
|
||||
|
||||
public int Begin { get; internal set; }
|
||||
|
||||
public int Location => _line;
|
||||
|
||||
public void EndWriting()
|
||||
{
|
||||
IsWriting = false;
|
||||
}
|
||||
|
||||
public string ReadLine()
|
||||
{
|
||||
if( _cache.TryDequeue( out string? line ) )
|
||||
{
|
||||
_line++;
|
||||
return line;
|
||||
}
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
public string ReadLine( out int position )
|
||||
{
|
||||
string ret = ReadLine();
|
||||
position = _line;
|
||||
return ret;
|
||||
}
|
||||
|
||||
public void WriteLine( string line )
|
||||
{
|
||||
if( line == "DATA;" ) {
|
||||
return;
|
||||
}
|
||||
if( line == EndDataText )
|
||||
{
|
||||
EndWriting();
|
||||
return;
|
||||
}
|
||||
if( IsWriting ) {
|
||||
_cache.Enqueue( line );
|
||||
}
|
||||
}
|
||||
|
||||
IScriptSourceProvider IScriptSourceProvider.Slice( int location, int count )
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,176 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepDataTokenReader.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the “Software”), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED “AS IS”,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Model.Step;
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public partial class StepDataTokenReader : IScriptTokenReader
|
||||
{
|
||||
|
||||
private ExpTokenReader _reader;
|
||||
|
||||
private HashSet<string> tokenHash = [
|
||||
"T","F","UNSPECIFIED"
|
||||
];
|
||||
private Queue<Token> _cache = new Queue<Token>();
|
||||
private StepDataSectionTransmitter _transmitter;
|
||||
|
||||
public StepDataTokenReader( StepDataSectionTransmitter transmitter )
|
||||
{
|
||||
_reader = new ExpTokenReader( transmitter );
|
||||
_reader.TokenReaderPreProcessor = new TokenPreReader();
|
||||
_transmitter = transmitter;
|
||||
}
|
||||
|
||||
public bool IsEmpty
|
||||
{
|
||||
get
|
||||
{
|
||||
if( _reader.IsEmpty ) {
|
||||
return !_transmitter.IsWriting;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public Token ReadToken()
|
||||
{
|
||||
return _reader.ReadToken();
|
||||
}
|
||||
|
||||
public bool TryReadToken( out Token t )
|
||||
{
|
||||
return _reader.TryReadToken( out t );
|
||||
}
|
||||
|
||||
private partial class TokenPreReader : ExpTokenReaderPreProcessor
|
||||
{
|
||||
|
||||
private static Regex
|
||||
_nextHashtagSymbolPattern = GetEntityTagSymbolPattern(),
|
||||
_nextEnumPattern = GetNextEnumPattern(),
|
||||
_stringPattern = GetStringPattern();
|
||||
|
||||
public override bool Process( string codeLine, int line, ref int current, out Token t )
|
||||
{
|
||||
ReadOnlySpan<char> chars = codeLine.AsSpan( current );
|
||||
char c = chars[ 0 ];
|
||||
Match match;
|
||||
switch( c )
|
||||
{
|
||||
case '#':
|
||||
match = _nextHashtagSymbolPattern.Match( codeLine, current );
|
||||
if( match.Success )
|
||||
{
|
||||
int begin = match.Groups[ "token" ].Index;
|
||||
int end = match.Groups[ "end" ].Index;
|
||||
int rest = match.Groups[ "rest" ].Index;
|
||||
current = rest;
|
||||
t = new(
|
||||
ExpressCompile.PoolString( chars[ 0..( end - begin ) ] ), line,
|
||||
begin, TokenFlag.Member );
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case '.':
|
||||
match = _nextEnumPattern.Match( codeLine, current );
|
||||
if( match.Success )
|
||||
{
|
||||
int begin = match.Groups[ "token" ].Index;
|
||||
int end = match.Groups[ "end" ].Index;
|
||||
int rest = match.Groups[ "rest" ].Index;
|
||||
current = rest;
|
||||
t = new Token(
|
||||
match.Groups[ "token" ].Value, line, begin, TokenFlag.Enum );
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case '$':
|
||||
t = new Token( "$", line, current, TokenFlag.Member );
|
||||
current++;
|
||||
return true;
|
||||
case '*':
|
||||
t = new Token( "*", line, current, TokenFlag.Member );
|
||||
current++;
|
||||
return true;
|
||||
case '\'':
|
||||
match = _stringPattern.Match( codeLine, current );
|
||||
if( match.Success )
|
||||
{
|
||||
int begin = match.Groups[ "token" ].Index;
|
||||
int end = match.Groups[ "end" ].Index;
|
||||
int rest = match.Groups[ "rest" ].Index;
|
||||
current = rest;
|
||||
string value = chars.Slice( 1, ( end - begin - 1 ) ).ToString();
|
||||
if( string.IsNullOrWhiteSpace( value ) ) {
|
||||
value = string.Empty;
|
||||
}
|
||||
t = new Token( value, line, begin, TokenFlag.String );
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
t = Token.Empty;
|
||||
return false;
|
||||
}
|
||||
|
||||
[GeneratedRegex(
|
||||
@"(?<token>#[0-9A-Za-z]+)(?<end>\s*?)(?<rest>\S|$)",
|
||||
RegexOptions.Singleline )]
|
||||
private static partial Regex GetEntityTagSymbolPattern();
|
||||
|
||||
[GeneratedRegex(
|
||||
@"(?<token>\.[A-Za-z_]+\.)(?<end>\s*)(?<rest>\S*)",
|
||||
RegexOptions.Singleline )]
|
||||
private static partial Regex GetNextEnumPattern();
|
||||
|
||||
[GeneratedRegex(
|
||||
@"(?<token>')(?>\\\\|''|(?!')[^'])*(?<end>')\s*?(?<rest>\S|$)",
|
||||
RegexOptions.Singleline )]
|
||||
private static partial Regex GetStringPattern();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepDependencyDetector.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the “Software”), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED “AS IS”,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Model.Step;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
internal class StepDependencyDetector
|
||||
{
|
||||
|
||||
public StepDependencyDetector() { }
|
||||
|
||||
public List<int> Dependencies { get; private set; } = new();
|
||||
|
||||
public void AddDependency( StepEntityInstanceNode node )
|
||||
{
|
||||
Dependencies.Add( node.Id );
|
||||
}
|
||||
|
||||
public IEnumerable<int> ExportAllDependencies()
|
||||
{
|
||||
List<int> ret = Dependencies;
|
||||
Dependencies = new List<int>();
|
||||
return ret;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepEntityDefineSequence.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the “Software”), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED “AS IS”,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.Design;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public record class StepEntityDefineSequence
|
||||
{
|
||||
public StepEntityDefineSequence( ExpSyntaxNode node, IEnumerable<int> dep )
|
||||
{
|
||||
Expression = node;
|
||||
Dependencies = dep;
|
||||
}
|
||||
|
||||
public ExpSyntaxNode Expression { get; init; }
|
||||
|
||||
public IEnumerable<int> Dependencies { get; init; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="ExpressStepUtil.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the ¡°Software¡±), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED ¡°AS IS¡±,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using CommunityToolkit.HighPerformance.Buffers;
|
||||
|
||||
using StgSharp.Model.Step;
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System;
|
||||
using System.Collections.Frozen;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public class ExpressStepUtil : ExpSchema
|
||||
{
|
||||
|
||||
public const string AdvancedFaceText = "ADVANCED_FACE";
|
||||
public const string Axis2Placement2DText = "AXIS2_PLACEMENT_2D";
|
||||
public const string Axis2Placement3DText = "AXIS2_PLACEMENT_3D";
|
||||
public const string BSplineCurveWithKnotsText = "B_SPLINE_CURVE_WITH_KNOTS";
|
||||
public const string CartesianPointText = "CARTESIAN_POINT";
|
||||
public const string CircleText = "CIRCLE";
|
||||
public const string CylindricalSurfaceText = "CYLINDRICAL_SURFACE";
|
||||
public const string DirectionText = "DIRECTION";
|
||||
public const string EdgeCurveText = "EDGE_CURVE";
|
||||
public const string EdgeLoopText = "EDGE_LOOP";
|
||||
public const string EllipseText = "ELLIPSE";
|
||||
public const string FaceBoundText = "FACE_BOUND";
|
||||
public const string FaceOuterBoundText = "FACE_OUTER_BOUND";
|
||||
public const string LineText = "LINE";
|
||||
public const string OrientedEdgeText = "ORIENTED_EDGE";
|
||||
public const string PlaneText = "PLANE";
|
||||
public const string RepresentationItemText = "REPRESENTATION_ITEM";
|
||||
public const string VectorText = "VECTOR";
|
||||
public const string VertexPointText = "VERTEX_POINT";
|
||||
|
||||
private static
|
||||
HashSet<string> names = [
|
||||
AdvancedFaceText,
|
||||
Axis2Placement2DText,
|
||||
Axis2Placement3DText,
|
||||
BSplineCurveWithKnotsText,
|
||||
CartesianPointText,
|
||||
CircleText,
|
||||
CylindricalSurfaceText,
|
||||
DirectionText,
|
||||
EdgeCurveText,
|
||||
EdgeLoopText,
|
||||
EllipseText,
|
||||
FaceBoundText,
|
||||
FaceOuterBoundText,
|
||||
LineText,
|
||||
OrientedEdgeText,
|
||||
PlaneText,
|
||||
RepresentationItemText,
|
||||
VectorText,
|
||||
VertexPointText,
|
||||
];
|
||||
|
||||
private FrozenDictionary<string, ExpEntitySource> entitiesDefine;
|
||||
private StringPool _entityNamePool = new StringPool();
|
||||
|
||||
public ExpressStepUtil()
|
||||
{
|
||||
IEnumerable<KeyValuePair<string, ExpEntitySource>> defineSource = [];
|
||||
entitiesDefine = new Dictionary<string, ExpEntitySource>( defineSource )
|
||||
.ToFrozenDictionary();
|
||||
foreach( string item in names ) {
|
||||
_entityNamePool.Add( item );
|
||||
}
|
||||
}
|
||||
|
||||
internal StepModel Current { get; set; }
|
||||
|
||||
public override void LoadFromSource( ExpSchemaSource source )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
public override bool TryGetConst( string name, out ExpElementInstance c )
|
||||
{
|
||||
c = null!;
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool TryGetEntity( string name, out ExpEntitySource e )
|
||||
{
|
||||
return entitiesDefine.TryGetValue( name, out e! );
|
||||
}
|
||||
|
||||
public override bool TryGetFunction( string name, out ExpFunctionSource f )
|
||||
{
|
||||
f = null!;
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool TryGetProcedure( string name, out ExpProcedureSource p )
|
||||
{
|
||||
p = null!;
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool TryGetRule( string name, out ExpRuleSource r )
|
||||
{
|
||||
r = null!;
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool TryGetSchemaInclude( string name, out ExpSchema include )
|
||||
{
|
||||
include = null!;
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool TryGetType( string name, out ExpTypeSource t )
|
||||
{
|
||||
t = null!;
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepAdvancedFace.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the ¡°Software¡±), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED ¡°AS IS¡±,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Model.Step;
|
||||
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System.Linq;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public class StepAdvancedFace : StepFaceSurface, IExpConvertableFrom<StepAdvancedFace>
|
||||
{
|
||||
|
||||
public StepAdvancedFace( StepModel model ) : base( model ) { }
|
||||
|
||||
public override StepItemType ItemType => StepItemType.AdvancedFace;
|
||||
|
||||
public void FromInstance( StepAdvancedFace entity )
|
||||
{
|
||||
base.FromInstance( entity );
|
||||
}
|
||||
|
||||
internal static StepAdvancedFace FromSyntax( StepModel binder, ExpSyntaxNode syntaxList )
|
||||
{
|
||||
ExpNodePresidentEnumerator enumerator = new ExpNodePresidentEnumerator( syntaxList );
|
||||
StepAdvancedFace face = new StepAdvancedFace( binder );
|
||||
enumerator.AssertEnumeratorCount( 4 );
|
||||
face.Name = ( enumerator[ 0 ]as ExpStringNode )!.Value;
|
||||
|
||||
ExpNodePresidentEnumerator boundsList = enumerator[ 1 ].TupleToPresidentEnumerator();
|
||||
face.Bounds.Clear();
|
||||
face.Bounds
|
||||
.AddRange(
|
||||
Enumerable.Range( 0, enumerator.Count ).Select( _ => ( StepFaceBound )null ) );
|
||||
for( int i = 0; i < boundsList.Count; i++ )
|
||||
{
|
||||
int j = i; // capture to avoid rebinding
|
||||
face.Bounds[ j ] = binder[ boundsList[ j ] ] as StepFaceBound;
|
||||
}
|
||||
face.FaceGeometry = binder[ enumerator[ 2 ] ] as StepSurface;
|
||||
face.SameSense = ( enumerator[ 3 ] as ExpBoolNode )!.Value;
|
||||
|
||||
return face;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepAxis2Placement.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the ¡°Software¡±), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED ¡°AS IS¡±,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Model.Step;
|
||||
using StgSharp.Script;
|
||||
|
||||
using System;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public class StepAxis2Placement : StepPlacement
|
||||
{
|
||||
|
||||
private StepDirection _refDirection;
|
||||
|
||||
protected StepAxis2Placement( StepModel model ) : base( model ) { }
|
||||
|
||||
public StepDirection RefDirection
|
||||
{
|
||||
get { return _refDirection; }
|
||||
set
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull( value );
|
||||
_refDirection = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool IsConvertableTo( string entityName )
|
||||
{
|
||||
return base.IsConvertableTo( entityName ) || entityName == "StepAxis2Placement";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepAxis2Placement2D.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the ¡°Software¡±), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED ¡°AS IS¡±,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Model.Step;
|
||||
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public class StepAxis2Placement2D : StepAxis2Placement, IExpConvertableFrom<StepAxis2Placement2D>
|
||||
{
|
||||
|
||||
private StepAxis2Placement2D( StepModel model ) : base( model ) { }
|
||||
|
||||
public StepAxis2Placement2D(
|
||||
StepModel model,
|
||||
StepCartesianPoint location,
|
||||
StepDirection direction )
|
||||
: base( model )
|
||||
{
|
||||
Location = location;
|
||||
RefDirection = direction;
|
||||
}
|
||||
|
||||
public override StepItemType ItemType => StepItemType.AxisPlacement2D;
|
||||
|
||||
public void FromInstance( StepAxis2Placement2D entity )
|
||||
{
|
||||
base.FromInstance( entity );
|
||||
Location = entity.Location;
|
||||
RefDirection = entity.RefDirection;
|
||||
}
|
||||
|
||||
internal static StepAxis2Placement2D FromSyntax(
|
||||
StepModel binder,
|
||||
ExpSyntaxNode syntaxList )
|
||||
{
|
||||
ExpNodePresidentEnumerator enumerator = new ExpNodePresidentEnumerator( syntaxList );
|
||||
StepAxis2Placement2D axis = new StepAxis2Placement2D( binder );
|
||||
enumerator.AssertEnumeratorCount( 3 );
|
||||
axis.Name = ( enumerator[ 0 ]as ExpStringNode )!.Value;
|
||||
axis.Location = binder[ enumerator[ 1 ] ] as StepCartesianPoint;
|
||||
axis.RefDirection = binder[ enumerator[ 2 ] ] as StepDirection;
|
||||
return axis;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepAxis2Placement3D.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the ¡°Software¡±), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED ¡°AS IS¡±,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Model.Step;
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public class StepAxis2Placement3D : StepAxis2Placement, IExpConvertableFrom<StepAxis2Placement3D>
|
||||
{
|
||||
|
||||
private StepDirection _axis;
|
||||
|
||||
private StepAxis2Placement3D( StepModel model ) : base( model ) { }
|
||||
|
||||
public StepAxis2Placement3D(
|
||||
StepModel model,
|
||||
StepCartesianPoint location,
|
||||
StepDirection axis,
|
||||
StepDirection refDirection )
|
||||
: base( model )
|
||||
{
|
||||
Location = location;
|
||||
Axis = axis;
|
||||
RefDirection = refDirection;
|
||||
}
|
||||
|
||||
public StepDirection Axis
|
||||
{
|
||||
get { return _axis; }
|
||||
set
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull( value );
|
||||
_axis = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override StepItemType ItemType => StepItemType.AxisPlacement3D;
|
||||
|
||||
public override bool IsConvertableTo( string entityTypeName )
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
internal static StepAxis2Placement3D FromSyntax(
|
||||
StepModel binder,
|
||||
ExpSyntaxNode syntaxList )
|
||||
{
|
||||
ExpNodePresidentEnumerator enumerator = new ExpNodePresidentEnumerator( syntaxList );
|
||||
StepAxis2Placement3D axis = new StepAxis2Placement3D( binder );
|
||||
enumerator.AssertEnumeratorCount( 4 );
|
||||
axis.Name = ( enumerator[ 0 ]as ExpStringNode )!.Value;
|
||||
axis.Location = binder[ enumerator[ 1 ] ] as StepCartesianPoint;
|
||||
axis.Axis = binder[ enumerator[ 2 ] ] as StepDirection;
|
||||
axis.RefDirection = binder[ enumerator[ 3 ] ] as StepDirection;
|
||||
return axis;
|
||||
}
|
||||
|
||||
void IExpConvertableFrom<StepAxis2Placement3D>.FromInstance( StepAxis2Placement3D entity )
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,141 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepBSplineCurve.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the ¡°Software¡±), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED ¡°AS IS¡±,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Model.Step;
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System;
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public enum StepBSplineCurveForm
|
||||
{
|
||||
|
||||
Polyline,
|
||||
CircularArc,
|
||||
EllipticalArc,
|
||||
ParabolicArc,
|
||||
HyperbolicArc,
|
||||
Unspecified
|
||||
|
||||
}
|
||||
|
||||
public static class StepExpEnumValue
|
||||
{
|
||||
|
||||
internal const string CIRCULAR_ARC = "CIRCULAR_ARC";
|
||||
internal const string ELLIPTIC_ARC = "ELLIPTIC_ARC";
|
||||
internal const string HYPERBOLIC_ARC = "HYPERBOLIC_ARC";
|
||||
internal const string PARABOLIC_ARC = "PARABOLIC_ARC";
|
||||
internal const string POLYLINE_FORM = "POLYLINE_FORM";
|
||||
internal const string UNSPECIFIED = "UNSPECIFIED";
|
||||
|
||||
internal static HashSet<string> AllPossibleValue { get; } = [
|
||||
CIRCULAR_ARC,
|
||||
ELLIPTIC_ARC,
|
||||
HYPERBOLIC_ARC,
|
||||
PARABOLIC_ARC,
|
||||
POLYLINE_FORM,
|
||||
UNSPECIFIED,
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
public class StepBSplineCurve : StepBoundedCurve, IExpConvertableFrom<StepBSplineCurve>
|
||||
{
|
||||
|
||||
public StepBSplineCurve( StepModel model, params StepCartesianPoint[] controlPoints )
|
||||
: this( model, ( IEnumerable<StepCartesianPoint> )controlPoints ) { }
|
||||
|
||||
public StepBSplineCurve( StepModel model, IEnumerable<StepCartesianPoint> controlPoints )
|
||||
: base( model )
|
||||
{
|
||||
ControlPointsList.AddRange( controlPoints );
|
||||
}
|
||||
|
||||
public bool ClosedCurve { get; set; }
|
||||
|
||||
public bool SelfIntersect { get; set; }
|
||||
|
||||
public int Degree { get; set; }
|
||||
|
||||
public List<StepCartesianPoint> ControlPointsList { get; private set; }
|
||||
= new List<StepCartesianPoint>();
|
||||
|
||||
public StepBSplineCurveForm CurveForm { get; set; } = StepBSplineCurveForm.Unspecified;
|
||||
|
||||
public void FromInstance( StepBSplineCurve entity )
|
||||
{
|
||||
base.FromInstance( entity );
|
||||
this.Degree = entity.Degree;
|
||||
this.ClosedCurve = entity.ClosedCurve;
|
||||
this.ControlPointsList = entity.ControlPointsList;
|
||||
this.SelfIntersect = entity.SelfIntersect;
|
||||
}
|
||||
|
||||
public override bool IsConvertableTo( string entityName )
|
||||
{
|
||||
return base.IsConvertableTo( entityName ) || entityName == "StepBSplineCurve";
|
||||
}
|
||||
|
||||
protected static string GetCurveFormString( StepBSplineCurveForm form )
|
||||
{
|
||||
return form switch
|
||||
{
|
||||
StepBSplineCurveForm.Polyline => StepExpEnumValue.POLYLINE_FORM,
|
||||
StepBSplineCurveForm.CircularArc => StepExpEnumValue.CIRCULAR_ARC,
|
||||
StepBSplineCurveForm.EllipticalArc => StepExpEnumValue.ELLIPTIC_ARC,
|
||||
StepBSplineCurveForm.ParabolicArc => StepExpEnumValue.PARABOLIC_ARC,
|
||||
StepBSplineCurveForm.HyperbolicArc => StepExpEnumValue.HYPERBOLIC_ARC,
|
||||
StepBSplineCurveForm.Unspecified => StepExpEnumValue.UNSPECIFIED,
|
||||
_ => throw new NotImplementedException(),
|
||||
};
|
||||
}
|
||||
|
||||
protected static StepBSplineCurveForm ParseCurveForm( string enumerationValue )
|
||||
{
|
||||
return enumerationValue.ToUpperInvariant() switch
|
||||
{
|
||||
StepExpEnumValue.POLYLINE_FORM => StepBSplineCurveForm.Polyline,
|
||||
StepExpEnumValue.CIRCULAR_ARC => StepBSplineCurveForm.CircularArc,
|
||||
StepExpEnumValue.ELLIPTIC_ARC => StepBSplineCurveForm.EllipticalArc,
|
||||
StepExpEnumValue.PARABOLIC_ARC => StepBSplineCurveForm.ParabolicArc,
|
||||
StepExpEnumValue.HYPERBOLIC_ARC => StepBSplineCurveForm.HyperbolicArc,
|
||||
_ => StepBSplineCurveForm.Unspecified,
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,158 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepBSplineCurveWithKnots.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the ¡°Software¡±), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED ¡°AS IS¡±,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Model.Step;
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System;
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public enum StepKnotType
|
||||
{
|
||||
|
||||
UniformKnots,
|
||||
QuasiUniformKnots,
|
||||
PiecewiseBezierKnots,
|
||||
Unspecified
|
||||
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
public class StepBSplineCurveWithKnots : StepBSplineCurve, IExpConvertableFrom<StepBSplineCurveWithKnots>
|
||||
{
|
||||
|
||||
private const string PIECEWISE_BEZIER_KNOTS = "PIECEWISE_BEZIER_KNOTS";
|
||||
private const string QUASI_UNIFORM_KNOTS = "QUASI_UNIFORM_KNOTS";
|
||||
|
||||
private const string UNIFORM_KNOTS = "UNIFORM_KNOTS";
|
||||
private const string UNSPECIFIED = "UNSPECIFIED";
|
||||
|
||||
public StepBSplineCurveWithKnots(
|
||||
StepModel model,
|
||||
IEnumerable<StepCartesianPoint> controlPoints )
|
||||
: base( model, controlPoints ) { }
|
||||
|
||||
public StepBSplineCurveWithKnots(
|
||||
StepModel model,
|
||||
params StepCartesianPoint[] controlPoints )
|
||||
: base( model, controlPoints ) { }
|
||||
|
||||
public List<int> KnotMultiplicities { get; } = new List<int>();
|
||||
|
||||
public List<double> Knots { get; } = new List<double>();
|
||||
|
||||
public override StepItemType ItemType => StepItemType.BSplineCurveWithKnots;
|
||||
|
||||
public StepKnotType KnotSpec { get; set; } = StepKnotType.Unspecified;
|
||||
|
||||
public void FromInstance( StepBSplineCurveWithKnots entity )
|
||||
{
|
||||
base.FromInstance( entity );
|
||||
KnotSpec = entity.KnotSpec;
|
||||
KnotMultiplicities.Clear();
|
||||
KnotMultiplicities.AddRange( entity.KnotMultiplicities );
|
||||
Knots.Clear();
|
||||
Knots.AddRange( entity.Knots );
|
||||
}
|
||||
|
||||
internal static StepBSplineCurveWithKnots FromSyntax(
|
||||
StepModel binder,
|
||||
ExpSyntaxNode syntaxList )
|
||||
{
|
||||
ExpNodePresidentEnumerator enumerator = syntaxList .ToPresidentEnumerator();
|
||||
enumerator.AssertEnumeratorCount( 9 );
|
||||
ExpNodePresidentEnumerator controlPointsList = enumerator[ 2 ].TupleToPresidentEnumerator(
|
||||
);
|
||||
|
||||
StepBSplineCurveWithKnots spline = new StepBSplineCurveWithKnots(
|
||||
binder, new StepCartesianPoint[controlPointsList.Count] );
|
||||
spline.Name = ( enumerator[ 0 ]as ExpStringNode )!.Value;
|
||||
spline.Degree = ( enumerator[ 1 ] as ExpIntNode )!.Value;
|
||||
|
||||
for( int i = 0; i < controlPointsList.Count; i++ )
|
||||
{
|
||||
int j = i; // capture to avoid rebinding
|
||||
spline.ControlPointsList[ j ] = binder[ controlPointsList[ j ] ]as StepCartesianPoint;
|
||||
}
|
||||
|
||||
spline.CurveForm = ParseCurveForm( enumerator[ 3 ].CodeConvertTemplate );
|
||||
spline.ClosedCurve = ( enumerator[ 4 ] as ExpBoolNode )!.Value;
|
||||
spline.SelfIntersect = ( enumerator[ 5 ]as ExpBoolNode )!.Value;
|
||||
|
||||
ExpNodePresidentEnumerator knotMultiplicitiesList = enumerator[ 6 ].TupleToPresidentEnumerator(
|
||||
);
|
||||
spline.KnotMultiplicities.Clear();
|
||||
for( int i = 0; i < knotMultiplicitiesList.Count; i++ ) {
|
||||
spline.KnotMultiplicities.Add( ( knotMultiplicitiesList[ i ]as ExpIntNode )!.Value );
|
||||
}
|
||||
|
||||
ExpNodePresidentEnumerator knotsList = enumerator[ 7 ].TupleToPresidentEnumerator();
|
||||
spline.Knots.Clear();
|
||||
for( int i = 0; i < knotsList.Count; i++ ) {
|
||||
spline.Knots.Add( ( knotsList[ i ]as ExpRealNumberNode )!.Value );
|
||||
}
|
||||
|
||||
spline.KnotSpec = ParseKnotSpec( enumerator[ 8 ].CodeConvertTemplate );
|
||||
|
||||
return spline;
|
||||
}
|
||||
|
||||
private static string GetKnotSpec( StepKnotType spec )
|
||||
{
|
||||
return spec switch
|
||||
{
|
||||
StepKnotType.UniformKnots => UNIFORM_KNOTS,
|
||||
StepKnotType.QuasiUniformKnots => QUASI_UNIFORM_KNOTS,
|
||||
StepKnotType.PiecewiseBezierKnots => PIECEWISE_BEZIER_KNOTS,
|
||||
StepKnotType.Unspecified => UNSPECIFIED,
|
||||
_ => throw new NotImplementedException(),
|
||||
};
|
||||
}
|
||||
|
||||
private static StepKnotType ParseKnotSpec( string enumerationValue )
|
||||
{
|
||||
return enumerationValue.ToUpperInvariant() switch
|
||||
{
|
||||
UNIFORM_KNOTS => StepKnotType.UniformKnots,
|
||||
QUASI_UNIFORM_KNOTS => StepKnotType.QuasiUniformKnots,
|
||||
PIECEWISE_BEZIER_KNOTS => StepKnotType.PiecewiseBezierKnots,
|
||||
_ => StepKnotType.Unspecified,
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,185 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepBSplineSurface.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the “Software”), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED “AS IS”,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using CommunityToolkit.HighPerformance;
|
||||
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public enum StepBSplineSurfaceForm
|
||||
{
|
||||
|
||||
PLANE_SURF,
|
||||
CYLINDRICAL_SURF,
|
||||
CONICAL_SURF,
|
||||
SPHERICAL_SURF,
|
||||
TOROIDAL_SURF,
|
||||
SURF_OF_REVOLUTION,
|
||||
RULED_SURF,
|
||||
GENERALISED_CONE,
|
||||
QUADRIC_SURF,
|
||||
SURF_OF_LINEAR_EXTRUSION,
|
||||
UNSPECIFIED,
|
||||
|
||||
}
|
||||
|
||||
public class StepBSplineSurface : StepBoundedSurface, IExpConvertableFrom<StepBSplineSurface>
|
||||
{
|
||||
|
||||
public const string CONICAL_SURF_TEXT = "CONICAL_SURF";
|
||||
public const string CYLINDRICAL_SURF_TEXT = "CYLINDRICAL_SURF";
|
||||
public const string GENERALISED_CONE_TEXT = "GENERALISED_CONE";
|
||||
public const string PLANE_SURF_TEXT = "PLANE_SURF";
|
||||
public const string QUADRIC_SURF_TEXT = "QUADRIC_SURF";
|
||||
public const string RULED_SURF_TEXT = "RULED_SURF";
|
||||
public const string SPHERICAL_SURF_TEXT = "SPHERICAL_SURF";
|
||||
public const string SURF_OF_LINEAR_EXTRUSION_TEXT = "SURF_OF_LINEAR_EXTRUSION";
|
||||
public const string SURF_OF_REVOLUTION_TEXT = "SURF_OF_REVOLUTION";
|
||||
public const string TOROIDAL_SURF_TEXT = "TOROIDAL_SURF";
|
||||
public const string UNSPECIFIED_TEXT = "UNSPECIFIED";
|
||||
|
||||
public StepBSplineSurface( StepModel model ) : base( model ) { }
|
||||
|
||||
public bool UClosed { get; set; }
|
||||
|
||||
public bool VClosed { get; set; }
|
||||
|
||||
public bool SelfIntersections { get; set; }
|
||||
|
||||
public int UDegree { get; set; }
|
||||
|
||||
public int VDegree { get; set; }
|
||||
|
||||
public int UUpper => ControlPointsList.Count - 1;
|
||||
|
||||
public int VUpper => ControlPointsList[ 0 ].Count - 1;
|
||||
|
||||
public List<List<StepCartesianPoint>> ControlPointsList { get; set; }
|
||||
= new List<List<StepCartesianPoint>>();
|
||||
|
||||
public StepBSplineSurfaceForm SurfaceForm { get; set; }
|
||||
|
||||
public static StepBSplineSurface CreateFromSyntax( StepModel binder, ExpSyntaxNode syntax )
|
||||
{
|
||||
ExpNodePresidentEnumerator enumerator = syntax.ToPresidentEnumerator();
|
||||
enumerator.AssertEnumeratorCount( 7 );
|
||||
StepBSplineSurface ret = new StepBSplineSurface( binder );
|
||||
|
||||
ret.UDegree = ( enumerator[ 0 ] as ExpIntNode ).Value;
|
||||
ret.VDegree = ( enumerator[ 1 ] as ExpIntNode ).Value;
|
||||
|
||||
ExpNodePresidentEnumerator pointList = enumerator[ 2 ].TupleToPresidentEnumerator();
|
||||
pointList.AssertEnumeratorCount( 2, int.MaxValue );
|
||||
for( int i = 0; i < pointList.Count; i++ )
|
||||
{
|
||||
ExpNodePresidentEnumerator points = pointList[ i ].TupleToPresidentEnumerator();
|
||||
points.AssertEnumeratorCount( 2, int.MaxValue );
|
||||
List<StepCartesianPoint> pList = new List<StepCartesianPoint>( points.Count );
|
||||
CollectionsMarshal.SetCount( pList, points.Count );
|
||||
Span<StepCartesianPoint> ls = CollectionsMarshal.AsSpan( pList );
|
||||
Span<ExpSyntaxNode> aspan = points.AsSpan();
|
||||
for( int j = 0; j < points.Count; j++ )
|
||||
{
|
||||
StepCartesianPoint p = binder[ aspan[ i ] as StepEntityInstanceNode ] as StepCartesianPoint;
|
||||
ls[ j ] = p;
|
||||
}
|
||||
ret.ControlPointsList.Add( pList );
|
||||
}
|
||||
|
||||
ret.SurfaceForm = GetSurfaceForm( enumerator[ 3 ].CodeConvertTemplate );
|
||||
ret.UClosed = ( enumerator[ 4 ] as ExpBoolNode ).Value;
|
||||
ret.VClosed = ( enumerator[ 5 ] as ExpBoolNode ).Value;
|
||||
ret.SelfIntersections = ( enumerator[ 6 ] as ExpBoolNode ).Value;
|
||||
return ret;
|
||||
}
|
||||
|
||||
public void FromInstance( StepBSplineSurface entity )
|
||||
{
|
||||
base.FromInstance( entity );
|
||||
UClosed = entity.UClosed;
|
||||
VClosed = entity.VClosed;
|
||||
UDegree = entity.UDegree;
|
||||
VDegree = entity.VDegree;
|
||||
ControlPointsList.Clear();
|
||||
foreach( List<StepCartesianPoint> list in entity.ControlPointsList ) {
|
||||
ControlPointsList.Add( new List<StepCartesianPoint>( list ) );
|
||||
}
|
||||
SurfaceForm = entity.SurfaceForm;
|
||||
}
|
||||
|
||||
protected static StepBSplineSurfaceForm GetSurfaceForm( string literal )
|
||||
{
|
||||
return literal switch
|
||||
{
|
||||
CONICAL_SURF_TEXT => StepBSplineSurfaceForm.PLANE_SURF,
|
||||
CYLINDRICAL_SURF_TEXT => StepBSplineSurfaceForm.CYLINDRICAL_SURF,
|
||||
GENERALISED_CONE_TEXT => StepBSplineSurfaceForm.CONICAL_SURF,
|
||||
PLANE_SURF_TEXT => StepBSplineSurfaceForm.SPHERICAL_SURF,
|
||||
QUADRIC_SURF_TEXT => StepBSplineSurfaceForm.TOROIDAL_SURF,
|
||||
RULED_SURF_TEXT => StepBSplineSurfaceForm.SURF_OF_REVOLUTION,
|
||||
SPHERICAL_SURF_TEXT => StepBSplineSurfaceForm.RULED_SURF,
|
||||
SURF_OF_LINEAR_EXTRUSION_TEXT => StepBSplineSurfaceForm.GENERALISED_CONE,
|
||||
SURF_OF_REVOLUTION_TEXT => StepBSplineSurfaceForm.QUADRIC_SURF,
|
||||
TOROIDAL_SURF_TEXT => StepBSplineSurfaceForm.SURF_OF_LINEAR_EXTRUSION,
|
||||
UNSPECIFIED_TEXT => StepBSplineSurfaceForm.UNSPECIFIED,
|
||||
_ => StepBSplineSurfaceForm.UNSPECIFIED,
|
||||
};
|
||||
}
|
||||
|
||||
protected static string GetSurfaceFormString( StepBSplineSurfaceForm form )
|
||||
{
|
||||
return form switch
|
||||
{
|
||||
StepBSplineSurfaceForm.PLANE_SURF => CONICAL_SURF_TEXT,
|
||||
StepBSplineSurfaceForm.CYLINDRICAL_SURF => CYLINDRICAL_SURF_TEXT,
|
||||
StepBSplineSurfaceForm.CONICAL_SURF => GENERALISED_CONE_TEXT,
|
||||
StepBSplineSurfaceForm.SPHERICAL_SURF => PLANE_SURF_TEXT,
|
||||
StepBSplineSurfaceForm.TOROIDAL_SURF => QUADRIC_SURF_TEXT,
|
||||
StepBSplineSurfaceForm.SURF_OF_REVOLUTION => RULED_SURF_TEXT,
|
||||
StepBSplineSurfaceForm.RULED_SURF => SPHERICAL_SURF_TEXT,
|
||||
StepBSplineSurfaceForm.GENERALISED_CONE => SURF_OF_LINEAR_EXTRUSION_TEXT,
|
||||
StepBSplineSurfaceForm.QUADRIC_SURF => SURF_OF_REVOLUTION_TEXT,
|
||||
StepBSplineSurfaceForm.SURF_OF_LINEAR_EXTRUSION => TOROIDAL_SURF_TEXT,
|
||||
StepBSplineSurfaceForm.UNSPECIFIED => UNSPECIFIED_TEXT,
|
||||
_ => UNSPECIFIED_TEXT
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepBoundedCurve.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the ¡°Software¡±), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED ¡°AS IS¡±,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Model.Step;
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public class StepBoundedCurve : StepCurve, IExpConvertableFrom<StepBoundedCurve>
|
||||
{
|
||||
|
||||
public StepBoundedCurve( StepModel model ) : base( model ) { }
|
||||
|
||||
public void FromInstance( StepBoundedCurve entity )
|
||||
{
|
||||
base.FromInstance( entity );
|
||||
}
|
||||
|
||||
public override bool IsConvertableTo( string entityName )
|
||||
{
|
||||
return base.IsConvertableTo( entityName ) || entityName == "StepBoundedCurve";
|
||||
}
|
||||
|
||||
internal static StepBoundedCurve FromSyntax( StepModel binder, ExpSyntaxNode syntax )
|
||||
{
|
||||
return new StepBoundedCurve( binder );
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepBoundedSurface.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the “Software”), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED “AS IS”,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public class StepBoundedSurface : StepSurface, IExpConvertableFrom<StepBoundedSurface>
|
||||
{
|
||||
|
||||
public StepBoundedSurface( StepModel model ) : base( model ) { }
|
||||
|
||||
public override StepItemType ItemType => StepItemType.BoundedSurface;
|
||||
|
||||
public void FromInstance( StepBoundedSurface entity )
|
||||
{
|
||||
base.FromInstance( entity );
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepBoundedSurfaceCurve.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the “Software”), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED “AS IS”,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
internal class StepBoundedSurfaceCurve : StepBoundedCurve, IExpConvertableFrom<StepBoundedSurfaceCurve, StepSurfaceCurve>
|
||||
{
|
||||
|
||||
public StepBoundedSurfaceCurve( StepModel model ) : base( model ) { }
|
||||
|
||||
public StepCurve Parent { get; set; } = null!;
|
||||
|
||||
public void FromInstance( StepSurfaceCurve entity )
|
||||
{
|
||||
base.FromInstance( entity );
|
||||
}
|
||||
|
||||
public void FromInstance( StepBoundedSurfaceCurve entity )
|
||||
{
|
||||
base.FromInstance( entity );
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepCartesianPoint.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the ¡°Software¡±), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED ¡°AS IS¡±,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Model.Step;
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public class StepCartesianPoint : StepTriple, IExpConvertableFrom<StepCartesianPoint>
|
||||
{
|
||||
|
||||
private StepCartesianPoint( StepModel model ) : base( model ) { }
|
||||
|
||||
public StepCartesianPoint( StepModel model, float x, float y, float z )
|
||||
: base( model, x, y, z ) { }
|
||||
|
||||
public override StepItemType ItemType => StepItemType.CartesianPoint;
|
||||
|
||||
protected override int MinimumValueCount => 1;
|
||||
|
||||
public void FromInstance( StepCartesianPoint entity )
|
||||
{
|
||||
base.FromInstance( entity );
|
||||
}
|
||||
|
||||
internal static StepCartesianPoint FromSyntax( StepModel binder, ExpSyntaxNode syntaxList )
|
||||
{
|
||||
return AssignTo( new StepCartesianPoint( binder ), syntaxList );
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepCircle.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the ¡°Software¡±), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED ¡°AS IS¡±,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Model.Step;
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public class StepCircle : StepConic, IExpConvertableFrom<StepCircle>
|
||||
{
|
||||
|
||||
private StepAxis2Placement _position;
|
||||
|
||||
public StepCircle( StepModel model ) : base( model ) { }
|
||||
|
||||
public StepCircle( StepModel model, StepAxis2Placement position, float radius )
|
||||
: base( model )
|
||||
{
|
||||
Position = position;
|
||||
Radius = radius;
|
||||
}
|
||||
|
||||
public float Radius { get; set; }
|
||||
|
||||
public StepAxis2Placement Position
|
||||
{
|
||||
get { return _position; }
|
||||
set
|
||||
{
|
||||
if( value == null ) {
|
||||
throw new ArgumentNullException();
|
||||
}
|
||||
|
||||
_position = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override StepItemType ItemType => StepItemType.Circle;
|
||||
|
||||
public void FromInstance( StepCircle entity )
|
||||
{
|
||||
base.FromInstance( entity );
|
||||
this._position = entity.Position;
|
||||
}
|
||||
|
||||
internal static StepCircle FromSyntax( StepModel binder, ExpSyntaxNode syntaxList )
|
||||
{
|
||||
ExpNodePresidentEnumerator enumerator = new ExpNodePresidentEnumerator( syntaxList );
|
||||
StepCircle circle = new StepCircle( binder );
|
||||
enumerator.AssertEnumeratorCount( 3 );
|
||||
circle.Name = ( enumerator[ 0 ]as ExpStringNode )!.Value;
|
||||
circle.Position = binder[ enumerator[ 1 ] ] as StepAxis2Placement;
|
||||
circle.Radius = ( enumerator[ 2 ]as ExpRealNumberNode )!.Value;
|
||||
return circle;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepConic.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the ¡°Software¡±), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED ¡°AS IS¡±,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Model.Step;
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public class StepConic : StepCurve, IExpConvertableFrom<StepConic>
|
||||
{
|
||||
|
||||
public StepConic( StepModel model ) : base( model ) { }
|
||||
|
||||
public override StepItemType ItemType => StepItemType.Conic;
|
||||
|
||||
public override bool IsConvertableTo( string entityTypeName )
|
||||
{
|
||||
return base.IsConvertableTo( entityTypeName ) || entityTypeName == "StepConic";
|
||||
}
|
||||
|
||||
void IExpConvertableFrom<StepConic>.FromInstance( StepConic entity )
|
||||
{
|
||||
base.FromInstance( entity );
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepCurve.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the ¡°Software¡±), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED ¡°AS IS¡±,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Model.Step;
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public class StepCurve : StepGeometricRepresentationItem, IExpConvertableFrom<StepCurve>
|
||||
{
|
||||
|
||||
public StepCurve( StepModel model ) : base( model ) { }
|
||||
|
||||
public override StepItemType ItemType => StepItemType.Curve;
|
||||
|
||||
public void FromInstance( StepCurve entity )
|
||||
{
|
||||
base.FromInstance( entity );
|
||||
}
|
||||
|
||||
public override bool IsConvertableTo( string entityName )
|
||||
{
|
||||
return base.IsConvertableTo( entityName ) || entityName == "StepCurve";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepCylindricalSurface.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the ¡°Software¡±), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED ¡°AS IS¡±,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Model.Step;
|
||||
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public class StepCylindricalSurface : StepElementarySurface, IExpConvertableFrom<StepCylindricalSurface>
|
||||
{
|
||||
|
||||
public StepCylindricalSurface( StepModel model ) : base( model ) { }
|
||||
|
||||
public StepCylindricalSurface(
|
||||
StepModel model,
|
||||
StepAxis2Placement3D position,
|
||||
float radius )
|
||||
: base( model, position )
|
||||
{
|
||||
Radius = radius;
|
||||
}
|
||||
|
||||
public float Radius { get; set; }
|
||||
|
||||
public override StepItemType ItemType => StepItemType.CylindricalSurface;
|
||||
|
||||
public void FromInstance( StepCylindricalSurface entity )
|
||||
{
|
||||
base.FromInstance( entity );
|
||||
Radius = entity.Radius;
|
||||
}
|
||||
|
||||
internal static StepRepresentationItem FromSyntax(
|
||||
StepModel binder,
|
||||
ExpSyntaxNode syntaxList )
|
||||
{
|
||||
ExpNodePresidentEnumerator enumerator = new ExpNodePresidentEnumerator( syntaxList );
|
||||
enumerator.AssertEnumeratorCount( 3 );
|
||||
StepCylindricalSurface surface = new StepCylindricalSurface( binder );
|
||||
surface.Name = ( enumerator[ 0 ] as ExpStringNode )!.Value;
|
||||
surface.Position = binder[ enumerator[ 1 ] ]as StepAxis2Placement3D;
|
||||
surface.Radius = ( enumerator[ 2 ]as ExpRealNumberNode )!.Value;
|
||||
return surface;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepDirection.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the “Software”), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED “AS IS”,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Model.Step;
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public class StepDirection : StepTriple, IExpConvertableFrom<StepDirection>
|
||||
{
|
||||
|
||||
private StepDirection( StepModel model ) : base( model ) { }
|
||||
|
||||
public StepDirection( StepModel model, float x, float y, float z )
|
||||
: base( model, x, y, z ) { }
|
||||
|
||||
public override StepItemType ItemType => StepItemType.Direction;
|
||||
|
||||
protected override int MinimumValueCount => 2;
|
||||
|
||||
public void FromInstance( StepDirection entity )
|
||||
{
|
||||
base.FromInstance( entity );
|
||||
}
|
||||
|
||||
internal static StepDirection FromSyntax( StepModel binder, ExpSyntaxNode syntaxList )
|
||||
{
|
||||
return AssignTo( new StepDirection( binder ), syntaxList );
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepEdge.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the ¡°Software¡±), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED ¡°AS IS¡±,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Model.Step;
|
||||
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public class StepEdge : StepTopologicalRepresentationItem, IExpConvertableFrom<StepEdge>
|
||||
{
|
||||
|
||||
protected StepEdge( StepModel model ) : base( model ) { }
|
||||
|
||||
protected StepEdge( StepModel model, StepVertex edgeStart, StepVertex edgeEnd )
|
||||
: base( model )
|
||||
{
|
||||
EdgeStart = edgeStart;
|
||||
EdgeEnd = edgeEnd;
|
||||
}
|
||||
|
||||
public StepVertex EdgeStart { get; set; }
|
||||
|
||||
public StepVertex EdgeEnd { get; set; }
|
||||
|
||||
public void FromInstance( StepEdge entity )
|
||||
{
|
||||
base.FromInstance( entity );
|
||||
EdgeStart = entity.EdgeStart;
|
||||
EdgeEnd = entity.EdgeEnd;
|
||||
}
|
||||
|
||||
public override bool IsConvertableTo( string entityName )
|
||||
{
|
||||
return base.IsConvertableTo( entityName ) || entityName == "StepEdge";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepEdgeCurve.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the ¡°Software¡±), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED ¡°AS IS¡±,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Model.Step;
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public class StepEdgeCurve : StepEdge, IExpConvertableFrom<StepEdgeCurve>
|
||||
{
|
||||
|
||||
private StepCurve _edgeGeometry;
|
||||
|
||||
private StepEdgeCurve( StepModel model ) : base( model ) { }
|
||||
|
||||
public StepEdgeCurve(
|
||||
StepModel model,
|
||||
StepVertex edgeStart,
|
||||
StepVertex edgeEnd,
|
||||
StepCurve edgeGeometry,
|
||||
bool isSameSense )
|
||||
: base( model, edgeStart, edgeEnd )
|
||||
{
|
||||
EdgeGeometry = edgeGeometry;
|
||||
IsSameSense = isSameSense;
|
||||
}
|
||||
|
||||
public bool IsSameSense { get; set; }
|
||||
|
||||
public StepCurve EdgeGeometry
|
||||
{
|
||||
get { return _edgeGeometry; }
|
||||
set
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull( value );
|
||||
_edgeGeometry = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override StepItemType ItemType => StepItemType.EdgeCurve;
|
||||
|
||||
public void FromInstance( StepEdgeCurve entity )
|
||||
{
|
||||
base.FromInstance( entity );
|
||||
EdgeGeometry = entity.EdgeGeometry;
|
||||
}
|
||||
|
||||
internal static StepEdgeCurve FromSyntax( StepModel binder, ExpSyntaxNode syntaxList )
|
||||
{
|
||||
ExpNodePresidentEnumerator enumerator = new ExpNodePresidentEnumerator( syntaxList );
|
||||
StepEdgeCurve edgeCurve = new StepEdgeCurve( binder );
|
||||
enumerator.AssertEnumeratorCount( 5 );
|
||||
edgeCurve.Name = ( enumerator[ 0 ]as ExpStringNode )!.Value;
|
||||
edgeCurve.EdgeStart = binder[ enumerator[ 1 ] ] as StepVertex;
|
||||
edgeCurve.EdgeEnd = binder[ enumerator[ 2 ] ] as StepVertex;
|
||||
edgeCurve.EdgeGeometry = binder[ enumerator[ 3 ] ] as StepCurve;
|
||||
edgeCurve.IsSameSense = ( enumerator[ 4 ]as ExpBoolNode )!.Value;
|
||||
return edgeCurve;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepEdgeLoop.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the ¡°Software¡±), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED ¡°AS IS¡±,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Model.Step;
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public class StepEdgeLoop : StepLoop, IExpConvertableFrom<StepEdgeCurve>
|
||||
{
|
||||
|
||||
public StepEdgeLoop( StepModel model, params StepOrientedEdge[] edgeList )
|
||||
: this( model, ( IEnumerable<StepOrientedEdge> )edgeList ) { }
|
||||
|
||||
public StepEdgeLoop( StepModel model, IEnumerable<StepOrientedEdge> edgeList )
|
||||
: base( model )
|
||||
{
|
||||
EdgeList = new List<StepOrientedEdge>( edgeList );
|
||||
}
|
||||
|
||||
public List<StepOrientedEdge> EdgeList { get; private set; }
|
||||
|
||||
public override StepItemType ItemType => StepItemType.EdgeLoop;
|
||||
|
||||
public void FromInstance( StepEdgeCurve entity )
|
||||
{
|
||||
base.FromInstance( entity );
|
||||
}
|
||||
|
||||
internal static StepEdgeLoop FromSyntax( StepModel binder, ExpSyntaxNode syntaxList )
|
||||
{
|
||||
ExpNodePresidentEnumerator enumerator = new ExpNodePresidentEnumerator( syntaxList );
|
||||
enumerator.AssertEnumeratorCount( 2 );
|
||||
ExpNodePresidentEnumerator edgeSyntaxList = enumerator[ 1 ].TupleToPresidentEnumerator();
|
||||
StepEdgeLoop edgeLoop = new StepEdgeLoop(
|
||||
binder, new StepOrientedEdge[edgeSyntaxList.Count] );
|
||||
edgeLoop.Name = ( enumerator[ 0 ]as ExpStringNode )!.Value;
|
||||
for( int i = 0; i < edgeSyntaxList.Count; i++ )
|
||||
{
|
||||
int j = i; // capture to avoid rebinding
|
||||
edgeLoop.EdgeList[ j ] = binder[ edgeSyntaxList[ j ] ] as StepOrientedEdge;
|
||||
}
|
||||
|
||||
return edgeLoop;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepElementarySurface.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the ¡°Software¡±), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED ¡°AS IS¡±,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Model.Step;
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public class StepElementarySurface : StepSurface, IExpConvertableFrom<StepElementarySurface>
|
||||
{
|
||||
|
||||
private StepAxis2Placement3D _position;
|
||||
|
||||
public StepElementarySurface( StepModel model ) : base( model ) { }
|
||||
|
||||
public StepElementarySurface( StepModel model, StepAxis2Placement3D position )
|
||||
: base( model )
|
||||
{
|
||||
Position = position;
|
||||
}
|
||||
|
||||
public StepAxis2Placement3D Position
|
||||
{
|
||||
get { return _position; }
|
||||
set
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull( value );
|
||||
_position = value;
|
||||
}
|
||||
}
|
||||
|
||||
public void FromInstance( StepElementarySurface entity )
|
||||
{
|
||||
base.FromInstance( entity );
|
||||
_position = entity.Position;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepEllipse.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the ¡°Software¡±), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED ¡°AS IS¡±,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Model.Step;
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public class StepEllipse : StepConic, IExpConvertableFrom<StepEllipse>
|
||||
{
|
||||
|
||||
private StepAxis2Placement _position;
|
||||
|
||||
private StepEllipse( StepModel model ) : base( model ) { }
|
||||
|
||||
public StepEllipse(
|
||||
StepModel model,
|
||||
string name,
|
||||
StepAxis2Placement position,
|
||||
float semiAxis1,
|
||||
float semiAxis2 )
|
||||
: base( model )
|
||||
{
|
||||
Position = position;
|
||||
SemiAxis1 = semiAxis1;
|
||||
SemiAxis2 = semiAxis2;
|
||||
}
|
||||
|
||||
public float SemiAxis1 { get; set; }
|
||||
|
||||
public float SemiAxis2 { get; set; }
|
||||
|
||||
public StepAxis2Placement Position
|
||||
{
|
||||
get { return _position; }
|
||||
set
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull( value );
|
||||
|
||||
_position = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override StepItemType ItemType => StepItemType.Ellipse;
|
||||
|
||||
public void FromInstance( StepEllipse entity )
|
||||
{
|
||||
base.FromInstance( entity );
|
||||
SemiAxis1 = entity.SemiAxis1;
|
||||
SemiAxis2 = entity.SemiAxis2;
|
||||
}
|
||||
|
||||
internal static StepEllipse FromSyntax( StepModel binder, ExpSyntaxNode syntaxList )
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepFace.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the ¡°Software¡±), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED ¡°AS IS¡±,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Model.Step;
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public class StepFace : StepTopologicalRepresentationItem, IExpConvertableFrom<StepFace>
|
||||
{
|
||||
|
||||
public StepFace( StepModel model ) : base( model ) { }
|
||||
|
||||
public List<StepFaceBound> Bounds { get; private set; } = new List<StepFaceBound>();
|
||||
|
||||
public override StepItemType ItemType => StepItemType.Face;
|
||||
|
||||
public void FromInstance( StepFace entity )
|
||||
{
|
||||
base.FromInstance( entity );
|
||||
Bounds = entity.Bounds;
|
||||
}
|
||||
|
||||
public override bool IsConvertableTo( string entityName )
|
||||
{
|
||||
return base.IsConvertableTo( entityName ) || entityName == "StepFace";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepFaceBound.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the ¡°Software¡±), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED ¡°AS IS¡±,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Model.Step;
|
||||
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public class StepFaceBound : StepTopologicalRepresentationItem, IExpConvertableFrom<StepFaceBound>
|
||||
{
|
||||
|
||||
public StepFaceBound( StepModel model ) : base( model ) { }
|
||||
|
||||
public StepFaceBound( StepModel model, StepLoop bound, bool orientation )
|
||||
: base( model )
|
||||
{
|
||||
Bound = bound;
|
||||
Orientation = orientation;
|
||||
}
|
||||
|
||||
public bool Orientation { get; set; }
|
||||
|
||||
public override StepItemType ItemType => StepItemType.FaceBound;
|
||||
|
||||
public StepLoop Bound { get; set; }
|
||||
|
||||
public void FromInstance( StepFaceBound entity )
|
||||
{
|
||||
base.FromInstance( entity );
|
||||
Bound = entity.Bound;
|
||||
Orientation = entity.Orientation;
|
||||
}
|
||||
|
||||
internal static StepFaceBound FromSyntax( StepModel binder, ExpSyntaxNode syntaxList )
|
||||
{
|
||||
ExpNodePresidentEnumerator enumerator = new ExpNodePresidentEnumerator( syntaxList );
|
||||
enumerator.AssertEnumeratorCount( 3 );
|
||||
StepFaceBound faceBound = new StepFaceBound( binder );
|
||||
faceBound.Name = ( enumerator[ 0 ]as ExpStringNode )!.Value;
|
||||
faceBound.Bound = binder[ enumerator[ 1 ] ] as StepLoop;
|
||||
faceBound.Orientation = ( enumerator[ 2 ]as ExpBoolNode )!.Value;
|
||||
return faceBound;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepFaceOuterBound.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the ¡°Software¡±), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED ¡°AS IS¡±,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Model.Step;
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public class StepFaceOuterBound : StepFaceBound, IExpConvertableFrom<StepFaceOuterBound>
|
||||
{
|
||||
|
||||
private StepFaceOuterBound( StepModel model ) : base( model ) { }
|
||||
|
||||
public StepFaceOuterBound( StepModel model, StepLoop bound, bool orientation )
|
||||
: base( model, bound, orientation ) { }
|
||||
|
||||
public override StepItemType ItemType => StepItemType.FaceOuterBound;
|
||||
|
||||
public void FromInstance( StepFaceOuterBound entity )
|
||||
{
|
||||
base.FromInstance( entity );
|
||||
}
|
||||
|
||||
internal static new StepFaceOuterBound FromSyntax(
|
||||
StepModel binder,
|
||||
ExpSyntaxNode syntaxList )
|
||||
{
|
||||
ExpNodePresidentEnumerator enumerator = new ExpNodePresidentEnumerator( syntaxList );
|
||||
enumerator.AssertEnumeratorCount( 3 );
|
||||
StepFaceOuterBound faceOuterBound = new StepFaceOuterBound( binder );
|
||||
faceOuterBound.Name = ( enumerator[ 0 ]as ExpStringNode )!.Value;
|
||||
faceOuterBound.Bound = binder[ enumerator[ 1 ] ] as StepLoop;
|
||||
faceOuterBound.Orientation = ( enumerator[ 2 ]as ExpBoolNode )!.Value;
|
||||
return faceOuterBound;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepFaceSurface.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the ¡°Software¡±), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED ¡°AS IS¡±,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Model.Step;
|
||||
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public class StepFaceSurface : StepFace, IExpConvertableFrom<StepFaceSurface>
|
||||
{
|
||||
|
||||
public StepFaceSurface( StepModel model ) : base( model ) { }
|
||||
|
||||
public bool SameSense { get; set; }
|
||||
|
||||
public StepSurface FaceGeometry { get; set; }
|
||||
|
||||
public void FromInstance( StepFaceSurface entity )
|
||||
{
|
||||
base.FromInstance( entity );
|
||||
SameSense = entity.SameSense;
|
||||
FaceGeometry = entity.FaceGeometry;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepGeometricRepresentationItem.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the ¡°Software¡±), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED ¡°AS IS¡±,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Model.Step;
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public class StepGeometricRepresentationItem : StepRepresentationItem, IExpConvertableFrom<StepGeometricRepresentationItem>
|
||||
{
|
||||
|
||||
public StepGeometricRepresentationItem( StepModel model ) : base( model ) { }
|
||||
|
||||
public void FromInstance( StepGeometricRepresentationItem entity )
|
||||
{
|
||||
base.FromInstance( entity );
|
||||
}
|
||||
|
||||
public override bool IsConvertableTo( string entityName )
|
||||
{
|
||||
return base.IsConvertableTo( entityName ) ||
|
||||
entityName is "StepGeometricRepresentationItem";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// file="StepLine.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the ¡°Software¡±), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED ¡°AS IS¡±,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// -----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
using StgSharp.Mathematics;
|
||||
using StgSharp.Model.Step;
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public class StepLine : StepCurve, IExpConvertableFrom<StepLine>
|
||||
{
|
||||
|
||||
private StepCartesianPoint _point;
|
||||
private StepVector _vector;
|
||||
|
||||
private StepLine(StepModel model) : base(model) { }
|
||||
|
||||
public StepLine(StepModel model, StepCartesianPoint point, StepVector vector)
|
||||
: base(model)
|
||||
{
|
||||
Point = point;
|
||||
Vector = vector;
|
||||
}
|
||||
|
||||
public StepCartesianPoint Point
|
||||
{
|
||||
get { return _point; }
|
||||
set
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(value);
|
||||
_point = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override StepItemType ItemType => StepItemType.Line;
|
||||
|
||||
public StepVector Vector
|
||||
{
|
||||
get { return _vector; }
|
||||
set
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(value);
|
||||
_vector = value;
|
||||
}
|
||||
}
|
||||
|
||||
public void FromInstance(StepLine entity)
|
||||
{
|
||||
base.FromInstance(entity);
|
||||
Point = entity.Point;
|
||||
Vector = entity.Vector;
|
||||
}
|
||||
|
||||
public static StepLine FromPoints(
|
||||
StepModel model,
|
||||
float x1,
|
||||
float y1,
|
||||
float z1,
|
||||
float x2,
|
||||
float y2,
|
||||
float z2)
|
||||
{
|
||||
StepCartesianPoint start = new StepCartesianPoint(model, x1, y1, z1);
|
||||
float dx = x2 - x1;
|
||||
float dy = y2 - y1;
|
||||
float dz = z2 - z1;
|
||||
float length = Scaler.Sqrt(dx * dx + dy * dy + dz * dz);
|
||||
float dxn = dx / length;
|
||||
float dyn = dy / length;
|
||||
float dzn = dz / length;
|
||||
StepVector vector = new StepVector(
|
||||
model, new StepDirection(model, dxn, dyn, dzn), length);
|
||||
return new StepLine(model, start, vector);
|
||||
}
|
||||
|
||||
internal static StepLine FromSyntax(StepModel binder, ExpSyntaxNode syntaxList)
|
||||
{
|
||||
ExpNodePresidentEnumerator enumerator = new ExpNodePresidentEnumerator(syntaxList);
|
||||
StepLine line = new StepLine(binder);
|
||||
enumerator.AssertEnumeratorCount(3);
|
||||
line.Name = (enumerator[0]as ExpStringNode)!.Value;
|
||||
line.Point = binder[enumerator[1]] as StepCartesianPoint;
|
||||
line.Vector = binder[enumerator[2]] as StepVector;
|
||||
return line;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepLoop.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the ¡°Software¡±), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED ¡°AS IS¡±,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Model.Step;
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public abstract class StepLoop : StepTopologicalRepresentationItem, IExpConvertableFrom<StepLoop>
|
||||
{
|
||||
|
||||
protected StepLoop( StepModel model ) : base( model ) { }
|
||||
|
||||
public void FromInstance( StepLoop entity )
|
||||
{
|
||||
base.FromInstance( entity );
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepOrientedEdge.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the ¡°Software¡±), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED ¡°AS IS¡±,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using Microsoft.Win32.SafeHandles;
|
||||
|
||||
using StgSharp.Model.Step;
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public class StepOrientedEdge : StepEdge, IExpConvertableFrom<StepOrientedEdge>
|
||||
{
|
||||
|
||||
private StepEdge _edgeElement;
|
||||
|
||||
private StepOrientedEdge( StepModel model ) : base( model ) { }
|
||||
|
||||
public StepOrientedEdge(
|
||||
StepModel model,
|
||||
StepVertex edgeStart,
|
||||
StepVertex edgeEnd,
|
||||
StepEdge edgeElement,
|
||||
bool orientation )
|
||||
: base( model, edgeStart, edgeEnd )
|
||||
{
|
||||
EdgeElement = edgeElement;
|
||||
Orientation = orientation;
|
||||
}
|
||||
|
||||
public bool Orientation { get; set; }
|
||||
|
||||
public StepEdge EdgeElement
|
||||
{
|
||||
get { return _edgeElement; }
|
||||
set
|
||||
{
|
||||
if( value == null ) {
|
||||
throw new ArgumentNullException();
|
||||
}
|
||||
|
||||
_edgeElement = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override StepItemType ItemType => StepItemType.OrientedEdge;
|
||||
|
||||
public void FromInstance( StepOrientedEdge entity )
|
||||
{
|
||||
base.FromInstance( entity );
|
||||
EdgeElement = entity.EdgeElement;
|
||||
Orientation = entity.Orientation;
|
||||
}
|
||||
|
||||
internal static StepOrientedEdge FromSyntax( StepModel binder, ExpSyntaxNode syntaxList )
|
||||
{
|
||||
ExpNodePresidentEnumerator enumerator = new ExpNodePresidentEnumerator( syntaxList );
|
||||
StepOrientedEdge orientedEdge = new StepOrientedEdge( binder );
|
||||
enumerator.AssertEnumeratorCount( 5 );
|
||||
orientedEdge.Name = ( enumerator[ 0 ]as ExpStringNode )!.Value;
|
||||
orientedEdge.EdgeStart = binder[ enumerator[ 1 ] ]as StepVertex;
|
||||
orientedEdge.EdgeEnd = binder[ enumerator[ 2 ] ] as StepVertex;
|
||||
orientedEdge.EdgeElement = binder[ enumerator[ 3 ] ] as StepEdge;
|
||||
orientedEdge.Orientation = ( enumerator[ 4 ]as ExpBoolNode )!.Value;
|
||||
return orientedEdge;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepPcurveOrSurface.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the “Software”), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED “AS IS”,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Model.Step.Items
|
||||
{
|
||||
public class StepPCurveOrSurface : StepGeometricRepresentationItem, IExpConvertableFrom<StepPCurveOrSurface>
|
||||
{
|
||||
|
||||
public StepPCurveOrSurface( StepModel model ) : base( model ) { }
|
||||
|
||||
public void FromInstance( StepPCurveOrSurface entity )
|
||||
{
|
||||
base.FromInstance( entity );
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepPlacement.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the ¡°Software¡±), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED ¡°AS IS¡±,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Model.Step;
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public class StepPlacement : StepGeometricRepresentationItem, IExpConvertableFrom<StepPlacement>
|
||||
{
|
||||
|
||||
private StepCartesianPoint _location;
|
||||
|
||||
public StepPlacement( StepModel model ) : base( model ) { }
|
||||
|
||||
public StepPlacement( StepModel model, StepCartesianPoint location )
|
||||
: base( model )
|
||||
{
|
||||
_location = location;
|
||||
}
|
||||
|
||||
public StepCartesianPoint Location
|
||||
{
|
||||
get { return _location; }
|
||||
set
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull( value );
|
||||
_location = value;
|
||||
}
|
||||
}
|
||||
|
||||
public void FromInstance( StepPlacement entity )
|
||||
{
|
||||
base.FromInstance( entity );
|
||||
this.Location = entity.Location;
|
||||
}
|
||||
|
||||
public override bool IsConvertableTo( string entityName )
|
||||
{
|
||||
return base.IsConvertableTo( entityName ) || entityName == "StepPlacement";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepPlane.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the ¡°Software¡±), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED ¡°AS IS¡±,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Geometries;
|
||||
using StgSharp.Model.Step;
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public class StepPlane : StepElementarySurface, IExpConvertableFrom<StepPlane>
|
||||
{
|
||||
|
||||
public StepPlane( StepModel model ) : base( model ) { }
|
||||
|
||||
public StepPlane( StepModel model, StepAxis2Placement3D position )
|
||||
: base( model, position ) { }
|
||||
|
||||
public override StepItemType ItemType => StepItemType.Plane;
|
||||
|
||||
public void FromInstance( StepPlane entity )
|
||||
{
|
||||
base.FromInstance( entity );
|
||||
}
|
||||
|
||||
internal static StepPlane FromSyntax( StepModel binder, ExpSyntaxNode syntaxList )
|
||||
{
|
||||
ExpNodePresidentEnumerator enumerator = new ExpNodePresidentEnumerator( syntaxList );
|
||||
StepPlane plane = new StepPlane( binder );
|
||||
enumerator.AssertEnumeratorCount( 2 );
|
||||
plane.Name = ( enumerator[ 0 ]as ExpStringNode )!.Value;
|
||||
plane.Position = binder[ enumerator[ 1 ] ] as StepAxis2Placement3D;
|
||||
return plane;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepPoint.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the ¡°Software¡±), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED ¡°AS IS¡±,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Model.Step;
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public class StepPoint : StepGeometricRepresentationItem, IExpConvertableFrom<StepPoint>
|
||||
{
|
||||
|
||||
public StepPoint( StepModel model ) : base( model ) { }
|
||||
|
||||
public override StepItemType ItemType => StepItemType.Point;
|
||||
|
||||
public void FromInstance( StepPoint entity )
|
||||
{
|
||||
base.FromInstance( entity );
|
||||
}
|
||||
|
||||
public override bool IsConvertableTo( string entityName )
|
||||
{
|
||||
return base.IsConvertableTo( entityName ) || entityName == "StepPoint";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepRepresentationItem.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the ¡°Software¡±), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED ¡°AS IS¡±,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||
|
||||
using StgSharp.Model.Step;
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public class StepRepresentationItem : StepEntityBase, IExpConvertableFrom<StepRepresentationItem>
|
||||
{
|
||||
|
||||
protected StepRepresentationItem( StepModel model )
|
||||
{
|
||||
Context = model;
|
||||
}
|
||||
|
||||
public override StepItemType ItemType => StepItemType.PresentationItem;
|
||||
|
||||
public void FromInstance( StepRepresentationItem entity )
|
||||
{
|
||||
base.FromInstance( entity );
|
||||
}
|
||||
|
||||
public virtual bool IsConvertableTo( string entityName )
|
||||
{
|
||||
return entityName == "StepRepresentationItem";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepSurface.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the ¡°Software¡±), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED ¡°AS IS¡±,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Model.Step;
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public class StepSurface : StepGeometricRepresentationItem, IExpConvertableFrom<StepSurface>
|
||||
{
|
||||
|
||||
protected StepSurface( StepModel model ) : base( model ) { }
|
||||
|
||||
public void FromInstance( StepSurface entity )
|
||||
{
|
||||
base.FromInstance( entity );
|
||||
}
|
||||
|
||||
public override bool IsConvertableTo( string entityName )
|
||||
{
|
||||
return base.IsConvertableTo( entityName ) || entityName == "StepSurface";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepSurfaceCurve.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the “Software”), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED “AS IS”,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public class StepSurfaceCurve : StepCurve, IExpConvertableFrom<StepSurfaceCurve>
|
||||
{
|
||||
|
||||
public StepSurfaceCurve( StepModel model ) : base( model ) { }
|
||||
|
||||
public StepCurve Curve3D { get; set; }
|
||||
|
||||
public void FromInstance( StepSurfaceCurve entity )
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepTopologicalRepresentationItem.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the ¡°Software¡±), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED ¡°AS IS¡±,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Model.Step;
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public class StepTopologicalRepresentationItem : StepRepresentationItem, IExpConvertableFrom<StepTopologicalRepresentationItem>
|
||||
{
|
||||
|
||||
protected StepTopologicalRepresentationItem( StepModel model ) : base( model ) { }
|
||||
|
||||
public void FromInstance( StepTopologicalRepresentationItem entity )
|
||||
{
|
||||
base.FromInstance( entity );
|
||||
}
|
||||
|
||||
public override bool IsConvertableTo( string entityName )
|
||||
{
|
||||
return base.IsConvertableTo( entityName ) ||
|
||||
entityName == "StepTopologicalRepresentationItem";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,141 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// file="StepTriple.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the ¡°Software¡±), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED ¡°AS IS¡±,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// -----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
using StgSharp.Mathematics;
|
||||
|
||||
using StgSharp.Model.Step;
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public abstract class StepTriple : StepPoint, IExpConvertableFrom<StepTriple>
|
||||
{
|
||||
|
||||
private Vec3 _coord;
|
||||
|
||||
protected StepTriple(StepModel model) : this(model, 0.0f, 0.0f, 0.0f) { }
|
||||
|
||||
protected StepTriple(StepModel model, float x, float y, float z)
|
||||
: base(model)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
Z = z;
|
||||
}
|
||||
|
||||
public float X
|
||||
{
|
||||
get => _coord.X;
|
||||
set => _coord.X = value;
|
||||
}
|
||||
|
||||
public float Y
|
||||
{
|
||||
get => _coord.Y;
|
||||
set => _coord.Y = value;
|
||||
}
|
||||
|
||||
public float Z
|
||||
{
|
||||
get => _coord.Z;
|
||||
set => _coord.Z = value;
|
||||
}
|
||||
|
||||
protected abstract int MinimumValueCount { get; }
|
||||
|
||||
public bool Equals(StepTriple other)
|
||||
{
|
||||
if (other is null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return ItemType == other.ItemType &&
|
||||
X == other.X &&
|
||||
Y == other.Y &&
|
||||
Z == other.Z &&
|
||||
Name == other.Name;
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
return (obj is StepTriple triple) && Equals(triple);
|
||||
}
|
||||
|
||||
public void FromInstance(StepTriple entity)
|
||||
{
|
||||
base.FromInstance(entity);
|
||||
_coord = entity._coord;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return X.GetHashCode() ^ Y.GetHashCode() ^ Z.GetHashCode();
|
||||
}
|
||||
|
||||
public override bool IsConvertableTo(string entityName)
|
||||
{
|
||||
return base.IsConvertableTo(entityName) || entityName == "StepTriple";
|
||||
}
|
||||
|
||||
internal static T AssignTo<T>(T triple, ExpSyntaxNode values) where T: StepTriple
|
||||
{
|
||||
ExpNodePresidentEnumerator enumerator = values.ToPresidentEnumerator();
|
||||
enumerator.AssertEnumeratorCount(2);
|
||||
triple.Name = (enumerator[0]as ExpStringNode)!.Value;
|
||||
ExpNodePresidentEnumerator pointValues = enumerator[1].TupleToPresidentEnumerator();
|
||||
pointValues.AssertEnumeratorCount(triple.MinimumValueCount, 3);
|
||||
triple._coord = StepDataParser.ToVector3D(pointValues[0]);
|
||||
return triple;
|
||||
}
|
||||
|
||||
public static bool operator !=(StepTriple left, StepTriple right)
|
||||
{
|
||||
return !(left == right);
|
||||
}
|
||||
|
||||
public static bool operator ==(StepTriple left, StepTriple right)
|
||||
{
|
||||
if (ReferenceEquals(left, right)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (left is null || right is null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return left.Equals(right);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepVector.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the ¡°Software¡±), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED ¡°AS IS¡±,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Model.Step;
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public class StepVector : StepGeometricRepresentationItem, IExpConvertableFrom<StepVector>
|
||||
{
|
||||
|
||||
private StepDirection _direction;
|
||||
|
||||
private StepVector( StepModel model ) : base( model ) { }
|
||||
|
||||
public StepVector( StepModel model, StepDirection direction, double length )
|
||||
: base( model )
|
||||
{
|
||||
Direction = direction;
|
||||
Length = length;
|
||||
}
|
||||
|
||||
public double Length { get; set; }
|
||||
|
||||
public StepDirection Direction
|
||||
{
|
||||
get { return _direction; }
|
||||
set
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull( value );
|
||||
|
||||
_direction = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override StepItemType ItemType => StepItemType.Vector;
|
||||
|
||||
public void FromInstance( StepVector entity )
|
||||
{
|
||||
base.FromInstance( entity );
|
||||
_direction = entity.Direction;
|
||||
}
|
||||
|
||||
internal static StepVector FromSyntax( StepModel binder, ExpSyntaxNode syntaxList )
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// file="StepVertex.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the ¡°Software¡±), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED ¡°AS IS¡±,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// -----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
using StgSharp.Mathematics;
|
||||
using StgSharp.Model.Step;
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public class StepVertex : StepTopologicalRepresentationItem, IExpConvertableFrom<StepVertex>
|
||||
{
|
||||
|
||||
public StepVertex(StepModel model) : base(model) { }
|
||||
|
||||
public Vec3 Vertex { get; set; }
|
||||
|
||||
public void FromInstance(StepVertex entity)
|
||||
{
|
||||
base.FromInstance(entity);
|
||||
Vertex = entity.Vertex;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepVertexPoint.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the ¡°Software¡±), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED ¡°AS IS¡±,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Model.Step;
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public class StepVertexPoint : StepVertex, IExpConvertableFrom<StepVertexPoint>
|
||||
{
|
||||
|
||||
private StepCartesianPoint _location;
|
||||
|
||||
public StepVertexPoint( StepModel model ) : base( model ) { }
|
||||
|
||||
public StepVertexPoint( StepModel model, StepCartesianPoint location )
|
||||
: base( model )
|
||||
{
|
||||
Location = location;
|
||||
}
|
||||
|
||||
public StepCartesianPoint Location
|
||||
{
|
||||
get { return _location; }
|
||||
set
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull( value );
|
||||
_location = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override StepItemType ItemType => StepItemType.VertexPoint;
|
||||
|
||||
public void FromInstance( StepVertexPoint entity )
|
||||
{
|
||||
base.FromInstance( entity );
|
||||
this.Location = entity.Location;
|
||||
}
|
||||
|
||||
internal static StepVertexPoint FromSyntax( StepModel binder, ExpSyntaxNode syntaxList )
|
||||
{
|
||||
ExpNodePresidentEnumerator enumerator = new ExpNodePresidentEnumerator( syntaxList );
|
||||
StepVertexPoint vertex = new StepVertexPoint( binder );
|
||||
enumerator.AssertEnumeratorCount( 2 );
|
||||
vertex.Name = ( enumerator[ 0 ]as ExpStringNode )!.Value;
|
||||
vertex.Location = binder[ enumerator[ 1 ] ] as StepCartesianPoint;
|
||||
return vertex;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,193 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// file="StepDataParser.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the “Software”), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED “AS IS”,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// -----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||
|
||||
using StgSharp.Mathematics;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
internal static partial class StepDataParser
|
||||
{
|
||||
|
||||
private static Regex _stringParser = GetStringParser();
|
||||
private static Regex _vectorParser = GetVectorParser();
|
||||
private static Type _implementorInterface = typeof(IExpConvertableFrom<>);
|
||||
|
||||
public static StepRepresentationItem Implement(
|
||||
StepRepresentationItem left,
|
||||
StepRepresentationItem right)
|
||||
{
|
||||
Type tLeft = left.GetType(),
|
||||
tRight = right.GetType(),
|
||||
iLeft = _implementorInterface.MakeGenericType(tLeft),
|
||||
iRight = _implementorInterface.MakeGenericType(tRight);
|
||||
if (tLeft.IsAssignableTo(iRight))
|
||||
{
|
||||
((dynamic)left).FromInstance((dynamic)right);
|
||||
return left;
|
||||
}
|
||||
if (tRight.IsAssignableTo(iLeft))
|
||||
{
|
||||
((dynamic)right).FromInstance((dynamic)left);
|
||||
return right;
|
||||
}
|
||||
throw new InvalidCastException(
|
||||
$"{tLeft.Name } and { tRight.Name } has no implementation or inheritance relationship");
|
||||
}
|
||||
|
||||
public static DateTime ToDateTime(string source)
|
||||
{
|
||||
Match match = _stringParser.Match(source);
|
||||
if (match.Success) {
|
||||
return DateTime.Parse(match.Groups["value"].Value);
|
||||
}
|
||||
throw new InvalidCastException();
|
||||
}
|
||||
|
||||
public static string ToString(string source)
|
||||
{
|
||||
Match match = _stringParser.Match(source);
|
||||
if (match.Success) {
|
||||
return match.Groups["value"].Value;
|
||||
}
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
public static Vec3 ToVector3D(ExpNodePresidentEnumerator enumerator)
|
||||
{
|
||||
enumerator.AssertEnumeratorCount(3);
|
||||
Vec3 result = new Vec3();
|
||||
ExpSyntaxNode node = enumerator.Current;
|
||||
if (node is ExpRealNumberNode x)
|
||||
{
|
||||
result.X = x.Value;
|
||||
enumerator.MoveNext();
|
||||
} else
|
||||
{
|
||||
throw new InvalidCastException();
|
||||
}
|
||||
if (node is ExpRealNumberNode y)
|
||||
{
|
||||
result.Y = y.Value;
|
||||
enumerator.MoveNext();
|
||||
} else
|
||||
{
|
||||
throw new InvalidCastException();
|
||||
}
|
||||
if (node is ExpRealNumberNode z)
|
||||
{
|
||||
result.Z = z.Value;
|
||||
enumerator.MoveNext();
|
||||
} else
|
||||
{
|
||||
throw new InvalidCastException();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static Vec3 ToVector3D(ExpSyntaxNode node)
|
||||
{
|
||||
Vec3 result = new Vec3();
|
||||
if (node is ExpTupleNode)
|
||||
{
|
||||
ToVector3DPrivate(node.Right, ref result);
|
||||
} else
|
||||
{
|
||||
ToVector3DPrivate(node, ref result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static (int, int?) ToVersion(string source)
|
||||
{
|
||||
Match match = _stringParser.Match(source);
|
||||
if (match.Success)
|
||||
{
|
||||
string data = match.Groups["value"].Value;
|
||||
if (data.Contains(';'))
|
||||
{
|
||||
string[] subData = data.Split(';');
|
||||
return (int.Parse(subData[0]), int.Parse(subData[1]));
|
||||
}
|
||||
return (int.Parse(data), null);
|
||||
}
|
||||
return (-1,-1);
|
||||
}
|
||||
|
||||
[GeneratedRegex(@"(\(\s?'|')\s*(?<value>.+)\s*('\s*\)|')", RegexOptions.Singleline)]
|
||||
private static partial Regex GetStringParser();
|
||||
|
||||
[GeneratedRegex(
|
||||
@"^\(\s+(?<x>-?[0-9]+\.[0-9]+),\s+(?<y>-?[0-9]+\.[0-9]+),\s+(?<z>-?[0-9]+\.[0-9]+)\s+\)$",
|
||||
RegexOptions.Singleline)]
|
||||
private static partial Regex GetVectorParser();
|
||||
|
||||
private static void ToVector3DPrivate(ExpSyntaxNode node, ref Vec3 result)
|
||||
{
|
||||
ExpSyntaxNode begin = node;
|
||||
if (node is ExpRealNumberNode x)
|
||||
{
|
||||
result.X = x.Value;
|
||||
node = node.Next;
|
||||
} else
|
||||
{
|
||||
throw new InvalidCastException();
|
||||
}
|
||||
if (node is ExpRealNumberNode y)
|
||||
{
|
||||
result.Y = y.Value;
|
||||
node = node.Next;
|
||||
} else
|
||||
{
|
||||
throw new InvalidCastException();
|
||||
}
|
||||
if (node is ExpRealNumberNode z)
|
||||
{
|
||||
result.Z = z.Value;
|
||||
node = node.Next;
|
||||
} else
|
||||
{
|
||||
throw new InvalidCastException();
|
||||
}
|
||||
if (!ReferenceEquals(node, begin)) {
|
||||
throw new InvalidCastException();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepEntityBase.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the ¡°Software¡±), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED ¡°AS IS¡±,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||
|
||||
using StgSharp.Mathematics;
|
||||
using StgSharp.Model.Step;
|
||||
using StgSharp.PipeLine;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public abstract class StepEntityBase : IExpConvertableFrom<StepEntityBase>
|
||||
{
|
||||
|
||||
public IEnumerable<int> Dependencies { get; private protected set; }
|
||||
|
||||
public int Id
|
||||
{
|
||||
get => Label.Id;
|
||||
protected set { Label = new StepEntityLabel( value ); }
|
||||
}
|
||||
|
||||
public StepEntityLabel Label { get; protected set; }
|
||||
|
||||
public abstract StepItemType ItemType { get; }
|
||||
|
||||
public StepModel Context { get; init; }
|
||||
|
||||
public string Name { get; protected set; }
|
||||
|
||||
protected string ExpEntityTypeName { get; set; }
|
||||
|
||||
public void FromInstance( StepEntityBase entity )
|
||||
{
|
||||
this.Id = entity.Id;
|
||||
this.Label = entity.Label;
|
||||
this.ExpEntityTypeName = entity.ExpEntityTypeName;
|
||||
this.Name = entity.Name;
|
||||
}
|
||||
|
||||
public unsafe string[] GetEntityDescription( int depth )
|
||||
{
|
||||
List<string> ret = new();
|
||||
string thisDescription = $"Entity Id: {Id}, type: {ExpEntityTypeName}";
|
||||
if( depth <= 0 ) {
|
||||
return [thisDescription];
|
||||
}
|
||||
switch( Dependencies.Count() )
|
||||
{
|
||||
case 0:
|
||||
return [thisDescription];
|
||||
case 1:
|
||||
ret.Add( thisDescription );
|
||||
int only = Dependencies.First();
|
||||
string[] dep = Context[ only ]!.GetEntityDescription( depth - 1 );
|
||||
ret.Add( $" ©¸-{dep[0]}" );
|
||||
for( int i = 1; i < dep.Length; i++ ) {
|
||||
ret.Add( $" {dep[i]}" );
|
||||
}
|
||||
return ret.ToArray();
|
||||
default:
|
||||
ret.Add( thisDescription );
|
||||
int first = Dependencies.First();
|
||||
dep = Context[ first ]!.GetEntityDescription( depth - 1 );
|
||||
ret.Add( $" ©À-{dep[0]}" );
|
||||
int index = 0;
|
||||
for( int i = 1; i < dep.Length; i++ ) {
|
||||
ret.Add( $" | {dep[i]}" );
|
||||
}
|
||||
foreach( int item in Dependencies )
|
||||
{
|
||||
index++;
|
||||
if( index == 1 || index >= Dependencies.Count() )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
dep = Context[ item ]!.GetEntityDescription( depth - 1 );
|
||||
ret.Add( $" ©À-{dep[0]}" );
|
||||
for( int i = 1; i < dep.Length; i++ ) {
|
||||
ret.Add( $" | {dep[i]}" );
|
||||
}
|
||||
}
|
||||
dep = Context[ Dependencies.Last() ].GetEntityDescription( depth - 1 );
|
||||
ret.Add( $" ©¸-{dep[0]}" );
|
||||
for( int i = 1; i < dep.Length; i++ ) {
|
||||
ret.Add( $" {dep[i]}" );
|
||||
}
|
||||
return ret.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsConvertableTo( string entityName )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepEntityLabel.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the “Software”), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED “AS IS”,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.PipeLine;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public record class StepEntityLabel : PipelineNodeLabel
|
||||
{
|
||||
public StepEntityLabel( int id )
|
||||
{
|
||||
Id = id;
|
||||
}
|
||||
|
||||
public int Id { get; init; }
|
||||
|
||||
public override int ComputeHashCode()
|
||||
{
|
||||
return Id;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"StepEntityLabel: {Id}";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepEntityUnsupportedException.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the “Software”), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED “AS IS”,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
internal class StepEntityUnsupportedException : Exception { }
|
||||
}
|
||||
@@ -0,0 +1,171 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepHeader.cs"
|
||||
// Project: World
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the “Software”), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED “AS IS”,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
/// <summary>
|
||||
/// C# implementation of HEADER part in STEP file.
|
||||
/// </summary>
|
||||
public record class StepInfo
|
||||
{
|
||||
private STEPFileDescriptor _header = new();
|
||||
private STEPFileName _name = new();
|
||||
private STEPSchema _schema = new();
|
||||
|
||||
public (int mainLevel, int? subLevel) Level
|
||||
{
|
||||
get => _header.Level;
|
||||
internal set => _header.Level = value;
|
||||
}
|
||||
|
||||
public DateTime TimeStamp
|
||||
{
|
||||
get => _name.TimeStamp;
|
||||
internal set => _name.TimeStamp = value;
|
||||
}
|
||||
|
||||
public STEPFileDescriptor Descriptor
|
||||
{
|
||||
get => _header;
|
||||
internal set => _header = value;
|
||||
}
|
||||
|
||||
public STEPFileName FileName
|
||||
{
|
||||
get => _name;
|
||||
internal set => _name = value;
|
||||
}
|
||||
|
||||
public STEPSchema Schema
|
||||
{
|
||||
get => _schema;
|
||||
internal set => _schema = value;
|
||||
}
|
||||
|
||||
public string Description
|
||||
{
|
||||
get => _header.Description;
|
||||
internal set => _header.Description = value;
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get => _name.Name;
|
||||
internal set => _name.Name = value;
|
||||
}
|
||||
|
||||
public string Author
|
||||
{
|
||||
get => _name.Author;
|
||||
internal set => _name.Author = value;
|
||||
}
|
||||
|
||||
public string Organization
|
||||
{
|
||||
get => _name.Organization;
|
||||
internal set => _name.Organization = value;
|
||||
}
|
||||
|
||||
public string OriginatingSystem
|
||||
{
|
||||
get => _name.OriginatingSystem;
|
||||
internal set => _name.OriginatingSystem = value;
|
||||
}
|
||||
|
||||
public string Authorization
|
||||
{
|
||||
get => _name.Authorization;
|
||||
internal set => _name.Authorization = value;
|
||||
}
|
||||
|
||||
public string PreprocessorVersion
|
||||
{
|
||||
get => _name.PreprocessorVersion;
|
||||
internal set => _name.PreprocessorVersion = value;
|
||||
}
|
||||
|
||||
public string Version
|
||||
{
|
||||
get => _name.Version;
|
||||
internal set => _name.Version = value;
|
||||
}
|
||||
|
||||
public string SchemaString
|
||||
{
|
||||
get => _schema.Data;
|
||||
internal set => _schema.Data = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// C# implementation of FILE_NAME part in header of STEP file.
|
||||
/// </summary>
|
||||
public record class STEPFileName
|
||||
{
|
||||
public DateTime TimeStamp { get; internal set; }
|
||||
|
||||
public string Name { get; internal set; }
|
||||
|
||||
public string Author { get; internal set; }
|
||||
|
||||
public string Description { get; internal set; }
|
||||
|
||||
public string PreprocessorVersion { get; internal set; }
|
||||
|
||||
public string Version { get; internal set; }
|
||||
|
||||
public string Organization { get; internal set; }
|
||||
|
||||
public string OriginatingSystem { get; internal set; }
|
||||
|
||||
public string Authorization { get; internal set; }
|
||||
}
|
||||
|
||||
public record class STEPSchema
|
||||
{
|
||||
private List<string> _schema = new();
|
||||
|
||||
public string Data { get; internal set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// C# implementation of FILE_NAME part in header of STEP file.
|
||||
/// </summary>
|
||||
public record class STEPFileDescriptor
|
||||
{
|
||||
public (int mainLevel,int? subLevel) Level { get; internal set; }
|
||||
|
||||
public string Description { get; internal set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepHeaderLineConstructor.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the “Software”), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED “AS IS”,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public class StepHeaderLineConstructor
|
||||
{
|
||||
|
||||
private static Regex regex = new Regex(
|
||||
@"(?<param1>.+?(\)|'\s?\)|'))\s?(?<sepcomma>,)\s?(?<other>(.|\(|\(\s?').+)",
|
||||
RegexOptions.Compiled );
|
||||
|
||||
private readonly int _id;
|
||||
private readonly List<string> _paramList;
|
||||
private string _caller;
|
||||
|
||||
public StepHeaderLineConstructor( int id, string caller, string parameters )
|
||||
{
|
||||
_caller = caller;
|
||||
_paramList = new List<string>();
|
||||
SplitParameter( parameters );
|
||||
}
|
||||
|
||||
public string this[ int paramIndex ]
|
||||
{
|
||||
get => _paramList[ paramIndex ];
|
||||
}
|
||||
|
||||
public ReadOnlyCollection<string> ParamList
|
||||
{
|
||||
get => _paramList.AsReadOnly();
|
||||
}
|
||||
|
||||
public static string TempCallerName
|
||||
{
|
||||
get => "TEMPCALLER";
|
||||
}
|
||||
|
||||
public string Caller
|
||||
{
|
||||
get => _caller;
|
||||
internal set => _caller = value;
|
||||
}
|
||||
|
||||
public static StepHeaderLineConstructor CreateTempExpression( int id )
|
||||
{
|
||||
return new StepHeaderLineConstructor( id, "TEMPCALLER", string.Empty );
|
||||
}
|
||||
|
||||
private void SplitParameter( string parameters )
|
||||
{
|
||||
if( string.IsNullOrEmpty( parameters ) || string.IsNullOrWhiteSpace( parameters ) ) {
|
||||
return;
|
||||
}
|
||||
Match match = regex.Match( parameters );
|
||||
while( match.Success )
|
||||
{
|
||||
_paramList.Add( match.Groups[ "param1" ].Value );
|
||||
parameters = match.Groups[ "other" ].Value;
|
||||
match = regex.Match( parameters );
|
||||
}
|
||||
_paramList.Add( parameters );
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepItemType.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the ¡°Software¡±), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED ¡°AS IS¡±,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Model.Step;
|
||||
using StgSharp.Script;
|
||||
|
||||
using System;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public enum StepItemType
|
||||
{
|
||||
|
||||
BoundedSurface,
|
||||
BSplineSurface,
|
||||
Unknown,
|
||||
Face,
|
||||
Conic,
|
||||
AdvancedFace,
|
||||
AxisPlacement2D,
|
||||
AxisPlacement3D,
|
||||
BSplineCurveWithKnots,
|
||||
CartesianPoint,
|
||||
Circle,
|
||||
Curve,
|
||||
CylindricalSurface,
|
||||
Direction,
|
||||
EdgeCurve,
|
||||
EdgeLoop,
|
||||
Ellipse,
|
||||
FaceBound,
|
||||
FaceOuterBound,
|
||||
Line,
|
||||
OrientedEdge,
|
||||
Plane,
|
||||
Point,
|
||||
PresentationItem,
|
||||
Vector,
|
||||
VertexPoint
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,199 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepModel.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the “Software”), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED “AS IS”,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.PipeLine;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices.Marshalling;
|
||||
using System.Text;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public class StepModel
|
||||
{
|
||||
|
||||
private Dictionary<int, StepEntityBase> _nodes
|
||||
= new Dictionary<int, StepEntityBase>();
|
||||
|
||||
private PipelineScheduler _builder;
|
||||
|
||||
private PipelineScheduler _initScheduler = new PipelineScheduler();
|
||||
private StepInfo _header;
|
||||
|
||||
internal StepModel( StepInfo header )
|
||||
{
|
||||
_header = header;
|
||||
_builder = new PipelineScheduler();
|
||||
}
|
||||
|
||||
public StepEntityBase? this[ int id ]
|
||||
{
|
||||
get
|
||||
{
|
||||
if( id == 0 ) {
|
||||
return null;
|
||||
}
|
||||
if( _nodes.TryGetValue( id, out StepEntityBase? node ) )
|
||||
{
|
||||
if( node is StepUnsupportedEntity ) {
|
||||
throw new StepEntityUnsupportedException();
|
||||
}
|
||||
return node;
|
||||
}
|
||||
node = new StepUninitializedEntity( this, id );
|
||||
_nodes.Add( id, node );
|
||||
return node;
|
||||
}
|
||||
private set { _nodes[ id ] = value!; }
|
||||
}
|
||||
|
||||
internal StepEntityBase? this[ ExpSyntaxNode node ]
|
||||
{
|
||||
get
|
||||
{
|
||||
if( node is not StepEntityInstanceNode instance ) {
|
||||
throw new InvalidCastException();
|
||||
}
|
||||
return this[ instance.Id ];
|
||||
}
|
||||
set
|
||||
{
|
||||
if( node is not StepEntityInstanceNode instance ) {
|
||||
throw new InvalidCastException();
|
||||
}
|
||||
this[ instance.Id ] = value;
|
||||
}
|
||||
}
|
||||
|
||||
public void BindValue( ExpSyntaxNode node, Action<StepEntityBase> action ) { }
|
||||
|
||||
public StepUninitializedEntity FromInitSequence( StepEntityDefineSequence sequence )
|
||||
{
|
||||
int id = ( sequence.Expression.Left as StepEntityInstanceNode )!.Id;
|
||||
PipelineNode node;
|
||||
if( _nodes.TryGetValue( id, out StepEntityBase? e ) && e is StepUninitializedEntity u )
|
||||
{
|
||||
u.FromSequence( sequence );
|
||||
node = _initScheduler.GetNode( u.Label );
|
||||
} else
|
||||
{
|
||||
u = new StepUninitializedEntity( this, id );
|
||||
u.FromSequenceUnsafe( sequence );
|
||||
_nodes.Add( id, u );
|
||||
node = _initScheduler.Create( u.Label, u );
|
||||
}
|
||||
|
||||
PipelineNodeInPort port = node.GetInputPort( StepUninitializedEntity.InName );
|
||||
if( sequence.Dependencies.Count() == 0 )
|
||||
{
|
||||
_initScheduler.LinkToInput( port );
|
||||
} else
|
||||
{
|
||||
foreach( int i in sequence.Dependencies )
|
||||
{
|
||||
PipelineNode dNode;
|
||||
StepEntityLabel label = new StepEntityLabel( i );
|
||||
if( _nodes.TryGetValue( i, out e ) )
|
||||
{
|
||||
dNode = _initScheduler.GetNode( label );
|
||||
} else
|
||||
{
|
||||
u = new StepUninitializedEntity( this, i );
|
||||
_nodes.Add( i, u );
|
||||
dNode = _initScheduler.Create( u.Label, u );
|
||||
}
|
||||
port.Connect( dNode.GetOutputPort( StepUninitializedEntity.OutName ) );
|
||||
}
|
||||
}
|
||||
return u;
|
||||
}
|
||||
|
||||
public void InitEntity()
|
||||
{
|
||||
if( _initScheduler is null ) {
|
||||
return;
|
||||
}
|
||||
_initScheduler.ArrangeNodes();
|
||||
PipeLineRunner.Run( _initScheduler );
|
||||
_initScheduler = null!;
|
||||
}
|
||||
|
||||
public void ReplaceEntity(
|
||||
StepUninitializedEntity uninitialized,
|
||||
StepEntityBase accurateEntity )
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull( uninitialized );
|
||||
if( uninitialized.Context != this || accurateEntity.Context != this ) {
|
||||
throw new InvalidOperationException();
|
||||
}
|
||||
if( uninitialized.Id != accurateEntity.Id ) {
|
||||
throw new InvalidOperationException();
|
||||
}
|
||||
_nodes[ uninitialized.Id ] = accurateEntity;
|
||||
}
|
||||
|
||||
public string[] ShowStructure( int depth )
|
||||
{
|
||||
_initScheduler.ArrangeNodes();
|
||||
IEnumerable<PipelineNode> nodes = PipelineMarshal.GetNodeSortedEnumeration(
|
||||
_initScheduler );
|
||||
int count = 0;
|
||||
List<string> info = [
|
||||
@$"Step model root",
|
||||
];
|
||||
foreach( PipelineNode node in nodes )
|
||||
{
|
||||
count++;
|
||||
StepUninitializedEntity uncertain = ( node.NodeOperation as StepUninitializedEntity )!;
|
||||
string[] strings = uncertain.GetEntityDescription( depth - 1 );
|
||||
if( count < nodes.Count() )
|
||||
{
|
||||
info.Add( $" ├-{strings[0]}" );
|
||||
for( int i = 1; i < strings.Length; i++ ) {
|
||||
info.Add( $" | {strings[i]}" );
|
||||
}
|
||||
} else
|
||||
{
|
||||
info.Add( $" └-{strings[0]}" );
|
||||
for( int i = 1; i < strings.Length; i++ ) {
|
||||
info.Add( $" {strings[i]}" );
|
||||
}
|
||||
}
|
||||
}
|
||||
return info.ToArray();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepReader.DataSectionReader.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the “Software”), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED “AS IS”,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Model.Step;
|
||||
using StgSharp.Model.Step;
|
||||
using StgSharp.Script;
|
||||
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.IO;
|
||||
using System.IO.MemoryMappedFiles;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public partial class StepReader
|
||||
{
|
||||
|
||||
public StepDataSectionTransmitter DataTransmitter { get; } = new StepDataSectionTransmitter(
|
||||
);
|
||||
|
||||
internal async void ReadDataSection()
|
||||
{
|
||||
using( MemoryMappedViewStream ms = _memoryFile.CreateViewStream(
|
||||
0, _size, MemoryMappedFileAccess.Read ) )
|
||||
{
|
||||
StreamReader sr = new StreamReader( ms );
|
||||
ms.Position = _dataStart;
|
||||
DataTransmitter.Begin = _dataBeginLine;
|
||||
string line;
|
||||
while( !string.IsNullOrEmpty( line = sr.ReadLine()! ) ) {
|
||||
DataTransmitter.WriteLine( line );
|
||||
}
|
||||
sr.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
[GeneratedRegex(
|
||||
@"^#(?<id>[0-9]+)\s*?=\s*?(?<expression>\S.*?)\s*;$",
|
||||
RegexOptions.Compiled | RegexOptions.Singleline )]
|
||||
private static partial Regex GetExpressionSplitter();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepReader.HeadReader.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the ¡°Software¡±), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED ¡°AS IS¡±,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.IO.MemoryMappedFiles;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public partial class StepReader
|
||||
{
|
||||
|
||||
private static Regex expressionSplitter = GetStepHeadExpressionParser();
|
||||
/**/
|
||||
private StepInfo _info;
|
||||
|
||||
public StepInfo GetInfo()
|
||||
{
|
||||
if( _info is not null ) {
|
||||
return _info;
|
||||
}
|
||||
StepInfo info = new StepInfo();
|
||||
List<StepHeaderLineConstructor> constructorList = new List<StepHeaderLineConstructor>();
|
||||
using( MemoryMappedViewStream ms = _memoryFile.CreateViewStream(
|
||||
0, _size, MemoryMappedFileAccess.Read ) )
|
||||
{
|
||||
using( StreamReader sr = new StreamReader( ms ) )
|
||||
{
|
||||
long pos = _headStart;
|
||||
ms.Seek( _headStart, SeekOrigin.Begin );
|
||||
while( pos <= _headEnd )
|
||||
{
|
||||
string token = ReadToken( sr, ref pos );
|
||||
if( token == "HEADER;" )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if( token == "ENDSEC;" )
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
GroupCollection match = expressionSplitter.Match( token ).Groups;
|
||||
constructorList.Add(
|
||||
new StepHeaderLineConstructor(
|
||||
0, match[ "CALLER" ].ToString(), match[ "PARAM" ].ToString() ) );
|
||||
}
|
||||
foreach( StepHeaderLineConstructor constructor in constructorList )
|
||||
{
|
||||
switch( constructor.Caller )
|
||||
{
|
||||
case "FILE_DESCRIPTION":
|
||||
info.Description = StepDataParser.ToString( constructor[ 0 ] );
|
||||
info.Level = StepDataParser.ToVersion( constructor[ 1 ] );
|
||||
break;
|
||||
case "FILE_NAME":
|
||||
info.Name = StepDataParser.ToString( constructor[ 0 ] );
|
||||
info.TimeStamp = StepDataParser.ToDateTime( constructor[ 1 ] );
|
||||
info.Author = StepDataParser.ToString( constructor[ 2 ] );
|
||||
info.Organization = StepDataParser.ToString( constructor[ 3 ] );
|
||||
info.PreprocessorVersion = StepDataParser.ToString(
|
||||
constructor[ 4 ] );
|
||||
info.OriginatingSystem = StepDataParser.ToString( constructor[ 5 ] );
|
||||
info.Authorization = StepDataParser.ToString( constructor[ 6 ] );
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return info;
|
||||
}
|
||||
|
||||
[GeneratedRegex( @"^(?<CALLER>[A-Z_]+)\s?\((?<PARAM>.+)\)\;", RegexOptions.Compiled )]
|
||||
private static partial Regex GetStepHeadExpressionParser();
|
||||
/**/
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepReader.ToModel.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the “Software”), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED “AS IS”,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public partial class StepReader
|
||||
{
|
||||
|
||||
private volatile int _version = 0;
|
||||
private StepDataTokenReader tokenReader;
|
||||
|
||||
private StepExpSyntaxAnalyzer analyzer;
|
||||
|
||||
private StepModel Model { get; set; }
|
||||
|
||||
private Task<StepModel> ReadToModelTask { get; set; }
|
||||
|
||||
public StepModel ReadToModel()
|
||||
{
|
||||
if( Model is not null ) {
|
||||
return Model;
|
||||
}
|
||||
if( _version != 0 ) {
|
||||
throw new InvalidOperationException(
|
||||
"A ReadToModel method has been called and is running now, use Async version instead" );
|
||||
}
|
||||
Interlocked.Increment( ref _version );
|
||||
GetInfo();
|
||||
tokenReader = new StepDataTokenReader( DataTransmitter );
|
||||
analyzer = new StepExpSyntaxAnalyzer();
|
||||
ConcurrentQueue<StepEntityDefineSequence> initStatements = analyzer.StepEntityInitStatements;
|
||||
Task secTask = Task.Run( ReadDataSection );
|
||||
Task anTask = Task.Run( ReadStepToken );
|
||||
Model = new StepModel( _info );
|
||||
while( initStatements.TryDequeue( out StepEntityDefineSequence? statement ) ||
|
||||
!anTask.IsCompleted )
|
||||
{
|
||||
if( statement is null )
|
||||
{
|
||||
Thread.Sleep( 0 );
|
||||
continue;
|
||||
}
|
||||
StepUninitializedEntity entity = Model.FromInitSequence( statement );
|
||||
}
|
||||
Task.WaitAll( secTask, anTask );
|
||||
return Model;
|
||||
}
|
||||
|
||||
public async Task<StepModel> ReadToModelAsync()
|
||||
{
|
||||
if( ReadToModelTask is null ) {
|
||||
ReadToModelTask = Task.Run( ReadToModel );
|
||||
}
|
||||
return await ReadToModelTask;
|
||||
}
|
||||
|
||||
public StepModel ReadToModelSingleThread()
|
||||
{
|
||||
if( Model is not null ) {
|
||||
return Model;
|
||||
}
|
||||
if( _version != 0 ) {
|
||||
throw new InvalidOperationException(
|
||||
"A ReadToModel method has been called and is running now, use Async version instead" );
|
||||
}
|
||||
Interlocked.Increment( ref _version );
|
||||
GetInfo();
|
||||
tokenReader = new StepDataTokenReader( DataTransmitter );
|
||||
analyzer = new StepExpSyntaxAnalyzer();
|
||||
ConcurrentQueue<StepEntityDefineSequence> initStatements = analyzer.StepEntityInitStatements;
|
||||
ReadDataSection();
|
||||
ReadStepToken();
|
||||
Model = new StepModel( _info );
|
||||
while( initStatements.TryDequeue( out StepEntityDefineSequence? statement ) )
|
||||
{
|
||||
if( statement is null )
|
||||
{
|
||||
Thread.Sleep( 0 );
|
||||
continue;
|
||||
}
|
||||
StepUninitializedEntity entity = Model.FromInitSequence( statement );
|
||||
}
|
||||
return Model;
|
||||
}
|
||||
|
||||
private void ReadStepToken()
|
||||
{
|
||||
while( !tokenReader.IsEmpty )
|
||||
{
|
||||
Token t = tokenReader.ReadToken();
|
||||
analyzer.AppendToken( t );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,173 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepReader.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the “Software”), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED “AS IS”,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp;
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.IO.MemoryMappedFiles;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public partial class StepReader : IDisposable
|
||||
{
|
||||
|
||||
private const string fileLabel = "ISO-10303-21;";
|
||||
|
||||
private bool disposedValue;
|
||||
private FileStream _fileStream;
|
||||
private int _dataBeginLine;
|
||||
private long _headStart = -1, _headEnd = -1, _dataStart = -1, _size;
|
||||
private MemoryMappedFile _memoryFile;
|
||||
|
||||
private StepReader() { }
|
||||
|
||||
private StepReader( FileStream stream, long size )
|
||||
{
|
||||
_fileStream = stream;
|
||||
_size = size;
|
||||
_memoryFile = MemoryMappedFile.CreateFromFile(
|
||||
stream, mapName: null, size, MemoryMappedFileAccess.Read, HandleInheritability.None,
|
||||
leaveOpen: true );
|
||||
}
|
||||
|
||||
// ~StepReader()
|
||||
// {
|
||||
// Dispose(disposing: false);
|
||||
// }
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose( disposing: true );
|
||||
GC.SuppressFinalize( this );
|
||||
}
|
||||
|
||||
public static bool FromFile( string path, out StepReader reader )
|
||||
{
|
||||
FileInfo info = new FileInfo( path );
|
||||
if( !info.Exists )
|
||||
{
|
||||
reader = null!;
|
||||
return false;
|
||||
}
|
||||
FileStream stream = new FileStream(
|
||||
path, FileMode.Open, FileAccess.Read, FileShare.Read, bufferSize: 4096,
|
||||
useAsync: true );
|
||||
byte[] fileHead = new byte[40];
|
||||
stream.Read( fileHead, 0, fileLabel.Length );
|
||||
if( !Encoding.UTF8.GetString( fileHead ).Contains( fileLabel ) ) {
|
||||
throw new InvalidDataException( "The given file is not a STEP file" );
|
||||
}
|
||||
reader = new StepReader( stream, info.Length );
|
||||
reader.LocateSection();
|
||||
return reader != null;
|
||||
}
|
||||
|
||||
private void LocateSection()
|
||||
{
|
||||
long startPos = 0;
|
||||
byte[] buffer = new byte[1024];
|
||||
Span<byte> bufferSpan = buffer,
|
||||
headerSec = Encoding.UTF8.GetBytes( "HEADER;" ),
|
||||
endsecSec = Encoding.UTF8.GetBytes( "ENDSEC;" ),
|
||||
dataSec = Encoding.UTF8.GetBytes( "DATA;" );
|
||||
_fileStream.Position = 0;
|
||||
for( ; startPos < _size; startPos += 1000 )
|
||||
{
|
||||
_fileStream.Read( buffer );
|
||||
if( _headStart == -1 )
|
||||
{
|
||||
long pos = bufferSpan.IndexOf( headerSec );
|
||||
if( pos >= 0 ) {
|
||||
_headStart = startPos + pos;
|
||||
}
|
||||
}
|
||||
if( _headEnd == -1 )
|
||||
{
|
||||
long pos = bufferSpan.IndexOf( endsecSec );
|
||||
if( pos >= 0 ) {
|
||||
_headEnd = startPos + pos;
|
||||
}
|
||||
}
|
||||
if( _dataStart == -1 )
|
||||
{
|
||||
long pos = bufferSpan.IndexOf( dataSec );
|
||||
if( pos >= 0 ) {
|
||||
_dataStart = startPos + pos;
|
||||
}
|
||||
} else
|
||||
{
|
||||
break;
|
||||
}
|
||||
_fileStream.Seek( 1000, SeekOrigin.Current );
|
||||
}
|
||||
}
|
||||
|
||||
private string ReadToken( StreamReader reader, ref long posCache )
|
||||
{
|
||||
StringBuilder token = new StringBuilder( 100 );
|
||||
while( token.Length == 0 || token[ token.Length - 1 ] != ';' )
|
||||
{
|
||||
string subString = reader.ReadLine()!;
|
||||
if( subString == null )
|
||||
{
|
||||
break;
|
||||
}
|
||||
token.Append( subString.TrimStart() );
|
||||
}
|
||||
posCache += token.Length;
|
||||
return token.ToString();
|
||||
}
|
||||
|
||||
private protected virtual void Dispose( bool disposing )
|
||||
{
|
||||
if( !disposedValue )
|
||||
{
|
||||
if( disposing )
|
||||
{
|
||||
_fileStream.Dispose();
|
||||
_memoryFile.Dispose();
|
||||
}
|
||||
|
||||
disposedValue = true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepUncertainElement.Parse.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the “Software”), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED “AS IS”,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public partial class StepUninitializedEntity
|
||||
{
|
||||
|
||||
private static StepRepresentationItem ConvertSimpleEntity(
|
||||
StepModel context,
|
||||
ExpFunctionCallingNode calling )
|
||||
{
|
||||
string name = calling.FunctionCaller.Name;
|
||||
return name switch
|
||||
{
|
||||
ExpressStepUtil.AdvancedFaceText => StepAdvancedFace.FromSyntax(
|
||||
context, calling.Right ),
|
||||
ExpressStepUtil.Axis2Placement2DText => StepAxis2Placement2D.FromSyntax(
|
||||
context, calling.Right ),
|
||||
ExpressStepUtil.Axis2Placement3DText => StepAxis2Placement3D.FromSyntax(
|
||||
context, calling.Right ),
|
||||
ExpressStepUtil.BSplineCurveWithKnotsText => StepBSplineCurveWithKnots.FromSyntax(
|
||||
context, calling.Right ),
|
||||
ExpressStepUtil.CartesianPointText => StepCartesianPoint.FromSyntax(
|
||||
context, calling.Right ),
|
||||
ExpressStepUtil.CircleText => StepCircle.FromSyntax( context, calling.Right ),
|
||||
ExpressStepUtil.CylindricalSurfaceText => StepCylindricalSurface.FromSyntax(
|
||||
context, calling.Right ),
|
||||
ExpressStepUtil.DirectionText => StepDirection.FromSyntax( context, calling.Right ),
|
||||
ExpressStepUtil.EdgeCurveText => StepEdgeCurve.FromSyntax( context, calling.Right ),
|
||||
ExpressStepUtil.EdgeLoopText => StepEdgeLoop.FromSyntax( context, calling.Right ),
|
||||
ExpressStepUtil.EllipseText => StepEllipse.FromSyntax( context, calling.Right ),
|
||||
ExpressStepUtil.FaceBoundText => StepFaceBound.FromSyntax( context, calling.Right ),
|
||||
ExpressStepUtil.FaceOuterBoundText => StepFaceOuterBound.FromSyntax(
|
||||
context, calling.Right ),
|
||||
ExpressStepUtil.LineText => StepLine.FromSyntax( context, calling.Right ),
|
||||
ExpressStepUtil.OrientedEdgeText => StepOrientedEdge.FromSyntax(
|
||||
context, calling.Right ),
|
||||
ExpressStepUtil.PlaneText => StepPlane.FromSyntax( context, calling.Right ),
|
||||
ExpressStepUtil.VectorText => StepVector.FromSyntax( context, calling.Right ),
|
||||
ExpressStepUtil.VertexPointText => StepVertexPoint.FromSyntax(
|
||||
context, calling.Right ),
|
||||
_ => throw new StepEntityUnsupportedException()
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,238 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepUncertainEntity.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the ¡°Software¡±), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED ¡°AS IS¡±,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||
using Microsoft.CodeAnalysis.Operations;
|
||||
|
||||
using StgSharp;
|
||||
|
||||
using StgSharp.Model.Step;
|
||||
using StgSharp.PipeLine;
|
||||
using StgSharp.Script;
|
||||
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Dynamic;
|
||||
using System.Reflection.Metadata;
|
||||
using System.Security.AccessControl;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Transactions;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public partial class StepUninitializedEntity : StepEntityBase, IConvertableToPipelineNode
|
||||
{
|
||||
|
||||
internal const string InName = "in", OutName = "out";
|
||||
|
||||
private ExpSyntaxNode _data;
|
||||
|
||||
internal StepUninitializedEntity( StepModel model, int id )
|
||||
{
|
||||
Context = model;
|
||||
Id = id;
|
||||
}
|
||||
|
||||
internal StepUninitializedEntity( StepModel model, StepEntityLabel label )
|
||||
{
|
||||
Context = model;
|
||||
Label = label;
|
||||
}
|
||||
|
||||
internal StepUninitializedEntity(
|
||||
StepModel model,
|
||||
int id,
|
||||
ExpSyntaxNode initialization,
|
||||
IEnumerable<int> dependency )
|
||||
{
|
||||
Context = model;
|
||||
Id = id;
|
||||
_data = initialization;
|
||||
if( dependency == null )
|
||||
{
|
||||
Dependencies = [];
|
||||
} else
|
||||
{
|
||||
Dependencies = dependency;
|
||||
}
|
||||
}
|
||||
|
||||
public override StepItemType ItemType => StepItemType.Unknown;
|
||||
|
||||
internal static HashSet<string> UnsupportedItemTypes { get; } = new HashSet<string>();
|
||||
|
||||
internal StepEntityBase? ConvertToAccurate()
|
||||
{
|
||||
/*
|
||||
StringBuilder builder = new StringBuilder();
|
||||
if( Dependencies is null || _data is null )
|
||||
{
|
||||
builder.Append( "---------------------------" );
|
||||
builder.Append( "************************" );
|
||||
Console.WriteLine(
|
||||
$"Building entity {Id} from thread {Environment.CurrentManagedThreadId} with dependency:{builder.ToString()} " );
|
||||
} else
|
||||
{
|
||||
foreach( int item in Dependencies ) {
|
||||
builder.Append( $"{item}," );
|
||||
}
|
||||
}
|
||||
return null;
|
||||
/**/
|
||||
if( _data is ExpFunctionCallingNode initNode )
|
||||
{
|
||||
string name = initNode.FunctionCaller.Name;
|
||||
StepEntityBase? entity = ConvertSimpleEntity( Context, initNode );
|
||||
if( entity is null )
|
||||
{
|
||||
UnsupportedItemTypes.Add( name );
|
||||
return null;
|
||||
}
|
||||
return entity;
|
||||
} else if( _data is StepComplexEntityNode complex )
|
||||
{
|
||||
/**/
|
||||
ExpNodeTempEnumerator enumerator = new ExpNodeTempEnumerator( complex.Right, true );
|
||||
StepRepresentationItem entity = null!;
|
||||
while( enumerator.MoveNext() )
|
||||
{
|
||||
if( enumerator.Current is not ExpFunctionCallingNode init ) {
|
||||
throw new InvalidCastException();
|
||||
}
|
||||
StepRepresentationItem? e = ConvertSimpleEntity( Context, init );
|
||||
if( e is null )
|
||||
{
|
||||
//throw new NotImplementedException( $"Unknown entity type in sequence {Id}" );
|
||||
return null;
|
||||
}
|
||||
if( entity is null )
|
||||
{
|
||||
entity = e;
|
||||
} else
|
||||
{
|
||||
entity = StepDataParser.Implement( entity, e );
|
||||
}
|
||||
}
|
||||
return entity;
|
||||
/**/
|
||||
return null;
|
||||
} else
|
||||
{
|
||||
throw new ExpInvalidSyntaxException( "Name of entity is required." );
|
||||
}
|
||||
}
|
||||
|
||||
internal void FromSequence( StepEntityDefineSequence sequence )
|
||||
{
|
||||
ExpSyntaxNode node = sequence.Expression;
|
||||
if( node is not ExpBinaryOperatorNode assign ) {
|
||||
throw new ExpInvalidSyntaxException( "Not an assign expression " );
|
||||
}
|
||||
StepEntityInstanceNode? idNode = assign.Left as StepEntityInstanceNode;
|
||||
if( idNode!.Id != this.Id ) {
|
||||
throw new InvalidOperationException();
|
||||
}
|
||||
FromSequenceUnsafe( sequence );
|
||||
}
|
||||
|
||||
internal void FromSequenceUnsafe( StepEntityDefineSequence sequence )
|
||||
{
|
||||
ExpSyntaxNode assign = ( sequence.Expression as ExpBinaryOperatorNode )!;
|
||||
ExpSyntaxNode initNode;
|
||||
if( ( assign.Right is ExpFunctionCallingNode f ) )
|
||||
{
|
||||
initNode = assign.Right;
|
||||
ExpEntityTypeName = f.FunctionCaller.Name;
|
||||
} else if( ( assign.Right is StepComplexEntityNode c ) )
|
||||
{
|
||||
initNode = assign.Right;
|
||||
ExpNodeTempEnumerator enumerator = new ExpNodeTempEnumerator( c.Right, false );
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append( "Complex entity initialization: " );
|
||||
int count = 0;
|
||||
while( enumerator.MoveNext() )
|
||||
{
|
||||
if( count > 0 ) {
|
||||
sb.Append( " <-> " );
|
||||
}
|
||||
f = ( enumerator.Current as ExpFunctionCallingNode )!;
|
||||
sb.Append( $"{f.FunctionCaller.Name}" );
|
||||
count++;
|
||||
}
|
||||
ExpEntityTypeName = sb.ToString();
|
||||
} else
|
||||
{
|
||||
throw new ExpInvalidSyntaxException(
|
||||
"Entity init or complex entity define is required." );
|
||||
}
|
||||
if( _data is not null ) {
|
||||
return;
|
||||
}
|
||||
_data = initNode!;
|
||||
Dependencies = sequence.Dependencies ?? [];
|
||||
}
|
||||
|
||||
void IConvertableToPipelineNode.NodeMain(
|
||||
in Dictionary<string, PipelineNodeInPort> input,
|
||||
in Dictionary<string, PipelineNodeOutPort> output )
|
||||
{
|
||||
try
|
||||
{
|
||||
StepEntityBase? entity = ConvertToAccurate();
|
||||
if( entity is not null )
|
||||
{
|
||||
entity.FromInstance( this );
|
||||
Context.ReplaceEntity( this, entity );
|
||||
}
|
||||
}
|
||||
catch( StepEntityUnsupportedException ) { }
|
||||
catch( Exception ex )
|
||||
{
|
||||
throw new Exception( $"Step decoder crashed when building entity {Id}", ex );
|
||||
}
|
||||
|
||||
//Context.ReplaceEntity( this, entity );
|
||||
PipelineNodeOutPort.SkipAll( output );
|
||||
}
|
||||
|
||||
IEnumerable<string> IConvertableToPipelineNode.InputPortName => [InName];
|
||||
|
||||
PipelineNodeOperation IConvertableToPipelineNode.Operation => ( this as IConvertableToPipelineNode ).NodeMain;
|
||||
|
||||
IEnumerable<string> IConvertableToPipelineNode.OutputPortName => [OutName];
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepUnsupportedEntity.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the “Software”), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED “AS IS”,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public class StepUnsupportedEntity : StepEntityBase
|
||||
{
|
||||
|
||||
private ExpSyntaxNode _initSequence;
|
||||
|
||||
public StepUnsupportedEntity( StepModel model, int id, string name, ExpSyntaxNode sequence )
|
||||
{
|
||||
Id = id;
|
||||
Name = name;
|
||||
_initSequence = sequence;
|
||||
Context = model;
|
||||
}
|
||||
|
||||
public override StepItemType ItemType => StepItemType.Unknown;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepComplexEntityNode.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the “Software”), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED “AS IS”,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public class StepComplexEntityNode : ExpSyntaxNode
|
||||
{
|
||||
|
||||
private ExpSyntaxNode _begin;
|
||||
|
||||
private StepComplexEntityNode( ExpSyntaxNode node )
|
||||
: base( node.Source )
|
||||
{
|
||||
_begin = node;
|
||||
}
|
||||
|
||||
public override ExpSyntaxNode Left => Empty;
|
||||
|
||||
public override ExpSyntaxNode Right => _begin;
|
||||
|
||||
public override IExpElementSource EqualityTypeConvert => StepEntityType.Source;
|
||||
|
||||
public static StepComplexEntityNode FromTuple( ExpSyntaxNode node )
|
||||
{
|
||||
if( node is not ExpTupleNode tuple ) {
|
||||
throw new ExpInvalidSyntaxException( "Node to convert is not a complex" );
|
||||
}
|
||||
return new StepComplexEntityNode( tuple.Right );
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepEntityInitCaller.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the “Software”), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED “AS IS”,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public class StepEntityInitCaller : ExpFunctionSource
|
||||
{
|
||||
|
||||
private static Dictionary<string, StepEntityInitCaller> _callers = new();
|
||||
|
||||
private StepEntityInitCaller( string name )
|
||||
: base( name, null )
|
||||
{
|
||||
ReturningType = StepEntityType.Source;
|
||||
}
|
||||
|
||||
public static StepEntityInitCaller CreateCaller( string name )
|
||||
{
|
||||
if( _callers.TryGetValue( name, out StepEntityInitCaller? caller ) ) {
|
||||
return caller;
|
||||
}
|
||||
caller = new StepEntityInitCaller( name );
|
||||
_callers.Add( name, caller );
|
||||
return caller;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepEntityInstanceNode.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the “Software”), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED “AS IS”,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Model.Step;
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
public class StepEntityInstanceNode : ExpSyntaxNode
|
||||
{
|
||||
|
||||
private StepEntityInstanceNode( Token source ) : base( source ) { }
|
||||
|
||||
public override ExpSyntaxNode Left => Empty;
|
||||
|
||||
public override ExpSyntaxNode Right => Empty;
|
||||
|
||||
public override IExpElementSource EqualityTypeConvert => StepEntityType.Source;
|
||||
|
||||
public int Id { get; init; }
|
||||
|
||||
public static StepEntityInstanceNode Register( Token t )
|
||||
{
|
||||
if( t.Value[ 0 ] != '#' ) {
|
||||
throw new ExpInvalidSyntaxException( "Entity label in STEP should be # + number" );
|
||||
}
|
||||
StepEntityInstanceNode node = new StepEntityInstanceNode( t )
|
||||
{
|
||||
Id = int.Parse( t.Value.AsSpan( 1 ) ),
|
||||
};
|
||||
return node;
|
||||
}
|
||||
|
||||
public static StepEntityInstanceNode RegisterNull( Token t )
|
||||
{
|
||||
if( t.Value != "$" ) {
|
||||
throw new ExpInvalidSyntaxException(
|
||||
$"Token {t.Value} does not represent a null entity" );
|
||||
}
|
||||
StepEntityInstanceNode node = new StepEntityInstanceNode( t )
|
||||
{
|
||||
Id = 0,
|
||||
};
|
||||
return node;
|
||||
}
|
||||
|
||||
public static StepEntityInstanceNode RegisterRuntimeInference( Token t )
|
||||
{
|
||||
if( t.Value != "*" ) {
|
||||
throw new ExpInvalidSyntaxException(
|
||||
$"Token {t.Value} does not represent a runtime inferences entity" );
|
||||
}
|
||||
StepEntityInstanceNode node = new StepEntityInstanceNode( t )
|
||||
{
|
||||
Id = -1,
|
||||
};
|
||||
return node;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
internal class StepEntityType : ExpTypeSource
|
||||
{
|
||||
|
||||
private StepEntityType( string typeName ) : base( typeName ) { }
|
||||
|
||||
public static StepEntityType Source { get; } = new StepEntityType( "ENTITY" );
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// file="StepExpEnumValueNode.cs"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the “Software”), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED “AS IS”,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using StgSharp.Script;
|
||||
using StgSharp.Script.Express;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Model.Step
|
||||
{
|
||||
internal class StepExpEnumValueNode : ExpSyntaxNode
|
||||
{
|
||||
|
||||
public StepExpEnumValueNode( Token source )
|
||||
: base( source )
|
||||
{
|
||||
EnumValue = source.Value;
|
||||
}
|
||||
|
||||
public override ExpSyntaxNode Left => Empty;
|
||||
|
||||
public override ExpSyntaxNode Right => Empty;
|
||||
|
||||
public override IExpElementSource EqualityTypeConvert => throw new NotImplementedException();
|
||||
|
||||
public string EnumValue { get; private set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<LangVersion>preview</LangVersion>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\StgSharp.Common\StgSharp.Common.csproj" />
|
||||
<ProjectReference Include="..\StgSharp.Script\StgSharp.Script.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,244 @@
|
||||
{
|
||||
"runtimeTarget": {
|
||||
"name": ".NETCoreApp,Version=v8.0",
|
||||
"signature": ""
|
||||
},
|
||||
"compilationOptions": {},
|
||||
"targets": {
|
||||
".NETCoreApp,Version=v8.0": {
|
||||
"StgSharp.Model/1.0.0": {
|
||||
"dependencies": {
|
||||
"StgSharp.Common": "1.0.0",
|
||||
"StgSharp.Script": "1.0.0"
|
||||
},
|
||||
"runtime": {
|
||||
"StgSharp.Model.dll": {}
|
||||
}
|
||||
},
|
||||
"CommunityToolkit.HighPerformance/8.4.0": {
|
||||
"runtime": {
|
||||
"lib/net8.0/CommunityToolkit.HighPerformance.dll": {
|
||||
"assemblyVersion": "8.4.0.0",
|
||||
"fileVersion": "8.4.0.1"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.CodeAnalysis.Analyzers/3.11.0": {},
|
||||
"Microsoft.CodeAnalysis.Common/4.13.0": {
|
||||
"dependencies": {
|
||||
"Microsoft.CodeAnalysis.Analyzers": "3.11.0",
|
||||
"System.Collections.Immutable": "8.0.0",
|
||||
"System.Reflection.Metadata": "8.0.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.CodeAnalysis.dll": {
|
||||
"assemblyVersion": "4.13.0.0",
|
||||
"fileVersion": "4.1300.25.12011"
|
||||
}
|
||||
},
|
||||
"resources": {
|
||||
"lib/net8.0/cs/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "cs"
|
||||
},
|
||||
"lib/net8.0/de/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "de"
|
||||
},
|
||||
"lib/net8.0/es/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "es"
|
||||
},
|
||||
"lib/net8.0/fr/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "fr"
|
||||
},
|
||||
"lib/net8.0/it/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "it"
|
||||
},
|
||||
"lib/net8.0/ja/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "ja"
|
||||
},
|
||||
"lib/net8.0/ko/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "ko"
|
||||
},
|
||||
"lib/net8.0/pl/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "pl"
|
||||
},
|
||||
"lib/net8.0/pt-BR/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "pt-BR"
|
||||
},
|
||||
"lib/net8.0/ru/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "ru"
|
||||
},
|
||||
"lib/net8.0/tr/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "tr"
|
||||
},
|
||||
"lib/net8.0/zh-Hans/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "zh-Hans"
|
||||
},
|
||||
"lib/net8.0/zh-Hant/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "zh-Hant"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.CodeAnalysis.CSharp/4.13.0": {
|
||||
"dependencies": {
|
||||
"Microsoft.CodeAnalysis.Analyzers": "3.11.0",
|
||||
"Microsoft.CodeAnalysis.Common": "4.13.0",
|
||||
"System.Collections.Immutable": "8.0.0",
|
||||
"System.Reflection.Metadata": "8.0.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.CodeAnalysis.CSharp.dll": {
|
||||
"assemblyVersion": "4.13.0.0",
|
||||
"fileVersion": "4.1300.25.12011"
|
||||
}
|
||||
},
|
||||
"resources": {
|
||||
"lib/net8.0/cs/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "cs"
|
||||
},
|
||||
"lib/net8.0/de/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "de"
|
||||
},
|
||||
"lib/net8.0/es/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "es"
|
||||
},
|
||||
"lib/net8.0/fr/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "fr"
|
||||
},
|
||||
"lib/net8.0/it/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "it"
|
||||
},
|
||||
"lib/net8.0/ja/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "ja"
|
||||
},
|
||||
"lib/net8.0/ko/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "ko"
|
||||
},
|
||||
"lib/net8.0/pl/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "pl"
|
||||
},
|
||||
"lib/net8.0/pt-BR/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "pt-BR"
|
||||
},
|
||||
"lib/net8.0/ru/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "ru"
|
||||
},
|
||||
"lib/net8.0/tr/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "tr"
|
||||
},
|
||||
"lib/net8.0/zh-Hans/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "zh-Hans"
|
||||
},
|
||||
"lib/net8.0/zh-Hant/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "zh-Hant"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.CSharp/4.7.0": {},
|
||||
"System.Collections.Immutable/8.0.0": {},
|
||||
"System.Reflection.Metadata/8.0.0": {
|
||||
"dependencies": {
|
||||
"System.Collections.Immutable": "8.0.0"
|
||||
}
|
||||
},
|
||||
"System.Runtime.CompilerServices.Unsafe/6.1.0": {},
|
||||
"StgSharp.Common/1.0.0": {
|
||||
"dependencies": {
|
||||
"Microsoft.CSharp": "4.7.0",
|
||||
"System.Runtime.CompilerServices.Unsafe": "6.1.0"
|
||||
},
|
||||
"runtime": {
|
||||
"StgSharp.Common.dll": {
|
||||
"assemblyVersion": "1.0.0.0",
|
||||
"fileVersion": "1.0.0.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"StgSharp.Script/1.0.0": {
|
||||
"dependencies": {
|
||||
"CommunityToolkit.HighPerformance": "8.4.0",
|
||||
"Microsoft.CodeAnalysis.CSharp": "4.13.0",
|
||||
"StgSharp.Common": "1.0.0"
|
||||
},
|
||||
"runtime": {
|
||||
"StgSharp.Script.dll": {
|
||||
"assemblyVersion": "1.0.0.0",
|
||||
"fileVersion": "1.0.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"libraries": {
|
||||
"StgSharp.Model/1.0.0": {
|
||||
"type": "project",
|
||||
"serviceable": false,
|
||||
"sha512": ""
|
||||
},
|
||||
"CommunityToolkit.HighPerformance/8.4.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-flxspiBs0G/0GMp7IK2J2ijV9bTG6hEwFc/z6ekHqB6nwRJ4Ry2yLdx+TkbCUYFCl4XhABkAwomeKbT6zM2Zlg==",
|
||||
"path": "communitytoolkit.highperformance/8.4.0",
|
||||
"hashPath": "communitytoolkit.highperformance.8.4.0.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.CodeAnalysis.Analyzers/3.11.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-v/EW3UE8/lbEYHoC2Qq7AR/DnmvpgdtAMndfQNmpuIMx/Mto8L5JnuCfdBYtgvalQOtfNCnxFejxuRrryvUTsg==",
|
||||
"path": "microsoft.codeanalysis.analyzers/3.11.0",
|
||||
"hashPath": "microsoft.codeanalysis.analyzers.3.11.0.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.CodeAnalysis.Common/4.13.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-T8nRl4mAUY4mhdYM4U2ra2vP2EL+ol8Yqwo0gwC/V55vmlXq9NxdIkZJynTpTL1uX/jHijJ90AeOEx4lf7OwzQ==",
|
||||
"path": "microsoft.codeanalysis.common/4.13.0",
|
||||
"hashPath": "microsoft.codeanalysis.common.4.13.0.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.CodeAnalysis.CSharp/4.13.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-BsH7Vijbj9IL7Fj4k/ysZSVyLGFqr75wmdFGwCKWJvSjnA1xwPaQ3hkB2BQdHOt5CpEYA6Q0I6Oo5sDTDHqHsg==",
|
||||
"path": "microsoft.codeanalysis.csharp/4.13.0",
|
||||
"hashPath": "microsoft.codeanalysis.csharp.4.13.0.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.CSharp/4.7.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-pTj+D3uJWyN3My70i2Hqo+OXixq3Os2D1nJ2x92FFo6sk8fYS1m1WLNTs0Dc1uPaViH0YvEEwvzddQ7y4rhXmA==",
|
||||
"path": "microsoft.csharp/4.7.0",
|
||||
"hashPath": "microsoft.csharp.4.7.0.nupkg.sha512"
|
||||
},
|
||||
"System.Collections.Immutable/8.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-AurL6Y5BA1WotzlEvVaIDpqzpIPvYnnldxru8oXJU2yFxFUy3+pNXjXd1ymO+RA0rq0+590Q8gaz2l3Sr7fmqg==",
|
||||
"path": "system.collections.immutable/8.0.0",
|
||||
"hashPath": "system.collections.immutable.8.0.0.nupkg.sha512"
|
||||
},
|
||||
"System.Reflection.Metadata/8.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-ptvgrFh7PvWI8bcVqG5rsA/weWM09EnthFHR5SCnS6IN+P4mj6rE1lBDC4U8HL9/57htKAqy4KQ3bBj84cfYyQ==",
|
||||
"path": "system.reflection.metadata/8.0.0",
|
||||
"hashPath": "system.reflection.metadata.8.0.0.nupkg.sha512"
|
||||
},
|
||||
"System.Runtime.CompilerServices.Unsafe/6.1.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-5o/HZxx6RVqYlhKSq8/zronDkALJZUT2Vz0hx43f0gwe8mwlM0y2nYlqdBwLMzr262Bwvpikeb/yEwkAa5PADg==",
|
||||
"path": "system.runtime.compilerservices.unsafe/6.1.0",
|
||||
"hashPath": "system.runtime.compilerservices.unsafe.6.1.0.nupkg.sha512"
|
||||
},
|
||||
"StgSharp.Common/1.0.0": {
|
||||
"type": "project",
|
||||
"serviceable": false,
|
||||
"sha512": ""
|
||||
},
|
||||
"StgSharp.Script/1.0.0": {
|
||||
"type": "project",
|
||||
"serviceable": false,
|
||||
"sha512": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,857 @@
|
||||
<?xml version="1.0"?>
|
||||
<doc>
|
||||
<assembly>
|
||||
<name>StgSharp.Common</name>
|
||||
</assembly>
|
||||
<members>
|
||||
<member name="M:StgSharp.Commom.Collections.IBidirectionalDictionary`2.Contains(`1)">
|
||||
<summary>
|
||||
Determines whether the <see cref="T:StgSharp.Commom.Collections.IBidirectionalDictionary`2" />
|
||||
contains the specified key.
|
||||
</summary>
|
||||
<param _label="key">
|
||||
The value to locate in the <see cref="T:StgSharp.Commom.Collections.IBidirectionalDictionary`2" />.
|
||||
</param>
|
||||
<returns>
|
||||
true if the <see cref="T:StgSharp.Commom.Collections.IBidirectionalDictionary`2" /> contains an
|
||||
element with the specified key; otherwise, false.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Commom.Collections.IBidirectionalDictionary`2.Contains(`0)">
|
||||
<summary>
|
||||
Determines whether the <see cref="T:StgSharp.Commom.Collections.IBidirectionalDictionary`2" />
|
||||
contains the specified key.
|
||||
</summary>
|
||||
<param _label="key">
|
||||
The value to locate in the <see cref="T:StgSharp.Commom.Collections.IBidirectionalDictionary`2" />.
|
||||
</param>
|
||||
<returns>
|
||||
true if the <see cref="T:StgSharp.Commom.Collections.IBidirectionalDictionary`2" /> contains an
|
||||
element with the specified key; otherwise, false.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="T:StgSharp.Collections.ListSegment`1">
|
||||
<summary>
|
||||
Part of a collection. This contains a direct reference to _origin collection, so all
|
||||
change to _origin collection will be reflected in this object.
|
||||
</summary>
|
||||
<typeparam name="T">
|
||||
|
||||
</typeparam>
|
||||
</member>
|
||||
<member name="M:StgSharp.World.InitGL(System.Int32,System.Int32)">
|
||||
<summary>
|
||||
CustomizeInit an instance of OpenGL program, This method should be called before any
|
||||
other World api.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:StgSharp.World.version">
|
||||
<summary>
|
||||
Version of current World platform. Main version represent in hundred's digit, and sub
|
||||
version represent in ten's digit.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.World.WriteLog(System.String,StgSharp.LogType)">
|
||||
<summary>
|
||||
Write a log message to log file, and mark the _level of this message.
|
||||
</summary>
|
||||
<param _label="message">
|
||||
A string contains information of how current evironment runs.
|
||||
</param>
|
||||
<param _label="logType">
|
||||
The severity of current message.
|
||||
</param>
|
||||
</member>
|
||||
<member name="T:StgSharp.Data.ValueBox`1">
|
||||
<summary>
|
||||
A class attempt to reduce cost of boxing, though still a bit slower than direct access to
|
||||
_origin value type instance.
|
||||
</summary>
|
||||
<typeparam name="T">
|
||||
Type of instance to be boxed.
|
||||
</typeparam>
|
||||
</member>
|
||||
<member name="T:StgSharp.Internal.Serializer">
|
||||
<summary>
|
||||
A class contains a sets of methods to serialize several types
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:StgSharp.Internal.Area">
|
||||
<summary>
|
||||
An independent storage area, used as the only folder type in root folder. Contains several
|
||||
<see cref="T:StgSharp.Internal.SSD" /> files reference as virtual disc. Data is actually stored in <see
|
||||
cref="T:StgSharp.Internal.SSD" />s in certain RAID mode.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:StgSharp.Internal.GLclampf">
|
||||
<summary>
|
||||
OpenGL numeric type. An IEEE-754 floating-point value, clamped to the range [0,1].
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:StgSharp.Internal.GLclampd">
|
||||
<summary>
|
||||
OpenGL numeric type. An IEEE-754 double precision floating-point value, clamped to the
|
||||
range [0,1].
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:StgSharp.IEntity.X">
|
||||
<summary>
|
||||
X position of an enenmy entity
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:StgSharp.IEntity.Y">
|
||||
<summary>
|
||||
Y position of an enemy entity
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:StgSharp.IEntity.CollisionSensor">
|
||||
<summary>
|
||||
A sensor used for checking out if a bullet hit a player or something else
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:StgSharp.IEntity.Location">
|
||||
<summary>
|
||||
A 2D vector presenting the position of an enemy entity, position can also be visited
|
||||
by X, Y
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:StgSharp.Geometries.UnusedVertexException">
|
||||
<summary>
|
||||
当几何体调用了过多的CalcVec方法时,产生UnusedVertexException异常
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:StgSharp.Geometries.PartialPlainCoordinate.origin">
|
||||
<summary>
|
||||
The _origin of this coordinate.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:StgSharp.Geometries.PartialPlainCoordinate.axis_H">
|
||||
<summary>
|
||||
The horizontial axis of the coordinate. Point to the right direction.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:StgSharp.Geometries.PartialPlainCoordinate.axis_V">
|
||||
<summary>
|
||||
The vertical axis of the coordinate. Point to the top direction.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:StgSharp.Geometries.PlainGeometry">
|
||||
<summary>
|
||||
Plain geometry only contains straight sides.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.Geometries.Rectangle.MovCenter(System.UInt32)">
|
||||
<summary>
|
||||
Calculate movement to center
|
||||
</summary>
|
||||
<param _label="tick">
|
||||
CurrentPipeline time tick
|
||||
</param>
|
||||
<returns>
|
||||
|
||||
</returns>
|
||||
</member>
|
||||
<member name="T:StgSharp.Geometries.Square">
|
||||
<summary>
|
||||
A square
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:StgSharp.Math.Vec2">
|
||||
<summary>
|
||||
A two dimension vector defined by two elements. Vec2 in World are default used as colum
|
||||
vector.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.Math.Linear.Orthogonalize(StgSharp.Math.Vec3@,StgSharp.Math.Vec3@)">
|
||||
<summary>
|
||||
Orthogonalize two <see cref="T:StgSharp.Math.Vec3" />s, let their length be 1 and perpendicular to
|
||||
each other.
|
||||
</summary>
|
||||
<param _label="source">
|
||||
|
||||
</param>
|
||||
<param _label="target">
|
||||
|
||||
</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Math.Scaler.ASin(System.Single)">
|
||||
<summary>
|
||||
Reurns the value of ArcSin(x)
|
||||
</summary>
|
||||
<param _label="x">
|
||||
The sine value of the angle
|
||||
</param>
|
||||
<returns>
|
||||
|
||||
</returns>
|
||||
<exception cref="T:System.ArgumentException">
|
||||
|
||||
</exception>
|
||||
</member>
|
||||
<member name="M:StgSharp.Math.Scaler.Exp(System.Single)">
|
||||
<summary>
|
||||
Get the value of E ^ x;
|
||||
</summary>
|
||||
<param _label="x">
|
||||
|
||||
</param>
|
||||
<returns>
|
||||
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Math.Scaler.Log(System.Single)">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
<param _label="x">
|
||||
|
||||
</param>
|
||||
<returns>
|
||||
Returns the value of ln(x).
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Math.Scaler.Pow(System.Single,System.Single)">
|
||||
<summary>
|
||||
calculate the value of x^y
|
||||
</summary>
|
||||
<param _label="x">
|
||||
|
||||
</param>
|
||||
<param _label="y">
|
||||
|
||||
</param>
|
||||
<returns>
|
||||
Returns the value of x^y
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Math.Scaler.LowProceisionRandom">
|
||||
<summary>
|
||||
returns a random float number between 0 and 1.
|
||||
</summary>
|
||||
<returns>
|
||||
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Math.Scaler.Random``1">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
<returns>
|
||||
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Math.Scaler.RandomSeed">
|
||||
<summary>
|
||||
Generates a random seed in int value.
|
||||
</summary>
|
||||
<returns>
|
||||
|
||||
</returns>
|
||||
</member>
|
||||
<member name="T:StgSharp.Graphics.BufferObjectBase">
|
||||
<summary>
|
||||
Interface of all kinds OpenGL Buffer objects
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:StgSharp.Graphics.BufferObjectBase.Item(System.Int32)">
|
||||
<summary>
|
||||
Get the only handle to one of the Object instance
|
||||
</summary>
|
||||
<param _label="index">
|
||||
|
||||
</param>
|
||||
<returns>
|
||||
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.BufferObjectBase.Bind(System.Int32)">
|
||||
<summary>
|
||||
Bind a Buffer instance to OpenGL
|
||||
</summary>
|
||||
<param _label="index">
|
||||
Index of handle of the object in this instance to be bind
|
||||
</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.BufferObjectBase.ToString">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="T:StgSharp.Graphics.glLoader">
|
||||
<summary>
|
||||
Function handler to load an opengl function by searching its _label.
|
||||
</summary>
|
||||
<param _label="name">
|
||||
the _label of the Opengl function
|
||||
</param>
|
||||
<returns>
|
||||
An Intptr value representing the pointer to the function
|
||||
</returns>
|
||||
</member>
|
||||
<member name="P:StgSharp.Graphics.Image.PixelUpdateCount">
|
||||
<summary>
|
||||
Hash code of time pixels updated last time.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:StgSharp.Graphics.OpenGL.AutoTextureGL">
|
||||
<summary>
|
||||
A collection of a sets of OpenGL textures. The collection can automatically select one of
|
||||
the texture with minimum costs to upgrade pixels to Buffer. Usually <see
|
||||
cref="T:StgSharp.Graphics.OpenGL.AutoTextureGL" /> is used for <see cref="T:StgSharp.Graphics.IImageProvider" /> loading, but not for
|
||||
target of <see cref="M:StgSharp.Graphics.OpenGL.OpenGLFunction.FrameBufferTexture2d(StgSharp.Graphics.OpenGL.FrameBufferTarget,System.UInt32,StgSharp.Graphics.OpenGL.Texture2DTarget,StgSharp.Graphics.OpenGL.GlHandle,System.Int32)" />.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:StgSharp.Graphics.OpenGL.ElementBuffer">
|
||||
<summary>
|
||||
A collection of handle to Element Buffer Object in OpenglFunc. Each <see langword="uint"
|
||||
/> value indexed from instance of this class this is the only handle to one Element Buffer
|
||||
Object.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.OpenGL.FrameBuffer.Bind(System.Int32)">
|
||||
<summary>
|
||||
Bind the frame Buffer object with _label frame Buffer to the frame Buffer target
|
||||
specified by target. <see langword="FrameBufferTarget.All" /> will be set as default
|
||||
target.
|
||||
</summary>
|
||||
<param _label="index">
|
||||
Index of object to be binded in handle set
|
||||
</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.OpenGL.FrameBuffer.Bind(StgSharp.Graphics.OpenGL.FrameBufferTarget,System.Int32)">
|
||||
<summary>
|
||||
Bind the frame Buffer object with _label frame Buffer to the frame Buffer target
|
||||
specified by target. Target of this frame Buffer should be set manually.
|
||||
</summary>
|
||||
<param _label="target">
|
||||
The frame Buffer target of the binding operation.
|
||||
</param>
|
||||
<param _label="index">
|
||||
Index of object to be binded in handle set
|
||||
</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.OpenGL.TextureGL.LoadTexture(System.Int32,StgSharp.Graphics.Image)">
|
||||
<summary>
|
||||
Load an <see cref="T:StgSharp.Graphics.Image" /> to certain texture.
|
||||
</summary>
|
||||
<param _label="index">
|
||||
|
||||
</param>
|
||||
<param _label="i">
|
||||
|
||||
</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.OpenGL.VertexBuffer.Unbind">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.OpenGL.VertexBuffer.WriteMatrixData``1(System.Int32,``0,StgSharp.Graphics.OpenGL.BufferUsage)">
|
||||
<summary>
|
||||
Set _data to current vertex Buffer object
|
||||
</summary>
|
||||
<typeparam _label="TItem">
|
||||
Type of bufferData
|
||||
</typeparam>
|
||||
<param _label="index">
|
||||
Index to find certain VBO in this instance
|
||||
</param>
|
||||
<param _label="bufferData">
|
||||
Data to write in
|
||||
</param>
|
||||
<param _label="usage">
|
||||
How OpenGL use these _data, defined by <see cref="T:StgSharp.Graphics.OpenGL.BufferUsage" />
|
||||
</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.OpenGL.VertexBuffer.WriteScalerData``1(System.Int32,``0[],StgSharp.Graphics.OpenGL.BufferUsage)">
|
||||
<summary>
|
||||
Set _data to current vertex Buffer object
|
||||
</summary>
|
||||
<typeparam _label="TItem">
|
||||
Type of bufferData
|
||||
</typeparam>
|
||||
<param _label="index">
|
||||
Index to find certain VBO in this instance
|
||||
</param>
|
||||
<param _label="bufferArray">
|
||||
Data to write in
|
||||
</param>
|
||||
<param _label="usage">
|
||||
How OpenGL use these _data, defined by <see cref="T:StgSharp.Graphics.OpenGL.BufferUsage" />
|
||||
</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.OpenGL.VertexBuffer.WriteScalerData``1(System.Int32,System.ReadOnlySpan{``0},StgSharp.Graphics.OpenGL.BufferUsage)">
|
||||
<summary>
|
||||
Set _data to current vertex Buffer object
|
||||
</summary>
|
||||
<typeparam _label="TItem">
|
||||
Type of bufferData
|
||||
</typeparam>
|
||||
<param _label="index">
|
||||
Index to find certain VBO in this instance
|
||||
</param>
|
||||
<param _label="scalerSpan">
|
||||
A <see cref="T:System.Span`1" /> of _data to write in
|
||||
</param>
|
||||
<param _label="usage">
|
||||
How OpenGL use these _data, defined by <see cref="T:StgSharp.Graphics.OpenGL.BufferUsage" />
|
||||
</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.OpenGL.VertexBuffer.WriteVectorData``1(System.Int32,System.ReadOnlySpan{``0},StgSharp.Graphics.OpenGL.BufferUsage)">
|
||||
<summary>
|
||||
Set data to current vertex Buffer object
|
||||
</summary>
|
||||
<typeparam _label="TItem">
|
||||
Type of bufferData
|
||||
</typeparam>
|
||||
<param _label="index">
|
||||
Index to find certain VBO in this instance
|
||||
</param>
|
||||
<param _label="vectorSpan">
|
||||
A <see cref="T:System.Span`1" /> of data to write in
|
||||
</param>
|
||||
<param _label="usage">
|
||||
How OpenGL use these data, defined by <see cref="T:StgSharp.Graphics.OpenGL.BufferUsage" />
|
||||
</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.OpenGL.VertexBuffer.WriteVectorData``1(System.Int32,``0[],StgSharp.Graphics.OpenGL.BufferUsage)">
|
||||
<summary>
|
||||
Set _data to current vertex Buffer object
|
||||
</summary>
|
||||
<typeparam _label="TItem">
|
||||
Type of bufferData
|
||||
</typeparam>
|
||||
<param _label="index">
|
||||
Index to find certain VBO in this instance
|
||||
</param>
|
||||
<param _label="vectorArray">
|
||||
A array of _data to write in
|
||||
</param>
|
||||
<param _label="usage">
|
||||
How OpenGL use these _data, defined by <see cref="T:StgSharp.Graphics.OpenGL.BufferUsage" />
|
||||
</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.OpenGL.glManager.LoadGLfunc(System.String)">
|
||||
<summary>
|
||||
Get the function pointer of given OpenGL api _label
|
||||
</summary>
|
||||
<param _label="name">
|
||||
ContextName of the OpenGL api
|
||||
</param>
|
||||
<returns>
|
||||
The funtion pointer of the api in stream of <see cref="T:System.IntPtr" />
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.OpenGL.glManager.LoadOpenGLApiTo(System.IntPtr)">
|
||||
<summary>
|
||||
Load all supported OpenGL APIs and bind them to given <see cref="T:StgSharp.MVVM.ViewPort" />.
|
||||
</summary>
|
||||
<param _label="contextHandle">
|
||||
The handle to current OpenGL viewPortDisplay
|
||||
</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.OpenGL.OpenGLFunction.BindFrameBuffer(StgSharp.Graphics.OpenGL.FrameBufferTarget,StgSharp.Graphics.OpenGL.GlHandle)">
|
||||
<summary>
|
||||
Bind a frame Buffer to a frame Buffer target Same function as <see
|
||||
href="https://docs._gl/gl3/glBindFramebuffer"> glBindFramebuffer </see>.
|
||||
</summary>
|
||||
<param _label="target">
|
||||
The frame Buffer target of the binding operation.
|
||||
</param>
|
||||
<param _label="handle">
|
||||
The handle of the frame Buffer object to bind.
|
||||
</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.OpenGL.OpenGLFunction.DeleteRenderBuffer(StgSharp.Graphics.OpenGL.GlHandle)">
|
||||
<summary>
|
||||
Delete a render Buffer object Very simlilar function as <see
|
||||
href="https://docs.gl/gl3/glDeleteRenderbuffers"> glDeleteRenderbuffers </see>. The
|
||||
only deifference is that this mehtod can only delete one renderbuffer at the same
|
||||
time.
|
||||
</summary>
|
||||
<param _label="bufferHandle">
|
||||
Handle to Buffer to delete.
|
||||
</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.OpenGL.glRender.CreateElementBuffer(System.Int32)">
|
||||
<summary>
|
||||
Create a set of <see cref="T:StgSharp.Graphics.OpenGL.ElementBuffer" />.
|
||||
</summary>
|
||||
<param _label="count">
|
||||
Amount of EBO to be created.
|
||||
</param>
|
||||
<returns>
|
||||
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.OpenGL.glRender.CreateTexture(System.Int32)">
|
||||
<summary>
|
||||
Create a sets of <see cref="T:StgSharp.Graphics.OpenGL.TextureGL" />
|
||||
</summary>
|
||||
<param _label="count">
|
||||
Amount of textures to be created.
|
||||
</param>
|
||||
<returns>
|
||||
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.OpenGL.glRender.CreateVertexArray(System.Int32)">
|
||||
<summary>
|
||||
Create a set of <see cref="T:StgSharp.Graphics.OpenGL.VertexArray" />.
|
||||
</summary>
|
||||
<param _label="count">
|
||||
Amount of VAO to be created.
|
||||
</param>
|
||||
<returns>
|
||||
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.OpenGL.glRender.CreateVertexBuffer(System.Int32)">
|
||||
<summary>
|
||||
Create a set of <see cref="T:StgSharp.Graphics.OpenGL.VertexBuffer" />.
|
||||
</summary>
|
||||
<param _label="count">
|
||||
Amount of Object to be created.
|
||||
</param>
|
||||
<returns>
|
||||
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.OpenGL.glRender.InitializeContext">
|
||||
<summary>
|
||||
Initialize an opengl context and load all opengl functions.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.OpenGL.glRender.MakeAsCurrentContext">
|
||||
<summary>
|
||||
Initialize an OpenGl viewPortDisplay if current form has not been binded to any
|
||||
viewPortDisplay. and set the viewPortDisplay binded to current form as current OpenGL
|
||||
viewPortDisplay.
|
||||
</summary>
|
||||
<exception cref="T:System.Exception">
|
||||
Something goes wrong and World fails in creating a new OpenGL viewPortDisplay.
|
||||
</exception>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.OpenGL.glRender.RenderEnd">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.OpenGL.glRender.RenderStart">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.OpenGL.glRender.CreateShaderProgram">
|
||||
<summary>
|
||||
Create an instance of <see cref="T:StgSharp.Graphics.OpenGL.Shader" /> program
|
||||
</summary>
|
||||
<returns>
|
||||
New instance of <see cref="T:StgSharp.Graphics.OpenGL.Shader" /> instance.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.OpenGL.Shader.AttachTo(System.Int32,StgSharp.Graphics.OpenGL.ShaderProgram)">
|
||||
<summary>
|
||||
Attach one shader code to a shader program.
|
||||
</summary>
|
||||
<param _label="target">
|
||||
Shader program to attach
|
||||
</param>
|
||||
<param _label="index">
|
||||
Index of shader code in current shader code set.
|
||||
</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.OpenGL.ShaderProgram.#ctor(StgSharp.Graphics.OpenGL.glRender)">
|
||||
<summary>
|
||||
CustomizeInit a program with no shader attached.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.OpenGL.ShaderProgram.GetUniform``1(System.String)">
|
||||
<summary>
|
||||
Get a uniform form current shader, the value type of the uniform should be provided.
|
||||
</summary>
|
||||
<param _label="name">
|
||||
ContextName of the Uniform in shader code
|
||||
</param>
|
||||
<returns>
|
||||
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.OpenGL.ShaderProgram.GetUniform``2(System.String)">
|
||||
<summary>
|
||||
Get a uniform form current shader, the value type of the uniform should be provided.
|
||||
</summary>
|
||||
<param _label="name">
|
||||
ContextName of the Uniform in shader code
|
||||
</param>
|
||||
<returns>
|
||||
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.OpenGL.ShaderProgram.GetUniform``3(System.String)">
|
||||
<summary>
|
||||
Get a uniform form current shader, the value type of the uniform should be provided.
|
||||
</summary>
|
||||
<param _label="name">
|
||||
ContextName of the Uniform in shader code
|
||||
</param>
|
||||
<returns>
|
||||
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.OpenGL.ShaderProgram.GetUniform``4(System.String)">
|
||||
<summary>
|
||||
Get a uniform form current shader, the value type of the uniform should be provided.
|
||||
</summary>
|
||||
<param _label="name">
|
||||
ContextName of the Uniform in shader code
|
||||
</param>
|
||||
<returns>
|
||||
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.OpenGL.ShaderProgram.Link">
|
||||
<summary>
|
||||
Link the shader to current viewPortDisplay.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.OpenGL.ShaderProgram.Use">
|
||||
<summary>
|
||||
Let the current viewPortDisplay use this shader.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.ShaderEdit.IglConvertable.DisplayGLtypeDefinition">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.ShaderEdit.IglConvertable.GainAllUniforms(StgSharp.Graphics.OpenGL.ShaderProgram,System.String[])">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.ShaderEdit.IglConvertable.GetConvertedGLtype">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
<returns>
|
||||
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.ShaderEdit.IglConvertable.SetAllUniforms">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.RenderStream.SetSizeLimit(System.Int32,System.Int32,System.Int32,System.Int32)">
|
||||
<summary>
|
||||
Set the size limit of current form
|
||||
</summary>
|
||||
<param _label="minWidth">
|
||||
Minimum width of current form
|
||||
</param>
|
||||
<param _label="minHeight">
|
||||
Minimum height of current form
|
||||
</param>
|
||||
<param _label="maxWidth">
|
||||
Maximum width of current form
|
||||
</param>
|
||||
<param _label="maxHeight">
|
||||
Maximum height of current form
|
||||
</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.RenderStream.NativeCameraUniform(StgSharp.Graphics.OpenGL.ShaderProgram,System.String)">
|
||||
<summary>
|
||||
Get <see cref="T:StgSharp.Graphics.OpenGL.Uniform`1" />(TView is <see cref="T:StgSharp.Math.Matrix44" />) uniform from a shader.
|
||||
This uniform will be used as projection matrix of this camera. Additionally, for
|
||||
multi- shader rendering, each shader requires a uniform, so do not ignore return
|
||||
value of this method.
|
||||
</summary>
|
||||
<param _label="source">
|
||||
Shader using this camera
|
||||
</param>
|
||||
<param _label="name">
|
||||
ContextName of projection camera named in shader
|
||||
</param>
|
||||
<returns>
|
||||
<see cref="T:StgSharp.Graphics.OpenGL.Uniform`1" />(TView is <see cref="T:StgSharp.Math.Matrix44" />) representing projection
|
||||
matrix in shader program.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.RenderStream.RenderStart">
|
||||
<summary>
|
||||
Marking the start of current render operations, and set this renser context as
|
||||
current.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.RenderStream.RenderEnd">
|
||||
<summary>
|
||||
Marking the end of current render operations, and release the binding of this renser
|
||||
context to current, making it available for another thread as current.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Camera.GainAllUniforms(StgSharp.Graphics.OpenGL.ShaderProgram,System.String[])">
|
||||
<summary>
|
||||
Get all uniform related to this <see cref="T:StgSharp.Graphics.Camera" />.
|
||||
</summary>
|
||||
<param _label="source">
|
||||
Shader program requires this camera.
|
||||
</param>
|
||||
<param _label="uniformName">
|
||||
ContextName of all related uniforms. If you fallow form from <see
|
||||
cref="M:StgSharp.Graphics.ShaderEdit.IglConvertable.DisplayGLtypeDefinition" />
|
||||
</param>
|
||||
<exception cref="T:System.ArgumentException">
|
||||
|
||||
</exception>
|
||||
</member>
|
||||
<member name="P:StgSharp.Threading.ThreadHelper.EmptyThread">
|
||||
<summary>
|
||||
An individual thread doing nothing, and its <see cref="P:System.Threading.Thread.IsAlive" /> <see
|
||||
langword="property" /> always returns false.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.MVVM.ViewModel.ViewModelBase.UseViewModel(System.String)">
|
||||
<summary>
|
||||
CustomizeInit this form and render it on screen, and respond with operation
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:StgSharp.MVVM.ViewModel.ViewModelBase.Height">
|
||||
<summary>
|
||||
Height of this form, represent in <see cref="T:System.Int32" />
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:StgSharp.MVVM.ViewModel.ViewModelBase.Width">
|
||||
<summary>
|
||||
Width of this form, represent in <see cref="T:System.Int32" />
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:StgSharp.MVVM.ViewModel.ViewModelBase.Size">
|
||||
<summary>
|
||||
Width of this form, represent in <see cref="T:System.Int32" />
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.MVVM.ViewModel.ViewModelBase.SetSizeLimit(StgSharp.Math.Vec2,StgSharp.Math.Vec2)">
|
||||
<summary>
|
||||
Set the size limit of current form
|
||||
</summary>
|
||||
<param _label="minSize">
|
||||
Minimum size of current form. In form of a <see cref="T:StgSharp.Math.Vec2" /> of (width,height)
|
||||
</param>
|
||||
<param _label="maxSize">
|
||||
Maximum size of current form. In form of a <see cref="T:StgSharp.Math.Vec2" /> of (width,height)
|
||||
</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.MVVM.ViewModel.ViewModelBase.SetSizeLimit(System.Int32,System.Int32,System.Int32,System.Int32)">
|
||||
<summary>
|
||||
Set the size limit of current form
|
||||
</summary>
|
||||
<param _label="minWidth">
|
||||
Minimum width of current form
|
||||
</param>
|
||||
<param _label="minHeight">
|
||||
Minimum height of current form
|
||||
</param>
|
||||
<param _label="maxWidth">
|
||||
Maximum width of current form
|
||||
</param>
|
||||
<param _label="maxHeight">
|
||||
Maximum height of current form
|
||||
</param>
|
||||
</member>
|
||||
<member name="T:StgSharp.MVVM.ViewBase">
|
||||
<summary>
|
||||
ViewBase is the base type for all view types, providing context binding and control
|
||||
element binding. A complete view should contain one complete <see cref="T:StgSharp.MVVM.ViewBase.ViewDesigner`1"
|
||||
/>, <see cref="T:StgSharp.MVVM.ViewBase.ViewRender`1" />, and <see cref="!:ViewResponder" />, which provide
|
||||
layout descriptions of control elements, user responses, and rendering implementations in
|
||||
the view. Data between instances of <see cref="T:StgSharp.MVVM.ViewBase.ViewDesigner`1" />, <see
|
||||
cref="T:StgSharp.MVVM.ViewBase.ViewRender`1" />, and <see cref="T:StgSharp.MVVM.ViewBase.ViewResponder`1" /> is shared through <see
|
||||
cref="T:StgSharp.MVVM.ViewBase" />.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.MVVM.ViewBase.GetKeyStatus(StgSharp.KeyboardKey)">
|
||||
<summary>
|
||||
Get the status of a certain key on the keyboard.
|
||||
</summary>
|
||||
<param _label="key">
|
||||
|
||||
</param>
|
||||
<returns>
|
||||
<see cref="T:StgSharp.KeyStatus" /> representing if a key is pressed or released.
|
||||
</returns>
|
||||
</member>
|
||||
<member name="T:StgSharp.MVVM.ViewBase.ViewDesigner`1">
|
||||
<summary>
|
||||
ViewDesigner provides descriptions of various controls in the view, binds the
|
||||
controls to specific user actions and behaviors, and describes the layout and
|
||||
interactions of each control.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:StgSharp.PipeLine.PipelineNode">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
<risk>
|
||||
Reset pipeline has risk, this operation is a direct operation to port in current node, the
|
||||
port on the other node cannot get the change.
|
||||
</risk>
|
||||
</member>
|
||||
<member name="M:StgSharp.PipeLine.PipeLineRunner.IsValidCalling">
|
||||
<summary>
|
||||
<para> Only the following occasions of calling are valid: </para> <para>1. no bp is
|
||||
running or the only bp is quitting.</para><para>2. calling from the main thread or a
|
||||
thread the current bp is running on. </para>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:StgSharp.PipeLine.PipelineScheduler">
|
||||
<summary>
|
||||
A sets of complex logic designed for running in multi threads environment. Warning: do not
|
||||
run a <see cref="T:StgSharp.PipeLine.PipelineScheduler" /> instance in multi threads more than once.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:StgSharp.Timing.TimeSpanProvider">
|
||||
<summary>
|
||||
A microsecond-accuracy timer. It will refresh every a certain time span.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.Timing.TimeSpanProvider.#ctor(System.Int64,StgSharp.Timing.TimeSourceProviderBase)">
|
||||
<summary>
|
||||
Create a new <see cref="T:StgSharp.Timing.TimeSpanProvider" /> and define the length of time span.
|
||||
Length of a single time span is defined in microseconds.
|
||||
</summary>
|
||||
<param _label="spanMicroSeconds">
|
||||
|
||||
</param>
|
||||
<param _label="provider">
|
||||
|
||||
</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Timing.TimeSpanProvider.#ctor(System.Double,StgSharp.Timing.TimeSourceProviderBase)">
|
||||
<summary>
|
||||
Create a new <see cref="T:StgSharp.Timing.TimeSpanProvider" /> and define the length of time span.
|
||||
Length of a single time span is defined in seconds.
|
||||
</summary>
|
||||
<param _label="spanSeconds">
|
||||
|
||||
</param>
|
||||
<param _label="provider">
|
||||
|
||||
</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Timing.TimeSpanProvider.#ctor(System.Int64,System.Int64,StgSharp.Timing.TimeSourceProviderBase)">
|
||||
<summary>
|
||||
Create a new <see cref="T:StgSharp.Timing.TimeSpanProvider" /> and define the length of time span.
|
||||
Length of a single time span is defined in microseconds.
|
||||
</summary>
|
||||
<param _label="spanLength">
|
||||
|
||||
</param>
|
||||
<param _label="maxSpan">
|
||||
|
||||
</param>
|
||||
<param _label="provider">
|
||||
|
||||
</param>
|
||||
</member>
|
||||
<member name="P:StgSharp.Timing.TimeSpanProvider.DefaultProvider">
|
||||
<summary>
|
||||
Time source provider provided in <see cref="T:StgSharp.World" /> internal framework.
|
||||
</summary>
|
||||
</member>
|
||||
</members>
|
||||
</doc>
|
||||
@@ -0,0 +1,244 @@
|
||||
{
|
||||
"runtimeTarget": {
|
||||
"name": ".NETCoreApp,Version=v8.0",
|
||||
"signature": ""
|
||||
},
|
||||
"compilationOptions": {},
|
||||
"targets": {
|
||||
".NETCoreApp,Version=v8.0": {
|
||||
"StgSharp.Model/1.0.0": {
|
||||
"dependencies": {
|
||||
"StgSharp.Common": "1.0.0",
|
||||
"StgSharp.Script": "1.0.0"
|
||||
},
|
||||
"runtime": {
|
||||
"StgSharp.Model.dll": {}
|
||||
}
|
||||
},
|
||||
"CommunityToolkit.HighPerformance/8.4.0": {
|
||||
"runtime": {
|
||||
"lib/net8.0/CommunityToolkit.HighPerformance.dll": {
|
||||
"assemblyVersion": "8.4.0.0",
|
||||
"fileVersion": "8.4.0.1"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.CodeAnalysis.Analyzers/3.11.0": {},
|
||||
"Microsoft.CodeAnalysis.Common/4.13.0": {
|
||||
"dependencies": {
|
||||
"Microsoft.CodeAnalysis.Analyzers": "3.11.0",
|
||||
"System.Collections.Immutable": "8.0.0",
|
||||
"System.Reflection.Metadata": "8.0.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.CodeAnalysis.dll": {
|
||||
"assemblyVersion": "4.13.0.0",
|
||||
"fileVersion": "4.1300.25.12011"
|
||||
}
|
||||
},
|
||||
"resources": {
|
||||
"lib/net8.0/cs/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "cs"
|
||||
},
|
||||
"lib/net8.0/de/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "de"
|
||||
},
|
||||
"lib/net8.0/es/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "es"
|
||||
},
|
||||
"lib/net8.0/fr/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "fr"
|
||||
},
|
||||
"lib/net8.0/it/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "it"
|
||||
},
|
||||
"lib/net8.0/ja/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "ja"
|
||||
},
|
||||
"lib/net8.0/ko/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "ko"
|
||||
},
|
||||
"lib/net8.0/pl/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "pl"
|
||||
},
|
||||
"lib/net8.0/pt-BR/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "pt-BR"
|
||||
},
|
||||
"lib/net8.0/ru/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "ru"
|
||||
},
|
||||
"lib/net8.0/tr/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "tr"
|
||||
},
|
||||
"lib/net8.0/zh-Hans/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "zh-Hans"
|
||||
},
|
||||
"lib/net8.0/zh-Hant/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "zh-Hant"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.CodeAnalysis.CSharp/4.13.0": {
|
||||
"dependencies": {
|
||||
"Microsoft.CodeAnalysis.Analyzers": "3.11.0",
|
||||
"Microsoft.CodeAnalysis.Common": "4.13.0",
|
||||
"System.Collections.Immutable": "8.0.0",
|
||||
"System.Reflection.Metadata": "8.0.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.CodeAnalysis.CSharp.dll": {
|
||||
"assemblyVersion": "4.13.0.0",
|
||||
"fileVersion": "4.1300.25.12011"
|
||||
}
|
||||
},
|
||||
"resources": {
|
||||
"lib/net8.0/cs/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "cs"
|
||||
},
|
||||
"lib/net8.0/de/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "de"
|
||||
},
|
||||
"lib/net8.0/es/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "es"
|
||||
},
|
||||
"lib/net8.0/fr/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "fr"
|
||||
},
|
||||
"lib/net8.0/it/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "it"
|
||||
},
|
||||
"lib/net8.0/ja/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "ja"
|
||||
},
|
||||
"lib/net8.0/ko/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "ko"
|
||||
},
|
||||
"lib/net8.0/pl/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "pl"
|
||||
},
|
||||
"lib/net8.0/pt-BR/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "pt-BR"
|
||||
},
|
||||
"lib/net8.0/ru/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "ru"
|
||||
},
|
||||
"lib/net8.0/tr/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "tr"
|
||||
},
|
||||
"lib/net8.0/zh-Hans/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "zh-Hans"
|
||||
},
|
||||
"lib/net8.0/zh-Hant/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "zh-Hant"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.CSharp/4.7.0": {},
|
||||
"System.Collections.Immutable/8.0.0": {},
|
||||
"System.Reflection.Metadata/8.0.0": {
|
||||
"dependencies": {
|
||||
"System.Collections.Immutable": "8.0.0"
|
||||
}
|
||||
},
|
||||
"System.Runtime.CompilerServices.Unsafe/6.1.0": {},
|
||||
"StgSharp.Common/1.0.0": {
|
||||
"dependencies": {
|
||||
"Microsoft.CSharp": "4.7.0",
|
||||
"System.Runtime.CompilerServices.Unsafe": "6.1.0"
|
||||
},
|
||||
"runtime": {
|
||||
"StgSharp.Common.dll": {
|
||||
"assemblyVersion": "1.0.0",
|
||||
"fileVersion": "1.0.0.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"StgSharp.Script/1.0.0": {
|
||||
"dependencies": {
|
||||
"CommunityToolkit.HighPerformance": "8.4.0",
|
||||
"Microsoft.CodeAnalysis.CSharp": "4.13.0",
|
||||
"StgSharp.Common": "1.0.0"
|
||||
},
|
||||
"runtime": {
|
||||
"StgSharp.Script.dll": {
|
||||
"assemblyVersion": "1.0.0",
|
||||
"fileVersion": "1.0.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"libraries": {
|
||||
"StgSharp.Model/1.0.0": {
|
||||
"type": "project",
|
||||
"serviceable": false,
|
||||
"sha512": ""
|
||||
},
|
||||
"CommunityToolkit.HighPerformance/8.4.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-flxspiBs0G/0GMp7IK2J2ijV9bTG6hEwFc/z6ekHqB6nwRJ4Ry2yLdx+TkbCUYFCl4XhABkAwomeKbT6zM2Zlg==",
|
||||
"path": "communitytoolkit.highperformance/8.4.0",
|
||||
"hashPath": "communitytoolkit.highperformance.8.4.0.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.CodeAnalysis.Analyzers/3.11.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-v/EW3UE8/lbEYHoC2Qq7AR/DnmvpgdtAMndfQNmpuIMx/Mto8L5JnuCfdBYtgvalQOtfNCnxFejxuRrryvUTsg==",
|
||||
"path": "microsoft.codeanalysis.analyzers/3.11.0",
|
||||
"hashPath": "microsoft.codeanalysis.analyzers.3.11.0.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.CodeAnalysis.Common/4.13.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-T8nRl4mAUY4mhdYM4U2ra2vP2EL+ol8Yqwo0gwC/V55vmlXq9NxdIkZJynTpTL1uX/jHijJ90AeOEx4lf7OwzQ==",
|
||||
"path": "microsoft.codeanalysis.common/4.13.0",
|
||||
"hashPath": "microsoft.codeanalysis.common.4.13.0.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.CodeAnalysis.CSharp/4.13.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-BsH7Vijbj9IL7Fj4k/ysZSVyLGFqr75wmdFGwCKWJvSjnA1xwPaQ3hkB2BQdHOt5CpEYA6Q0I6Oo5sDTDHqHsg==",
|
||||
"path": "microsoft.codeanalysis.csharp/4.13.0",
|
||||
"hashPath": "microsoft.codeanalysis.csharp.4.13.0.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.CSharp/4.7.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-pTj+D3uJWyN3My70i2Hqo+OXixq3Os2D1nJ2x92FFo6sk8fYS1m1WLNTs0Dc1uPaViH0YvEEwvzddQ7y4rhXmA==",
|
||||
"path": "microsoft.csharp/4.7.0",
|
||||
"hashPath": "microsoft.csharp.4.7.0.nupkg.sha512"
|
||||
},
|
||||
"System.Collections.Immutable/8.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-AurL6Y5BA1WotzlEvVaIDpqzpIPvYnnldxru8oXJU2yFxFUy3+pNXjXd1ymO+RA0rq0+590Q8gaz2l3Sr7fmqg==",
|
||||
"path": "system.collections.immutable/8.0.0",
|
||||
"hashPath": "system.collections.immutable.8.0.0.nupkg.sha512"
|
||||
},
|
||||
"System.Reflection.Metadata/8.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-ptvgrFh7PvWI8bcVqG5rsA/weWM09EnthFHR5SCnS6IN+P4mj6rE1lBDC4U8HL9/57htKAqy4KQ3bBj84cfYyQ==",
|
||||
"path": "system.reflection.metadata/8.0.0",
|
||||
"hashPath": "system.reflection.metadata.8.0.0.nupkg.sha512"
|
||||
},
|
||||
"System.Runtime.CompilerServices.Unsafe/6.1.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-5o/HZxx6RVqYlhKSq8/zronDkALJZUT2Vz0hx43f0gwe8mwlM0y2nYlqdBwLMzr262Bwvpikeb/yEwkAa5PADg==",
|
||||
"path": "system.runtime.compilerservices.unsafe/6.1.0",
|
||||
"hashPath": "system.runtime.compilerservices.unsafe.6.1.0.nupkg.sha512"
|
||||
},
|
||||
"StgSharp.Common/1.0.0": {
|
||||
"type": "project",
|
||||
"serviceable": false,
|
||||
"sha512": ""
|
||||
},
|
||||
"StgSharp.Script/1.0.0": {
|
||||
"type": "project",
|
||||
"serviceable": false,
|
||||
"sha512": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,4 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")]
|
||||
@@ -0,0 +1,23 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码由工具生成。
|
||||
// 运行时版本:4.0.30319.42000
|
||||
//
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果
|
||||
// 重新生成代码,这些更改将会丢失。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("StgSharp.Model")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+a24215351dc744a54eba06fb168de611dc5a335f")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("StgSharp.Model")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("StgSharp.Model")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
// 由 MSBuild WriteCodeFragment 类生成。
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
9a9fb7bf62f33fb2d23ef3fe81ca30586a96ae1ce53a73dcd50ccf3676a9b491
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
is_global = true
|
||||
build_property.TargetFramework = net8.0
|
||||
build_property.TargetFramework = net8.0
|
||||
build_property.TargetPlatformMinVersion =
|
||||
build_property.TargetPlatformMinVersion =
|
||||
build_property.UsingMicrosoftNETSdkWeb =
|
||||
build_property.UsingMicrosoftNETSdkWeb =
|
||||
build_property.ProjectTypeGuids =
|
||||
build_property.ProjectTypeGuids =
|
||||
build_property.InvariantGlobalization =
|
||||
build_property.InvariantGlobalization =
|
||||
build_property.PlatformNeutralAssembly =
|
||||
build_property.PlatformNeutralAssembly =
|
||||
build_property.EnforceExtendedAnalyzerRules =
|
||||
build_property.EnforceExtendedAnalyzerRules =
|
||||
build_property._SupportedPlatformList = Linux,macOS,Windows
|
||||
build_property._SupportedPlatformList = Linux,macOS,Windows
|
||||
build_property.RootNamespace = StgSharp.Model
|
||||
build_property.ProjectDir = D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.Model\
|
||||
build_property.EnableComHosting =
|
||||
build_property.EnableGeneratedComInterfaceComImportInterop =
|
||||
build_property.EffectiveAnalysisLevelStyle = 8.0
|
||||
build_property.EnableCodeStyleSeverity =
|
||||
Binary file not shown.
Binary file not shown.
+4
@@ -0,0 +1,4 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
|
||||
@@ -0,0 +1,23 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码由工具生成。
|
||||
// 运行时版本:4.0.30319.42000
|
||||
//
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果
|
||||
// 重新生成代码,这些更改将会丢失。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("StgSharp.Model")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+e687473132786f419a48170313782d6779890c3d")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("StgSharp.Model")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("StgSharp.Model")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
// 由 MSBuild WriteCodeFragment 类生成。
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
abf07b2e35262c3cd0803343b75421705dafd659347da275d51988c6cb04d83a
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
is_global = true
|
||||
build_property.RootNamespace = StgSharp.Model
|
||||
build_property.ProjectDir = D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.Model\
|
||||
build_property.EnableComHosting =
|
||||
build_property.EnableGeneratedComInterfaceComImportInterop =
|
||||
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user