You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
106 lines
2.5 KiB
106 lines
2.5 KiB
1 year ago
|
#pragma once
|
||
|
|
||
|
#ifdef _WIN32
|
||
|
#ifdef WIREROUTINGDLL_EXPORTS // VisualStudio DLL ��Ŀģ���Ὣ <PROJECTNAME>_EXPORTS ���ӵ�����Ԥ�������ꡣ
|
||
|
#define BASIC_CHANNEL_API __declspec(dllexport) // _WIN32
|
||
|
#else
|
||
|
#define BASIC_CHANNEL_API __declspec(dllimport)
|
||
|
#endif
|
||
|
#else
|
||
|
#define BASIC_CHANNEL_API
|
||
|
#endif
|
||
|
|
||
|
#include "Bundle.h"
|
||
|
#include<cmath>
|
||
|
#include<vector>
|
||
|
#include<queue>
|
||
|
#include<map>
|
||
|
#include<iostream>
|
||
|
#include<fstream>
|
||
|
#include<sstream>
|
||
|
#include<cassert>
|
||
|
using namespace std;
|
||
|
|
||
|
|
||
|
//���ݿ�������λ�ù��ƻ�����ͨ������ά���������صķ�֧����Ϣ
|
||
|
struct BASIC_CHANNEL_API BasicChannel {
|
||
|
|
||
|
|
||
|
Bundle bundles[N]; //����ͨ��
|
||
|
int bundleNum; //����ͨ������
|
||
|
int basicChannelNum;//����ͨ������
|
||
|
map<int,BundleNode *> PointConnectedTobranchPoint[MAXPointNum];//���ӵ���֧���ĵ�
|
||
|
|
||
|
//�������ݿ���������λ�ô������Ƶ�ͨ��
|
||
|
void createChannel();
|
||
|
|
||
|
//�������з�֧��
|
||
|
void createBranchPoint();
|
||
|
|
||
|
//���ݿ������Ż�ȡ��������ͨ���ڵ�ָ��
|
||
|
BundleNode* getClipBundleNodePointer(int cid);
|
||
|
|
||
|
//��ȡ�������ڵ�ͨ��id
|
||
|
int getClipBundleID(Clip* pc);
|
||
|
|
||
|
int getClipBundleID(int cid);
|
||
|
|
||
|
//���ݵ���ȡ�����ڵ�bundleNode����������֧��,���������ھ��´���һ��
|
||
|
BundleNode* getBundleNodeByPoint(P& p, int inOut, int bundleID);
|
||
|
|
||
|
//��ȡ������ͨ������������
|
||
|
int getClipInOut(int cid);
|
||
|
|
||
|
//���ؿ������ͣ�0Ϊ����������1Ϊ��ͷ������2Ϊ�м俨��
|
||
|
int clipType(int cid);
|
||
|
|
||
|
//��ȡ��ͷ�����Ľ���ͨ������
|
||
|
int getEXTClipInDir(Clip* pc);
|
||
|
|
||
|
int getEXTClipInDir(int cid);
|
||
|
|
||
|
//��ȡ�м俨����ͨ�����ķ���
|
||
|
int getMIDClipDir(int cid);
|
||
|
|
||
|
/*�ж�һ����֧���Ƿ���ͨ�������ӵ�һ������
|
||
|
���������ӷ���-1
|
||
|
���������Ϸ����ɷ�֧�����ӵ������ķ���
|
||
|
*/
|
||
|
int isBranchPointConnectedToClip(int bid, int cid);
|
||
|
|
||
|
/*�ж�һ�������Ƿ���ͨ�������ӵ�һ������
|
||
|
���������ӷ���-1
|
||
|
���������Ϸ����ɿ���1���ӵ�����2�ķ���
|
||
|
*/
|
||
|
int isClipConnectedToClip(int cid1, int cid2);
|
||
|
|
||
|
//����һ�������ļ��Ϸ��ظ������п����ͷ�֧���ļ���
|
||
|
vector<int> getBranchPointAndClip(vector<int> cv, int offset);
|
||
|
|
||
|
/*�ϲ�����bundle,�̵IJ��볤��
|
||
|
���ߵ�bundle��ָ��pbd��ʾ
|
||
|
�ұߵ�bundle��id��ʾ
|
||
|
rev1,rev2�ֱ�������������bundle��path�����Ĺ�ϵ
|
||
|
���غϲ�����bundle��path��λ�ù�ϵ
|
||
|
pbd��ָ���ϲ�����bundle
|
||
|
*/
|
||
|
int mergeBundle(Bundle*& pbd, int bdid, int rev1, int rev2);
|
||
|
|
||
|
//����һ��·��������ͨ������
|
||
|
void addPath(Path path);
|
||
|
|
||
|
vector<vector<pair<int,int> > > resClip;
|
||
|
vector<vector<int> > resBranchPoint;
|
||
|
vector<int> startBranchPoint;
|
||
|
vector<int> endBranchPoint;
|
||
|
vector<int> BundleConnectedToBranchPoint[MAXPointNum]; //���ӵ���֧����ͨ��
|
||
|
int Out[N];
|
||
|
|
||
|
|
||
|
void printSingleBundle(int i,ofstream &ofs);
|
||
|
|
||
|
//��bundle��Ϣ����ʽҪ����ӡ����
|
||
|
void printBundle(string resultfile, bool basic = false);
|
||
|
|
||
|
};
|