示例#1
0
			public Line(EffectVideo cEffect, Composite cParent)
            {
				aLine = new List<EffectVideo>();
                aLine.Add(cEffect);
                nWidth = cEffect.stArea.nWidth;
                nHeight = cEffect.stArea.nHeight;
                _cParent = cParent;
				Area stArea = _cParent.stArea;
                stArea.nHeight += nHeight;
				_cParent.stArea = stArea;
				stArea = cEffect.stArea;
				stArea.nTop = (short)(_cParent._nHeightTotal + cEffect.stArea.nTop);
				cEffect.stArea = stArea;
            }
示例#2
0
            public Line(EffectVideo cEffect, Composite cParent)
            {
                aLine = new List <EffectVideo>();
                aLine.Add(cEffect);
                nWidth   = cEffect.stArea.nWidth;
                nHeight  = cEffect.stArea.nHeight;
                _cParent = cParent;
                Area stArea = _cParent.stArea;

                stArea.nHeight += nHeight;
                _cParent.stArea = stArea;
                stArea          = cEffect.stArea;
                stArea.nTop     = (short)(_cParent._nHeightTotal + cEffect.stArea.nTop);
                cEffect.stArea  = stArea;
            }
示例#3
0
            internal void Add(EffectVideo cEffect)
            {
                Area stArea = cEffect.stArea;

                stArea.nTop    = (short)(_cParent._nHeightTotal + cEffect.stArea.nTop);
                stArea.nLeft   = (short)nWidth;
                cEffect.stArea = stArea;
                aLine.Add(cEffect);
                nWidth += cEffect.stArea.nWidth;
                if (nHeight < cEffect.stArea.nHeight)
                {
                    stArea          = _cParent.stArea;
                    stArea.nHeight += (ushort)(cEffect.stArea.nHeight - nHeight);
                    _cParent.stArea = stArea;
                    short nDelta = (short)((float)(cEffect.stArea.nHeight - nHeight) / 2F + 0.5F);
                    nHeight = cEffect.stArea.nHeight;
                    for (int ni = 0; aLine.Count - 1 > ni; ni++)
                    {
                        stArea           = aLine[ni].stArea;
                        stArea.nTop     += nDelta;
                        aLine[ni].stArea = stArea;
                    }
                }
                else if (nHeight > cEffect.stArea.nHeight)
                {
                    short nDelta = (short)((float)(nHeight - cEffect.stArea.nHeight) / 2F + 0.5F);
                    stArea         = cEffect.stArea;
                    stArea.nTop   += nDelta;
                    cEffect.stArea = stArea;
                }
                if (0 < _cParent._nCurentIndent)
                {
                    stArea        = aLine[aLine.Count - 1].stArea;
                    stArea.nLeft += (short)_cParent._nCurentIndent;
                    aLine[aLine.Count - 1].stArea = stArea;
                    nWidth += _cParent._nCurentIndent;
                }
            }
示例#4
0
			internal void Add(EffectVideo cEffect)
            {
				Area stArea = cEffect.stArea;
				stArea.nTop = (short)(_cParent._nHeightTotal + cEffect.stArea.nTop);
                stArea.nLeft = (short)nWidth;
				cEffect.stArea = stArea;
                aLine.Add(cEffect);
                nWidth += cEffect.stArea.nWidth;
                if (nHeight < cEffect.stArea.nHeight)
                {
					stArea = _cParent.stArea;
                    stArea.nHeight += (ushort)(cEffect.stArea.nHeight - nHeight);
					_cParent.stArea = stArea;
                    short nDelta = (short)((float)(cEffect.stArea.nHeight - nHeight) / 2F + 0.5F);
                    nHeight = cEffect.stArea.nHeight;
					for (int ni = 0; aLine.Count - 1 > ni; ni++)
					{
						stArea = aLine[ni].stArea;
						stArea.nTop += nDelta;
						aLine[ni].stArea = stArea;
					}
                }
                else if (nHeight > cEffect.stArea.nHeight)
                {
                    short nDelta = (short)((float)(nHeight - cEffect.stArea.nHeight) / 2F + 0.5F);
					stArea = cEffect.stArea;
					stArea.nTop += nDelta;
					cEffect.stArea = stArea;
                }
                if (0 < _cParent._nCurentIndent)
                {
					stArea = aLine[aLine.Count - 1].stArea;
					stArea.nLeft += (short)_cParent._nCurentIndent;
					aLine[aLine.Count - 1].stArea = stArea;
                    nWidth += _cParent._nCurentIndent;
                }
            }
