GeoGen API Reference
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
geogen Namespace Reference

Wraps all GeoGen features. Contains basic functions and classes used throughout the entire code-base. More...

Namespaces

 compiler
 Contains script parser and compiler.
 
 corelib
 Contains definitions of the entire standard library as it is exposed to scripts.
 
 genlib
 Contains low-level native implementations of generator objects (height maps and height profiles) and all associated map operations.
 
 random
 Contains pseudo-random number generation features.
 
 renderer
 Contains the renderer and all associated classes.
 
 runtime
 Contains the virtual machine and all associated classes.
 
 testlib
 Contains additional functions exposed to functions in testing mode.
 
 utils
 Contains assorted utility classes and functions used throughout the project.
 

Classes

class  ApiUsageException
 Exception thrown when the API detects incorrect usage (such as incorrect parameter or a method being called in incorrect context). More...
 
class  CodeLocation
 A position in code. More...
 
class  Configuration
 Settings allowing to slightly customize behavior of the generator. More...
 
class  GeoGenException
 Base class for all exceptions thrown by GeoGen. More...
 
class  InternalErrorException
 Exception thrown when an unrecoverable internal error in GeoGen occurs. These should be reported as bugs (although an incorrect usage of the API might also be sometimes the cause). More...
 
class  Interval
 A coordinate interval in a 1D space. More...
 
class  Point
 A point in 2D space. More...
 
class  Rectangle
 A rectangle in 2D space with a position and a size. More...
 
class  Serializable
 Base class for objects that can be serialized into a human readable string representation. More...
 
class  Size2D
 Size of a 2D region with width and height. More...
 

Typedefs

typedef double Number
 Numeric type corresponding to script numbers.
 
typedef short Height
 Height in range HEIGHT_MIN, HEIGHT_MAX.
 
typedef double Scale
 Scale ratio.
 
typedef int Coordinate
 A coordinate in a 1D space. May be positive and negative.
 
typedef unsigned Size1D
 Size of a 1D region.
 
typedef char Char
 A character in GeoGen string. Defined as wchar_t, if GEOGEN_WCHAR is defined.
 
typedef std::string String
 A string type used to represent string throughout the library. Defined as std::wstring, if GEOGEN_WCHAR is defined.
 
typedef std::stringstream StringStream
 A string stream type used to represent string throughout the library. Defined as std::wstringstream, if GEOGEN_WCHAR is defined.
 
typedef std::ifstream IFStream
 An input file stream. Defined as std::wifstream, if GEOGEN_WCHAR is defined.
 
typedef std::ofstream OFStream
 An output file stream. Defined as std::wofstream, if GEOGEN_WCHAR is defined.
 
typedef std::ostream OStream
 An input file stream. Defined as std::wostream, if GEOGEN_WCHAR is defined.
 
typedef std::istream IStream
 An input file stream. Defined as std::wistream, if GEOGEN_WCHAR is defined.
 
typedef std::iostream IOStream
 An input file stream. Defined as std::wiostream, if GEOGEN_WCHAR is defined.
 

Enumerations

enum  Direction { DIRECTION_HORIZONTAL, DIRECTION_VERTICAL }
 Values that represent direction. More...
 
