Java Corner类代码示例

本文整理汇总了Java中org.twak.camp.Corner的典型用法代码示例。如果您正苦于以下问题:Java Corner类的具体用法?Java Corner怎么用?Java Corner使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Java Corner类代码示例

Corner类属于org.twak.camp包,在下文中一共展示了Corner类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testBasic

import org.twak.camp.Corner; //导入依赖的package包/类
public void testBasic() {
		Loop<Edge> loop1 = new Loop<Edge>();
		Corner c1 = new Corner ( 0,0), 
				c2 = new Corner (100,0 ), 
				c3 = new Corner (100,100 );
		
		Machine directionMachine = new Machine ();
		
		loop1.append(new Edge ( c1,c2 ) );
		loop1.append(new Edge ( c2, c3 ) );
		loop1.append(new Edge ( c3, c1 ) );
		for (Edge e : loop1) e.machine = directionMachine;

		LoopL<Edge> a = new LoopL<Edge>(loop1);
		LoopL<Corner> output = OffsetSkeleton.shrink(a, 5);
		
		for (Loop<Corner> ll : output) {
			for (Corner c : ll)
			{
//				Assert.assertNotNull( c );
				System.out.println(c);
			}
			System.out.println(">>");
		}
	} 
开发者ID:twak,项目名称:campskeleton,代码行数:26,代码来源:TestBasic.java

示例2: process

import org.twak.camp.Corner; //导入依赖的package包/类
@Override
public LContext<Corner> process(
        Anchor anchor,
        LContext<Corner> toEdit,
        Marker planMarker,
        Marker profileMarker,
        Edge edge,
        AnchorHeightEvent hauler,
        Corner oldLeadingCorner )
{
    for (int i = 0; i < anchors.length; i++) {
        if (anchors[i].matches(anchor.getPlanGen(), anchor.getProfileGen())) {
            if (i == 0) {
                planC = planMarker;
                profileC = profileMarker;
            }
            else {
                planM = planMarker;
                profileM = profileMarker;
            }

            return toEdit;
        }
    }
    return toEdit;
} 
开发者ID:twak,项目名称:siteplan,代码行数:27,代码来源:AnimateAnchorCircularShip.java

示例3: process

import org.twak.camp.Corner; //导入依赖的package包/类
@Override
public boolean process( Skeleton skel )
{
    SkeletonCapUpdate capUpdate = new SkeletonCapUpdate(skel);
    LoopL<Corner> flatTop = capUpdate.getCap(height);

    LoopL<Point3d> pts = new LoopL();
    for (Loop<Corner> cLoop : flatTop)
    {
        Loop<Point3d> loop = new Loop();
        pts.add(loop);
        for ( Corner c : cLoop)
            loop.append( new Point3d( c.x, c.y, height) );
    }

    skel.output.addNonSkeletonOutputFace2(pts , new Vector3d(0,0,1) );

    capUpdate.update(new LoopL(), new SetCorrespondence<Corner, Corner>(), new DHash<Corner, Corner>());
    skel.qu.clearFaceEvents();
    skel.qu.clearOtherEvents();
    return true;

} 
开发者ID:twak,项目名称:siteplan,代码行数:24,代码来源:CapFeatureFactory.java

示例4: fromPositionToCorner

import org.twak.camp.Corner; //导入依赖的package包/类
/**
 * Convertit un positon en corner
 * 
 * @param dp
 * @return
 */
private static Corner fromPositionToCorner(IDirectPosition dp) {

	if (dp.getDimension() == 2) {
		return new Corner(dp.getX(), dp.getY(), 0);
	}

	return new Corner(dp.getX(), dp.getY(), dp.getZ());
} 
开发者ID:IGNF,项目名称:geoxygene,代码行数:15,代码来源:CampSkeleton.java

示例5: main

import org.twak.camp.Corner; //导入依赖的package包/类
public static void main( String[] args ) {
	Corner c1 = new Corner( 0, 0 ), 
		   c2 = new Corner( 100, -100 ), 
		   c3 = new Corner( 100, 0 );

	Machine speed1 = new Machine(Math.PI/4),
			speed2 = new Machine(Math.PI/3);

	Loop<Edge> loop1 = new Loop<Edge>();

	
	Edge e1 = new Edge( c1, c2 ),
		 e2 = new Edge( c2, c3 ),
		 e3 = new Edge( c3, c1 );
	
	loop1.append( e1 );
	loop1.append( e2 );
	loop1.append( e3 );

	e1.machine = speed1;
	e2.machine = speed1;
	e3.machine = speed2;

	Skeleton skel = new Skeleton( loop1.singleton(), true );
	skel.skeleton();

	for ( Face face : skel.output.faces.values() ) {
		System.out.println( "face:" );
		for ( Loop<Point3d> lp3 : face.points )
			for ( Point3d pt : lp3 )
				System.out.println( pt );
	}
} 
开发者ID:twak,项目名称:campskeleton,代码行数:34,代码来源:Example.java

