亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? ssec.h

?? 一款最完整的工業(yè)組態(tài)軟源代碼
?? H
字號:
// Copyright (c) 2002
// Sergey Klimov (kidd@ukr.net)
// WTL Docking windows
//
// This code is provided "as is", with absolutely no warranty expressed
// or implied. Any use is at your own risk.
//
// This code may be used in compiled form in any way you desire. This
// file may be redistributed unmodified by any means PROVIDING it is
// not sold for profit without the authors written consent, and
// providing that this notice and the authors name is included. If
// the source code in  this file is used in any commercial application
// then a simple email woulod be nice.

#ifndef __SSEC_H__
#define __SSEC_H__

#pragma once

#include <cassert>
#include <deque>
#include <algorithm>
#include <functional>
#include <numeric>

namespace ssec{

template <class TPosition,class TDistance=TPosition>
struct bounds_type
{
	typedef TPosition position_t;
	typedef TDistance distance_t;
	typedef bounds_type<position_t,distance_t> bounds_t;

	bounds_type(){}
	bounds_type(position_t l,position_t h)
			:low(l),hi(h)
	{
	}
	distance_t distance() const
	{
		return hi-low;
	}
	bounds_t& operator=(const bounds_t& x)
	{
		hi=x.hi;
		low=x.low;
		return *this;
	}
	position_t bind(position_t pos) const
	{
		if(pos<low)
			pos=low;
		else
		if(pos>hi)
			pos=hi;
		return pos;
	}
	position_t low;
	position_t hi;
};

//uncommenting default value for TPosition yield "fatal error C1001: INTERNAL COMPILER ERROR" I don't know why
template<class T,class TPosition/*=long*/,class TDistance=long,const TDistance TMinDistance=0>
class spraits
{
public:
	typedef TPosition position;
	typedef TDistance distance;
	static distance min_distance(const T& /*x*/)
	{
		return TMinDistance;
	}
};

//SeparatedSection
template<class T,class TTraits >
class ssection
{
	typedef T						separator_t;
	typedef TTraits					traits;

	typedef std::deque<separator_t>	separators_t;
public:
	typedef typename traits::position				position;
	typedef typename traits::distance				distance;
	typedef bounds_type<position,distance>			bounds_t;
	typedef typename separators_t::size_type		size_type;
	typedef typename separators_t::iterator			iterator;
	typedef typename separators_t::reverse_iterator	reverse_iterator;
	typedef typename separators_t::const_iterator	const_iterator;
	typedef typename separators_t::const_reverse_iterator	const_reverse_iterator;
protected:
	static distance add_distance_limit(distance d,const T& x)
	{
		return d+traits::min_distance(x);
	}
	distance distance_limit(const_iterator begin,const_iterator end) const
	{
//		return std::distance(begin,end)*traits::minDistance;
		return std::accumulate(begin,end,0,add_distance_limit);
	}
	template<class T>
	void lshrink(T begin,T end,position rbound,position offset=0)
	{
		while(begin!=end)
		{
			(*begin)+=offset;
			if((*begin)>rbound)
				(*begin)=rbound;
			rbound+=traits::min_distance(*begin);
			++begin;
		}
	}
	template<class T>
	void rshrink(T begin,T end,position lbound,position offset=0)
	{
		while(begin!=end)
		{
			(*begin)+=offset;
			lbound-=traits::min_distance(*begin);
			if((*begin)<lbound)
				(*begin)=lbound;
			++begin;
		}
	}

	inline const double& Min( const double& a, const double& b )
	{
		return b < a ? b : a;
	}
	inline const double& Max( const double& a, const double& b )
	{
		return a < b ? b : a;
	}

