|
|
@ -1,6 +1,8 @@ |
|
|
|
#include "pch.h" // use stdafx.h in Visual Studio 2017 and earlier |
|
|
|
#include "BranchPoint.h" |
|
|
|
|
|
|
|
BranchPointSet branchPointSet; |
|
|
|
|
|
|
|
void BranchPoint::init() |
|
|
|
{ |
|
|
|
l = 0; |
|
|
@ -87,6 +89,14 @@ void BranchPoint::fix() |
|
|
|
return; |
|
|
|
fixed = true; |
|
|
|
t = tempt[mode]; |
|
|
|
/*
|
|
|
|
if(pb1!=NULL){ |
|
|
|
pb1->pushL(t*Dis+MinBranchPointDistance-r*Dis); |
|
|
|
} |
|
|
|
if(pb2!=NULL){ |
|
|
|
pb2->pushR(l*Dis-(t*Dis-MinBranchPointDistance)); |
|
|
|
} |
|
|
|
*/ |
|
|
|
cout << "***********"; |
|
|
|
if (!Equal(t, l) && !Equal(t, r)) |
|
|
|
cout << "-------"; |
|
|
@ -153,11 +163,14 @@ double BranchPoint::computeWeight(P &p, int inOut, bool reverse) |
|
|
|
// 记录分支点最优位置
|
|
|
|
void BranchPoint::recordPos(int mode) |
|
|
|
{ |
|
|
|
// if(!Equal(t,l)&&!Equal(t,r))cout<<"-------"<<endl;
|
|
|
|
// else t=(l+r)/2;
|
|
|
|
tempt[mode] = t; |
|
|
|
} |
|
|
|
|
|
|
|
void BranchPoint::check(int i) |
|
|
|
{ |
|
|
|
// if(!Equal(t,l)&&!Equal(t,r))cout<<"--"<<i<<"--"<<endl;
|
|
|
|
} |
|
|
|
|
|
|
|
BranchPointSet::BranchPointSet() |
|
|
@ -166,7 +179,7 @@ BranchPointSet::BranchPointSet() |
|
|
|
} |
|
|
|
|
|
|
|
// 添加一个分支点,并返回指向它的指针
|
|
|
|
BranchPoint *BranchPointSet::addBranchPoint(Clip *pc1, Clip *pc2, int bundleNodeID) |
|
|
|
BranchPoint* BranchPointSet::addBranchPoint(Clip* pc1, Clip* pc2, int bundleNodeID) |
|
|
|
{ |
|
|
|
branchPointNum++; |
|
|
|
b[branchPointNum] = BranchPoint(pc1, pc2); |
|
|
@ -178,7 +191,7 @@ BranchPoint *BranchPointSet::addBranchPoint(Clip *pc1, Clip *pc2, int bundleNode |
|
|
|
} |
|
|
|
|
|
|
|
// 获取指向编号为id的分支点的指针
|
|
|
|
BranchPoint *BranchPointSet::getBranchPointPointer(int id) |
|
|
|
BranchPoint* BranchPointSet::getBranchPointPointer(int id) |
|
|
|
{ |
|
|
|
assert(id >= 1 && id <= branchPointNum); |
|
|
|
return &b[id]; |
|
|
|