示例6: dump

import org.twak.camp.Corner; //导入依赖的package包/类
public static void dump ( String name, Skeleton skel )
{
    if (!debug)
        return;

    instance.toDisplay.add(new Status ( skel.name+":"+name, Corner.dupeNewAll(skel.findLoopLive()), skel.output.dupeEdgesOnly() ));
    push();
} 
开发者ID:twak,项目名称:campskeleton,代码行数:9,代码来源:DebugDevice.java

示例7: dumpPoints

import org.twak.camp.Corner; //导入依赖的package包/类
public static void dumpPoints ( String name, LoopL<Point3d> points )
{
    if (!debug)
        return;

    LoopL<Corner> loopl = new LoopL();

    Cache<Point3d, Corner> cCache = new Cache<Point3d, Corner>()
    {
        @Override
        public Corner create( Point3d i )
        {
            return new Corner( i.x, i.y, i.y );
        }
    };

    for ( Loop<Point3d> lc : points )
    {
        Loop<Corner> loop = new Loop();
        loopl.add( loop );
        for ( Loopable<Point3d> loopable : lc.loopableIterator() )
        {
            Corner me = cCache.get( loopable.get());
            Corner yu = cCache.get( loopable.get());
            loop.append( me );
            me.nextC = yu;
            yu.prevC = me;
            me.nextL = new Edge (me, yu);
            yu.prevL = me.nextL;
        }
    }

    instance.toDisplay.add(new Status ( name, loopl, null ));
    push();
} 
开发者ID:twak,项目名称:campskeleton,代码行数:36,代码来源:DebugDevice.java

示例8: createInitial

import org.twak.camp.Corner; //导入依赖的package包/类
@Override
protected void createInitial() {

    edges.clear();
    cornerMap.clear();
    edgeMap.clear();


    Cache<Corner, Point2d> cache = new Cache<Corner, Point2d>() {

        @Override
        public Point2d create(Corner i) {
            Point2d out = new Point2d(i.x, i.y);
            cornerMap.put(out, i);
            return out;

        }
    };

    for (Loop<Corner> lc : corners)
    {
        Loop<Bar> loop = new Loop();
        edges.add(loop);
        for (Corner c : lc)
        {
            Bar b = new Bar (cache.get(c), cache.get(c.nextC));
            edgeMap.put(b, c.nextL);
            loop.append(b);
        }
    }
} 
开发者ID:twak,项目名称:campskeleton,代码行数:32,代码来源:DebugPointEditor.java

示例9: mouseMoved

import org.twak.camp.Corner; //导入依赖的package包/类
@Override
public void mouseMoved(MouseEvent e) {
    highlightEdges.clear();
    double tol = ma.fromZoom( 10 );

    Point2d from = ma.from(e);
    LContext<Bar> bar = getNearest(from, tol);

    if (bar != null) {
        for (Point2d p : new Point2d[]{bar.get().start, bar.get().end}) {
            if (p.distance(from) < tol) {
                Corner corner = cornerMap.get(p);
                highlightEdges.put(corner.nextL, Color.green.darker());
                highlightEdges.put(corner.prevL, Color.red.darker());
                hoverOver(corner);
                return;
            }
        }

        hoverOver(edgeMap.get(bar.get()));
    }
    else if (output != null)// bar == null
    {
        if (corners.isEmpty()) // debug - face - mode - engage
            for (Face f : output.faces.values()) {
                Corner s = f.edge.start;
                Corner ee = f.edge.end;
                Bar b = new Bar(new Point2d(s.x, s.y), new Point2d(ee.x, ee.y));
                if (b.distance(from) < tol) {
                    hoverOver(f,output);
                }
            }

        hoverOver((Edge)null);
        return;
    }
} 
开发者ID:twak,项目名称:campskeleton,代码行数:38,代码来源:DebugPointEditor.java

示例10: FindNOCorner

