Package renderer.models_L
Class Circle
- java.lang.Object
-
- renderer.scene.Model
-
- renderer.models_L.Circle
-
-
Field Summary
Fields Modifier and Type Field Description int
n
double
r
-
Fields inherited from class renderer.scene.Model
colorList, name, primitiveList, vertexList, visible
-
-
Constructor Summary
Constructors Constructor Description Circle()
Create a circle in the xy-plane with radius 1 and with 16 line segments around the circumference.Circle(double r)
Create a circle in the xy-plane with radiusr
and with 16 line segments around the circumference.Circle(double r, int n)
Create a circle in the xy-plane with radiusr
and withn
line segments around the circumference.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getHorzCount()
int
getVertCount()
Circle
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
-
Circle
public Circle()
Create a circle in the xy-plane with radius 1 and with 16 line segments around the circumference.
-
Circle
public Circle(double r)
Create a circle in the xy-plane with radiusr
and with 16 line segments around the circumference.- Parameters:
r
- radius of the circle
-
Circle
public Circle(double r, int n)
Create a circle in the xy-plane with radiusr
and withn
line segments around the circumference.- Parameters:
r
- radius of the circlen
- number of line segments in the circle's circumference- Throws:
IllegalArgumentException
- ifn
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
-
-