/*
* MATLAB Compiler: 4.14 (R2010b)
* Date: Mon Dec 06 15:45:36 2010
* Arguments: "-B" "macro_default" "-W"
* "dotnet:BwnFunctions,Interpolator,2.0,D:\Projects\1002637 - Building with
* Nature\TempCompile\Interpolate.snk" "-T" "link:lib" "-d" "D:\Projects\1002637 -
* Building with Nature\TempCompile\BwnFunctions\src" "-N" "-w"
* "enable:specified_file_mismatch" "-w" "enable:repeated_file" "-w"
* "enable:switch_ignored" "-w" "enable:missing_lib_sentinel" "-w" "enable:demo_license"
* "-v" "class{Interpolator:D:\Projects\1002637 - Building with
* Nature\TempCompile\Initialize.m,D:\Projects\1002637 - Building with
* Nature\TempCompile\InterpolateToLine.m,D:\Projects\1002637 - Building with
* Nature\TempCompile\PlotTimeSeries.m}" "-a"
* "F:\OpenEarthTools\matlab\applications\SuperTrans\data\EPSG.mat"
*/
using System;
using System.Reflection;
using System.IO;
using MathWorks.MATLAB.NET.Arrays;
using MathWorks.MATLAB.NET.Utility;
#if SHARED
[assembly: System.Reflection.AssemblyKeyFile(@"D:\Projects\1002637 - Building with Nature\TempCompile\Interpolate.snk")]
#endif
namespace BwnFunctionsNative
{
///
/// The Interpolator class provides a CLS compliant, Object (native) interface to the
/// M-functions contained in the files:
///
/// D:\Projects\1002637 - Building with Nature\TempCompile\Initialize.m
///
/// D:\Projects\1002637 - Building with Nature\TempCompile\InterpolateToLine.m
///
/// D:\Projects\1002637 - Building with Nature\TempCompile\PlotTimeSeries.m
///
/// deployprint.m
///
/// printdlg.m
///
///
/// @Version 2.0
///
public class Interpolator : IDisposable
{
#region Constructors
///
/// The static constructor instantiates and initializes the MATLAB Compiler Runtime
/// instance.
///
static Interpolator()
{
if (MWMCR.MCRAppInitialized)
{
Assembly assembly= Assembly.GetExecutingAssembly();
string ctfFilePath= assembly.Location;
int lastDelimiter= ctfFilePath.LastIndexOf(@"\");
ctfFilePath= ctfFilePath.Remove(lastDelimiter, (ctfFilePath.Length - lastDelimiter));
string ctfFileName = "BwnFunctions.ctf";
Stream embeddedCtfStream = null;
String[] resourceStrings = assembly.GetManifestResourceNames();
foreach (String name in resourceStrings)
{
if (name.Contains(ctfFileName))
{
embeddedCtfStream = assembly.GetManifestResourceStream(name);
break;
}
}
mcr= new MWMCR("",
ctfFilePath, embeddedCtfStream, true);
}
else
{
throw new ApplicationException("MWArray assembly could not be initialized");
}
}
///
/// Constructs a new instance of the Interpolator class.
///
public Interpolator()
{
}
#endregion Constructors
#region Finalize
///
/// Class destructor called by the CLR garbage collector.
///
~Interpolator()
{
Dispose(false);
}
///
/// Frees the native resources associated with this object
///
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
///
/// Internal dispose function
///
protected virtual void Dispose(bool disposing)
{
if (!disposed)
{
disposed= true;
if (disposing)
{
// Free managed resources;
}
// Free native resources
}
}
#endregion Finalize
#region Methods
///
/// Provides a void output, 0-input Objectinterface to the Initialize M-function.
///
///
///
///
public void Initialize()
{
mcr.EvaluateFunction(0, "Initialize", new Object[]{});
}
///
/// Provides a void output, 1-input Objectinterface to the Initialize M-function.
///
///
///
/// Array of Objects representing the input arguments 1
/// through varargin.length
///
public void Initialize(params Object[] varargin)
{
mcr.EvaluateFunction(0, "Initialize", varargin);
}
///
/// Provides the standard 0-input Object interface to the Initialize M-function.
///
///
///
/// The number of output arguments to return.
/// An Array of length "numArgsOut" containing the output
/// arguments.
///
public Object[] Initialize(int numArgsOut)
{
return mcr.EvaluateFunction(numArgsOut, "Initialize", new Object[]{});
}
///
/// Provides the standard 1-input Object interface to the Initialize M-function.
///
///
///
/// The number of output arguments to return.
/// Array of Objects representing the input arguments 1
/// through varargin.length
/// An Array of length "numArgsOut" containing the output
/// arguments.
///
public Object[] Initialize(int numArgsOut, params Object[] varargin)
{
return mcr.EvaluateFunction(numArgsOut, "Initialize", varargin);
}
///
/// Provides a single output, 0-input Objectinterface to the InterpolateToLine
/// M-function.
///
///
/// M-Documentation:
/// specify possible ncVariable names for longitude, latitude
///
/// An Object containing the first output argument.
///
public Object InterpolateToLine()
{
return mcr.EvaluateFunction("InterpolateToLine", new Object[]{});
}
///
/// Provides a single output, 1-input Objectinterface to the InterpolateToLine
/// M-function.
///
///
/// M-Documentation:
/// specify possible ncVariable names for longitude, latitude
///
/// Input argument #1
/// An Object containing the first output argument.
///
public Object InterpolateToLine(Object ncfile)
{
return mcr.EvaluateFunction("InterpolateToLine", ncfile);
}
///
/// Provides a single output, 2-input Objectinterface to the InterpolateToLine
/// M-function.
///
///
/// M-Documentation:
/// specify possible ncVariable names for longitude, latitude
///
/// Input argument #1
/// Input argument #2
/// An Object containing the first output argument.
///
public Object InterpolateToLine(Object ncfile, Object ncVariable)
{
return mcr.EvaluateFunction("InterpolateToLine", ncfile, ncVariable);
}
///
/// Provides a single output, 3-input Objectinterface to the InterpolateToLine
/// M-function.
///
///
/// M-Documentation:
/// specify possible ncVariable names for longitude, latitude
///
/// Input argument #1
/// Input argument #2
/// Input argument #3
/// An Object containing the first output argument.
///
public Object InterpolateToLine(Object ncfile, Object ncVariable, Object Centre)
{
return mcr.EvaluateFunction("InterpolateToLine", ncfile, ncVariable, Centre);
}
///
/// Provides a single output, 4-input Objectinterface to the InterpolateToLine
/// M-function.
///
///
/// M-Documentation:
/// specify possible ncVariable names for longitude, latitude
///
/// Input argument #1
/// Input argument #2
/// Input argument #3
/// Input argument #4
/// An Object containing the first output argument.
///
public Object InterpolateToLine(Object ncfile, Object ncVariable, Object Centre,
Object Vertex)
{
return mcr.EvaluateFunction("InterpolateToLine", ncfile, ncVariable, Centre, Vertex);
}
///
/// Provides a single output, 5-input Objectinterface to the InterpolateToLine
/// M-function.
///
///
/// M-Documentation:
/// specify possible ncVariable names for longitude, latitude
///
/// Input argument #1
/// Input argument #2
/// Input argument #3
/// Input argument #4
/// Array of Objects representing the input arguments 5
/// through varargin.length+4
/// An Object containing the first output argument.
///
public Object InterpolateToLine(Object ncfile, Object ncVariable, Object Centre,
Object Vertex, params Object[] varargin)
{
Object[] argsIn= {ncfile, ncVariable, Centre, Vertex, varargin};
return mcr.EvaluateFunction("InterpolateToLine", argsIn);
}
///
/// Provides the standard 0-input Object interface to the InterpolateToLine
/// M-function.
///
///
/// M-Documentation:
/// specify possible ncVariable names for longitude, latitude
///
/// The number of output arguments to return.
/// An Array of length "numArgsOut" containing the output
/// arguments.
///
public Object[] InterpolateToLine(int numArgsOut)
{
return mcr.EvaluateFunction(numArgsOut, "InterpolateToLine", new Object[]{});
}
///
/// Provides the standard 1-input Object interface to the InterpolateToLine
/// M-function.
///
///
/// M-Documentation:
/// specify possible ncVariable names for longitude, latitude
///
/// The number of output arguments to return.
/// Input argument #1
/// An Array of length "numArgsOut" containing the output
/// arguments.
///
public Object[] InterpolateToLine(int numArgsOut, Object ncfile)
{
return mcr.EvaluateFunction(numArgsOut, "InterpolateToLine", ncfile);
}
///
/// Provides the standard 2-input Object interface to the InterpolateToLine
/// M-function.
///
///
/// M-Documentation:
/// specify possible ncVariable names for longitude, latitude
///
/// The number of output arguments to return.
/// Input argument #1
/// Input argument #2
/// An Array of length "numArgsOut" containing the output
/// arguments.
///
public Object[] InterpolateToLine(int numArgsOut, Object ncfile, Object ncVariable)
{
return mcr.EvaluateFunction(numArgsOut, "InterpolateToLine", ncfile, ncVariable);
}
///
/// Provides the standard 3-input Object interface to the InterpolateToLine
/// M-function.
///
///
/// M-Documentation:
/// specify possible ncVariable names for longitude, latitude
///
/// The number of output arguments to return.
/// Input argument #1
/// Input argument #2
/// Input argument #3
/// An Array of length "numArgsOut" containing the output
/// arguments.
///
public Object[] InterpolateToLine(int numArgsOut, Object ncfile, Object ncVariable,
Object Centre)
{
return mcr.EvaluateFunction(numArgsOut, "InterpolateToLine", ncfile, ncVariable, Centre);
}
///
/// Provides the standard 4-input Object interface to the InterpolateToLine
/// M-function.
///
///
/// M-Documentation:
/// specify possible ncVariable names for longitude, latitude
///
/// The number of output arguments to return.
/// Input argument #1
/// Input argument #2
/// Input argument #3
/// Input argument #4
/// An Array of length "numArgsOut" containing the output
/// arguments.
///
public Object[] InterpolateToLine(int numArgsOut, Object ncfile, Object ncVariable,
Object Centre, Object Vertex)
{
return mcr.EvaluateFunction(numArgsOut, "InterpolateToLine", ncfile, ncVariable, Centre, Vertex);
}
///
/// Provides the standard 5-input Object interface to the InterpolateToLine
/// M-function.
///
///
/// M-Documentation:
/// specify possible ncVariable names for longitude, latitude
///
/// The number of output arguments to return.
/// Input argument #1
/// Input argument #2
/// Input argument #3
/// Input argument #4
/// Array of Objects representing the input arguments 5
/// through varargin.length+4
/// An Array of length "numArgsOut" containing the output
/// arguments.
///
public Object[] InterpolateToLine(int numArgsOut, Object ncfile, Object ncVariable,
Object Centre, Object Vertex, params Object[] varargin)
{
Object[] argsIn= {ncfile, ncVariable, Centre, Vertex, varargin};
return mcr.EvaluateFunction(numArgsOut, "InterpolateToLine", argsIn);
}
///
/// Provides a single output, 0-input Objectinterface to the PlotTimeSeries
/// M-function.
///
///
/// M-Documentation:
/// function [output] = PlotTimeSeries(ncfile,ncVariable, startTime, stopTime)
/// with startTime and stopTime optional time strings:
/// (ISO 8601) 'yyyymmddTHHMMSS' 20000301T154517
///
/// An Object containing the first output argument.
///
public Object PlotTimeSeries()
{
return mcr.EvaluateFunction("PlotTimeSeries", new Object[]{});
}
///
/// Provides a single output, 1-input Objectinterface to the PlotTimeSeries
/// M-function.
///
///
/// M-Documentation:
/// function [output] = PlotTimeSeries(ncfile,ncVariable, startTime, stopTime)
/// with startTime and stopTime optional time strings:
/// (ISO 8601) 'yyyymmddTHHMMSS' 20000301T154517
///
/// Input argument #1
/// An Object containing the first output argument.
///
public Object PlotTimeSeries(Object ncfile)
{
return mcr.EvaluateFunction("PlotTimeSeries", ncfile);
}
///
/// Provides a single output, 2-input Objectinterface to the PlotTimeSeries
/// M-function.
///
///
/// M-Documentation:
/// function [output] = PlotTimeSeries(ncfile,ncVariable, startTime, stopTime)
/// with startTime and stopTime optional time strings:
/// (ISO 8601) 'yyyymmddTHHMMSS' 20000301T154517
///
/// Input argument #1
/// Input argument #2
/// An Object containing the first output argument.
///
public Object PlotTimeSeries(Object ncfile, Object ncVariable)
{
return mcr.EvaluateFunction("PlotTimeSeries", ncfile, ncVariable);
}
///
/// Provides a single output, 3-input Objectinterface to the PlotTimeSeries
/// M-function.
///
///
/// M-Documentation:
/// function [output] = PlotTimeSeries(ncfile,ncVariable, startTime, stopTime)
/// with startTime and stopTime optional time strings:
/// (ISO 8601) 'yyyymmddTHHMMSS' 20000301T154517
///
/// Input argument #1
/// Input argument #2
/// Array of Objects representing the input arguments 3
/// through varargin.length+2
/// An Object containing the first output argument.
///
public Object PlotTimeSeries(Object ncfile, Object ncVariable, params Object[]
varargin)
{
Object[] argsIn= {ncfile, ncVariable, varargin};
return mcr.EvaluateFunction("PlotTimeSeries", argsIn);
}
///
/// Provides the standard 0-input Object interface to the PlotTimeSeries M-function.
///
///
/// M-Documentation:
/// function [output] = PlotTimeSeries(ncfile,ncVariable, startTime, stopTime)
/// with startTime and stopTime optional time strings:
/// (ISO 8601) 'yyyymmddTHHMMSS' 20000301T154517
///
/// The number of output arguments to return.
/// An Array of length "numArgsOut" containing the output
/// arguments.
///
public Object[] PlotTimeSeries(int numArgsOut)
{
return mcr.EvaluateFunction(numArgsOut, "PlotTimeSeries", new Object[]{});
}
///
/// Provides the standard 1-input Object interface to the PlotTimeSeries M-function.
///
///
/// M-Documentation:
/// function [output] = PlotTimeSeries(ncfile,ncVariable, startTime, stopTime)
/// with startTime and stopTime optional time strings:
/// (ISO 8601) 'yyyymmddTHHMMSS' 20000301T154517
///
/// The number of output arguments to return.
/// Input argument #1
/// An Array of length "numArgsOut" containing the output
/// arguments.
///
public Object[] PlotTimeSeries(int numArgsOut, Object ncfile)
{
return mcr.EvaluateFunction(numArgsOut, "PlotTimeSeries", ncfile);
}
///
/// Provides the standard 2-input Object interface to the PlotTimeSeries M-function.
///
///
/// M-Documentation:
/// function [output] = PlotTimeSeries(ncfile,ncVariable, startTime, stopTime)
/// with startTime and stopTime optional time strings:
/// (ISO 8601) 'yyyymmddTHHMMSS' 20000301T154517
///
/// The number of output arguments to return.
/// Input argument #1
/// Input argument #2
/// An Array of length "numArgsOut" containing the output
/// arguments.
///
public Object[] PlotTimeSeries(int numArgsOut, Object ncfile, Object ncVariable)
{
return mcr.EvaluateFunction(numArgsOut, "PlotTimeSeries", ncfile, ncVariable);
}
///
/// Provides the standard 3-input Object interface to the PlotTimeSeries M-function.
///
///
/// M-Documentation:
/// function [output] = PlotTimeSeries(ncfile,ncVariable, startTime, stopTime)
/// with startTime and stopTime optional time strings:
/// (ISO 8601) 'yyyymmddTHHMMSS' 20000301T154517
///
/// The number of output arguments to return.
/// Input argument #1
/// Input argument #2
/// Array of Objects representing the input arguments 3
/// through varargin.length+2
/// An Array of length "numArgsOut" containing the output
/// arguments.
///
public Object[] PlotTimeSeries(int numArgsOut, Object ncfile, Object ncVariable,
params Object[] varargin)
{
Object[] argsIn= {ncfile, ncVariable, varargin};
return mcr.EvaluateFunction(numArgsOut, "PlotTimeSeries", argsIn);
}
///
/// This method will cause a MATLAB figure window to behave as a modal dialog box.
/// The method will not return until all the figure windows associated with this
/// component have been closed.
///
///
/// An application should only call this method when required to keep the
/// MATLAB figure window from disappearing. Other techniques, such as calling
/// Console.ReadLine() from the application should be considered where
/// possible.
///
public void WaitForFiguresToDie()
{
mcr.WaitForFiguresToDie();
}
#endregion Methods
#region Class Members
private static MWMCR mcr= null;
private bool disposed= false;
#endregion Class Members
}
}