トンボマークの中心の算出
Namespace: fvalgcliAssembly: fvalgcli (in fvalgcli.dll) Version: 3.1.0.0 (3.1.0.11)
Syntax
C# |
---|
public static int fnFIE_cg_calc_cross_mark(
DPNT_T pnt1,
DPNT_T pnt2,
DPNT_T pnt3,
DPNT_T pnt4,
DPNT_T pnt5,
DPNT_T pnt6,
DPNT_T pnt7,
DPNT_T pnt8,
ref DPNT_T center
) |
Visual Basic |
---|
Public Shared Function fnFIE_cg_calc_cross_mark (
pnt1 As DPNT_T,
pnt2 As DPNT_T,
pnt3 As DPNT_T,
pnt4 As DPNT_T,
pnt5 As DPNT_T,
pnt6 As DPNT_T,
pnt7 As DPNT_T,
pnt8 As DPNT_T,
ByRef center As DPNT_T
) As Integer |
Return Value
Type:
Int32
以下のエラーコードを返します。
エラーコード:f_err | 内容 |
---|
F_ERR_NONE | 正常終了 |
F_ERR_INVALID_PARAM | 不正なパラメータが渡された |
F_ERR_CALC_IMPOSSIBLE | 計算不能エラー |
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_calc_cross_mark()
{
int status = (int)f_err.F_ERR_NONE;
DPNT_T pts1 = new DPNT_T();
DPNT_T pts2 = new DPNT_T();
DPNT_T pts3 = new DPNT_T();
DPNT_T pts4 = new DPNT_T();
DPNT_T pts5 = new DPNT_T();
DPNT_T pts6 = new DPNT_T();
DPNT_T pts7 = new DPNT_T();
DPNT_T pts8 = new DPNT_T();
DPNT_T center = new DPNT_T();
DPNT_T ans_center = DPNT_T.init(125, 125);
pts1.x = 100;
pts1.y = 50;
pts2.x = 150;
pts2.y = 50;
pts3.x = 200;
pts3.y = 100;
pts4.x = 200;
pts4.y = 150;
pts5.x = 150;
pts5.y = 200;
pts6.x = 100;
pts6.y = 200;
pts7.x = 50;
pts7.y = 150;
pts8.x = 50;
pts8.y = 100;
status = api.fnFIE_cg_calc_cross_mark(pts1, pts2, pts3, pts4, pts5, pts6, pts7, pts8, ref center);
Assert.IsTrue(status == (int)f_err.F_ERR_NONE, "エラーが発生しました。({0})", (f_err)status);
ConsoleOut.WriteFunctionName(":\n");
Console.WriteLine("center.x: {0}", center.x);
Console.WriteLine("center.y: {0}", center.y);
Console.Write(" ...");
ConsoleOut.IsTrue(center.x == ans_center.x && center.y == ans_center.y);
}
}
} |
Visual Basic | Copy |
---|
Imports System.Collections.Generic
Imports System.Text
Imports fvalgcli
Public Partial Class FIE
<FvPluginExecute> _
Public Sub fnFIE_cg_calc_cross_mark()
Dim status As Integer = CInt(f_err.F_ERR_NONE)
Dim pts1 As New DPNT_T()
Dim pts2 As New DPNT_T()
Dim pts3 As New DPNT_T()
Dim pts4 As New DPNT_T()
Dim pts5 As New DPNT_T()
Dim pts6 As New DPNT_T()
Dim pts7 As New DPNT_T()
Dim pts8 As New DPNT_T()
Dim center As New DPNT_T()
Dim ans_center As DPNT_T = DPNT_T.init(125, 125)
pts1.x = 100
pts1.y = 50
pts2.x = 150
pts2.y = 50
pts3.x = 200
pts3.y = 100
pts4.x = 200
pts4.y = 150
pts5.x = 150
pts5.y = 200
pts6.x = 100
pts6.y = 200
pts7.x = 50
pts7.y = 150
pts8.x = 50
pts8.y = 100
status = api.fnFIE_cg_calc_cross_mark(pts1, pts2, pts3, pts4, pts5, pts6, _
pts7, pts8, center)
Assert.IsTrue(status = CInt(f_err.F_ERR_NONE), "エラーが発生しました。({0})", CType(status, f_err))
ConsoleOut.WriteFunctionName(":" & vbLf)
Console.WriteLine("center.x: {0}", center.x)
Console.WriteLine("center.y: {0}", center.y)
Console.Write(" ...")
ConsoleOut.IsTrue(center.x = ans_center.x AndAlso center.y = ans_center.y)
End Sub
End Class |
See Also