本文整理汇总了C#中ActiveRegion类的典型用法代码示例。如果您正苦于以下问题:C# ActiveRegion类的具体用法?C# ActiveRegion怎么用?C# ActiveRegion使用的例子? 这里精选的类代码示例或许可以为您提供帮助。
示例1: EdgeLeq
///
/// Both edges must be directed from right to left (this is the canonical
/// direction for the upper edge of each region).
///
/// The strategy is to evaluate a "t" value for each edge at the
/// current sweep line position, given by tess->event. The calculations
/// are designed to be very stable, but of course they are not perfect.
///
/// Special case: if both edge destinations are at the sweep event,
/// we sort the edges by slope (they would otherwise compare equally).
///
private bool EdgeLeq(ActiveRegion reg1, ActiveRegion reg2)
{
var e1 = reg1._eUp;
var e2 = reg2._eUp;
if (e1._Dst == _event)
{
if (e2._Dst == _event)
{
// Two edges right of the sweep line which meet at the sweep event.
// Sort them by slope.
if (Geom.VertLeq(e1._Org, e2._Org))
{
return Geom.EdgeSign(e2._Dst, e1._Org, e2._Org) <= 0.0f;
}
return Geom.EdgeSign(e1._Dst, e2._Org, e1._Org) >= 0.0f;
}
return Geom.EdgeSign(e2._Dst, _event, e2._Org) <= 0.0f;
}
if (e2._Dst == _event)
{
return Geom.EdgeSign(e1._Dst, _event, e1._Org) >= 0.0f;
}
// General case - compute signed distance *from* e1, e2 to event
var t1 = Geom.EdgeEval(e1._Dst, _event, e1._Org);
var t2 = Geom.EdgeEval(e2._Dst, _event, e2._Org);
return (t1 >= t2);
}
原文链接:
http://www.jxszl.com/biancheng/C/556467.html