Package renderer.models_L
Class Disk
- java.lang.Object
-
- renderer.scene.Model
-
- renderer.models_L.Disk
-
- All Implemented Interfaces:
MeshMaker
public class Disk extends Model implements MeshMaker
Create a wireframe model of a disk in the xy-plane centered at the origin.- See Also:
DiskSector
-
-
Field Summary
Fields Modifier and Type Field Description int
k
int
n
double
r
-
Fields inherited from class renderer.scene.Model
colorList, name, primitiveList, vertexList, visible
-
-
Constructor Summary
Constructors Constructor Description Disk()
Create a disk in the xy-plane with radius 1, with 12 spokes coming out of the center, and with 6 concentric circles around the disk.Disk(double r)
Create a disk in the xy-plane with radiusr
, with 12 spokes coming out of the center, and with 6 concentric circles around the disk.Disk(double r, int n, int k)
Create a disk in the xy-plane with radiusr
, withk
spokes coming out of the center, and withn
concentric circles around the disk.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getHorzCount()
int
getVertCount()
Disk
remake(int n, int k)
Build an instance of theModel
with 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
-
Disk
public Disk()
Create a disk in the xy-plane with radius 1, with 12 spokes coming out of the center, and with 6 concentric circles around the disk.
-
Disk
public Disk(double r)
Create a disk in the xy-plane with radiusr
, with 12 spokes coming out of the center, and with 6 concentric circles around the disk.- Parameters:
r
- radius of the disk
-
Disk
public Disk(double r, int n, int k)
Create a disk in the xy-plane with radiusr
, withk
spokes coming out of the center, and withn
concentric circles around the disk.If there are
k
spokes, then each circle around the center will havek
line segments. If there aren
concentric circles around the center, then each spoke will haven
line segments.There must be at least three spokes and at least one concentric circle.
- Parameters:
r
- radius of the diskn
- number of concentric circlesk
- number of spokes in the disk- Throws:
IllegalArgumentException
- ifn
is less than 1IllegalArgumentException
- ifk
is less than 3
-
-
Method Detail
-
getHorzCount
public int getHorzCount()
- Specified by:
getHorzCount
in interfaceMeshMaker
- Returns:
- the number of lines of latitude that the
Model
contains
-
getVertCount
public int getVertCount()
- Specified by:
getVertCount
in interfaceMeshMaker
- Returns:
- the number of lines of longitude that the
Model
contains
-
-