座標系変換行列の直接指定
Namespace: fvalgcliAssembly: fvalgcli (in fvalgcli.dll) Version: 3.1.0.0 (3.1.0.11)
Syntax
C# |
---|
public static int fnFIE_modelview_set_param( F_MODELVIEW_PTR param, bool reverse_y, double angle, double move_x, double move_y, double scale_x, double scale_y ) |
Visual Basic |
---|
Public Shared Function fnFIE_modelview_set_param ( param As F_MODELVIEW_PTR, reverse_y As Boolean, angle As Double, move_x As Double, move_y As Double, 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軸正方向が下向き)
- angle
- Type: System..::..Double
変換座標系 傾き(単位:ラジアン)
- move_x
- Type: System..::..Double
変換座標系 x移動量:Δx
- move_y
- Type: System..::..Double
変換座標系 y移動量:Δy
- 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 |
---|---|
// $Revision: 1.1 $ using System; using System.Collections.Generic; using System.Text; using fvalgcli; namespace TC { public partial class FIE { /// <summary> /// 座標系変換行列の直接指定. /// </summary> [FvPluginExecute] public void fnFIE_modelview_set_param() { int status = (int)f_err.F_ERR_NONE; F_MODELVIEW_PTR param = F_MODELVIEW_PTR.Zero; bool reverse_y = false; double angle = 0; double move_x = 10; double move_y = 30; double scale_x = 0.5; double scale_y = 0.5; try { // 確保. param = api.fnFIE_modelview_alloc_param(); status = api.fnFIE_modelview_set_param(param, reverse_y, angle, move_x, move_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, 2, 0, 10, 0, 2, 30, 0, 0, 1); } finally { param.Dispose(); } } } } |
Visual Basic | Copy |
---|---|
' $Revision: 1.1 $ Imports System.Collections.Generic Imports System.Text Imports fvalgcli Public Partial Class FIE ''' <summary> ''' 座標系変換行列の直接指定. ''' </summary> <FvPluginExecute> _ Public Sub fnFIE_modelview_set_param() 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 angle As Double = 0 Dim move_x As Double = 10 Dim move_y As Double = 30 Dim scale_x As Double = 0.5 Dim scale_y As Double = 0.5 Try ' 確保. param = api.fnFIE_modelview_alloc_param() status = api.fnFIE_modelview_set_param(param, reverse_y, angle, move_x, move_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, 2, 0, 10, 0, 2, _ 30, 0, 0, 1) Finally param.Dispose() End Try End Sub End Class |