enum  ErrorCode {
  GGE1101_UnexpectedCharacter = 1101, GGE1102_InvalidEscapeSequence = 1102, GGE1201_UnexpectedToken = 1201, GGE1301_InvalidBreak = 1301,
  GGE1303_InvalidContinue = 1303, GGE1304_InvalidReturn = 1304, GGE1306_FunctionAlreadyDefined = 1306, GGE1307_ReadOnlyExpressionWrite = 1307,
  GGE1308_TypeAlreadyDefined = 1308, GGE1309_EnumValueAlreadyDefined = 1309, GGE1310_EnumValueNotInteger = 1310, GGE1311_ReservedTypeNameUsed = 1311,
  GGE1312_MainMapNotSupportedByScript = 1312, GGE1401_MetadataKeyAlreadyDefined = 1401, GGE1402_ScriptParametersNotKeyValueCollection = 1402, GGE1403_ScriptParameterNotKeyValueCollection = 1403,
  GGE1405_ReservedScriptParameterNameUsed = 1405, GGE1406_IncorrectScriptParameterAttributeType = 1406, GGE1407_IncorrectScriptParameterValueRestriction = 1407, GGE1408_WidthNotKeyValueCollection = 1408,
  GGE1409_HeightNotKeyValueCollection = 1409, GGE1410_UndefinedMetadataIdentifier = 1410, GGE1411_IncorrectMapSizeNumericValue = 1411, GGE1412_MinGreaterThanMaxMapSize = 1412,
  GGE1413_IncorrectEnumScriptParameterType = 1413, GGE2101_IncorrectNativeFunctionArgumentType = 2101, GGE2102_IncorrectOperandType = 2102, GGE2103_IncorrectNumberOfArguments = 2103,
  GGE2104_IncorrectConditionResultType = 2104, GGE2106_NullReference = 2106, GGE2107_IncorrectYieldType = 2107, GGE2108_ReadOnlyWrite = 2108,
  GGE2201_UndefinedFunction = 2201, GGE2202_UndefinedVariable = 2202, GGE2204_VariableAlreadyDefined = 2204, GGE2301_DivisionByZero = 2301,
  GGE2302_NumberOverflow = 2302, GGE2303_HeightOverflow = 2303, GGE2304_CoordinateOverflow = 2304, GGE2305_OutsideTrigonometricFunctionDefinitionRange = 2305,
  GGE2306_OutsideLogFunctionDefinitionRange = 2306, GGE2307_OutsideSqrtFunctionDefinitionRange = 2307, GGE2308_NumberUnderflow = 2308, GGE2309_SizeOverflow = 2309,
  GGE2501_CallStackOverflow = 2501, GGE2502_CodeBlockStackOverflow = 2502, GGE2503_ObjectStackOverflow = 2503, GGE2504_RenderingSequenceTooLong = 2504,
  GGE2601_InvalidOperationOnEmptyArray = 2601, GGE2602_ArrayKeyNotFound = 2602, GGE2603_ArrayNullKey = 2603, GGE2604_ArrayIndexNotFound = 2604,
  GGE2701_IncorrectStringFormat = 2701, GGE2702_InvalidEnumNumericValue = 2702, GGE2703_UnknownRelativeCoordinateDirection = 2703, GGE2704_RelativeCoordinateInInfiniteDimensions = 2704,
  GGE2705_MaxLessThanMin = 2705, GGE2706_IncorrectHeightProfileKeyType = 2706, GGE2707_IncorrectHeightProfileHeightType = 2707, GGE2708_IncorrectNoiseLayerWaveLengthType = 2708,
  GGE2709_IncorrectNoiseLayerAmplitudeType = 2709, GGE2710_NonpositiveNoiseLayerWaveLength = 2710, GGE2711_NonpositiveNoiseLayerAmplitude = 2711, GGE2712_InvalidTransformationMatrix = 2712,
  GGE2713_InvalidPersistence = 2713, GGE2714_InvalidScale = 2714, GGE2715_InvalidStrength = 2715, GGE2716_InvalidNumberOfStrata = 2716,
  GGE2801_MainMapNotGenerated = 2801, GGE3001_RendererMemoryLimitReached = 3001, GGE4000_ApiUsageError = 4000, GGE5000_InternalError = 5000,
  GGE5001_IntermediateCodeError = 5001, GGE6000_UserError = 6000
}
 Error codes produced by GeoGen. Detailed information on each of the codes can be found in the scripting reference. More...
 
enum  FunctionType { FUNCTION_TYPE_FUNCTION, FUNCTION_TYPE_OPERATOR }
 Kind of a function - operator vs. function. More...
 

Functions

Direction OtherDirection (Direction d)
 Returns the other than the specified direction. More...
 
String DirectionToString (Direction direction)
 Converts Direction to string. More...
 
Number StringToNumber (String const &str)
 Converts String to Number. More...
 
bool IsNumberInt (Number n)
 Determines whether a Number is an integer. More...
 
int NumberToInt (Number n)
 Converts a Number to an integer. More...
 
bool TryNumberToHeight (Number n, Height &out)
 Attempts to convert a Number to a Height. More...
 
bool TryNumberToScale (Number n, Scale &out)
 Attempts to convert a Number to a Scale. More...
 
bool TryNumberToSize (Number n, Size1D &out)
 Attempts to convert a Number to Size1D. More...
 
Height NumberToHeight (Number n)
 Converts a Number to a Height. More...
 
template<typename T >
int Sign (T val)
 Returns sign of a numeric value. More...
 
template<typename T >
Square (T val)
 Returns squared. More...
 
static Height Lerp (Coordinate fromCoord, Coordinate toCoord, Height fromHeight, Height toHeight, double point)
 Linear interpolation between two values on two 1D coordinates. More...
 
static Height AddHeights (Height x, Height y)
 Adds two heights together in saturation arithmetic (the result will be clamped to range <geogen::HEIGHT_MIN, geogen::HEIGHT_MAX>). More...
 
static double RoundAway (double x)
 Rounds a number to the next integer away from zero. More...
 
Coordinate NextMultipleOfInclusive (Coordinate coord, unsigned multiplier)
 Next coordinate that is a multiple of given number. More...
 
Coordinate NextMultipleOfExclusive (Coordinate coord, unsigned multiplier)
 Next coordinate that is a multiple of given number. More...
 
Coordinate PreviousMultipleOfInclusive (Coordinate coord, unsigned multiplier)
 Previous coordinate that is a multiple of given number. More...
 
Coordinate PreviousMultipleOfExclusive (Coordinate coord, unsigned multiplier)
 Previous coordinate that is a multiple of given number. More...
 
static bool TryPointToSize (Point p, Size2D &out)
 Attempts to convert a point to a 2D size. More...
 
String FormatString (String str, std::vector< String > arguments)
 Replaces formatting marks in a string with appropriate formatting arguments. More...
 
std::string StringToAscii (String str)
 Converts String to an ASCII string (std::string<char>). More...
 
String AnyStringToString (std::string str)
 Converts any string to String. More...
 
std::wstring StringToWstring (String str)
 Converts String to an ASCII string (std::string<wchar>). More...
 
String AnyStringToString (std::wstring str)
 Converts any string to String. More...
 
int StringToInt (String str)
 Converts String to an integer. More...
 
String IntToString (int n)
 Converts integer to String. More...
 

Variables

const Interval INTERVAL_MAX = Interval(COORDINATE_MIN, SIZE1D_MAX)
 The maximum representable interval covering the entire 1D space.
 
const Height HEIGHT_MIN = -32767
 The minimum height.
 
const Height HEIGHT_MAX = 32767
 The maximum height.
 
const Number NUMBER_PI = 3.14159265358979323846
 Mathematical constant Pi.
 
const Coordinate COORDINATE_MAX = INT_MAX
 The maximum coordinate.
 
const Coordinate COORDINATE_MIN = INT_MIN
 The minimum coordinate.
 
const Rectangle RECTANGLE_MAX = Rectangle(Point(COORDINATE_MIN, COORDINATE_MIN), SIZE2D_MAX)
 A rectangle covering the entire representable 2D space.
 
const Size1D SIZE1D_MAX = UINT_MAX
 Maximum 1D size.
 
const Size2D SIZE2D_MAX = Size2D(SIZE1D_MAX, SIZE1D_MAX)
 Maximum 2D size.
 
static OStreamCout = std::cout
 Standard output. Defined as std::wcout, if GEOGEN_WCHAR is defined.
 
static IStreamCin = std::cin
 Standard input. Defined as std::wcin, if GEOGEN_WCHAR is defined.
 

Detailed Description

Wraps all GeoGen features. Contains basic functions and classes used throughout the entire code-base.

Enumeration Type Documentation

Values that represent direction.

Enumerator
DIRECTION_HORIZONTAL 

Horizontal.

DIRECTION_VERTICAL 

Vertical.

Error codes produced by GeoGen. Detailed information on each of the codes can be found in the scripting reference.

Enumerator
GGE1101_UnexpectedCharacter 

An unexpected character was encountered in the input. This usually means a severe syntax error.

GGE1102_InvalidEscapeSequence 

An invalid escape sequence was encountered in the input.

GGE1201_UnexpectedToken 

The parser hes encountered an unexpected token.

GGE1301_InvalidBreak 

The parser has encountered a break statement outside of a loop.

GGE1303_InvalidContinue 

The parser has encountered a continue statement outside of a loop.

GGE1304_InvalidReturn 

The parser has encountered a return statement outside of a function body.

GGE1306_FunctionAlreadyDefined 

The script has declared a function which with a name which was already used by another function (either predefined or defined previously by the script).

GGE1307_ReadOnlyExpressionWrite 

A read only expression was used as a left-expression with a assignment operator such as =, += or ++. Only variable references and array item references are legal as left-expression.

GGE1308_TypeAlreadyDefined 

The script attempted to define an enum type with a name already used another class (either predefined or script defined).

GGE1309_EnumValueAlreadyDefined 

The script defined an enum item with the same name as another item of the same enum type.

GGE1310_EnumValueNotInteger 

The script defined an enum item with a numeric value that was not an integer.

GGE1311_ReservedTypeNameUsed 

The script defined an enum type with a name that is reserved by the language. Currently, the only reserved name is "Type".

GGE1312_MainMapNotSupportedByScript 

The script didn't contain a yield statement returning the primary map.

GGE1401_MetadataKeyAlreadyDefined 

The script metadata defined key a key which was already defined under the same node.

GGE1402_ScriptParametersNotKeyValueCollection 

The Parameters node of script metadata was not key-value collection node.

GGE1403_ScriptParameterNotKeyValueCollection 

Node of script metadata node representing a single script parameter was not key-value collection node.

GGE1405_ReservedScriptParameterNameUsed 

Script parameter defined in script metadata used name reserved by the language.

GGE1406_IncorrectScriptParameterAttributeType 

An attribute of a script parameter defined in script metadata was a node of a different type than expected.

GGE1407_IncorrectScriptParameterValueRestriction 

Unknown script parameter restriction was used.

GGE1408_WidthNotKeyValueCollection 

The Width node of script metadata was of incorrect type.

GGE1409_HeightNotKeyValueCollection 

The Height node of script metadata was of incorrect type.

GGE1410_UndefinedMetadataIdentifier 

An identifier used in script metadata was not recognized.

GGE1411_IncorrectMapSizeNumericValue 

A map size (maximum, minimum or default width or height) in script metadata was outside of the supported range.

GGE1412_MinGreaterThanMaxMapSize 

A minimum map size (width or height) in script metadata was greater than corresponding maximum map size.

GGE1413_IncorrectEnumScriptParameterType 

The Type of an script parameter in script metadata was not valid.

GGE2101_IncorrectNativeFunctionArgumentType 

An argument passed to a native function was of incorrect type.

GGE2102_IncorrectOperandType 

An operand of an operator was of incorrect type.

GGE2103_IncorrectNumberOfArguments 

Incorrect number of arguments was passed to a function.

GGE2104_IncorrectConditionResultType 

Condition expression in an if, while or for statement returned a value of incorrect type (Boolean is expected).

GGE2106_NullReference 

The script attempted to access a member of null.

GGE2107_IncorrectYieldType 

The script attempted to yield an object of incorrect type (HeightMap is expected).

GGE2108_ReadOnlyWrite 

The script attempted to write into a read-only variable.

GGE2201_UndefinedFunction 

The script attempted to call an undefined function.

GGE2202_UndefinedVariable 

The script attempted to read or write an undefined variable.

GGE2204_VariableAlreadyDefined 

The script attempted to define a variable which was already defined in the same scope.

GGE2301_DivisionByZero 

The script attempted to divide a number by zero.

GGE2302_NumberOverflow 

A number or a result of a numeric operation was outside of the range allowed by Number.

GGE2303_HeightOverflow 

The script attempted to specify a height outside of the range of allowed heigts (-1 to 1).

GGE2304_CoordinateOverflow 

The script attempted to specify a coordinate outside of the range of allowed values (-2147483648 to 2147483647).

GGE2305_OutsideTrigonometricFunctionDefinitionRange 

Argument of a trigonometric function was outside of its definition range.

GGE2306_OutsideLogFunctionDefinitionRange 

Argument of a Log function was outside of its definition range.

GGE2307_OutsideSqrtFunctionDefinitionRange 

Argument of a Sqrt function was outside of its definition range.

GGE2308_NumberUnderflow 

A number or a result of a numeric operation was too small to represent with Number.

GGE2309_SizeOverflow 

The script attempted to specify a size (or length) outside of the range of allowed values (0 to 4294967295).

GGE2501_CallStackOverflow 

Call stack became too large while executing the script.

GGE2502_CodeBlockStackOverflow 

Code block stack became too large while executing the script.

GGE2503_ObjectStackOverflow 

Object stack became too large while executing the script.

GGE2504_RenderingSequenceTooLong 

Rendering sequence became too long while executing the script.

GGE2601_InvalidOperationOnEmptyArray 

An operation that requires non-empty was called on an empty array.

GGE2602_ArrayKeyNotFound 

Specified key was not found in an array.

GGE2603_ArrayNullKey 

The script attempted to insert a key-value pair with null as its key into an array.

GGE2604_ArrayIndexNotFound 

Specified index was not found in the array.

GGE2701_IncorrectStringFormat 

A string format template had incorrect formating marks in it.

GGE2702_InvalidEnumNumericValue 

The script attempted to translate a incorrect numeric value to an enum value using FromNumber function of that enum type.

