本文整理汇总了C#中Zone.GetCurrent方法的典型用法代码示例。如果您正苦于以下问题:C# Zone.GetCurrent方法的具体用法?C# Zone.GetCurrent怎么用?C# Zone.GetCurrent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zone
的用法示例。
在下文中一共展示了Zone.GetCurrent方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ComputeDisplacement
Vector2 ComputeDisplacement(int mode, out Zone zone, out int point)
{
// compute displacement of the reference point
if ((mode & 1) == 0)
{
zone = zp1;
point = state.Rp2;
}
else
{
zone = zp0;
point = state.Rp1;
}
var distance = Project(zone.GetCurrent(point) - zone.GetOriginal(point));
return distance * state.Freedom / fdotp;
}
示例2: MovePoint
void MovePoint(Zone zone, int index, float distance)
{
var point = zone.GetCurrent(index) + distance * state.Freedom / fdotp;
var touch = GetTouchState();
zone.Current[index].P = point;
zone.TouchState[index] |= touch;
}
示例3: Execute
//.........这里部分代码省略.........
case OpCode.RDTG: state.RoundState = RoundMode.DownToGrid; break;
case OpCode.RUTG: state.RoundState = RoundMode.UpToGrid; break;
case OpCode.ROFF: state.RoundState = RoundMode.Off; break;
case OpCode.SROUND: state.RoundState = RoundMode.Super; SetSuperRound(1.0f); break;
case OpCode.S45ROUND: state.RoundState = RoundMode.Super45; SetSuperRound(Sqrt2Over2); break;
case OpCode.INSTCTRL:
{
var selector = stack.Pop();
if (selector >= 1 && selector <= 2)
{
// value is false if zero, otherwise shift the right bit into the flags
var bit = 1 << (selector - 1);
if (stack.Pop() == 0)
state.InstructionControl = (InstructionControlFlags)((int)state.InstructionControl & ~bit);
else
state.InstructionControl = (InstructionControlFlags)((int)state.InstructionControl | bit);
}
}
break;
case OpCode.SCANCTRL: /* instruction unspported */ stack.Pop(); break;
case OpCode.SCANTYPE: /* instruction unspported */ stack.Pop(); break;
case OpCode.SANGW: /* instruction unspported */ stack.Pop(); break;
case OpCode.SLOOP: state.Loop = stack.Pop(); break;
case OpCode.SMD: state.MinDistance = stack.PopFloat(); break;
case OpCode.SCVTCI: state.ControlValueCutIn = stack.PopFloat(); break;
case OpCode.SSWCI: state.SingleWidthCutIn = stack.PopFloat(); break;
case OpCode.SSW: state.SingleWidthValue = stack.Pop() * scale; break;
case OpCode.FLIPON: state.AutoFlip = true; break;
case OpCode.FLIPOFF: state.AutoFlip = false; break;
case OpCode.SDB: state.DeltaBase = stack.Pop(); break;
case OpCode.SDS: state.DeltaShift = stack.Pop(); break;
// ==== POINT MEASUREMENT ====
case OpCode.GC0: stack.Push(Project(zp2.GetCurrent(stack.Pop()))); break;
case OpCode.GC1: stack.Push(DualProject(zp2.GetOriginal(stack.Pop()))); break;
case OpCode.SCFS:
{
var value = stack.PopFloat();
var index = stack.Pop();
var point = zp2.GetCurrent(index);
MovePoint(zp2, index, value - Project(point));
// moving twilight points moves their "original" value also
if (zp2.IsTwilight)
zp2.Original[index].P = zp2.Current[index].P;
}
break;
case OpCode.MD0:
{
var p1 = zp1.GetOriginal(stack.Pop());
var p2 = zp0.GetOriginal(stack.Pop());
stack.Push(DualProject(p2 - p1));
}
break;
case OpCode.MD1:
{
var p1 = zp1.GetCurrent(stack.Pop());
var p2 = zp0.GetCurrent(stack.Pop());
stack.Push(Project(p2 - p1));
}
break;
case OpCode.MPS: // MPS should return point size, but we assume DPI so it's the same as pixel size
case OpCode.MPPEM: stack.Push(ppem); break;
case OpCode.AA: /* deprecated instruction */ stack.Pop(); break;
// ==== POINT MODIFICATION ====