BowlerKernel
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
eu.mihosoft.vrl.v3d.Sphere Class Reference
Inheritance diagram for eu.mihosoft.vrl.v3d.Sphere:
Inheritance graph
[legend]
Collaboration diagram for eu.mihosoft.vrl.v3d.Sphere:
Collaboration graph
[legend]

Public Member Functions

 Sphere ()
 
 Sphere (double radius)
 
 Sphere (LengthParameter size)
 
 Sphere (LengthParameter size, int numSlices, int numStacks)
 
 Sphere (double radius, int numSlices, int numStacks)
 
 Sphere (Vector3d center, double radius, int numSlices, int numStacks)
 
List< PolygontoPolygons ()
 
Vector3d getCenter ()
 
Sphere setCenter (Vector3d center)
 
double getRadius ()
 
Sphere setRadius (double radius)
 
int getNumSlices ()
 
Sphere setNumSlices (int numSlices)
 
int getNumStacks ()
 
Sphere setNumStacks (int numStacks)
 
PropertyStorage getProperties ()
 
- Public Member Functions inherited from eu.mihosoft.vrl.v3d.Primitive
CSG toCSG ()
 

Private Member Functions

void init ()
 
Vertex sphereVertex (Vector3d c, double r, double theta, double phi)
 

Private Attributes

Vector3d center
 
double radius
 
int numSlices
 
int numStacks
 
final PropertyStorage properties = new PropertyStorage()
 

Static Private Attributes

static final int NUM_SLICES = 16
 
static final int NUM_STACKS = 8
 

Detailed Description

A solid sphere.

Tthe tessellation along the longitude and latitude directions can be controlled via the numSlices and numStacks parameters.

Author
Michael Hoffer <info@.nosp@m.mich.nosp@m.aelho.nosp@m.ffer.nosp@m..de>

Definition at line 50 of file Sphere.java.

Constructor & Destructor Documentation

◆ Sphere() [1/6]

eu.mihosoft.vrl.v3d.Sphere.Sphere ( )

Constructor. Creates a sphere with radius 1, 16 slices and 8 stacks and center [0,0,0].

Definition at line 76 of file Sphere.java.

References eu.mihosoft.vrl.v3d.Sphere.init().

Here is the call graph for this function:

◆ Sphere() [2/6]

eu.mihosoft.vrl.v3d.Sphere.Sphere ( double  radius)

Constructor. Creates a sphere with the specified radius, 16 slices and 8 stacks and center [0,0,0].

Parameters
radiussphare radius

Definition at line 86 of file Sphere.java.

References eu.mihosoft.vrl.v3d.Sphere.init(), and eu.mihosoft.vrl.v3d.Sphere.radius.

Here is the call graph for this function:

◆ Sphere() [3/6]

eu.mihosoft.vrl.v3d.Sphere.Sphere ( LengthParameter  size)

Definition at line 94 of file Sphere.java.

References eu.mihosoft.vrl.v3d.parametrics.Parameter.getMM().

Here is the call graph for this function:

◆ Sphere() [4/6]

eu.mihosoft.vrl.v3d.Sphere.Sphere ( LengthParameter  size,
int  numSlices,
int  numStacks 
)

Definition at line 98 of file Sphere.java.

References eu.mihosoft.vrl.v3d.parametrics.Parameter.getMM(), eu.mihosoft.vrl.v3d.Sphere.numSlices, and eu.mihosoft.vrl.v3d.Sphere.numStacks.

Here is the call graph for this function:

◆ Sphere() [5/6]

eu.mihosoft.vrl.v3d.Sphere.Sphere ( double  radius,
int  numSlices,
int  numStacks 
)

Constructor. Creates a sphere with the specified radius, number of slices and stacks.

Parameters
radiussphare radius
numSlicesnumber of slices
numStacksnumber of stacks

Definition at line 110 of file Sphere.java.

References eu.mihosoft.vrl.v3d.Sphere.init(), eu.mihosoft.vrl.v3d.Sphere.radius, eu.mihosoft.vrl.v3d.Sphere.setNumSlices(), and eu.mihosoft.vrl.v3d.Sphere.setNumStacks().

Here is the call graph for this function:

◆ Sphere() [6/6]

eu.mihosoft.vrl.v3d.Sphere.Sphere ( Vector3d  center,
double  radius,
int  numSlices,
int  numStacks 
)

Constructor. Creates a sphere with the specified center, radius, number of slices and stacks.

Parameters
centercenter of the sphere
radiussphere radius
numSlicesnumber of slices
numStacksnumber of stacks

Definition at line 126 of file Sphere.java.

References eu.mihosoft.vrl.v3d.Sphere.center, eu.mihosoft.vrl.v3d.Sphere.radius, eu.mihosoft.vrl.v3d.Sphere.setNumSlices(), and eu.mihosoft.vrl.v3d.Sphere.setNumStacks().

Here is the call graph for this function:

Member Function Documentation

◆ getCenter()

Vector3d eu.mihosoft.vrl.v3d.Sphere.getCenter ( )

Gets the center.

Returns
the center

Definition at line 207 of file Sphere.java.

References eu.mihosoft.vrl.v3d.Sphere.center.

◆ getNumSlices()

int eu.mihosoft.vrl.v3d.Sphere.getNumSlices ( )

Gets the num slices.

Returns
the numSlices

Definition at line 244 of file Sphere.java.

