All Downloads are FREE. Search and download functionalities are using the official Maven repository.

sim.portrayal3d.network.ConeEdgePortrayal3D Maven / Gradle / Ivy

Go to download

MASON is a fast discrete-event multiagent simulation library core in Java, designed to be the foundation for large custom-purpose Java simulations, and also to provide more than enough functionality for many lightweight simulation needs. MASON contains both a model library and an optional suite of visualization tools in 2D and 3D.

The newest version!
/*
  Copyright 2006 by Sean Luke and George Mason University
  Licensed under the Academic Free License version 3.0
  See the file "LICENSE" for more information
*/

package sim.portrayal3d.network;

import javax.media.j3d.*;
import sim.portrayal3d.simple.*;
import com.sun.j3d.utils.geometry.*;
import java.awt.*;

/**
 * @author Gabriel Balan
 *
 */
 
public class ConeEdgePortrayal3D extends PrimitiveEdgePortrayal3D
    {
    /** @deprecated */
    public ConeEdgePortrayal3D(double radius)
        {
        this(null, Color.white, null, radius);
        }
        
    /** @deprecated */
    public ConeEdgePortrayal3D(Color labelColor)
        {
        this(null, labelColor, null, DEFAULT_RADIUS);
        }

    public ConeEdgePortrayal3D()
        {
        this(null, Color.white, null, DEFAULT_RADIUS);
        }

    public ConeEdgePortrayal3D(Appearance appearance, Color labelColor)
        {
        this(appearance, labelColor, null, DEFAULT_RADIUS);
        }       

    public ConeEdgePortrayal3D(Color color, Color labelColor)
        {
        this(appearanceForColor(color), labelColor, null, DEFAULT_RADIUS);
        }       

    /** Assumes that the image is opaque */
    public ConeEdgePortrayal3D(Image image, Color labelColor)
        {
        this(appearanceForImage(image, true), labelColor, null, DEFAULT_RADIUS);
        }       

    public ConeEdgePortrayal3D(Appearance appearance, Color labelColor, Font labelFont, double radius)
        {
        super(new Cone((float)radius, (float)DEFAULT_HEIGHT), appearance, labelColor, labelFont);
        }       

    protected void init(Node edgeModel)
        {
        super.init(edgeModel);
        Cone c = (Cone)edgeModel;       
        PrimitivePortrayal3D.setShape3DFlags(c.getShape(Cone.BODY));
        PrimitivePortrayal3D.setShape3DFlags(c.getShape(Cone.CAP));
        }

    //cap, body.
    protected int numShapes(){return 2;}
    }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy