Stellarium 0.12.2
List of all members | Public Member Functions | Public Attributes
RingParams Struct Reference

Parameters specifying how to generate a ring. More...

#include <StelGeometryBuilder.hpp>

Public Member Functions

 RingParams (const float innerRadius, const float outerRadius)
 Construct RingParams specifying the required inner and outer radius parameter and other parameters at default values. More...
 
RingParamsresolution (const int slices, const int loops)
 Set resolution (detail) of the ring. More...
 
RingParamsflipFaces ()
 If specified, the ring will be flipped to face the opposite side. More...
 

Public Attributes

float innerRadius_
 Inner radius of the ring. More...
 
float outerRadius_
 Outer radius of the ring. More...
 
int loops_
 Number of loops in the ring. More...
 
int slices_
 Number of slices/subdivisions in the ring. More...
 
bool flipFaces_
 Should the faces in the ring be flipped to face the opposite side? More...
 

Detailed Description

Parameters specifying how to generate a ring.

These are passed to StelGeometryBuilder to build a sphere.

This is a builder-style struct. Parameters can be specified like this:

// Required parameters, inner and outer radius, set to 5 and 10 respectively,
// optional parameters have default values
// (20 loops, 20 slices, faces not flipped)
RingParams a = RingParams(5.0f, 10.0f);
// Higher detail ring
RingParams b = RingParams(5.0f, 10.0f).resolution(40, 40);
// Ring facing the opposite side
RingParams c = RingParams(5.0f, 10.0f).flipFaces();
See Also
StelGeometryRing, StelGeometryBuilder::buildRingTextured, StelGeometryBuilder::buildRing2D

Definition at line 345 of file StelGeometryBuilder.hpp.

Constructor & Destructor Documentation

RingParams::RingParams ( const float  innerRadius,
const float  outerRadius 
)
inline

Construct RingParams specifying the required inner and outer radius parameter and other parameters at default values.

Default values are 20 loops, 20 slices and faces not flipped.

Parameters
innerRadiusInner radius. Must be greater than zero.
outerRadiusOuter radius. Must be greater than the inner radius.

Definition at line 354 of file StelGeometryBuilder.hpp.

Member Function Documentation

RingParams& RingParams::flipFaces ( )
inline

If specified, the ring will be flipped to face the opposite side.

Definition at line 379 of file StelGeometryBuilder.hpp.

RingParams& RingParams::resolution ( const int  slices,
const int  loops 
)
inline

Set resolution (detail) of the ring.

Higher values result in more detail, but also higher resource usage.

Parameters
slicesNumber of slices/subdivisions. E.g. 3 is a triangle, 5 a pentagon, etc. Must be at least 3 and at most 4096.
loopsNumber of concentric loops in the ring. Must be at least 1.

Definition at line 371 of file StelGeometryBuilder.hpp.

Member Data Documentation

bool RingParams::flipFaces_

Should the faces in the ring be flipped to face the opposite side?

Definition at line 394 of file StelGeometryBuilder.hpp.

float RingParams::innerRadius_

Inner radius of the ring.

Definition at line 386 of file StelGeometryBuilder.hpp.

int RingParams::loops_

Number of loops in the ring.

Definition at line 390 of file StelGeometryBuilder.hpp.

float RingParams::outerRadius_

Outer radius of the ring.

Definition at line 388 of file StelGeometryBuilder.hpp.

int RingParams::slices_

Number of slices/subdivisions in the ring.

Definition at line 392 of file StelGeometryBuilder.hpp.


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