示例#5
0
		public void EffectAdd(EffectVideo cEffect, ushort nIndent)
        {
            if (null == cEffect)
                throw new Exception("effect:add: общий массив объектов не инициализирован");
            _aEffects.Add(cEffect);
            _nCurentIndent = nIndent;

            switch (_eType)
            {
                case Type.Vertical:
                    if (null == _aLines)
                        throw new Exception("effect:add: горизонтальный массив объектов не инициализирован");
                    if (1 > _aLines.Count || cEffect.stArea.nWidth > _nWidth - _aLines[_aLines.Count - 1].nWidth)
                    {
                        if (0 < _aLines.Count)
                            _aLines.Last().bFull = true;
                        _aLines.Add(new Line(cEffect, this));
                    }
                    else
                        _aLines[_aLines.Count - 1].Add(cEffect);
					Area stArea = this.stArea;
                    stArea.nWidth = stArea.nWidth < _aLines[_aLines.Count - 1].nWidth ? stArea.nWidth = _aLines[_aLines.Count - 1].nWidth : stArea.nWidth;
					this.stArea = stArea;
                    break;
                case Type.Horizontal:
                    //TODO   реализовать бы...
                    if (null == _aColumns)
                        throw new Exception("effect:add: вертикальный массив объектов не инициализирован");
                    break;
                case Type.Fixed:
                    //здесь ничего не надо - в _aEffects уже добавили ))
                    break;
                default:
                    break;
            }
            
        }
示例#6
0
        public void EffectAdd(EffectVideo cEffect)
        {
			EffectAdd(cEffect, 0);
        }
示例#7
0
        public void EffectAdd(EffectVideo cEffect, ushort nIndent)
        {
            if (null == cEffect)
            {
                throw new Exception("effect:add: общий массив объектов не инициализирован");
            }
            lock (_aEffects)
            {
                if (this.stMergingMethod != cEffect.stMergingMethod)
                {
                    cEffect.stMergingMethod = this.stMergingMethod;
                }

                cEffect.cDock.eCorner = Dock.Corner.unknown;                 // чтобы сами не позиционировались при препаре

                Effect cItemTMP;
                if (null != (cItemTMP = _aEffects.FirstOrDefault(o => o.nID == cEffect.nID)))   // один и тот же эффект можно сделать добавление, но нужно item-ы вводить, чтобы помнить разные Area, как в роле
                {
                    throw new Exception("effect:add: this effect is already here [id=" + cEffect.nID + "][name=" + cEffect.sName + "]");
                }
                if (cEffect.cMask != null)    // т.к. композит разводит все эффекты, то смысла в масках нет.
                {
                    throw new Exception("effect:add: this effect is mask, but composite has not mask handler [id=" + cEffect.nID + "][name=" + cEffect.sName + "]");
                }

                _aEffects.Add(cEffect);
                _nCurentIndent = nIndent;

                switch (_eType)
                {
                case Type.Vertical:
                    if (null == _aLines)
                    {
                        throw new Exception("effect:add: горизонтальный массив объектов не инициализирован");
                    }
                    if (1 > _aLines.Count || cEffect.stArea.nWidth > _nWidth - _aLines[_aLines.Count - 1].nWidth)
                    {
                        if (0 < _aLines.Count)
                        {
                            _aLines.Last().bFull = true;
                        }
                        _aLines.Add(new Line(cEffect, this));
                    }
                    else
                    {
                        _aLines[_aLines.Count - 1].Add(cEffect);
                    }
                    Area stArea = this.stArea;
                    stArea.nWidth = stArea.nWidth < _aLines[_aLines.Count - 1].nWidth ? stArea.nWidth = _aLines[_aLines.Count - 1].nWidth : stArea.nWidth;
                    this.stArea   = stArea;
                    break;

                case Type.Horizontal:
                    //TODO   реализовать бы...
                    if (null == _aColumns)
                    {
                        throw new Exception("effect:add: вертикальный массив объектов не инициализирован");
                    }
                    break;

                case Type.Fixed:
                    //здесь ничего не надо - в _aEffects уже добавили ))
                    break;

                default:
                    break;
                }
            }
        }
示例#8
0
 public void EffectAdd(EffectVideo cEffect)
 {
     EffectAdd(cEffect, 0);
 }