import org.twak.camp.Corner; //导入依赖的package包/类
public FindNOCorner(Offset offset, LoopL<Corner> cap)
{
    nOSegmentsUpdate = offset.nOSegments.toSetCorrespondence();
    /**
     * The maps that come out of offset relate the old edge positions to their
     * new positions, not the direct edge or corner correspondence that they do in
     * cap update => goal:
     *
     * if both adjacent edges of speed 0, entry in nOCorner.
     * for all input corners:
     *    if equivilent edges exist in cap output, and had speed 0
     *        add an entry between (find new corner between two edges) -> existing
     *
     * if segment's edge has speed 0, entry in nOSegment
     **/
    // add all valid corners to nOCorner
    for (Corner oldC : cap.eIterator())
        // only if both edges are 0-speed (don't use our machine)
        if (didThisOldCornerRemainUnchanged(oldC))
        {
            // two edges in the
            Set<Corner> second = nOSegmentsUpdate.getSetB(oldC);
            Set<Corner> first = nOSegmentsUpdate.getSetB(oldC.prevC);
            Corner neuC = findAdjacent(first, second);
            if (neuC != null)
                nOCorner.put(neuC, oldC);
        }
} 
开发者ID:twak,项目名称:campskeleton,代码行数:29,代码来源:FindNOCorner.java

示例11: findAdjacent

import org.twak.camp.Corner; //导入依赖的package包/类
/**
 * Given two sets of leading corners, find the corner (if any) that lies on
 * both edges
 *
 * @return
 */
private Corner findAdjacent(Set<Corner> first, Set<Corner> second)
{
    for (Corner c : first)
        if (second.contains(c.nextC))
            return c.nextC;
    return null;
} 
开发者ID:twak,项目名称:campskeleton,代码行数:14,代码来源:FindNOCorner.java

示例12: PerEdgeOffsetSkeleton

import org.twak.camp.Corner; //导入依赖的package包/类
public PerEdgeOffsetSkeleton ( LoopL<Corner> corners, LoopL<Double> speeds )
{
    setup (corners);

    Iterator<Corner> cit = corners.eIterator().iterator();
    Iterator<Double> sit = speeds.eIterator().iterator();

    while (cit.hasNext())
    {
        Corner c = cit.next();
        assert (sit.hasNext());
        double speed = sit.next();
        registerEdge(c, speed );
    }
} 
开发者ID:twak,项目名称:campskeleton,代码行数:16,代码来源:PerEdgeOffsetSkeleton.java

示例13: setup

import org.twak.camp.Corner; //导入依赖的package包/类
public void setup ( LoopL<Corner> inputCorners )
{
    // clone the input, so we're non-destructive
    CornerClone cc = new CornerClone(inputCorners);
    this.oldCorners = cc.output;
    oldInputSegments = cc.nOSegments;

    // default for all edges is 0
    for (Corner oldC : this.oldCorners.eIterator())
        oldC.nextL.machine = machineGenerator.get( new Double ( 0 ) );
} 
开发者ID:twak,项目名称:campskeleton,代码行数:12,代码来源:PerEdgeOffsetSkeleton.java

示例14: process

import org.twak.camp.Corner; //导入依赖的package包/类
public boolean process( Skeleton skel )
{
    LoopL<Corner> copy = skel.capCopy( height );

    // I would like to appologise to my future self for writing this...
    // (skel -> cap) segment map to (skel-before-direction-events -> cap)
    ManyManyMap<Corner, Corner> outputOldSegments = 
            skel.segmentMap.new ConvertInputCollection<Corner>   ( skel.getSegmentOriginator() ).get();

    // to input -> cap
    ManyManyMap<Corner, Corner> inputCapSegments =
            outputOldSegments.new ConvertInputCollection<Corner>( oldInputSegments.asCache () ).get();

    inputCapSegments = inputCapSegments.getFlipShallow();

    output = new Offset( copy , inputCapSegments ); // should be new->old segments
    
    // cap everything below to tidy up.
    for (Corner c : skel.liveCorners)
    {
        Corner top = skel.cornerMap.teg(c);

        skel.output.addOutputSideTo(c, top, c.nextL, c.prevL);
        skel.output.addOutputSideTo(true, top, top.nextC, c.nextL);
    }

    // no more output events pls!
    skel.liveEdges.clear();
    skel.liveCorners.clear();
    skel.qu.clearFaceEvents();

    return false;
} 
开发者ID:twak,项目名称:campskeleton,代码行数:34,代码来源:PerEdgeOffsetSkeleton.java

示例15: setup

import org.twak.camp.Corner; //导入依赖的package包/类
public void setup ( LoopL<Corner> corners, double interval )
{
    // clone the input, so we're non-destructive
    CornerClone cc = new CornerClone(corners);
    this.corners = cc.output;
    oldInputSegments = cc.nOSegments;
} 
开发者ID:twak,项目名称:campskeleton,代码行数:8,代码来源:OffsetSkeleton.java

本文标签属性:

示例:示例英文

代码:代码大全可复制

java:javascript18岁

上一篇:肖凯中个人资料及其影响(肖凯中个人资料)
下一篇:Java Layout.getLineBounds方法代码示例

为您推荐