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 intkintndoubler-
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, withkspokes coming out of the center, and withnconcentric circles around the disk.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetHorzCount()intgetVertCount()Diskremake(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
-
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, withkspokes coming out of the center, and withnconcentric circles around the disk.If there are
kspokes, then each circle around the center will havekline segments. If there arenconcentric circles around the center, then each spoke will havenline 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- 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
-
-