	template<class T>
	void scale(T begin,T end,bounds_t bounds,float ratio)
	{
		if(begin!=end)
		{
			double low=bounds.low;
			double offset=low-begin->get_real();
			(*begin)=low;
			bounds.low+=traits::min_distance(*begin);
			bounds.hi-=distance_limit(++begin,end);
			while(begin!=end)
			{
				(*begin)= begin->get_real() + offset;
// pk021110 replaced following line due to truncation error.
// Also CPtrFrame & CWndFrame classes modified to use double m_pos.
//				(*begin)=(double)(bounds.bind(low+position(((*begin)-low)*ratio)));
				(*begin)=Max((double)bounds.low,Min((double)bounds.hi,low+(begin->get_real()-low)*ratio));
				distance d=traits::min_distance(*begin);
				bounds.hi+=d;
				bounds.low=(*begin)+d;
				++begin;
			}
		}
	}
	template<class T>
	void shift(T begin,T end,distance n)
	{
		std::transform(begin,end,begin,std::bind2nd(std::plus<position>(),n));
	}
public:
	ssection()
	{
	}
	ssection(position low,position hi)
		:m_bounds(low,hi)
	{
	}
	position low() const
	{
		return m_bounds.low;
	}
	position hi() const
	{
		return m_bounds.hi;
	}
	iterator begin()
	{
		return m_separators.begin();
	}
	iterator end()
	{
		return m_separators.end();
	}
	reverse_iterator rbegin()
	{
		return m_separators.rbegin();
	}
	reverse_iterator rend()
	{
		return m_separators.rend();
	}

	const_iterator begin() const
	{
		return m_separators.begin();
	}
	const_iterator end() const
	{
		return m_separators.end();
	}
	const_reverse_iterator rbegin() const
	{
		return m_separators.rbegin();
	}
	const_reverse_iterator rend() const
	{
		return m_separators.rend();
	}

	distance distance_limit() const
	{
		return distance_limit(m_separators.begin(),m_separators.end());
	}
	size_type size() const
	{
		return m_separators.size();
	}

	const_iterator locate(position pos) const
	{
		assert(m_bounds.bind(pos)==pos);
		const_iterator i=m_separators.begin();
		if(i!=m_separators.end())
		{
			i=std::lower_bound(i,m_separators.end(),pos+1,std::less<position>());
			--i;
		}
		return i;

	}
	iterator locate(position pos)
	{
		assert(m_bounds.bind(pos)==pos);
		iterator i=m_separators.begin();
		if(i!=m_separators.end())
		{
			i=std::lower_bound(i,m_separators.end(),pos+1,std::less<position>());
			--i;
		}
		return i;
	}

	position get_frame_low(const_iterator i) const
	{
		assert(i!=m_separators.end());
		return (*i);
	}

	position get_frame_hi(const_iterator i) const
	{
		assert(i!=m_separators.end());
		return (++i==m_separators.end()) ? m_bounds.hi : position(*i);
	}

	distance get_frame_size(const_iterator i) const
	{
		return get_frame_hi(i)-get_frame_low(i);
	}
	void get_effective_bounds(const_iterator i,bounds_t& bounds) const
	{
		bounds.low=m_bounds.low+distance_limit(m_separators.begin(),i);
		bounds.hi =m_bounds.hi-distance_limit(i,m_separators.end());
	}

//	iterator insert(iterator i,const T& x,distance length)
//	{
//        position pos=x;
////      assert(m_bounds.bind(pos)==pos);
//
//        distance leftLimit=distance_limit(m_separators.begin(),i);
//        distance rightLimit=distance_limit(i,m_separators.end())/*+traits::min_distance(x)*/;
//
//        bounds_t ef_bounds(m_bounds.low+leftLimit,m_bounds.hi-rightLimit-traits::min_distance(x));
//
//        assert(ef_bounds.low<=ef_bounds.hi);
//        pos=ef_bounds.bind(pos);
//
//        lshrink(m_separators.begin(),i,pos-leftLimit);
//
//        position pos2=pos+length;
//        if(pos2>ef_bounds.hi)
//                pos2=ef_bounds.hi;
//
//        rshrink(m_separators.rbegin(),reverse_iterator(i),pos2+rightLimit);
//
//		i=m_separators.insert(i,x);
//		(*i)=(i!=m_separators.begin()) ? pos : m_bounds.low;
//		return i;
//	}
	iterator insert(iterator i,const T& x,distance length)
	{
        distance leftLimit=distance_limit(m_separators.begin(),i);
        distance rightLimit=distance_limit(i,m_separators.end())/*+traits::min_distance(x)*/;

        bounds_t ef_bounds(m_bounds.low+leftLimit,m_bounds.hi-rightLimit);
        assert(ef_bounds.low<=ef_bounds.hi);

		distance limit=ef_bounds.distance();
		if(length>limit)
			length=limit;
//		assert(length>=traits::min_distance(x));
		position pos=x;
		bounds_t bounds(pos,pos+length);
		if(bounds.low<ef_bounds.low)
		{
			bounds.low=ef_bounds.low;
			bounds.hi=bounds.low+length;
		}
		if(bounds.hi>ef_bounds.hi)
		{
			bounds.hi=ef_bounds.hi;
			bounds.low=bounds.hi-length;
		}
		rshrink(m_separators.rbegin(),reverse_iterator(i),bounds.hi+rightLimit);
        lshrink(m_separators.begin(),i,bounds.low-leftLimit);

		i=m_separators.insert(i,x);
		(*i)=(i!=m_separators.begin()) ? bounds.low : m_bounds.low;
		return i;
	}