References eu.mihosoft.vrl.v3d.Sphere.numSlices.

Referenced by eu.mihosoft.vrl.v3d.Sphere.toPolygons().

◆ getNumStacks()

int eu.mihosoft.vrl.v3d.Sphere.getNumStacks ( )

Gets the num stacks.

Returns
the numStacks

Definition at line 264 of file Sphere.java.

References eu.mihosoft.vrl.v3d.Sphere.numStacks.

Referenced by eu.mihosoft.vrl.v3d.Sphere.toPolygons().

◆ getProperties()

PropertyStorage eu.mihosoft.vrl.v3d.Sphere.getProperties ( )

Returns the property storage of this primitive.

Returns
the property storage of this primitive

Reimplemented from eu.mihosoft.vrl.v3d.Primitive.

Definition at line 283 of file Sphere.java.

References eu.mihosoft.vrl.v3d.Sphere.properties.

Referenced by eu.mihosoft.vrl.v3d.Sphere.toPolygons().

◆ getRadius()

double eu.mihosoft.vrl.v3d.Sphere.getRadius ( )

Gets the radius.

Returns
the radius

Definition at line 226 of file Sphere.java.

References eu.mihosoft.vrl.v3d.Sphere.radius.

◆ init()

void eu.mihosoft.vrl.v3d.Sphere.init ( )
private

◆ setCenter()

Sphere eu.mihosoft.vrl.v3d.Sphere.setCenter ( Vector3d  center)

Sets the center.

Parameters
centerthe center to set

Definition at line 216 of file Sphere.java.

References eu.mihosoft.vrl.v3d.Sphere.center.

◆ setNumSlices()

Sphere eu.mihosoft.vrl.v3d.Sphere.setNumSlices ( int  numSlices)

Sets the num slices.

Parameters
numSlicesthe numSlices to set

Definition at line 253 of file Sphere.java.

References eu.mihosoft.vrl.v3d.Sphere.NUM_SLICES, and eu.mihosoft.vrl.v3d.Sphere.numSlices.

Referenced by eu.mihosoft.vrl.v3d.Sphere.init(), and eu.mihosoft.vrl.v3d.Sphere.Sphere().

◆ setNumStacks()

Sphere eu.mihosoft.vrl.v3d.Sphere.setNumStacks ( int  numStacks)

Sets the num stacks.

Parameters
numStacksthe numStacks to set

Definition at line 273 of file Sphere.java.

References eu.mihosoft.vrl.v3d.Sphere.NUM_STACKS, and eu.mihosoft.vrl.v3d.Sphere.numStacks.

Referenced by eu.mihosoft.vrl.v3d.Sphere.init(), and eu.mihosoft.vrl.v3d.Sphere.Sphere().

◆ setRadius()

Sphere eu.mihosoft.vrl.v3d.Sphere.setRadius ( double  radius)

Sets the radius.

Parameters
radiusthe radius to set

Definition at line 235 of file Sphere.java.

References eu.mihosoft.vrl.v3d.Sphere.radius.

◆ sphereVertex()

Vertex eu.mihosoft.vrl.v3d.Sphere.sphereVertex ( Vector3d  c,
double  r,
double  theta,
double  phi 
)
private

Sphere vertex.

Parameters
cthe c
rthe r
thetathe theta
phithe phi
Returns
the vertex

Definition at line 152 of file Sphere.java.

References eu.mihosoft.vrl.v3d.Vector3d.plus(), and eu.mihosoft.vrl.v3d.Vector3d.times().

Referenced by eu.mihosoft.vrl.v3d.Sphere.toPolygons().

Here is the call graph for this function:

◆ toPolygons()

List<Polygon> eu.mihosoft.vrl.v3d.Sphere.toPolygons ( )

Returns the polygons that define this primitive.

Note: this method computes the polygons each time this method is called. The polygons can be cached inside a CSG object.

Returns
a list of polygons that define this primitive

Reimplemented from eu.mihosoft.vrl.v3d.Primitive.

Definition at line 167 of file Sphere.java.

References eu.mihosoft.vrl.v3d.Sphere.center, eu.mihosoft.vrl.v3d.Sphere.getNumSlices(), eu.mihosoft.vrl.v3d.Sphere.getNumStacks(), eu.mihosoft.vrl.v3d.Sphere.getProperties(), eu.mihosoft.vrl.v3d.Sphere.radius, and eu.mihosoft.vrl.v3d.Sphere.sphereVertex().

Here is the call graph for this function:

Member Data Documentation

◆ center

Vector3d eu.mihosoft.vrl.v3d.Sphere.center
private

◆ NUM_SLICES

final int eu.mihosoft.vrl.v3d.Sphere.NUM_SLICES = 16
staticprivate

◆ NUM_STACKS

final int eu.mihosoft.vrl.v3d.Sphere.NUM_STACKS = 8
staticprivate

◆ numSlices

int eu.mihosoft.vrl.v3d.Sphere.numSlices
private

◆ numStacks

int eu.mihosoft.vrl.v3d.Sphere.numStacks
private

◆ properties

final PropertyStorage eu.mihosoft.vrl.v3d.Sphere.properties = new PropertyStorage()
private

The properties.

Definition at line 69 of file Sphere.java.

Referenced by eu.mihosoft.vrl.v3d.Sphere.getProperties().

◆ radius

double eu.mihosoft.vrl.v3d.Sphere.radius
private

The documentation for this class was generated from the following file: