多角形の単純性のチェック(整数型)
Namespace: fvalgcliAssembly: fvalgcli (in fvalgcli.dll) Version: 3.1.0.0 (3.1.0.11)
Syntax
C# |
---|
public static int fnFIE_cg_simple_polygon_check(
PNT_T_PTR vrtx,
int num,
ref int simple_type
) |
Visual Basic |
---|
Public Shared Function fnFIE_cg_simple_polygon_check (
vrtx As PNT_T_PTR,
num As Integer,
ByRef simple_type As Integer
) As Integer |
Parameters
- vrtx
- Type: fvalgcli..::..PNT_T_PTR
多角形の頂点
- num
- Type: System..::..Int32
頂点数( vrtx の要素数)
- simple_type
- Type: System..::..Int32%
多角形の凸形状
Return Value
Type:
Int32
以下のエラーコードを返します。
エラーコード:f_err | 内容 |
---|
F_ERR_NONE | 正常終了 |
F_ERR_INVALID_PARAM | 不正なパラメータが渡された | 頂点数が3未満 |
F_ERR_NOMEMORY | メモリ不足 |
F_ERR_NO_LICENCE | ライセンスエラー、または未初期化エラー |
Remarks
Examples
C# | Copy |
---|
using System;
using System.Collections.Generic;
using System.Text;
using fvalgcli;
namespace TC
{
public partial class FIE
{
[FvPluginExecute]
public void fnFIE_cg_simple_polygon_check()
{
int status = (int)f_err.F_ERR_NONE;
PNT_T_PTR vrtx = PNT_T_PTR.Zero;
int num;
int simple_type = 2;
const int size = 16;
try
{
int ans_simple_type = new int();
vrtx = PNT_T_PTR.alloc(5);
vrtx[0] = PNT_T.init(0, 0);
vrtx[1] = PNT_T.init(0, size);
vrtx[2] = PNT_T.init(size, size);
vrtx[3] = PNT_T.init(size, 0);
vrtx[4] = PNT_T.init(size / 2, size * 2);
#if NOT_SIMPLE
num = 5;
ans_simple_type = 0;
#else
num = 4;
ans_simple_type = 1;
#endif
status = api.fnFIE_cg_simple_polygon_check(vrtx, num, ref simple_type);
Assert.IsTrue(status == (int)f_err.F_ERR_NONE, "エラーが発生しました。({0})", (f_err)status);
ConsoleOut.WriteFunctionName(":\t");
Console.Write("simple_type = {0} ...", simple_type);
ConsoleOut.IsTrue(ans_simple_type == simple_type);
}
finally
{
vrtx.Dispose();
}
}
}
} |
Visual Basic | Copy |
---|
Imports System.Collections.Generic
Imports System.Text
Imports fvalgcli
Public Partial Class FIE
<FvPluginExecute> _
Public Sub fnFIE_cg_simple_polygon_check()
Dim status As Integer = CInt(f_err.F_ERR_NONE)
Dim vrtx As PNT_T_PTR = PNT_T_PTR.Zero
Dim num As Integer
Dim simple_type As Integer = 2
Const size As Integer = 16
Try
Dim ans_simple_type As New Integer()
vrtx = PNT_T_PTR.alloc(5)
vrtx(0) = PNT_T.init(0, 0)
vrtx(1) = PNT_T.init(0, size)
vrtx(2) = PNT_T.init(size, size)
vrtx(3) = PNT_T.init(size, 0)
vrtx(4) = PNT_T.init(size \ 2, size * 2)
#If NOT_SIMPLE Then
num = 5
ans_simple_type = 0
#Else
num = 4
ans_simple_type = 1
#End If
status = api.fnFIE_cg_simple_polygon_check(vrtx, num, simple_type)
Assert.IsTrue(status = CInt(f_err.F_ERR_NONE), "エラーが発生しました。({0})", CType(status, f_err))
ConsoleOut.WriteFunctionName(":" & vbTab)
Console.Write("simple_type = {0} ...", simple_type)
ConsoleOut.IsTrue(ans_simple_type = simple_type)
Finally
vrtx.Dispose()
End Try
End Sub
End Class |
See Also