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.

104 lines
2.3 KiB

#pragma once
#ifdef _WIN32
#ifdef WIREROUTINGDLL_EXPORTS // VisualStudio DLL ��Ŀģ���Ὣ <PROJECTNAME>_EXPORTS ���ӵ�����Ԥ�������ꡣ
#define BRANCH_POINT_API __declspec(dllexport) // _WIN32
#else
#define BRANCH_POINT_API __declspec(dllimport)
#endif
#else
#define BRANCH_POINT_API
#endif
#include "Clip.h"
#include<cmath>
#include<vector>
#include<queue>
#include<map>
#include<iostream>
#include<fstream>
#include<sstream>
#include<cassert>
using namespace std;
//��֧����������
struct BRANCH_POINT_API BranchPoint{
P coord; //������
double t; // ��֧������λ�ã���0-1֮��
double Dis; //����������֮���ľ���
bool fixed; //λ���Ƿ��Ѿ��̶�
Clip * pc1,*pc2; //�洢�����ڵ���������
BranchPoint *pb1,*pb2; //�洢�����ڵ�������֧��
double l,r; //����t�ķ�Χ
vector<int> branchPointsInSameSegment; //ͬһ�ֶ���������֧���ı���
P ndir; //���ڷ�֧�ķ��߷���
double position; //�����ο������ľ���
double tempt[2]; //�洢��֧�������������µ�����λ�ã�0�������ν�ͬ�γ�
string referClip; //�����������
int id; //��֧������
int mode; //�洢��֧����һ�α�����·����������������0�������ν�ͬ�γ���1����ͬ�ν����˳�
int bundleNodeID; //��֧�����ڵ�bundle��id
bool used; //��֧���Ƿ���ʹ��
void init();
//��ʼ��
BranchPoint();
//������������ʼ��
BranchPoint(Clip *c1,Clip *c2);
//�������ͷ�Χ��ʼ��
BranchPoint(Clip *c1,Clip *c2,double L,double R);
//�������ߵķ�֧��
void addL(BranchPoint b);
//�����ұߵķ�֧��
void addR(BranchPoint b);
//�����߽����ұ���d����
void pushL(double d);
//���ұ߽���������d����
void pushR(double d);
//�̶���֧��λ��
void fix();
//ͨ���������򣬷�֧��Ҳ�ı�����ʾ��ʽ
void reverse();
//���ط�֧���ڷ�֧�Ͽ������ӵ�����һ����
//offSet������֧��������ƫ��ֵ
vector<int> getNext(int offSet);
/*������֧�㵽��������Ȩֵ
reverse=0ӷ֧p
reverse=1p֧
*/
double computeWeight(P& p, int inOut, bool reverse);
//��¼��֧������λ��
void recordPos(int mode);
void check(int i);
};
//ά�����з�֧���ļ���
struct BRANCH_POINT_API BranchPointSet{
BranchPoint b[MAXPointNum]; //��֧������
int branchPointNum; //��֧������
BranchPointSet();
//����һ����֧��,������ָ������ָ��
BranchPoint* addBranchPoint(Clip* pc1,Clip* pc2,int bundleNodeID);
//��ȡָ������Ϊid�ķ�֧����ָ��
BranchPoint * getBranchPointPointer(int id);
};