📄 openfig.cpp
字号:
//
// MATLAB Compiler: 3.0
// Date: Wed Jul 14 12:15:03 2004
// Arguments: "-B" "macro_default" "-O" "all" "-O" "fold_scalar_mxarrays:on"
// "-O" "fold_non_scalar_mxarrays:on" "-O" "optimize_integer_for_loops:on" "-O"
// "array_indexing:on" "-O" "optimize_conditionals:on" "-B" "sglcpp" "-p" "-W"
// "main" "-L" "Cpp" "-t" "-T" "link:exe" "-h" "libmmfile.mlib" "-W" "mainhg"
// "libmwsglm.mlib" "QQchabu.m"
//
#include "openfig.hpp"
#include "libsgl.hpp"
#include "libmatlbm.hpp"
#include "libmmfile.hpp"
#include "libmwsglm.hpp"
#include "movegui.hpp"
static mwArray _mxarray0_ = mclInitializeDouble(1.0);
static double _ieee_plusinf_ = mclGetInf();
static mwArray _mxarray1_ = mclInitializeDouble(_ieee_plusinf_);
static mwArray _mxarray2_ = mclInitializeCharVector(0, 0, (mxChar *)NULL);
static mxChar _array4_[9] = { 'i', 'n', 'v', 'i', 's', 'i', 'b', 'l', 'e' };
static mwArray _mxarray3_ = mclInitializeString(9, _array4_);
static mxChar _array6_[7] = { 'v', 'i', 's', 'i', 'b', 'l', 'e' };
static mwArray _mxarray5_ = mclInitializeString(7, _array6_);
static mxChar _array8_[4] = { 'a', 'u', 't', 'o' };
static mwArray _mxarray7_ = mclInitializeString(4, _array8_);
static mxChar _array10_[54] = { 'T', 'h', 'i', 'r', 'd', ' ', 'i', 'n',
'p', 'u', 't', ' ', 'a', 'r', 'g', 'u',
'm', 'e', 'n', 't', ' ', 'm', 'u', 's',
't', ' ', 'b', 'e', ' ', 0x0027, 'i', 'n',
'v', 'i', 's', 'i', 'b', 'l', 'e', 0x0027,
' ', 'o', 'r', ' ', 0x0027, 'v', 'i', 's',
'i', 'b', 'l', 'e', 0x0027, '.' };
static mwArray _mxarray9_ = mclInitializeString(54, _array10_);
static mxChar _array12_[3] = { 'n', 'e', 'w' };
static mwArray _mxarray11_ = mclInitializeString(3, _array12_);
static mxChar _array14_[5] = { 'r', 'e', 'u', 's', 'e' };
static mwArray _mxarray13_ = mclInitializeString(5, _array14_);
static mxChar _array16_[47] = { 'S', 'e', 'c', 'o', 'n', 'd', ' ', 'i', 'n',
'p', 'u', 't', ' ', 'a', 'r', 'g', 'u', 'm',
'e', 'n', 't', ' ', 'm', 'u', 's', 't', ' ',
'b', 'e', ' ', 0x0027, 'n', 'e', 'w',
0x0027, ' ', 'o', 'r', ' ', 0x0027, 'r',
'e', 'u', 's', 'e', 0x0027, '.' };
static mwArray _mxarray15_ = mclInitializeString(47, _array16_);
static mxChar _array18_[4] = { '.', 'f', 'i', 'g' };
static mwArray _mxarray17_ = mclInitializeString(4, _array18_);
static mxChar _array20_[28] = { 'A', 'r', 'g', 'u', 'm', 'e', 'n',
't', ' ', 'm', 'u', 's', 't', ' ',
'b', 'e', ' ', 'a', ' ', '.', 'f',
'i', 'g', ' ', 'f', 'i', 'l', 'e' };
static mwArray _mxarray19_ = mclInitializeString(28, _array20_);
static mxChar _array22_[1] = { '_' };
static mwArray _mxarray21_ = mclInitializeString(1, _array22_);
static mxChar _array24_[1] = { '0' };
static mwArray _mxarray23_ = mclInitializeString(1, _array24_);
static mxChar _array26_[1] = { '9' };
static mwArray _mxarray25_ = mclInitializeString(1, _array26_);
static mxChar _array28_[8] = { 'O', 'p', 'e', 'n', 'F', 'i', 'g', '_' };
static mwArray _mxarray27_ = mclInitializeString(8, _array28_);
static mxChar _array30_[10] = { '_', 'S', 'I', 'N', 'G',
'L', 'E', 'T', 'O', 'N' };
static mwArray _mxarray29_ = mclInitializeString(10, _array30_);
static mwArray _mxarray31_ = mclInitializeDouble(31.0);
static mwArray _mxarray32_ = mclInitializeDouble(0.0);
static mxChar _array34_[7] = { 'V', 'i', 's', 'i', 'b', 'l', 'e' };
static mwArray _mxarray33_ = mclInitializeString(7, _array34_);
static mxChar _array36_[3] = { 'o', 'f', 'f' };
static mwArray _mxarray35_ = mclInitializeString(3, _array36_);
static mxArray * _mxarray38_ = mclInitializeString(7, _array34_);
static mwArray _mxarray37_ = mclInitializeCell(_mxarray38_);
static mxChar _array40_[20] = { 'D', 'e', 'f', 'a', 'u', 'l', 't',
'F', 'i', 'g', 'u', 'r', 'e', 'V',
'i', 's', 'i', 'b', 'l', 'e' };
static mwArray _mxarray39_ = mclInitializeString(20, _array40_);
static mxChar _array42_[8] = { 'o', 'n', 's', 'c', 'r', 'e', 'e', 'n' };
static mwArray _mxarray41_ = mclInitializeString(8, _array42_);
static mxChar _array44_[2] = { 'o', 'n' };
static mwArray _mxarray43_ = mclInitializeString(2, _array44_);
void InitializeModule_openfig() {
}
void TerminateModule_openfig() {
mxDestroyArray(_mxarray38_);
}
static mwArray Mopenfig(int nargout_,
mwArray filename,
mwArray policy,
mwArray visible);
_mexLocalFunctionTable _local_function_table_openfig
= { 0, (mexFunctionTableEntry *)NULL };
//
// The function "Nopenfig" contains the nargout interface for the "openfig"
// M-function from file "e:\matlab6.5\toolbox\matlab\graphics\openfig.m" (lines
// 1-136). This interface is only produced if the M-function uses the special
// variable "nargout". The nargout interface allows the number of requested
// outputs to be specified via the nargout argument, as opposed to the normal
// interface which dynamically calculates the number of outputs based on the
// number of non-NULL inputs it receives. This function processes any input
// arguments and passes them to the implementation version of the function,
// appearing above.
//
mwArray Nopenfig(int nargout,
mwArray filename,
mwArray policy,
mwArray visible) {
mwArray figOut = mwArray::UNDEFINED;
figOut = Mopenfig(nargout, filename, policy, visible);
return figOut;
}
//
// The function "openfig" contains the normal interface for the "openfig"
// M-function from file "e:\matlab6.5\toolbox\matlab\graphics\openfig.m" (lines
// 1-136). This function processes any input arguments and passes them to the
// implementation version of the function, appearing above.
//
mwArray openfig(mwArray filename, mwArray policy, mwArray visible) {
int nargout = 1;
mwArray figOut = mwArray::UNDEFINED;
figOut = Mopenfig(nargout, filename, policy, visible);
return figOut;
}
//
// The function "Vopenfig" contains the void interface for the "openfig"
// M-function from file "e:\matlab6.5\toolbox\matlab\graphics\openfig.m" (lines
// 1-136). The void interface is only produced if the M-function uses the
// special variable "nargout", and has at least one output. The void interface
// function specifies zero output arguments to the implementation version of
// the function, and in the event that the implementation version still returns
// an output (which, in MATLAB, would be assigned to the "ans" variable), it
// deallocates the output. This function processes any input arguments and
// passes them to the implementation version of the function, appearing above.
//
void Vopenfig(mwArray filename, mwArray policy, mwArray visible) {
mwArray figOut = mwArray::UNDEFINED;
figOut = Mopenfig(0, filename, policy, visible);
}
//
// The function "mlxOpenfig" contains the feval interface for the "openfig"
// M-function from file "e:\matlab6.5\toolbox\matlab\graphics\openfig.m" (lines
// 1-136). The feval function calls the implementation version of openfig
// through this function. This function processes any input arguments and
// passes them to the implementation version of the function, appearing above.
//
void mlxOpenfig(int nlhs, mxArray * plhs[], int nrhs, mxArray * prhs[]) {
MW_BEGIN_MLX();
{
mwArray mprhs[3];
mwArray mplhs[1];
int i;
mclCppUndefineArrays(1, mplhs);
if (nlhs > 1) {
error(
mwVarargin(
mwArray(
"Run-time Error: File: openfig Line: 1 Column: "
"1 The function \"openfig\" was called with mor"
"e than the declared number of outputs (1).")));
}
if (nrhs > 3) {
error(
mwVarargin(
mwArray(
"Run-time Error: File: openfig Line: 1 Column: "
"1 The function \"openfig\" was called with mor"
"e than the declared number of inputs (3).")));
}
for (i = 0; i < 3 && i < nrhs; ++i) {
mprhs[i] = mwArray(prhs[i], 0);
}
for (; i < 3; ++i) {
mprhs[i].MakeDIN();
}
mplhs[0] = Mopenfig(nlhs, mprhs[0], mprhs[1], mprhs[2]);
plhs[0] = mplhs[0].FreezeData();
}
MW_END_MLX();
}
//
// The function "Mopenfig" is the implementation version of the "openfig"
// M-function from file "e:\matlab6.5\toolbox\matlab\graphics\openfig.m" (lines
// 1-136). It contains the actual compiled code for that M-function. It is a
// static function and must only be called from one of the interface functions,
// appearing below.
//
//
// function figOut = openfig(filename, policy, visible)
//
static mwArray Mopenfig(int nargout_,
mwArray filename,
mwArray policy,
mwArray visible) {
mwLocalFunctionTable save_local_function_table_
= &_local_function_table_openfig;
int nargin_ = nargin(3, mwVarargin(filename, policy, visible));
mwArray figOut = mwArray::UNDEFINED;
mwArray oldvis = mwArray::UNDEFINED;
mwArray fig = mwArray::UNDEFINED;
mwArray reusing = mwArray::UNDEFINED;
mwArray figs = mwArray::UNDEFINED;
mwArray TOKEN = mwArray::UNDEFINED;
mwArray flag = mwArray::UNDEFINED;
mwArray fname = mwArray::UNDEFINED;
mwArray ext = mwArray::UNDEFINED;
mwArray name = mwArray::UNDEFINED;
mwArray path = mwArray::UNDEFINED;
mwArray ans = mwArray::UNDEFINED;
//
// %OPENFIG Open new copy or raise existing copy of saved figure.
// % OPENFIG('NAME.FIG','new') opens figure contained in .fig file,
// % NAME.FIG, and ensures it is completely on screen. Specifying the
// % .fig extension is optional. Specifying the full path is optional
// % as long as the .fig file is on the MATLAB path.
// %
// % If the .fig file contains an invisible figure, OPENFIG returns
// % its handle and leaves it invisible. The caller should make the
// % figure visible when appropriate.
// %
// % OPENFIG('NAME.FIG') is the same as OPENFIG('NAME.FIG','new').
// %
// % OPENFIG('NAME.FIG','reuse') opens figure contained in .fig file
// % only if a copy is not currently open, otherwise ensures existing
// % copy is still completely on screen. If the existing copy is
// % visible, it is also raised above all other windows.
// %
// % OPENFIG(...,'invisible') opens as above, forcing figure invisible.
// %
// % OPENFIG(...,'visible') opens as above, forcing figure visible.
// %
// % F = OPENFIG(...) returns the handle to the figure.
// %
// % See also: OPEN, MOVEGUI, GUIDE, GUIHANDLES, SAVE, SAVEAS.
//
// % OPENFIG(...,'auto') opens as above, forcing figure invisible on
// % creation. Subsequent calls when the second argument is 'reuse' will
// % obey the current visibility setting.
// %
// % Copyright 1984-2002 The MathWorks, Inc.
// % $Revision: 1.29 $ $Date: 2002/05/31 21:44:39 $
//
// error(nargchk(1,inf,nargin));
//
error(mwVarargin(nargchk(_mxarray0_, _mxarray1_, nargin_)));
//
// if nargin < 3
//
if (nargin_ < 3) {
//
// visible = '';
//
visible = _mxarray2_;
//
// else
//
} else {
//
// visible = lower(visible);
//
visible = lower(mwVa(visible, "visible"));
//
// end
//
}
//
//
// if ~isempty(visible) & ~isequal(visible,'invisible') & ~isequal(visible,'visible') & ~isequal(visible,'auto')
//
{
mwArray a_ = ~ isempty(mwVa(visible, "visible"));
if (tobool(a_)) {
a_
= a_
& ~ isequal(mwVa(visible, "visible"), mwVarargin(_mxarray3_));
} else {
a_ = 0;
}
if (tobool(a_)) {
a_
= a_
& ~ isequal(mwVa(visible, "visible"), mwVarargin(_mxarray5_));
} else {
a_ = 0;
}
if (tobool(a_)
&& tobool(
a_
& ~ isequal(
mwVa(visible, "visible"), mwVarargin(_mxarray7_)))) {
//
// error('Third input argument must be ''invisible'' or ''visible''.');
//
error(mwVarargin(_mxarray9_));
} else {
}
//
// end
//
}
//
//
// if nargin < 2
//
if (nargin_ < 2) {
//
// policy = 'new';
//
policy = _mxarray11_;
//
// end
//
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -