Package renderer.models_L
Class Ring
- java.lang.Object
-
- renderer.scene.Model
-
- renderer.models_L.Ring
-
- All Implemented Interfaces:
MeshMaker
public class Ring extends Model implements MeshMaker
Create a wireframe model of a ring (an annulus) in the xy-plane centered at the origin.- See Also:
RingSector
-
-
Field Summary
Fields Modifier and Type Field Description intkintndoubler1doubler2-
Fields inherited from class renderer.scene.Model
colorList, name, primitiveList, vertexList, visible
-
-
Constructor Summary
Constructors Constructor Description Ring()Create a ring (annulus) in the xy-plane with outer radius 1 and with inner radius 0.33, with 12 spokes coming out of the center, and with 5 concentric circles.Ring(double r1, double r2)Create a ring (annulus) in the xy-plane with outer radiusr1and with inner radiusr2, with 12 spokes coming out of the center, and with 5 concentric circles.Ring(double r1, double r2, int n, int k)Create a ring (annulus) in the xy-plane with outer radiusr1and with inner radiusr2, withkspokes coming out of the center, and withnconcentric circles (not counting the inner most circle).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetHorzCount()intgetVertCount()Ringremake(int n, int k)Build an instance of theModelwith new values for the number of lines of latitude and longitude while keeping all the other model parameters the same.-
Methods inherited from class renderer.scene.Model
addColor, addPrimitive, addVertex, getPrimitive, toString
-
-
-
-
Constructor Detail
-
Ring
public Ring()
Create a ring (annulus) in the xy-plane with outer radius 1 and with inner radius 0.33, with 12 spokes coming out of the center, and with 5 concentric circles.
-
Ring
public Ring(double r1, double r2)
Create a ring (annulus) in the xy-plane with outer radiusr1and with inner radiusr2, with 12 spokes coming out of the center, and with 5 concentric circles.- Parameters:
r1- outer radius of the ringr2- inner radius of the ring
-
Ring
public Ring(double r1, double r2, int n, int k)
Create a ring (annulus) in the xy-plane with outer radiusr1and with inner radiusr2, withkspokes coming out of the center, and withnconcentric circles (not counting the inner most circle).If there are
kspokes, then each circle around the center will havekline segments. If there arenconcentric circles around the center (not counting the inner most circle), then each spoke will havenline segments.There must be at least three spokes and at least one concentric circle.
- Parameters:
r1- outer radius of the ringr2- inner radius of the ringn- number of concentric circlesk- number of spokes in the ring- Throws:
IllegalArgumentException- ifnis less than 1IllegalArgumentException- ifkis less than 3
-
-
Method Detail
-
getHorzCount
public int getHorzCount()
- Specified by:
getHorzCountin interfaceMeshMaker- Returns:
- the number of lines of latitude that the
Modelcontains
-
getVertCount
public int getVertCount()
- Specified by:
getVertCountin interfaceMeshMaker- Returns:
- the number of lines of longitude that the
Modelcontains
-
-