多角形の凸性のチェック(浮動小数点型)
Namespace: fvalgcliAssembly: fvalgcli (in fvalgcli.dll) Version: 3.1.0.0 (3.1.0.11)
Syntax
C# |
---|
public static int fnFIE_cg_convex_polygon_check_d(
DPNT_T_PTR vrtx,
int num,
ref int convex_type
) |
Visual Basic |
---|
Public Shared Function fnFIE_cg_convex_polygon_check_d (
vrtx As DPNT_T_PTR,
num As Integer,
ByRef convex_type As Integer
) As Integer |
Parameters
- vrtx
- Type: fvalgcli..::..DPNT_T_PTR
多角形の頂点
- num
- Type: System..::..Int32
頂点数( vrtx の要素数)
- convex_type
- Type: System..::..Int32%
多角形の凸形状
Return Value
Type:
Int32
以下のエラーコードを返します。
エラーコード:f_err | 内容 |
---|
F_ERR_NONE | 正常終了 |
F_ERR_INVALID_PARAM | 不正なパラメータが渡された | 頂点数が3未満 |
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_convex_polygon_check_d()
{
int status = (int)f_err.F_ERR_NONE;
DPNT_T_PTR vrtx = DPNT_T_PTR.Zero;
int num;
int convex_type = new int();
int ans_convex_type;
const double size = 10.0;
try
{
num = 5;
vrtx = DPNT_T_PTR.alloc(num);
vrtx[1] = DPNT_T.init(0.0, 0.0);
vrtx[0] = DPNT_T.init(0.0, vrtx[1].y + size);
vrtx[2] = DPNT_T.init(vrtx[0].x + size, 0.0);
vrtx[3] = DPNT_T.init(vrtx[0].x + size, vrtx[1].y + size);
#if !NOT_CONVEX
vrtx[4] = DPNT_T.init( vrtx[0].x + size / 2.0, vrtx[0].y + 1);
ans_convex_type = 1;
#else
vrtx[4] = DPNT_T.init( vrtx[0].x + size / 2.0, vrtx[0].y - 1);
ans_convex_type = 0;
#endif
status = api.fnFIE_cg_convex_polygon_check_d(vrtx, num, ref convex_type);
Assert.IsTrue(status == (int)f_err.F_ERR_NONE, "エラーが発生しました。({0})", (f_err)status);
ConsoleOut.WriteFunctionName(":\t");
Console.Write("convex_type = {0} ...", convex_type);
ConsoleOut.IsTrue(ans_convex_type == convex_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_convex_polygon_check_d()
Dim status As Integer = CInt(f_err.F_ERR_NONE)
Dim vrtx As DPNT_T_PTR = DPNT_T_PTR.Zero
Dim num As Integer
Dim convex_type As New Integer()
Dim ans_convex_type As Integer
Const size As Double = 10.0
Try
num = 5
vrtx = DPNT_T_PTR.alloc(num)
vrtx(1) = DPNT_T.init(0.0, 0.0)
vrtx(0) = DPNT_T.init(0.0, vrtx(1).y + size)
vrtx(2) = DPNT_T.init(vrtx(0).x + size, 0.0)
vrtx(3) = DPNT_T.init(vrtx(0).x + size, vrtx(1).y + size)
#If Not NOT_CONVEX Then
vrtx(4) = DPNT_T.init(vrtx(0).x + size / 2.0, vrtx(0).y + 1)
ans_convex_type = 1
#Else
vrtx(4) = DPNT_T.init(vrtx(0).x + size / 2.0, vrtx(0).y - 1)
ans_convex_type = 0
#End If
status = api.fnFIE_cg_convex_polygon_check_d(vrtx, num, convex_type)
Assert.IsTrue(status = CInt(f_err.F_ERR_NONE), "エラーが発生しました。({0})", CType(status, f_err))
ConsoleOut.WriteFunctionName(":" & vbTab)
Console.Write("convex_type = {0} ...", convex_type)
ConsoleOut.IsTrue(ans_convex_type = convex_type)
Finally
vrtx.Dispose()
End Try
End Sub
End Class |
See Also