Value¶
LXe_OK_INEXACT_MATCH
LXe_OK_NO_CHOICES
LXe_VALUE_UNKNOWN_EXOTYPE
ILxValueService¶
-
class
ILxValueService
¶ This COM interface provides some useful functions for dealing with values.
Public Functions
-
LxResult
ScriptQuery
(LXtObjectID self, void **ppvObj)¶ As with all globals, the first method gets the ILxScriptQueryID interface for the system.
-
LxResult
TextHintEncode
(LXtObjectID self, int value, const LXtTextValueHint *hint, char *buf, unsigned len)¶ This encodes a numeric value as a string. If the ‘buf’ pointer is null, then a rolling buffer will be allocated and returned. If the hint pointer is null then the value is written as a plain signed integer. This will return LXe_OK_INEXACT_MATCH when an integer is provided that does not exactly map to one of the choices. This is only returned if there are choices. LXe_OK_NO_CHOICES is returned if there are no choices at all. In both cases, the raw integer is encoded into the string buffer. Both codes are “OK” codes, and do not signify an error, but rather provide hints about the content of the encoded string, and may help instruct an code path if you do need an exact match or were expecting choices.
-
LxResult
TextHintDecode
(LXtObjectID self, const char *buf, const LXtTextValueHint *hint, int *value)¶ This method decodes a string using the hint array. If the string is a number it will be returned directly after being clamped to min or max limits. If nothing is recognized then the function end-of-list will be returned. This will return LXe_NOTFOUND when the string does not exactly match any text hints and cannot be converted into an integer (i.e., it doesn’t start with a number). LXe_OK_NO_CHOICES is returned when the string was sucessfully converted from a number into an integer and may have been constrained to any min/max hints present, but the hints contain no actual choices. This may occur in the case of a hints array that is used only for min/max or similar properties, and is not meant to have a list of choices.
-
LxResult
CreateValue
(LXtObjectID self, const char *type, void **ppvObj)¶ This method creates a new value object of the given type.
-
LxResult
ValueType
(LXtObjectID self, const char *type, unsigned *valType)¶ This gets the intrinsic type for a given value type, as one of the LXi_TYPE_* choices.
-
LxResult
TextHintDuplicate
(LXtObjectID self, const LXtTextValueHint *hint, LXtTextValueHint **copy)¶ There are cases where it is useful to copy a text hints array. These methods can be used to do just that, and to free it when it is no longer needed. These functions will safely handle NULL arrays, and will simply fail.
-
LxResult
TextHintFreeDuplicate
(LXtObjectID self, LXtTextValueHint *copy)¶
-
int
FloatType
(LXtObjectID self, float val)¶ Check a float for NaN or infinity. A zero return value is OK.
-
double
GetFPS
(LXtObjectID self)¶ Returns the global Frames Per Second.
-
double
TimeToFrame
(LXtObjectID self, double time)¶ Given a time and using the global Frames Per Second, returns an equivalent frame.
-
double
FrameToTime
(LXtObjectID self, double frame)¶ Given a frame and using the global Frames Per Second, returns an equivalent time.
-
double
TimeToFrameFPS
(LXtObjectID self, double time, double fps)¶ Given a time and a Frames Per Second, returns an equivalent frame.
-
double
FrameToTimeFPS
(LXtObjectID self, double frame, double fps)¶ Given a frame and a Frames Per Second, returns an equivalent time.
-
LxResult
ConvertValues
(LXtObjectID self, const char *from, const char *to, void **ppvObj)¶ Given two different value type names, returns an ILxValueConversion object that can be used to convert from one type to the other.
-
bool
EncodeHint
(int value, const LXtTextValueHint *hint, std::string &text)¶
-
bool
NewValue
(CLxLocalizedObject &value, const char *type)¶ User Class Only:
-
class
Tmp_Sgs
¶ User Class Only: Safer version for C++.
-
LxResult
ILxValueService::Tmp_Sgs¶
-
class
Tmp_Sgs
User Class Only: Safer version for C++.
Public Functions
-
LxResult
sgs_GetString
(char *buf, unsigned int len)
Public Members
-
CLxLoc_ValueService *
vsrv
-
const LXtTextValueHint *
hint
-
int
value
-
LxResult
LXiFLOATTYPE_NUMBER
LXiFLOATTYPE_NAN
LXiFLOATTYPE_INFINITY
LXtTextValueHint¶
-
struct
st_LXtTextValueHint
¶ Internal numeric codes are sometimes stored in files: data files, config files, and even macros. Since these numeric codes are subject to change as algorithms and systems get updated, we provide a system of hints to use when storing these values to files so that we can cope with changes when reading old ones. Right now the system is simple, but it can be expanded as required to cope with more sophisticated conversions. The hints come in the form of a null-terminated array of hint structs, each one linking a numeric value to a text token. Tokens that start with “+” indicate bit masks, and other values represent choices. The tokens should not start with numeric or punctuation characters, and should not contain spaces.
ILxValue¶
-
class
ILxValue
¶ This COM interface provides some useful functions for dealing with values.
Public Functions
-
LxResult
Clone
(LXtObjectID self, void **ppvObj)¶ The Clone method returns a duplicate of the value server. The data for the value is also copied, allowing the clone to be modified, without affecting the source value.
-
LxResult
Copy
(LXtObjectID self, LXtObjectID from)¶ Similar to Clone, the Copy method will be copy the data from the Value object, however, instead of returning a new object, the data will be copied to the object passed in. The target and source Value servers must have the same implementation.
-
LxResult
Compare
(LXtObjectID self, LXtObjectID other, int *diff)¶ The Compare method will compare this Value object against another of the same type. This works in a similar way to string comparison, with a diff value of -1 for less than, 0 for equal to, and 1 for greater than. If the objects are the same, the result code will be LXe_TRUE.
-
unsigned int
Type
(LXtObjectID self)¶ The Type method returns the intrinsic type, in a similar way to the Attributes interface. The return value will either be LXi_TYPE_INTEGER, LXi_TYPE_FLOAT, LXi_TYPE_STRING or LXi_TYPE_OBJECT.
-
LxResult
TypeName
(LXtObjectID self, const char **name)¶ The TypeName method indirectly returns a string representing the name of the value type. This is usually the name of the server that implements the value, but this is not guaranteed.
-
LxResult
SubTypeName
(LXtObjectID self, const char **name)¶ In some cases, Value objects are simply containers for other value types. The SubTypeName method returns the name of the value type contained.
-
LxResult
GetInt
(LXtObjectID self, int *val)¶ The actual value of the value can be read and optionally set several different ways.
-
LxResult
SetInt
(LXtObjectID self, int val)¶
-
LxResult
GetFlt
(LXtObjectID self, double *val)¶
-
LxResult
SetFlt
(LXtObjectID self, double val)¶
-
LxResult
GetString
(LXtObjectID self, char *buf, unsigned len)¶
-
LxResult
SetString
(LXtObjectID self, const char *val)¶
-
void *
Intrinsic
(LXtObjectID self)¶ A somewhat more raw method can give generic access to the intrinsic types. For integer types this is a pointer to int; for float types it’s a pointer to double; for string types it’s a pointer to char. Other value types may return null.
-
int
Compare
(ILxUnknownID other)¶ User Class Only: For C++ developers, a method is provided that returns the Comparison value directly.
-
bool
String
(std::string &text)¶
-
void
Set
(int value)¶ User Class Only: For setting at least we can infer the type from the argument.
-
void
Set
(double value)¶
-
void
Set
(const char *value)¶
-
LxResult
ILxValue1¶
-
class
ILxValue1
¶ Public Functions
-
LxResult
Clone
(LXtObjectID self, void **ppvObj)¶
-
LxResult
Copy
(LXtObjectID self, LXtObjectID from)¶
-
LxResult
Compare
(LXtObjectID self, LXtObjectID other, int *diff)¶
-
unsigned int
Type
(LXtObjectID self)¶
-
LxResult
GetInt
(LXtObjectID self, int *val)¶
-
LxResult
SetInt
(LXtObjectID self, int val)¶
-
LxResult
GetFlt
(LXtObjectID self, double *val)¶
-
LxResult
SetFlt
(LXtObjectID self, double val)¶
-
LxResult
GetString
(LXtObjectID self, char *buf, unsigned len)¶
-
LxResult
SetString
(LXtObjectID self, const char *val)¶
-
void *
Intrinsic
(LXtObjectID self)¶
-
LxResult
ILxStringConversion¶
-
class
ILxStringConversion
¶ There are actually two variants of this interfaces that an object can provide. The “raw” version writes values in a native format, most suitable for scripting of file I/O. The “nice” version writes the value in a format suitable for human reading, and parses a more extensive range of possible human input.
Public Functions
-
LxResult
Encode
(LXtObjectID self, char *buf, unsigned len)¶ This interface allows simple string equivalence for COM objects. The Encode() function writes the value of the object to a string with the given number of available bytes (including null termination), and the Decode() parses a string setting the value of the object to match.
-
LxResult
Decode
(LXtObjectID self, const char *buf)¶
-
LxResult
ILxStringConversion::Tmp_Sgs¶
-
class
Tmp_Sgs
User Class Only:
Public Functions
-
LxResult
sgs_GetString
(char *buf, unsigned int len)
Public Members
-
CLxLoc_StringConversion *
conv
-
LxResult
ILxStringConversionNice¶
-
class
ILxStringConversionNice
¶ There are actually two variants of this interfaces that an object can provide. The “raw” version writes values in a native format, most suitable for scripting of file I/O. The “nice” version writes the value in a format suitable for human reading, and parses a more extensive range of possible human input.
Public Functions
-
LxResult
Encode
(LXtObjectID self, char *buf, unsigned len)¶ Nice is the same as raw. Too bad there’s no reasonable way to use the same interface with different GUIDs.
-
LxResult
Decode
(LXtObjectID self, const char *buf)¶
-
LxResult
ILxStringConversionNice::Tmp_Sgs¶
-
class
Tmp_Sgs
User Class Only:
Public Functions
-
LxResult
sgs_GetString
(char *buf, unsigned int len)
Public Members
-
CLxLoc_StringConversionNice *
conv
-
LxResult
ILxValueMath¶
-
class
ILxValueMath
¶ Public Functions
-
LxResult
Step
(LXtObjectID self, int direction)¶ Numeric or quasi-numeric values can be modified through the value-math interface.
-
int
Detent
(LXtObjectID self)¶
-
LxResult
Add
(LXtObjectID self, double delta)¶
-
LxResult
Multiply
(LXtObjectID self, double factor)¶
-
LxResult
Blend
(LXtObjectID self, LXtObjectID other, double blend)¶
-
LxResult
LXiDETENT_NONE
LXiDETENT_MINOR
LXiDETENT_MAJOR
ILxValueReference¶
-
class
ILxValueReference
¶ Public Functions
-
LxResult
IsSet
(LXtObjectID self)¶ Some values are references to other object types. This interface allows access to the referenced object, as well as a query for knowing if a reference is set.
-
LxResult
GetObject
(LXtObjectID self, void **ppvObj)¶
-
LxResult
SetObject
(LXtObjectID self, LXtObjectID obj)¶
-
bool
Get
(CLxLocalizedObject &loc)¶ User Class Only:
-
bool
TakeObject
(ILxUnknownID obj)¶
-
LxResult
ILxValueConversion¶
-
class
ILxValueConversion
¶ Public Functions
-
LxResult
Test
(LXtObjectID self, const char *fromType, const char *toType)¶ Value Conversion servers allow one value type to be converted into another. For example, converting an integer into a string. This method should return LXe_TRUE or LXe_FALSE if the value type can handle a conversion from one type to another.
-
LxResult
Convert
(LXtObjectID self, LXtObjectID from, const char *fromType, LXtObjectID to, const char *toType)¶ When the conversion occurs, the “from” value and it’s type is passed to this method along with the “to” value, and it’s type. This method should set the value of the “to” object, using the value of the “from” object.
-
LxResult
ILxAttributes¶
-
class
ILxAttributes
¶ The attributes interface typically does not stand on its own. Instead it’s one of an object’s polymorphic features, which packages the internal state of the object into a common format.
Public Functions
-
unsigned int
Count
(LXtObjectID self)¶ Return the number of attributes.
-
LxResult
Name
(LXtObjectID self, unsigned int index, const char **name)¶ Return the name of the attribute at given index, or LXe_OUTOFBOUNDS for bad index choices.
-
LxResult
Lookup
(LXtObjectID self, const char *name, unsigned int *index)¶ Return the index given the name, or LXe_NOTFOUND.
-
LxResult
Type
(LXtObjectID self, unsigned int index, unsigned int *type)¶ Return the basic attribute type which indicates what intrinsic data type is used to store it. That is given by one of the types below.
-
LxResult
TypeName
(LXtObjectID self, unsigned int index, const char **tname)¶ Return the attribute type name. This is the name of any of the available value types.
-
const LXtTextValueHint *
Hints
(LXtObjectID self, unsigned int index)¶ Return a read-only array of text value hints for the given attribute. This may return null if there are none or if there is any other failure. Note that this array may be volatile and should not be stored.
-
LxResult
Value
(LXtObjectID self, unsigned int index, void **ppvObj, int writeOK)¶ Once the list of attributes and their types has been determined, the following methods can be used to read and write their values given their index (from 0 to Count-1).
Value This gets the ILxValue associated with the attribute. The interface has been acquired for the calling client and needs to be released when done. If ‘writeOK’ is true the object will be writable, and changes to the value should be done using the appropriate object interface.
GetInt, SetInt These get and set the value of integer attributes.
GetFlt, SetFlt These get and set the value of floating-point attributes.
GetString, SetString These get and set the value of string attributes. Note that GetString() returns a “raw” string when used with non-string datatypes. “Nice” strings can be obtained by passing the result of Value() through an appropriate StringConversion.
-
LxResult
GetInt
(LXtObjectID self, unsigned int index, int *val)¶
-
LxResult
SetInt
(LXtObjectID self, unsigned int index, int val)¶
-
LxResult
GetFlt
(LXtObjectID self, unsigned int index, double *val)¶
-
LxResult
SetFlt
(LXtObjectID self, unsigned int index, double val)¶
-
LxResult
GetString
(LXtObjectID self, unsigned int index, char *buf, unsigned len)¶
-
LxResult
SetString
(LXtObjectID self, unsigned int index, const char *val)¶
-
int
FindIndex
(const std::string &name)¶ User Class Only: FindIndex() is an analogue of Lookup(), but returns the attribute index or -1 for none.
-
int
FindIndex
(const char *name)¶
-
int
Type
(unsigned index)¶
-
bool
Name
(unsigned index, std::string &name)¶
-
bool
Set
(unsigned index, bool val)¶ User Class Only: There are a few alternate methods defined in the C++ user class for handling some of the type conversions.
-
bool
Set
(unsigned index, int val)¶
-
bool
Set
(unsigned index, double val)¶
-
bool
Set
(unsigned index, const char *val)¶
-
bool
Bool
(unsigned index, bool preset = false)¶ User Class Only: Simpler get methods return the value without error checking.
-
int
Int
(unsigned index, int preset = 0)¶
-
double
Float
(unsigned index, double preset = 0.0)¶
-
bool
Set
(unsigned index, const std::string &text)¶ User Class Only: Strings can be set and read using the STL string class.
-
bool
String
(unsigned index, std::string &text)¶
-
bool
ObjectRO
(unsigned index, CLxLocalizedObject &loc)¶ User Class Only: Object values can be read into any interface localization, for read-only access or for read-write.
-
bool
ObjectRW
(unsigned index, CLxLocalizedObject &loc)¶
-
LxResult
GetRef
(unsigned index, void **ppvObj)¶ User Class Only: If the object is of the OBJREF type, then it’s actually a container for another object. These methods allow the content to be accessed directly.
-
bool
GetRef
(unsigned index, CLxLocalizedObject &loc)¶
-
bool
TakeRef
(unsigned index, ILxUnknownID obj)¶
-
class
Tmp_Sgs
¶
-
unsigned int
ILxAttributes::Tmp_Sgs¶
-
class
Tmp_Sgs
Public Functions
-
LxResult
sgs_GetString
(char *buf, unsigned int len)
Public Members
-
CLxLoc_Attributes *
attr
-
unsigned
index
-
LxResult
-
LXi_TYPE_OBJECT
¶ The intrinsic type returned by Type() is one of the following codes:
LXi_TYPE_INTEGER, LXi_TYPE_FLOAT The attribute is number, either an integer (int) of a floating point number (double). Booleans and axes are considered integers for this purpose.
LXi_TYPE_STRING The attribute is a string, and can be read or set as a null-terminated array of bytes.
LXi_TYPE_OBJECT The attribute is a complex object, and is accessed as an ILxValue interface.
LXi_TYPE_INTEGER
LXi_TYPE_FLOAT
LXi_TYPE_STRING
-
LXsTYPE_INTEGER
¶ The type name can be one of the nexus intrinsic types here, or it can be a value type implemented by a plug-in server of the “value” class.
LXsTYPE_FLOAT
LXsTYPE_DISTANCE
LXsTYPE_PERCENT
LXsTYPE_ANGLE
LXsTYPE_FLOAT3
LXsTYPE_DISTANCE3
LXsTYPE_PERCENT3
LXsTYPE_ANGLE3
LXsTYPE_TIME
LXsTYPE_LIGHT
LXsTYPE_STRING
LXsTYPE_FILEPATH
LXsTYPE_UVCOORD
LXsTYPE_BOOLEAN
LXsTYPE_AXIS
LXsTYPE_MEMORY
LXsTYPE_PIXEL
LXsTYPE_FPIXEL
LXsTYPE_COLOR
LXsTYPE_COLOR1
LXsTYPE_MATRIX3
LXsTYPE_MATRIX4
LXsTYPE_DATETIME
LXsTYPE_TOD
LXsTYPE_DATE
LXsTYPE_OBJREF
LXsTYPE_VERTMAPNAME
LXsTYPE_FORCE
LXsTYPE_ACCELERATION
LXsTYPE_SPEED
LXsTYPE_MASS
LXsTYPE_QUATERNION
LXsTYPE_FOCALLENGTH
LXsTYPE_NONE
ILxMessage¶
-
class
ILxMessage
¶ Error messages can be managed through the use of the ILxMessage interface. These objects contain the result code, a message, and values for each of the arguments in the message string.
Public Functions
-
LxResult
Code
(LXtObjectID self)¶ This returns the code, which can be an error, info (success) or warning LxResult.
-
LxResult
SetCode
(LXtObjectID self, LxResult code)¶ This sets that code.
-
LxResult
SetMessage
(LXtObjectID self, const char *table, const char *name, unsigned id)¶ To set the message, the client provides a message table name and either a message name or numeric ID representing the message. If the text name is NULL, the ID is converted to text and used instead. Setting a message clears any existing message.
-
LxResult
SetArgumentInt
(LXtObjectID self, unsigned arg, int value)¶ Messages in message tables may have arguments marked in the form of %1, %2, etc. One of the SetArgument…() functions should be called for each to provide a meaningful dynamic value to the user. Note that these argument indices match the numbers in the message string itself; if you want to set %1, use argument index 1. Technically, you can have a %0 and use arg index 0, but that is discouraged.
-
LxResult
SetArgumentFloat
(LXtObjectID self, unsigned arg, double value)¶
-
LxResult
SetArgumentString
(LXtObjectID self, unsigned arg, const char *string)¶
-
LxResult
SetArgumentObject
(LXtObjectID self, unsigned arg, LXtObjectID object)¶
-
LxResult
Reset
(LXtObjectID self)¶ This resets a message object to LXe_OK and clears the string to NULL.
-
LxResult
Table
(LXtObjectID self, const char **table)¶ Some clients need access to the table and message name.
-
LxResult
Name
(LXtObjectID self, const char **name)¶
-
LxResult
SetMessageResult
(LXtObjectID self, unsigned id)¶ To set the message from a result code, the client provides the numeric ID representing the message. Setting a message clears any existing message. This also sets the result code itself by treating the numeric ID as an LxResult.
-
bool
SetArg
(unsigned arg, int val)¶ User Class Only: The user class has alternate methods for setting the argument based on different types.
-
bool
SetArg
(unsigned arg, double val)¶
-
bool
SetArg
(unsigned arg, const char *val)¶
-
bool
SetMsg
(const char *table, unsigned id)¶ User Class Only: It also has some alternates for setting the message itself using either dictionary string or message ID. If you pass just a string it will use common message 99 which just displays argument 1. This is not recommended for commercial plug-ins, but it lets you use literal text for quick hacks.
-
bool
SetMsg
(const char *table, const char *name)¶
-
bool
SetMsg
(const char *string)¶
-
LxResult
ILxValueArray¶
-
class
ILxValueArray
¶ The ILxValueArray interface is a container for multiple values of the same type. There can be zero or more values of any given type in the container, and the object has methods for setting and getting individual values. Generally an empty container will be passed to a source which will fill in all the values, and then the container will be passed along to a destination which will read out the values.
Public Functions
-
LxResult
Type
(LXtObjectID self, unsigned int *type)¶ These returns the type of the values stored in the container. Type is an LXi_TYPE_* identifier, while TypeName is the ExoType’s actual name string.
-
LxResult
TypeName
(LXtObjectID self, const char **name)¶
-
unsigned int
Count
(LXtObjectID self)¶ This returns the number of values currently in the container.
-
LxResult
AddEmptyValue
(LXtObjectID self, void **ppvObj)¶ This adds an uninitialized value to the container, optionally returning it to the caller. This is useful if you just need a dummy value to fill a gap. Another common use is to the returned value object to decode a string.
-
LxResult
AddValue
(LXtObjectID self, LXtObjectID value)¶ These add new values to the container. Note that the original value is still owned by the client. Also note that these only work on matching datatypes notably, AddString() will only work if the value array is itself representing a string. If you want have a string decoded as a value to add to the array, use AddEmptyValue() to add an empty value object to the array, then call that object’s SetString() method to decode the string into it.
-
LxResult
AddInt
(LXtObjectID self, int value)¶
-
LxResult
AddFloat
(LXtObjectID self, double value)¶
-
LxResult
AddString
(LXtObjectID self, const char *value)¶
-
LxResult
GetValue
(LXtObjectID self, unsigned int index, void **ppvObj)¶ These get values out of the container. Note that the ILxValueID provided from GetValue() must be released by the caller. Also note that GetString() can be used on non-string datatypes, and will return a “raw” string. “Nice” strings can be obtained by passing the result of Value() through an appropriate StringConversion.
-
LxResult
GetInt
(LXtObjectID self, unsigned int index, int *value)¶
-
LxResult
GetFloat
(LXtObjectID self, unsigned int index, double *value)¶
-
LxResult
GetString
(LXtObjectID self, unsigned int index, char *buf, unsigned len)¶
-
LxResult
FirstUnique
(LXtObjectID self, unsigned int *uniqueIndex)¶ This returns the index of the first unique value found that is different from the 0th index, or -1 if all the values are identical. This is useful for creating mixed argument lists for user interfaces.
-
LxResult
Reset
(LXtObjectID self)¶ This empties the container, freeing all values within.
-
LxResult
Remove
(LXtObjectID self, unsigned int index)¶ This removes an element from the array at the specified index. If the index is out of bounds, the function returns LXe_OUTOFBOUNDS.
-
LxResult
SetValue
(LXtObjectID self, unsigned int index, LXtObjectID value)¶ These methods set the value of an existing element in the value array, replacing the value stored at the specified index.
-
LxResult
SetInt
(LXtObjectID self, unsigned int index, int value)¶
-
LxResult
SetFloat
(LXtObjectID self, unsigned int index, double value)¶
-
LxResult
SetString
(LXtObjectID self, unsigned int index, const char *value)¶
-
bool
AddEmpty
(CLxLocalizedObject &val)¶ User Class Only: There are a few alternate methods in the user class for varying arg types.
-
bool
Add
(CLxLoc_Value &val)¶
-
bool
Add
(bool val)¶
-
bool
Add
(int val)¶
-
bool
Add
(double val)¶
-
bool
Add
(const char *val)¶
-
bool
String
(unsigned index, std::string &text)¶
-
class
Tmp_Sgs
¶ User Class Only:
-
LxResult
ILxValueArray::Tmp_Sgs¶
-
class
Tmp_Sgs
User Class Only:
Public Functions
-
LxResult
sgs_GetString
(char *buf, unsigned int len)
Public Members
-
CLxLoc_ValueArray *
vary
-
unsigned
index
-
LxResult
ILxValueArray1¶
-
class
ILxValueArray1
¶ Public Functions
-
LxResult
Type
(LXtObjectID self, unsigned int *type)¶
-
LxResult
TypeName
(LXtObjectID self, const char **name)¶
-
unsigned int
Count
(LXtObjectID self)¶
-
LxResult
AddEmptyValue
(LXtObjectID self, void **ppvObj)¶
-
LxResult
AddValue
(LXtObjectID self, LXtObjectID value)¶
-
LxResult
AddInt
(LXtObjectID self, int value)¶
-
LxResult
AddFloat
(LXtObjectID self, double value)¶
-
LxResult
AddString
(LXtObjectID self, const char *value)¶
-
LxResult
GetValue
(LXtObjectID self, unsigned int index, void **ppvObj)¶
-
LxResult
GetInt
(LXtObjectID self, unsigned int index, int *value)¶
-
LxResult
GetFloat
(LXtObjectID self, unsigned int index, double *value)¶
-
LxResult
GetString
(LXtObjectID self, unsigned int index, char *buf, unsigned len)¶
-
LxResult
FirstUnique
(LXtObjectID self, unsigned int *uniqueIndex)¶
-
LxResult
Reset
(LXtObjectID self)¶
-
LxResult
ILxArray¶
-
class
ILxArray
¶ There is also this simple read-only list construct. The elements are COM objects that must be queried for their interface by the caller. As usually, any returned objects must be released by the caller.
Public Functions
-
unsigned int
Count
(LXtObjectID self)¶
-
LxResult
ByIndex
(LXtObjectID self, unsigned int index, void **ppvObj)¶
-
unsigned int
-
LXe_QUERY_UNKNOWN_SERVICE
¶ These error codes can be returned by the interface on error.
LXe_QUERY_SERVICE_UNAVAILABLE
LXe_QUERY_UNKNOWN_ATTRIBUTE
LXe_QUERY_MISMATCHED_TYPE
LXe_QUERY_SELECT_FAILED
LXe_QUERY_NEED_SELECTION
LXe_QUERY_MISMATCHED_SELECTION
LXe_QUERY_NOT_APPLICABLE_TO_SELECTED
LXe_QUERY_ERROR
ILxScriptQuery¶
-
class
ILxScriptQuery
¶ The ILxScriptQuery interface allows scripts and other clients to easily and generically access values from the internal systems.
Public Functions
-
LxResult
Select
(LXtObjectID self, const char *attribute, const char *which)¶ LXe_QUERY_UNKNOWN_SERVICE Unknown service, usually used by those looking up a script service by name.
LXe_QUERY_UNKNOWN_SERVICE Service exists, but does not have an ILxScriptQuery inteface, usually because the ScriptQuery() method of the service returned LXe_NOTIMPL.
LXe_QUERY_UNKNOWN_ATTRIBUTE The attribute being queried is not known by the service.
LXe_QUERY_MISMATCHED_TYPE The attribute expects a type that is different from the type in the ILxValueArray object.
LXe_QUERY_SELECT_FAILED Attempt to select an item failed, possibly because it doesn’t exist, is of the wrong type of the attribute, or the attribute doesn’t require a selection.
LXe_QUERY_NEED_SELECTION The attribute requires a selection to operation on.
LXe_QUERY_MISMATCHED_SELECTION Although something is selected, it doesn’t match the attribute being queried.
LXe_QUERY_NOT_APPLICABLE_TO_SELECTED The attribute is not applicable to the current selection, such as when the selected item does not have the property being queried.
LXe_QUERY_ERROR General error querying the selection. This selects what a query will obtain values for. The attribute is the class that we’re querying, which might be “command.username” for the name of a command; only the first part is looked at for the class, so “command” is fine. which is the thing we’re getting the data from. The which argument depends on the kind of attribute; for commands, it might be the name of the command to get information for.
-
LxResult
Query
(LXtObjectID self, const char *attribute, LXtObjectID query)¶ Once selected, we can query the selected item for it’s values by providing an attribute and an ILxValueArray object. For a list of all possible attributes, use NULL or an empty string for the attribute string. Note that both NULL and the empty string “” must be supported, as it can be difficult to provide NULL from a script.
-
LxResult
Type
(LXtObjectID self, const char *attribute, int *type)¶ The type (LXi_TYPE_*) of the attribute can be obtained with this method. The ILxValueArrayID passed to Query() must be of this type.
-
LxResult
TypeName
(LXtObjectID self, const char *attribute, const char **type)¶ The specific ExoType name can be read with this method.
-
bool
fromGlobal
(LXtObjectID obj)¶ User Class Only: The script query C++ user class has a method that allows it to init from any global. This is done by casting to the ILxValueService interface, which we know is defined, and calling the ScriptQuery() method. Any well-formed global will have this as their first method, but there is some danger here in casting.
-
LxResult
ILxStringTag¶
-
class
ILxStringTag
¶ Many object types support tags, which are an opened-ended list of strings indexed by numeric IDs. Tags can be accessed using this interface.
Public Functions
-
LxResult
Get
(LXtObjectID self, LXtID4 type, const char **tag)¶ The ID is an LXtID4, which can be generated with the LXxID4() macro. This method gets the tag string for an ID, or returns NOTFOUND if none.
-
LxResult
Set
(LXtObjectID self, LXtID4 type, const char *tag)¶ This sets the value of a tag, overwriting the one for the given ID. Passing null for the string pointer will clear the tag.
-
LxResult
Count
(LXtObjectID self, unsigned int *count)¶ This methods gets the total number of tags.
-
LxResult
ByIndex
(LXtObjectID self, unsigned int index, LXtID4 *type, const char **tag)¶ This method returns the type and value of a tag by index.
-
const char *
Value
(LXtID4 type)¶ User Class Only: User class method gets the string from the tag, or null if not found.
-
LxResult
-
LXiTAG_COMMENT
¶ Some very common tags are defined here.
LXiTAG_DESCRIPTION
LXiTAG_CUE
LXiTAG_LOCK
ILxMatrix¶
-
class
ILxMatrix
¶ Public Functions
-
LxResult
Get3
(LXtObjectID self, LXtMatrix mat3)¶ Matrices are one of the more common complex types, so we provide an interface (polymorphic with ILxValue-type objects) to access them more directly. These functions allow 3x3 and 4x4 transformation matrices to be read.
-
LxResult
Get4
(LXtObjectID self, LXtMatrix4 mat4)¶
-
LxResult
GetOffset
(LXtObjectID self, LXtVector offset)¶
-
LxResult
MultiplyVector
(LXtObjectID self, const LXtVector vector, LXtVector result)¶ As a convenience, this method composes a vector with the matrix.
-
LxResult
Set3
(LXtObjectID self, const LXtMatrix mat3)¶ Writable matrices have some operations to change them. First directly:
-
LxResult
Set4
(LXtObjectID self, const LXtMatrix4 mat4)¶
-
LxResult
SetOffset
(LXtObjectID self, const LXtVector offset)¶
-
LxResult
SetIdentity
(LXtObjectID self)¶ Then indirectly:
-
LxResult
Multiply3
(LXtObjectID self, const LXtMatrix mat3)¶
-
LxResult
Multiply4
(LXtObjectID self, const LXtMatrix4 mat4)¶
-
LxResult
Invert
(LXtObjectID self)¶
-
LxResult
Transpose
(LXtObjectID self)¶
-
LxResult
ILxQuaternion¶
-
class
ILxQuaternion
¶ Public Functions
-
LxResult
GetQuaternion
(LXtObjectID self, LXtQuaternion q)¶ Quaternions are often useful when working with rotations, however they are a rather complex data type, so we provide an interface (polymorphic ILxValue-type object) to access them more directly. These functions allow the quaternion to be read. Either as a direct quaternion, a 3x3 matrix, or as an angle + axis.
-
LxResult
GetMatrix
(LXtObjectID self, LXtMatrix mat3)¶
-
LxResult
GetAngleAxis
(LXtObjectID self, double *ang, LXtVector axis)¶
-
LxResult
SetQuaternion
(LXtObjectID self, const LXtQuaternion q)¶ Writable quaternions have some operations to change them.
-
LxResult
SetMatrix
(LXtObjectID self, const LXtMatrix mat3)¶
-
LxResult
SetAngleAxis
(LXtObjectID self, double ang, const LXtVector axis)¶
-
LxResult
ILxVisitor¶
-
class
ILxVisitor
¶ Public Functions
-
LxResult
Evaluate
(LXtObjectID self)¶ A visitor is a general-purpose object created by SDK clients when they want to perform some action from inside the app. The single Evaluate() method can be called for each element in a database, for example, or just when the client wants to do something in a specific context. If this method returns a value other than LXe_OK, the enumeration will stop and the enumerate method will return the result code.
-
LxResult
-
LXiTEXT_ENCODING_DEFAULT
¶ Text encoding converts text encoding of multi-bytes international between UTF-8 and other encodings.
LXiTEXT_ENCODING_DEFAULT System default encoding. UTF-8 is for Linux, one of others are for Windows and OSX and it is depended on the current locale setting.
LXiTEXT_ENCODING_ANSI ANSI character set for Latin.
LXiTEXT_ENCODING_UTF8 UTF8
LXiTEXT_ENCODING_SHIFTJIS Shift-JIS (Japanese)
LXiTEXT_ENCODING_EUCJP EUC-JP (Japanese)
LXiTEXT_ENCODING_EUCKR EUC-KR (Korea KS C 5601)
LXiTEXT_ENCODING_GB2312 GB2312 (Simplified Chinese)
LXiTEXT_ENCODING_BIG5 BIG5 (Traditonal Chinese)
LXiTEXT_ENCODING_ANSI
LXiTEXT_ENCODING_UTF8
LXiTEXT_ENCODING_SHIFTJIS
LXiTEXT_ENCODING_EUCJP
LXiTEXT_ENCODING_EUCKR
LXiTEXT_ENCODING_GB2312
LXiTEXT_ENCODING_BIG5
ILxTextEncoding¶
-
class
ILxTextEncoding
¶ Public Functions
-
unsigned
Default
(LXtObjectID self)¶ Default Return the system default text encoding. It returns UTF-8 for OSX and Linux and others for Windows.
Source Return the current text encoding for source text.
Target Return the current text encoding for source text.
SetSource Set a text encoding for source text. The initial source encoding is set by “Default” method.
SetTarget Set a text encoding for target text to convert to.
Convert Convert a string encoded by source to a given buffer with target encoding.
NumChar Returns the length of a string in logical characters. If ‘target’ is true, the string is handled by target encoding, otherwise source encoding is used.
PullChar Gets the first character’s numeric value in the current code page, and returns a pointer to the next character, or null if the the string was empty. If ‘target’ is true, the string is handled by target encoding, otherwise source encoding is used.
-
unsigned
Source
(LXtObjectID self)¶
-
unsigned
Target
(LXtObjectID self)¶
-
LxResult
SetSource
(LXtObjectID self, unsigned encoding)¶
-
LxResult
SetTarget
(LXtObjectID self, unsigned encoding)¶
-
LxResult
Convert
(LXtObjectID self, const char *src, char *buf, unsigned max)¶
-
int
NumChar
(LXtObjectID self, const char *string, int target)¶
-
const char *
PullChar
(LXtObjectID self, const char *string, int *code, int *len, int target)¶
-
bool
ConvertString
(const std::string &src, std::string &dst)¶ User Class Only:
-
unsigned
ILxTextEncodingService¶
-
class
ILxTextEncodingService
¶ Public Functions
-
LxResult
Allocate
(LXtObjectID self, void **ppvObj)¶
-
bool
NewTextEncoding
(CLxLoc_TextEncoding &txe)¶ User Class Only:
-
LxResult