GGE2703_UnknownRelativeCoordinateDirection 

The script attempted to use relative coordinate in context to which dimension of the map the coordinate is relative to could not be determined.

GGE2704_RelativeCoordinateInInfiniteDimensions 

The script attempted to use relative coordinate in dimension in which the map is infinite.

GGE2705_MaxLessThanMin 

A maximum passed to a standard library function was less than a minimum.

GGE2706_IncorrectHeightProfileKeyType 

A key-value pair with a key of incorrect type was passed to HeightProfile.FromArray (Number is expected).

GGE2707_IncorrectHeightProfileHeightType 

A key-value pair with a value of incorrect type was passed to HeightProfile.FromArray (Number is expected).

GGE2708_IncorrectNoiseLayerWaveLengthType 

A wave length-amplitude pair with a key (wave length) of incorrect type was passed to HeightProfile. NHeightMap.Noise (Number is expected).

GGE2709_IncorrectNoiseLayerAmplitudeType 

A wave length-amplitude pair with a value (amplitude) of incorrect type was passed to HeightProfile.Noise HeightMap.Noise (Number is expected).

GGE2710_NonpositiveNoiseLayerWaveLength 

A wave length-amplitude pair with a non-positive wave length (key) was passed to HeightProfile.Noise or HeightMap.Noise.

GGE2711_NonpositiveNoiseLayerAmplitude 

A wave length-amplitude pair with a non-positive amplitude (value) was passed to HeightProfile.Noise or HeightMap.Noise.

GGE2712_InvalidTransformationMatrix 

An invalid transformation matrix was passed to HeightMap.Transform.

GGE2713_InvalidPersistence 

A persistence number passed to CreateNoiseLayers was ouside of the supported range (0.1 to 0.9).

GGE2714_InvalidScale 

A scale number passed to function like HeightMap.Rescale was ouside of the supported range (0.1 to 10).

GGE2715_InvalidStrength 

A strength number passed to function like HeightMap.Glaciate was ouside of the supported range (0 to 1).

GGE2716_InvalidNumberOfStrata 

Number of strata passed to function like HeightMap.Stratify was ouside of the supported range (1 to 100).

GGE2801_MainMapNotGenerated 

The script finished without yielding the main height map.

GGE3001_RendererMemoryLimitReached 

Rendering step requires too much memory.

GGE4000_ApiUsageError 

API usage error - such as incorrect parameter or a method being called in incorrect context).

GGE5000_InternalError 

An unrecoverable internal error in GeoGen occured. These should be reported as bugs (although an incorrect usage of the API might also be sometimes the cause).

GGE5001_IntermediateCodeError 

An error in the intermediate code was detected (such as incorrect state of the stack).

GGE6000_UserError 

An error was triggered using the TriggerError function from a script.

Kind of a function - operator vs. function.

Enumerator
FUNCTION_TYPE_FUNCTION 

Function.

FUNCTION_TYPE_OPERATOR 

Operator.

Function Documentation

static Height geogen::AddHeights ( Height  x,
Height  y 
)
inlinestatic

Adds two heights together in saturation arithmetic (the result will be clamped to range <geogen::HEIGHT_MIN, geogen::HEIGHT_MAX>).

Parameters
xHeight 1.
yHeight 2.
Returns
A height.
See also
http://en.wikipedia.org/wiki/Saturation_arithmetic Saturation arithmetic in Wikipedia
String geogen::AnyStringToString ( std::string  str)

Converts any string to String.

Parameters
strThe string.
Returns
The converted string.
String geogen::AnyStringToString ( std::wstring  str)

Converts any string to String.

Parameters
strThe string.
Returns
The converted string.
geogen::String geogen::DirectionToString ( Direction  direction)

Converts Direction to string.

Parameters
directionThe dimension.
Returns
The string.
String geogen::FormatString ( String  str,
std::vector< String arguments 
)

Replaces formatting marks in a string with appropriate formatting arguments.

Parameters
strThe string with formatting marks.
argumentsThe formatting arguments.
Returns
The formatted string.
String geogen::IntToString ( int  n)

Converts integer to String.

Parameters
nThe integer.
Returns
The converted string.
bool geogen::IsNumberInt ( Number  n)

Determines whether a Number is an integer.

Parameters
nThe number.
Returns
true if the number is an integer, false otherwise.
static Height geogen::Lerp ( Coordinate  fromCoord,
Coordinate  toCoord,
Height  fromHeight,
Height  toHeight,
double  point 
)
inlinestatic

Linear interpolation between two values on two 1D coordinates.