    iterator insert(const T& x,distance length)
    {
        position pos=x;
        assert(m_bounds.bind(pos)==pos);
        iterator i=std::lower_bound(m_separators.begin(),m_separators.end(),pos,std::less<position>());
		return insert(i,x,length);
	}
	void set_position(iterator i,position pos)
	{
		distance limit=distance_limit(m_separators.begin(),i);
		assert(pos-limit>=m_bounds.low);
		lshrink(m_separators.begin(),i,pos-limit);


		limit=distance_limit(i,m_separators.end());
		assert(pos+limit<=m_bounds.hi);

		(*i)=pos;
		rshrink(m_separators.rbegin(),reverse_iterator(i),pos+limit);
	}

	void set_bounds(const bounds_t& bounds)
	{
		assert(bounds.distance()>=distance_limit(m_separators.begin(),m_separators.end()));
		distance prevDist=m_bounds.distance();
//		distance offset=bounds.low-m_bounds.low;
		m_bounds=bounds;
		if(prevDist!=0)
		{
			float ratio=float(bounds.distance())/prevDist;
			scale(m_separators.begin(),m_separators.end(),bounds,ratio);
		}
	}
	const_iterator erase(iterator i)
	{
		assert(i!=m_separators.end());
		i=m_separators.erase(i);
		if(i!=m_separators.end() && (i==m_separators.begin()) )
			(*i)=m_bounds.low;
		return i;
	}
	const_iterator replace(iterator i,const T& x)
	{
		assert(i!=m_separators.end());
		position pos=(*i);
		i=m_separators.erase(i);
		i=m_separators.insert(i,x);
		(*i)=pos;
		return i;
	}
//////////////////some ugly additions////////////////////////////////////////
/*
	void set_frame_size(iterator i,distance length)
	{
		assert(i!=m_separators.end());
		assert(m_bounds.distance()>distance_limit(m_separators.begin(),m_separators.end()));
		position pos=(*i);
		iterator inext=i;
		++inext;
		if(length>get_frame_size(i))
		{
			assert(pos<hi()-distance_limit(inext,m_separators.end()));
			distance offset=hi()-distance_limit(inext,m_separators.end())-pos;
			if(offset>length)
				offset=length;
			length-=offset;
			rshrink(m_separators.rbegin(),reverse_iterator(inext),pos+offset);

			if(length>0)
			{
				assert(pos>low()+distance_limit(i,m_separators.end()));
				distance offset=pos-low()+distance_limit(i,m_separators.end());
				if(offset>length)
					offset=length;
				lshrink(m_separators.begin(),inext,pos-offset);
			}
		}
		else
		{
			if(inext!=m_separators.end())
				(*inext)=pos+length;
			else
			{
				distance limit=distance_limit(m_separators.begin(),i);
				if(limit<length)
					length=limit;
				(*i)=hi()-length;
			}
		}
	}
*/
	template<class P>
	void set_bounds(const bounds_t& bounds,P p)
	{
		iterator idecl=std::find_if(m_separators.begin(),m_separators.end(),p);
		assert(idecl!=m_separators.end());

		distance prevDist=m_bounds.distance();
		m_bounds=bounds;
		if(prevDist!=0)
		{
			distance diff=m_bounds.distance()-prevDist;
			if(diff<0)
			{
				distance limit=-(get_frame_size(idecl)-traits::min_distance(*idecl));
				if(diff<limit)
					diff=limit;
			}
			shift(++idecl,m_separators.end(),diff);
			float ratio=float(bounds.distance())/(prevDist+diff);
			scale(m_separators.begin(),m_separators.end(),bounds,ratio);
		}
	}
	template<class P>
	iterator insert(iterator i,P p,const T& x,distance length)
	{
		assert(std::find_if(m_separators.begin(),m_separators.end(),p)!=m_separators.end());

		iterator first=std::find_if(m_separators.begin(),i,p);
		iterator last=i;
		distance n=length/*+traits::min_distance(x)*/;
		if(first==i)
		{
			last=std::find_if(i,m_separators.end(),p);
			distance limit=get_frame_size(last)-traits::min_distance(*last);
			if(n>limit)
				n=limit;
			++last;
		}
		else
		{
			distance limit=get_frame_size(first)-traits::min_distance(*first);
			if(n>limit)
				n=limit;
			n=-n;
			++first;
		}
		shift(first,last,n);
		return insert(i,x,length);
	}

