SilverLining
Static Public Member Functions | List of all members
SilverLining::CloudLayerFactory Class Reference

A class factory for CloudLayer objects. More...

#include <CloudLayerFactory.h>

Inheritance diagram for SilverLining::CloudLayerFactory:
Inheritance graph
[legend]
Collaboration diagram for SilverLining::CloudLayerFactory:
Collaboration graph
[legend]

Static Public Member Functions

static CloudLayer *SILVERLINING_API Create (CloudTypes layerType, const Atmosphere &atmosphere)
 Instantiate a CloudLayer for a given cloud type.
 
static bool SILVERLINING_API Serialize (CloudLayer *layer, std::ostream &stream, void *data=0)
 Flattens a cloud layer to a stream buffer.
 
static CloudLayer *SILVERLINING_API Unserialize (const Atmosphere &atm, std::istream &stream, void *data=0)
 Restores a cloud layer from a stream buffer written with Serialize()
 

Detailed Description

A class factory for CloudLayer objects.

Call CloudLayerFactory::Create to instantiate a CloudLayer object, which may then be configured, seeded, and submitted to the AtmosphericConditions. CloudLayer is a virtual base class, so this is the only mechanism for creating specific cloud layer types.

Member Function Documentation

◆ Create()

static CloudLayer *SILVERLINING_API SilverLining::CloudLayerFactory::Create ( CloudTypes  layerType,
const Atmosphere atmosphere 
)
static

Instantiate a CloudLayer for a given cloud type.

May only be called after the Atmosphere object has been initialized with Atmosphere::Initialize(), or at least pre-initialized with Atmosphere::PreInit().

Currently supported CloudTypes include:

  • CloudTypes::CIRROCUMULUS - High planar cloud puffs.
  • CloudTypes::CIRRUS_FIBRATUS - High, wispy cirrus clouds.
  • CloudTypes::STRATUS - Low clouds represented as a slab.
  • CloudTypes::CUMULONIMBUS_CAPPILATUS - A large thunderhead with lightning and rain.
  • CloudTypes::CUMULUS_MEDIOCRIS - Small, puffy clouds. Use sparingly.
  • CloudTypes::CUMULUS_CONGESTUS - Larger cumulus clouds with flattened bottoms, optimized for performance.
  • CloudTypes::CUMULUS_CONGESTUS_HI_RES - Larger cumulus clouds with flattened bottoms, optimized for appearance.
  • CloudTypes::TOWERING_CUMULUS - Large cumulus clouds with strong vertical growth - basically cumulus congestus clouds growing into cumulonimbus.
  • CloudTypes::STRATOCUMULUS - Low, dense, puffy clouds with some sun breaks between them. Implemented with GPU ray-casting, which can stress fill rate.
  • CloudTypes::STRATOCUMULUS_PARTICLES - EXPERIMENTAL. Low, dense, puffy clouds with some sun breaks between them. Implemented with billboard particles.
  • CloudTypes::SANDSTORM - A "haboob" cloud of dust intended to be positioned at ground level.
Parameters
layerTypeThe type of cloud deck to create, must be of the CloudTypes enumeration.
atmosphereThe atmosphere to which this cloud layer belongs to.
Returns
A pointer to a new CloudLayer for the specified type, or NULL if the Atmosphere has not yet been initialized.

◆ Serialize()

static bool SILVERLINING_API SilverLining::CloudLayerFactory::Serialize ( CloudLayer layer,
std::ostream &  stream,
void *  data = 0 
)
static

Flattens a cloud layer to a stream buffer.

Parameters
dataAn optional ThreadCameraStreamData object that this calls pertains to.

◆ Unserialize()

static CloudLayer *SILVERLINING_API SilverLining::CloudLayerFactory::Unserialize ( const Atmosphere atm,
std::istream &  stream,
void *  data = 0 
)
static

Restores a cloud layer from a stream buffer written with Serialize()

Parameters
dataAn optional ThreadCameraStreamData object that this calls pertains to.

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