The two coordinates must not be the same.

Parameters
fromCoordFrom coordinate (x0).
toCoordTo coordinate (x1).
fromHeightFrom height (y0).
toHeightTo height (y1).
pointThe point (x).
Returns
An interpolated height.
See also
http://en.wikipedia.org/wiki/Linear_interpolation
Coordinate geogen::NextMultipleOfExclusive ( Coordinate  coord,
unsigned  multiplier 
)
inline

Next coordinate that is a multiple of given number.

If the coordinate is already a multiple of that number, the next multiple will be returned.

Parameters
coordThe coordinate.
multiplierThe multiplier.
Returns
A next multiple.
Coordinate geogen::NextMultipleOfInclusive ( Coordinate  coord,
unsigned  multiplier 
)
inline

Next coordinate that is a multiple of given number.

If the coordinate is already a multiple of that number, the same coordinate will be returned.

Parameters
coordThe coordinate.
multiplierThe multiplier.
Returns
A next multiple.
Height geogen::NumberToHeight ( Number  n)

Converts a Number to a Height.

The number is expected to be in range <-1, 1>.

Parameters
nThe Number to convert.
Returns
The converted Height.
int geogen::NumberToInt ( Number  n)

Converts a Number to an integer.

Parameters
nThe number.
Returns
The converted integer.
Direction geogen::OtherDirection ( Direction  d)
inline

Returns the other than the specified direction.

Parameters
dThe direction.
Returns
The other directions (vertical if horizontal, horizontal if vertical). Other values are returned unchanged.
Coordinate geogen::PreviousMultipleOfExclusive ( Coordinate  coord,
unsigned  multiplier 
)
inline

Previous coordinate that is a multiple of given number.

If the coordinate is already a multiple of that number, the previous multiple will be returned.

Parameters
coordThe coordinate.
multiplierThe multiplier.
Returns
A previous multiple.
Coordinate geogen::PreviousMultipleOfInclusive ( Coordinate  coord,
unsigned  multiplier 
)
inline

Previous coordinate that is a multiple of given number.

If the coordinate is already a multiple of that number, the same coordinate will be returned.

Parameters
coordThe coordinate.
multiplierThe multiplier.
Returns
A previous multiple.
static double geogen::RoundAway ( double  x)
inlinestatic

Rounds a number to the next integer away from zero.

Parameters
xThe number.
Returns
The rounded number.
template<typename T >
int geogen::Sign ( val)

Returns sign of a numeric value.

Template Parameters
TNumeric type.
Parameters
valThe value.
Returns
-1 if the value was less than 0, 0 if it was 0 and 1 if it was greater than 0.
template<typename T >
T geogen::Square ( val)

Returns squared.

Template Parameters
TNumeric type.
Parameters
valThe value.
Returns
The squared value.
string geogen::StringToAscii ( String  str)

Converts String to an ASCII string (std::string<char>).

Parameters
strThe string.
Returns
The converted string.
int geogen::StringToInt ( String  str)

Converts String to an integer.

Parameters
strThe string.
Returns
The converted integer.
Number geogen::StringToNumber ( String const &  str)

Converts String to Number.

Parameters
strThe string.
Returns
The number. 0 if the conversion failed.
wstring geogen::StringToWstring ( String  str)

Converts String to an ASCII string (std::string<wchar>).

Parameters
strThe string.
Returns
The converted string.
bool geogen::TryNumberToHeight ( Number  n,
Height out 
)

Attempts to convert a Number to a Height.

The number is expected to be in range <-1, 1>.

Parameters
nThe Number to convert.
outThe conversion result.
Returns
true if the conversion was successful, false otherwise.
bool geogen::TryNumberToScale ( Number  n,
Scale out 
)

Attempts to convert a Number to a Scale.

The number is expected to be in range <0.1, 10>.

Parameters
nThe Number to convert.
outThe conversion result.
Returns
true if the conversion was successful, false otherwise.
bool geogen::TryNumberToSize ( Number  n,
Size1D out 
)

Attempts to convert a Number to Size1D.

The number is expected to be in range SIZE_MIN, SIZE_MAX.

Parameters
nThe Number to convert.
outThe conversion result.
Returns
true if the conversion was successful, false otherwise.
static bool geogen::TryPointToSize ( Point  p,
Size2D &  out 
)
inlinestatic

Attempts to convert a point to a 2D size.

Parameters
pThe point to convert.
outThe conversion result.
Returns
true if the conversion was successful, false otherwise.