	template<class T>
	iterator erase(iterator i,T p)
	{
		assert(i!=m_separators.end());
		assert(std::find_if(m_separators.begin(),m_separators.end(),p)!=m_separators.end());

		distance n=get_frame_size(i);
		i=m_separators.erase(i);
		iterator first=std::find_if(m_separators.begin(),i,p);
		iterator last=i;
		if(first==i)
		{
			last=std::find_if(i,m_separators.end(),p);
			++last;
			n=-n;
		}
		else
			++first;
		shift(first,last,n);
		return i;
	}
protected:
	separators_t	m_separators;
	bounds_t		m_bounds;
};

//helpers
template<class T,class Pr,class Sz>
T search_n(T begin,T end,Pr pr,Sz n)
{
  while((begin!=end)&&(n!=0))
  {
    if(pr(*begin))
				break;
    ++begin;
    --n;
  }
  return begin;
}
}//namespace ssec
#endif // __SSEC_H__

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产乱人伦偷精品视频不卡 | ...xxx性欧美| 中文字幕亚洲成人| 亚洲国产综合91精品麻豆| 首页国产丝袜综合| 国产高清视频一区| 色菇凉天天综合网| 日韩美女一区二区三区四区| 国产精品女主播av| 丝袜美腿一区二区三区| 国产精品自在欧美一区| 欧美在线观看一二区| 欧美videos中文字幕| 国产精品网站一区| 天堂在线亚洲视频| 成人国产精品免费网站| 欧美日韩国产经典色站一区二区三区 | 在线观看亚洲一区| 精品国产一区二区三区av性色| 日韩伦理av电影| 蜜臀av国产精品久久久久| 一本久道中文字幕精品亚洲嫩| 欧美军同video69gay| 久久久国产精品麻豆| 午夜精品久久久久久| 国产精品一区二区三区四区| 亚洲嫩草精品久久| 日韩电影一区二区三区四区| 综合色中文字幕| 一区二区三区在线视频观看| 精品一区二区三区在线播放| 91视频在线观看| 日韩精品一区二区三区在线观看 | 国产精品白丝av| 91影视在线播放| 日韩一级片在线观看| 亚洲精品国产一区二区精华液| 国产毛片精品视频| 欧美日韩精品一区二区天天拍小说| 久久久精品国产免大香伊| 午夜婷婷国产麻豆精品| 国产成人免费高清| 日韩欧美亚洲国产精品字幕久久久| 亚洲另类一区二区| 成av人片一区二区| 精品动漫一区二区三区在线观看| 婷婷激情综合网| 欧美最新大片在线看| 中文字幕色av一区二区三区| 激情深爱一区二区| 欧美一区二区三区人| 亚洲一区二区欧美| 91福利精品视频| 国产麻豆精品在线观看| 国产综合久久久久久久久久久久| 欧美日韩精品一区二区三区四区| 亚洲乱码日产精品bd| 不卡一区中文字幕| 欧美—级在线免费片| 国内精品免费**视频| 日韩精品一区二区在线观看| 蜜臀国产一区二区三区在线播放 | 亚洲成人自拍一区| 在线亚洲人成电影网站色www| 日韩视频在线你懂得| 国产肉丝袜一区二区| 国产一区二区在线观看视频| 欧美tk—视频vk| 美女网站在线免费欧美精品| 欧美一级视频精品观看| 日韩影院免费视频| 制服丝袜亚洲网站| 免费高清在线一区| 精品国产区一区| 国产伦精品一区二区三区在线观看| 精品国产一区二区亚洲人成毛片| 激情六月婷婷综合| 久久久久久电影| 成人激情图片网| 亚洲人成影院在线观看| 色婷婷精品大在线视频| 欧美日韩国产首页| 国产日产欧产精品推荐色| 国产凹凸在线观看一区二区| 国产精品区一区二区三| 91在线小视频| 亚洲综合精品自拍| 5566中文字幕一区二区电影| 久久精品国产澳门| 日本一区二区三区在线不卡| 99精品国产热久久91蜜凸| 亚洲美女精品一区| 91精品中文字幕一区二区三区| 日本sm残虐另类| 久久精品人人做人人爽人人| 播五月开心婷婷综合| 亚洲伊人伊色伊影伊综合网| 欧美一区二区三区成人| 国产精品影视在线观看| 亚洲视频免费在线观看| 欧美日本国产一区| 国产精品伊人色| 亚洲免费资源在线播放| 欧美一区二区三区在线观看| 国产福利一区二区| 亚洲最大的成人av| 日韩亚洲欧美一区| 丰满少妇在线播放bd日韩电影| 亚洲免费av网站| 日韩一卡二卡三卡| 99热精品国产| 日本中文一区二区三区| 国产区在线观看成人精品| 色播五月激情综合网| 久久99精品国产91久久来源| 国产精品青草久久| 91精品国产91久久综合桃花| 成人免费视频播放| 无码av中文一区二区三区桃花岛| 337p粉嫩大胆色噜噜噜噜亚洲| 91浏览器在线视频| 久久国产精品一区二区| 日韩理论电影院| 97久久久精品综合88久久| 国产成人av一区| 成a人片亚洲日本久久| 日本中文在线一区| 久久久久久久久久电影| 色网站国产精品| 国产一区欧美二区| 亚洲制服欧美中文字幕中文字幕| 欧美精品一区二区三区在线播放 | 精品福利在线导航| 99久久伊人网影院| 奇米888四色在线精品| 亚洲欧美一区二区三区孕妇| 精品乱人伦小说| 欧美在线视频你懂得| 亚洲线精品一区二区三区| 欧美精品在线观看播放| www..com久久爱| 国产美女精品在线| 日韩精品一二三| 亚洲另类在线视频| 亚洲国产精品成人综合色在线婷婷 | 日韩欧美电影一二三| 色综合久久久久久久久久久| 国产高清不卡二三区| 免费看黄色91| 国产精品麻豆视频| 成人性生交大片免费看中文网站| 日韩国产在线一| 亚洲人成网站在线| 国产欧美日韩另类一区| 精品久久久久av影院| 欧美久久久久中文字幕| 一本久道中文字幕精品亚洲嫩| 国产成人午夜电影网| 久久er精品视频| 日韩中文字幕区一区有砖一区| 一区二区三区小说| 日韩毛片精品高清免费| 国产精品乱码一区二三区小蝌蚪| 久久奇米777| 精品播放一区二区| 欧美不卡一区二区三区四区| 欧美一区二区三区免费大片| 欧美日韩精品免费| 欧美在线综合视频| 色哟哟一区二区三区| 92国产精品观看| www.综合网.com| 99麻豆久久久国产精品免费| 成人手机在线视频| 国产一区二区0| 国产一区久久久| 国产一级精品在线| 国产精品夜夜嗨| 国产一区免费电影| 国产精品综合在线视频| 国产精品自在在线| 国产成人免费xxxxxxxx| 成人午夜视频免费看| 丰满少妇在线播放bd日韩电影| 丁香啪啪综合成人亚洲小说| 国产suv精品一区二区883| 大胆欧美人体老妇| 不卡av在线网| 91久久久免费一区二区| 欧美中文字幕一二三区视频| 欧美日韩精品欧美日韩精品一综合| 欧美日韩成人在线| 91精品国产手机| 精品欧美乱码久久久久久| 精品电影一区二区三区 | 国产一区 二区 三区一级| 国内精品国产成人国产三级粉色| 国产在线播放一区二区三区| 国产精品1024| gogo大胆日本视频一区|