3点から座標系変換行列の設定(その2)

Namespace: fvalgcli
Assembly: fvalgcli (in fvalgcli.dll) Version: 3.1.0.0 (3.1.0.11)

Syntax

C#
public static int fnFIE_modelview_3pointB(
	F_MODELVIEW_PTR param,
	bool reverse_y,
	DPNT_T pnt_x1,
	DPNT_T pnt_x2,
	DPNT_T pnt_y,
	double scale_x,
	double scale_y
)
Visual Basic
Public Shared Function fnFIE_modelview_3pointB ( 
	param As F_MODELVIEW_PTR,
	reverse_y As Boolean,
	pnt_x1 As DPNT_T,
	pnt_x2 As DPNT_T,
	pnt_y As DPNT_T,
	scale_x As Double,
	scale_y As Double
) As Integer

Parameters

param
Type: fvalgcli..::..F_MODELVIEW_PTR
座標変換係数
reverse_y
Type: System..::..Boolean
Y軸方向
  • TRUE 反転有り(Y軸正方向が上向き)
  • FALSE 反転無し(Y軸正方向が下向き)
pnt_x1
Type: fvalgcli..::..DPNT_T
x軸を決定する点1:P1
pnt_x2
Type: fvalgcli..::..DPNT_T
x軸を決定する点2:P2
pnt_y
Type: fvalgcli..::..DPNT_T
y軸を決定する点:P3
scale_x
Type: System..::..Double
xスケーリング
scale_y
Type: System..::..Double
yスケーリング

Return Value

Type: Int32
以下のエラーコードを返します。

エラーコード:
f_err内容
F_ERR_NONE 正常終了
F_ERR_INVALID_PARAM 不正なパラメータが渡された
F_ERR_CALC_IMPOSSIBLE 計算不能エラー
F_ERR_NOMEMORY メモリ不足
F_ERR_NO_LICENCE ライセンスエラー

Remarks

Examples

C# Copy imageCopy
//    $Revision: 1.1 $

using System;
using System.Collections.Generic;
using System.Text;
using fvalgcli;

namespace TC
{
    public partial class FIE
    {
        /// <summary>
        /// 3点から座標系変換行列の設定(その2).
        /// </summary>
        [FvPluginExecute]
        public void fnFIE_modelview_3pointB()
        {
            int status = (int)f_err.F_ERR_NONE;

            F_MODELVIEW_PTR param = F_MODELVIEW_PTR.Zero;

            // パラメータ.
            bool reverse_y = false;
            DPNT_T pnt_x1 = DPNT_T.init(50, 50);
            DPNT_T pnt_x2 = DPNT_T.init(100, 50);
            DPNT_T pnt_y = DPNT_T.init(25, 25);
            double scale_x = 1;
            double scale_y = 1;

            try
            {
                // 確保.
                param = api.fnFIE_modelview_alloc_param();

                status = api.fnFIE_modelview_3pointB(param, reverse_y, pnt_x1, pnt_x2, pnt_y, scale_x, scale_y);

                Assert.IsTrue(status == (int)f_err.F_ERR_NONE, "fnFIE_modelview_reset_param: エラーが発生しました。({0})", (f_err)status);

                // 結果表示.
                ConsoleOut.WriteFunctionName(":\n");
                Console.WriteLine(" reverse_y = {0}\n angle = {1}\n move = ({2},{3})\n scale = ({4},{5})",
                                    param.reverse_y, param.angle, param.move_x, param.move_y, param.scale_x, param.scale_y);
                ConsoleOut.WriteFMATRIX(param.forward, param.forward.row, param.forward.col);
                ConsoleOut.WriteFMATRIX(param.backward, param.backward.row, param.backward.col);
                Console.Write(" ...");
                ConsoleOut.IsEqualMatrix(param.backward, 1, 0, 25, 0, 1, 25, 0, 0, 1);
            }
            finally
            {
                param.Dispose();
            }
        }
    }
}


Visual Basic Copy imageCopy
'    $Revision: 1.1 $

Imports System.Collections.Generic
Imports System.Text
Imports fvalgcli

Public Partial Class FIE
    ''' <summary>
    ''' 3点から座標系変換行列の設定(その2).
    ''' </summary>
    <FvPluginExecute> _
    Public Sub fnFIE_modelview_3pointB()
        Dim status As Integer = CInt(f_err.F_ERR_NONE)

        Dim param As F_MODELVIEW_PTR = F_MODELVIEW_PTR.Zero

        ' パラメータ.
        Dim reverse_y As Boolean = False
        Dim pnt_x1 As DPNT_T = DPNT_T.init(50, 50)
        Dim pnt_x2 As DPNT_T = DPNT_T.init(100, 50)
        Dim pnt_y As DPNT_T = DPNT_T.init(25, 25)
        Dim scale_x As Double = 1
        Dim scale_y As Double = 1

        Try
            ' 確保.
            param = api.fnFIE_modelview_alloc_param()

            status = api.fnFIE_modelview_3pointB(param, reverse_y, pnt_x1, pnt_x2, pnt_y, scale_x, _
                scale_y)

            Assert.IsTrue(status = CInt(f_err.F_ERR_NONE), "fnFIE_modelview_reset_param: エラーが発生しました。({0})", CType(status, f_err))

            ' 結果表示.
            ConsoleOut.WriteFunctionName(":" & vbLf)
            Console.WriteLine(" reverse_y = {0}" & vbLf & " angle = {1}" & vbLf & " move = ({2},{3})" & vbLf & " scale = ({4},{5})", param.reverse_y, param.angle, param.move_x, param.move_y, param.scale_x, _
                param.scale_y)
            ConsoleOut.WriteFMATRIX(param.forward, param.forward.row, param.forward.col)
            ConsoleOut.WriteFMATRIX(param.backward, param.backward.row, param.backward.col)
            Console.Write(" ...")
            ConsoleOut.IsEqualMatrix(param.backward, 1, 0, 25, 0, 1, _
                25, 0, 0, 1)
        Finally
            param.Dispose()
        End Try
    End Sub
End Class

See Also