⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 truesize.cpp

📁 matlab的可执行程序
💻 CPP
📖 第 1 页 / 共 5 页
字号:
    // end
    //
    }
    //
    // 
    // if (nargin >= 1)
    //
    if (nargin_ >= 1) {
        //
        // if ((nargin == 1) & isequal(size(varargin{1}), [1 2]))
        //
        mwArray a_ = nargin_ == 1;
        if (tobool(a_)
            && tobool(
                 a_
                 & isequal(
                     feval(
                       mwValueVarargout(),
                       mlxSize,
                       mwVarargin(
                         mwVa(varargin, "varargin").cell(_mxarray0_))),
                     mwVarargin(_mxarray5_)))) {
            //
            // % truesize([M N])
            // figHandle = gcf;
            //
            figHandle = gcf();
            //
            // imSize = varargin{1};
            //
            *imSize = mwVa(varargin, "varargin").cell(_mxarray0_);
        //
        // 
        // else
        //
        } else {
            //
            // % truesize(FIG, ...)
            // if (~ishandle(varargin{1}) | ~strcmp(get(varargin{1},'type'),'figure'))
            //
            mwArray a_0
              = ~ feval(
                    mwValueVarargout(),
                    mlxIshandle,
                    mwVarargin(mwVa(varargin, "varargin").cell(_mxarray0_)));
            if (tobool(a_0)
                || tobool(
                     a_0
                     | ~ strcmp(
                           Nget(
                             1,
                             mwVarargin(
                               mwVa(varargin, "varargin").cell(_mxarray0_),
                               _mxarray7_)),
                           _mxarray9_))) {
                //
                // msg = 'FIG must be a valid figure handle';
                //
                *msg = _mxarray11_;
                //
                // return;
                //
                goto return_;
            //
            // else
            //
            } else {
                //
                // figHandle = varargin{1};
                //
                figHandle = mwVa(varargin, "varargin").cell(_mxarray0_);
            }
        }
        //
        // end
        // end
        // 
        // axHandle = get(figHandle, 'CurrentAxes');
        //
        axHandle
          = Nget(1, mwVarargin(mwVv(figHandle, "figHandle"), _mxarray13_));
        //
        // if (isempty(axHandle))
        //
        if (tobool(isempty(mwVv(axHandle, "axHandle")))) {
            //
            // msg = 'Current figure has no axes';
            //
            *msg = _mxarray15_;
            //
            // return;
            //
            goto return_;
        //
        // end
        //
        }
    //
    // end
    //
    }
    //
    // 
    // if (nargin >= 2)
    //
    if (nargin_ >= 2) {
        //
        // imSize = varargin{2};
        //
        *imSize = mwVa(varargin, "varargin").cell(_mxarray1_);
        //
        // if (~isequal(size(imSize), [1 2]))
        //
        if (mclNotBool(
              isequal(
                size(mwValueVarargout(), mwVv(*imSize, "imSize")),
                mwVarargin(_mxarray5_)))) {
            //
            // msg = 'REQSIZE must be a 1-by-2 vector';
            //
            *msg = _mxarray17_;
            //
            // return;
            //
            goto return_;
        //
        // end
        //
        }
    //
    // end
    //
    }
    //
    // 
    // figHandle = get(axHandle, 'Parent');
    //
    figHandle = Nget(1, mwVarargin(mwVv(axHandle, "axHandle"), _mxarray19_));
    //
    // 
    // % Find all the images and texturemapped surfaces
    // % in the current figure.  These are the candidates.
    // h = [findobj(figHandle, 'Type', 'image') ;
    //
    h
      = vertcat(
          mwVarargin(
            findobj(
              mwVarargin(
                mwVv(figHandle, "figHandle"), _mxarray21_, _mxarray23_)),
            findobj(
              mwVarargin(
                mwVv(figHandle, "figHandle"),
                _mxarray21_,
                _mxarray25_,
                _mxarray27_,
                _mxarray29_))));
    //
    // findobj(figHandle, 'Type', 'surface', ...
    // 'FaceColor', 'texturemap')];
    // 
    // % If there's a colorbar, ignore it.
    // colorbarHandle = findobj(figHandle, 'type', 'image', ...
    //
    *colorbarHandle
      = findobj(
          mwVarargin(
            mwVv(figHandle, "figHandle"),
            _mxarray7_,
            _mxarray23_,
            _mxarray31_,
            _mxarray33_));
    //
    // 'Tag', 'TMW_COLORBAR');
    // if (~isempty(colorbarHandle))
    //
    if (mclNotBool(isempty(mwVv(*colorbarHandle, "colorbarHandle")))) {
        //
        // for k = 1:length(colorbarHandle)
        //
        int v_ = mclForIntStart(1);
        int e_ = mclLengthInt(mwVv(*colorbarHandle, "colorbarHandle"));
        if (v_ > e_) {
            k = _mxarray3_;
        } else {
            //
            // h(h == colorbarHandle(k)) = [];
            // end
            //
            for (; ; ) {
                h(
                  mwVv(h, "h")
                  == mclIntArrayRef(
                       mwVv(*colorbarHandle, "colorbarHandle"), v_))
                = mwEmptySqBracket();
                if (v_ == e_) {
                    break;
                }
                ++v_;
            }
            k = v_;
        }
    //
    // end
    //
    }
    //
    // 
    // if (isempty(h))
    //
    if (tobool(isempty(mwVv(h, "h")))) {
        //
        // msg = 'No images or texturemapped surfaces in the figure';
        //
        *msg = _mxarray35_;
        //
        // return;
        //
        goto return_;
    //
    // end
    //
    }
    //
    // 
    // % Start with the first object on the list as the
    // % initial candidate.  If it's not in the current
    // % axes, look for another one that is.
    // imHandle = h(1);
    //
    *imHandle = mclIntArrayRef(mwVv(h, "h"), 1);
    //
    // if (get(imHandle,'Parent') ~= axHandle)
    //
    if (mclNeBool(
          Nget(1, mwVarargin(mwVv(*imHandle, "imHandle"), _mxarray19_)),
          mwVv(axHandle, "axHandle"))) {
        //
        // for k = 2:length(h)
        //
        int v_ = mclForIntStart(2);
        int e_ = mclLengthInt(mwVv(h, "h"));
        if (v_ > e_) {
            k = _mxarray3_;
        } else {
            //
            // if (get(h(k),'Parent') == axHandle)
            // imHandle = h(k);
            // break;
            // end
            // end
            //
            for (; ; ) {
                if (mclEqBool(
                      Nget(
                        1,
                        mwVarargin(
                          mclIntArrayRef(mwVv(h, "h"), v_), _mxarray19_)),
                      mwVv(axHandle, "axHandle"))) {
                    *imHandle = mclIntArrayRef(mwVv(h, "h"), v_);
                    break;
                }
                if (v_ == e_) {
                    break;
                }
                ++v_;
            }
            k = v_;
        }
    //
    // end
    //
    }
    //
    // 
    // figKids = allchild(figHandle);
    //
    figKids = allchild(mwVv(figHandle, "figHandle"));
    //
    // if ((length(findobj(figKids, 'flat', 'Type', 'axes')) == 1) & ...
    //
    if (mclLengthInt(
          findobj(
            mwVarargin(
              mwVv(figKids, "figKids"), _mxarray37_, _mxarray21_, _mxarray39_)))
        == 1
        && mclLengthInt(
             findobj(
               mwVarargin(
                 mwVv(figKids, "figKids"),
                 _mxarray37_,
                 _mxarray21_,
                 _mxarray41_,
                 _mxarray43_,
                 _mxarray45_)))
           == 0
        && mclLengthInt(mwVv(*imHandle, "imHandle")) == 1) {
        //
        // (length(findobj(figKids, 'flat', 'Type', 'uicontrol', ...
        // 'Visible', 'on')) == 0) & ...
        // (length(imHandle) == 1))
        // % Resize type 1
        // % Figure contains only one axes object, which contains only
        // % one image.
        // resizeType = 1;
        //
        *resizeType = _mxarray0_;
    //
    // 
    // elseif (isempty(colorbarHandle))
    //
    } else if (tobool(isempty(mwVv(*colorbarHandle, "colorbarHandle")))) {
        //
        // % Figure contains other objects and not a colorbar.
        // resizeType = 2;
        //
        *resizeType = _mxarray1_;
    //
    // 
    // else
    //
    } else {
        //
        // % Figure contains a colorbar.  Do we have a one image
        // % one colorbar situation?
        // if (length(colorbarHandle) > 1)
        //
        if (mclLengthInt(mwVv(*colorbarHandle, "colorbarHandle")) > 1) {
            //
            // % No
            // resizeType = 2;
            //
            *resizeType = _mxarray1_;
        //
        // else
        //
        } else {
            //
            // colorbarAxes = get(colorbarHandle, 'Parent');
            //
            colorbarAxes
              = Nget(
                  1,
                  mwVarargin(
                    mwVv(*colorbarHandle, "colorbarHandle"), _mxarray19_));
            //
            // uimenuKids = findobj(figKids, 'flat', 'Type', 'uimenu');
            //
            uimenuKids
              = findobj(
                  mwVarargin(
                    mwVv(figKids, "figKids"),
                    _mxarray37_,
                    _mxarray21_,
                    _mxarray47_));
            //
            // invisUicontrolKids = findobj(figKids, 'flat', 'Type', 'uicontrol', ...
            //
            invisUicontrolKids
              = findobj(
                  mwVarargin(
                    mwVv(figKids, "figKids"),
                    _mxarray37_,
                    _mxarray21_,
                    _mxarray41_,
                    _mxarray43_,
                    _mxarray49_));
            //
            // 'Visible', 'off');
            // otherKids = setdiff(figKids, ...
            //
            otherKids
              = Nsetdiff(
                  1,
                  NULL,
                  mwVv(figKids, "figKids"),
                  vertcat(
                    mwVarargin(
                      mwVv(uimenuKids, "uimenuKids"),
                      mwVv(colorbarAxes, "colorbarAxes"),
                      mwVv(axHandle, "axHandle"),
                      mwVv(invisUicontrolKids, "invisUicontrolKids"))));
            //
            // [uimenuKids ; colorbarAxes ; axHandle ; invisUicontrolKids]);
            // if (length(otherKids) > 1)
            //
            if (mclLengthInt(mwVv(otherKids, "otherKids")) > 1) {
                //
                // % No

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -