keyword
stringclasses
7 values
repo_name
stringlengths
8
98
file_path
stringlengths
4
244
file_extension
stringclasses
29 values
file_size
int64
0
84.1M
line_count
int64
0
1.6M
content
stringlengths
1
84.1M
language
stringclasses
14 values
3D
mcellteam/mcell
libs/glm/ext/vector_uint2.hpp
.hpp
435
19
/// @ref core /// @file glm/ext/vector_uint2.hpp #pragma once #include "../detail/type_vec2.hpp" namespace glm { /// @addtogroup core_vector /// @{ /// 2 components vector of unsigned integer numbers. /// /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> typedef vec<2, unsigned int, defaultp> uvec2; /// @} }//namespace glm
Unknown
3D
mcellteam/mcell
libs/glm/ext/vector_float3_precision.hpp
.hpp
1,425
32
/// @ref core /// @file glm/ext/vector_float3_precision.hpp #pragma once #include "../detail/type_vec3.hpp" namespace glm { /// @addtogroup core_vector_precision /// @{ /// 3 components vector of high single-qualifier floating-point numbers. /// /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> typedef vec<3, float, highp> highp_vec3; /// 3 components vector of medium single-qualifier floating-point numbers. /// /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> typedef vec<3, float, mediump> mediump_vec3; /// 3 components vector of low single-qualifier floating-point numbers. /// /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> typedef vec<3, float, lowp> lowp_vec3; /// @} }//namespace glm
Unknown
3D
mcellteam/mcell
libs/glm/ext/vector_bool2_precision.hpp
.hpp
1,371
32
/// @ref core /// @file glm/ext/vector_bool2_precision.hpp #pragma once #include "../detail/type_vec2.hpp" namespace glm { /// @addtogroup core_vector_precision /// @{ /// 2 components vector of high qualifier bool numbers. /// /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> typedef vec<2, bool, highp> highp_bvec2; /// 2 components vector of medium qualifier bool numbers. /// /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> typedef vec<2, bool, mediump> mediump_bvec2; /// 2 components vector of low qualifier bool numbers. /// /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> typedef vec<2, bool, lowp> lowp_bvec2; /// @} }//namespace glm
Unknown
3D
mcellteam/mcell
libs/glm/ext/matrix_double3x2_precision.hpp
.hpp
1,621
32
/// @ref core /// @file glm/ext/matrix_double3x2_precision.hpp #pragma once #include "../detail/type_mat3x2.hpp" namespace glm { /// @addtogroup core_matrix_precision /// @{ /// 3 columns of 2 components matrix of double-precision floating-point numbers using low precision arithmetic in term of ULPs. /// /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> typedef mat<3, 2, double, lowp> lowp_dmat3x2; /// 3 columns of 2 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. /// /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> typedef mat<3, 2, double, mediump> mediump_dmat3x2; /// 3 columns of 2 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. /// /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> typedef mat<3, 2, double, highp> highp_dmat3x2; /// @} }//namespace glm
Unknown
3D
mcellteam/mcell
libs/glm/ext/quaternion_common.hpp
.hpp
4,152
121
/// @ref ext_quaternion_common /// @file glm/ext/quaternion_common.hpp /// /// @defgroup ext_quaternion_common GLM_EXT_quaternion_common /// @ingroup ext /// /// Provides common functions for quaternion types /// /// Include <glm/ext/quaternion_common.hpp> to use the features of this extension. /// /// @see ext_scalar_common /// @see ext_vector_common /// @see ext_quaternion_float /// @see ext_quaternion_double /// @see ext_quaternion_exponential /// @see ext_quaternion_geometric /// @see ext_quaternion_relational /// @see ext_quaternion_trigonometric /// @see ext_quaternion_transform #pragma once // Dependency: #include "../ext/scalar_constants.hpp" #include "../ext/quaternion_geometric.hpp" #include "../common.hpp" #include "../trigonometric.hpp" #include "../exponential.hpp" #include <limits> #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_EXT_quaternion_common extension included") #endif namespace glm { /// @addtogroup ext_quaternion_common /// @{ /// Spherical linear interpolation of two quaternions. /// The interpolation is oriented and the rotation is performed at constant speed. /// For short path spherical linear interpolation, use the slerp function. /// /// @param x A quaternion /// @param y A quaternion /// @param a Interpolation factor. The interpolation is defined beyond the range [0, 1]. /// /// @tparam T A floating-point scalar type /// @tparam Q A value from qualifier enum /// /// @see - slerp(qua<T, Q> const& x, qua<T, Q> const& y, T const& a) template<typename T, qualifier Q> GLM_FUNC_DECL qua<T, Q> mix(qua<T, Q> const& x, qua<T, Q> const& y, T a); /// Linear interpolation of two quaternions. /// The interpolation is oriented. /// /// @param x A quaternion /// @param y A quaternion /// @param a Interpolation factor. The interpolation is defined in the range [0, 1]. /// /// @tparam T A floating-point scalar type /// @tparam Q A value from qualifier enum template<typename T, qualifier Q> GLM_FUNC_DECL qua<T, Q> lerp(qua<T, Q> const& x, qua<T, Q> const& y, T a); /// Spherical linear interpolation of two quaternions. /// The interpolation always take the short path and the rotation is performed at constant speed. /// /// @param x A quaternion /// @param y A quaternion /// @param a Interpolation factor. The interpolation is defined beyond the range [0, 1]. /// /// @tparam T A floating-point scalar type /// @tparam Q A value from qualifier enum template<typename T, qualifier Q> GLM_FUNC_DECL qua<T, Q> slerp(qua<T, Q> const& x, qua<T, Q> const& y, T a); /// Returns the q conjugate. /// /// @tparam T A floating-point scalar type /// @tparam Q A value from qualifier enum template<typename T, qualifier Q> GLM_FUNC_DECL qua<T, Q> conjugate(qua<T, Q> const& q); /// Returns the q inverse. /// /// @tparam T A floating-point scalar type /// @tparam Q A value from qualifier enum template<typename T, qualifier Q> GLM_FUNC_DECL qua<T, Q> inverse(qua<T, Q> const& q); /// Returns true if x holds a NaN (not a number) /// representation in the underlying implementation's set of /// floating point representations. Returns false otherwise, /// including for implementations with no NaN /// representations. /// /// /!\ When using compiler fast math, this function may fail. /// /// @tparam T A floating-point scalar type /// @tparam Q A value from qualifier enum template<typename T, qualifier Q> GLM_FUNC_DECL vec<4, bool, Q> isnan(qua<T, Q> const& x); /// Returns true if x holds a positive infinity or negative /// infinity representation in the underlying implementation's /// set of floating point representations. Returns false /// otherwise, including for implementations with no infinity /// representations. /// /// @tparam T A floating-point scalar type /// @tparam Q A value from qualifier enum template<typename T, qualifier Q> GLM_FUNC_DECL vec<4, bool, Q> isinf(qua<T, Q> const& x); /// @} } //namespace glm #include "quaternion_common.inl"
Unknown
3D
mcellteam/mcell
libs/glm/ext/matrix_float4x2_precision.hpp
.hpp
1,613
32
/// @ref core /// @file glm/ext/matrix_float2x2_precision.hpp #pragma once #include "../detail/type_mat2x2.hpp" namespace glm { /// @addtogroup core_matrix_precision /// @{ /// 4 columns of 2 components matrix of single-precision floating-point numbers using low precision arithmetic in term of ULPs. /// /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> typedef mat<4, 2, float, lowp> lowp_mat4x2; /// 4 columns of 2 components matrix of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. /// /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> typedef mat<4, 2, float, mediump> mediump_mat4x2; /// 4 columns of 2 components matrix of single-precision floating-point numbers using high precision arithmetic in term of ULPs. /// /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> typedef mat<4, 2, float, highp> highp_mat4x2; /// @} }//namespace glm
Unknown
3D
mcellteam/mcell
libs/glm/ext/vector_relational.hpp
.hpp
4,561
105
/// @ref ext_vector_relational /// @file glm/ext/vector_relational.hpp /// /// @defgroup ext_vector_relational GLM_EXT_vector_relational /// @ingroup ext /// /// Exposes comparison functions for vector types that take a user defined epsilon values. /// /// Include <glm/ext/vector_relational.hpp> to use the features of this extension. /// /// @see core_vector_relational /// @see ext_scalar_relational /// @see ext_matrix_relational #pragma once // Dependencies #include "../detail/qualifier.hpp" #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_EXT_vector_relational extension included") #endif namespace glm { /// @addtogroup ext_vector_relational /// @{ /// Returns the component-wise comparison of |x - y| < epsilon. /// True if this expression is satisfied. /// /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector /// @tparam T Floating-point or integer scalar types /// @tparam Q Value from qualifier enum template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<L, bool, Q> equal(vec<L, T, Q> const& x, vec<L, T, Q> const& y, T epsilon); /// Returns the component-wise comparison of |x - y| < epsilon. /// True if this expression is satisfied. /// /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector /// @tparam T Floating-point or integer scalar types /// @tparam Q Value from qualifier enum template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<L, bool, Q> equal(vec<L, T, Q> const& x, vec<L, T, Q> const& y, vec<L, T, Q> const& epsilon); /// Returns the component-wise comparison of |x - y| >= epsilon. /// True if this expression is not satisfied. /// /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector /// @tparam T Floating-point or integer scalar types /// @tparam Q Value from qualifier enum template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<L, bool, Q> notEqual(vec<L, T, Q> const& x, vec<L, T, Q> const& y, T epsilon); /// Returns the component-wise comparison of |x - y| >= epsilon. /// True if this expression is not satisfied. /// /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector /// @tparam T Floating-point or integer scalar types /// @tparam Q Value from qualifier enum template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<L, bool, Q> notEqual(vec<L, T, Q> const& x, vec<L, T, Q> const& y, vec<L, T, Q> const& epsilon); /// Returns the component-wise comparison between two vectors in term of ULPs. /// True if this expression is satisfied. /// /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector /// @tparam T Floating-point /// @tparam Q Value from qualifier enum template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<L, bool, Q> equal(vec<L, T, Q> const& x, vec<L, T, Q> const& y, int ULPs); /// Returns the component-wise comparison between two vectors in term of ULPs. /// True if this expression is satisfied. /// /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector /// @tparam T Floating-point /// @tparam Q Value from qualifier enum template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<L, bool, Q> equal(vec<L, T, Q> const& x, vec<L, T, Q> const& y, vec<L, int, Q> const& ULPs); /// Returns the component-wise comparison between two vectors in term of ULPs. /// True if this expression is not satisfied. /// /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector /// @tparam T Floating-point /// @tparam Q Value from qualifier enum template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<L, bool, Q> notEqual(vec<L, T, Q> const& x, vec<L, T, Q> const& y, int ULPs); /// Returns the component-wise comparison between two vectors in term of ULPs. /// True if this expression is not satisfied. /// /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector /// @tparam T Floating-point /// @tparam Q Value from qualifier enum template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<L, bool, Q> notEqual(vec<L, T, Q> const& x, vec<L, T, Q> const& y, vec<L, int, Q> const& ULPs); /// @} }//namespace glm #include "vector_relational.inl"
Unknown
3D
mcellteam/mcell
libs/glm/ext/vector_ulp.hpp
.hpp
3,965
110
/// @ref ext_vector_ulp /// @file glm/ext/vector_ulp.hpp /// /// @defgroup ext_vector_ulp GLM_EXT_vector_ulp /// @ingroup ext /// /// Allow the measurement of the accuracy of a function against a reference /// implementation. This extension works on floating-point data and provide results /// in ULP. /// /// Include <glm/ext/vector_ulp.hpp> to use the features of this extension. /// /// @see ext_scalar_ulp /// @see ext_scalar_relational /// @see ext_vector_relational #pragma once // Dependencies #include "../ext/scalar_ulp.hpp" #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_EXT_vector_ulp extension included") #endif namespace glm { /// Return the next ULP value(s) after the input value(s). /// /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector /// @tparam T Floating-point /// @tparam Q Value from qualifier enum /// /// @see ext_scalar_ulp template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL vec<L, T, Q> next_float(vec<L, T, Q> const& x); /// Return the value(s) ULP distance after the input value(s). /// /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector /// @tparam T Floating-point /// @tparam Q Value from qualifier enum /// /// @see ext_scalar_ulp template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL vec<L, T, Q> next_float(vec<L, T, Q> const& x, int ULPs); /// Return the value(s) ULP distance after the input value(s). /// /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector /// @tparam T Floating-point /// @tparam Q Value from qualifier enum /// /// @see ext_scalar_ulp template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL vec<L, T, Q> next_float(vec<L, T, Q> const& x, vec<L, int, Q> const& ULPs); /// Return the previous ULP value(s) before the input value(s). /// /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector /// @tparam T Floating-point /// @tparam Q Value from qualifier enum /// /// @see ext_scalar_ulp template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL vec<L, T, Q> prev_float(vec<L, T, Q> const& x); /// Return the value(s) ULP distance before the input value(s). /// /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector /// @tparam T Floating-point /// @tparam Q Value from qualifier enum /// /// @see ext_scalar_ulp template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL vec<L, T, Q> prev_float(vec<L, T, Q> const& x, int ULPs); /// Return the value(s) ULP distance before the input value(s). /// /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector /// @tparam T Floating-point /// @tparam Q Value from qualifier enum /// /// @see ext_scalar_ulp template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL vec<L, T, Q> prev_float(vec<L, T, Q> const& x, vec<L, int, Q> const& ULPs); /// Return the distance in the number of ULP between 2 single-precision floating-point scalars. /// /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector /// @tparam Q Value from qualifier enum /// /// @see ext_scalar_ulp template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL vec<L, int, Q> float_distance(vec<L, float, Q> const& x, vec<L, float, Q> const& y); /// Return the distance in the number of ULP between 2 double-precision floating-point scalars. /// /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector /// @tparam Q Value from qualifier enum /// /// @see ext_scalar_ulp template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL vec<L, int64, Q> float_distance(vec<L, double, Q> const& x, vec<L, double, Q> const& y); /// @} }//namespace glm #include "vector_ulp.inl"
Unknown
3D
mcellteam/mcell
libs/glm/ext/quaternion_float_precision.hpp
.hpp
1,189
37
/// @ref ext_quaternion_float_precision /// @file glm/ext/quaternion_float_precision.hpp /// /// @defgroup ext_quaternion_float_precision GLM_EXT_quaternion_float_precision /// @ingroup ext /// /// Exposes single-precision floating point quaternion type with various precision in term of ULPs. /// /// Include <glm/ext/quaternion_float_precision.hpp> to use the features of this extension. #pragma once // Dependency: #include "../detail/type_quat.hpp" #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_EXT_quaternion_float_precision extension included") #endif namespace glm { /// @addtogroup ext_quaternion_float_precision /// @{ /// Quaternion of single-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef qua<float, lowp> lowp_quat; /// Quaternion of single-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef qua<float, mediump> mediump_quat; /// Quaternion of single-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef qua<float, highp> highp_quat; /// @} } //namespace glm
Unknown
3D
mcellteam/mcell
libs/glm/ext/matrix_float3x2.hpp
.hpp
460
19
/// @ref core /// @file glm/ext/matrix_float3x2.hpp #pragma once #include "../detail/type_mat3x2.hpp" namespace glm { /// @addtogroup core /// @{ /// 3 columns of 2 components matrix of single-precision floating-point numbers. /// /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> typedef mat<3, 2, float, defaultp> mat3x2; /// @} }//namespace glm
Unknown
3D
mcellteam/mcell
libs/glm/ext/matrix_float4x4.hpp
.hpp
733
24
/// @ref core /// @file glm/ext/matrix_float4x4.hpp #pragma once #include "../detail/type_mat4x4.hpp" namespace glm { /// @ingroup core_matrix /// @{ /// 4 columns of 4 components matrix of single-precision floating-point numbers. /// /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> typedef mat<4, 4, float, defaultp> mat4x4; /// 4 columns of 4 components matrix of single-precision floating-point numbers. /// /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a> typedef mat<4, 4, float, defaultp> mat4; /// @} }//namespace glm
Unknown
3D
mcellteam/mcell
libs/glm/detail/_swizzle.hpp
.hpp
49,213
805
#pragma once namespace glm{ namespace detail { // Internal class for implementing swizzle operators template<typename T, int N> struct _swizzle_base0 { protected: GLM_FUNC_QUALIFIER T& elem(size_t i){ return (reinterpret_cast<T*>(_buffer))[i]; } GLM_FUNC_QUALIFIER T const& elem(size_t i) const{ return (reinterpret_cast<const T*>(_buffer))[i]; } // Use an opaque buffer to *ensure* the compiler doesn't call a constructor. // The size 1 buffer is assumed to aligned to the actual members so that the // elem() char _buffer[1]; }; template<int N, typename T, qualifier Q, int E0, int E1, int E2, int E3, bool Aligned> struct _swizzle_base1 : public _swizzle_base0<T, N> { }; template<typename T, qualifier Q, int E0, int E1, bool Aligned> struct _swizzle_base1<2, T, Q, E0,E1,-1,-2, Aligned> : public _swizzle_base0<T, 2> { GLM_FUNC_QUALIFIER vec<2, T, Q> operator ()() const { return vec<2, T, Q>(this->elem(E0), this->elem(E1)); } }; template<typename T, qualifier Q, int E0, int E1, int E2, bool Aligned> struct _swizzle_base1<3, T, Q, E0,E1,E2,-1, Aligned> : public _swizzle_base0<T, 3> { GLM_FUNC_QUALIFIER vec<3, T, Q> operator ()() const { return vec<3, T, Q>(this->elem(E0), this->elem(E1), this->elem(E2)); } }; template<typename T, qualifier Q, int E0, int E1, int E2, int E3, bool Aligned> struct _swizzle_base1<4, T, Q, E0,E1,E2,E3, Aligned> : public _swizzle_base0<T, 4> { GLM_FUNC_QUALIFIER vec<4, T, Q> operator ()() const { return vec<4, T, Q>(this->elem(E0), this->elem(E1), this->elem(E2), this->elem(E3)); } }; // Internal class for implementing swizzle operators /* Template parameters: T = type of scalar values (e.g. float, double) N = number of components in the vector (e.g. 3) E0...3 = what index the n-th element of this swizzle refers to in the unswizzled vec DUPLICATE_ELEMENTS = 1 if there is a repeated element, 0 otherwise (used to specialize swizzles containing duplicate elements so that they cannot be used as r-values). */ template<int N, typename T, qualifier Q, int E0, int E1, int E2, int E3, int DUPLICATE_ELEMENTS> struct _swizzle_base2 : public _swizzle_base1<N, T, Q, E0,E1,E2,E3, detail::is_aligned<Q>::value> { struct op_equal { GLM_FUNC_QUALIFIER void operator() (T& e, T& t) const{ e = t; } }; struct op_minus { GLM_FUNC_QUALIFIER void operator() (T& e, T& t) const{ e -= t; } }; struct op_plus { GLM_FUNC_QUALIFIER void operator() (T& e, T& t) const{ e += t; } }; struct op_mul { GLM_FUNC_QUALIFIER void operator() (T& e, T& t) const{ e *= t; } }; struct op_div { GLM_FUNC_QUALIFIER void operator() (T& e, T& t) const{ e /= t; } }; public: GLM_FUNC_QUALIFIER _swizzle_base2& operator= (const T& t) { for (int i = 0; i < N; ++i) (*this)[i] = t; return *this; } GLM_FUNC_QUALIFIER _swizzle_base2& operator= (vec<N, T, Q> const& that) { _apply_op(that, op_equal()); return *this; } GLM_FUNC_QUALIFIER void operator -= (vec<N, T, Q> const& that) { _apply_op(that, op_minus()); } GLM_FUNC_QUALIFIER void operator += (vec<N, T, Q> const& that) { _apply_op(that, op_plus()); } GLM_FUNC_QUALIFIER void operator *= (vec<N, T, Q> const& that) { _apply_op(that, op_mul()); } GLM_FUNC_QUALIFIER void operator /= (vec<N, T, Q> const& that) { _apply_op(that, op_div()); } GLM_FUNC_QUALIFIER T& operator[](size_t i) { const int offset_dst[4] = { E0, E1, E2, E3 }; return this->elem(offset_dst[i]); } GLM_FUNC_QUALIFIER T operator[](size_t i) const { const int offset_dst[4] = { E0, E1, E2, E3 }; return this->elem(offset_dst[i]); } protected: template<typename U> GLM_FUNC_QUALIFIER void _apply_op(vec<N, T, Q> const& that, const U& op) { // Make a copy of the data in this == &that. // The copier should optimize out the copy in cases where the function is // properly inlined and the copy is not necessary. T t[N]; for (int i = 0; i < N; ++i) t[i] = that[i]; for (int i = 0; i < N; ++i) op( (*this)[i], t[i] ); } }; // Specialization for swizzles containing duplicate elements. These cannot be modified. template<int N, typename T, qualifier Q, int E0, int E1, int E2, int E3> struct _swizzle_base2<N, T, Q, E0,E1,E2,E3, 1> : public _swizzle_base1<N, T, Q, E0,E1,E2,E3, detail::is_aligned<Q>::value> { struct Stub {}; GLM_FUNC_QUALIFIER _swizzle_base2& operator= (Stub const&) { return *this; } GLM_FUNC_QUALIFIER T operator[] (size_t i) const { const int offset_dst[4] = { E0, E1, E2, E3 }; return this->elem(offset_dst[i]); } }; template<int N, typename T, qualifier Q, int E0, int E1, int E2, int E3> struct _swizzle : public _swizzle_base2<N, T, Q, E0, E1, E2, E3, (E0 == E1 || E0 == E2 || E0 == E3 || E1 == E2 || E1 == E3 || E2 == E3)> { typedef _swizzle_base2<N, T, Q, E0, E1, E2, E3, (E0 == E1 || E0 == E2 || E0 == E3 || E1 == E2 || E1 == E3 || E2 == E3)> base_type; using base_type::operator=; GLM_FUNC_QUALIFIER operator vec<N, T, Q> () const { return (*this)(); } }; // // To prevent the C++ syntax from getting entirely overwhelming, define some alias macros // #define GLM_SWIZZLE_TEMPLATE1 template<int N, typename T, qualifier Q, int E0, int E1, int E2, int E3> #define GLM_SWIZZLE_TEMPLATE2 template<int N, typename T, qualifier Q, int E0, int E1, int E2, int E3, int F0, int F1, int F2, int F3> #define GLM_SWIZZLE_TYPE1 _swizzle<N, T, Q, E0, E1, E2, E3> #define GLM_SWIZZLE_TYPE2 _swizzle<N, T, Q, F0, F1, F2, F3> // // Wrapper for a binary operator (e.g. u.yy + v.zy) // #define GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(OPERAND) \ GLM_SWIZZLE_TEMPLATE2 \ GLM_FUNC_QUALIFIER vec<N, T, Q> operator OPERAND ( const GLM_SWIZZLE_TYPE1& a, const GLM_SWIZZLE_TYPE2& b) \ { \ return a() OPERAND b(); \ } \ GLM_SWIZZLE_TEMPLATE1 \ GLM_FUNC_QUALIFIER vec<N, T, Q> operator OPERAND ( const GLM_SWIZZLE_TYPE1& a, const vec<N, T, Q>& b) \ { \ return a() OPERAND b; \ } \ GLM_SWIZZLE_TEMPLATE1 \ GLM_FUNC_QUALIFIER vec<N, T, Q> operator OPERAND ( const vec<N, T, Q>& a, const GLM_SWIZZLE_TYPE1& b) \ { \ return a OPERAND b(); \ } // // Wrapper for a operand between a swizzle and a binary (e.g. 1.0f - u.xyz) // #define GLM_SWIZZLE_SCALAR_BINARY_OPERATOR_IMPLEMENTATION(OPERAND) \ GLM_SWIZZLE_TEMPLATE1 \ GLM_FUNC_QUALIFIER vec<N, T, Q> operator OPERAND ( const GLM_SWIZZLE_TYPE1& a, const T& b) \ { \ return a() OPERAND b; \ } \ GLM_SWIZZLE_TEMPLATE1 \ GLM_FUNC_QUALIFIER vec<N, T, Q> operator OPERAND ( const T& a, const GLM_SWIZZLE_TYPE1& b) \ { \ return a OPERAND b(); \ } // // Macro for wrapping a function taking one argument (e.g. abs()) // #define GLM_SWIZZLE_FUNCTION_1_ARGS(RETURN_TYPE,FUNCTION) \ GLM_SWIZZLE_TEMPLATE1 \ GLM_FUNC_QUALIFIER typename GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const GLM_SWIZZLE_TYPE1& a) \ { \ return FUNCTION(a()); \ } // // Macro for wrapping a function taking two vector arguments (e.g. dot()). // #define GLM_SWIZZLE_FUNCTION_2_ARGS(RETURN_TYPE,FUNCTION) \ GLM_SWIZZLE_TEMPLATE2 \ GLM_FUNC_QUALIFIER typename GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const GLM_SWIZZLE_TYPE1& a, const GLM_SWIZZLE_TYPE2& b) \ { \ return FUNCTION(a(), b()); \ } \ GLM_SWIZZLE_TEMPLATE1 \ GLM_FUNC_QUALIFIER typename GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const GLM_SWIZZLE_TYPE1& a, const GLM_SWIZZLE_TYPE1& b) \ { \ return FUNCTION(a(), b()); \ } \ GLM_SWIZZLE_TEMPLATE1 \ GLM_FUNC_QUALIFIER typename GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const GLM_SWIZZLE_TYPE1& a, const typename V& b) \ { \ return FUNCTION(a(), b); \ } \ GLM_SWIZZLE_TEMPLATE1 \ GLM_FUNC_QUALIFIER typename GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const V& a, const GLM_SWIZZLE_TYPE1& b) \ { \ return FUNCTION(a, b()); \ } // // Macro for wrapping a function take 2 vec arguments followed by a scalar (e.g. mix()). // #define GLM_SWIZZLE_FUNCTION_2_ARGS_SCALAR(RETURN_TYPE,FUNCTION) \ GLM_SWIZZLE_TEMPLATE2 \ GLM_FUNC_QUALIFIER typename GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const GLM_SWIZZLE_TYPE1& a, const GLM_SWIZZLE_TYPE2& b, const T& c) \ { \ return FUNCTION(a(), b(), c); \ } \ GLM_SWIZZLE_TEMPLATE1 \ GLM_FUNC_QUALIFIER typename GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const GLM_SWIZZLE_TYPE1& a, const GLM_SWIZZLE_TYPE1& b, const T& c) \ { \ return FUNCTION(a(), b(), c); \ } \ GLM_SWIZZLE_TEMPLATE1 \ GLM_FUNC_QUALIFIER typename GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const GLM_SWIZZLE_TYPE1& a, const typename S0::vec_type& b, const T& c)\ { \ return FUNCTION(a(), b, c); \ } \ GLM_SWIZZLE_TEMPLATE1 \ GLM_FUNC_QUALIFIER typename GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const typename V& a, const GLM_SWIZZLE_TYPE1& b, const T& c) \ { \ return FUNCTION(a, b(), c); \ } }//namespace detail }//namespace glm namespace glm { namespace detail { GLM_SWIZZLE_SCALAR_BINARY_OPERATOR_IMPLEMENTATION(-) GLM_SWIZZLE_SCALAR_BINARY_OPERATOR_IMPLEMENTATION(*) GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(+) GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(-) GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(*) GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(/) } // // Swizzles are distinct types from the unswizzled type. The below macros will // provide template specializations for the swizzle types for the given functions // so that the compiler does not have any ambiguity to choosing how to handle // the function. // // The alternative is to use the operator()() when calling the function in order // to explicitly convert the swizzled type to the unswizzled type. // //GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, abs); //GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, acos); //GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, acosh); //GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, all); //GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, any); //GLM_SWIZZLE_FUNCTION_2_ARGS(value_type, dot); //GLM_SWIZZLE_FUNCTION_2_ARGS(vec_type, cross); //GLM_SWIZZLE_FUNCTION_2_ARGS(vec_type, step); //GLM_SWIZZLE_FUNCTION_2_ARGS_SCALAR(vec_type, mix); } #define GLM_SWIZZLE2_2_MEMBERS(T, Q, E0,E1) \ struct { detail::_swizzle<2, T, Q, 0,0,-1,-2> E0 ## E0; }; \ struct { detail::_swizzle<2, T, Q, 0,1,-1,-2> E0 ## E1; }; \ struct { detail::_swizzle<2, T, Q, 1,0,-1,-2> E1 ## E0; }; \ struct { detail::_swizzle<2, T, Q, 1,1,-1,-2> E1 ## E1; }; #define GLM_SWIZZLE2_3_MEMBERS(T, Q, E0,E1) \ struct { detail::_swizzle<3,T, Q, 0,0,0,-1> E0 ## E0 ## E0; }; \ struct { detail::_swizzle<3,T, Q, 0,0,1,-1> E0 ## E0 ## E1; }; \ struct { detail::_swizzle<3,T, Q, 0,1,0,-1> E0 ## E1 ## E0; }; \ struct { detail::_swizzle<3,T, Q, 0,1,1,-1> E0 ## E1 ## E1; }; \ struct { detail::_swizzle<3,T, Q, 1,0,0,-1> E1 ## E0 ## E0; }; \ struct { detail::_swizzle<3,T, Q, 1,0,1,-1> E1 ## E0 ## E1; }; \ struct { detail::_swizzle<3,T, Q, 1,1,0,-1> E1 ## E1 ## E0; }; \ struct { detail::_swizzle<3,T, Q, 1,1,1,-1> E1 ## E1 ## E1; }; #define GLM_SWIZZLE2_4_MEMBERS(T, Q, E0,E1) \ struct { detail::_swizzle<4,T, Q, 0,0,0,0> E0 ## E0 ## E0 ## E0; }; \ struct { detail::_swizzle<4,T, Q, 0,0,0,1> E0 ## E0 ## E0 ## E1; }; \ struct { detail::_swizzle<4,T, Q, 0,0,1,0> E0 ## E0 ## E1 ## E0; }; \ struct { detail::_swizzle<4,T, Q, 0,0,1,1> E0 ## E0 ## E1 ## E1; }; \ struct { detail::_swizzle<4,T, Q, 0,1,0,0> E0 ## E1 ## E0 ## E0; }; \ struct { detail::_swizzle<4,T, Q, 0,1,0,1> E0 ## E1 ## E0 ## E1; }; \ struct { detail::_swizzle<4,T, Q, 0,1,1,0> E0 ## E1 ## E1 ## E0; }; \ struct { detail::_swizzle<4,T, Q, 0,1,1,1> E0 ## E1 ## E1 ## E1; }; \ struct { detail::_swizzle<4,T, Q, 1,0,0,0> E1 ## E0 ## E0 ## E0; }; \ struct { detail::_swizzle<4,T, Q, 1,0,0,1> E1 ## E0 ## E0 ## E1; }; \ struct { detail::_swizzle<4,T, Q, 1,0,1,0> E1 ## E0 ## E1 ## E0; }; \ struct { detail::_swizzle<4,T, Q, 1,0,1,1> E1 ## E0 ## E1 ## E1; }; \ struct { detail::_swizzle<4,T, Q, 1,1,0,0> E1 ## E1 ## E0 ## E0; }; \ struct { detail::_swizzle<4,T, Q, 1,1,0,1> E1 ## E1 ## E0 ## E1; }; \ struct { detail::_swizzle<4,T, Q, 1,1,1,0> E1 ## E1 ## E1 ## E0; }; \ struct { detail::_swizzle<4,T, Q, 1,1,1,1> E1 ## E1 ## E1 ## E1; }; #define GLM_SWIZZLE3_2_MEMBERS(T, Q, E0,E1,E2) \ struct { detail::_swizzle<2,T, Q, 0,0,-1,-2> E0 ## E0; }; \ struct { detail::_swizzle<2,T, Q, 0,1,-1,-2> E0 ## E1; }; \ struct { detail::_swizzle<2,T, Q, 0,2,-1,-2> E0 ## E2; }; \ struct { detail::_swizzle<2,T, Q, 1,0,-1,-2> E1 ## E0; }; \ struct { detail::_swizzle<2,T, Q, 1,1,-1,-2> E1 ## E1; }; \ struct { detail::_swizzle<2,T, Q, 1,2,-1,-2> E1 ## E2; }; \ struct { detail::_swizzle<2,T, Q, 2,0,-1,-2> E2 ## E0; }; \ struct { detail::_swizzle<2,T, Q, 2,1,-1,-2> E2 ## E1; }; \ struct { detail::_swizzle<2,T, Q, 2,2,-1,-2> E2 ## E2; }; #define GLM_SWIZZLE3_3_MEMBERS(T, Q ,E0,E1,E2) \ struct { detail::_swizzle<3, T, Q, 0,0,0,-1> E0 ## E0 ## E0; }; \ struct { detail::_swizzle<3, T, Q, 0,0,1,-1> E0 ## E0 ## E1; }; \ struct { detail::_swizzle<3, T, Q, 0,0,2,-1> E0 ## E0 ## E2; }; \ struct { detail::_swizzle<3, T, Q, 0,1,0,-1> E0 ## E1 ## E0; }; \ struct { detail::_swizzle<3, T, Q, 0,1,1,-1> E0 ## E1 ## E1; }; \ struct { detail::_swizzle<3, T, Q, 0,1,2,-1> E0 ## E1 ## E2; }; \ struct { detail::_swizzle<3, T, Q, 0,2,0,-1> E0 ## E2 ## E0; }; \ struct { detail::_swizzle<3, T, Q, 0,2,1,-1> E0 ## E2 ## E1; }; \ struct { detail::_swizzle<3, T, Q, 0,2,2,-1> E0 ## E2 ## E2; }; \ struct { detail::_swizzle<3, T, Q, 1,0,0,-1> E1 ## E0 ## E0; }; \ struct { detail::_swizzle<3, T, Q, 1,0,1,-1> E1 ## E0 ## E1; }; \ struct { detail::_swizzle<3, T, Q, 1,0,2,-1> E1 ## E0 ## E2; }; \ struct { detail::_swizzle<3, T, Q, 1,1,0,-1> E1 ## E1 ## E0; }; \ struct { detail::_swizzle<3, T, Q, 1,1,1,-1> E1 ## E1 ## E1; }; \ struct { detail::_swizzle<3, T, Q, 1,1,2,-1> E1 ## E1 ## E2; }; \ struct { detail::_swizzle<3, T, Q, 1,2,0,-1> E1 ## E2 ## E0; }; \ struct { detail::_swizzle<3, T, Q, 1,2,1,-1> E1 ## E2 ## E1; }; \ struct { detail::_swizzle<3, T, Q, 1,2,2,-1> E1 ## E2 ## E2; }; \ struct { detail::_swizzle<3, T, Q, 2,0,0,-1> E2 ## E0 ## E0; }; \ struct { detail::_swizzle<3, T, Q, 2,0,1,-1> E2 ## E0 ## E1; }; \ struct { detail::_swizzle<3, T, Q, 2,0,2,-1> E2 ## E0 ## E2; }; \ struct { detail::_swizzle<3, T, Q, 2,1,0,-1> E2 ## E1 ## E0; }; \ struct { detail::_swizzle<3, T, Q, 2,1,1,-1> E2 ## E1 ## E1; }; \ struct { detail::_swizzle<3, T, Q, 2,1,2,-1> E2 ## E1 ## E2; }; \ struct { detail::_swizzle<3, T, Q, 2,2,0,-1> E2 ## E2 ## E0; }; \ struct { detail::_swizzle<3, T, Q, 2,2,1,-1> E2 ## E2 ## E1; }; \ struct { detail::_swizzle<3, T, Q, 2,2,2,-1> E2 ## E2 ## E2; }; #define GLM_SWIZZLE3_4_MEMBERS(T, Q, E0,E1,E2) \ struct { detail::_swizzle<4,T, Q, 0,0,0,0> E0 ## E0 ## E0 ## E0; }; \ struct { detail::_swizzle<4,T, Q, 0,0,0,1> E0 ## E0 ## E0 ## E1; }; \ struct { detail::_swizzle<4,T, Q, 0,0,0,2> E0 ## E0 ## E0 ## E2; }; \ struct { detail::_swizzle<4,T, Q, 0,0,1,0> E0 ## E0 ## E1 ## E0; }; \ struct { detail::_swizzle<4,T, Q, 0,0,1,1> E0 ## E0 ## E1 ## E1; }; \ struct { detail::_swizzle<4,T, Q, 0,0,1,2> E0 ## E0 ## E1 ## E2; }; \ struct { detail::_swizzle<4,T, Q, 0,0,2,0> E0 ## E0 ## E2 ## E0; }; \ struct { detail::_swizzle<4,T, Q, 0,0,2,1> E0 ## E0 ## E2 ## E1; }; \ struct { detail::_swizzle<4,T, Q, 0,0,2,2> E0 ## E0 ## E2 ## E2; }; \ struct { detail::_swizzle<4,T, Q, 0,1,0,0> E0 ## E1 ## E0 ## E0; }; \ struct { detail::_swizzle<4,T, Q, 0,1,0,1> E0 ## E1 ## E0 ## E1; }; \ struct { detail::_swizzle<4,T, Q, 0,1,0,2> E0 ## E1 ## E0 ## E2; }; \ struct { detail::_swizzle<4,T, Q, 0,1,1,0> E0 ## E1 ## E1 ## E0; }; \ struct { detail::_swizzle<4,T, Q, 0,1,1,1> E0 ## E1 ## E1 ## E1; }; \ struct { detail::_swizzle<4,T, Q, 0,1,1,2> E0 ## E1 ## E1 ## E2; }; \ struct { detail::_swizzle<4,T, Q, 0,1,2,0> E0 ## E1 ## E2 ## E0; }; \ struct { detail::_swizzle<4,T, Q, 0,1,2,1> E0 ## E1 ## E2 ## E1; }; \ struct { detail::_swizzle<4,T, Q, 0,1,2,2> E0 ## E1 ## E2 ## E2; }; \ struct { detail::_swizzle<4,T, Q, 0,2,0,0> E0 ## E2 ## E0 ## E0; }; \ struct { detail::_swizzle<4,T, Q, 0,2,0,1> E0 ## E2 ## E0 ## E1; }; \ struct { detail::_swizzle<4,T, Q, 0,2,0,2> E0 ## E2 ## E0 ## E2; }; \ struct { detail::_swizzle<4,T, Q, 0,2,1,0> E0 ## E2 ## E1 ## E0; }; \ struct { detail::_swizzle<4,T, Q, 0,2,1,1> E0 ## E2 ## E1 ## E1; }; \ struct { detail::_swizzle<4,T, Q, 0,2,1,2> E0 ## E2 ## E1 ## E2; }; \ struct { detail::_swizzle<4,T, Q, 0,2,2,0> E0 ## E2 ## E2 ## E0; }; \ struct { detail::_swizzle<4,T, Q, 0,2,2,1> E0 ## E2 ## E2 ## E1; }; \ struct { detail::_swizzle<4,T, Q, 0,2,2,2> E0 ## E2 ## E2 ## E2; }; \ struct { detail::_swizzle<4,T, Q, 1,0,0,0> E1 ## E0 ## E0 ## E0; }; \ struct { detail::_swizzle<4,T, Q, 1,0,0,1> E1 ## E0 ## E0 ## E1; }; \ struct { detail::_swizzle<4,T, Q, 1,0,0,2> E1 ## E0 ## E0 ## E2; }; \ struct { detail::_swizzle<4,T, Q, 1,0,1,0> E1 ## E0 ## E1 ## E0; }; \ struct { detail::_swizzle<4,T, Q, 1,0,1,1> E1 ## E0 ## E1 ## E1; }; \ struct { detail::_swizzle<4,T, Q, 1,0,1,2> E1 ## E0 ## E1 ## E2; }; \ struct { detail::_swizzle<4,T, Q, 1,0,2,0> E1 ## E0 ## E2 ## E0; }; \ struct { detail::_swizzle<4,T, Q, 1,0,2,1> E1 ## E0 ## E2 ## E1; }; \ struct { detail::_swizzle<4,T, Q, 1,0,2,2> E1 ## E0 ## E2 ## E2; }; \ struct { detail::_swizzle<4,T, Q, 1,1,0,0> E1 ## E1 ## E0 ## E0; }; \ struct { detail::_swizzle<4,T, Q, 1,1,0,1> E1 ## E1 ## E0 ## E1; }; \ struct { detail::_swizzle<4,T, Q, 1,1,0,2> E1 ## E1 ## E0 ## E2; }; \ struct { detail::_swizzle<4,T, Q, 1,1,1,0> E1 ## E1 ## E1 ## E0; }; \ struct { detail::_swizzle<4,T, Q, 1,1,1,1> E1 ## E1 ## E1 ## E1; }; \ struct { detail::_swizzle<4,T, Q, 1,1,1,2> E1 ## E1 ## E1 ## E2; }; \ struct { detail::_swizzle<4,T, Q, 1,1,2,0> E1 ## E1 ## E2 ## E0; }; \ struct { detail::_swizzle<4,T, Q, 1,1,2,1> E1 ## E1 ## E2 ## E1; }; \ struct { detail::_swizzle<4,T, Q, 1,1,2,2> E1 ## E1 ## E2 ## E2; }; \ struct { detail::_swizzle<4,T, Q, 1,2,0,0> E1 ## E2 ## E0 ## E0; }; \ struct { detail::_swizzle<4,T, Q, 1,2,0,1> E1 ## E2 ## E0 ## E1; }; \ struct { detail::_swizzle<4,T, Q, 1,2,0,2> E1 ## E2 ## E0 ## E2; }; \ struct { detail::_swizzle<4,T, Q, 1,2,1,0> E1 ## E2 ## E1 ## E0; }; \ struct { detail::_swizzle<4,T, Q, 1,2,1,1> E1 ## E2 ## E1 ## E1; }; \ struct { detail::_swizzle<4,T, Q, 1,2,1,2> E1 ## E2 ## E1 ## E2; }; \ struct { detail::_swizzle<4,T, Q, 1,2,2,0> E1 ## E2 ## E2 ## E0; }; \ struct { detail::_swizzle<4,T, Q, 1,2,2,1> E1 ## E2 ## E2 ## E1; }; \ struct { detail::_swizzle<4,T, Q, 1,2,2,2> E1 ## E2 ## E2 ## E2; }; \ struct { detail::_swizzle<4,T, Q, 2,0,0,0> E2 ## E0 ## E0 ## E0; }; \ struct { detail::_swizzle<4,T, Q, 2,0,0,1> E2 ## E0 ## E0 ## E1; }; \ struct { detail::_swizzle<4,T, Q, 2,0,0,2> E2 ## E0 ## E0 ## E2; }; \ struct { detail::_swizzle<4,T, Q, 2,0,1,0> E2 ## E0 ## E1 ## E0; }; \ struct { detail::_swizzle<4,T, Q, 2,0,1,1> E2 ## E0 ## E1 ## E1; }; \ struct { detail::_swizzle<4,T, Q, 2,0,1,2> E2 ## E0 ## E1 ## E2; }; \ struct { detail::_swizzle<4,T, Q, 2,0,2,0> E2 ## E0 ## E2 ## E0; }; \ struct { detail::_swizzle<4,T, Q, 2,0,2,1> E2 ## E0 ## E2 ## E1; }; \ struct { detail::_swizzle<4,T, Q, 2,0,2,2> E2 ## E0 ## E2 ## E2; }; \ struct { detail::_swizzle<4,T, Q, 2,1,0,0> E2 ## E1 ## E0 ## E0; }; \ struct { detail::_swizzle<4,T, Q, 2,1,0,1> E2 ## E1 ## E0 ## E1; }; \ struct { detail::_swizzle<4,T, Q, 2,1,0,2> E2 ## E1 ## E0 ## E2; }; \ struct { detail::_swizzle<4,T, Q, 2,1,1,0> E2 ## E1 ## E1 ## E0; }; \ struct { detail::_swizzle<4,T, Q, 2,1,1,1> E2 ## E1 ## E1 ## E1; }; \ struct { detail::_swizzle<4,T, Q, 2,1,1,2> E2 ## E1 ## E1 ## E2; }; \ struct { detail::_swizzle<4,T, Q, 2,1,2,0> E2 ## E1 ## E2 ## E0; }; \ struct { detail::_swizzle<4,T, Q, 2,1,2,1> E2 ## E1 ## E2 ## E1; }; \ struct { detail::_swizzle<4,T, Q, 2,1,2,2> E2 ## E1 ## E2 ## E2; }; \ struct { detail::_swizzle<4,T, Q, 2,2,0,0> E2 ## E2 ## E0 ## E0; }; \ struct { detail::_swizzle<4,T, Q, 2,2,0,1> E2 ## E2 ## E0 ## E1; }; \ struct { detail::_swizzle<4,T, Q, 2,2,0,2> E2 ## E2 ## E0 ## E2; }; \ struct { detail::_swizzle<4,T, Q, 2,2,1,0> E2 ## E2 ## E1 ## E0; }; \ struct { detail::_swizzle<4,T, Q, 2,2,1,1> E2 ## E2 ## E1 ## E1; }; \ struct { detail::_swizzle<4,T, Q, 2,2,1,2> E2 ## E2 ## E1 ## E2; }; \ struct { detail::_swizzle<4,T, Q, 2,2,2,0> E2 ## E2 ## E2 ## E0; }; \ struct { detail::_swizzle<4,T, Q, 2,2,2,1> E2 ## E2 ## E2 ## E1; }; \ struct { detail::_swizzle<4,T, Q, 2,2,2,2> E2 ## E2 ## E2 ## E2; }; #define GLM_SWIZZLE4_2_MEMBERS(T, Q, E0,E1,E2,E3) \ struct { detail::_swizzle<2,T, Q, 0,0,-1,-2> E0 ## E0; }; \ struct { detail::_swizzle<2,T, Q, 0,1,-1,-2> E0 ## E1; }; \ struct { detail::_swizzle<2,T, Q, 0,2,-1,-2> E0 ## E2; }; \ struct { detail::_swizzle<2,T, Q, 0,3,-1,-2> E0 ## E3; }; \ struct { detail::_swizzle<2,T, Q, 1,0,-1,-2> E1 ## E0; }; \ struct { detail::_swizzle<2,T, Q, 1,1,-1,-2> E1 ## E1; }; \ struct { detail::_swizzle<2,T, Q, 1,2,-1,-2> E1 ## E2; }; \ struct { detail::_swizzle<2,T, Q, 1,3,-1,-2> E1 ## E3; }; \ struct { detail::_swizzle<2,T, Q, 2,0,-1,-2> E2 ## E0; }; \ struct { detail::_swizzle<2,T, Q, 2,1,-1,-2> E2 ## E1; }; \ struct { detail::_swizzle<2,T, Q, 2,2,-1,-2> E2 ## E2; }; \ struct { detail::_swizzle<2,T, Q, 2,3,-1,-2> E2 ## E3; }; \ struct { detail::_swizzle<2,T, Q, 3,0,-1,-2> E3 ## E0; }; \ struct { detail::_swizzle<2,T, Q, 3,1,-1,-2> E3 ## E1; }; \ struct { detail::_swizzle<2,T, Q, 3,2,-1,-2> E3 ## E2; }; \ struct { detail::_swizzle<2,T, Q, 3,3,-1,-2> E3 ## E3; }; #define GLM_SWIZZLE4_3_MEMBERS(T, Q, E0,E1,E2,E3) \ struct { detail::_swizzle<3, T, Q, 0,0,0,-1> E0 ## E0 ## E0; }; \ struct { detail::_swizzle<3, T, Q, 0,0,1,-1> E0 ## E0 ## E1; }; \ struct { detail::_swizzle<3, T, Q, 0,0,2,-1> E0 ## E0 ## E2; }; \ struct { detail::_swizzle<3, T, Q, 0,0,3,-1> E0 ## E0 ## E3; }; \ struct { detail::_swizzle<3, T, Q, 0,1,0,-1> E0 ## E1 ## E0; }; \ struct { detail::_swizzle<3, T, Q, 0,1,1,-1> E0 ## E1 ## E1; }; \ struct { detail::_swizzle<3, T, Q, 0,1,2,-1> E0 ## E1 ## E2; }; \ struct { detail::_swizzle<3, T, Q, 0,1,3,-1> E0 ## E1 ## E3; }; \ struct { detail::_swizzle<3, T, Q, 0,2,0,-1> E0 ## E2 ## E0; }; \ struct { detail::_swizzle<3, T, Q, 0,2,1,-1> E0 ## E2 ## E1; }; \ struct { detail::_swizzle<3, T, Q, 0,2,2,-1> E0 ## E2 ## E2; }; \ struct { detail::_swizzle<3, T, Q, 0,2,3,-1> E0 ## E2 ## E3; }; \ struct { detail::_swizzle<3, T, Q, 0,3,0,-1> E0 ## E3 ## E0; }; \ struct { detail::_swizzle<3, T, Q, 0,3,1,-1> E0 ## E3 ## E1; }; \ struct { detail::_swizzle<3, T, Q, 0,3,2,-1> E0 ## E3 ## E2; }; \ struct { detail::_swizzle<3, T, Q, 0,3,3,-1> E0 ## E3 ## E3; }; \ struct { detail::_swizzle<3, T, Q, 1,0,0,-1> E1 ## E0 ## E0; }; \ struct { detail::_swizzle<3, T, Q, 1,0,1,-1> E1 ## E0 ## E1; }; \ struct { detail::_swizzle<3, T, Q, 1,0,2,-1> E1 ## E0 ## E2; }; \ struct { detail::_swizzle<3, T, Q, 1,0,3,-1> E1 ## E0 ## E3; }; \ struct { detail::_swizzle<3, T, Q, 1,1,0,-1> E1 ## E1 ## E0; }; \ struct { detail::_swizzle<3, T, Q, 1,1,1,-1> E1 ## E1 ## E1; }; \ struct { detail::_swizzle<3, T, Q, 1,1,2,-1> E1 ## E1 ## E2; }; \ struct { detail::_swizzle<3, T, Q, 1,1,3,-1> E1 ## E1 ## E3; }; \ struct { detail::_swizzle<3, T, Q, 1,2,0,-1> E1 ## E2 ## E0; }; \ struct { detail::_swizzle<3, T, Q, 1,2,1,-1> E1 ## E2 ## E1; }; \ struct { detail::_swizzle<3, T, Q, 1,2,2,-1> E1 ## E2 ## E2; }; \ struct { detail::_swizzle<3, T, Q, 1,2,3,-1> E1 ## E2 ## E3; }; \ struct { detail::_swizzle<3, T, Q, 1,3,0,-1> E1 ## E3 ## E0; }; \ struct { detail::_swizzle<3, T, Q, 1,3,1,-1> E1 ## E3 ## E1; }; \ struct { detail::_swizzle<3, T, Q, 1,3,2,-1> E1 ## E3 ## E2; }; \ struct { detail::_swizzle<3, T, Q, 1,3,3,-1> E1 ## E3 ## E3; }; \ struct { detail::_swizzle<3, T, Q, 2,0,0,-1> E2 ## E0 ## E0; }; \ struct { detail::_swizzle<3, T, Q, 2,0,1,-1> E2 ## E0 ## E1; }; \ struct { detail::_swizzle<3, T, Q, 2,0,2,-1> E2 ## E0 ## E2; }; \ struct { detail::_swizzle<3, T, Q, 2,0,3,-1> E2 ## E0 ## E3; }; \ struct { detail::_swizzle<3, T, Q, 2,1,0,-1> E2 ## E1 ## E0; }; \ struct { detail::_swizzle<3, T, Q, 2,1,1,-1> E2 ## E1 ## E1; }; \ struct { detail::_swizzle<3, T, Q, 2,1,2,-1> E2 ## E1 ## E2; }; \ struct { detail::_swizzle<3, T, Q, 2,1,3,-1> E2 ## E1 ## E3; }; \ struct { detail::_swizzle<3, T, Q, 2,2,0,-1> E2 ## E2 ## E0; }; \ struct { detail::_swizzle<3, T, Q, 2,2,1,-1> E2 ## E2 ## E1; }; \ struct { detail::_swizzle<3, T, Q, 2,2,2,-1> E2 ## E2 ## E2; }; \ struct { detail::_swizzle<3, T, Q, 2,2,3,-1> E2 ## E2 ## E3; }; \ struct { detail::_swizzle<3, T, Q, 2,3,0,-1> E2 ## E3 ## E0; }; \ struct { detail::_swizzle<3, T, Q, 2,3,1,-1> E2 ## E3 ## E1; }; \ struct { detail::_swizzle<3, T, Q, 2,3,2,-1> E2 ## E3 ## E2; }; \ struct { detail::_swizzle<3, T, Q, 2,3,3,-1> E2 ## E3 ## E3; }; \ struct { detail::_swizzle<3, T, Q, 3,0,0,-1> E3 ## E0 ## E0; }; \ struct { detail::_swizzle<3, T, Q, 3,0,1,-1> E3 ## E0 ## E1; }; \ struct { detail::_swizzle<3, T, Q, 3,0,2,-1> E3 ## E0 ## E2; }; \ struct { detail::_swizzle<3, T, Q, 3,0,3,-1> E3 ## E0 ## E3; }; \ struct { detail::_swizzle<3, T, Q, 3,1,0,-1> E3 ## E1 ## E0; }; \ struct { detail::_swizzle<3, T, Q, 3,1,1,-1> E3 ## E1 ## E1; }; \ struct { detail::_swizzle<3, T, Q, 3,1,2,-1> E3 ## E1 ## E2; }; \ struct { detail::_swizzle<3, T, Q, 3,1,3,-1> E3 ## E1 ## E3; }; \ struct { detail::_swizzle<3, T, Q, 3,2,0,-1> E3 ## E2 ## E0; }; \ struct { detail::_swizzle<3, T, Q, 3,2,1,-1> E3 ## E2 ## E1; }; \ struct { detail::_swizzle<3, T, Q, 3,2,2,-1> E3 ## E2 ## E2; }; \ struct { detail::_swizzle<3, T, Q, 3,2,3,-1> E3 ## E2 ## E3; }; \ struct { detail::_swizzle<3, T, Q, 3,3,0,-1> E3 ## E3 ## E0; }; \ struct { detail::_swizzle<3, T, Q, 3,3,1,-1> E3 ## E3 ## E1; }; \ struct { detail::_swizzle<3, T, Q, 3,3,2,-1> E3 ## E3 ## E2; }; \ struct { detail::_swizzle<3, T, Q, 3,3,3,-1> E3 ## E3 ## E3; }; #define GLM_SWIZZLE4_4_MEMBERS(T, Q, E0,E1,E2,E3) \ struct { detail::_swizzle<4, T, Q, 0,0,0,0> E0 ## E0 ## E0 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 0,0,0,1> E0 ## E0 ## E0 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 0,0,0,2> E0 ## E0 ## E0 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 0,0,0,3> E0 ## E0 ## E0 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 0,0,1,0> E0 ## E0 ## E1 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 0,0,1,1> E0 ## E0 ## E1 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 0,0,1,2> E0 ## E0 ## E1 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 0,0,1,3> E0 ## E0 ## E1 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 0,0,2,0> E0 ## E0 ## E2 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 0,0,2,1> E0 ## E0 ## E2 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 0,0,2,2> E0 ## E0 ## E2 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 0,0,2,3> E0 ## E0 ## E2 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 0,0,3,0> E0 ## E0 ## E3 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 0,0,3,1> E0 ## E0 ## E3 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 0,0,3,2> E0 ## E0 ## E3 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 0,0,3,3> E0 ## E0 ## E3 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 0,1,0,0> E0 ## E1 ## E0 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 0,1,0,1> E0 ## E1 ## E0 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 0,1,0,2> E0 ## E1 ## E0 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 0,1,0,3> E0 ## E1 ## E0 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 0,1,1,0> E0 ## E1 ## E1 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 0,1,1,1> E0 ## E1 ## E1 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 0,1,1,2> E0 ## E1 ## E1 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 0,1,1,3> E0 ## E1 ## E1 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 0,1,2,0> E0 ## E1 ## E2 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 0,1,2,1> E0 ## E1 ## E2 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 0,1,2,2> E0 ## E1 ## E2 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 0,1,2,3> E0 ## E1 ## E2 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 0,1,3,0> E0 ## E1 ## E3 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 0,1,3,1> E0 ## E1 ## E3 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 0,1,3,2> E0 ## E1 ## E3 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 0,1,3,3> E0 ## E1 ## E3 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 0,2,0,0> E0 ## E2 ## E0 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 0,2,0,1> E0 ## E2 ## E0 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 0,2,0,2> E0 ## E2 ## E0 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 0,2,0,3> E0 ## E2 ## E0 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 0,2,1,0> E0 ## E2 ## E1 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 0,2,1,1> E0 ## E2 ## E1 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 0,2,1,2> E0 ## E2 ## E1 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 0,2,1,3> E0 ## E2 ## E1 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 0,2,2,0> E0 ## E2 ## E2 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 0,2,2,1> E0 ## E2 ## E2 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 0,2,2,2> E0 ## E2 ## E2 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 0,2,2,3> E0 ## E2 ## E2 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 0,2,3,0> E0 ## E2 ## E3 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 0,2,3,1> E0 ## E2 ## E3 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 0,2,3,2> E0 ## E2 ## E3 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 0,2,3,3> E0 ## E2 ## E3 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 0,3,0,0> E0 ## E3 ## E0 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 0,3,0,1> E0 ## E3 ## E0 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 0,3,0,2> E0 ## E3 ## E0 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 0,3,0,3> E0 ## E3 ## E0 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 0,3,1,0> E0 ## E3 ## E1 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 0,3,1,1> E0 ## E3 ## E1 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 0,3,1,2> E0 ## E3 ## E1 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 0,3,1,3> E0 ## E3 ## E1 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 0,3,2,0> E0 ## E3 ## E2 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 0,3,2,1> E0 ## E3 ## E2 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 0,3,2,2> E0 ## E3 ## E2 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 0,3,2,3> E0 ## E3 ## E2 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 0,3,3,0> E0 ## E3 ## E3 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 0,3,3,1> E0 ## E3 ## E3 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 0,3,3,2> E0 ## E3 ## E3 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 0,3,3,3> E0 ## E3 ## E3 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 1,0,0,0> E1 ## E0 ## E0 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 1,0,0,1> E1 ## E0 ## E0 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 1,0,0,2> E1 ## E0 ## E0 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 1,0,0,3> E1 ## E0 ## E0 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 1,0,1,0> E1 ## E0 ## E1 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 1,0,1,1> E1 ## E0 ## E1 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 1,0,1,2> E1 ## E0 ## E1 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 1,0,1,3> E1 ## E0 ## E1 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 1,0,2,0> E1 ## E0 ## E2 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 1,0,2,1> E1 ## E0 ## E2 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 1,0,2,2> E1 ## E0 ## E2 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 1,0,2,3> E1 ## E0 ## E2 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 1,0,3,0> E1 ## E0 ## E3 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 1,0,3,1> E1 ## E0 ## E3 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 1,0,3,2> E1 ## E0 ## E3 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 1,0,3,3> E1 ## E0 ## E3 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 1,1,0,0> E1 ## E1 ## E0 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 1,1,0,1> E1 ## E1 ## E0 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 1,1,0,2> E1 ## E1 ## E0 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 1,1,0,3> E1 ## E1 ## E0 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 1,1,1,0> E1 ## E1 ## E1 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 1,1,1,1> E1 ## E1 ## E1 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 1,1,1,2> E1 ## E1 ## E1 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 1,1,1,3> E1 ## E1 ## E1 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 1,1,2,0> E1 ## E1 ## E2 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 1,1,2,1> E1 ## E1 ## E2 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 1,1,2,2> E1 ## E1 ## E2 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 1,1,2,3> E1 ## E1 ## E2 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 1,1,3,0> E1 ## E1 ## E3 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 1,1,3,1> E1 ## E1 ## E3 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 1,1,3,2> E1 ## E1 ## E3 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 1,1,3,3> E1 ## E1 ## E3 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 1,2,0,0> E1 ## E2 ## E0 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 1,2,0,1> E1 ## E2 ## E0 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 1,2,0,2> E1 ## E2 ## E0 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 1,2,0,3> E1 ## E2 ## E0 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 1,2,1,0> E1 ## E2 ## E1 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 1,2,1,1> E1 ## E2 ## E1 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 1,2,1,2> E1 ## E2 ## E1 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 1,2,1,3> E1 ## E2 ## E1 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 1,2,2,0> E1 ## E2 ## E2 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 1,2,2,1> E1 ## E2 ## E2 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 1,2,2,2> E1 ## E2 ## E2 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 1,2,2,3> E1 ## E2 ## E2 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 1,2,3,0> E1 ## E2 ## E3 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 1,2,3,1> E1 ## E2 ## E3 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 1,2,3,2> E1 ## E2 ## E3 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 1,2,3,3> E1 ## E2 ## E3 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 1,3,0,0> E1 ## E3 ## E0 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 1,3,0,1> E1 ## E3 ## E0 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 1,3,0,2> E1 ## E3 ## E0 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 1,3,0,3> E1 ## E3 ## E0 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 1,3,1,0> E1 ## E3 ## E1 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 1,3,1,1> E1 ## E3 ## E1 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 1,3,1,2> E1 ## E3 ## E1 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 1,3,1,3> E1 ## E3 ## E1 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 1,3,2,0> E1 ## E3 ## E2 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 1,3,2,1> E1 ## E3 ## E2 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 1,3,2,2> E1 ## E3 ## E2 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 1,3,2,3> E1 ## E3 ## E2 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 1,3,3,0> E1 ## E3 ## E3 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 1,3,3,1> E1 ## E3 ## E3 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 1,3,3,2> E1 ## E3 ## E3 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 1,3,3,3> E1 ## E3 ## E3 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 2,0,0,0> E2 ## E0 ## E0 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 2,0,0,1> E2 ## E0 ## E0 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 2,0,0,2> E2 ## E0 ## E0 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 2,0,0,3> E2 ## E0 ## E0 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 2,0,1,0> E2 ## E0 ## E1 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 2,0,1,1> E2 ## E0 ## E1 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 2,0,1,2> E2 ## E0 ## E1 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 2,0,1,3> E2 ## E0 ## E1 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 2,0,2,0> E2 ## E0 ## E2 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 2,0,2,1> E2 ## E0 ## E2 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 2,0,2,2> E2 ## E0 ## E2 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 2,0,2,3> E2 ## E0 ## E2 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 2,0,3,0> E2 ## E0 ## E3 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 2,0,3,1> E2 ## E0 ## E3 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 2,0,3,2> E2 ## E0 ## E3 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 2,0,3,3> E2 ## E0 ## E3 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 2,1,0,0> E2 ## E1 ## E0 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 2,1,0,1> E2 ## E1 ## E0 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 2,1,0,2> E2 ## E1 ## E0 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 2,1,0,3> E2 ## E1 ## E0 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 2,1,1,0> E2 ## E1 ## E1 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 2,1,1,1> E2 ## E1 ## E1 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 2,1,1,2> E2 ## E1 ## E1 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 2,1,1,3> E2 ## E1 ## E1 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 2,1,2,0> E2 ## E1 ## E2 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 2,1,2,1> E2 ## E1 ## E2 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 2,1,2,2> E2 ## E1 ## E2 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 2,1,2,3> E2 ## E1 ## E2 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 2,1,3,0> E2 ## E1 ## E3 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 2,1,3,1> E2 ## E1 ## E3 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 2,1,3,2> E2 ## E1 ## E3 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 2,1,3,3> E2 ## E1 ## E3 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 2,2,0,0> E2 ## E2 ## E0 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 2,2,0,1> E2 ## E2 ## E0 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 2,2,0,2> E2 ## E2 ## E0 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 2,2,0,3> E2 ## E2 ## E0 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 2,2,1,0> E2 ## E2 ## E1 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 2,2,1,1> E2 ## E2 ## E1 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 2,2,1,2> E2 ## E2 ## E1 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 2,2,1,3> E2 ## E2 ## E1 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 2,2,2,0> E2 ## E2 ## E2 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 2,2,2,1> E2 ## E2 ## E2 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 2,2,2,2> E2 ## E2 ## E2 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 2,2,2,3> E2 ## E2 ## E2 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 2,2,3,0> E2 ## E2 ## E3 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 2,2,3,1> E2 ## E2 ## E3 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 2,2,3,2> E2 ## E2 ## E3 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 2,2,3,3> E2 ## E2 ## E3 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 2,3,0,0> E2 ## E3 ## E0 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 2,3,0,1> E2 ## E3 ## E0 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 2,3,0,2> E2 ## E3 ## E0 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 2,3,0,3> E2 ## E3 ## E0 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 2,3,1,0> E2 ## E3 ## E1 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 2,3,1,1> E2 ## E3 ## E1 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 2,3,1,2> E2 ## E3 ## E1 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 2,3,1,3> E2 ## E3 ## E1 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 2,3,2,0> E2 ## E3 ## E2 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 2,3,2,1> E2 ## E3 ## E2 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 2,3,2,2> E2 ## E3 ## E2 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 2,3,2,3> E2 ## E3 ## E2 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 2,3,3,0> E2 ## E3 ## E3 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 2,3,3,1> E2 ## E3 ## E3 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 2,3,3,2> E2 ## E3 ## E3 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 2,3,3,3> E2 ## E3 ## E3 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 3,0,0,0> E3 ## E0 ## E0 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 3,0,0,1> E3 ## E0 ## E0 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 3,0,0,2> E3 ## E0 ## E0 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 3,0,0,3> E3 ## E0 ## E0 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 3,0,1,0> E3 ## E0 ## E1 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 3,0,1,1> E3 ## E0 ## E1 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 3,0,1,2> E3 ## E0 ## E1 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 3,0,1,3> E3 ## E0 ## E1 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 3,0,2,0> E3 ## E0 ## E2 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 3,0,2,1> E3 ## E0 ## E2 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 3,0,2,2> E3 ## E0 ## E2 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 3,0,2,3> E3 ## E0 ## E2 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 3,0,3,0> E3 ## E0 ## E3 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 3,0,3,1> E3 ## E0 ## E3 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 3,0,3,2> E3 ## E0 ## E3 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 3,0,3,3> E3 ## E0 ## E3 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 3,1,0,0> E3 ## E1 ## E0 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 3,1,0,1> E3 ## E1 ## E0 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 3,1,0,2> E3 ## E1 ## E0 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 3,1,0,3> E3 ## E1 ## E0 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 3,1,1,0> E3 ## E1 ## E1 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 3,1,1,1> E3 ## E1 ## E1 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 3,1,1,2> E3 ## E1 ## E1 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 3,1,1,3> E3 ## E1 ## E1 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 3,1,2,0> E3 ## E1 ## E2 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 3,1,2,1> E3 ## E1 ## E2 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 3,1,2,2> E3 ## E1 ## E2 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 3,1,2,3> E3 ## E1 ## E2 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 3,1,3,0> E3 ## E1 ## E3 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 3,1,3,1> E3 ## E1 ## E3 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 3,1,3,2> E3 ## E1 ## E3 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 3,1,3,3> E3 ## E1 ## E3 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 3,2,0,0> E3 ## E2 ## E0 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 3,2,0,1> E3 ## E2 ## E0 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 3,2,0,2> E3 ## E2 ## E0 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 3,2,0,3> E3 ## E2 ## E0 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 3,2,1,0> E3 ## E2 ## E1 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 3,2,1,1> E3 ## E2 ## E1 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 3,2,1,2> E3 ## E2 ## E1 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 3,2,1,3> E3 ## E2 ## E1 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 3,2,2,0> E3 ## E2 ## E2 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 3,2,2,1> E3 ## E2 ## E2 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 3,2,2,2> E3 ## E2 ## E2 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 3,2,2,3> E3 ## E2 ## E2 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 3,2,3,0> E3 ## E2 ## E3 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 3,2,3,1> E3 ## E2 ## E3 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 3,2,3,2> E3 ## E2 ## E3 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 3,2,3,3> E3 ## E2 ## E3 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 3,3,0,0> E3 ## E3 ## E0 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 3,3,0,1> E3 ## E3 ## E0 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 3,3,0,2> E3 ## E3 ## E0 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 3,3,0,3> E3 ## E3 ## E0 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 3,3,1,0> E3 ## E3 ## E1 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 3,3,1,1> E3 ## E3 ## E1 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 3,3,1,2> E3 ## E3 ## E1 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 3,3,1,3> E3 ## E3 ## E1 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 3,3,2,0> E3 ## E3 ## E2 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 3,3,2,1> E3 ## E3 ## E2 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 3,3,2,2> E3 ## E3 ## E2 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 3,3,2,3> E3 ## E3 ## E2 ## E3; }; \ struct { detail::_swizzle<4, T, Q, 3,3,3,0> E3 ## E3 ## E3 ## E0; }; \ struct { detail::_swizzle<4, T, Q, 3,3,3,1> E3 ## E3 ## E3 ## E1; }; \ struct { detail::_swizzle<4, T, Q, 3,3,3,2> E3 ## E3 ## E3 ## E2; }; \ struct { detail::_swizzle<4, T, Q, 3,3,3,3> E3 ## E3 ## E3 ## E3; };
Unknown
3D
mcellteam/mcell
libs/glm/detail/_noise.hpp
.hpp
2,360
82
#pragma once #include "../common.hpp" namespace glm{ namespace detail { template<typename T> GLM_FUNC_QUALIFIER T mod289(T const& x) { return x - floor(x * (static_cast<T>(1.0) / static_cast<T>(289.0))) * static_cast<T>(289.0); } template<typename T> GLM_FUNC_QUALIFIER T permute(T const& x) { return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x); } template<typename T, qualifier Q> GLM_FUNC_QUALIFIER vec<2, T, Q> permute(vec<2, T, Q> const& x) { return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x); } template<typename T, qualifier Q> GLM_FUNC_QUALIFIER vec<3, T, Q> permute(vec<3, T, Q> const& x) { return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x); } template<typename T, qualifier Q> GLM_FUNC_QUALIFIER vec<4, T, Q> permute(vec<4, T, Q> const& x) { return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x); } template<typename T> GLM_FUNC_QUALIFIER T taylorInvSqrt(T const& r) { return static_cast<T>(1.79284291400159) - static_cast<T>(0.85373472095314) * r; } template<typename T, qualifier Q> GLM_FUNC_QUALIFIER vec<2, T, Q> taylorInvSqrt(vec<2, T, Q> const& r) { return static_cast<T>(1.79284291400159) - static_cast<T>(0.85373472095314) * r; } template<typename T, qualifier Q> GLM_FUNC_QUALIFIER vec<3, T, Q> taylorInvSqrt(vec<3, T, Q> const& r) { return static_cast<T>(1.79284291400159) - static_cast<T>(0.85373472095314) * r; } template<typename T, qualifier Q> GLM_FUNC_QUALIFIER vec<4, T, Q> taylorInvSqrt(vec<4, T, Q> const& r) { return static_cast<T>(1.79284291400159) - static_cast<T>(0.85373472095314) * r; } template<typename T, qualifier Q> GLM_FUNC_QUALIFIER vec<2, T, Q> fade(vec<2, T, Q> const& t) { return (t * t * t) * (t * (t * static_cast<T>(6) - static_cast<T>(15)) + static_cast<T>(10)); } template<typename T, qualifier Q> GLM_FUNC_QUALIFIER vec<3, T, Q> fade(vec<3, T, Q> const& t) { return (t * t * t) * (t * (t * static_cast<T>(6) - static_cast<T>(15)) + static_cast<T>(10)); } template<typename T, qualifier Q> GLM_FUNC_QUALIFIER vec<4, T, Q> fade(vec<4, T, Q> const& t) { return (t * t * t) * (t * (t * static_cast<T>(6) - static_cast<T>(15)) + static_cast<T>(10)); } }//namespace detail }//namespace glm
Unknown
3D
mcellteam/mcell
libs/glm/detail/type_mat3x3.hpp
.hpp
6,515
185
/// @ref core /// @file glm/detail/type_mat3x3.hpp #pragma once #include "type_vec3.hpp" #include <limits> #include <cstddef> namespace glm { template<typename T, qualifier Q> struct mat<3, 3, T, Q> { typedef vec<3, T, Q> col_type; typedef vec<3, T, Q> row_type; typedef mat<3, 3, T, Q> type; typedef mat<3, 3, T, Q> transpose_type; typedef T value_type; private: col_type value[3]; public: // -- Accesses -- typedef length_t length_type; GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 3; } GLM_FUNC_DECL col_type & operator[](length_type i); GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const; // -- Constructors -- GLM_FUNC_DECL GLM_CONSTEXPR mat() GLM_DEFAULT; template<qualifier P> GLM_FUNC_DECL GLM_CONSTEXPR mat(mat<3, 3, T, P> const& m); GLM_FUNC_DECL explicit GLM_CONSTEXPR mat(T scalar); GLM_FUNC_DECL GLM_CONSTEXPR mat( T x0, T y0, T z0, T x1, T y1, T z1, T x2, T y2, T z2); GLM_FUNC_DECL GLM_CONSTEXPR mat( col_type const& v0, col_type const& v1, col_type const& v2); // -- Conversions -- template< typename X1, typename Y1, typename Z1, typename X2, typename Y2, typename Z2, typename X3, typename Y3, typename Z3> GLM_FUNC_DECL GLM_CONSTEXPR mat( X1 x1, Y1 y1, Z1 z1, X2 x2, Y2 y2, Z2 z2, X3 x3, Y3 y3, Z3 z3); template<typename V1, typename V2, typename V3> GLM_FUNC_DECL GLM_CONSTEXPR mat( vec<3, V1, Q> const& v1, vec<3, V2, Q> const& v2, vec<3, V3, Q> const& v3); // -- Matrix conversions -- template<typename U, qualifier P> GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 3, U, P> const& m); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 2, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 4, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 3, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 2, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 4, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 2, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 4, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 3, T, Q> const& x); // -- Unary arithmetic operators -- template<typename U> GLM_FUNC_DECL mat<3, 3, T, Q> & operator=(mat<3, 3, U, Q> const& m); template<typename U> GLM_FUNC_DECL mat<3, 3, T, Q> & operator+=(U s); template<typename U> GLM_FUNC_DECL mat<3, 3, T, Q> & operator+=(mat<3, 3, U, Q> const& m); template<typename U> GLM_FUNC_DECL mat<3, 3, T, Q> & operator-=(U s); template<typename U> GLM_FUNC_DECL mat<3, 3, T, Q> & operator-=(mat<3, 3, U, Q> const& m); template<typename U> GLM_FUNC_DECL mat<3, 3, T, Q> & operator*=(U s); template<typename U> GLM_FUNC_DECL mat<3, 3, T, Q> & operator*=(mat<3, 3, U, Q> const& m); template<typename U> GLM_FUNC_DECL mat<3, 3, T, Q> & operator/=(U s); template<typename U> GLM_FUNC_DECL mat<3, 3, T, Q> & operator/=(mat<3, 3, U, Q> const& m); // -- Increment and decrement operators -- GLM_FUNC_DECL mat<3, 3, T, Q> & operator++(); GLM_FUNC_DECL mat<3, 3, T, Q> & operator--(); GLM_FUNC_DECL mat<3, 3, T, Q> operator++(int); GLM_FUNC_DECL mat<3, 3, T, Q> operator--(int); }; // -- Unary operators -- template<typename T, qualifier Q> GLM_FUNC_DECL mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m); template<typename T, qualifier Q> GLM_FUNC_DECL mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m); // -- Binary operators -- template<typename T, qualifier Q> GLM_FUNC_DECL mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL mat<3, 3, T, Q> operator+(T scalar, mat<3, 3, T, Q> const& m); template<typename T, qualifier Q> GLM_FUNC_DECL mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL mat<3, 3, T, Q> operator-(T scalar, mat<3, 3, T, Q> const& m); template<typename T, qualifier Q> GLM_FUNC_DECL mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL mat<3, 3, T, Q> operator*(mat<3, 3, T, Q> const& m, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL mat<3, 3, T, Q> operator*(T scalar, mat<3, 3, T, Q> const& m); template<typename T, qualifier Q> GLM_FUNC_DECL typename mat<3, 3, T, Q>::col_type operator*(mat<3, 3, T, Q> const& m, typename mat<3, 3, T, Q>::row_type const& v); template<typename T, qualifier Q> GLM_FUNC_DECL typename mat<3, 3, T, Q>::row_type operator*(typename mat<3, 3, T, Q>::col_type const& v, mat<3, 3, T, Q> const& m); template<typename T, qualifier Q> GLM_FUNC_DECL mat<3, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL mat<2, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL mat<4, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL mat<3, 3, T, Q> operator/(mat<3, 3, T, Q> const& m, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL mat<3, 3, T, Q> operator/(T scalar, mat<3, 3, T, Q> const& m); template<typename T, qualifier Q> GLM_FUNC_DECL typename mat<3, 3, T, Q>::col_type operator/(mat<3, 3, T, Q> const& m, typename mat<3, 3, T, Q>::row_type const& v); template<typename T, qualifier Q> GLM_FUNC_DECL typename mat<3, 3, T, Q>::row_type operator/(typename mat<3, 3, T, Q>::col_type const& v, mat<3, 3, T, Q> const& m); template<typename T, qualifier Q> GLM_FUNC_DECL mat<3, 3, T, Q> operator/(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2); // -- Boolean operators -- template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL bool operator!=(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2); }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE #include "type_mat3x3.inl" #endif
Unknown
3D
mcellteam/mcell
libs/glm/detail/type_vec4.hpp
.hpp
23,322
505
/// @ref core /// @file glm/detail/type_vec4.hpp #pragma once #include "qualifier.hpp" #if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR # include "_swizzle.hpp" #elif GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION # include "_swizzle_func.hpp" #endif #include <cstddef> namespace glm { template<typename T, qualifier Q> struct vec<4, T, Q> { // -- Implementation detail -- typedef T value_type; typedef vec<4, T, Q> type; typedef vec<4, bool, Q> bool_type; // -- Data -- # if GLM_SILENT_WARNINGS == GLM_ENABLE # if GLM_COMPILER & GLM_COMPILER_GCC # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wpedantic" # elif GLM_COMPILER & GLM_COMPILER_CLANG # pragma clang diagnostic push # pragma clang diagnostic ignored "-Wgnu-anonymous-struct" # pragma clang diagnostic ignored "-Wnested-anon-types" # elif GLM_COMPILER & GLM_COMPILER_VC # pragma warning(push) # pragma warning(disable: 4201) // nonstandard extension used : nameless struct/union # endif # endif # if GLM_CONFIG_XYZW_ONLY T x, y, z, w; # elif GLM_CONFIG_ANONYMOUS_STRUCT == GLM_ENABLE union { struct { T x, y, z, w; }; struct { T r, g, b, a; }; struct { T s, t, p, q; }; typename detail::storage<4, T, detail::is_aligned<Q>::value>::type data; # if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR GLM_SWIZZLE4_2_MEMBERS(T, Q, x, y, z, w) GLM_SWIZZLE4_2_MEMBERS(T, Q, r, g, b, a) GLM_SWIZZLE4_2_MEMBERS(T, Q, s, t, p, q) GLM_SWIZZLE4_3_MEMBERS(T, Q, x, y, z, w) GLM_SWIZZLE4_3_MEMBERS(T, Q, r, g, b, a) GLM_SWIZZLE4_3_MEMBERS(T, Q, s, t, p, q) GLM_SWIZZLE4_4_MEMBERS(T, Q, x, y, z, w) GLM_SWIZZLE4_4_MEMBERS(T, Q, r, g, b, a) GLM_SWIZZLE4_4_MEMBERS(T, Q, s, t, p, q) # endif }; # else union { T x, r, s; }; union { T y, g, t; }; union { T z, b, p; }; union { T w, a, q; }; # if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION GLM_SWIZZLE_GEN_VEC_FROM_VEC4(T, Q) # endif # endif # if GLM_SILENT_WARNINGS == GLM_ENABLE # if GLM_COMPILER & GLM_COMPILER_CLANG # pragma clang diagnostic pop # elif GLM_COMPILER & GLM_COMPILER_GCC # pragma GCC diagnostic pop # elif GLM_COMPILER & GLM_COMPILER_VC # pragma warning(pop) # endif # endif // -- Component accesses -- /// Return the count of components of the vector typedef length_t length_type; GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 4;} GLM_FUNC_DECL GLM_CONSTEXPR T & operator[](length_type i); GLM_FUNC_DECL GLM_CONSTEXPR T const& operator[](length_type i) const; // -- Implicit basic constructors -- GLM_FUNC_DECL GLM_CONSTEXPR vec() GLM_DEFAULT; GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<4, T, Q> const& v) GLM_DEFAULT; template<qualifier P> GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<4, T, P> const& v); // -- Explicit basic constructors -- GLM_FUNC_DECL GLM_CONSTEXPR explicit vec(T scalar); GLM_FUNC_DECL GLM_CONSTEXPR vec(T x, T y, T z, T w); // -- Conversion scalar constructors -- template<typename U, qualifier P> GLM_FUNC_DECL GLM_CONSTEXPR explicit vec(vec<1, U, P> const& v); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template<typename X, typename Y, typename Z, typename W> GLM_FUNC_DECL GLM_CONSTEXPR vec(X _x, Y _y, Z _z, W _w); template<typename X, typename Y, typename Z, typename W> GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, Y _y, Z _z, W _w); template<typename X, typename Y, typename Z, typename W> GLM_FUNC_DECL GLM_CONSTEXPR vec(X _x, vec<1, Y, Q> const& _y, Z _z, W _w); template<typename X, typename Y, typename Z, typename W> GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, Z _z, W _w); template<typename X, typename Y, typename Z, typename W> GLM_FUNC_DECL GLM_CONSTEXPR vec(X _x, Y _y, vec<1, Z, Q> const& _z, W _w); template<typename X, typename Y, typename Z, typename W> GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, Y _y, vec<1, Z, Q> const& _z, W _w); template<typename X, typename Y, typename Z, typename W> GLM_FUNC_DECL GLM_CONSTEXPR vec(X _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z, W _w); template<typename X, typename Y, typename Z, typename W> GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z, W _w); template<typename X, typename Y, typename Z, typename W> GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, Y _y, Z _z, vec<1, W, Q> const& _w); template<typename X, typename Y, typename Z, typename W> GLM_FUNC_DECL GLM_CONSTEXPR vec(X _x, vec<1, Y, Q> const& _y, Z _z, vec<1, W, Q> const& _w); template<typename X, typename Y, typename Z, typename W> GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, Z _z, vec<1, W, Q> const& _w); template<typename X, typename Y, typename Z, typename W> GLM_FUNC_DECL GLM_CONSTEXPR vec(X _x, Y _y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w); template<typename X, typename Y, typename Z, typename W> GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, Y _y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w); template<typename X, typename Y, typename Z, typename W> GLM_FUNC_DECL GLM_CONSTEXPR vec(X _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w); template<typename X, typename Y, typename Z, typename W> GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _Y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w); // -- Conversion vector constructors -- /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template<typename A, typename B, typename C, qualifier P> GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, P> const& _xy, B _z, C _w); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template<typename A, typename B, typename C, qualifier P> GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, P> const& _xy, vec<1, B, P> const& _z, C _w); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template<typename A, typename B, typename C, qualifier P> GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, P> const& _xy, B _z, vec<1, C, P> const& _w); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template<typename A, typename B, typename C, qualifier P> GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, P> const& _xy, vec<1, B, P> const& _z, vec<1, C, P> const& _w); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template<typename A, typename B, typename C, qualifier P> GLM_FUNC_DECL GLM_CONSTEXPR vec(A _x, vec<2, B, P> const& _yz, C _w); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template<typename A, typename B, typename C, qualifier P> GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, P> const& _x, vec<2, B, P> const& _yz, C _w); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template<typename A, typename B, typename C, qualifier P> GLM_FUNC_DECL GLM_CONSTEXPR vec(A _x, vec<2, B, P> const& _yz, vec<1, C, P> const& _w); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template<typename A, typename B, typename C, qualifier P> GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, P> const& _x, vec<2, B, P> const& _yz, vec<1, C, P> const& _w); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template<typename A, typename B, typename C, qualifier P> GLM_FUNC_DECL GLM_CONSTEXPR vec(A _x, B _y, vec<2, C, P> const& _zw); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template<typename A, typename B, typename C, qualifier P> GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, P> const& _x, B _y, vec<2, C, P> const& _zw); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template<typename A, typename B, typename C, qualifier P> GLM_FUNC_DECL GLM_CONSTEXPR vec(A _x, vec<1, B, P> const& _y, vec<2, C, P> const& _zw); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template<typename A, typename B, typename C, qualifier P> GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, P> const& _x, vec<1, B, P> const& _y, vec<2, C, P> const& _zw); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template<typename A, typename B, qualifier P> GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<3, A, P> const& _xyz, B _w); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template<typename A, typename B, qualifier P> GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<3, A, P> const& _xyz, vec<1, B, P> const& _w); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template<typename A, typename B, qualifier P> GLM_FUNC_DECL GLM_CONSTEXPR vec(A _x, vec<3, B, P> const& _yzw); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template<typename A, typename B, qualifier P> GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, P> const& _x, vec<3, B, P> const& _yzw); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template<typename A, typename B, qualifier P> GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, P> const& _xy, vec<2, B, P> const& _zw); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template<typename U, qualifier P> GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<4, U, P> const& v); // -- Swizzle constructors -- # if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR template<int E0, int E1, int E2, int E3> GLM_FUNC_DECL GLM_CONSTEXPR vec(detail::_swizzle<4, T, Q, E0, E1, E2, E3> const& that) { *this = that(); } template<int E0, int E1, int F0, int F1> GLM_FUNC_DECL GLM_CONSTEXPR vec(detail::_swizzle<2, T, Q, E0, E1, -1, -2> const& v, detail::_swizzle<2, T, Q, F0, F1, -1, -2> const& u) { *this = vec<4, T, Q>(v(), u()); } template<int E0, int E1> GLM_FUNC_DECL GLM_CONSTEXPR vec(T const& x, T const& y, detail::_swizzle<2, T, Q, E0, E1, -1, -2> const& v) { *this = vec<4, T, Q>(x, y, v()); } template<int E0, int E1> GLM_FUNC_DECL GLM_CONSTEXPR vec(T const& x, detail::_swizzle<2, T, Q, E0, E1, -1, -2> const& v, T const& w) { *this = vec<4, T, Q>(x, v(), w); } template<int E0, int E1> GLM_FUNC_DECL GLM_CONSTEXPR vec(detail::_swizzle<2, T, Q, E0, E1, -1, -2> const& v, T const& z, T const& w) { *this = vec<4, T, Q>(v(), z, w); } template<int E0, int E1, int E2> GLM_FUNC_DECL GLM_CONSTEXPR vec(detail::_swizzle<3, T, Q, E0, E1, E2, -1> const& v, T const& w) { *this = vec<4, T, Q>(v(), w); } template<int E0, int E1, int E2> GLM_FUNC_DECL GLM_CONSTEXPR vec(T const& x, detail::_swizzle<3, T, Q, E0, E1, E2, -1> const& v) { *this = vec<4, T, Q>(x, v()); } # endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR // -- Unary arithmetic operators -- GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator=(vec<4, T, Q> const& v) GLM_DEFAULT; template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator=(vec<4, U, Q> const& v); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator+=(U scalar); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator+=(vec<1, U, Q> const& v); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator+=(vec<4, U, Q> const& v); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator-=(U scalar); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator-=(vec<1, U, Q> const& v); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator-=(vec<4, U, Q> const& v); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator*=(U scalar); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator*=(vec<1, U, Q> const& v); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator*=(vec<4, U, Q> const& v); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator/=(U scalar); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator/=(vec<1, U, Q> const& v); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator/=(vec<4, U, Q> const& v); // -- Increment and decrement operators -- GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator++(); GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator--(); GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator++(int); GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator--(int); // -- Unary bit operators -- template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator%=(U scalar); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator%=(vec<1, U, Q> const& v); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator%=(vec<4, U, Q> const& v); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator&=(U scalar); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator&=(vec<1, U, Q> const& v); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator&=(vec<4, U, Q> const& v); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator|=(U scalar); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator|=(vec<1, U, Q> const& v); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator|=(vec<4, U, Q> const& v); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator^=(U scalar); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator^=(vec<1, U, Q> const& v); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator^=(vec<4, U, Q> const& v); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator<<=(U scalar); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator<<=(vec<1, U, Q> const& v); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator<<=(vec<4, U, Q> const& v); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator>>=(U scalar); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator>>=(vec<1, U, Q> const& v); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator>>=(vec<4, U, Q> const& v); }; // -- Unary operators -- template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v); // -- Binary operators -- template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v, T const & scalar); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator+(T scalar, vec<4, T, Q> const& v); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator+(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v, T const & scalar); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator-(T scalar, vec<4, T, Q> const& v); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator-(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v, T const & scalar); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(T scalar, vec<4, T, Q> const& v); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator/(vec<4, T, Q> const& v, T const & scalar); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator/(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator/(T scalar, vec<4, T, Q> const& v); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator/(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator/(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator%(vec<4, T, Q> const& v, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator%(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator%(T scalar, vec<4, T, Q> const& v); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator%(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator%(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator&(vec<4, T, Q> const& v, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator&(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator&(T scalar, vec<4, T, Q> const& v); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator&(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator&(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator|(vec<4, T, Q> const& v, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator|(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator|(T scalar, vec<4, T, Q> const& v); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator|(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator|(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator^(vec<4, T, Q> const& v, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator^(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator^(T scalar, vec<4, T, Q> const& v); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator^(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator^(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<4, T, Q> const& v, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator<<(T scalar, vec<4, T, Q> const& v); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<4, T, Q> const& v, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator>>(T scalar, vec<4, T, Q> const& v); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator~(vec<4, T, Q> const& v); // -- Boolean operators -- template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); template<qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, bool, Q> operator&&(vec<4, bool, Q> const& v1, vec<4, bool, Q> const& v2); template<qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<4, bool, Q> operator||(vec<4, bool, Q> const& v1, vec<4, bool, Q> const& v2); }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE #include "type_vec4.inl" #endif//GLM_EXTERNAL_TEMPLATE
Unknown
3D
mcellteam/mcell
libs/glm/detail/_vectorize.hpp
.hpp
4,300
124
#pragma once namespace glm{ namespace detail { template<template<length_t L, typename T, qualifier Q> class vec, length_t L, typename R, typename T, qualifier Q> struct functor1{}; template<template<length_t L, typename T, qualifier Q> class vec, typename R, typename T, qualifier Q> struct functor1<vec, 1, R, T, Q> { GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<1, R, Q> call(R (*Func) (T x), vec<1, T, Q> const& v) { return vec<1, R, Q>(Func(v.x)); } }; template<template<length_t L, typename T, qualifier Q> class vec, typename R, typename T, qualifier Q> struct functor1<vec, 2, R, T, Q> { GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<2, R, Q> call(R (*Func) (T x), vec<2, T, Q> const& v) { return vec<2, R, Q>(Func(v.x), Func(v.y)); } }; template<template<length_t L, typename T, qualifier Q> class vec, typename R, typename T, qualifier Q> struct functor1<vec, 3, R, T, Q> { GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<3, R, Q> call(R (*Func) (T x), vec<3, T, Q> const& v) { return vec<3, R, Q>(Func(v.x), Func(v.y), Func(v.z)); } }; template<template<length_t L, typename T, qualifier Q> class vec, typename R, typename T, qualifier Q> struct functor1<vec, 4, R, T, Q> { GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, R, Q> call(R (*Func) (T x), vec<4, T, Q> const& v) { return vec<4, R, Q>(Func(v.x), Func(v.y), Func(v.z), Func(v.w)); } }; template<template<length_t L, typename T, qualifier Q> class vec, length_t L, typename T, qualifier Q> struct functor2{}; template<template<length_t L, typename T, qualifier Q> class vec, typename T, qualifier Q> struct functor2<vec, 1, T, Q> { GLM_FUNC_QUALIFIER static vec<1, T, Q> call(T (*Func) (T x, T y), vec<1, T, Q> const& a, vec<1, T, Q> const& b) { return vec<1, T, Q>(Func(a.x, b.x)); } }; template<template<length_t L, typename T, qualifier Q> class vec, typename T, qualifier Q> struct functor2<vec, 2, T, Q> { GLM_FUNC_QUALIFIER static vec<2, T, Q> call(T (*Func) (T x, T y), vec<2, T, Q> const& a, vec<2, T, Q> const& b) { return vec<2, T, Q>(Func(a.x, b.x), Func(a.y, b.y)); } }; template<template<length_t L, typename T, qualifier Q> class vec, typename T, qualifier Q> struct functor2<vec, 3, T, Q> { GLM_FUNC_QUALIFIER static vec<3, T, Q> call(T (*Func) (T x, T y), vec<3, T, Q> const& a, vec<3, T, Q> const& b) { return vec<3, T, Q>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z)); } }; template<template<length_t L, typename T, qualifier Q> class vec, typename T, qualifier Q> struct functor2<vec, 4, T, Q> { GLM_FUNC_QUALIFIER static vec<4, T, Q> call(T (*Func) (T x, T y), vec<4, T, Q> const& a, vec<4, T, Q> const& b) { return vec<4, T, Q>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z), Func(a.w, b.w)); } }; template<template<length_t L, typename T, qualifier Q> class vec, length_t L, typename T, qualifier Q> struct functor2_vec_sca{}; template<template<length_t L, typename T, qualifier Q> class vec, typename T, qualifier Q> struct functor2_vec_sca<vec, 1, T, Q> { GLM_FUNC_QUALIFIER static vec<1, T, Q> call(T (*Func) (T x, T y), vec<1, T, Q> const& a, T b) { return vec<1, T, Q>(Func(a.x, b)); } }; template<template<length_t L, typename T, qualifier Q> class vec, typename T, qualifier Q> struct functor2_vec_sca<vec, 2, T, Q> { GLM_FUNC_QUALIFIER static vec<2, T, Q> call(T (*Func) (T x, T y), vec<2, T, Q> const& a, T b) { return vec<2, T, Q>(Func(a.x, b), Func(a.y, b)); } }; template<template<length_t L, typename T, qualifier Q> class vec, typename T, qualifier Q> struct functor2_vec_sca<vec, 3, T, Q> { GLM_FUNC_QUALIFIER static vec<3, T, Q> call(T (*Func) (T x, T y), vec<3, T, Q> const& a, T b) { return vec<3, T, Q>(Func(a.x, b), Func(a.y, b), Func(a.z, b)); } }; template<template<length_t L, typename T, qualifier Q> class vec, typename T, qualifier Q> struct functor2_vec_sca<vec, 4, T, Q> { GLM_FUNC_QUALIFIER static vec<4, T, Q> call(T (*Func) (T x, T y), vec<4, T, Q> const& a, T b) { return vec<4, T, Q>(Func(a.x, b), Func(a.y, b), Func(a.z, b), Func(a.w, b)); } }; }//namespace detail }//namespace glm
Unknown
3D
mcellteam/mcell
libs/glm/detail/type_mat3x4.hpp
.hpp
5,700
167
/// @ref core /// @file glm/detail/type_mat3x4.hpp #pragma once #include "type_vec3.hpp" #include "type_vec4.hpp" #include <limits> #include <cstddef> namespace glm { template<typename T, qualifier Q> struct mat<3, 4, T, Q> { typedef vec<4, T, Q> col_type; typedef vec<3, T, Q> row_type; typedef mat<3, 4, T, Q> type; typedef mat<4, 3, T, Q> transpose_type; typedef T value_type; private: col_type value[3]; public: // -- Accesses -- typedef length_t length_type; GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 3; } GLM_FUNC_DECL col_type & operator[](length_type i); GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const; // -- Constructors -- GLM_FUNC_DECL GLM_CONSTEXPR mat() GLM_DEFAULT; template<qualifier P> GLM_FUNC_DECL GLM_CONSTEXPR mat(mat<3, 4, T, P> const& m); GLM_FUNC_DECL explicit GLM_CONSTEXPR mat(T scalar); GLM_FUNC_DECL GLM_CONSTEXPR mat( T x0, T y0, T z0, T w0, T x1, T y1, T z1, T w1, T x2, T y2, T z2, T w2); GLM_FUNC_DECL GLM_CONSTEXPR mat( col_type const& v0, col_type const& v1, col_type const& v2); // -- Conversions -- template< typename X1, typename Y1, typename Z1, typename W1, typename X2, typename Y2, typename Z2, typename W2, typename X3, typename Y3, typename Z3, typename W3> GLM_FUNC_DECL GLM_CONSTEXPR mat( X1 x1, Y1 y1, Z1 z1, W1 w1, X2 x2, Y2 y2, Z2 z2, W2 w2, X3 x3, Y3 y3, Z3 z3, W3 w3); template<typename V1, typename V2, typename V3> GLM_FUNC_DECL GLM_CONSTEXPR mat( vec<4, V1, Q> const& v1, vec<4, V2, Q> const& v2, vec<4, V3, Q> const& v3); // -- Matrix conversions -- template<typename U, qualifier P> GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 4, U, P> const& m); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 2, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 3, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 4, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 3, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 2, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 4, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 2, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 3, T, Q> const& x); // -- Unary arithmetic operators -- template<typename U> GLM_FUNC_DECL mat<3, 4, T, Q> & operator=(mat<3, 4, U, Q> const& m); template<typename U> GLM_FUNC_DECL mat<3, 4, T, Q> & operator+=(U s); template<typename U> GLM_FUNC_DECL mat<3, 4, T, Q> & operator+=(mat<3, 4, U, Q> const& m); template<typename U> GLM_FUNC_DECL mat<3, 4, T, Q> & operator-=(U s); template<typename U> GLM_FUNC_DECL mat<3, 4, T, Q> & operator-=(mat<3, 4, U, Q> const& m); template<typename U> GLM_FUNC_DECL mat<3, 4, T, Q> & operator*=(U s); template<typename U> GLM_FUNC_DECL mat<3, 4, T, Q> & operator/=(U s); // -- Increment and decrement operators -- GLM_FUNC_DECL mat<3, 4, T, Q> & operator++(); GLM_FUNC_DECL mat<3, 4, T, Q> & operator--(); GLM_FUNC_DECL mat<3, 4, T, Q> operator++(int); GLM_FUNC_DECL mat<3, 4, T, Q> operator--(int); }; // -- Unary operators -- template<typename T, qualifier Q> GLM_FUNC_DECL mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m); template<typename T, qualifier Q> GLM_FUNC_DECL mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m); // -- Binary operators -- template<typename T, qualifier Q> GLM_FUNC_DECL mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL mat<3, 4, T, Q> operator*(mat<3, 4, T, Q> const& m, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL mat<3, 4, T, Q> operator*(T scalar, mat<3, 4, T, Q> const& m); template<typename T, qualifier Q> GLM_FUNC_DECL typename mat<3, 4, T, Q>::col_type operator*(mat<3, 4, T, Q> const& m, typename mat<3, 4, T, Q>::row_type const& v); template<typename T, qualifier Q> GLM_FUNC_DECL typename mat<3, 4, T, Q>::row_type operator*(typename mat<3, 4, T, Q>::col_type const& v, mat<3, 4, T, Q> const& m); template<typename T, qualifier Q> GLM_FUNC_DECL mat<4, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<4, 3, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL mat<2, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<2, 3, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL mat<3, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<3, 3, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL mat<3, 4, T, Q> operator/(mat<3, 4, T, Q> const& m, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL mat<3, 4, T, Q> operator/(T scalar, mat<3, 4, T, Q> const& m); // -- Boolean operators -- template<typename T, qualifier Q> GLM_FUNC_DECL bool operator==(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL bool operator!=(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2); }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE #include "type_mat3x4.inl" #endif
Unknown
3D
mcellteam/mcell
libs/glm/detail/_fixes.hpp
.hpp
407
28
#include <cmath> //! Workaround for compatibility with other libraries #ifdef max #undef max #endif //! Workaround for compatibility with other libraries #ifdef min #undef min #endif //! Workaround for Android #ifdef isnan #undef isnan #endif //! Workaround for Android #ifdef isinf #undef isinf #endif //! Workaround for Chrone Native Client #ifdef log2 #undef log2 #endif
Unknown
3D
mcellteam/mcell
libs/glm/detail/type_quat.hpp
.hpp
5,987
191
/// @ref gtc_quaternion /// @file glm/gtc/quaternion.hpp /// /// @see core (dependence) /// @see gtc_constants (dependence) /// /// @defgroup gtc_quaternion GLM_GTC_quaternion /// @ingroup gtc /// /// Include <glm/gtc/quaternion.hpp> to use the features of this extension. /// /// Defines a templated quaternion type and several quaternion operations. #pragma once // Dependency: #include "../detail/type_mat3x3.hpp" #include "../detail/type_mat4x4.hpp" #include "../detail/type_vec3.hpp" #include "../detail/type_vec4.hpp" #include "../ext/vector_relational.hpp" #include "../ext/quaternion_relational.hpp" #include "../gtc/constants.hpp" #include "../gtc/matrix_transform.hpp" namespace glm { /// @addtogroup gtc_quaternion /// @{ template<typename T, qualifier Q> struct qua { // -- Implementation detail -- typedef qua<T, Q> type; typedef T value_type; // -- Data -- # if GLM_SILENT_WARNINGS == GLM_ENABLE # if GLM_COMPILER & GLM_COMPILER_GCC # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wpedantic" # elif GLM_COMPILER & GLM_COMPILER_CLANG # pragma clang diagnostic push # pragma clang diagnostic ignored "-Wgnu-anonymous-struct" # pragma clang diagnostic ignored "-Wnested-anon-types" # elif GLM_COMPILER & GLM_COMPILER_VC # pragma warning(push) # pragma warning(disable: 4201) // nonstandard extension used : nameless struct/union # endif # endif # if GLM_LANG & GLM_LANG_CXXMS_FLAG union { struct { T x, y, z, w;}; typename detail::storage<4, T, detail::is_aligned<Q>::value>::type data; }; # else T x, y, z, w; # endif # if GLM_SILENT_WARNINGS == GLM_ENABLE # if GLM_COMPILER & GLM_COMPILER_CLANG # pragma clang diagnostic pop # elif GLM_COMPILER & GLM_COMPILER_GCC # pragma GCC diagnostic pop # elif GLM_COMPILER & GLM_COMPILER_VC # pragma warning(pop) # endif # endif // -- Component accesses -- typedef length_t length_type; /// Return the count of components of a quaternion GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 4;} GLM_FUNC_DECL GLM_CONSTEXPR T & operator[](length_type i); GLM_FUNC_DECL GLM_CONSTEXPR T const& operator[](length_type i) const; // -- Implicit basic constructors -- GLM_FUNC_DECL GLM_CONSTEXPR qua() GLM_DEFAULT; GLM_FUNC_DECL GLM_CONSTEXPR qua(qua<T, Q> const& q) GLM_DEFAULT; template<qualifier P> GLM_FUNC_DECL GLM_CONSTEXPR qua(qua<T, P> const& q); // -- Explicit basic constructors -- GLM_FUNC_DECL GLM_CONSTEXPR qua(T s, vec<3, T, Q> const& v); GLM_FUNC_DECL GLM_CONSTEXPR qua(T w, T x, T y, T z); // -- Conversion constructors -- template<typename U, qualifier P> GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT qua(qua<U, P> const& q); /// Explicit conversion operators # if GLM_HAS_EXPLICIT_CONVERSION_OPERATORS GLM_FUNC_DECL explicit operator mat<3, 3, T, Q>(); GLM_FUNC_DECL explicit operator mat<4, 4, T, Q>(); # endif /// Create a quaternion from two normalized axis /// /// @param u A first normalized axis /// @param v A second normalized axis /// @see gtc_quaternion /// @see http://lolengine.net/blog/2013/09/18/beautiful-maths-quaternion-from-vectors GLM_FUNC_DECL qua(vec<3, T, Q> const& u, vec<3, T, Q> const& v); /// Build a quaternion from euler angles (pitch, yaw, roll), in radians. GLM_FUNC_DECL GLM_EXPLICIT qua(vec<3, T, Q> const& eulerAngles); GLM_FUNC_DECL GLM_EXPLICIT qua(mat<3, 3, T, Q> const& q); GLM_FUNC_DECL GLM_EXPLICIT qua(mat<4, 4, T, Q> const& q); // -- Unary arithmetic operators -- GLM_FUNC_DECL qua<T, Q>& operator=(qua<T, Q> const& q) GLM_DEFAULT; template<typename U> GLM_FUNC_DECL qua<T, Q>& operator=(qua<U, Q> const& q); template<typename U> GLM_FUNC_DECL qua<T, Q>& operator+=(qua<U, Q> const& q); template<typename U> GLM_FUNC_DECL qua<T, Q>& operator-=(qua<U, Q> const& q); template<typename U> GLM_FUNC_DECL qua<T, Q>& operator*=(qua<U, Q> const& q); template<typename U> GLM_FUNC_DECL qua<T, Q>& operator*=(U s); template<typename U> GLM_FUNC_DECL qua<T, Q>& operator/=(U s); }; // -- Unary bit operators -- template<typename T, qualifier Q> GLM_FUNC_DECL qua<T, Q> operator+(qua<T, Q> const& q); template<typename T, qualifier Q> GLM_FUNC_DECL qua<T, Q> operator-(qua<T, Q> const& q); // -- Binary operators -- template<typename T, qualifier Q> GLM_FUNC_DECL qua<T, Q> operator+(qua<T, Q> const& q, qua<T, Q> const& p); template<typename T, qualifier Q> GLM_FUNC_DECL qua<T, Q> operator-(qua<T, Q> const& q, qua<T, Q> const& p); template<typename T, qualifier Q> GLM_FUNC_DECL qua<T, Q> operator*(qua<T, Q> const& q, qua<T, Q> const& p); template<typename T, qualifier Q> GLM_FUNC_DECL vec<3, T, Q> operator*(qua<T, Q> const& q, vec<3, T, Q> const& v); template<typename T, qualifier Q> GLM_FUNC_DECL vec<3, T, Q> operator*(vec<3, T, Q> const& v, qua<T, Q> const& q); template<typename T, qualifier Q> GLM_FUNC_DECL vec<4, T, Q> operator*(qua<T, Q> const& q, vec<4, T, Q> const& v); template<typename T, qualifier Q> GLM_FUNC_DECL vec<4, T, Q> operator*(vec<4, T, Q> const& v, qua<T, Q> const& q); template<typename T, qualifier Q> GLM_FUNC_DECL qua<T, Q> operator*(qua<T, Q> const& q, T const& s); template<typename T, qualifier Q> GLM_FUNC_DECL qua<T, Q> operator*(T const& s, qua<T, Q> const& q); template<typename T, qualifier Q> GLM_FUNC_DECL qua<T, Q> operator/(qua<T, Q> const& q, T const& s); // -- Boolean operators -- template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(qua<T, Q> const& q1, qua<T, Q> const& q2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(qua<T, Q> const& q1, qua<T, Q> const& q2); /// @} } //namespace glm #include "type_quat.inl"
Unknown
3D
mcellteam/mcell
libs/glm/detail/type_mat2x2.hpp
.hpp
6,331
178
/// @ref core /// @file glm/detail/type_mat2x2.hpp #pragma once #include "type_vec2.hpp" #include <limits> #include <cstddef> namespace glm { template<typename T, qualifier Q> struct mat<2, 2, T, Q> { typedef vec<2, T, Q> col_type; typedef vec<2, T, Q> row_type; typedef mat<2, 2, T, Q> type; typedef mat<2, 2, T, Q> transpose_type; typedef T value_type; private: col_type value[2]; public: // -- Accesses -- typedef length_t length_type; GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 2; } GLM_FUNC_DECL col_type & operator[](length_type i); GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const; // -- Constructors -- GLM_FUNC_DECL GLM_CONSTEXPR mat() GLM_DEFAULT; template<qualifier P> GLM_FUNC_DECL GLM_CONSTEXPR mat(mat<2, 2, T, P> const& m); GLM_FUNC_DECL explicit GLM_CONSTEXPR mat(T scalar); GLM_FUNC_DECL GLM_CONSTEXPR mat( T const& x1, T const& y1, T const& x2, T const& y2); GLM_FUNC_DECL GLM_CONSTEXPR mat( col_type const& v1, col_type const& v2); // -- Conversions -- template<typename U, typename V, typename M, typename N> GLM_FUNC_DECL GLM_CONSTEXPR mat( U const& x1, V const& y1, M const& x2, N const& y2); template<typename U, typename V> GLM_FUNC_DECL GLM_CONSTEXPR mat( vec<2, U, Q> const& v1, vec<2, V, Q> const& v2); // -- Matrix conversions -- template<typename U, qualifier P> GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 2, U, P> const& m); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 3, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 4, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 3, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 2, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 4, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 2, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 4, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 3, T, Q> const& x); // -- Unary arithmetic operators -- template<typename U> GLM_FUNC_DECL mat<2, 2, T, Q> & operator=(mat<2, 2, U, Q> const& m); template<typename U> GLM_FUNC_DECL mat<2, 2, T, Q> & operator+=(U s); template<typename U> GLM_FUNC_DECL mat<2, 2, T, Q> & operator+=(mat<2, 2, U, Q> const& m); template<typename U> GLM_FUNC_DECL mat<2, 2, T, Q> & operator-=(U s); template<typename U> GLM_FUNC_DECL mat<2, 2, T, Q> & operator-=(mat<2, 2, U, Q> const& m); template<typename U> GLM_FUNC_DECL mat<2, 2, T, Q> & operator*=(U s); template<typename U> GLM_FUNC_DECL mat<2, 2, T, Q> & operator*=(mat<2, 2, U, Q> const& m); template<typename U> GLM_FUNC_DECL mat<2, 2, T, Q> & operator/=(U s); template<typename U> GLM_FUNC_DECL mat<2, 2, T, Q> & operator/=(mat<2, 2, U, Q> const& m); // -- Increment and decrement operators -- GLM_FUNC_DECL mat<2, 2, T, Q> & operator++ (); GLM_FUNC_DECL mat<2, 2, T, Q> & operator-- (); GLM_FUNC_DECL mat<2, 2, T, Q> operator++(int); GLM_FUNC_DECL mat<2, 2, T, Q> operator--(int); }; // -- Unary operators -- template<typename T, qualifier Q> GLM_FUNC_DECL mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m); template<typename T, qualifier Q> GLM_FUNC_DECL mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m); // -- Binary operators -- template<typename T, qualifier Q> GLM_FUNC_DECL mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL mat<2, 2, T, Q> operator+(T scalar, mat<2, 2, T, Q> const& m); template<typename T, qualifier Q> GLM_FUNC_DECL mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL mat<2, 2, T, Q> operator-(T scalar, mat<2, 2, T, Q> const& m); template<typename T, qualifier Q> GLM_FUNC_DECL mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL mat<2, 2, T, Q> operator*(mat<2, 2, T, Q> const& m, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL mat<2, 2, T, Q> operator*(T scalar, mat<2, 2, T, Q> const& m); template<typename T, qualifier Q> GLM_FUNC_DECL typename mat<2, 2, T, Q>::col_type operator*(mat<2, 2, T, Q> const& m, typename mat<2, 2, T, Q>::row_type const& v); template<typename T, qualifier Q> GLM_FUNC_DECL typename mat<2, 2, T, Q>::row_type operator*(typename mat<2, 2, T, Q>::col_type const& v, mat<2, 2, T, Q> const& m); template<typename T, qualifier Q> GLM_FUNC_DECL mat<2, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL mat<3, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL mat<4, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL mat<2, 2, T, Q> operator/(mat<2, 2, T, Q> const& m, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL mat<2, 2, T, Q> operator/(T scalar, mat<2, 2, T, Q> const& m); template<typename T, qualifier Q> GLM_FUNC_DECL typename mat<2, 2, T, Q>::col_type operator/(mat<2, 2, T, Q> const& m, typename mat<2, 2, T, Q>::row_type const& v); template<typename T, qualifier Q> GLM_FUNC_DECL typename mat<2, 2, T, Q>::row_type operator/(typename mat<2, 2, T, Q>::col_type const& v, mat<2, 2, T, Q> const& m); template<typename T, qualifier Q> GLM_FUNC_DECL mat<2, 2, T, Q> operator/(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2); // -- Boolean operators -- template<typename T, qualifier Q> GLM_FUNC_DECL bool operator==(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL bool operator!=(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2); } //namespace glm #ifndef GLM_EXTERNAL_TEMPLATE #include "type_mat2x2.inl" #endif
Unknown
3D
mcellteam/mcell
libs/glm/detail/type_half.hpp
.hpp
270
17
#pragma once #include "setup.hpp" namespace glm{ namespace detail { typedef short hdata; GLM_FUNC_DECL float toFloat32(hdata value); GLM_FUNC_DECL hdata toFloat16(float const& value); }//namespace detail }//namespace glm #include "type_half.inl"
Unknown
3D
mcellteam/mcell
libs/glm/detail/type_mat4x3.hpp
.hpp
5,982
172
/// @ref core /// @file glm/detail/type_mat4x3.hpp #pragma once #include "type_vec3.hpp" #include "type_vec4.hpp" #include <limits> #include <cstddef> namespace glm { template<typename T, qualifier Q> struct mat<4, 3, T, Q> { typedef vec<3, T, Q> col_type; typedef vec<4, T, Q> row_type; typedef mat<4, 3, T, Q> type; typedef mat<3, 4, T, Q> transpose_type; typedef T value_type; private: col_type value[4]; public: // -- Accesses -- typedef length_t length_type; GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 4; } GLM_FUNC_DECL col_type & operator[](length_type i); GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const; // -- Constructors -- GLM_FUNC_DECL GLM_CONSTEXPR mat() GLM_DEFAULT; template<qualifier P> GLM_FUNC_DECL GLM_CONSTEXPR mat(mat<4, 3, T, P> const& m); GLM_FUNC_DECL explicit GLM_CONSTEXPR mat(T const& x); GLM_FUNC_DECL GLM_CONSTEXPR mat( T const& x0, T const& y0, T const& z0, T const& x1, T const& y1, T const& z1, T const& x2, T const& y2, T const& z2, T const& x3, T const& y3, T const& z3); GLM_FUNC_DECL GLM_CONSTEXPR mat( col_type const& v0, col_type const& v1, col_type const& v2, col_type const& v3); // -- Conversions -- template< typename X1, typename Y1, typename Z1, typename X2, typename Y2, typename Z2, typename X3, typename Y3, typename Z3, typename X4, typename Y4, typename Z4> GLM_FUNC_DECL GLM_CONSTEXPR mat( X1 const& x1, Y1 const& y1, Z1 const& z1, X2 const& x2, Y2 const& y2, Z2 const& z2, X3 const& x3, Y3 const& y3, Z3 const& z3, X4 const& x4, Y4 const& y4, Z4 const& z4); template<typename V1, typename V2, typename V3, typename V4> GLM_FUNC_DECL GLM_CONSTEXPR mat( vec<3, V1, Q> const& v1, vec<3, V2, Q> const& v2, vec<3, V3, Q> const& v3, vec<3, V4, Q> const& v4); // -- Matrix conversions -- template<typename U, qualifier P> GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 3, U, P> const& m); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 2, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 3, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 4, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 3, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 2, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 4, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 2, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 4, T, Q> const& x); // -- Unary arithmetic operators -- template<typename U> GLM_FUNC_DECL mat<4, 3, T, Q> & operator=(mat<4, 3, U, Q> const& m); template<typename U> GLM_FUNC_DECL mat<4, 3, T, Q> & operator+=(U s); template<typename U> GLM_FUNC_DECL mat<4, 3, T, Q> & operator+=(mat<4, 3, U, Q> const& m); template<typename U> GLM_FUNC_DECL mat<4, 3, T, Q> & operator-=(U s); template<typename U> GLM_FUNC_DECL mat<4, 3, T, Q> & operator-=(mat<4, 3, U, Q> const& m); template<typename U> GLM_FUNC_DECL mat<4, 3, T, Q> & operator*=(U s); template<typename U> GLM_FUNC_DECL mat<4, 3, T, Q> & operator/=(U s); // -- Increment and decrement operators -- GLM_FUNC_DECL mat<4, 3, T, Q>& operator++(); GLM_FUNC_DECL mat<4, 3, T, Q>& operator--(); GLM_FUNC_DECL mat<4, 3, T, Q> operator++(int); GLM_FUNC_DECL mat<4, 3, T, Q> operator--(int); }; // -- Unary operators -- template<typename T, qualifier Q> GLM_FUNC_DECL mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m); template<typename T, qualifier Q> GLM_FUNC_DECL mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m); // -- Binary operators -- template<typename T, qualifier Q> GLM_FUNC_DECL mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m, T const& s); template<typename T, qualifier Q> GLM_FUNC_DECL mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m, T const& s); template<typename T, qualifier Q> GLM_FUNC_DECL mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL mat<4, 3, T, Q> operator*(mat<4, 3, T, Q> const& m, T const& s); template<typename T, qualifier Q> GLM_FUNC_DECL mat<4, 3, T, Q> operator*(T const& s, mat<4, 3, T, Q> const& m); template<typename T, qualifier Q> GLM_FUNC_DECL typename mat<4, 3, T, Q>::col_type operator*(mat<4, 3, T, Q> const& m, typename mat<4, 3, T, Q>::row_type const& v); template<typename T, qualifier Q> GLM_FUNC_DECL typename mat<4, 3, T, Q>::row_type operator*(typename mat<4, 3, T, Q>::col_type const& v, mat<4, 3, T, Q> const& m); template<typename T, qualifier Q> GLM_FUNC_DECL mat<2, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<2, 4, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL mat<3, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<3, 4, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL mat<4, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<4, 4, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL mat<4, 3, T, Q> operator/(mat<4, 3, T, Q> const& m, T const& s); template<typename T, qualifier Q> GLM_FUNC_DECL mat<4, 3, T, Q> operator/(T const& s, mat<4, 3, T, Q> const& m); // -- Boolean operators -- template<typename T, qualifier Q> GLM_FUNC_DECL bool operator==(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL bool operator!=(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2); }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE #include "type_mat4x3.inl" #endif //GLM_EXTERNAL_TEMPLATE
Unknown
3D
mcellteam/mcell
libs/glm/detail/type_mat4x4.hpp
.hpp
7,023
190
/// @ref core /// @file glm/detail/type_mat4x4.hpp #pragma once #include "type_vec4.hpp" #include <limits> #include <cstddef> namespace glm { template<typename T, qualifier Q> struct mat<4, 4, T, Q> { typedef vec<4, T, Q> col_type; typedef vec<4, T, Q> row_type; typedef mat<4, 4, T, Q> type; typedef mat<4, 4, T, Q> transpose_type; typedef T value_type; private: col_type value[4]; public: // -- Accesses -- typedef length_t length_type; GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 4;} GLM_FUNC_DECL col_type & operator[](length_type i); GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const; // -- Constructors -- GLM_FUNC_DECL GLM_CONSTEXPR mat() GLM_DEFAULT; template<qualifier P> GLM_FUNC_DECL GLM_CONSTEXPR mat(mat<4, 4, T, P> const& m); GLM_FUNC_DECL explicit GLM_CONSTEXPR mat(T const& x); GLM_FUNC_DECL GLM_CONSTEXPR mat( T const& x0, T const& y0, T const& z0, T const& w0, T const& x1, T const& y1, T const& z1, T const& w1, T const& x2, T const& y2, T const& z2, T const& w2, T const& x3, T const& y3, T const& z3, T const& w3); GLM_FUNC_DECL GLM_CONSTEXPR mat( col_type const& v0, col_type const& v1, col_type const& v2, col_type const& v3); // -- Conversions -- template< typename X1, typename Y1, typename Z1, typename W1, typename X2, typename Y2, typename Z2, typename W2, typename X3, typename Y3, typename Z3, typename W3, typename X4, typename Y4, typename Z4, typename W4> GLM_FUNC_DECL GLM_CONSTEXPR mat( X1 const& x1, Y1 const& y1, Z1 const& z1, W1 const& w1, X2 const& x2, Y2 const& y2, Z2 const& z2, W2 const& w2, X3 const& x3, Y3 const& y3, Z3 const& z3, W3 const& w3, X4 const& x4, Y4 const& y4, Z4 const& z4, W4 const& w4); template<typename V1, typename V2, typename V3, typename V4> GLM_FUNC_DECL GLM_CONSTEXPR mat( vec<4, V1, Q> const& v1, vec<4, V2, Q> const& v2, vec<4, V3, Q> const& v3, vec<4, V4, Q> const& v4); // -- Matrix conversions -- template<typename U, qualifier P> GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 4, U, P> const& m); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 2, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 3, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 3, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 2, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 4, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 2, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 4, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 3, T, Q> const& x); // -- Unary arithmetic operators -- template<typename U> GLM_FUNC_DECL mat<4, 4, T, Q> & operator=(mat<4, 4, U, Q> const& m); template<typename U> GLM_FUNC_DECL mat<4, 4, T, Q> & operator+=(U s); template<typename U> GLM_FUNC_DECL mat<4, 4, T, Q> & operator+=(mat<4, 4, U, Q> const& m); template<typename U> GLM_FUNC_DECL mat<4, 4, T, Q> & operator-=(U s); template<typename U> GLM_FUNC_DECL mat<4, 4, T, Q> & operator-=(mat<4, 4, U, Q> const& m); template<typename U> GLM_FUNC_DECL mat<4, 4, T, Q> & operator*=(U s); template<typename U> GLM_FUNC_DECL mat<4, 4, T, Q> & operator*=(mat<4, 4, U, Q> const& m); template<typename U> GLM_FUNC_DECL mat<4, 4, T, Q> & operator/=(U s); template<typename U> GLM_FUNC_DECL mat<4, 4, T, Q> & operator/=(mat<4, 4, U, Q> const& m); // -- Increment and decrement operators -- GLM_FUNC_DECL mat<4, 4, T, Q> & operator++(); GLM_FUNC_DECL mat<4, 4, T, Q> & operator--(); GLM_FUNC_DECL mat<4, 4, T, Q> operator++(int); GLM_FUNC_DECL mat<4, 4, T, Q> operator--(int); }; // -- Unary operators -- template<typename T, qualifier Q> GLM_FUNC_DECL mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m); template<typename T, qualifier Q> GLM_FUNC_DECL mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m); // -- Binary operators -- template<typename T, qualifier Q> GLM_FUNC_DECL mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m, T const& s); template<typename T, qualifier Q> GLM_FUNC_DECL mat<4, 4, T, Q> operator+(T const& s, mat<4, 4, T, Q> const& m); template<typename T, qualifier Q> GLM_FUNC_DECL mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m, T const& s); template<typename T, qualifier Q> GLM_FUNC_DECL mat<4, 4, T, Q> operator-(T const& s, mat<4, 4, T, Q> const& m); template<typename T, qualifier Q> GLM_FUNC_DECL mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL mat<4, 4, T, Q> operator*(mat<4, 4, T, Q> const& m, T const& s); template<typename T, qualifier Q> GLM_FUNC_DECL mat<4, 4, T, Q> operator*(T const& s, mat<4, 4, T, Q> const& m); template<typename T, qualifier Q> GLM_FUNC_DECL typename mat<4, 4, T, Q>::col_type operator*(mat<4, 4, T, Q> const& m, typename mat<4, 4, T, Q>::row_type const& v); template<typename T, qualifier Q> GLM_FUNC_DECL typename mat<4, 4, T, Q>::row_type operator*(typename mat<4, 4, T, Q>::col_type const& v, mat<4, 4, T, Q> const& m); template<typename T, qualifier Q> GLM_FUNC_DECL mat<2, 4, T, Q> operator*(mat<4, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL mat<3, 4, T, Q> operator*(mat<4, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL mat<4, 4, T, Q> operator*(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL mat<4, 4, T, Q> operator/(mat<4, 4, T, Q> const& m, T const& s); template<typename T, qualifier Q> GLM_FUNC_DECL mat<4, 4, T, Q> operator/(T const& s, mat<4, 4, T, Q> const& m); template<typename T, qualifier Q> GLM_FUNC_DECL typename mat<4, 4, T, Q>::col_type operator/(mat<4, 4, T, Q> const& m, typename mat<4, 4, T, Q>::row_type const& v); template<typename T, qualifier Q> GLM_FUNC_DECL typename mat<4, 4, T, Q>::row_type operator/(typename mat<4, 4, T, Q>::col_type const& v, mat<4, 4, T, Q> const& m); template<typename T, qualifier Q> GLM_FUNC_DECL mat<4, 4, T, Q> operator/(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2); // -- Boolean operators -- template<typename T, qualifier Q> GLM_FUNC_DECL bool operator==(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL bool operator!=(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2); }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE #include "type_mat4x4.inl" #endif//GLM_EXTERNAL_TEMPLATE
Unknown
3D
mcellteam/mcell
libs/glm/detail/type_vec2.hpp
.hpp
16,117
401
/// @ref core /// @file glm/detail/type_vec2.hpp #pragma once #include "qualifier.hpp" #if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR # include "_swizzle.hpp" #elif GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION # include "_swizzle_func.hpp" #endif #include <cstddef> namespace glm { template<typename T, qualifier Q> struct vec<2, T, Q> { // -- Implementation detail -- typedef T value_type; typedef vec<2, T, Q> type; typedef vec<2, bool, Q> bool_type; // -- Data -- # if GLM_SILENT_WARNINGS == GLM_ENABLE # if GLM_COMPILER & GLM_COMPILER_GCC # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wpedantic" # elif GLM_COMPILER & GLM_COMPILER_CLANG # pragma clang diagnostic push # pragma clang diagnostic ignored "-Wgnu-anonymous-struct" # pragma clang diagnostic ignored "-Wnested-anon-types" # elif GLM_COMPILER & GLM_COMPILER_VC # pragma warning(push) # pragma warning(disable: 4201) // nonstandard extension used : nameless struct/union # endif # endif # if GLM_CONFIG_XYZW_ONLY T x, y; # elif GLM_CONFIG_ANONYMOUS_STRUCT == GLM_ENABLE union { struct{ T x, y; }; struct{ T r, g; }; struct{ T s, t; }; struct{ T u, v; }; // for mcell typename detail::storage<2, T, detail::is_aligned<Q>::value>::type data; # if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR GLM_SWIZZLE2_2_MEMBERS(T, Q, x, y) GLM_SWIZZLE2_2_MEMBERS(T, Q, r, g) GLM_SWIZZLE2_2_MEMBERS(T, Q, s, t) GLM_SWIZZLE2_3_MEMBERS(T, Q, x, y) GLM_SWIZZLE2_3_MEMBERS(T, Q, r, g) GLM_SWIZZLE2_3_MEMBERS(T, Q, s, t) GLM_SWIZZLE2_4_MEMBERS(T, Q, x, y) GLM_SWIZZLE2_4_MEMBERS(T, Q, r, g) GLM_SWIZZLE2_4_MEMBERS(T, Q, s, t) # endif }; # else union {T x, r, s, u;}; // u & v added for mcell4 union {T y, g, t, v;}; # if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION GLM_SWIZZLE_GEN_VEC_FROM_VEC2(T, Q) # endif//GLM_CONFIG_SWIZZLE # endif # if GLM_SILENT_WARNINGS == GLM_ENABLE # if GLM_COMPILER & GLM_COMPILER_CLANG # pragma clang diagnostic pop # elif GLM_COMPILER & GLM_COMPILER_GCC # pragma GCC diagnostic pop # elif GLM_COMPILER & GLM_COMPILER_VC # pragma warning(pop) # endif # endif // -- Component accesses -- /// Return the count of components of the vector typedef length_t length_type; GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 2;} GLM_FUNC_DECL GLM_CONSTEXPR T& operator[](length_type i); GLM_FUNC_DECL GLM_CONSTEXPR T const& operator[](length_type i) const; // -- Implicit basic constructors -- GLM_FUNC_DECL GLM_CONSTEXPR vec() GLM_DEFAULT; GLM_FUNC_DECL GLM_CONSTEXPR vec(vec const& v_) GLM_DEFAULT; template<qualifier P> GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, T, P> const& v_); // -- Explicit basic constructors -- GLM_FUNC_DECL GLM_CONSTEXPR explicit vec(T scalar); GLM_FUNC_DECL GLM_CONSTEXPR vec(T x, T y); // -- Conversion constructors -- template<typename U, qualifier P> GLM_FUNC_DECL GLM_CONSTEXPR explicit vec(vec<1, U, P> const& v_); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template<typename A, typename B> GLM_FUNC_DECL GLM_CONSTEXPR vec(A x, B y); template<typename A, typename B> GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, Q> const& x, B y); template<typename A, typename B> GLM_FUNC_DECL GLM_CONSTEXPR vec(A x, vec<1, B, Q> const& y); template<typename A, typename B> GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, Q> const& x, vec<1, B, Q> const& y); // -- Conversion vector constructors -- /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template<typename U, qualifier P> GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<3, U, P> const& v_); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template<typename U, qualifier P> GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<4, U, P> const& v_); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template<typename U, qualifier P> GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<2, U, P> const& v_); // -- Swizzle constructors -- # if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR template<int E0, int E1> GLM_FUNC_DECL GLM_CONSTEXPR vec(detail::_swizzle<2, T, Q, E0, E1,-1,-2> const& that) { *this = that(); } # endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR // -- Unary arithmetic operators -- GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator=(vec const& v_) GLM_DEFAULT; template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator=(vec<2, U, Q> const& v_); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator+=(U scalar); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator+=(vec<1, U, Q> const& v_); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator+=(vec<2, U, Q> const& v_); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator-=(U scalar); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator-=(vec<1, U, Q> const& v_); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator-=(vec<2, U, Q> const& v_); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator*=(U scalar); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator*=(vec<1, U, Q> const& v_); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator*=(vec<2, U, Q> const& v_); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator/=(U scalar); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator/=(vec<1, U, Q> const& v_); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator/=(vec<2, U, Q> const& v_); // -- Increment and decrement operators -- GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator++(); GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator--(); GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator++(int); GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator--(int); // -- Unary bit operators -- template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator%=(U scalar); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator%=(vec<1, U, Q> const& v_); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator%=(vec<2, U, Q> const& v_); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator&=(U scalar); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator&=(vec<1, U, Q> const& v_); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator&=(vec<2, U, Q> const& v_); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator|=(U scalar); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator|=(vec<1, U, Q> const& v_); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator|=(vec<2, U, Q> const& v_); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator^=(U scalar); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator^=(vec<1, U, Q> const& v_); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator^=(vec<2, U, Q> const& v_); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator<<=(U scalar); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator<<=(vec<1, U, Q> const& v_); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator<<=(vec<2, U, Q> const& v_); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator>>=(U scalar); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator>>=(vec<1, U, Q> const& v_); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator>>=(vec<2, U, Q> const& v_); }; // -- Unary operators -- template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator+(vec<2, T, Q> const& v_); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator-(vec<2, T, Q> const& v_); // -- Binary operators -- template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator+(vec<2, T, Q> const& v_, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator+(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator+(T scalar, vec<2, T, Q> const& v_); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator+(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator+(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator-(vec<2, T, Q> const& v_, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator-(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator-(T scalar, vec<2, T, Q> const& v_); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator-(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator-(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator*(vec<2, T, Q> const& v_, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator*(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator*(T scalar, vec<2, T, Q> const& v_); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator*(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator*(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator/(vec<2, T, Q> const& v_, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator/(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator/(T scalar, vec<2, T, Q> const& v_); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator/(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator/(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator%(vec<2, T, Q> const& v_, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator%(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator%(T scalar, vec<2, T, Q> const& v_); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator%(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator%(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator&(vec<2, T, Q> const& v_, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator&(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator&(T scalar, vec<2, T, Q> const& v_); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator&(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator&(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator|(vec<2, T, Q> const& v_, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator|(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator|(T scalar, vec<2, T, Q> const& v_); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator|(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator|(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator^(vec<2, T, Q> const& v_, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator^(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator^(T scalar, vec<2, T, Q> const& v_); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator^(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator^(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator<<(vec<2, T, Q> const& v_, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator<<(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator<<(T scalar, vec<2, T, Q> const& v_); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator<<(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator<<(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator>>(vec<2, T, Q> const& v_, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator>>(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator>>(T scalar, vec<2, T, Q> const& v_); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator>>(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator>>(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator~(vec<2, T, Q> const& v_); // -- Boolean operators -- template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); template<qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, bool, Q> operator&&(vec<2, bool, Q> const& v1, vec<2, bool, Q> const& v2); template<qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<2, bool, Q> operator||(vec<2, bool, Q> const& v1, vec<2, bool, Q> const& v2); }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE #include "type_vec2.inl" #endif//GLM_EXTERNAL_TEMPLATE
Unknown
3D
mcellteam/mcell
libs/glm/detail/qualifier.hpp
.hpp
5,819
211
#pragma once #include "setup.hpp" namespace glm { /// Qualify GLM types in term of alignment (packed, aligned) and precision in term of ULPs (lowp, mediump, highp) enum qualifier { packed_highp, ///< Typed data is tightly packed in memory and operations are executed with high precision in term of ULPs packed_mediump, ///< Typed data is tightly packed in memory and operations are executed with medium precision in term of ULPs for higher performance packed_lowp, ///< Typed data is tightly packed in memory and operations are executed with low precision in term of ULPs to maximize performance # if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE aligned_highp, ///< Typed data is aligned in memory allowing SIMD optimizations and operations are executed with high precision in term of ULPs aligned_mediump, ///< Typed data is aligned in memory allowing SIMD optimizations and operations are executed with high precision in term of ULPs for higher performance aligned_lowp, // ///< Typed data is aligned in memory allowing SIMD optimizations and operations are executed with high precision in term of ULPs to maximize performance aligned = aligned_highp, ///< By default aligned qualifier is also high precision # endif highp = packed_highp, ///< By default highp qualifier is also packed mediump = packed_mediump, ///< By default mediump qualifier is also packed lowp = packed_lowp, ///< By default lowp qualifier is also packed packed = packed_highp, ///< By default packed qualifier is also high precision # if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE && defined(GLM_FORCE_DEFAULT_ALIGNED_GENTYPES) defaultp = aligned_highp # else defaultp = highp # endif }; typedef qualifier precision; template<length_t L, typename T, qualifier Q = defaultp> struct vec; template<length_t C, length_t R, typename T, qualifier Q = defaultp> struct mat; template<typename T, qualifier Q = defaultp> struct qua; # if GLM_HAS_TEMPLATE_ALIASES template <typename T, qualifier Q = defaultp> using tvec1 = vec<1, T, Q>; template <typename T, qualifier Q = defaultp> using tvec2 = vec<2, T, Q>; template <typename T, qualifier Q = defaultp> using tvec3 = vec<3, T, Q>; template <typename T, qualifier Q = defaultp> using tvec4 = vec<4, T, Q>; template <typename T, qualifier Q = defaultp> using tmat2x2 = mat<2, 2, T, Q>; template <typename T, qualifier Q = defaultp> using tmat2x3 = mat<2, 3, T, Q>; template <typename T, qualifier Q = defaultp> using tmat2x4 = mat<2, 4, T, Q>; template <typename T, qualifier Q = defaultp> using tmat3x2 = mat<3, 2, T, Q>; template <typename T, qualifier Q = defaultp> using tmat3x3 = mat<3, 3, T, Q>; template <typename T, qualifier Q = defaultp> using tmat3x4 = mat<3, 4, T, Q>; template <typename T, qualifier Q = defaultp> using tmat4x2 = mat<4, 2, T, Q>; template <typename T, qualifier Q = defaultp> using tmat4x3 = mat<4, 3, T, Q>; template <typename T, qualifier Q = defaultp> using tmat4x4 = mat<4, 4, T, Q>; template <typename T, qualifier Q = defaultp> using tquat = qua<T, Q>; # endif namespace detail { template<glm::qualifier P> struct is_aligned { static const bool value = false; }; # if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE template<> struct is_aligned<glm::aligned_lowp> { static const bool value = true; }; template<> struct is_aligned<glm::aligned_mediump> { static const bool value = true; }; template<> struct is_aligned<glm::aligned_highp> { static const bool value = true; }; # endif template<length_t L, typename T, bool is_aligned> struct storage { typedef struct type { T data[L]; } type; }; # if GLM_HAS_ALIGNOF template<length_t L, typename T> struct storage<L, T, true> { typedef struct alignas(L * sizeof(T)) type { T data[L]; } type; }; template<typename T> struct storage<3, T, true> { typedef struct alignas(4 * sizeof(T)) type { T data[4]; } type; }; # endif # if GLM_ARCH & GLM_ARCH_SSE2_BIT template<> struct storage<4, float, true> { typedef glm_f32vec4 type; }; template<> struct storage<4, int, true> { typedef glm_i32vec4 type; }; template<> struct storage<4, unsigned int, true> { typedef glm_u32vec4 type; }; template<> struct storage<2, double, true> { typedef glm_f64vec2 type; }; template<> struct storage<2, detail::int64, true> { typedef glm_i64vec2 type; }; template<> struct storage<2, detail::uint64, true> { typedef glm_u64vec2 type; }; # endif # if (GLM_ARCH & GLM_ARCH_AVX_BIT) template<> struct storage<4, double, true> { typedef glm_f64vec4 type; }; # endif # if (GLM_ARCH & GLM_ARCH_AVX2_BIT) template<> struct storage<4, detail::int64, true> { typedef glm_i64vec4 type; }; template<> struct storage<4, detail::uint64, true> { typedef glm_u64vec4 type; }; # endif enum genTypeEnum { GENTYPE_VEC, GENTYPE_MAT, GENTYPE_QUAT }; template <typename genType> struct genTypeTrait {}; template <length_t C, length_t R, typename T> struct genTypeTrait<mat<C, R, T> > { static const genTypeEnum GENTYPE = GENTYPE_MAT; }; template<typename genType, genTypeEnum type> struct init_gentype { }; template<typename genType> struct init_gentype<genType, GENTYPE_QUAT> { GLM_FUNC_QUALIFIER GLM_CONSTEXPR static genType identity() { return genType(1, 0, 0, 0); } }; template<typename genType> struct init_gentype<genType, GENTYPE_MAT> { GLM_FUNC_QUALIFIER GLM_CONSTEXPR static genType identity() { return genType(1); } }; }//namespace detail }//namespace glm
Unknown
3D
mcellteam/mcell
libs/glm/detail/type_vec3.hpp
.hpp
18,115
434
/// @ref core /// @file glm/detail/type_vec3.hpp #pragma once #include "qualifier.hpp" #if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR # include "_swizzle.hpp" #elif GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION # include "_swizzle_func.hpp" #endif #include <cstddef> namespace glm { template<typename T, qualifier Q> struct vec<3, T, Q> { // -- Implementation detail -- typedef T value_type; typedef vec<3, T, Q> type; typedef vec<3, bool, Q> bool_type; // -- Data -- # if GLM_SILENT_WARNINGS == GLM_ENABLE # if GLM_COMPILER & GLM_COMPILER_GCC # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wpedantic" # elif GLM_COMPILER & GLM_COMPILER_CLANG # pragma clang diagnostic push # pragma clang diagnostic ignored "-Wgnu-anonymous-struct" # pragma clang diagnostic ignored "-Wnested-anon-types" # elif GLM_COMPILER & GLM_COMPILER_VC # pragma warning(push) # pragma warning(disable: 4201) // nonstandard extension used : nameless struct/union # if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE # pragma warning(disable: 4324) // structure was padded due to alignment specifier # endif # endif # endif # if GLM_CONFIG_XYZW_ONLY T x, y, z; # elif GLM_CONFIG_ANONYMOUS_STRUCT == GLM_ENABLE union { struct{ T x, y, z; }; struct{ T r, g, b; }; struct{ T s, t, p; }; struct{ T m, u, v; }; // for mcell typename detail::storage<3, T, detail::is_aligned<Q>::value>::type data; # if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR GLM_SWIZZLE3_2_MEMBERS(T, Q, x, y, z) GLM_SWIZZLE3_2_MEMBERS(T, Q, r, g, b) GLM_SWIZZLE3_2_MEMBERS(T, Q, s, t, p) GLM_SWIZZLE3_3_MEMBERS(T, Q, x, y, z) GLM_SWIZZLE3_3_MEMBERS(T, Q, r, g, b) GLM_SWIZZLE3_3_MEMBERS(T, Q, s, t, p) GLM_SWIZZLE3_4_MEMBERS(T, Q, x, y, z) GLM_SWIZZLE3_4_MEMBERS(T, Q, r, g, b) GLM_SWIZZLE3_4_MEMBERS(T, Q, s, t, p) # endif }; # else union { T x, r, s, m; }; // m, u & v added for mcell4 union { T y, g, t, u; }; union { T z, b, p, v; }; # if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION GLM_SWIZZLE_GEN_VEC_FROM_VEC3(T, Q) # endif//GLM_CONFIG_SWIZZLE # endif//GLM_LANG # if GLM_SILENT_WARNINGS == GLM_ENABLE # if GLM_COMPILER & GLM_COMPILER_CLANG # pragma clang diagnostic pop # elif GLM_COMPILER & GLM_COMPILER_GCC # pragma GCC diagnostic pop # elif GLM_COMPILER & GLM_COMPILER_VC # pragma warning(pop) # endif # endif // -- Component accesses -- /// Return the count of components of the vector typedef length_t length_type; GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 3;} GLM_FUNC_DECL GLM_CONSTEXPR T & operator[](length_type i); GLM_FUNC_DECL GLM_CONSTEXPR T const& operator[](length_type i) const; // -- Implicit basic constructors -- GLM_FUNC_DECL GLM_CONSTEXPR vec() GLM_DEFAULT; GLM_FUNC_DECL GLM_CONSTEXPR vec(vec const& v_) GLM_DEFAULT; template<qualifier P> GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<3, T, P> const& v_); // -- Explicit basic constructors -- GLM_FUNC_DECL GLM_CONSTEXPR explicit vec(T scalar); GLM_FUNC_DECL GLM_CONSTEXPR vec(T a, T b, T c); // -- Conversion scalar constructors -- template<typename U, qualifier P> GLM_FUNC_DECL GLM_CONSTEXPR explicit vec(vec<1, U, P> const& v_); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template<typename X, typename Y, typename Z> GLM_FUNC_DECL GLM_CONSTEXPR vec(X x, Y y, Z z); template<typename X, typename Y, typename Z> GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, Y _y, Z _z); template<typename X, typename Y, typename Z> GLM_FUNC_DECL GLM_CONSTEXPR vec(X _x, vec<1, Y, Q> const& _y, Z _z); template<typename X, typename Y, typename Z> GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, Z _z); template<typename X, typename Y, typename Z> GLM_FUNC_DECL GLM_CONSTEXPR vec(X _x, Y _y, vec<1, Z, Q> const& _z); template<typename X, typename Y, typename Z> GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, Y _y, vec<1, Z, Q> const& _z); template<typename X, typename Y, typename Z> GLM_FUNC_DECL GLM_CONSTEXPR vec(X _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z); template<typename X, typename Y, typename Z> GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z); // -- Conversion vector constructors -- /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template<typename A, typename B, qualifier P> GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, P> const& _xy, B _z); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template<typename A, typename B, qualifier P> GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, P> const& _xy, vec<1, B, P> const& _z); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template<typename A, typename B, qualifier P> GLM_FUNC_DECL GLM_CONSTEXPR vec(A _x, vec<2, B, P> const& _yz); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template<typename A, typename B, qualifier P> GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, P> const& _x, vec<2, B, P> const& _yz); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template<typename U, qualifier P> GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<4, U, P> const& v_); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template<typename U, qualifier P> GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<3, U, P> const& v_); // -- Swizzle constructors -- # if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR template<int E0, int E1, int E2> GLM_FUNC_DECL GLM_CONSTEXPR vec(detail::_swizzle<3, T, Q, E0, E1, E2, -1> const& that) { *this = that(); } template<int E0, int E1> GLM_FUNC_DECL GLM_CONSTEXPR vec(detail::_swizzle<2, T, Q, E0, E1, -1, -2> const& v_, T const& scalar) { *this = vec(v_(), scalar); } template<int E0, int E1> GLM_FUNC_DECL GLM_CONSTEXPR vec(T const& scalar, detail::_swizzle<2, T, Q, E0, E1, -1, -2> const& v_) { *this = vec(scalar, v_()); } # endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR // -- Unary arithmetic operators -- GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q>& operator=(vec<3, T, Q> const& v_) GLM_DEFAULT; template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator=(vec<3, U, Q> const& v_); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator+=(U scalar); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator+=(vec<1, U, Q> const& v_); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator+=(vec<3, U, Q> const& v_); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator-=(U scalar); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator-=(vec<1, U, Q> const& v_); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator-=(vec<3, U, Q> const& v_); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator*=(U scalar); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator*=(vec<1, U, Q> const& v_); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator*=(vec<3, U, Q> const& v_); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator/=(U scalar); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator/=(vec<1, U, Q> const& v_); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator/=(vec<3, U, Q> const& v_); // -- Increment and decrement operators -- GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator++(); GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator--(); GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator++(int); GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator--(int); // -- Unary bit operators -- template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator%=(U scalar); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator%=(vec<1, U, Q> const& v_); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator%=(vec<3, U, Q> const& v_); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator&=(U scalar); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator&=(vec<1, U, Q> const& v_); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator&=(vec<3, U, Q> const& v_); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator|=(U scalar); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator|=(vec<1, U, Q> const& v_); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator|=(vec<3, U, Q> const& v_); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator^=(U scalar); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator^=(vec<1, U, Q> const& v_); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator^=(vec<3, U, Q> const& v_); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator<<=(U scalar); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator<<=(vec<1, U, Q> const& v_); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator<<=(vec<3, U, Q> const& v_); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator>>=(U scalar); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator>>=(vec<1, U, Q> const& v_); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator>>=(vec<3, U, Q> const& v_); }; // -- Unary operators -- template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v_); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v_); // -- Binary operators -- template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v_, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v_, vec<1, T, Q> const& scalar); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator+(T scalar, vec<3, T, Q> const& v_); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator+(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v_, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator-(T scalar, vec<3, T, Q> const& v_); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator-(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v_, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(T scalar, vec<3, T, Q> const& v_); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator/(vec<3, T, Q> const& v_, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator/(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator/(T scalar, vec<3, T, Q> const& v_); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator/(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator/(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator%(vec<3, T, Q> const& v_, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator%(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator%(T scalar, vec<3, T, Q> const& v_); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator%(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator%(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator&(vec<3, T, Q> const& v1, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator&(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator&(T scalar, vec<3, T, Q> const& v_); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator&(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator&(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator|(vec<3, T, Q> const& v_, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator|(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator|(T scalar, vec<3, T, Q> const& v_); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator|(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator|(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator^(vec<3, T, Q> const& v_, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator^(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator^(T scalar, vec<3, T, Q> const& v_); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator^(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator^(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<3, T, Q> const& v_, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator<<(T scalar, vec<3, T, Q> const& v_); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<3, T, Q> const& v_, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator>>(T scalar, vec<3, T, Q> const& v_); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator~(vec<3, T, Q> const& v_); // -- Boolean operators -- template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); template<qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, bool, Q> operator&&(vec<3, bool, Q> const& v1, vec<3, bool, Q> const& v2); template<qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<3, bool, Q> operator||(vec<3, bool, Q> const& v1, vec<3, bool, Q> const& v2); }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE #include "type_vec3.inl" #endif//GLM_EXTERNAL_TEMPLATE
Unknown
3D
mcellteam/mcell
libs/glm/detail/compute_vector_relational.hpp
.hpp
630
31
#pragma once //#include "compute_common.hpp" #include "setup.hpp" #include <limits> namespace glm{ namespace detail { template <typename T, bool isFloat> struct compute_equal { GLM_FUNC_QUALIFIER GLM_CONSTEXPR static bool call(T a, T b) { return a == b; } }; /* template <typename T> struct compute_equal<T, true> { GLM_FUNC_QUALIFIER GLM_CONSTEXPR static bool call(T a, T b) { return detail::compute_abs<T, std::numeric_limits<T>::is_signed>::call(b - a) <= static_cast<T>(0); //return std::memcmp(&a, &b, sizeof(T)) == 0; } }; */ }//namespace detail }//namespace glm
Unknown
3D
mcellteam/mcell
libs/glm/detail/type_vec1.hpp
.hpp
11,561
309
/// @ref core /// @file glm/detail/type_vec1.hpp #pragma once #include "qualifier.hpp" #if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR # include "_swizzle.hpp" #elif GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION # include "_swizzle_func.hpp" #endif #include <cstddef> namespace glm { template<typename T, qualifier Q> struct vec<1, T, Q> { // -- Implementation detail -- typedef T value_type; typedef vec<1, T, Q> type; typedef vec<1, bool, Q> bool_type; // -- Data -- # if GLM_SILENT_WARNINGS == GLM_ENABLE # if GLM_COMPILER & GLM_COMPILER_GCC # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wpedantic" # elif GLM_COMPILER & GLM_COMPILER_CLANG # pragma clang diagnostic push # pragma clang diagnostic ignored "-Wgnu-anonymous-struct" # pragma clang diagnostic ignored "-Wnested-anon-types" # elif GLM_COMPILER & GLM_COMPILER_VC # pragma warning(push) # pragma warning(disable: 4201) // nonstandard extension used : nameless struct/union # endif # endif # if GLM_CONFIG_XYZW_ONLY T x; # elif GLM_CONFIG_ANONYMOUS_STRUCT == GLM_ENABLE union { T x; T r; T s; typename detail::storage<1, T, detail::is_aligned<Q>::value>::type data; /* # if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR _GLM_SWIZZLE1_2_MEMBERS(T, Q, x) _GLM_SWIZZLE1_2_MEMBERS(T, Q, r) _GLM_SWIZZLE1_2_MEMBERS(T, Q, s) _GLM_SWIZZLE1_3_MEMBERS(T, Q, x) _GLM_SWIZZLE1_3_MEMBERS(T, Q, r) _GLM_SWIZZLE1_3_MEMBERS(T, Q, s) _GLM_SWIZZLE1_4_MEMBERS(T, Q, x) _GLM_SWIZZLE1_4_MEMBERS(T, Q, r) _GLM_SWIZZLE1_4_MEMBERS(T, Q, s) # endif */ }; # else union {T x, r, s;}; /* # if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION GLM_SWIZZLE_GEN_VEC_FROM_VEC1(T, Q) # endif */ # endif # if GLM_SILENT_WARNINGS == GLM_ENABLE # if GLM_COMPILER & GLM_COMPILER_CLANG # pragma clang diagnostic pop # elif GLM_COMPILER & GLM_COMPILER_GCC # pragma GCC diagnostic pop # elif GLM_COMPILER & GLM_COMPILER_VC # pragma warning(pop) # endif # endif // -- Component accesses -- /// Return the count of components of the vector typedef length_t length_type; GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 1;} GLM_FUNC_DECL GLM_CONSTEXPR T & operator[](length_type i); GLM_FUNC_DECL GLM_CONSTEXPR T const& operator[](length_type i) const; // -- Implicit basic constructors -- GLM_FUNC_DECL GLM_CONSTEXPR vec() GLM_DEFAULT; GLM_FUNC_DECL GLM_CONSTEXPR vec(vec const& v) GLM_DEFAULT; template<qualifier P> GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, T, P> const& v); // -- Explicit basic constructors -- GLM_FUNC_DECL GLM_CONSTEXPR explicit vec(T scalar); // -- Conversion vector constructors -- /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template<typename U, qualifier P> GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<2, U, P> const& v); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template<typename U, qualifier P> GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<3, U, P> const& v); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template<typename U, qualifier P> GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<4, U, P> const& v); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template<typename U, qualifier P> GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<1, U, P> const& v); // -- Swizzle constructors -- /* # if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR template<int E0> GLM_FUNC_DECL GLM_CONSTEXPR vec(detail::_swizzle<1, T, Q, E0, -1,-2,-3> const& that) { *this = that(); } # endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR */ // -- Unary arithmetic operators -- GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator=(vec const& v) GLM_DEFAULT; template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator=(vec<1, U, Q> const& v); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator+=(U scalar); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator+=(vec<1, U, Q> const& v); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator-=(U scalar); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator-=(vec<1, U, Q> const& v); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator*=(U scalar); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator*=(vec<1, U, Q> const& v); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator/=(U scalar); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator/=(vec<1, U, Q> const& v); // -- Increment and decrement operators -- GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator++(); GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator--(); GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator++(int); GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator--(int); // -- Unary bit operators -- template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator%=(U scalar); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator%=(vec<1, U, Q> const& v); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator&=(U scalar); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator&=(vec<1, U, Q> const& v); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator|=(U scalar); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator|=(vec<1, U, Q> const& v); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator^=(U scalar); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator^=(vec<1, U, Q> const& v); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator<<=(U scalar); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator<<=(vec<1, U, Q> const& v); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator>>=(U scalar); template<typename U> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator>>=(vec<1, U, Q> const& v); }; // -- Unary operators -- template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator+(vec<1, T, Q> const& v); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator-(vec<1, T, Q> const& v); // -- Binary operators -- template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator+(vec<1, T, Q> const& v, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator+(T scalar, vec<1, T, Q> const& v); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator+(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator-(vec<1, T, Q> const& v, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator-(T scalar, vec<1, T, Q> const& v); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator-(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator*(vec<1, T, Q> const& v, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator*(T scalar, vec<1, T, Q> const& v); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator*(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator/(vec<1, T, Q> const& v, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator/(T scalar, vec<1, T, Q> const& v); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator/(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator%(vec<1, T, Q> const& v, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator%(T scalar, vec<1, T, Q> const& v); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator%(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator&(vec<1, T, Q> const& v, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator&(T scalar, vec<1, T, Q> const& v); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator&(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator|(vec<1, T, Q> const& v, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator|(T scalar, vec<1, T, Q> const& v); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator|(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator^(vec<1, T, Q> const& v, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator^(T scalar, vec<1, T, Q> const& v); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator^(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator<<(vec<1, T, Q> const& v, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator<<(T scalar, vec<1, T, Q> const& v); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator<<(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator>>(vec<1, T, Q> const& v, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator>>(T scalar, vec<1, T, Q> const& v); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator>>(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator~(vec<1, T, Q> const& v); // -- Boolean operators -- template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); template<typename T, qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); template<qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, bool, Q> operator&&(vec<1, bool, Q> const& v1, vec<1, bool, Q> const& v2); template<qualifier Q> GLM_FUNC_DECL GLM_CONSTEXPR vec<1, bool, Q> operator||(vec<1, bool, Q> const& v1, vec<1, bool, Q> const& v2); }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE #include "type_vec1.inl" #endif//GLM_EXTERNAL_TEMPLATE
Unknown
3D
mcellteam/mcell
libs/glm/detail/type_mat2x4.hpp
.hpp
5,516
162
/// @ref core /// @file glm/detail/type_mat2x4.hpp #pragma once #include "type_vec2.hpp" #include "type_vec4.hpp" #include <limits> #include <cstddef> namespace glm { template<typename T, qualifier Q> struct mat<2, 4, T, Q> { typedef vec<4, T, Q> col_type; typedef vec<2, T, Q> row_type; typedef mat<2, 4, T, Q> type; typedef mat<4, 2, T, Q> transpose_type; typedef T value_type; private: col_type value[2]; public: // -- Accesses -- typedef length_t length_type; GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 2; } GLM_FUNC_DECL col_type & operator[](length_type i); GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const; // -- Constructors -- GLM_FUNC_DECL GLM_CONSTEXPR mat() GLM_DEFAULT; template<qualifier P> GLM_FUNC_DECL GLM_CONSTEXPR mat(mat<2, 4, T, P> const& m); GLM_FUNC_DECL explicit GLM_CONSTEXPR mat(T scalar); GLM_FUNC_DECL GLM_CONSTEXPR mat( T x0, T y0, T z0, T w0, T x1, T y1, T z1, T w1); GLM_FUNC_DECL GLM_CONSTEXPR mat( col_type const& v0, col_type const& v1); // -- Conversions -- template< typename X1, typename Y1, typename Z1, typename W1, typename X2, typename Y2, typename Z2, typename W2> GLM_FUNC_DECL GLM_CONSTEXPR mat( X1 x1, Y1 y1, Z1 z1, W1 w1, X2 x2, Y2 y2, Z2 z2, W2 w2); template<typename U, typename V> GLM_FUNC_DECL GLM_CONSTEXPR mat( vec<4, U, Q> const& v1, vec<4, V, Q> const& v2); // -- Matrix conversions -- template<typename U, qualifier P> GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 4, U, P> const& m); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 2, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 3, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 4, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 3, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 2, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 4, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 2, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 3, T, Q> const& x); // -- Unary arithmetic operators -- template<typename U> GLM_FUNC_DECL mat<2, 4, T, Q> & operator=(mat<2, 4, U, Q> const& m); template<typename U> GLM_FUNC_DECL mat<2, 4, T, Q> & operator+=(U s); template<typename U> GLM_FUNC_DECL mat<2, 4, T, Q> & operator+=(mat<2, 4, U, Q> const& m); template<typename U> GLM_FUNC_DECL mat<2, 4, T, Q> & operator-=(U s); template<typename U> GLM_FUNC_DECL mat<2, 4, T, Q> & operator-=(mat<2, 4, U, Q> const& m); template<typename U> GLM_FUNC_DECL mat<2, 4, T, Q> & operator*=(U s); template<typename U> GLM_FUNC_DECL mat<2, 4, T, Q> & operator/=(U s); // -- Increment and decrement operators -- GLM_FUNC_DECL mat<2, 4, T, Q> & operator++ (); GLM_FUNC_DECL mat<2, 4, T, Q> & operator-- (); GLM_FUNC_DECL mat<2, 4, T, Q> operator++(int); GLM_FUNC_DECL mat<2, 4, T, Q> operator--(int); }; // -- Unary operators -- template<typename T, qualifier Q> GLM_FUNC_DECL mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m); template<typename T, qualifier Q> GLM_FUNC_DECL mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m); // -- Binary operators -- template<typename T, qualifier Q> GLM_FUNC_DECL mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL mat<2, 4, T, Q> operator*(mat<2, 4, T, Q> const& m, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL mat<2, 4, T, Q> operator*(T scalar, mat<2, 4, T, Q> const& m); template<typename T, qualifier Q> GLM_FUNC_DECL typename mat<2, 4, T, Q>::col_type operator*(mat<2, 4, T, Q> const& m, typename mat<2, 4, T, Q>::row_type const& v); template<typename T, qualifier Q> GLM_FUNC_DECL typename mat<2, 4, T, Q>::row_type operator*(typename mat<2, 4, T, Q>::col_type const& v, mat<2, 4, T, Q> const& m); template<typename T, qualifier Q> GLM_FUNC_DECL mat<4, 4, T, Q> operator*(mat<2, 4, T, Q> const& m1, mat<4, 2, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL mat<2, 4, T, Q> operator*(mat<2, 4, T, Q> const& m1, mat<2, 2, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL mat<3, 4, T, Q> operator*(mat<2, 4, T, Q> const& m1, mat<3, 2, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL mat<2, 4, T, Q> operator/(mat<2, 4, T, Q> const& m, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL mat<2, 4, T, Q> operator/(T scalar, mat<2, 4, T, Q> const& m); // -- Boolean operators -- template<typename T, qualifier Q> GLM_FUNC_DECL bool operator==(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL bool operator!=(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2); }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE #include "type_mat2x4.inl" #endif
Unknown
3D
mcellteam/mcell
libs/glm/detail/type_float.hpp
.hpp
1,642
69
#pragma once #include "setup.hpp" #if GLM_COMPILER == GLM_COMPILER_VC12 # pragma warning(push) # pragma warning(disable: 4512) // assignment operator could not be generated #endif namespace glm{ namespace detail { template <typename T> union float_t {}; // https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/ template <> union float_t<float> { typedef int int_type; typedef float float_type; GLM_CONSTEXPR float_t(float_type Num = 0.0f) : f(Num) {} GLM_CONSTEXPR float_t& operator=(float_t const& x) { f = x.f; return *this; } // Portable extraction of components. GLM_CONSTEXPR bool negative() const { return i < 0; } GLM_CONSTEXPR int_type mantissa() const { return i & ((1 << 23) - 1); } GLM_CONSTEXPR int_type exponent() const { return (i >> 23) & ((1 << 8) - 1); } int_type i; float_type f; }; template <> union float_t<double> { typedef detail::int64 int_type; typedef double float_type; GLM_CONSTEXPR float_t(float_type Num = static_cast<float_type>(0)) : f(Num) {} GLM_CONSTEXPR float_t& operator=(float_t const& x) { f = x.f; return *this; } // Portable extraction of components. GLM_CONSTEXPR bool negative() const { return i < 0; } GLM_CONSTEXPR int_type mantissa() const { return i & ((int_type(1) << 52) - 1); } GLM_CONSTEXPR int_type exponent() const { return (i >> 52) & ((int_type(1) << 11) - 1); } int_type i; float_type f; }; }//namespace detail }//namespace glm #if GLM_COMPILER == GLM_COMPILER_VC12 # pragma warning(pop) #endif
Unknown
3D
mcellteam/mcell
libs/glm/detail/type_mat4x2.hpp
.hpp
5,676
172
/// @ref core /// @file glm/detail/type_mat4x2.hpp #pragma once #include "type_vec2.hpp" #include "type_vec4.hpp" #include <limits> #include <cstddef> namespace glm { template<typename T, qualifier Q> struct mat<4, 2, T, Q> { typedef vec<2, T, Q> col_type; typedef vec<4, T, Q> row_type; typedef mat<4, 2, T, Q> type; typedef mat<2, 4, T, Q> transpose_type; typedef T value_type; private: col_type value[4]; public: // -- Accesses -- typedef length_t length_type; GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 4; } GLM_FUNC_DECL col_type & operator[](length_type i); GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const; // -- Constructors -- GLM_FUNC_DECL GLM_CONSTEXPR mat() GLM_DEFAULT; template<qualifier P> GLM_FUNC_DECL GLM_CONSTEXPR mat(mat<4, 2, T, P> const& m); GLM_FUNC_DECL explicit GLM_CONSTEXPR mat(T scalar); GLM_FUNC_DECL GLM_CONSTEXPR mat( T x0, T y0, T x1, T y1, T x2, T y2, T x3, T y3); GLM_FUNC_DECL GLM_CONSTEXPR mat( col_type const& v0, col_type const& v1, col_type const& v2, col_type const& v3); // -- Conversions -- template< typename X0, typename Y0, typename X1, typename Y1, typename X2, typename Y2, typename X3, typename Y3> GLM_FUNC_DECL GLM_CONSTEXPR mat( X0 x0, Y0 y0, X1 x1, Y1 y1, X2 x2, Y2 y2, X3 x3, Y3 y3); template<typename V1, typename V2, typename V3, typename V4> GLM_FUNC_DECL GLM_CONSTEXPR mat( vec<2, V1, Q> const& v1, vec<2, V2, Q> const& v2, vec<2, V3, Q> const& v3, vec<2, V4, Q> const& v4); // -- Matrix conversions -- template<typename U, qualifier P> GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 2, U, P> const& m); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 2, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 3, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 4, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 3, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 2, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 4, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 3, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 4, T, Q> const& x); // -- Unary arithmetic operators -- template<typename U> GLM_FUNC_DECL mat<4, 2, T, Q> & operator=(mat<4, 2, U, Q> const& m); template<typename U> GLM_FUNC_DECL mat<4, 2, T, Q> & operator+=(U s); template<typename U> GLM_FUNC_DECL mat<4, 2, T, Q> & operator+=(mat<4, 2, U, Q> const& m); template<typename U> GLM_FUNC_DECL mat<4, 2, T, Q> & operator-=(U s); template<typename U> GLM_FUNC_DECL mat<4, 2, T, Q> & operator-=(mat<4, 2, U, Q> const& m); template<typename U> GLM_FUNC_DECL mat<4, 2, T, Q> & operator*=(U s); template<typename U> GLM_FUNC_DECL mat<4, 2, T, Q> & operator/=(U s); // -- Increment and decrement operators -- GLM_FUNC_DECL mat<4, 2, T, Q> & operator++ (); GLM_FUNC_DECL mat<4, 2, T, Q> & operator-- (); GLM_FUNC_DECL mat<4, 2, T, Q> operator++(int); GLM_FUNC_DECL mat<4, 2, T, Q> operator--(int); }; // -- Unary operators -- template<typename T, qualifier Q> GLM_FUNC_DECL mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m); template<typename T, qualifier Q> GLM_FUNC_DECL mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m); // -- Binary operators -- template<typename T, qualifier Q> GLM_FUNC_DECL mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL mat<4, 2, T, Q> operator*(mat<4, 2, T, Q> const& m, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL mat<4, 2, T, Q> operator*(T scalar, mat<4, 2, T, Q> const& m); template<typename T, qualifier Q> GLM_FUNC_DECL typename mat<4, 2, T, Q>::col_type operator*(mat<4, 2, T, Q> const& m, typename mat<4, 2, T, Q>::row_type const& v); template<typename T, qualifier Q> GLM_FUNC_DECL typename mat<4, 2, T, Q>::row_type operator*(typename mat<4, 2, T, Q>::col_type const& v, mat<4, 2, T, Q> const& m); template<typename T, qualifier Q> GLM_FUNC_DECL mat<2, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<2, 4, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL mat<3, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<3, 4, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL mat<4, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<4, 4, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL mat<4, 2, T, Q> operator/(mat<4, 2, T, Q> const& m, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL mat<4, 2, T, Q> operator/(T scalar, mat<4, 2, T, Q> const& m); // -- Boolean operators -- template<typename T, qualifier Q> GLM_FUNC_DECL bool operator==(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL bool operator!=(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2); }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE #include "type_mat4x2.inl" #endif
Unknown
3D
mcellteam/mcell
libs/glm/detail/compute_common.hpp
.hpp
1,242
51
#pragma once #include "setup.hpp" #include <limits> namespace glm{ namespace detail { template<typename genFIType, bool /*signed*/> struct compute_abs {}; template<typename genFIType> struct compute_abs<genFIType, true> { GLM_FUNC_QUALIFIER GLM_CONSTEXPR static genFIType call(genFIType x) { GLM_STATIC_ASSERT( std::numeric_limits<genFIType>::is_iec559 || std::numeric_limits<genFIType>::is_signed, "'abs' only accept floating-point and integer scalar or vector inputs"); return x >= genFIType(0) ? x : -x; // TODO, perf comp with: *(((int *) &x) + 1) &= 0x7fffffff; } }; #if GLM_COMPILER & GLM_COMPILER_CUDA template<> struct compute_abs<float, true> { GLM_FUNC_QUALIFIER GLM_CONSTEXPR static float call(float x) { return fabsf(x); } }; #endif template<typename genFIType> struct compute_abs<genFIType, false> { GLM_FUNC_QUALIFIER GLM_CONSTEXPR static genFIType call(genFIType x) { GLM_STATIC_ASSERT( (!std::numeric_limits<genFIType>::is_signed && std::numeric_limits<genFIType>::is_integer), "'abs' only accept floating-point and integer scalar or vector inputs"); return x; } }; }//namespace detail }//namespace glm
Unknown
3D
mcellteam/mcell
libs/glm/detail/type_mat3x2.hpp
.hpp
5,548
168
/// @ref core /// @file glm/detail/type_mat3x2.hpp #pragma once #include "type_vec2.hpp" #include "type_vec3.hpp" #include <limits> #include <cstddef> namespace glm { template<typename T, qualifier Q> struct mat<3, 2, T, Q> { typedef vec<2, T, Q> col_type; typedef vec<3, T, Q> row_type; typedef mat<3, 2, T, Q> type; typedef mat<2, 3, T, Q> transpose_type; typedef T value_type; private: col_type value[3]; public: // -- Accesses -- typedef length_t length_type; GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 3; } GLM_FUNC_DECL col_type & operator[](length_type i); GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const; // -- Constructors -- GLM_FUNC_DECL GLM_CONSTEXPR mat() GLM_DEFAULT; template<qualifier P> GLM_FUNC_DECL GLM_CONSTEXPR mat(mat<3, 2, T, P> const& m); GLM_FUNC_DECL explicit GLM_CONSTEXPR mat(T scalar); GLM_FUNC_DECL GLM_CONSTEXPR mat( T x0, T y0, T x1, T y1, T x2, T y2); GLM_FUNC_DECL GLM_CONSTEXPR mat( col_type const& v0, col_type const& v1, col_type const& v2); // -- Conversions -- template< typename X1, typename Y1, typename X2, typename Y2, typename X3, typename Y3> GLM_FUNC_DECL GLM_CONSTEXPR mat( X1 x1, Y1 y1, X2 x2, Y2 y2, X3 x3, Y3 y3); template<typename V1, typename V2, typename V3> GLM_FUNC_DECL GLM_CONSTEXPR mat( vec<2, V1, Q> const& v1, vec<2, V2, Q> const& v2, vec<2, V3, Q> const& v3); // -- Matrix conversions -- template<typename U, qualifier P> GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 2, U, P> const& m); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 2, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 3, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 4, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 3, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 4, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 4, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 2, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 3, T, Q> const& x); // -- Unary arithmetic operators -- template<typename U> GLM_FUNC_DECL mat<3, 2, T, Q> & operator=(mat<3, 2, U, Q> const& m); template<typename U> GLM_FUNC_DECL mat<3, 2, T, Q> & operator+=(U s); template<typename U> GLM_FUNC_DECL mat<3, 2, T, Q> & operator+=(mat<3, 2, U, Q> const& m); template<typename U> GLM_FUNC_DECL mat<3, 2, T, Q> & operator-=(U s); template<typename U> GLM_FUNC_DECL mat<3, 2, T, Q> & operator-=(mat<3, 2, U, Q> const& m); template<typename U> GLM_FUNC_DECL mat<3, 2, T, Q> & operator*=(U s); template<typename U> GLM_FUNC_DECL mat<3, 2, T, Q> & operator/=(U s); // -- Increment and decrement operators -- GLM_FUNC_DECL mat<3, 2, T, Q> & operator++ (); GLM_FUNC_DECL mat<3, 2, T, Q> & operator-- (); GLM_FUNC_DECL mat<3, 2, T, Q> operator++(int); GLM_FUNC_DECL mat<3, 2, T, Q> operator--(int); }; // -- Unary operators -- template<typename T, qualifier Q> GLM_FUNC_DECL mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m); template<typename T, qualifier Q> GLM_FUNC_DECL mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m); // -- Binary operators -- template<typename T, qualifier Q> GLM_FUNC_DECL mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL mat<3, 2, T, Q> operator*(mat<3, 2, T, Q> const& m, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL mat<3, 2, T, Q> operator*(T scalar, mat<3, 2, T, Q> const& m); template<typename T, qualifier Q> GLM_FUNC_DECL typename mat<3, 2, T, Q>::col_type operator*(mat<3, 2, T, Q> const& m, typename mat<3, 2, T, Q>::row_type const& v); template<typename T, qualifier Q> GLM_FUNC_DECL typename mat<3, 2, T, Q>::row_type operator*(typename mat<3, 2, T, Q>::col_type const& v, mat<3, 2, T, Q> const& m); template<typename T, qualifier Q> GLM_FUNC_DECL mat<2, 2, T, Q> operator*(mat<3, 2, T, Q> const& m1, mat<2, 3, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL mat<3, 2, T, Q> operator*(mat<3, 2, T, Q> const& m1, mat<3, 3, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL mat<4, 2, T, Q> operator*(mat<3, 2, T, Q> const& m1, mat<4, 3, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL mat<3, 2, T, Q> operator/(mat<3, 2, T, Q> const& m, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL mat<3, 2, T, Q> operator/(T scalar, mat<3, 2, T, Q> const& m); // -- Boolean operators -- template<typename T, qualifier Q> GLM_FUNC_DECL bool operator==(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL bool operator!=(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2); }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE #include "type_mat3x2.inl" #endif
Unknown
3D
mcellteam/mcell
libs/glm/detail/setup.hpp
.hpp
38,997
1,066
#ifndef GLM_SETUP_INCLUDED #include <cassert> #include <cstddef> #define GLM_VERSION_MAJOR 0 #define GLM_VERSION_MINOR 9 #define GLM_VERSION_PATCH 9 #define GLM_VERSION_REVISION 3 #define GLM_VERSION 993 #define GLM_VERSION_MESSAGE "GLM: version 0.9.9.3" #define GLM_SETUP_INCLUDED GLM_VERSION /////////////////////////////////////////////////////////////////////////////////// // Active states #define GLM_DISABLE 0 #define GLM_ENABLE 1 /////////////////////////////////////////////////////////////////////////////////// // Messages #if defined(GLM_FORCE_MESSAGES) # define GLM_MESSAGES GLM_ENABLE #else # define GLM_MESSAGES GLM_DISABLE #endif /////////////////////////////////////////////////////////////////////////////////// // Detect the platform #include "../simd/platform.h" /////////////////////////////////////////////////////////////////////////////////// // Build model #if defined(__arch64__) || defined(__LP64__) || defined(_M_X64) || defined(__ppc64__) || defined(__x86_64__) # define GLM_MODEL GLM_MODEL_64 #elif defined(__i386__) || defined(__ppc__) # define GLM_MODEL GLM_MODEL_32 #else # define GLM_MODEL GLM_MODEL_32 #endif// #if !defined(GLM_MODEL) && GLM_COMPILER != 0 # error "GLM_MODEL undefined, your compiler may not be supported by GLM. Add #define GLM_MODEL 0 to ignore this message." #endif//GLM_MODEL /////////////////////////////////////////////////////////////////////////////////// // C++ Version // User defines: GLM_FORCE_CXX98, GLM_FORCE_CXX03, GLM_FORCE_CXX11, GLM_FORCE_CXX14, GLM_FORCE_CXX17, GLM_FORCE_CXX2A #define GLM_LANG_CXX98_FLAG (1 << 1) #define GLM_LANG_CXX03_FLAG (1 << 2) #define GLM_LANG_CXX0X_FLAG (1 << 3) #define GLM_LANG_CXX11_FLAG (1 << 4) #define GLM_LANG_CXX14_FLAG (1 << 5) #define GLM_LANG_CXX17_FLAG (1 << 6) #define GLM_LANG_CXX2A_FLAG (1 << 7) #define GLM_LANG_CXXMS_FLAG (1 << 8) #define GLM_LANG_CXXGNU_FLAG (1 << 9) #define GLM_LANG_CXX98 GLM_LANG_CXX98_FLAG #define GLM_LANG_CXX03 (GLM_LANG_CXX98 | GLM_LANG_CXX03_FLAG) #define GLM_LANG_CXX0X (GLM_LANG_CXX03 | GLM_LANG_CXX0X_FLAG) #define GLM_LANG_CXX11 (GLM_LANG_CXX0X | GLM_LANG_CXX11_FLAG) #define GLM_LANG_CXX14 (GLM_LANG_CXX11 | GLM_LANG_CXX14_FLAG) #define GLM_LANG_CXX17 (GLM_LANG_CXX14 | GLM_LANG_CXX17_FLAG) #define GLM_LANG_CXX2A (GLM_LANG_CXX17 | GLM_LANG_CXX2A_FLAG) #define GLM_LANG_CXXMS GLM_LANG_CXXMS_FLAG #define GLM_LANG_CXXGNU GLM_LANG_CXXGNU_FLAG #if (defined(_MSC_EXTENSIONS)) # define GLM_LANG_EXT GLM_LANG_CXXMS_FLAG #elif ((GLM_COMPILER & (GLM_COMPILER_CLANG | GLM_COMPILER_GCC)) && (GLM_ARCH & GLM_ARCH_SIMD_BIT)) # define GLM_LANG_EXT GLM_LANG_CXXMS_FLAG #else # define GLM_LANG_EXT 0 #endif #if (defined(GLM_FORCE_CXX_UNKNOWN)) # define GLM_LANG 0 #elif defined(GLM_FORCE_CXX2A) # define GLM_LANG (GLM_LANG_CXX2A | GLM_LANG_EXT) # define GLM_LANG_STL11_FORCED #elif defined(GLM_FORCE_CXX17) # define GLM_LANG (GLM_LANG_CXX17 | GLM_LANG_EXT) # define GLM_LANG_STL11_FORCED #elif defined(GLM_FORCE_CXX14) # define GLM_LANG (GLM_LANG_CXX14 | GLM_LANG_EXT) # define GLM_LANG_STL11_FORCED #elif defined(GLM_FORCE_CXX11) # define GLM_LANG (GLM_LANG_CXX11 | GLM_LANG_EXT) # define GLM_LANG_STL11_FORCED #elif defined(GLM_FORCE_CXX03) # define GLM_LANG (GLM_LANG_CXX03 | GLM_LANG_EXT) #elif defined(GLM_FORCE_CXX98) # define GLM_LANG (GLM_LANG_CXX98 | GLM_LANG_EXT) #else # if GLM_COMPILER & GLM_COMPILER_VC && defined(_MSVC_LANG) # if GLM_COMPILER >= GLM_COMPILER_VC15_7 # define GLM_LANG_PLATFORM _MSVC_LANG # elif GLM_COMPILER >= GLM_COMPILER_VC15 # if _MSVC_LANG > 201402L # define GLM_LANG_PLATFORM 201402L # else # define GLM_LANG_PLATFORM _MSVC_LANG # endif # else # define GLM_LANG_PLATFORM 0 # endif # else # define GLM_LANG_PLATFORM 0 # endif # if __cplusplus > 201703L || GLM_LANG_PLATFORM > 201703L # define GLM_LANG (GLM_LANG_CXX2A | GLM_LANG_EXT) # elif __cplusplus == 201703L || GLM_LANG_PLATFORM == 201703L # define GLM_LANG (GLM_LANG_CXX17 | GLM_LANG_EXT) # elif __cplusplus == 201402L || GLM_LANG_PLATFORM == 201402L # define GLM_LANG (GLM_LANG_CXX14 | GLM_LANG_EXT) # elif __cplusplus == 201103L || GLM_LANG_PLATFORM == 201103L # define GLM_LANG (GLM_LANG_CXX11 | GLM_LANG_EXT) # elif defined(__INTEL_CXX11_MODE__) || defined(_MSC_VER) || defined(__GXX_EXPERIMENTAL_CXX0X__) # define GLM_LANG (GLM_LANG_CXX0X | GLM_LANG_EXT) # elif __cplusplus == 199711L # define GLM_LANG (GLM_LANG_CXX98 | GLM_LANG_EXT) # else # define GLM_LANG (0 | GLM_LANG_EXT) # endif #endif /////////////////////////////////////////////////////////////////////////////////// // Has of C++ features // http://clang.llvm.org/cxx_status.html // http://gcc.gnu.org/projects/cxx0x.html // http://msdn.microsoft.com/en-us/library/vstudio/hh567368(v=vs.120).aspx // Android has multiple STLs but C++11 STL detection doesn't always work #284 #564 #if GLM_PLATFORM == GLM_PLATFORM_ANDROID && !defined(GLM_LANG_STL11_FORCED) # define GLM_HAS_CXX11_STL 0 #elif GLM_COMPILER & GLM_COMPILER_CLANG # if (defined(_LIBCPP_VERSION) && GLM_LANG & GLM_LANG_CXX11_FLAG) || defined(GLM_LANG_STL11_FORCED) # define GLM_HAS_CXX11_STL 1 # else # define GLM_HAS_CXX11_STL 0 # endif #elif GLM_LANG & GLM_LANG_CXX11_FLAG # define GLM_HAS_CXX11_STL 1 #else # define GLM_HAS_CXX11_STL ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC48)) || \ ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \ ((GLM_PLATFORM != GLM_PLATFORM_WINDOWS) && (GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL15)))) #endif // N1720 #if GLM_COMPILER & GLM_COMPILER_CLANG # define GLM_HAS_STATIC_ASSERT __has_feature(cxx_static_assert) #elif GLM_LANG & GLM_LANG_CXX11_FLAG # define GLM_HAS_STATIC_ASSERT 1 #else # define GLM_HAS_STATIC_ASSERT ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \ ((GLM_COMPILER & GLM_COMPILER_VC)))) #endif // N1988 #if GLM_LANG & GLM_LANG_CXX11_FLAG # define GLM_HAS_EXTENDED_INTEGER_TYPE 1 #else # define GLM_HAS_EXTENDED_INTEGER_TYPE (\ ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_VC)) || \ ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_CUDA)) || \ ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_CLANG))) #endif // N2672 Initializer lists http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2672.htm #if GLM_COMPILER & GLM_COMPILER_CLANG # define GLM_HAS_INITIALIZER_LISTS __has_feature(cxx_generalized_initializers) #elif GLM_LANG & GLM_LANG_CXX11_FLAG # define GLM_HAS_INITIALIZER_LISTS 1 #else # define GLM_HAS_INITIALIZER_LISTS ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC15)) || \ ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL14)) || \ ((GLM_COMPILER & GLM_COMPILER_CUDA) && (GLM_COMPILER >= GLM_COMPILER_CUDA75)))) #endif // N2544 Unrestricted unions http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2544.pdf #if GLM_COMPILER & GLM_COMPILER_CLANG # define GLM_HAS_UNRESTRICTED_UNIONS __has_feature(cxx_unrestricted_unions) #elif GLM_LANG & GLM_LANG_CXX11_FLAG # define GLM_HAS_UNRESTRICTED_UNIONS 1 #else # define GLM_HAS_UNRESTRICTED_UNIONS (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ (GLM_COMPILER & GLM_COMPILER_VC) || \ ((GLM_COMPILER & GLM_COMPILER_CUDA) && (GLM_COMPILER >= GLM_COMPILER_CUDA75))) #endif // N2346 #if GLM_COMPILER & GLM_COMPILER_CLANG # define GLM_HAS_DEFAULTED_FUNCTIONS __has_feature(cxx_defaulted_functions) #elif GLM_LANG & GLM_LANG_CXX11_FLAG # define GLM_HAS_DEFAULTED_FUNCTIONS 1 #else # define GLM_HAS_DEFAULTED_FUNCTIONS ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \ ((GLM_COMPILER & GLM_COMPILER_INTEL)) || \ (GLM_COMPILER & GLM_COMPILER_CUDA))) #endif // N2118 #if GLM_COMPILER & GLM_COMPILER_CLANG # define GLM_HAS_RVALUE_REFERENCES __has_feature(cxx_rvalue_references) #elif GLM_LANG & GLM_LANG_CXX11_FLAG # define GLM_HAS_RVALUE_REFERENCES 1 #else # define GLM_HAS_RVALUE_REFERENCES ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ ((GLM_COMPILER & GLM_COMPILER_VC)) || \ ((GLM_COMPILER & GLM_COMPILER_CUDA)))) #endif // N2437 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf #if GLM_COMPILER & GLM_COMPILER_CLANG # define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS __has_feature(cxx_explicit_conversions) #elif GLM_LANG & GLM_LANG_CXX11_FLAG # define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS 1 #else # define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL14)) || \ ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \ ((GLM_COMPILER & GLM_COMPILER_CUDA)))) #endif // N2258 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf #if GLM_COMPILER & GLM_COMPILER_CLANG # define GLM_HAS_TEMPLATE_ALIASES __has_feature(cxx_alias_templates) #elif GLM_LANG & GLM_LANG_CXX11_FLAG # define GLM_HAS_TEMPLATE_ALIASES 1 #else # define GLM_HAS_TEMPLATE_ALIASES ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ ((GLM_COMPILER & GLM_COMPILER_INTEL)) || \ ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \ ((GLM_COMPILER & GLM_COMPILER_CUDA)))) #endif // N2930 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2930.html #if GLM_COMPILER & GLM_COMPILER_CLANG # define GLM_HAS_RANGE_FOR __has_feature(cxx_range_for) #elif GLM_LANG & GLM_LANG_CXX11_FLAG # define GLM_HAS_RANGE_FOR 1 #else # define GLM_HAS_RANGE_FOR ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ ((GLM_COMPILER & GLM_COMPILER_INTEL)) || \ ((GLM_COMPILER & GLM_COMPILER_VC)) || \ ((GLM_COMPILER & GLM_COMPILER_CUDA)))) #endif // N2341 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf #if GLM_COMPILER & GLM_COMPILER_CLANG # define GLM_HAS_ALIGNOF __has_feature(cxx_alignas) #elif GLM_LANG & GLM_LANG_CXX11_FLAG # define GLM_HAS_ALIGNOF 1 #else # define GLM_HAS_ALIGNOF ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL15)) || \ ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC14)) || \ ((GLM_COMPILER & GLM_COMPILER_CUDA) && (GLM_COMPILER >= GLM_COMPILER_CUDA70)))) #endif // N2235 Generalized Constant Expressions http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2235.pdf // N3652 Extended Constant Expressions http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3652.html #if (GLM_ARCH & GLM_ARCH_SIMD_BIT) // Compiler SIMD intrinsics don't support constexpr... # define GLM_HAS_CONSTEXPR 0 #elif (GLM_COMPILER & GLM_COMPILER_CLANG) # define GLM_HAS_CONSTEXPR __has_feature(cxx_relaxed_constexpr) #elif (GLM_LANG & GLM_LANG_CXX14_FLAG) # define GLM_HAS_CONSTEXPR 1 #else # define GLM_HAS_CONSTEXPR ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && GLM_HAS_INITIALIZER_LISTS && (\ ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL17)) || \ ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC6)) || \ ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC15)))) #endif #if GLM_HAS_CONSTEXPR # define GLM_CONSTEXPR constexpr #else # define GLM_CONSTEXPR #endif // #if GLM_LANG & GLM_LANG_CXX11_FLAG # define GLM_HAS_ASSIGNABLE 1 #else # define GLM_HAS_ASSIGNABLE ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC15)) || \ ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC49)))) #endif // #define GLM_HAS_TRIVIAL_QUERIES 0 // #if GLM_LANG & GLM_LANG_CXX11_FLAG # define GLM_HAS_MAKE_SIGNED 1 #else # define GLM_HAS_MAKE_SIGNED ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \ ((GLM_COMPILER & GLM_COMPILER_CUDA)))) #endif // #if defined(GLM_FORCE_PURE) # define GLM_HAS_BITSCAN_WINDOWS 0 #else # define GLM_HAS_BITSCAN_WINDOWS ((GLM_PLATFORM & GLM_PLATFORM_WINDOWS) && (\ ((GLM_COMPILER & GLM_COMPILER_INTEL)) || \ ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC14) && (GLM_ARCH & GLM_ARCH_X86_BIT)))) #endif /////////////////////////////////////////////////////////////////////////////////// // OpenMP #ifdef _OPENMP # if GLM_COMPILER & GLM_COMPILER_GCC # if GLM_COMPILER >= GLM_COMPILER_GCC61 # define GLM_HAS_OPENMP 45 # elif GLM_COMPILER >= GLM_COMPILER_GCC49 # define GLM_HAS_OPENMP 40 # elif GLM_COMPILER >= GLM_COMPILER_GCC47 # define GLM_HAS_OPENMP 31 # else # define GLM_HAS_OPENMP 0 # endif # elif GLM_COMPILER & GLM_COMPILER_CLANG # if GLM_COMPILER >= GLM_COMPILER_CLANG38 # define GLM_HAS_OPENMP 31 # else # define GLM_HAS_OPENMP 0 # endif # elif GLM_COMPILER & GLM_COMPILER_VC # define GLM_HAS_OPENMP 20 # elif GLM_COMPILER & GLM_COMPILER_INTEL # if GLM_COMPILER >= GLM_COMPILER_INTEL16 # define GLM_HAS_OPENMP 40 # else # define GLM_HAS_OPENMP 0 # endif # else # define GLM_HAS_OPENMP 0 # endif #else # define GLM_HAS_OPENMP 0 #endif /////////////////////////////////////////////////////////////////////////////////// // nullptr #if GLM_LANG & GLM_LANG_CXX0X_FLAG # define GLM_CONFIG_NULLPTR GLM_ENABLE #else # define GLM_CONFIG_NULLPTR GLM_DISABLE #endif #if GLM_CONFIG_NULLPTR == GLM_ENABLE # define GLM_NULLPTR nullptr #else # define GLM_NULLPTR 0 #endif /////////////////////////////////////////////////////////////////////////////////// // Static assert #if GLM_HAS_STATIC_ASSERT # define GLM_STATIC_ASSERT(x, message) static_assert(x, message) #elif GLM_COMPILER & GLM_COMPILER_VC # define GLM_STATIC_ASSERT(x, message) typedef char __CASSERT__##__LINE__[(x) ? 1 : -1] #else # define GLM_STATIC_ASSERT(x, message) assert(x) #endif//GLM_LANG /////////////////////////////////////////////////////////////////////////////////// // Qualifiers #if GLM_COMPILER & GLM_COMPILER_CUDA # define GLM_CUDA_FUNC_DEF __device__ __host__ # define GLM_CUDA_FUNC_DECL __device__ __host__ #else # define GLM_CUDA_FUNC_DEF # define GLM_CUDA_FUNC_DECL #endif #if defined(GLM_FORCE_INLINE) # if GLM_COMPILER & GLM_COMPILER_VC # define GLM_INLINE __forceinline # define GLM_NEVER_INLINE __declspec((noinline)) # elif GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_CLANG) # define GLM_INLINE inline __attribute__((__always_inline__)) # define GLM_NEVER_INLINE __attribute__((__noinline__)) # elif GLM_COMPILER & GLM_COMPILER_CUDA # define GLM_INLINE __forceinline__ # define GLM_NEVER_INLINE __noinline__ # else # define GLM_INLINE inline # define GLM_NEVER_INLINE # endif//GLM_COMPILER #else # define GLM_INLINE inline # define GLM_NEVER_INLINE #endif//defined(GLM_FORCE_INLINE) #define GLM_FUNC_DECL GLM_CUDA_FUNC_DECL #define GLM_FUNC_QUALIFIER GLM_CUDA_FUNC_DEF GLM_INLINE /////////////////////////////////////////////////////////////////////////////////// // Swizzle operators // User defines: GLM_FORCE_SWIZZLE #define GLM_SWIZZLE_DISABLED 0 #define GLM_SWIZZLE_OPERATOR 1 #define GLM_SWIZZLE_FUNCTION 2 #if defined(GLM_FORCE_XYZW_ONLY) # undef GLM_FORCE_SWIZZLE #endif #if defined(GLM_SWIZZLE) # pragma message("GLM: GLM_SWIZZLE is deprecated, use GLM_FORCE_SWIZZLE instead.") # define GLM_FORCE_SWIZZLE #endif #if defined(GLM_FORCE_SWIZZLE) && (GLM_LANG & GLM_LANG_CXXMS_FLAG) # define GLM_CONFIG_SWIZZLE GLM_SWIZZLE_OPERATOR #elif defined(GLM_FORCE_SWIZZLE) # define GLM_CONFIG_SWIZZLE GLM_SWIZZLE_FUNCTION #else # define GLM_CONFIG_SWIZZLE GLM_SWIZZLE_DISABLED #endif /////////////////////////////////////////////////////////////////////////////////// // Allows using not basic types as genType // #define GLM_FORCE_UNRESTRICTED_GENTYPE #ifdef GLM_FORCE_UNRESTRICTED_GENTYPE # define GLM_CONFIG_UNRESTRICTED_GENTYPE GLM_ENABLE #else # define GLM_CONFIG_UNRESTRICTED_GENTYPE GLM_DISABLE #endif /////////////////////////////////////////////////////////////////////////////////// // Clip control, define GLM_FORCE_DEPTH_ZERO_TO_ONE before including GLM // to use a clip space between 0 to 1. // Coordinate system, define GLM_FORCE_LEFT_HANDED before including GLM // to use left handed coordinate system by default. #define GLM_CLIP_CONTROL_ZO_BIT (1 << 0) // ZERO_TO_ONE #define GLM_CLIP_CONTROL_NO_BIT (1 << 1) // NEGATIVE_ONE_TO_ONE #define GLM_CLIP_CONTROL_LH_BIT (1 << 2) // LEFT_HANDED, For DirectX, Metal, Vulkan #define GLM_CLIP_CONTROL_RH_BIT (1 << 3) // RIGHT_HANDED, For OpenGL, default in GLM #define GLM_CLIP_CONTROL_LH_ZO (GLM_CLIP_CONTROL_LH_BIT | GLM_CLIP_CONTROL_ZO_BIT) #define GLM_CLIP_CONTROL_LH_NO (GLM_CLIP_CONTROL_LH_BIT | GLM_CLIP_CONTROL_NO_BIT) #define GLM_CLIP_CONTROL_RH_ZO (GLM_CLIP_CONTROL_RH_BIT | GLM_CLIP_CONTROL_ZO_BIT) #define GLM_CLIP_CONTROL_RH_NO (GLM_CLIP_CONTROL_RH_BIT | GLM_CLIP_CONTROL_NO_BIT) #ifdef GLM_FORCE_DEPTH_ZERO_TO_ONE # ifdef GLM_FORCE_LEFT_HANDED # define GLM_CONFIG_CLIP_CONTROL GLM_CLIP_CONTROL_LH_ZO # else # define GLM_CONFIG_CLIP_CONTROL GLM_CLIP_CONTROL_RH_ZO # endif #else # ifdef GLM_FORCE_LEFT_HANDED # define GLM_CONFIG_CLIP_CONTROL GLM_CLIP_CONTROL_LH_NO # else # define GLM_CONFIG_CLIP_CONTROL GLM_CLIP_CONTROL_RH_NO # endif #endif /////////////////////////////////////////////////////////////////////////////////// // Qualifiers #if (GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS)) # define GLM_DEPRECATED __declspec(deprecated) # define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef __declspec(align(alignment)) type name #elif GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_CLANG | GLM_COMPILER_INTEL) # define GLM_DEPRECATED __attribute__((__deprecated__)) # define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name __attribute__((aligned(alignment))) #elif GLM_COMPILER & GLM_COMPILER_CUDA # define GLM_DEPRECATED # define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name __align__(x) #else # define GLM_DEPRECATED # define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name #endif /////////////////////////////////////////////////////////////////////////////////// #ifdef GLM_FORCE_EXPLICIT_CTOR # define GLM_EXPLICIT explicit #else # define GLM_EXPLICIT #endif /////////////////////////////////////////////////////////////////////////////////// // Length type: all length functions returns a length_t type. // When GLM_FORCE_SIZE_T_LENGTH is defined, length_t is a typedef of size_t otherwise // length_t is a typedef of int like GLSL defines it. #define GLM_LENGTH_INT 1 #define GLM_LENGTH_SIZE_T 2 #ifdef GLM_FORCE_SIZE_T_LENGTH # define GLM_CONFIG_LENGTH_TYPE GLM_LENGTH_SIZE_T #else # define GLM_CONFIG_LENGTH_TYPE GLM_LENGTH_INT #endif namespace glm { using std::size_t; # if GLM_CONFIG_LENGTH_TYPE == GLM_LENGTH_SIZE_T typedef size_t length_t; # else typedef int length_t; # endif }//namespace glm /////////////////////////////////////////////////////////////////////////////////// // constexpr #if GLM_HAS_CONSTEXPR # define GLM_CONFIG_CONSTEXP GLM_ENABLE namespace glm { template<typename T, std::size_t N> constexpr std::size_t countof(T const (&)[N]) { return N; } }//namespace glm # define GLM_COUNTOF(arr) glm::countof(arr) #elif defined(_MSC_VER) # define GLM_CONFIG_CONSTEXP GLM_DISABLE # define GLM_COUNTOF(arr) _countof(arr) #else # define GLM_CONFIG_CONSTEXP GLM_DISABLE # define GLM_COUNTOF(arr) sizeof(arr) / sizeof(arr[0]) #endif /////////////////////////////////////////////////////////////////////////////////// // uint namespace glm{ namespace detail { template<typename T> struct is_int { enum test {value = 0}; }; template<> struct is_int<unsigned int> { enum test {value = ~0}; }; template<> struct is_int<signed int> { enum test {value = ~0}; }; }//namespace detail typedef unsigned int uint; }//namespace glm /////////////////////////////////////////////////////////////////////////////////// // 64-bit int #if GLM_HAS_EXTENDED_INTEGER_TYPE # include <cstdint> #endif namespace glm{ namespace detail { # if GLM_HAS_EXTENDED_INTEGER_TYPE typedef std::uint64_t uint64; typedef std::int64_t int64; # elif (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) // C99 detected, 64 bit types available typedef uint64_t uint64; typedef int64_t int64; # elif GLM_COMPILER & GLM_COMPILER_VC typedef unsigned __int64 uint64; typedef signed __int64 int64; # elif GLM_COMPILER & GLM_COMPILER_GCC # pragma GCC diagnostic ignored "-Wlong-long" __extension__ typedef unsigned long long uint64; __extension__ typedef signed long long int64; # elif (GLM_COMPILER & GLM_COMPILER_CLANG) # pragma clang diagnostic ignored "-Wc++11-long-long" typedef unsigned long long uint64; typedef signed long long int64; # else//unknown compiler typedef unsigned long long uint64; typedef signed long long int64; # endif }//namespace detail }//namespace glm /////////////////////////////////////////////////////////////////////////////////// // make_unsigned #if GLM_HAS_MAKE_SIGNED # include <type_traits> namespace glm{ namespace detail { using std::make_unsigned; }//namespace detail }//namespace glm #else namespace glm{ namespace detail { template<typename genType> struct make_unsigned {}; template<> struct make_unsigned<char> { typedef unsigned char type; }; template<> struct make_unsigned<short> { typedef unsigned short type; }; template<> struct make_unsigned<int> { typedef unsigned int type; }; template<> struct make_unsigned<long> { typedef unsigned long type; }; template<> struct make_unsigned<int64> { typedef uint64 type; }; template<> struct make_unsigned<unsigned char> { typedef unsigned char type; }; template<> struct make_unsigned<unsigned short> { typedef unsigned short type; }; template<> struct make_unsigned<unsigned int> { typedef unsigned int type; }; template<> struct make_unsigned<unsigned long> { typedef unsigned long type; }; template<> struct make_unsigned<uint64> { typedef uint64 type; }; }//namespace detail }//namespace glm #endif /////////////////////////////////////////////////////////////////////////////////// // Only use x, y, z, w as vector type components #ifdef GLM_FORCE_XYZW_ONLY # define GLM_CONFIG_XYZW_ONLY GLM_ENABLE #else # define GLM_CONFIG_XYZW_ONLY GLM_DISABLE #endif /////////////////////////////////////////////////////////////////////////////////// // Configure the use of defaulted initialized types #define GLM_CTOR_INIT_DISABLE 0 #define GLM_CTOR_INITIALIZER_LIST 1 #define GLM_CTOR_INITIALISATION 2 #if defined(GLM_FORCE_CTOR_INIT) && GLM_HAS_INITIALIZER_LISTS # define GLM_CONFIG_CTOR_INIT GLM_CTOR_INITIALIZER_LIST #elif defined(GLM_FORCE_CTOR_INIT) && !GLM_HAS_INITIALIZER_LISTS # define GLM_CONFIG_CTOR_INIT GLM_CTOR_INITIALISATION #else # define GLM_CONFIG_CTOR_INIT GLM_CTOR_INIT_DISABLE #endif /////////////////////////////////////////////////////////////////////////////////// // Use SIMD instruction sets #if GLM_HAS_ALIGNOF && (GLM_LANG & GLM_LANG_CXXMS_FLAG) && (GLM_ARCH & GLM_ARCH_SIMD_BIT) # define GLM_CONFIG_SIMD GLM_ENABLE #else # define GLM_CONFIG_SIMD GLM_DISABLE #endif /////////////////////////////////////////////////////////////////////////////////// // Configure the use of defaulted function #if GLM_HAS_DEFAULTED_FUNCTIONS && GLM_CONFIG_CTOR_INIT == GLM_CTOR_INIT_DISABLE # define GLM_CONFIG_DEFAULTED_FUNCTIONS GLM_ENABLE # define GLM_DEFAULT = default #else # define GLM_CONFIG_DEFAULTED_FUNCTIONS GLM_DISABLE # define GLM_DEFAULT #endif /////////////////////////////////////////////////////////////////////////////////// // Configure the use of aligned gentypes #ifdef GLM_FORCE_ALIGNED // Legacy define # define GLM_FORCE_DEFAULT_ALIGNED_GENTYPES #endif #ifdef GLM_FORCE_DEFAULT_ALIGNED_GENTYPES # define GLM_FORCE_ALIGNED_GENTYPES #endif #if GLM_HAS_ALIGNOF && (GLM_LANG & GLM_LANG_CXXMS_FLAG) && (defined(GLM_FORCE_ALIGNED_GENTYPES) || (GLM_CONFIG_SIMD == GLM_ENABLE)) # define GLM_CONFIG_ALIGNED_GENTYPES GLM_ENABLE #else # define GLM_CONFIG_ALIGNED_GENTYPES GLM_DISABLE #endif /////////////////////////////////////////////////////////////////////////////////// // Configure the use of anonymous structure as implementation detail #if ((GLM_CONFIG_SIMD == GLM_ENABLE) || (GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR) || (GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE)) # define GLM_CONFIG_ANONYMOUS_STRUCT GLM_ENABLE #else # define GLM_CONFIG_ANONYMOUS_STRUCT GLM_DISABLE #endif /////////////////////////////////////////////////////////////////////////////////// // Silent warnings #ifdef GLM_FORCE_SILENT_WARNINGS # define GLM_SILENT_WARNINGS GLM_ENABLE #else # define GLM_SILENT_WARNINGS GLM_DISABLE #endif /////////////////////////////////////////////////////////////////////////////////// // Precision #define GLM_HIGHP 1 #define GLM_MEDIUMP 2 #define GLM_LOWP 3 #if defined(GLM_FORCE_PRECISION_HIGHP_BOOL) || defined(GLM_PRECISION_HIGHP_BOOL) # define GLM_CONFIG_PRECISION_BOOL GLM_HIGHP #elif defined(GLM_FORCE_PRECISION_MEDIUMP_BOOL) || defined(GLM_PRECISION_MEDIUMP_BOOL) # define GLM_CONFIG_PRECISION_BOOL GLM_MEDIUMP #elif defined(GLM_FORCE_PRECISION_LOWP_BOOL) || defined(GLM_PRECISION_LOWP_BOOL) # define GLM_CONFIG_PRECISION_BOOL GLM_LOWP #else # define GLM_CONFIG_PRECISION_BOOL GLM_HIGHP #endif #if defined(GLM_FORCE_PRECISION_HIGHP_INT) || defined(GLM_PRECISION_HIGHP_INT) # define GLM_CONFIG_PRECISION_INT GLM_HIGHP #elif defined(GLM_FORCE_PRECISION_MEDIUMP_INT) || defined(GLM_PRECISION_MEDIUMP_INT) # define GLM_CONFIG_PRECISION_INT GLM_MEDIUMP #elif defined(GLM_FORCE_PRECISION_LOWP_INT) || defined(GLM_PRECISION_LOWP_INT) # define GLM_CONFIG_PRECISION_INT GLM_LOWP #else # define GLM_CONFIG_PRECISION_INT GLM_HIGHP #endif #if defined(GLM_FORCE_PRECISION_HIGHP_UINT) || defined(GLM_PRECISION_HIGHP_UINT) # define GLM_CONFIG_PRECISION_UINT GLM_HIGHP #elif defined(GLM_FORCE_PRECISION_MEDIUMP_UINT) || defined(GLM_PRECISION_MEDIUMP_UINT) # define GLM_CONFIG_PRECISION_UINT GLM_MEDIUMP #elif defined(GLM_FORCE_PRECISION_LOWP_UINT) || defined(GLM_PRECISION_LOWP_UINT) # define GLM_CONFIG_PRECISION_UINT GLM_LOWP #else # define GLM_CONFIG_PRECISION_UINT GLM_HIGHP #endif #if defined(GLM_FORCE_PRECISION_HIGHP_FLOAT) || defined(GLM_PRECISION_HIGHP_FLOAT) # define GLM_CONFIG_PRECISION_FLOAT GLM_HIGHP #elif defined(GLM_FORCE_PRECISION_MEDIUMP_FLOAT) || defined(GLM_PRECISION_MEDIUMP_FLOAT) # define GLM_CONFIG_PRECISION_FLOAT GLM_MEDIUMP #elif defined(GLM_FORCE_PRECISION_LOWP_FLOAT) || defined(GLM_PRECISION_LOWP_FLOAT) # define GLM_CONFIG_PRECISION_FLOAT GLM_LOWP #else # define GLM_CONFIG_PRECISION_FLOAT GLM_HIGHP #endif #if defined(GLM_FORCE_PRECISION_HIGHP_DOUBLE) || defined(GLM_PRECISION_HIGHP_DOUBLE) # define GLM_CONFIG_PRECISION_DOUBLE GLM_HIGHP #elif defined(GLM_FORCE_PRECISION_MEDIUMP_DOUBLE) || defined(GLM_PRECISION_MEDIUMP_DOUBLE) # define GLM_CONFIG_PRECISION_DOUBLE GLM_MEDIUMP #elif defined(GLM_FORCE_PRECISION_LOWP_DOUBLE) || defined(GLM_PRECISION_LOWP_DOUBLE) # define GLM_CONFIG_PRECISION_DOUBLE GLM_LOWP #else # define GLM_CONFIG_PRECISION_DOUBLE GLM_HIGHP #endif /////////////////////////////////////////////////////////////////////////////////// // Check inclusions of different versions of GLM #elif ((GLM_SETUP_INCLUDED != GLM_VERSION) && !defined(GLM_FORCE_IGNORE_VERSION)) # error "GLM error: A different version of GLM is already included. Define GLM_FORCE_IGNORE_VERSION before including GLM headers to ignore this error." #elif GLM_SETUP_INCLUDED == GLM_VERSION /////////////////////////////////////////////////////////////////////////////////// // Messages #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_MESSAGE_DISPLAYED) # define GLM_MESSAGE_DISPLAYED # define GLM_STR_HELPER(x) #x # define GLM_STR(x) GLM_STR_HELPER(x) // Report GLM version # pragma message (GLM_STR(GLM_VERSION_MESSAGE)) // Report C++ language # if (GLM_LANG & GLM_LANG_CXX2A_FLAG) && (GLM_LANG & GLM_LANG_EXT) # pragma message("GLM: C++ 2A with extensions") # elif (GLM_LANG & GLM_LANG_CXX2A_FLAG) # pragma message("GLM: C++ 2A") # elif (GLM_LANG & GLM_LANG_CXX17_FLAG) && (GLM_LANG & GLM_LANG_EXT) # pragma message("GLM: C++ 17 with extensions") # elif (GLM_LANG & GLM_LANG_CXX17_FLAG) # pragma message("GLM: C++ 17") # elif (GLM_LANG & GLM_LANG_CXX14_FLAG) && (GLM_LANG & GLM_LANG_EXT) # pragma message("GLM: C++ 14 with extensions") # elif (GLM_LANG & GLM_LANG_CXX14_FLAG) # pragma message("GLM: C++ 14") # elif (GLM_LANG & GLM_LANG_CXX11_FLAG) && (GLM_LANG & GLM_LANG_EXT) # pragma message("GLM: C++ 11 with extensions") # elif (GLM_LANG & GLM_LANG_CXX11_FLAG) # pragma message("GLM: C++ 11") # elif (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_LANG & GLM_LANG_EXT) # pragma message("GLM: C++ 0x with extensions") # elif (GLM_LANG & GLM_LANG_CXX0X_FLAG) # pragma message("GLM: C++ 0x") # elif (GLM_LANG & GLM_LANG_CXX03_FLAG) && (GLM_LANG & GLM_LANG_EXT) # pragma message("GLM: C++ 03 with extensions") # elif (GLM_LANG & GLM_LANG_CXX03_FLAG) # pragma message("GLM: C++ 03") # elif (GLM_LANG & GLM_LANG_CXX98_FLAG) && (GLM_LANG & GLM_LANG_EXT) # pragma message("GLM: C++ 98 with extensions") # elif (GLM_LANG & GLM_LANG_CXX98_FLAG) # pragma message("GLM: C++ 98") # else # pragma message("GLM: C++ language undetected") # endif//GLM_LANG // Report compiler detection # if GLM_COMPILER & GLM_COMPILER_CUDA # pragma message("GLM: CUDA compiler detected") # elif GLM_COMPILER & GLM_COMPILER_VC # pragma message("GLM: Visual C++ compiler detected") # elif GLM_COMPILER & GLM_COMPILER_CLANG # pragma message("GLM: Clang compiler detected") # elif GLM_COMPILER & GLM_COMPILER_INTEL # pragma message("GLM: Intel Compiler detected") # elif GLM_COMPILER & GLM_COMPILER_GCC # pragma message("GLM: GCC compiler detected") # else # pragma message("GLM: Compiler not detected") # endif // Report build target # if (GLM_ARCH & GLM_ARCH_AVX2_BIT) && (GLM_MODEL == GLM_MODEL_64) # pragma message("GLM: x86 64 bits with AVX2 instruction set build target") # elif (GLM_ARCH & GLM_ARCH_AVX2_BIT) && (GLM_MODEL == GLM_MODEL_32) # pragma message("GLM: x86 32 bits with AVX2 instruction set build target") # elif (GLM_ARCH & GLM_ARCH_AVX_BIT) && (GLM_MODEL == GLM_MODEL_64) # pragma message("GLM: x86 64 bits with AVX instruction set build target") # elif (GLM_ARCH & GLM_ARCH_AVX_BIT) && (GLM_MODEL == GLM_MODEL_32) # pragma message("GLM: x86 32 bits with AVX instruction set build target") # elif (GLM_ARCH & GLM_ARCH_SSE42_BIT) && (GLM_MODEL == GLM_MODEL_64) # pragma message("GLM: x86 64 bits with SSE4.2 instruction set build target") # elif (GLM_ARCH & GLM_ARCH_SSE42_BIT) && (GLM_MODEL == GLM_MODEL_32) # pragma message("GLM: x86 32 bits with SSE4.2 instruction set build target") # elif (GLM_ARCH & GLM_ARCH_SSE41_BIT) && (GLM_MODEL == GLM_MODEL_64) # pragma message("GLM: x86 64 bits with SSE4.1 instruction set build target") # elif (GLM_ARCH & GLM_ARCH_SSE41_BIT) && (GLM_MODEL == GLM_MODEL_32) # pragma message("GLM: x86 32 bits with SSE4.1 instruction set build target") # elif (GLM_ARCH & GLM_ARCH_SSSE3_BIT) && (GLM_MODEL == GLM_MODEL_64) # pragma message("GLM: x86 64 bits with SSSE3 instruction set build target") # elif (GLM_ARCH & GLM_ARCH_SSSE3_BIT) && (GLM_MODEL == GLM_MODEL_32) # pragma message("GLM: x86 32 bits with SSSE3 instruction set build target") # elif (GLM_ARCH & GLM_ARCH_SSE3_BIT) && (GLM_MODEL == GLM_MODEL_64) # pragma message("GLM: x86 64 bits with SSE3 instruction set build target") # elif (GLM_ARCH & GLM_ARCH_SSE3_BIT) && (GLM_MODEL == GLM_MODEL_32) # pragma message("GLM: x86 32 bits with SSE3 instruction set build target") # elif (GLM_ARCH & GLM_ARCH_SSE2_BIT) && (GLM_MODEL == GLM_MODEL_64) # pragma message("GLM: x86 64 bits with SSE2 instruction set build target") # elif (GLM_ARCH & GLM_ARCH_SSE2_BIT) && (GLM_MODEL == GLM_MODEL_32) # pragma message("GLM: x86 32 bits with SSE2 instruction set build target") # elif (GLM_ARCH & GLM_ARCH_X86_BIT) && (GLM_MODEL == GLM_MODEL_64) # pragma message("GLM: x86 64 bits build target") # elif (GLM_ARCH & GLM_ARCH_X86_BIT) && (GLM_MODEL == GLM_MODEL_32) # pragma message("GLM: x86 32 bits build target") # elif (GLM_ARCH & GLM_ARCH_NEON_BIT) && (GLM_MODEL == GLM_MODEL_64) # pragma message("GLM: ARM 64 bits with Neon instruction set build target") # elif (GLM_ARCH & GLM_ARCH_NEON_BIT) && (GLM_MODEL == GLM_MODEL_32) # pragma message("GLM: ARM 32 bits with Neon instruction set build target") # elif (GLM_ARCH & GLM_ARCH_ARM_BIT) && (GLM_MODEL == GLM_MODEL_64) # pragma message("GLM: ARM 64 bits build target") # elif (GLM_ARCH & GLM_ARCH_ARM_BIT) && (GLM_MODEL == GLM_MODEL_32) # pragma message("GLM: ARM 32 bits build target") # elif (GLM_ARCH & GLM_ARCH_MIPS_BIT) && (GLM_MODEL == GLM_MODEL_64) # pragma message("GLM: MIPS 64 bits build target") # elif (GLM_ARCH & GLM_ARCH_MIPS_BIT) && (GLM_MODEL == GLM_MODEL_32) # pragma message("GLM: MIPS 32 bits build target") # elif (GLM_ARCH & GLM_ARCH_PPC_BIT) && (GLM_MODEL == GLM_MODEL_64) # pragma message("GLM: PowerPC 64 bits build target") # elif (GLM_ARCH & GLM_ARCH_PPC_BIT) && (GLM_MODEL == GLM_MODEL_32) # pragma message("GLM: PowerPC 32 bits build target") # else # pragma message("GLM: Unknown build target") # endif//GLM_ARCH // Report platform name # if(GLM_PLATFORM & GLM_PLATFORM_QNXNTO) # pragma message("GLM: QNX platform detected") //# elif(GLM_PLATFORM & GLM_PLATFORM_IOS) //# pragma message("GLM: iOS platform detected") # elif(GLM_PLATFORM & GLM_PLATFORM_APPLE) # pragma message("GLM: Apple platform detected") # elif(GLM_PLATFORM & GLM_PLATFORM_WINCE) # pragma message("GLM: WinCE platform detected") # elif(GLM_PLATFORM & GLM_PLATFORM_WINDOWS) # pragma message("GLM: Windows platform detected") # elif(GLM_PLATFORM & GLM_PLATFORM_CHROME_NACL) # pragma message("GLM: Native Client detected") # elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID) # pragma message("GLM: Android platform detected") # elif(GLM_PLATFORM & GLM_PLATFORM_LINUX) # pragma message("GLM: Linux platform detected") # elif(GLM_PLATFORM & GLM_PLATFORM_UNIX) # pragma message("GLM: UNIX platform detected") # elif(GLM_PLATFORM & GLM_PLATFORM_UNKNOWN) # pragma message("GLM: platform unknown") # else # pragma message("GLM: platform not detected") # endif // Report whether only xyzw component are used # if defined GLM_FORCE_XYZW_ONLY # pragma message("GLM: GLM_FORCE_XYZW_ONLY is defined. Only x, y, z and w component are available in vector type. This define disables swizzle operators and SIMD instruction sets.") # endif // Report swizzle operator support # if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR # pragma message("GLM: GLM_FORCE_SWIZZLE is defined, swizzling operators enabled.") # elif GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION # pragma message("GLM: GLM_FORCE_SWIZZLE is defined, swizzling functions enabled. Enable compiler C++ language extensions to enable swizzle operators.") # else # pragma message("GLM: GLM_FORCE_SWIZZLE is undefined. swizzling functions or operators are disabled.") # endif // Report .length() type # if GLM_CONFIG_LENGTH_TYPE == GLM_LENGTH_SIZE_T # pragma message("GLM: GLM_FORCE_SIZE_T_LENGTH is defined. .length() returns a glm::length_t, a typedef of std::size_t.") # else # pragma message("GLM: GLM_FORCE_SIZE_T_LENGTH is undefined. .length() returns a glm::length_t, a typedef of int following GLSL.") # endif # if GLM_CONFIG_UNRESTRICTED_GENTYPE == GLM_ENABLE # pragma message("GLM: GLM_FORCE_UNRESTRICTED_GENTYPE is defined. Removes GLSL restrictions on valid function genTypes.") # else # pragma message("GLM: GLM_FORCE_UNRESTRICTED_GENTYPE is undefined. Follows strictly GLSL on valid function genTypes.") # endif # if GLM_SILENT_WARNINGS == GLM_ENABLE # pragma message("GLM: GLM_FORCE_SILENT_WARNINGS is defined. Ignores C++ warnings from using C++ language extensions.") # else # pragma message("GLM: GLM_FORCE_SILENT_WARNINGS is undefined. Shows C++ warnings from using C++ language extensions.") # endif # ifdef GLM_FORCE_SINGLE_ONLY # pragma message("GLM: GLM_FORCE_SINGLE_ONLY is defined. Using only single precision floating-point types.") # endif # if defined(GLM_FORCE_ALIGNED_GENTYPES) && (GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE) # undef GLM_FORCE_ALIGNED_GENTYPES # pragma message("GLM: GLM_FORCE_ALIGNED_GENTYPES is defined, allowing aligned types. This prevents the use of C++ constexpr.") # elif defined(GLM_FORCE_ALIGNED_GENTYPES) && (GLM_CONFIG_ALIGNED_GENTYPES == GLM_DISABLE) # undef GLM_FORCE_ALIGNED_GENTYPES # pragma message("GLM: GLM_FORCE_ALIGNED_GENTYPES is defined but is disabled. It requires C++11 and language extensions.") # endif # if defined(GLM_FORCE_DEFAULT_ALIGNED_GENTYPES) # if GLM_CONFIG_ALIGNED_GENTYPES == GLM_DISABLE # undef GLM_FORCE_DEFAULT_ALIGNED_GENTYPES # pragma message("GLM: GLM_FORCE_DEFAULT_ALIGNED_GENTYPES is defined but is disabled. It requires C++11 and language extensions.") # elif GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE # pragma message("GLM: GLM_FORCE_DEFAULT_ALIGNED_GENTYPES is defined. All gentypes (e.g. vec3) will be aligned and padded by default.") # endif # endif # if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT # pragma message("GLM: GLM_FORCE_DEPTH_ZERO_TO_ONE is defined. Using zero to one depth clip space.") # else # pragma message("GLM: GLM_FORCE_DEPTH_ZERO_TO_ONE is undefined. Using negative one to one depth clip space.") # endif # if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT # pragma message("GLM: GLM_FORCE_LEFT_HANDED is defined. Using left handed coordinate system.") # else # pragma message("GLM: GLM_FORCE_LEFT_HANDED is undefined. Using right handed coordinate system.") # endif #endif//GLM_MESSAGES #endif//GLM_SETUP_INCLUDED
Unknown
3D
mcellteam/mcell
libs/glm/detail/type_mat2x3.hpp
.hpp
5,455
160
/// @ref core /// @file glm/detail/type_mat2x3.hpp #pragma once #include "type_vec2.hpp" #include "type_vec3.hpp" #include <limits> #include <cstddef> namespace glm { template<typename T, qualifier Q> struct mat<2, 3, T, Q> { typedef vec<3, T, Q> col_type; typedef vec<2, T, Q> row_type; typedef mat<2, 3, T, Q> type; typedef mat<3, 2, T, Q> transpose_type; typedef T value_type; private: col_type value[2]; public: // -- Accesses -- typedef length_t length_type; GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 2; } GLM_FUNC_DECL col_type & operator[](length_type i); GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const; // -- Constructors -- GLM_FUNC_DECL GLM_CONSTEXPR mat() GLM_DEFAULT; template<qualifier P> GLM_FUNC_DECL GLM_CONSTEXPR mat(mat<2, 3, T, P> const& m); GLM_FUNC_DECL explicit GLM_CONSTEXPR mat(T scalar); GLM_FUNC_DECL GLM_CONSTEXPR mat( T x0, T y0, T z0, T x1, T y1, T z1); GLM_FUNC_DECL GLM_CONSTEXPR mat( col_type const& v0, col_type const& v1); // -- Conversions -- template<typename X1, typename Y1, typename Z1, typename X2, typename Y2, typename Z2> GLM_FUNC_DECL GLM_CONSTEXPR mat( X1 x1, Y1 y1, Z1 z1, X2 x2, Y2 y2, Z2 z2); template<typename U, typename V> GLM_FUNC_DECL GLM_CONSTEXPR mat( vec<3, U, Q> const& v1, vec<3, V, Q> const& v2); // -- Matrix conversions -- template<typename U, qualifier P> GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 3, U, P> const& m); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 2, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 3, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 4, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 4, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 2, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 4, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 2, T, Q> const& x); GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 3, T, Q> const& x); // -- Unary arithmetic operators -- template<typename U> GLM_FUNC_DECL mat<2, 3, T, Q> & operator=(mat<2, 3, U, Q> const& m); template<typename U> GLM_FUNC_DECL mat<2, 3, T, Q> & operator+=(U s); template<typename U> GLM_FUNC_DECL mat<2, 3, T, Q> & operator+=(mat<2, 3, U, Q> const& m); template<typename U> GLM_FUNC_DECL mat<2, 3, T, Q> & operator-=(U s); template<typename U> GLM_FUNC_DECL mat<2, 3, T, Q> & operator-=(mat<2, 3, U, Q> const& m); template<typename U> GLM_FUNC_DECL mat<2, 3, T, Q> & operator*=(U s); template<typename U> GLM_FUNC_DECL mat<2, 3, T, Q> & operator/=(U s); // -- Increment and decrement operators -- GLM_FUNC_DECL mat<2, 3, T, Q> & operator++ (); GLM_FUNC_DECL mat<2, 3, T, Q> & operator-- (); GLM_FUNC_DECL mat<2, 3, T, Q> operator++(int); GLM_FUNC_DECL mat<2, 3, T, Q> operator--(int); }; // -- Unary operators -- template<typename T, qualifier Q> GLM_FUNC_DECL mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m); template<typename T, qualifier Q> GLM_FUNC_DECL mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m); // -- Binary operators -- template<typename T, qualifier Q> GLM_FUNC_DECL mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL mat<2, 3, T, Q> operator*(mat<2, 3, T, Q> const& m, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL mat<2, 3, T, Q> operator*(T scalar, mat<2, 3, T, Q> const& m); template<typename T, qualifier Q> GLM_FUNC_DECL typename mat<2, 3, T, Q>::col_type operator*(mat<2, 3, T, Q> const& m, typename mat<2, 3, T, Q>::row_type const& v); template<typename T, qualifier Q> GLM_FUNC_DECL typename mat<2, 3, T, Q>::row_type operator*(typename mat<2, 3, T, Q>::col_type const& v, mat<2, 3, T, Q> const& m); template<typename T, qualifier Q> GLM_FUNC_DECL mat<2, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<2, 2, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL mat<3, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<3, 2, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL mat<4, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<4, 2, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL mat<2, 3, T, Q> operator/(mat<2, 3, T, Q> const& m, T scalar); template<typename T, qualifier Q> GLM_FUNC_DECL mat<2, 3, T, Q> operator/(T scalar, mat<2, 3, T, Q> const& m); // -- Boolean operators -- template<typename T, qualifier Q> GLM_FUNC_DECL bool operator==(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2); template<typename T, qualifier Q> GLM_FUNC_DECL bool operator!=(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2); }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE #include "type_mat2x3.inl" #endif
Unknown
3D
mcellteam/mcell
libs/glm/detail/glm.cpp
.cpp
8,687
262
/// @ref core /// @file glm/glm.cpp #define GLM_ENABLE_EXPERIMENTAL #include <glm/gtx/dual_quaternion.hpp> #include <glm/gtc/vec1.hpp> #include <glm/gtc/quaternion.hpp> #include <glm/ext/scalar_int_sized.hpp> #include <glm/ext/scalar_uint_sized.hpp> #include <glm/glm.hpp> namespace glm { // tvec1 type explicit instantiation template struct vec<1, uint8, lowp>; template struct vec<1, uint16, lowp>; template struct vec<1, uint32, lowp>; template struct vec<1, uint64, lowp>; template struct vec<1, int8, lowp>; template struct vec<1, int16, lowp>; template struct vec<1, int32, lowp>; template struct vec<1, int64, lowp>; template struct vec<1, float32, lowp>; template struct vec<1, float64, lowp>; template struct vec<1, uint8, mediump>; template struct vec<1, uint16, mediump>; template struct vec<1, uint32, mediump>; template struct vec<1, uint64, mediump>; template struct vec<1, int8, mediump>; template struct vec<1, int16, mediump>; template struct vec<1, int32, mediump>; template struct vec<1, int64, mediump>; template struct vec<1, float32, mediump>; template struct vec<1, float64, mediump>; template struct vec<1, uint8, highp>; template struct vec<1, uint16, highp>; template struct vec<1, uint32, highp>; template struct vec<1, uint64, highp>; template struct vec<1, int8, highp>; template struct vec<1, int16, highp>; template struct vec<1, int32, highp>; template struct vec<1, int64, highp>; template struct vec<1, float32, highp>; template struct vec<1, float64, highp>; // tvec2 type explicit instantiation template struct vec<2, uint8, lowp>; template struct vec<2, uint16, lowp>; template struct vec<2, uint32, lowp>; template struct vec<2, uint64, lowp>; template struct vec<2, int8, lowp>; template struct vec<2, int16, lowp>; template struct vec<2, int32, lowp>; template struct vec<2, int64, lowp>; template struct vec<2, float32, lowp>; template struct vec<2, float64, lowp>; template struct vec<2, uint8, mediump>; template struct vec<2, uint16, mediump>; template struct vec<2, uint32, mediump>; template struct vec<2, uint64, mediump>; template struct vec<2, int8, mediump>; template struct vec<2, int16, mediump>; template struct vec<2, int32, mediump>; template struct vec<2, int64, mediump>; template struct vec<2, float32, mediump>; template struct vec<2, float64, mediump>; template struct vec<2, uint8, highp>; template struct vec<2, uint16, highp>; template struct vec<2, uint32, highp>; template struct vec<2, uint64, highp>; template struct vec<2, int8, highp>; template struct vec<2, int16, highp>; template struct vec<2, int32, highp>; template struct vec<2, int64, highp>; template struct vec<2, float32, highp>; template struct vec<2, float64, highp>; // tvec3 type explicit instantiation template struct vec<3, uint8, lowp>; template struct vec<3, uint16, lowp>; template struct vec<3, uint32, lowp>; template struct vec<3, uint64, lowp>; template struct vec<3, int8, lowp>; template struct vec<3, int16, lowp>; template struct vec<3, int32, lowp>; template struct vec<3, int64, lowp>; template struct vec<3, float32, lowp>; template struct vec<3, float64, lowp>; template struct vec<3, uint8, mediump>; template struct vec<3, uint16, mediump>; template struct vec<3, uint32, mediump>; template struct vec<3, uint64, mediump>; template struct vec<3, int8, mediump>; template struct vec<3, int16, mediump>; template struct vec<3, int32, mediump>; template struct vec<3, int64, mediump>; template struct vec<3, float32, mediump>; template struct vec<3, float64, mediump>; template struct vec<3, uint8, highp>; template struct vec<3, uint16, highp>; template struct vec<3, uint32, highp>; template struct vec<3, uint64, highp>; template struct vec<3, int8, highp>; template struct vec<3, int16, highp>; template struct vec<3, int32, highp>; template struct vec<3, int64, highp>; template struct vec<3, float32, highp>; template struct vec<3, float64, highp>; // tvec4 type explicit instantiation template struct vec<4, uint8, lowp>; template struct vec<4, uint16, lowp>; template struct vec<4, uint32, lowp>; template struct vec<4, uint64, lowp>; template struct vec<4, int8, lowp>; template struct vec<4, int16, lowp>; template struct vec<4, int32, lowp>; template struct vec<4, int64, lowp>; template struct vec<4, float32, lowp>; template struct vec<4, float64, lowp>; template struct vec<4, uint8, mediump>; template struct vec<4, uint16, mediump>; template struct vec<4, uint32, mediump>; template struct vec<4, uint64, mediump>; template struct vec<4, int8, mediump>; template struct vec<4, int16, mediump>; template struct vec<4, int32, mediump>; template struct vec<4, int64, mediump>; template struct vec<4, float32, mediump>; template struct vec<4, float64, mediump>; template struct vec<4, uint8, highp>; template struct vec<4, uint16, highp>; template struct vec<4, uint32, highp>; template struct vec<4, uint64, highp>; template struct vec<4, int8, highp>; template struct vec<4, int16, highp>; template struct vec<4, int32, highp>; template struct vec<4, int64, highp>; template struct vec<4, float32, highp>; template struct vec<4, float64, highp>; // tmat2x2 type explicit instantiation template struct mat<2, 2, float32, lowp>; template struct mat<2, 2, float64, lowp>; template struct mat<2, 2, float32, mediump>; template struct mat<2, 2, float64, mediump>; template struct mat<2, 2, float32, highp>; template struct mat<2, 2, float64, highp>; // tmat2x3 type explicit instantiation template struct mat<2, 3, float32, lowp>; template struct mat<2, 3, float64, lowp>; template struct mat<2, 3, float32, mediump>; template struct mat<2, 3, float64, mediump>; template struct mat<2, 3, float32, highp>; template struct mat<2, 3, float64, highp>; // tmat2x4 type explicit instantiation template struct mat<2, 4, float32, lowp>; template struct mat<2, 4, float64, lowp>; template struct mat<2, 4, float32, mediump>; template struct mat<2, 4, float64, mediump>; template struct mat<2, 4, float32, highp>; template struct mat<2, 4, float64, highp>; // tmat3x2 type explicit instantiation template struct mat<3, 2, float32, lowp>; template struct mat<3, 2, float64, lowp>; template struct mat<3, 2, float32, mediump>; template struct mat<3, 2, float64, mediump>; template struct mat<3, 2, float32, highp>; template struct mat<3, 2, float64, highp>; // tmat3x3 type explicit instantiation template struct mat<3, 3, float32, lowp>; template struct mat<3, 3, float64, lowp>; template struct mat<3, 3, float32, mediump>; template struct mat<3, 3, float64, mediump>; template struct mat<3, 3, float32, highp>; template struct mat<3, 3, float64, highp>; // tmat3x4 type explicit instantiation template struct mat<3, 4, float32, lowp>; template struct mat<3, 4, float64, lowp>; template struct mat<3, 4, float32, mediump>; template struct mat<3, 4, float64, mediump>; template struct mat<3, 4, float32, highp>; template struct mat<3, 4, float64, highp>; // tmat4x2 type explicit instantiation template struct mat<4, 2, float32, lowp>; template struct mat<4, 2, float64, lowp>; template struct mat<4, 2, float32, mediump>; template struct mat<4, 2, float64, mediump>; template struct mat<4, 2, float32, highp>; template struct mat<4, 2, float64, highp>; // tmat4x3 type explicit instantiation template struct mat<4, 3, float32, lowp>; template struct mat<4, 3, float64, lowp>; template struct mat<4, 3, float32, mediump>; template struct mat<4, 3, float64, mediump>; template struct mat<4, 3, float32, highp>; template struct mat<4, 3, float64, highp>; // tmat4x4 type explicit instantiation template struct mat<4, 4, float32, lowp>; template struct mat<4, 4, float64, lowp>; template struct mat<4, 4, float32, mediump>; template struct mat<4, 4, float64, mediump>; template struct mat<4, 4, float32, highp>; template struct mat<4, 4, float64, highp>; // tquat type explicit instantiation template struct qua<float32, lowp>; template struct qua<float64, lowp>; template struct qua<float32, mediump>; template struct qua<float64, mediump>; template struct qua<float32, highp>; template struct qua<float64, highp>; //tdualquat type explicit instantiation template struct tdualquat<float32, lowp>; template struct tdualquat<float64, lowp>; template struct tdualquat<float32, mediump>; template struct tdualquat<float64, mediump>; template struct tdualquat<float32, highp>; template struct tdualquat<float64, highp>; }//namespace glm
C++
3D
mcellteam/mcell
libs/glm/detail/_swizzle_func.hpp
.hpp
35,019
683
#pragma once #define GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, CONST, A, B) \ vec<2, T, Q> A ## B() CONST \ { \ return vec<2, T, Q>(this->A, this->B); \ } #define GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, CONST, A, B, C) \ vec<3, T, Q> A ## B ## C() CONST \ { \ return vec<3, T, Q>(this->A, this->B, this->C); \ } #define GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, CONST, A, B, C, D) \ vec<4, T, Q> A ## B ## C ## D() CONST \ { \ return vec<4, T, Q>(this->A, this->B, this->C, this->D); \ } #define GLM_SWIZZLE_GEN_VEC2_ENTRY_DEF(T, P, L, CONST, A, B) \ template<typename T> \ vec<L, T, Q> vec<L, T, Q>::A ## B() CONST \ { \ return vec<2, T, Q>(this->A, this->B); \ } #define GLM_SWIZZLE_GEN_VEC3_ENTRY_DEF(T, P, L, CONST, A, B, C) \ template<typename T> \ vec<3, T, Q> vec<L, T, Q>::A ## B ## C() CONST \ { \ return vec<3, T, Q>(this->A, this->B, this->C); \ } #define GLM_SWIZZLE_GEN_VEC4_ENTRY_DEF(T, P, L, CONST, A, B, C, D) \ template<typename T> \ vec<4, T, Q> vec<L, T, Q>::A ## B ## C ## D() CONST \ { \ return vec<4, T, Q>(this->A, this->B, this->C, this->D); \ } #define GLM_MUTABLE #define GLM_SWIZZLE_GEN_REF2_FROM_VEC2_SWIZZLE(T, P, A, B) \ GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, 2, GLM_MUTABLE, A, B) \ GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, 2, GLM_MUTABLE, B, A) #define GLM_SWIZZLE_GEN_REF_FROM_VEC2(T, P) \ GLM_SWIZZLE_GEN_REF2_FROM_VEC2_SWIZZLE(T, P, x, y) \ GLM_SWIZZLE_GEN_REF2_FROM_VEC2_SWIZZLE(T, P, r, g) \ GLM_SWIZZLE_GEN_REF2_FROM_VEC2_SWIZZLE(T, P, s, t) #define GLM_SWIZZLE_GEN_REF2_FROM_VEC3_SWIZZLE(T, P, A, B, C) \ GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, A, B) \ GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, A, C) \ GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, B, A) \ GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, B, C) \ GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, C, A) \ GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, C, B) #define GLM_SWIZZLE_GEN_REF3_FROM_VEC3_SWIZZLE(T, P, A, B, C) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, GLM_MUTABLE, A, B, C) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, GLM_MUTABLE, A, C, B) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, GLM_MUTABLE, B, A, C) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, GLM_MUTABLE, B, C, A) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, GLM_MUTABLE, C, A, B) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, GLM_MUTABLE, C, B, A) #define GLM_SWIZZLE_GEN_REF_FROM_VEC3_COMP(T, P, A, B, C) \ GLM_SWIZZLE_GEN_REF3_FROM_VEC3_SWIZZLE(T, P, A, B, C) \ GLM_SWIZZLE_GEN_REF2_FROM_VEC3_SWIZZLE(T, P, A, B, C) #define GLM_SWIZZLE_GEN_REF_FROM_VEC3(T, P) \ GLM_SWIZZLE_GEN_REF_FROM_VEC3_COMP(T, P, x, y, z) \ GLM_SWIZZLE_GEN_REF_FROM_VEC3_COMP(T, P, r, g, b) \ GLM_SWIZZLE_GEN_REF_FROM_VEC3_COMP(T, P, s, t, p) #define GLM_SWIZZLE_GEN_REF2_FROM_VEC4_SWIZZLE(T, P, A, B, C, D) \ GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, A, B) \ GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, A, C) \ GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, A, D) \ GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, B, A) \ GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, B, C) \ GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, B, D) \ GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, C, A) \ GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, C, B) \ GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, C, D) \ GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, D, A) \ GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, D, B) \ GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, D, C) #define GLM_SWIZZLE_GEN_REF3_FROM_VEC4_SWIZZLE(T, P, A, B, C, D) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , A, B, C) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , A, B, D) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , A, C, B) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , A, C, D) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , A, D, B) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , A, D, C) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , B, A, C) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , B, A, D) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , B, C, A) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , B, C, D) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , B, D, A) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , B, D, C) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , C, A, B) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , C, A, D) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , C, B, A) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , C, B, D) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , C, D, A) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , C, D, B) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , D, A, B) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , D, A, C) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , D, B, A) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , D, B, C) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , D, C, A) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , D, C, B) #define GLM_SWIZZLE_GEN_REF4_FROM_VEC4_SWIZZLE(T, P, A, B, C, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , A, C, B, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , A, C, D, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , A, D, B, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , A, D, C, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , A, B, D, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , A, B, C, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , B, C, A, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , B, C, D, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , B, D, A, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , B, D, C, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , B, A, D, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , B, A, C, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , C, B, A, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , C, B, D, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , C, D, A, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , C, D, B, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , C, A, D, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , C, A, B, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , D, C, B, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , D, C, A, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , D, A, B, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , D, A, C, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , D, B, A, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , D, B, C, A) #define GLM_SWIZZLE_GEN_REF_FROM_VEC4_COMP(T, P, A, B, C, D) \ GLM_SWIZZLE_GEN_REF2_FROM_VEC4_SWIZZLE(T, P, A, B, C, D) \ GLM_SWIZZLE_GEN_REF3_FROM_VEC4_SWIZZLE(T, P, A, B, C, D) \ GLM_SWIZZLE_GEN_REF4_FROM_VEC4_SWIZZLE(T, P, A, B, C, D) #define GLM_SWIZZLE_GEN_REF_FROM_VEC4(T, P) \ GLM_SWIZZLE_GEN_REF_FROM_VEC4_COMP(T, P, x, y, z, w) \ GLM_SWIZZLE_GEN_REF_FROM_VEC4_COMP(T, P, r, g, b, a) \ GLM_SWIZZLE_GEN_REF_FROM_VEC4_COMP(T, P, s, t, p, q) #define GLM_SWIZZLE_GEN_VEC2_FROM_VEC2_SWIZZLE(T, P, A, B) \ GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, A, A) \ GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, A, B) \ GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, B, A) \ GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, B, B) #define GLM_SWIZZLE_GEN_VEC3_FROM_VEC2_SWIZZLE(T, P, A, B) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, A, A) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, A, B) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, B, A) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, B, B) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, A, A) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, A, B) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, B, A) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, B, B) #define GLM_SWIZZLE_GEN_VEC4_FROM_VEC2_SWIZZLE(T, P, A, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, A, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, A, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, B, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, B, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, A, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, A, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, B, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, B, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, A, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, A, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, B, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, B, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, A, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, A, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, B, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, B, B) #define GLM_SWIZZLE_GEN_VEC_FROM_VEC2_COMP(T, P, A, B) \ GLM_SWIZZLE_GEN_VEC2_FROM_VEC2_SWIZZLE(T, P, A, B) \ GLM_SWIZZLE_GEN_VEC3_FROM_VEC2_SWIZZLE(T, P, A, B) \ GLM_SWIZZLE_GEN_VEC4_FROM_VEC2_SWIZZLE(T, P, A, B) #define GLM_SWIZZLE_GEN_VEC_FROM_VEC2(T, P) \ GLM_SWIZZLE_GEN_VEC_FROM_VEC2_COMP(T, P, x, y) \ GLM_SWIZZLE_GEN_VEC_FROM_VEC2_COMP(T, P, r, g) \ GLM_SWIZZLE_GEN_VEC_FROM_VEC2_COMP(T, P, s, t) #define GLM_SWIZZLE_GEN_VEC2_FROM_VEC3_SWIZZLE(T, P, A, B, C) \ GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, A, A) \ GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, A, B) \ GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, A, C) \ GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, B, A) \ GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, B, B) \ GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, B, C) \ GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, C, A) \ GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, C, B) \ GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, C, C) #define GLM_SWIZZLE_GEN_VEC3_FROM_VEC3_SWIZZLE(T, P, A, B, C) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, A, A) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, A, B) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, A, C) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, B, A) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, B, B) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, B, C) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, C, A) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, C, B) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, C, C) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, A, A) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, A, B) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, A, C) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, B, A) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, B, B) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, B, C) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, C, A) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, C, B) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, C, C) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, A, A) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, A, B) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, A, C) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, B, A) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, B, B) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, B, C) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, C, A) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, C, B) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, C, C) #define GLM_SWIZZLE_GEN_VEC4_FROM_VEC3_SWIZZLE(T, P, A, B, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, A, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, A, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, A, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, B, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, B, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, B, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, C, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, C, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, C, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, A, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, A, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, A, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, B, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, B, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, B, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, C, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, C, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, C, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, A, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, A, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, A, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, B, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, B, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, B, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, C, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, C, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, C, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, A, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, A, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, A, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, B, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, B, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, B, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, C, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, C, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, C, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, A, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, A, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, A, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, B, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, B, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, B, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, C, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, C, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, C, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, A, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, A, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, A, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, B, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, B, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, B, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, C, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, C, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, C, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, A, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, A, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, A, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, B, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, B, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, B, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, C, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, C, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, C, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, A, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, A, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, A, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, B, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, B, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, B, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, C, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, C, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, C, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, A, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, A, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, A, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, B, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, B, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, B, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, C, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, C, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, C, C) #define GLM_SWIZZLE_GEN_VEC_FROM_VEC3_COMP(T, P, A, B, C) \ GLM_SWIZZLE_GEN_VEC2_FROM_VEC3_SWIZZLE(T, P, A, B, C) \ GLM_SWIZZLE_GEN_VEC3_FROM_VEC3_SWIZZLE(T, P, A, B, C) \ GLM_SWIZZLE_GEN_VEC4_FROM_VEC3_SWIZZLE(T, P, A, B, C) #define GLM_SWIZZLE_GEN_VEC_FROM_VEC3(T, P) \ GLM_SWIZZLE_GEN_VEC_FROM_VEC3_COMP(T, P, x, y, z) \ GLM_SWIZZLE_GEN_VEC_FROM_VEC3_COMP(T, P, r, g, b) \ GLM_SWIZZLE_GEN_VEC_FROM_VEC3_COMP(T, P, s, t, p) #define GLM_SWIZZLE_GEN_VEC2_FROM_VEC4_SWIZZLE(T, P, A, B, C, D) \ GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, A, A) \ GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, A, B) \ GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, A, C) \ GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, A, D) \ GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, B, A) \ GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, B, B) \ GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, B, C) \ GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, B, D) \ GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, C, A) \ GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, C, B) \ GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, C, C) \ GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, C, D) \ GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, D, A) \ GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, D, B) \ GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, D, C) \ GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, D, D) #define GLM_SWIZZLE_GEN_VEC3_FROM_VEC4_SWIZZLE(T, P, A, B, C, D) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, A, A) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, A, B) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, A, C) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, A, D) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, B, A) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, B, B) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, B, C) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, B, D) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, C, A) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, C, B) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, C, C) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, C, D) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, D, A) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, D, B) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, D, C) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, D, D) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, A, A) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, A, B) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, A, C) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, A, D) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, B, A) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, B, B) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, B, C) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, B, D) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, C, A) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, C, B) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, C, C) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, C, D) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, D, A) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, D, B) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, D, C) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, D, D) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, A, A) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, A, B) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, A, C) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, A, D) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, B, A) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, B, B) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, B, C) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, B, D) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, C, A) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, C, B) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, C, C) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, C, D) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, D, A) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, D, B) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, D, C) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, D, D) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, A, A) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, A, B) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, A, C) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, A, D) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, B, A) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, B, B) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, B, C) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, B, D) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, C, A) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, C, B) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, C, C) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, C, D) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, D, A) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, D, B) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, D, C) \ GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, D, D) #define GLM_SWIZZLE_GEN_VEC4_FROM_VEC4_SWIZZLE(T, P, A, B, C, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, A, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, A, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, A, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, A, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, B, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, B, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, B, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, B, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, C, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, C, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, C, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, C, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, D, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, D, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, D, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, D, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, A, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, A, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, A, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, A, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, B, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, B, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, B, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, B, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, C, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, C, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, C, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, C, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, D, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, D, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, D, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, D, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, A, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, A, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, A, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, A, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, B, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, B, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, B, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, B, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, C, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, C, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, C, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, C, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, D, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, D, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, D, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, D, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, A, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, A, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, A, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, A, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, B, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, B, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, B, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, B, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, C, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, C, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, C, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, C, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, D, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, D, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, D, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, D, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, A, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, A, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, A, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, A, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, B, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, B, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, B, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, B, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, C, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, C, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, C, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, C, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, D, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, D, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, D, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, D, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, A, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, A, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, A, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, A, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, B, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, B, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, B, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, B, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, C, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, C, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, C, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, C, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, D, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, D, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, D, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, D, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, A, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, A, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, A, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, A, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, B, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, B, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, B, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, B, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, C, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, C, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, C, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, C, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, D, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, D, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, D, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, D, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, A, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, A, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, A, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, A, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, B, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, B, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, B, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, B, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, C, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, C, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, C, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, C, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, D, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, D, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, D, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, D, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, A, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, A, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, A, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, A, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, B, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, B, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, B, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, B, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, C, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, C, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, C, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, C, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, D, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, D, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, D, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, D, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, A, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, A, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, A, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, A, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, B, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, B, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, B, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, B, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, C, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, C, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, C, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, C, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, D, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, D, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, D, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, D, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, A, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, A, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, A, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, A, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, B, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, B, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, B, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, B, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, C, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, C, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, C, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, C, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, D, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, D, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, D, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, D, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, A, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, A, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, A, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, A, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, B, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, B, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, B, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, B, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, C, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, C, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, C, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, C, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, D, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, D, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, D, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, D, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, A, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, A, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, A, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, A, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, B, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, B, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, B, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, B, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, C, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, C, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, C, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, C, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, D, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, D, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, D, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, D, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, A, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, A, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, A, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, A, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, B, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, B, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, B, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, B, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, C, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, C, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, C, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, C, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, D, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, D, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, D, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, D, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, A, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, A, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, A, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, A, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, B, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, B, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, B, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, B, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, C, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, C, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, C, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, C, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, D, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, D, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, D, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, D, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, A, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, A, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, A, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, A, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, B, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, B, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, B, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, B, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, C, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, C, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, C, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, C, D) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, D, A) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, D, B) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, D, C) \ GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, D, D) #define GLM_SWIZZLE_GEN_VEC_FROM_VEC4_COMP(T, P, A, B, C, D) \ GLM_SWIZZLE_GEN_VEC2_FROM_VEC4_SWIZZLE(T, P, A, B, C, D) \ GLM_SWIZZLE_GEN_VEC3_FROM_VEC4_SWIZZLE(T, P, A, B, C, D) \ GLM_SWIZZLE_GEN_VEC4_FROM_VEC4_SWIZZLE(T, P, A, B, C, D) #define GLM_SWIZZLE_GEN_VEC_FROM_VEC4(T, P) \ GLM_SWIZZLE_GEN_VEC_FROM_VEC4_COMP(T, P, x, y, z, w) \ GLM_SWIZZLE_GEN_VEC_FROM_VEC4_COMP(T, P, r, g, b, a) \ GLM_SWIZZLE_GEN_VEC_FROM_VEC4_COMP(T, P, s, t, p, q)
Unknown
3D
mcellteam/mcell
libs/glm/detail/_features.hpp
.hpp
11,770
395
#pragma once // #define GLM_CXX98_EXCEPTIONS // #define GLM_CXX98_RTTI // #define GLM_CXX11_RVALUE_REFERENCES // Rvalue references - GCC 4.3 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2118.html // GLM_CXX11_TRAILING_RETURN // Rvalue references for *this - GCC not supported // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2439.htm // GLM_CXX11_NONSTATIC_MEMBER_INIT // Initialization of class objects by rvalues - GCC any // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1610.html // GLM_CXX11_NONSTATIC_MEMBER_INIT // Non-static data member initializers - GCC 4.7 // http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2008/n2756.htm // #define GLM_CXX11_VARIADIC_TEMPLATE // Variadic templates - GCC 4.3 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2242.pdf // // Extending variadic template template parameters - GCC 4.4 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2555.pdf // #define GLM_CXX11_GENERALIZED_INITIALIZERS // Initializer lists - GCC 4.4 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2672.htm // #define GLM_CXX11_STATIC_ASSERT // Static assertions - GCC 4.3 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1720.html // #define GLM_CXX11_AUTO_TYPE // auto-typed variables - GCC 4.4 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1984.pdf // #define GLM_CXX11_AUTO_TYPE // Multi-declarator auto - GCC 4.4 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1737.pdf // #define GLM_CXX11_AUTO_TYPE // Removal of auto as a storage-class specifier - GCC 4.4 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2546.htm // #define GLM_CXX11_AUTO_TYPE // New function declarator syntax - GCC 4.4 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2541.htm // #define GLM_CXX11_LAMBDAS // New wording for C++0x lambdas - GCC 4.5 // http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2927.pdf // #define GLM_CXX11_DECLTYPE // Declared type of an expression - GCC 4.3 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2343.pdf // // Right angle brackets - GCC 4.3 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1757.html // // Default template arguments for function templates DR226 GCC 4.3 // http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#226 // // Solving the SFINAE problem for expressions DR339 GCC 4.4 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2634.html // #define GLM_CXX11_ALIAS_TEMPLATE // Template aliases N2258 GCC 4.7 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf // // Extern templates N1987 Yes // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1987.htm // #define GLM_CXX11_NULLPTR // Null pointer constant N2431 GCC 4.6 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf // #define GLM_CXX11_STRONG_ENUMS // Strongly-typed enums N2347 GCC 4.4 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf // // Forward declarations for enums N2764 GCC 4.6 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2764.pdf // // Generalized attributes N2761 GCC 4.8 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2761.pdf // // Generalized constant expressions N2235 GCC 4.6 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2235.pdf // // Alignment support N2341 GCC 4.8 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf // #define GLM_CXX11_DELEGATING_CONSTRUCTORS // Delegating constructors N1986 GCC 4.7 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1986.pdf // // Inheriting constructors N2540 GCC 4.8 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2540.htm // #define GLM_CXX11_EXPLICIT_CONVERSIONS // Explicit conversion operators N2437 GCC 4.5 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf // // New character types N2249 GCC 4.4 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2249.html // // Unicode string literals N2442 GCC 4.5 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm // // Raw string literals N2442 GCC 4.5 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm // // Universal character name literals N2170 GCC 4.5 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2170.html // #define GLM_CXX11_USER_LITERALS // User-defined literals N2765 GCC 4.7 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2765.pdf // // Standard Layout Types N2342 GCC 4.5 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2342.htm // #define GLM_CXX11_DEFAULTED_FUNCTIONS // #define GLM_CXX11_DELETED_FUNCTIONS // Defaulted and deleted functions N2346 GCC 4.4 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2346.htm // // Extended friend declarations N1791 GCC 4.7 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1791.pdf // // Extending sizeof N2253 GCC 4.4 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2253.html // #define GLM_CXX11_INLINE_NAMESPACES // Inline namespaces N2535 GCC 4.4 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2535.htm // #define GLM_CXX11_UNRESTRICTED_UNIONS // Unrestricted unions N2544 GCC 4.6 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2544.pdf // #define GLM_CXX11_LOCAL_TYPE_TEMPLATE_ARGS // Local and unnamed types as template arguments N2657 GCC 4.5 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2657.htm // #define GLM_CXX11_RANGE_FOR // Range-based for N2930 GCC 4.6 // http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2930.html // #define GLM_CXX11_OVERRIDE_CONTROL // Explicit virtual overrides N2928 N3206 N3272 GCC 4.7 // http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2928.htm // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3206.htm // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3272.htm // // Minimal support for garbage collection and reachability-based leak detection N2670 No // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2670.htm // #define GLM_CXX11_NOEXCEPT // Allowing move constructors to throw [noexcept] N3050 GCC 4.6 (core language only) // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3050.html // // Defining move special member functions N3053 GCC 4.6 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3053.html // // Sequence points N2239 Yes // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2239.html // // Atomic operations N2427 GCC 4.4 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2239.html // // Strong Compare and Exchange N2748 GCC 4.5 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2427.html // // Bidirectional Fences N2752 GCC 4.8 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2752.htm // // Memory model N2429 GCC 4.8 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2429.htm // // Data-dependency ordering: atomics and memory model N2664 GCC 4.4 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2664.htm // // Propagating exceptions N2179 GCC 4.4 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html // // Abandoning a process and at_quick_exit N2440 GCC 4.8 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2440.htm // // Allow atomics use in signal handlers N2547 Yes // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2547.htm // // Thread-local storage N2659 GCC 4.8 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2659.htm // // Dynamic initialization and destruction with concurrency N2660 GCC 4.3 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2660.htm // // __func__ predefined identifier N2340 GCC 4.3 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2340.htm // // C99 preprocessor N1653 GCC 4.3 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1653.htm // // long long N1811 GCC 4.3 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1811.pdf // // Extended integral types N1988 Yes // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1988.pdf #if(GLM_COMPILER & GLM_COMPILER_GCC) # define GLM_CXX11_STATIC_ASSERT #elif(GLM_COMPILER & GLM_COMPILER_CLANG) # if(__has_feature(cxx_exceptions)) # define GLM_CXX98_EXCEPTIONS # endif # if(__has_feature(cxx_rtti)) # define GLM_CXX98_RTTI # endif # if(__has_feature(cxx_access_control_sfinae)) # define GLM_CXX11_ACCESS_CONTROL_SFINAE # endif # if(__has_feature(cxx_alias_templates)) # define GLM_CXX11_ALIAS_TEMPLATE # endif # if(__has_feature(cxx_alignas)) # define GLM_CXX11_ALIGNAS # endif # if(__has_feature(cxx_attributes)) # define GLM_CXX11_ATTRIBUTES # endif # if(__has_feature(cxx_constexpr)) # define GLM_CXX11_CONSTEXPR # endif # if(__has_feature(cxx_decltype)) # define GLM_CXX11_DECLTYPE # endif # if(__has_feature(cxx_default_function_template_args)) # define GLM_CXX11_DEFAULT_FUNCTION_TEMPLATE_ARGS # endif # if(__has_feature(cxx_defaulted_functions)) # define GLM_CXX11_DEFAULTED_FUNCTIONS # endif # if(__has_feature(cxx_delegating_constructors)) # define GLM_CXX11_DELEGATING_CONSTRUCTORS # endif # if(__has_feature(cxx_deleted_functions)) # define GLM_CXX11_DELETED_FUNCTIONS # endif # if(__has_feature(cxx_explicit_conversions)) # define GLM_CXX11_EXPLICIT_CONVERSIONS # endif # if(__has_feature(cxx_generalized_initializers)) # define GLM_CXX11_GENERALIZED_INITIALIZERS # endif # if(__has_feature(cxx_implicit_moves)) # define GLM_CXX11_IMPLICIT_MOVES # endif # if(__has_feature(cxx_inheriting_constructors)) # define GLM_CXX11_INHERITING_CONSTRUCTORS # endif # if(__has_feature(cxx_inline_namespaces)) # define GLM_CXX11_INLINE_NAMESPACES # endif # if(__has_feature(cxx_lambdas)) # define GLM_CXX11_LAMBDAS # endif # if(__has_feature(cxx_local_type_template_args)) # define GLM_CXX11_LOCAL_TYPE_TEMPLATE_ARGS # endif # if(__has_feature(cxx_noexcept)) # define GLM_CXX11_NOEXCEPT # endif # if(__has_feature(cxx_nonstatic_member_init)) # define GLM_CXX11_NONSTATIC_MEMBER_INIT # endif # if(__has_feature(cxx_nullptr)) # define GLM_CXX11_NULLPTR # endif # if(__has_feature(cxx_override_control)) # define GLM_CXX11_OVERRIDE_CONTROL # endif # if(__has_feature(cxx_reference_qualified_functions)) # define GLM_CXX11_REFERENCE_QUALIFIED_FUNCTIONS # endif # if(__has_feature(cxx_range_for)) # define GLM_CXX11_RANGE_FOR # endif # if(__has_feature(cxx_raw_string_literals)) # define GLM_CXX11_RAW_STRING_LITERALS # endif # if(__has_feature(cxx_rvalue_references)) # define GLM_CXX11_RVALUE_REFERENCES # endif # if(__has_feature(cxx_static_assert)) # define GLM_CXX11_STATIC_ASSERT # endif # if(__has_feature(cxx_auto_type)) # define GLM_CXX11_AUTO_TYPE # endif # if(__has_feature(cxx_strong_enums)) # define GLM_CXX11_STRONG_ENUMS # endif # if(__has_feature(cxx_trailing_return)) # define GLM_CXX11_TRAILING_RETURN # endif # if(__has_feature(cxx_unicode_literals)) # define GLM_CXX11_UNICODE_LITERALS # endif # if(__has_feature(cxx_unrestricted_unions)) # define GLM_CXX11_UNRESTRICTED_UNIONS # endif # if(__has_feature(cxx_user_literals)) # define GLM_CXX11_USER_LITERALS # endif # if(__has_feature(cxx_variadic_templates)) # define GLM_CXX11_VARIADIC_TEMPLATES # endif #endif//(GLM_COMPILER & GLM_COMPILER_CLANG)
Unknown
3D
mcellteam/mcell
libs/glm/gtc/matrix_access.hpp
.hpp
1,468
61
/// @ref gtc_matrix_access /// @file glm/gtc/matrix_access.hpp /// /// @see core (dependence) /// /// @defgroup gtc_matrix_access GLM_GTC_matrix_access /// @ingroup gtc /// /// Include <glm/gtc/matrix_access.hpp> to use the features of this extension. /// /// Defines functions to access rows or columns of a matrix easily. #pragma once // Dependency: #include "../detail/setup.hpp" #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTC_matrix_access extension included") #endif namespace glm { /// @addtogroup gtc_matrix_access /// @{ /// Get a specific row of a matrix. /// @see gtc_matrix_access template<typename genType> GLM_FUNC_DECL typename genType::row_type row( genType const& m, length_t index); /// Set a specific row to a matrix. /// @see gtc_matrix_access template<typename genType> GLM_FUNC_DECL genType row( genType const& m, length_t index, typename genType::row_type const& x); /// Get a specific column of a matrix. /// @see gtc_matrix_access template<typename genType> GLM_FUNC_DECL typename genType::col_type column( genType const& m, length_t index); /// Set a specific column to a matrix. /// @see gtc_matrix_access template<typename genType> GLM_FUNC_DECL genType column( genType const& m, length_t index, typename genType::col_type const& x); /// @} }//namespace glm #include "matrix_access.inl"
Unknown
3D
mcellteam/mcell
libs/glm/gtc/quaternion.hpp
.hpp
5,638
174
/// @ref gtc_quaternion /// @file glm/gtc/quaternion.hpp /// /// @see core (dependence) /// @see gtc_constants (dependence) /// /// @defgroup gtc_quaternion GLM_GTC_quaternion /// @ingroup gtc /// /// Include <glm/gtc/quaternion.hpp> to use the features of this extension. /// /// Defines a templated quaternion type and several quaternion operations. #pragma once // Dependency: #include "../gtc/constants.hpp" #include "../gtc/matrix_transform.hpp" #include "../ext/vector_relational.hpp" #include "../ext/quaternion_common.hpp" #include "../ext/quaternion_float.hpp" #include "../ext/quaternion_float_precision.hpp" #include "../ext/quaternion_double.hpp" #include "../ext/quaternion_double_precision.hpp" #include "../ext/quaternion_relational.hpp" #include "../ext/quaternion_geometric.hpp" #include "../ext/quaternion_trigonometric.hpp" #include "../ext/quaternion_transform.hpp" #include "../detail/type_mat3x3.hpp" #include "../detail/type_mat4x4.hpp" #include "../detail/type_vec3.hpp" #include "../detail/type_vec4.hpp" #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTC_quaternion extension included") #endif namespace glm { /// @addtogroup gtc_quaternion /// @{ /// Returns euler angles, pitch as x, yaw as y, roll as z. /// The result is expressed in radians. /// /// @tparam T Floating-point scalar types. /// /// @see gtc_quaternion template<typename T, qualifier Q> GLM_FUNC_DECL vec<3, T, Q> eulerAngles(qua<T, Q> const& x); /// Returns roll value of euler angles expressed in radians. /// /// @tparam T Floating-point scalar types. /// /// @see gtc_quaternion template<typename T, qualifier Q> GLM_FUNC_DECL T roll(qua<T, Q> const& x); /// Returns pitch value of euler angles expressed in radians. /// /// @tparam T Floating-point scalar types. /// /// @see gtc_quaternion template<typename T, qualifier Q> GLM_FUNC_DECL T pitch(qua<T, Q> const& x); /// Returns yaw value of euler angles expressed in radians. /// /// @tparam T Floating-point scalar types. /// /// @see gtc_quaternion template<typename T, qualifier Q> GLM_FUNC_DECL T yaw(qua<T, Q> const& x); /// Converts a quaternion to a 3 * 3 matrix. /// /// @tparam T Floating-point scalar types. /// /// @see gtc_quaternion template<typename T, qualifier Q> GLM_FUNC_DECL mat<3, 3, T, Q> mat3_cast(qua<T, Q> const& x); /// Converts a quaternion to a 4 * 4 matrix. /// /// @tparam T Floating-point scalar types. /// /// @see gtc_quaternion template<typename T, qualifier Q> GLM_FUNC_DECL mat<4, 4, T, Q> mat4_cast(qua<T, Q> const& x); /// Converts a pure rotation 3 * 3 matrix to a quaternion. /// /// @tparam T Floating-point scalar types. /// /// @see gtc_quaternion template<typename T, qualifier Q> GLM_FUNC_DECL qua<T, Q> quat_cast(mat<3, 3, T, Q> const& x); /// Converts a pure rotation 4 * 4 matrix to a quaternion. /// /// @tparam T Floating-point scalar types. /// /// @see gtc_quaternion template<typename T, qualifier Q> GLM_FUNC_DECL qua<T, Q> quat_cast(mat<4, 4, T, Q> const& x); /// Returns the component-wise comparison result of x < y. /// /// @tparam T Floating-point scalar types /// @tparam Q Value from qualifier enum /// /// @see ext_quaternion_relational template<typename T, qualifier Q> GLM_FUNC_DECL vec<4, bool, Q> lessThan(qua<T, Q> const& x, qua<T, Q> const& y); /// Returns the component-wise comparison of result x <= y. /// /// @tparam T Floating-point scalar types /// @tparam Q Value from qualifier enum /// /// @see ext_quaternion_relational template<typename T, qualifier Q> GLM_FUNC_DECL vec<4, bool, Q> lessThanEqual(qua<T, Q> const& x, qua<T, Q> const& y); /// Returns the component-wise comparison of result x > y. /// /// @tparam T Floating-point scalar types /// @tparam Q Value from qualifier enum /// /// @see ext_quaternion_relational template<typename T, qualifier Q> GLM_FUNC_DECL vec<4, bool, Q> greaterThan(qua<T, Q> const& x, qua<T, Q> const& y); /// Returns the component-wise comparison of result x >= y. /// /// @tparam T Floating-point scalar types /// @tparam Q Value from qualifier enum /// /// @see ext_quaternion_relational template<typename T, qualifier Q> GLM_FUNC_DECL vec<4, bool, Q> greaterThanEqual(qua<T, Q> const& x, qua<T, Q> const& y); /// Build a look at quaternion based on the default handedness. /// /// @param direction Desired forward direction. Needs to be normalized. /// @param up Up vector, how the camera is oriented. Typically (0, 1, 0). template<typename T, qualifier Q> GLM_FUNC_DECL qua<T, Q> quatLookAt( vec<3, T, Q> const& direction, vec<3, T, Q> const& up); /// Build a right-handed look at quaternion. /// /// @param direction Desired forward direction onto which the -z-axis gets mapped. Needs to be normalized. /// @param up Up vector, how the camera is oriented. Typically (0, 1, 0). template<typename T, qualifier Q> GLM_FUNC_DECL qua<T, Q> quatLookAtRH( vec<3, T, Q> const& direction, vec<3, T, Q> const& up); /// Build a left-handed look at quaternion. /// /// @param direction Desired forward direction onto which the +z-axis gets mapped. Needs to be normalized. /// @param up Up vector, how the camera is oriented. Typically (0, 1, 0). template<typename T, qualifier Q> GLM_FUNC_DECL qua<T, Q> quatLookAtLH( vec<3, T, Q> const& direction, vec<3, T, Q> const& up); /// @} } //namespace glm #include "quaternion.inl"
Unknown
3D
mcellteam/mcell
libs/glm/gtc/type_ptr.hpp
.hpp
7,056
231
/// @ref gtc_type_ptr /// @file glm/gtc/type_ptr.hpp /// /// @see core (dependence) /// @see gtc_quaternion (dependence) /// /// @defgroup gtc_type_ptr GLM_GTC_type_ptr /// @ingroup gtc /// /// Include <glm/gtc/type_ptr.hpp> to use the features of this extension. /// /// Handles the interaction between pointers and vector, matrix types. /// /// This extension defines an overloaded function, glm::value_ptr. It returns /// a pointer to the memory layout of the object. Matrix types store their values /// in column-major order. /// /// This is useful for uploading data to matrices or copying data to buffer objects. /// /// Example: /// @code /// #include <glm/glm.hpp> /// #include <glm/gtc/type_ptr.hpp> /// /// glm::vec3 aVector(3); /// glm::mat4 someMatrix(1.0); /// /// glUniform3fv(uniformLoc, 1, glm::value_ptr(aVector)); /// glUniformMatrix4fv(uniformMatrixLoc, 1, GL_FALSE, glm::value_ptr(someMatrix)); /// @endcode /// /// <glm/gtc/type_ptr.hpp> need to be included to use the features of this extension. #pragma once // Dependency: #include "../gtc/quaternion.hpp" #include "../gtc/vec1.hpp" #include "../vec2.hpp" #include "../vec3.hpp" #include "../vec4.hpp" #include "../mat2x2.hpp" #include "../mat2x3.hpp" #include "../mat2x4.hpp" #include "../mat3x2.hpp" #include "../mat3x3.hpp" #include "../mat3x4.hpp" #include "../mat4x2.hpp" #include "../mat4x3.hpp" #include "../mat4x4.hpp" #include <cstring> #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTC_type_ptr extension included") #endif namespace glm { /// @addtogroup gtc_type_ptr /// @{ /// Return the constant address to the data of the input parameter. /// @see gtc_type_ptr template<typename genType> GLM_FUNC_DECL typename genType::value_type const * value_ptr(genType const& v); /// Build a vector from a pointer. /// @see gtc_type_ptr template <typename T, qualifier Q> GLM_FUNC_DECL vec<1, T, Q> make_vec1(vec<1, T, Q> const& v); /// Build a vector from a pointer. /// @see gtc_type_ptr template <typename T, qualifier Q> GLM_FUNC_DECL vec<1, T, Q> make_vec1(vec<2, T, Q> const& v); /// Build a vector from a pointer. /// @see gtc_type_ptr template <typename T, qualifier Q> GLM_FUNC_DECL vec<1, T, Q> make_vec1(vec<3, T, Q> const& v); /// Build a vector from a pointer. /// @see gtc_type_ptr template <typename T, qualifier Q> GLM_FUNC_DECL vec<1, T, Q> make_vec1(vec<4, T, Q> const& v); /// Build a vector from a pointer. /// @see gtc_type_ptr template <typename T, qualifier Q> GLM_FUNC_DECL vec<2, T, Q> make_vec2(vec<1, T, Q> const& v); /// Build a vector from a pointer. /// @see gtc_type_ptr template <typename T, qualifier Q> GLM_FUNC_DECL vec<2, T, Q> make_vec2(vec<2, T, Q> const& v); /// Build a vector from a pointer. /// @see gtc_type_ptr template <typename T, qualifier Q> GLM_FUNC_DECL vec<2, T, Q> make_vec2(vec<3, T, Q> const& v); /// Build a vector from a pointer. /// @see gtc_type_ptr template <typename T, qualifier Q> GLM_FUNC_DECL vec<2, T, Q> make_vec2(vec<4, T, Q> const& v); /// Build a vector from a pointer. /// @see gtc_type_ptr template <typename T, qualifier Q> GLM_FUNC_DECL vec<3, T, Q> make_vec3(vec<1, T, Q> const& v); /// Build a vector from a pointer. /// @see gtc_type_ptr template <typename T, qualifier Q> GLM_FUNC_DECL vec<3, T, Q> make_vec3(vec<2, T, Q> const& v); /// Build a vector from a pointer. /// @see gtc_type_ptr template <typename T, qualifier Q> GLM_FUNC_DECL vec<3, T, Q> make_vec3(vec<3, T, Q> const& v); /// Build a vector from a pointer. /// @see gtc_type_ptr template <typename T, qualifier Q> GLM_FUNC_DECL vec<3, T, Q> make_vec3(vec<4, T, Q> const& v); /// Build a vector from a pointer. /// @see gtc_type_ptr template <typename T, qualifier Q> GLM_FUNC_DECL vec<4, T, Q> make_vec4(vec<1, T, Q> const& v); /// Build a vector from a pointer. /// @see gtc_type_ptr template <typename T, qualifier Q> GLM_FUNC_DECL vec<4, T, Q> make_vec4(vec<2, T, Q> const& v); /// Build a vector from a pointer. /// @see gtc_type_ptr template <typename T, qualifier Q> GLM_FUNC_DECL vec<4, T, Q> make_vec4(vec<3, T, Q> const& v); /// Build a vector from a pointer. /// @see gtc_type_ptr template <typename T, qualifier Q> GLM_FUNC_DECL vec<4, T, Q> make_vec4(vec<4, T, Q> const& v); /// Build a vector from a pointer. /// @see gtc_type_ptr template<typename T> GLM_FUNC_DECL vec<2, T, defaultp> make_vec2(T const * const ptr); /// Build a vector from a pointer. /// @see gtc_type_ptr template<typename T> GLM_FUNC_DECL vec<3, T, defaultp> make_vec3(T const * const ptr); /// Build a vector from a pointer. /// @see gtc_type_ptr template<typename T> GLM_FUNC_DECL vec<4, T, defaultp> make_vec4(T const * const ptr); /// Build a matrix from a pointer. /// @see gtc_type_ptr template<typename T> GLM_FUNC_DECL mat<2, 2, T, defaultp> make_mat2x2(T const * const ptr); /// Build a matrix from a pointer. /// @see gtc_type_ptr template<typename T> GLM_FUNC_DECL mat<2, 3, T, defaultp> make_mat2x3(T const * const ptr); /// Build a matrix from a pointer. /// @see gtc_type_ptr template<typename T> GLM_FUNC_DECL mat<2, 4, T, defaultp> make_mat2x4(T const * const ptr); /// Build a matrix from a pointer. /// @see gtc_type_ptr template<typename T> GLM_FUNC_DECL mat<3, 2, T, defaultp> make_mat3x2(T const * const ptr); /// Build a matrix from a pointer. /// @see gtc_type_ptr template<typename T> GLM_FUNC_DECL mat<3, 3, T, defaultp> make_mat3x3(T const * const ptr); /// Build a matrix from a pointer. /// @see gtc_type_ptr template<typename T> GLM_FUNC_DECL mat<3, 4, T, defaultp> make_mat3x4(T const * const ptr); /// Build a matrix from a pointer. /// @see gtc_type_ptr template<typename T> GLM_FUNC_DECL mat<4, 2, T, defaultp> make_mat4x2(T const * const ptr); /// Build a matrix from a pointer. /// @see gtc_type_ptr template<typename T> GLM_FUNC_DECL mat<4, 3, T, defaultp> make_mat4x3(T const * const ptr); /// Build a matrix from a pointer. /// @see gtc_type_ptr template<typename T> GLM_FUNC_DECL mat<4, 4, T, defaultp> make_mat4x4(T const * const ptr); /// Build a matrix from a pointer. /// @see gtc_type_ptr template<typename T> GLM_FUNC_DECL mat<2, 2, T, defaultp> make_mat2(T const * const ptr); /// Build a matrix from a pointer. /// @see gtc_type_ptr template<typename T> GLM_FUNC_DECL mat<3, 3, T, defaultp> make_mat3(T const * const ptr); /// Build a matrix from a pointer. /// @see gtc_type_ptr template<typename T> GLM_FUNC_DECL mat<4, 4, T, defaultp> make_mat4(T const * const ptr); /// Build a quaternion from a pointer. /// @see gtc_type_ptr template<typename T> GLM_FUNC_DECL qua<T, defaultp> make_quat(T const * const ptr); /// @} }//namespace glm #include "type_ptr.inl"
Unknown
3D
mcellteam/mcell
libs/glm/gtc/color_space.hpp
.hpp
2,020
57
/// @ref gtc_color_space /// @file glm/gtc/color_space.hpp /// /// @see core (dependence) /// @see gtc_color_space (dependence) /// /// @defgroup gtc_color_space GLM_GTC_color_space /// @ingroup gtc /// /// Include <glm/gtc/color_space.hpp> to use the features of this extension. /// /// Allow to perform bit operations on integer values #pragma once // Dependencies #include "../detail/setup.hpp" #include "../detail/qualifier.hpp" #include "../exponential.hpp" #include "../vec3.hpp" #include "../vec4.hpp" #include <limits> #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTC_color_space extension included") #endif namespace glm { /// @addtogroup gtc_color_space /// @{ /// Convert a linear color to sRGB color using a standard gamma correction. /// IEC 61966-2-1:1999 / Rec. 709 specification https://www.w3.org/Graphics/Color/srgb template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL vec<L, T, Q> convertLinearToSRGB(vec<L, T, Q> const& ColorLinear); /// Convert a linear color to sRGB color using a custom gamma correction. /// IEC 61966-2-1:1999 / Rec. 709 specification https://www.w3.org/Graphics/Color/srgb template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL vec<L, T, Q> convertLinearToSRGB(vec<L, T, Q> const& ColorLinear, T Gamma); /// Convert a sRGB color to linear color using a standard gamma correction. /// IEC 61966-2-1:1999 / Rec. 709 specification https://www.w3.org/Graphics/Color/srgb template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL vec<L, T, Q> convertSRGBToLinear(vec<L, T, Q> const& ColorSRGB); /// Convert a sRGB color to linear color using a custom gamma correction. // IEC 61966-2-1:1999 / Rec. 709 specification https://www.w3.org/Graphics/Color/srgb template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL vec<L, T, Q> convertSRGBToLinear(vec<L, T, Q> const& ColorSRGB, T Gamma); /// @} } //namespace glm #include "color_space.inl"
Unknown
3D
mcellteam/mcell
libs/glm/gtc/packing.hpp
.hpp
36,725
729
/// @ref gtc_packing /// @file glm/gtc/packing.hpp /// /// @see core (dependence) /// /// @defgroup gtc_packing GLM_GTC_packing /// @ingroup gtc /// /// Include <glm/gtc/packing.hpp> to use the features of this extension. /// /// This extension provides a set of function to convert vertors to packed /// formats. #pragma once // Dependency: #include "type_precision.hpp" #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTC_packing extension included") #endif namespace glm { /// @addtogroup gtc_packing /// @{ /// First, converts the normalized floating-point value v into a 8-bit integer value. /// Then, the results are packed into the returned 8-bit unsigned integer. /// /// The conversion for component c of v to fixed point is done as follows: /// packUnorm1x8: round(clamp(c, 0, +1) * 255.0) /// /// @see gtc_packing /// @see uint16 packUnorm2x8(vec2 const& v) /// @see uint32 packUnorm4x8(vec4 const& v) /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packUnorm4x8.xml">GLSL packUnorm4x8 man page</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> GLM_FUNC_DECL uint8 packUnorm1x8(float v); /// Convert a single 8-bit integer to a normalized floating-point value. /// /// The conversion for unpacked fixed-point value f to floating point is done as follows: /// unpackUnorm4x8: f / 255.0 /// /// @see gtc_packing /// @see vec2 unpackUnorm2x8(uint16 p) /// @see vec4 unpackUnorm4x8(uint32 p) /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackUnorm4x8.xml">GLSL unpackUnorm4x8 man page</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> GLM_FUNC_DECL float unpackUnorm1x8(uint8 p); /// First, converts each component of the normalized floating-point value v into 8-bit integer values. /// Then, the results are packed into the returned 16-bit unsigned integer. /// /// The conversion for component c of v to fixed point is done as follows: /// packUnorm2x8: round(clamp(c, 0, +1) * 255.0) /// /// The first component of the vector will be written to the least significant bits of the output; /// the last component will be written to the most significant bits. /// /// @see gtc_packing /// @see uint8 packUnorm1x8(float const& v) /// @see uint32 packUnorm4x8(vec4 const& v) /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packUnorm4x8.xml">GLSL packUnorm4x8 man page</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> GLM_FUNC_DECL uint16 packUnorm2x8(vec2 const& v); /// First, unpacks a single 16-bit unsigned integer p into a pair of 8-bit unsigned integers. /// Then, each component is converted to a normalized floating-point value to generate the returned two-component vector. /// /// The conversion for unpacked fixed-point value f to floating point is done as follows: /// unpackUnorm4x8: f / 255.0 /// /// The first component of the returned vector will be extracted from the least significant bits of the input; /// the last component will be extracted from the most significant bits. /// /// @see gtc_packing /// @see float unpackUnorm1x8(uint8 v) /// @see vec4 unpackUnorm4x8(uint32 p) /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackUnorm4x8.xml">GLSL unpackUnorm4x8 man page</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> GLM_FUNC_DECL vec2 unpackUnorm2x8(uint16 p); /// First, converts the normalized floating-point value v into 8-bit integer value. /// Then, the results are packed into the returned 8-bit unsigned integer. /// /// The conversion to fixed point is done as follows: /// packSnorm1x8: round(clamp(s, -1, +1) * 127.0) /// /// @see gtc_packing /// @see uint16 packSnorm2x8(vec2 const& v) /// @see uint32 packSnorm4x8(vec4 const& v) /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packSnorm4x8.xml">GLSL packSnorm4x8 man page</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> GLM_FUNC_DECL uint8 packSnorm1x8(float s); /// First, unpacks a single 8-bit unsigned integer p into a single 8-bit signed integers. /// Then, the value is converted to a normalized floating-point value to generate the returned scalar. /// /// The conversion for unpacked fixed-point value f to floating point is done as follows: /// unpackSnorm1x8: clamp(f / 127.0, -1, +1) /// /// @see gtc_packing /// @see vec2 unpackSnorm2x8(uint16 p) /// @see vec4 unpackSnorm4x8(uint32 p) /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackSnorm4x8.xml">GLSL unpackSnorm4x8 man page</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> GLM_FUNC_DECL float unpackSnorm1x8(uint8 p); /// First, converts each component of the normalized floating-point value v into 8-bit integer values. /// Then, the results are packed into the returned 16-bit unsigned integer. /// /// The conversion for component c of v to fixed point is done as follows: /// packSnorm2x8: round(clamp(c, -1, +1) * 127.0) /// /// The first component of the vector will be written to the least significant bits of the output; /// the last component will be written to the most significant bits. /// /// @see gtc_packing /// @see uint8 packSnorm1x8(float const& v) /// @see uint32 packSnorm4x8(vec4 const& v) /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packSnorm4x8.xml">GLSL packSnorm4x8 man page</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> GLM_FUNC_DECL uint16 packSnorm2x8(vec2 const& v); /// First, unpacks a single 16-bit unsigned integer p into a pair of 8-bit signed integers. /// Then, each component is converted to a normalized floating-point value to generate the returned two-component vector. /// /// The conversion for unpacked fixed-point value f to floating point is done as follows: /// unpackSnorm2x8: clamp(f / 127.0, -1, +1) /// /// The first component of the returned vector will be extracted from the least significant bits of the input; /// the last component will be extracted from the most significant bits. /// /// @see gtc_packing /// @see float unpackSnorm1x8(uint8 p) /// @see vec4 unpackSnorm4x8(uint32 p) /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackSnorm4x8.xml">GLSL unpackSnorm4x8 man page</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> GLM_FUNC_DECL vec2 unpackSnorm2x8(uint16 p); /// First, converts the normalized floating-point value v into a 16-bit integer value. /// Then, the results are packed into the returned 16-bit unsigned integer. /// /// The conversion for component c of v to fixed point is done as follows: /// packUnorm1x16: round(clamp(c, 0, +1) * 65535.0) /// /// @see gtc_packing /// @see uint16 packSnorm1x16(float const& v) /// @see uint64 packSnorm4x16(vec4 const& v) /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packUnorm4x8.xml">GLSL packUnorm4x8 man page</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> GLM_FUNC_DECL uint16 packUnorm1x16(float v); /// First, unpacks a single 16-bit unsigned integer p into a of 16-bit unsigned integers. /// Then, the value is converted to a normalized floating-point value to generate the returned scalar. /// /// The conversion for unpacked fixed-point value f to floating point is done as follows: /// unpackUnorm1x16: f / 65535.0 /// /// @see gtc_packing /// @see vec2 unpackUnorm2x16(uint32 p) /// @see vec4 unpackUnorm4x16(uint64 p) /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackUnorm2x16.xml">GLSL unpackUnorm2x16 man page</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> GLM_FUNC_DECL float unpackUnorm1x16(uint16 p); /// First, converts each component of the normalized floating-point value v into 16-bit integer values. /// Then, the results are packed into the returned 64-bit unsigned integer. /// /// The conversion for component c of v to fixed point is done as follows: /// packUnorm4x16: round(clamp(c, 0, +1) * 65535.0) /// /// The first component of the vector will be written to the least significant bits of the output; /// the last component will be written to the most significant bits. /// /// @see gtc_packing /// @see uint16 packUnorm1x16(float const& v) /// @see uint32 packUnorm2x16(vec2 const& v) /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packUnorm4x8.xml">GLSL packUnorm4x8 man page</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> GLM_FUNC_DECL uint64 packUnorm4x16(vec4 const& v); /// First, unpacks a single 64-bit unsigned integer p into four 16-bit unsigned integers. /// Then, each component is converted to a normalized floating-point value to generate the returned four-component vector. /// /// The conversion for unpacked fixed-point value f to floating point is done as follows: /// unpackUnormx4x16: f / 65535.0 /// /// The first component of the returned vector will be extracted from the least significant bits of the input; /// the last component will be extracted from the most significant bits. /// /// @see gtc_packing /// @see float unpackUnorm1x16(uint16 p) /// @see vec2 unpackUnorm2x16(uint32 p) /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackUnorm2x16.xml">GLSL unpackUnorm2x16 man page</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> GLM_FUNC_DECL vec4 unpackUnorm4x16(uint64 p); /// First, converts the normalized floating-point value v into 16-bit integer value. /// Then, the results are packed into the returned 16-bit unsigned integer. /// /// The conversion to fixed point is done as follows: /// packSnorm1x8: round(clamp(s, -1, +1) * 32767.0) /// /// @see gtc_packing /// @see uint32 packSnorm2x16(vec2 const& v) /// @see uint64 packSnorm4x16(vec4 const& v) /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packSnorm4x8.xml">GLSL packSnorm4x8 man page</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> GLM_FUNC_DECL uint16 packSnorm1x16(float v); /// First, unpacks a single 16-bit unsigned integer p into a single 16-bit signed integers. /// Then, each component is converted to a normalized floating-point value to generate the returned scalar. /// /// The conversion for unpacked fixed-point value f to floating point is done as follows: /// unpackSnorm1x16: clamp(f / 32767.0, -1, +1) /// /// @see gtc_packing /// @see vec2 unpackSnorm2x16(uint32 p) /// @see vec4 unpackSnorm4x16(uint64 p) /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackSnorm1x16.xml">GLSL unpackSnorm4x8 man page</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> GLM_FUNC_DECL float unpackSnorm1x16(uint16 p); /// First, converts each component of the normalized floating-point value v into 16-bit integer values. /// Then, the results are packed into the returned 64-bit unsigned integer. /// /// The conversion for component c of v to fixed point is done as follows: /// packSnorm2x8: round(clamp(c, -1, +1) * 32767.0) /// /// The first component of the vector will be written to the least significant bits of the output; /// the last component will be written to the most significant bits. /// /// @see gtc_packing /// @see uint16 packSnorm1x16(float const& v) /// @see uint32 packSnorm2x16(vec2 const& v) /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packSnorm4x8.xml">GLSL packSnorm4x8 man page</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> GLM_FUNC_DECL uint64 packSnorm4x16(vec4 const& v); /// First, unpacks a single 64-bit unsigned integer p into four 16-bit signed integers. /// Then, each component is converted to a normalized floating-point value to generate the returned four-component vector. /// /// The conversion for unpacked fixed-point value f to floating point is done as follows: /// unpackSnorm4x16: clamp(f / 32767.0, -1, +1) /// /// The first component of the returned vector will be extracted from the least significant bits of the input; /// the last component will be extracted from the most significant bits. /// /// @see gtc_packing /// @see float unpackSnorm1x16(uint16 p) /// @see vec2 unpackSnorm2x16(uint32 p) /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackSnorm2x16.xml">GLSL unpackSnorm4x8 man page</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> GLM_FUNC_DECL vec4 unpackSnorm4x16(uint64 p); /// Returns an unsigned integer obtained by converting the components of a floating-point scalar /// to the 16-bit floating-point representation found in the OpenGL Specification, /// and then packing this 16-bit value into a 16-bit unsigned integer. /// /// @see gtc_packing /// @see uint32 packHalf2x16(vec2 const& v) /// @see uint64 packHalf4x16(vec4 const& v) /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packHalf2x16.xml">GLSL packHalf2x16 man page</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> GLM_FUNC_DECL uint16 packHalf1x16(float v); /// Returns a floating-point scalar with components obtained by unpacking a 16-bit unsigned integer into a 16-bit value, /// interpreted as a 16-bit floating-point number according to the OpenGL Specification, /// and converting it to 32-bit floating-point values. /// /// @see gtc_packing /// @see vec2 unpackHalf2x16(uint32 const& v) /// @see vec4 unpackHalf4x16(uint64 const& v) /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackHalf2x16.xml">GLSL unpackHalf2x16 man page</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> GLM_FUNC_DECL float unpackHalf1x16(uint16 v); /// Returns an unsigned integer obtained by converting the components of a four-component floating-point vector /// to the 16-bit floating-point representation found in the OpenGL Specification, /// and then packing these four 16-bit values into a 64-bit unsigned integer. /// The first vector component specifies the 16 least-significant bits of the result; /// the forth component specifies the 16 most-significant bits. /// /// @see gtc_packing /// @see uint16 packHalf1x16(float const& v) /// @see uint32 packHalf2x16(vec2 const& v) /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packHalf2x16.xml">GLSL packHalf2x16 man page</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> GLM_FUNC_DECL uint64 packHalf4x16(vec4 const& v); /// Returns a four-component floating-point vector with components obtained by unpacking a 64-bit unsigned integer into four 16-bit values, /// interpreting those values as 16-bit floating-point numbers according to the OpenGL Specification, /// and converting them to 32-bit floating-point values. /// The first component of the vector is obtained from the 16 least-significant bits of v; /// the forth component is obtained from the 16 most-significant bits of v. /// /// @see gtc_packing /// @see float unpackHalf1x16(uint16 const& v) /// @see vec2 unpackHalf2x16(uint32 const& v) /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackHalf2x16.xml">GLSL unpackHalf2x16 man page</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> GLM_FUNC_DECL vec4 unpackHalf4x16(uint64 p); /// Returns an unsigned integer obtained by converting the components of a four-component signed integer vector /// to the 10-10-10-2-bit signed integer representation found in the OpenGL Specification, /// and then packing these four values into a 32-bit unsigned integer. /// The first vector component specifies the 10 least-significant bits of the result; /// the forth component specifies the 2 most-significant bits. /// /// @see gtc_packing /// @see uint32 packI3x10_1x2(uvec4 const& v) /// @see uint32 packSnorm3x10_1x2(vec4 const& v) /// @see uint32 packUnorm3x10_1x2(vec4 const& v) /// @see ivec4 unpackI3x10_1x2(uint32 const& p) GLM_FUNC_DECL uint32 packI3x10_1x2(ivec4 const& v); /// Unpacks a single 32-bit unsigned integer p into three 10-bit and one 2-bit signed integers. /// /// The first component of the returned vector will be extracted from the least significant bits of the input; /// the last component will be extracted from the most significant bits. /// /// @see gtc_packing /// @see uint32 packU3x10_1x2(uvec4 const& v) /// @see vec4 unpackSnorm3x10_1x2(uint32 const& p); /// @see uvec4 unpackI3x10_1x2(uint32 const& p); GLM_FUNC_DECL ivec4 unpackI3x10_1x2(uint32 p); /// Returns an unsigned integer obtained by converting the components of a four-component unsigned integer vector /// to the 10-10-10-2-bit unsigned integer representation found in the OpenGL Specification, /// and then packing these four values into a 32-bit unsigned integer. /// The first vector component specifies the 10 least-significant bits of the result; /// the forth component specifies the 2 most-significant bits. /// /// @see gtc_packing /// @see uint32 packI3x10_1x2(ivec4 const& v) /// @see uint32 packSnorm3x10_1x2(vec4 const& v) /// @see uint32 packUnorm3x10_1x2(vec4 const& v) /// @see ivec4 unpackU3x10_1x2(uint32 const& p) GLM_FUNC_DECL uint32 packU3x10_1x2(uvec4 const& v); /// Unpacks a single 32-bit unsigned integer p into three 10-bit and one 2-bit unsigned integers. /// /// The first component of the returned vector will be extracted from the least significant bits of the input; /// the last component will be extracted from the most significant bits. /// /// @see gtc_packing /// @see uint32 packU3x10_1x2(uvec4 const& v) /// @see vec4 unpackSnorm3x10_1x2(uint32 const& p); /// @see uvec4 unpackI3x10_1x2(uint32 const& p); GLM_FUNC_DECL uvec4 unpackU3x10_1x2(uint32 p); /// First, converts the first three components of the normalized floating-point value v into 10-bit signed integer values. /// Then, converts the forth component of the normalized floating-point value v into 2-bit signed integer values. /// Then, the results are packed into the returned 32-bit unsigned integer. /// /// The conversion for component c of v to fixed point is done as follows: /// packSnorm3x10_1x2(xyz): round(clamp(c, -1, +1) * 511.0) /// packSnorm3x10_1x2(w): round(clamp(c, -1, +1) * 1.0) /// /// The first vector component specifies the 10 least-significant bits of the result; /// the forth component specifies the 2 most-significant bits. /// /// @see gtc_packing /// @see vec4 unpackSnorm3x10_1x2(uint32 const& p) /// @see uint32 packUnorm3x10_1x2(vec4 const& v) /// @see uint32 packU3x10_1x2(uvec4 const& v) /// @see uint32 packI3x10_1x2(ivec4 const& v) GLM_FUNC_DECL uint32 packSnorm3x10_1x2(vec4 const& v); /// First, unpacks a single 32-bit unsigned integer p into four 16-bit signed integers. /// Then, each component is converted to a normalized floating-point value to generate the returned four-component vector. /// /// The conversion for unpacked fixed-point value f to floating point is done as follows: /// unpackSnorm3x10_1x2(xyz): clamp(f / 511.0, -1, +1) /// unpackSnorm3x10_1x2(w): clamp(f / 511.0, -1, +1) /// /// The first component of the returned vector will be extracted from the least significant bits of the input; /// the last component will be extracted from the most significant bits. /// /// @see gtc_packing /// @see uint32 packSnorm3x10_1x2(vec4 const& v) /// @see vec4 unpackUnorm3x10_1x2(uint32 const& p)) /// @see uvec4 unpackI3x10_1x2(uint32 const& p) /// @see uvec4 unpackU3x10_1x2(uint32 const& p) GLM_FUNC_DECL vec4 unpackSnorm3x10_1x2(uint32 p); /// First, converts the first three components of the normalized floating-point value v into 10-bit unsigned integer values. /// Then, converts the forth component of the normalized floating-point value v into 2-bit signed uninteger values. /// Then, the results are packed into the returned 32-bit unsigned integer. /// /// The conversion for component c of v to fixed point is done as follows: /// packUnorm3x10_1x2(xyz): round(clamp(c, 0, +1) * 1023.0) /// packUnorm3x10_1x2(w): round(clamp(c, 0, +1) * 3.0) /// /// The first vector component specifies the 10 least-significant bits of the result; /// the forth component specifies the 2 most-significant bits. /// /// @see gtc_packing /// @see vec4 unpackUnorm3x10_1x2(uint32 const& p) /// @see uint32 packUnorm3x10_1x2(vec4 const& v) /// @see uint32 packU3x10_1x2(uvec4 const& v) /// @see uint32 packI3x10_1x2(ivec4 const& v) GLM_FUNC_DECL uint32 packUnorm3x10_1x2(vec4 const& v); /// First, unpacks a single 32-bit unsigned integer p into four 16-bit signed integers. /// Then, each component is converted to a normalized floating-point value to generate the returned four-component vector. /// /// The conversion for unpacked fixed-point value f to floating point is done as follows: /// unpackSnorm3x10_1x2(xyz): clamp(f / 1023.0, 0, +1) /// unpackSnorm3x10_1x2(w): clamp(f / 3.0, 0, +1) /// /// The first component of the returned vector will be extracted from the least significant bits of the input; /// the last component will be extracted from the most significant bits. /// /// @see gtc_packing /// @see uint32 packSnorm3x10_1x2(vec4 const& v) /// @see vec4 unpackInorm3x10_1x2(uint32 const& p)) /// @see uvec4 unpackI3x10_1x2(uint32 const& p) /// @see uvec4 unpackU3x10_1x2(uint32 const& p) GLM_FUNC_DECL vec4 unpackUnorm3x10_1x2(uint32 p); /// First, converts the first two components of the normalized floating-point value v into 11-bit signless floating-point values. /// Then, converts the third component of the normalized floating-point value v into a 10-bit signless floating-point value. /// Then, the results are packed into the returned 32-bit unsigned integer. /// /// The first vector component specifies the 11 least-significant bits of the result; /// the last component specifies the 10 most-significant bits. /// /// @see gtc_packing /// @see vec3 unpackF2x11_1x10(uint32 const& p) GLM_FUNC_DECL uint32 packF2x11_1x10(vec3 const& v); /// First, unpacks a single 32-bit unsigned integer p into two 11-bit signless floating-point values and one 10-bit signless floating-point value . /// Then, each component is converted to a normalized floating-point value to generate the returned three-component vector. /// /// The first component of the returned vector will be extracted from the least significant bits of the input; /// the last component will be extracted from the most significant bits. /// /// @see gtc_packing /// @see uint32 packF2x11_1x10(vec3 const& v) GLM_FUNC_DECL vec3 unpackF2x11_1x10(uint32 p); /// First, converts the first two components of the normalized floating-point value v into 11-bit signless floating-point values. /// Then, converts the third component of the normalized floating-point value v into a 10-bit signless floating-point value. /// Then, the results are packed into the returned 32-bit unsigned integer. /// /// The first vector component specifies the 11 least-significant bits of the result; /// the last component specifies the 10 most-significant bits. /// /// packF3x9_E1x5 allows encoding into RGBE / RGB9E5 format /// /// @see gtc_packing /// @see vec3 unpackF3x9_E1x5(uint32 const& p) GLM_FUNC_DECL uint32 packF3x9_E1x5(vec3 const& v); /// First, unpacks a single 32-bit unsigned integer p into two 11-bit signless floating-point values and one 10-bit signless floating-point value . /// Then, each component is converted to a normalized floating-point value to generate the returned three-component vector. /// /// The first component of the returned vector will be extracted from the least significant bits of the input; /// the last component will be extracted from the most significant bits. /// /// unpackF3x9_E1x5 allows decoding RGBE / RGB9E5 data /// /// @see gtc_packing /// @see uint32 packF3x9_E1x5(vec3 const& v) GLM_FUNC_DECL vec3 unpackF3x9_E1x5(uint32 p); /// Returns an unsigned integer vector obtained by converting the components of a floating-point vector /// to the 16-bit floating-point representation found in the OpenGL Specification. /// The first vector component specifies the 16 least-significant bits of the result; /// the forth component specifies the 16 most-significant bits. /// /// @see gtc_packing /// @see vec<3, T, Q> unpackRGBM(vec<4, T, Q> const& p) /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL vec<4, T, Q> packRGBM(vec<3, T, Q> const& rgb); /// Returns a floating-point vector with components obtained by reinterpreting an integer vector as 16-bit floating-point numbers and converting them to 32-bit floating-point values. /// The first component of the vector is obtained from the 16 least-significant bits of v; /// the forth component is obtained from the 16 most-significant bits of v. /// /// @see gtc_packing /// @see vec<4, T, Q> packRGBM(vec<3, float, Q> const& v) /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL vec<3, T, Q> unpackRGBM(vec<4, T, Q> const& rgbm); /// Returns an unsigned integer vector obtained by converting the components of a floating-point vector /// to the 16-bit floating-point representation found in the OpenGL Specification. /// The first vector component specifies the 16 least-significant bits of the result; /// the forth component specifies the 16 most-significant bits. /// /// @see gtc_packing /// @see vec<L, float, Q> unpackHalf(vec<L, uint16, Q> const& p) /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> template<length_t L, qualifier Q> GLM_FUNC_DECL vec<L, uint16, Q> packHalf(vec<L, float, Q> const& v); /// Returns a floating-point vector with components obtained by reinterpreting an integer vector as 16-bit floating-point numbers and converting them to 32-bit floating-point values. /// The first component of the vector is obtained from the 16 least-significant bits of v; /// the forth component is obtained from the 16 most-significant bits of v. /// /// @see gtc_packing /// @see vec<L, uint16, Q> packHalf(vec<L, float, Q> const& v) /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> template<length_t L, qualifier Q> GLM_FUNC_DECL vec<L, float, Q> unpackHalf(vec<L, uint16, Q> const& p); /// Convert each component of the normalized floating-point vector into unsigned integer values. /// /// @see gtc_packing /// @see vec<L, floatType, Q> unpackUnorm(vec<L, intType, Q> const& p); template<typename uintType, length_t L, typename floatType, qualifier Q> GLM_FUNC_DECL vec<L, uintType, Q> packUnorm(vec<L, floatType, Q> const& v); /// Convert a packed integer to a normalized floating-point vector. /// /// @see gtc_packing /// @see vec<L, intType, Q> packUnorm(vec<L, floatType, Q> const& v) template<typename floatType, length_t L, typename uintType, qualifier Q> GLM_FUNC_DECL vec<L, floatType, Q> unpackUnorm(vec<L, uintType, Q> const& v); /// Convert each component of the normalized floating-point vector into signed integer values. /// /// @see gtc_packing /// @see vec<L, floatType, Q> unpackSnorm(vec<L, intType, Q> const& p); template<typename intType, length_t L, typename floatType, qualifier Q> GLM_FUNC_DECL vec<L, intType, Q> packSnorm(vec<L, floatType, Q> const& v); /// Convert a packed integer to a normalized floating-point vector. /// /// @see gtc_packing /// @see vec<L, intType, Q> packSnorm(vec<L, floatType, Q> const& v) template<typename floatType, length_t L, typename intType, qualifier Q> GLM_FUNC_DECL vec<L, floatType, Q> unpackSnorm(vec<L, intType, Q> const& v); /// Convert each component of the normalized floating-point vector into unsigned integer values. /// /// @see gtc_packing /// @see vec2 unpackUnorm2x4(uint8 p) GLM_FUNC_DECL uint8 packUnorm2x4(vec2 const& v); /// Convert a packed integer to a normalized floating-point vector. /// /// @see gtc_packing /// @see uint8 packUnorm2x4(vec2 const& v) GLM_FUNC_DECL vec2 unpackUnorm2x4(uint8 p); /// Convert each component of the normalized floating-point vector into unsigned integer values. /// /// @see gtc_packing /// @see vec4 unpackUnorm4x4(uint16 p) GLM_FUNC_DECL uint16 packUnorm4x4(vec4 const& v); /// Convert a packed integer to a normalized floating-point vector. /// /// @see gtc_packing /// @see uint16 packUnorm4x4(vec4 const& v) GLM_FUNC_DECL vec4 unpackUnorm4x4(uint16 p); /// Convert each component of the normalized floating-point vector into unsigned integer values. /// /// @see gtc_packing /// @see vec3 unpackUnorm1x5_1x6_1x5(uint16 p) GLM_FUNC_DECL uint16 packUnorm1x5_1x6_1x5(vec3 const& v); /// Convert a packed integer to a normalized floating-point vector. /// /// @see gtc_packing /// @see uint16 packUnorm1x5_1x6_1x5(vec3 const& v) GLM_FUNC_DECL vec3 unpackUnorm1x5_1x6_1x5(uint16 p); /// Convert each component of the normalized floating-point vector into unsigned integer values. /// /// @see gtc_packing /// @see vec4 unpackUnorm3x5_1x1(uint16 p) GLM_FUNC_DECL uint16 packUnorm3x5_1x1(vec4 const& v); /// Convert a packed integer to a normalized floating-point vector. /// /// @see gtc_packing /// @see uint16 packUnorm3x5_1x1(vec4 const& v) GLM_FUNC_DECL vec4 unpackUnorm3x5_1x1(uint16 p); /// Convert each component of the normalized floating-point vector into unsigned integer values. /// /// @see gtc_packing /// @see vec3 unpackUnorm2x3_1x2(uint8 p) GLM_FUNC_DECL uint8 packUnorm2x3_1x2(vec3 const& v); /// Convert a packed integer to a normalized floating-point vector. /// /// @see gtc_packing /// @see uint8 packUnorm2x3_1x2(vec3 const& v) GLM_FUNC_DECL vec3 unpackUnorm2x3_1x2(uint8 p); /// Convert each component from an integer vector into a packed unsigned integer. /// /// @see gtc_packing /// @see i8vec2 unpackInt2x8(int16 p) GLM_FUNC_DECL int16 packInt2x8(i8vec2 const& v); /// Convert a packed integer into an integer vector. /// /// @see gtc_packing /// @see int16 packInt2x8(i8vec2 const& v) GLM_FUNC_DECL i8vec2 unpackInt2x8(int16 p); /// Convert each component from an integer vector into a packed unsigned integer. /// /// @see gtc_packing /// @see u8vec2 unpackInt2x8(uint16 p) GLM_FUNC_DECL uint16 packUint2x8(u8vec2 const& v); /// Convert a packed integer into an integer vector. /// /// @see gtc_packing /// @see uint16 packInt2x8(u8vec2 const& v) GLM_FUNC_DECL u8vec2 unpackUint2x8(uint16 p); /// Convert each component from an integer vector into a packed unsigned integer. /// /// @see gtc_packing /// @see i8vec4 unpackInt4x8(int32 p) GLM_FUNC_DECL int32 packInt4x8(i8vec4 const& v); /// Convert a packed integer into an integer vector. /// /// @see gtc_packing /// @see int32 packInt2x8(i8vec4 const& v) GLM_FUNC_DECL i8vec4 unpackInt4x8(int32 p); /// Convert each component from an integer vector into a packed unsigned integer. /// /// @see gtc_packing /// @see u8vec4 unpackUint4x8(uint32 p) GLM_FUNC_DECL uint32 packUint4x8(u8vec4 const& v); /// Convert a packed integer into an integer vector. /// /// @see gtc_packing /// @see uint32 packUint4x8(u8vec2 const& v) GLM_FUNC_DECL u8vec4 unpackUint4x8(uint32 p); /// Convert each component from an integer vector into a packed unsigned integer. /// /// @see gtc_packing /// @see i16vec2 unpackInt2x16(int p) GLM_FUNC_DECL int packInt2x16(i16vec2 const& v); /// Convert a packed integer into an integer vector. /// /// @see gtc_packing /// @see int packInt2x16(i16vec2 const& v) GLM_FUNC_DECL i16vec2 unpackInt2x16(int p); /// Convert each component from an integer vector into a packed unsigned integer. /// /// @see gtc_packing /// @see i16vec4 unpackInt4x16(int64 p) GLM_FUNC_DECL int64 packInt4x16(i16vec4 const& v); /// Convert a packed integer into an integer vector. /// /// @see gtc_packing /// @see int64 packInt4x16(i16vec4 const& v) GLM_FUNC_DECL i16vec4 unpackInt4x16(int64 p); /// Convert each component from an integer vector into a packed unsigned integer. /// /// @see gtc_packing /// @see u16vec2 unpackUint2x16(uint p) GLM_FUNC_DECL uint packUint2x16(u16vec2 const& v); /// Convert a packed integer into an integer vector. /// /// @see gtc_packing /// @see uint packUint2x16(u16vec2 const& v) GLM_FUNC_DECL u16vec2 unpackUint2x16(uint p); /// Convert each component from an integer vector into a packed unsigned integer. /// /// @see gtc_packing /// @see u16vec4 unpackUint4x16(uint64 p) GLM_FUNC_DECL uint64 packUint4x16(u16vec4 const& v); /// Convert a packed integer into an integer vector. /// /// @see gtc_packing /// @see uint64 packUint4x16(u16vec4 const& v) GLM_FUNC_DECL u16vec4 unpackUint4x16(uint64 p); /// Convert each component from an integer vector into a packed unsigned integer. /// /// @see gtc_packing /// @see i32vec2 unpackInt2x32(int p) GLM_FUNC_DECL int64 packInt2x32(i32vec2 const& v); /// Convert a packed integer into an integer vector. /// /// @see gtc_packing /// @see int packInt2x16(i32vec2 const& v) GLM_FUNC_DECL i32vec2 unpackInt2x32(int64 p); /// Convert each component from an integer vector into a packed unsigned integer. /// /// @see gtc_packing /// @see u32vec2 unpackUint2x32(int p) GLM_FUNC_DECL uint64 packUint2x32(u32vec2 const& v); /// Convert a packed integer into an integer vector. /// /// @see gtc_packing /// @see int packUint2x16(u32vec2 const& v) GLM_FUNC_DECL u32vec2 unpackUint2x32(uint64 p); /// @} }// namespace glm #include "packing.inl"
Unknown
3D
mcellteam/mcell
libs/glm/gtc/reciprocal.hpp
.hpp
3,550
136
/// @ref gtc_reciprocal /// @file glm/gtc/reciprocal.hpp /// /// @see core (dependence) /// /// @defgroup gtc_reciprocal GLM_GTC_reciprocal /// @ingroup gtc /// /// Include <glm/gtc/reciprocal.hpp> to use the features of this extension. /// /// Define secant, cosecant and cotangent functions. #pragma once // Dependencies #include "../detail/setup.hpp" #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTC_reciprocal extension included") #endif namespace glm { /// @addtogroup gtc_reciprocal /// @{ /// Secant function. /// hypotenuse / adjacent or 1 / cos(x) /// /// @tparam genType Floating-point scalar or vector types. /// /// @see gtc_reciprocal template<typename genType> GLM_FUNC_DECL genType sec(genType angle); /// Cosecant function. /// hypotenuse / opposite or 1 / sin(x) /// /// @tparam genType Floating-point scalar or vector types. /// /// @see gtc_reciprocal template<typename genType> GLM_FUNC_DECL genType csc(genType angle); /// Cotangent function. /// adjacent / opposite or 1 / tan(x) /// /// @tparam genType Floating-point scalar or vector types. /// /// @see gtc_reciprocal template<typename genType> GLM_FUNC_DECL genType cot(genType angle); /// Inverse secant function. /// /// @return Return an angle expressed in radians. /// @tparam genType Floating-point scalar or vector types. /// /// @see gtc_reciprocal template<typename genType> GLM_FUNC_DECL genType asec(genType x); /// Inverse cosecant function. /// /// @return Return an angle expressed in radians. /// @tparam genType Floating-point scalar or vector types. /// /// @see gtc_reciprocal template<typename genType> GLM_FUNC_DECL genType acsc(genType x); /// Inverse cotangent function. /// /// @return Return an angle expressed in radians. /// @tparam genType Floating-point scalar or vector types. /// /// @see gtc_reciprocal template<typename genType> GLM_FUNC_DECL genType acot(genType x); /// Secant hyperbolic function. /// /// @tparam genType Floating-point scalar or vector types. /// /// @see gtc_reciprocal template<typename genType> GLM_FUNC_DECL genType sech(genType angle); /// Cosecant hyperbolic function. /// /// @tparam genType Floating-point scalar or vector types. /// /// @see gtc_reciprocal template<typename genType> GLM_FUNC_DECL genType csch(genType angle); /// Cotangent hyperbolic function. /// /// @tparam genType Floating-point scalar or vector types. /// /// @see gtc_reciprocal template<typename genType> GLM_FUNC_DECL genType coth(genType angle); /// Inverse secant hyperbolic function. /// /// @return Return an angle expressed in radians. /// @tparam genType Floating-point scalar or vector types. /// /// @see gtc_reciprocal template<typename genType> GLM_FUNC_DECL genType asech(genType x); /// Inverse cosecant hyperbolic function. /// /// @return Return an angle expressed in radians. /// @tparam genType Floating-point scalar or vector types. /// /// @see gtc_reciprocal template<typename genType> GLM_FUNC_DECL genType acsch(genType x); /// Inverse cotangent hyperbolic function. /// /// @return Return an angle expressed in radians. /// @tparam genType Floating-point scalar or vector types. /// /// @see gtc_reciprocal template<typename genType> GLM_FUNC_DECL genType acoth(genType x); /// @} }//namespace glm #include "reciprocal.inl"
Unknown
3D
mcellteam/mcell
libs/glm/gtc/type_aligned.hpp
.hpp
69,298
1,316
/// @ref gtc_type_aligned /// @file glm/gtc/type_aligned.hpp /// /// @see core (dependence) /// /// @defgroup gtc_type_aligned GLM_GTC_type_aligned /// @ingroup gtc /// /// Include <glm/gtc/type_aligned.hpp> to use the features of this extension. /// /// Aligned types allowing SIMD optimizations of vectors and matrices types #pragma once #if (GLM_CONFIG_ALIGNED_GENTYPES == GLM_DISABLE) # error "GLM: Aligned gentypes require to enable C++ language extensions. Define GLM_FORCE_ALIGNED_GENTYPES before including GLM headers to use aligned types." #endif #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTC_type_aligned extension included") #endif #include "../mat4x4.hpp" #include "../mat4x3.hpp" #include "../mat4x2.hpp" #include "../mat3x4.hpp" #include "../mat3x3.hpp" #include "../mat3x2.hpp" #include "../mat2x4.hpp" #include "../mat2x3.hpp" #include "../mat2x2.hpp" #include "../gtc/vec1.hpp" #include "../vec2.hpp" #include "../vec3.hpp" #include "../vec4.hpp" namespace glm { /// @addtogroup gtc_type_aligned /// @{ // -- *vec1 -- /// 1 component vector aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef vec<1, float, aligned_highp> aligned_highp_vec1; /// 1 component vector aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef vec<1, float, aligned_mediump> aligned_mediump_vec1; /// 1 component vector aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef vec<1, float, aligned_lowp> aligned_lowp_vec1; /// 1 component vector aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef vec<1, double, aligned_highp> aligned_highp_dvec1; /// 1 component vector aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef vec<1, double, aligned_mediump> aligned_mediump_dvec1; /// 1 component vector aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef vec<1, double, aligned_lowp> aligned_lowp_dvec1; /// 1 component vector aligned in memory of signed integer numbers. typedef vec<1, int, aligned_highp> aligned_highp_ivec1; /// 1 component vector aligned in memory of signed integer numbers. typedef vec<1, int, aligned_mediump> aligned_mediump_ivec1; /// 1 component vector aligned in memory of signed integer numbers. typedef vec<1, int, aligned_lowp> aligned_lowp_ivec1; /// 1 component vector aligned in memory of unsigned integer numbers. typedef vec<1, uint, aligned_highp> aligned_highp_uvec1; /// 1 component vector aligned in memory of unsigned integer numbers. typedef vec<1, uint, aligned_mediump> aligned_mediump_uvec1; /// 1 component vector aligned in memory of unsigned integer numbers. typedef vec<1, uint, aligned_lowp> aligned_lowp_uvec1; /// 1 component vector aligned in memory of bool values. typedef vec<1, bool, aligned_highp> aligned_highp_bvec1; /// 1 component vector aligned in memory of bool values. typedef vec<1, bool, aligned_mediump> aligned_mediump_bvec1; /// 1 component vector aligned in memory of bool values. typedef vec<1, bool, aligned_lowp> aligned_lowp_bvec1; /// 1 component vector tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef vec<1, float, packed_highp> packed_highp_vec1; /// 1 component vector tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef vec<1, float, packed_mediump> packed_mediump_vec1; /// 1 component vector tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef vec<1, float, packed_lowp> packed_lowp_vec1; /// 1 component vector tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef vec<1, double, packed_highp> packed_highp_dvec1; /// 1 component vector tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef vec<1, double, packed_mediump> packed_mediump_dvec1; /// 1 component vector tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef vec<1, double, packed_lowp> packed_lowp_dvec1; /// 1 component vector tightly packed in memory of signed integer numbers. typedef vec<1, int, packed_highp> packed_highp_ivec1; /// 1 component vector tightly packed in memory of signed integer numbers. typedef vec<1, int, packed_mediump> packed_mediump_ivec1; /// 1 component vector tightly packed in memory of signed integer numbers. typedef vec<1, int, packed_lowp> packed_lowp_ivec1; /// 1 component vector tightly packed in memory of unsigned integer numbers. typedef vec<1, uint, packed_highp> packed_highp_uvec1; /// 1 component vector tightly packed in memory of unsigned integer numbers. typedef vec<1, uint, packed_mediump> packed_mediump_uvec1; /// 1 component vector tightly packed in memory of unsigned integer numbers. typedef vec<1, uint, packed_lowp> packed_lowp_uvec1; /// 1 component vector tightly packed in memory of bool values. typedef vec<1, bool, packed_highp> packed_highp_bvec1; /// 1 component vector tightly packed in memory of bool values. typedef vec<1, bool, packed_mediump> packed_mediump_bvec1; /// 1 component vector tightly packed in memory of bool values. typedef vec<1, bool, packed_lowp> packed_lowp_bvec1; // -- *vec2 -- /// 2 components vector aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef vec<2, float, aligned_highp> aligned_highp_vec2; /// 2 components vector aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef vec<2, float, aligned_mediump> aligned_mediump_vec2; /// 2 components vector aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef vec<2, float, aligned_lowp> aligned_lowp_vec2; /// 2 components vector aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef vec<2, double, aligned_highp> aligned_highp_dvec2; /// 2 components vector aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef vec<2, double, aligned_mediump> aligned_mediump_dvec2; /// 2 components vector aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef vec<2, double, aligned_lowp> aligned_lowp_dvec2; /// 2 components vector aligned in memory of signed integer numbers. typedef vec<2, int, aligned_highp> aligned_highp_ivec2; /// 2 components vector aligned in memory of signed integer numbers. typedef vec<2, int, aligned_mediump> aligned_mediump_ivec2; /// 2 components vector aligned in memory of signed integer numbers. typedef vec<2, int, aligned_lowp> aligned_lowp_ivec2; /// 2 components vector aligned in memory of unsigned integer numbers. typedef vec<2, uint, aligned_highp> aligned_highp_uvec2; /// 2 components vector aligned in memory of unsigned integer numbers. typedef vec<2, uint, aligned_mediump> aligned_mediump_uvec2; /// 2 components vector aligned in memory of unsigned integer numbers. typedef vec<2, uint, aligned_lowp> aligned_lowp_uvec2; /// 2 components vector aligned in memory of bool values. typedef vec<2, bool, aligned_highp> aligned_highp_bvec2; /// 2 components vector aligned in memory of bool values. typedef vec<2, bool, aligned_mediump> aligned_mediump_bvec2; /// 2 components vector aligned in memory of bool values. typedef vec<2, bool, aligned_lowp> aligned_lowp_bvec2; /// 2 components vector tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef vec<2, float, packed_highp> packed_highp_vec2; /// 2 components vector tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef vec<2, float, packed_mediump> packed_mediump_vec2; /// 2 components vector tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef vec<2, float, packed_lowp> packed_lowp_vec2; /// 2 components vector tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef vec<2, double, packed_highp> packed_highp_dvec2; /// 2 components vector tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef vec<2, double, packed_mediump> packed_mediump_dvec2; /// 2 components vector tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef vec<2, double, packed_lowp> packed_lowp_dvec2; /// 2 components vector tightly packed in memory of signed integer numbers. typedef vec<2, int, packed_highp> packed_highp_ivec2; /// 2 components vector tightly packed in memory of signed integer numbers. typedef vec<2, int, packed_mediump> packed_mediump_ivec2; /// 2 components vector tightly packed in memory of signed integer numbers. typedef vec<2, int, packed_lowp> packed_lowp_ivec2; /// 2 components vector tightly packed in memory of unsigned integer numbers. typedef vec<2, uint, packed_highp> packed_highp_uvec2; /// 2 components vector tightly packed in memory of unsigned integer numbers. typedef vec<2, uint, packed_mediump> packed_mediump_uvec2; /// 2 components vector tightly packed in memory of unsigned integer numbers. typedef vec<2, uint, packed_lowp> packed_lowp_uvec2; /// 2 components vector tightly packed in memory of bool values. typedef vec<2, bool, packed_highp> packed_highp_bvec2; /// 2 components vector tightly packed in memory of bool values. typedef vec<2, bool, packed_mediump> packed_mediump_bvec2; /// 2 components vector tightly packed in memory of bool values. typedef vec<2, bool, packed_lowp> packed_lowp_bvec2; // -- *vec3 -- /// 3 components vector aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef vec<3, float, aligned_highp> aligned_highp_vec3; /// 3 components vector aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef vec<3, float, aligned_mediump> aligned_mediump_vec3; /// 3 components vector aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef vec<3, float, aligned_lowp> aligned_lowp_vec3; /// 3 components vector aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef vec<3, double, aligned_highp> aligned_highp_dvec3; /// 3 components vector aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef vec<3, double, aligned_mediump> aligned_mediump_dvec3; /// 3 components vector aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef vec<3, double, aligned_lowp> aligned_lowp_dvec3; /// 3 components vector aligned in memory of signed integer numbers. typedef vec<3, int, aligned_highp> aligned_highp_ivec3; /// 3 components vector aligned in memory of signed integer numbers. typedef vec<3, int, aligned_mediump> aligned_mediump_ivec3; /// 3 components vector aligned in memory of signed integer numbers. typedef vec<3, int, aligned_lowp> aligned_lowp_ivec3; /// 3 components vector aligned in memory of unsigned integer numbers. typedef vec<3, uint, aligned_highp> aligned_highp_uvec3; /// 3 components vector aligned in memory of unsigned integer numbers. typedef vec<3, uint, aligned_mediump> aligned_mediump_uvec3; /// 3 components vector aligned in memory of unsigned integer numbers. typedef vec<3, uint, aligned_lowp> aligned_lowp_uvec3; /// 3 components vector aligned in memory of bool values. typedef vec<3, bool, aligned_highp> aligned_highp_bvec3; /// 3 components vector aligned in memory of bool values. typedef vec<3, bool, aligned_mediump> aligned_mediump_bvec3; /// 3 components vector aligned in memory of bool values. typedef vec<3, bool, aligned_lowp> aligned_lowp_bvec3; /// 3 components vector tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef vec<3, float, packed_highp> packed_highp_vec3; /// 3 components vector tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef vec<3, float, packed_mediump> packed_mediump_vec3; /// 3 components vector tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef vec<3, float, packed_lowp> packed_lowp_vec3; /// 3 components vector tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef vec<3, double, packed_highp> packed_highp_dvec3; /// 3 components vector tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef vec<3, double, packed_mediump> packed_mediump_dvec3; /// 3 components vector tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef vec<3, double, packed_lowp> packed_lowp_dvec3; /// 3 components vector tightly packed in memory of signed integer numbers. typedef vec<3, int, packed_highp> packed_highp_ivec3; /// 3 components vector tightly packed in memory of signed integer numbers. typedef vec<3, int, packed_mediump> packed_mediump_ivec3; /// 3 components vector tightly packed in memory of signed integer numbers. typedef vec<3, int, packed_lowp> packed_lowp_ivec3; /// 3 components vector tightly packed in memory of unsigned integer numbers. typedef vec<3, uint, packed_highp> packed_highp_uvec3; /// 3 components vector tightly packed in memory of unsigned integer numbers. typedef vec<3, uint, packed_mediump> packed_mediump_uvec3; /// 3 components vector tightly packed in memory of unsigned integer numbers. typedef vec<3, uint, packed_lowp> packed_lowp_uvec3; /// 3 components vector tightly packed in memory of bool values. typedef vec<3, bool, packed_highp> packed_highp_bvec3; /// 3 components vector tightly packed in memory of bool values. typedef vec<3, bool, packed_mediump> packed_mediump_bvec3; /// 3 components vector tightly packed in memory of bool values. typedef vec<3, bool, packed_lowp> packed_lowp_bvec3; // -- *vec4 -- /// 4 components vector aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef vec<4, float, aligned_highp> aligned_highp_vec4; /// 4 components vector aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef vec<4, float, aligned_mediump> aligned_mediump_vec4; /// 4 components vector aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef vec<4, float, aligned_lowp> aligned_lowp_vec4; /// 4 components vector aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef vec<4, double, aligned_highp> aligned_highp_dvec4; /// 4 components vector aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef vec<4, double, aligned_mediump> aligned_mediump_dvec4; /// 4 components vector aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef vec<4, double, aligned_lowp> aligned_lowp_dvec4; /// 4 components vector aligned in memory of signed integer numbers. typedef vec<4, int, aligned_highp> aligned_highp_ivec4; /// 4 components vector aligned in memory of signed integer numbers. typedef vec<4, int, aligned_mediump> aligned_mediump_ivec4; /// 4 components vector aligned in memory of signed integer numbers. typedef vec<4, int, aligned_lowp> aligned_lowp_ivec4; /// 4 components vector aligned in memory of unsigned integer numbers. typedef vec<4, uint, aligned_highp> aligned_highp_uvec4; /// 4 components vector aligned in memory of unsigned integer numbers. typedef vec<4, uint, aligned_mediump> aligned_mediump_uvec4; /// 4 components vector aligned in memory of unsigned integer numbers. typedef vec<4, uint, aligned_lowp> aligned_lowp_uvec4; /// 4 components vector aligned in memory of bool values. typedef vec<4, bool, aligned_highp> aligned_highp_bvec4; /// 4 components vector aligned in memory of bool values. typedef vec<4, bool, aligned_mediump> aligned_mediump_bvec4; /// 4 components vector aligned in memory of bool values. typedef vec<4, bool, aligned_lowp> aligned_lowp_bvec4; /// 4 components vector tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef vec<4, float, packed_highp> packed_highp_vec4; /// 4 components vector tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef vec<4, float, packed_mediump> packed_mediump_vec4; /// 4 components vector tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef vec<4, float, packed_lowp> packed_lowp_vec4; /// 4 components vector tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef vec<4, double, packed_highp> packed_highp_dvec4; /// 4 components vector tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef vec<4, double, packed_mediump> packed_mediump_dvec4; /// 4 components vector tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef vec<4, double, packed_lowp> packed_lowp_dvec4; /// 4 components vector tightly packed in memory of signed integer numbers. typedef vec<4, int, packed_highp> packed_highp_ivec4; /// 4 components vector tightly packed in memory of signed integer numbers. typedef vec<4, int, packed_mediump> packed_mediump_ivec4; /// 4 components vector tightly packed in memory of signed integer numbers. typedef vec<4, int, packed_lowp> packed_lowp_ivec4; /// 4 components vector tightly packed in memory of unsigned integer numbers. typedef vec<4, uint, packed_highp> packed_highp_uvec4; /// 4 components vector tightly packed in memory of unsigned integer numbers. typedef vec<4, uint, packed_mediump> packed_mediump_uvec4; /// 4 components vector tightly packed in memory of unsigned integer numbers. typedef vec<4, uint, packed_lowp> packed_lowp_uvec4; /// 4 components vector tightly packed in memory of bool values. typedef vec<4, bool, packed_highp> packed_highp_bvec4; /// 4 components vector tightly packed in memory of bool values. typedef vec<4, bool, packed_mediump> packed_mediump_bvec4; /// 4 components vector tightly packed in memory of bool values. typedef vec<4, bool, packed_lowp> packed_lowp_bvec4; // -- *mat2 -- /// 2 by 2 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef mat<2, 2, float, aligned_highp> aligned_highp_mat2; /// 2 by 2 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef mat<2, 2, float, aligned_mediump> aligned_mediump_mat2; /// 2 by 2 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef mat<2, 2, float, aligned_lowp> aligned_lowp_mat2; /// 2 by 2 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef mat<2, 2, double, aligned_highp> aligned_highp_dmat2; /// 2 by 2 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef mat<2, 2, double, aligned_mediump> aligned_mediump_dmat2; /// 2 by 2 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef mat<2, 2, double, aligned_lowp> aligned_lowp_dmat2; /// 2 by 2 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef mat<2, 2, float, packed_highp> packed_highp_mat2; /// 2 by 2 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef mat<2, 2, float, packed_mediump> packed_mediump_mat2; /// 2 by 2 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef mat<2, 2, float, packed_lowp> packed_lowp_mat2; /// 2 by 2 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef mat<2, 2, double, packed_highp> packed_highp_dmat2; /// 2 by 2 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef mat<2, 2, double, packed_mediump> packed_mediump_dmat2; /// 2 by 2 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef mat<2, 2, double, packed_lowp> packed_lowp_dmat2; // -- *mat3 -- /// 3 by 3 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef mat<3, 3, float, aligned_highp> aligned_highp_mat3; /// 3 by 3 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef mat<3, 3, float, aligned_mediump> aligned_mediump_mat3; /// 3 by 3 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef mat<3, 3, float, aligned_lowp> aligned_lowp_mat3; /// 3 by 3 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef mat<3, 3, double, aligned_highp> aligned_highp_dmat3; /// 3 by 3 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef mat<3, 3, double, aligned_mediump> aligned_mediump_dmat3; /// 3 by 3 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef mat<3, 3, double, aligned_lowp> aligned_lowp_dmat3; /// 3 by 3 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef mat<3, 3, float, packed_highp> packed_highp_mat3; /// 3 by 3 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef mat<3, 3, float, packed_mediump> packed_mediump_mat3; /// 3 by 3 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef mat<3, 3, float, packed_lowp> packed_lowp_mat3; /// 3 by 3 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef mat<3, 3, double, packed_highp> packed_highp_dmat3; /// 3 by 3 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef mat<3, 3, double, packed_mediump> packed_mediump_dmat3; /// 3 by 3 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef mat<3, 3, double, packed_lowp> packed_lowp_dmat3; // -- *mat4 -- /// 4 by 4 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef mat<4, 4, float, aligned_highp> aligned_highp_mat4; /// 4 by 4 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef mat<4, 4, float, aligned_mediump> aligned_mediump_mat4; /// 4 by 4 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef mat<4, 4, float, aligned_lowp> aligned_lowp_mat4; /// 4 by 4 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef mat<4, 4, double, aligned_highp> aligned_highp_dmat4; /// 4 by 4 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef mat<4, 4, double, aligned_mediump> aligned_mediump_dmat4; /// 4 by 4 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef mat<4, 4, double, aligned_lowp> aligned_lowp_dmat4; /// 4 by 4 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef mat<4, 4, float, packed_highp> packed_highp_mat4; /// 4 by 4 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef mat<4, 4, float, packed_mediump> packed_mediump_mat4; /// 4 by 4 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef mat<4, 4, float, packed_lowp> packed_lowp_mat4; /// 4 by 4 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef mat<4, 4, double, packed_highp> packed_highp_dmat4; /// 4 by 4 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef mat<4, 4, double, packed_mediump> packed_mediump_dmat4; /// 4 by 4 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef mat<4, 4, double, packed_lowp> packed_lowp_dmat4; // -- *mat2x2 -- /// 2 by 2 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef mat<2, 2, float, aligned_highp> aligned_highp_mat2x2; /// 2 by 2 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef mat<2, 2, float, aligned_mediump> aligned_mediump_mat2x2; /// 2 by 2 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef mat<2, 2, float, aligned_lowp> aligned_lowp_mat2x2; /// 2 by 2 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef mat<2, 2, double, aligned_highp> aligned_highp_dmat2x2; /// 2 by 2 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef mat<2, 2, double, aligned_mediump> aligned_mediump_dmat2x2; /// 2 by 2 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef mat<2, 2, double, aligned_lowp> aligned_lowp_dmat2x2; /// 2 by 2 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef mat<2, 2, float, packed_highp> packed_highp_mat2x2; /// 2 by 2 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef mat<2, 2, float, packed_mediump> packed_mediump_mat2x2; /// 2 by 2 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef mat<2, 2, float, packed_lowp> packed_lowp_mat2x2; /// 2 by 2 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef mat<2, 2, double, packed_highp> packed_highp_dmat2x2; /// 2 by 2 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef mat<2, 2, double, packed_mediump> packed_mediump_dmat2x2; /// 2 by 2 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef mat<2, 2, double, packed_lowp> packed_lowp_dmat2x2; // -- *mat2x3 -- /// 2 by 3 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef mat<2, 3, float, aligned_highp> aligned_highp_mat2x3; /// 2 by 3 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef mat<2, 3, float, aligned_mediump> aligned_mediump_mat2x3; /// 2 by 3 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef mat<2, 3, float, aligned_lowp> aligned_lowp_mat2x3; /// 2 by 3 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef mat<2, 3, double, aligned_highp> aligned_highp_dmat2x3; /// 2 by 3 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef mat<2, 3, double, aligned_mediump> aligned_mediump_dmat2x3; /// 2 by 3 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef mat<2, 3, double, aligned_lowp> aligned_lowp_dmat2x3; /// 2 by 3 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef mat<2, 3, float, packed_highp> packed_highp_mat2x3; /// 2 by 3 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef mat<2, 3, float, packed_mediump> packed_mediump_mat2x3; /// 2 by 3 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef mat<2, 3, float, packed_lowp> packed_lowp_mat2x3; /// 2 by 3 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef mat<2, 3, double, packed_highp> packed_highp_dmat2x3; /// 2 by 3 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef mat<2, 3, double, packed_mediump> packed_mediump_dmat2x3; /// 2 by 3 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef mat<2, 3, double, packed_lowp> packed_lowp_dmat2x3; // -- *mat2x4 -- /// 2 by 4 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef mat<2, 4, float, aligned_highp> aligned_highp_mat2x4; /// 2 by 4 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef mat<2, 4, float, aligned_mediump> aligned_mediump_mat2x4; /// 2 by 4 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef mat<2, 4, float, aligned_lowp> aligned_lowp_mat2x4; /// 2 by 4 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef mat<2, 4, double, aligned_highp> aligned_highp_dmat2x4; /// 2 by 4 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef mat<2, 4, double, aligned_mediump> aligned_mediump_dmat2x4; /// 2 by 4 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef mat<2, 4, double, aligned_lowp> aligned_lowp_dmat2x4; /// 2 by 4 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef mat<2, 4, float, packed_highp> packed_highp_mat2x4; /// 2 by 4 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef mat<2, 4, float, packed_mediump> packed_mediump_mat2x4; /// 2 by 4 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef mat<2, 4, float, packed_lowp> packed_lowp_mat2x4; /// 2 by 4 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef mat<2, 4, double, packed_highp> packed_highp_dmat2x4; /// 2 by 4 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef mat<2, 4, double, packed_mediump> packed_mediump_dmat2x4; /// 2 by 4 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef mat<2, 4, double, packed_lowp> packed_lowp_dmat2x4; // -- *mat3x2 -- /// 3 by 2 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef mat<3, 2, float, aligned_highp> aligned_highp_mat3x2; /// 3 by 2 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef mat<3, 2, float, aligned_mediump> aligned_mediump_mat3x2; /// 3 by 2 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef mat<3, 2, float, aligned_lowp> aligned_lowp_mat3x2; /// 3 by 2 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef mat<3, 2, double, aligned_highp> aligned_highp_dmat3x2; /// 3 by 2 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef mat<3, 2, double, aligned_mediump> aligned_mediump_dmat3x2; /// 3 by 2 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef mat<3, 2, double, aligned_lowp> aligned_lowp_dmat3x2; /// 3 by 2 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef mat<3, 2, float, packed_highp> packed_highp_mat3x2; /// 3 by 2 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef mat<3, 2, float, packed_mediump> packed_mediump_mat3x2; /// 3 by 2 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef mat<3, 2, float, packed_lowp> packed_lowp_mat3x2; /// 3 by 2 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef mat<3, 2, double, packed_highp> packed_highp_dmat3x2; /// 3 by 2 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef mat<3, 2, double, packed_mediump> packed_mediump_dmat3x2; /// 3 by 2 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef mat<3, 2, double, packed_lowp> packed_lowp_dmat3x2; // -- *mat3x3 -- /// 3 by 3 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef mat<3, 3, float, aligned_highp> aligned_highp_mat3x3; /// 3 by 3 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef mat<3, 3, float, aligned_mediump> aligned_mediump_mat3x3; /// 3 by 3 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef mat<3, 3, float, aligned_lowp> aligned_lowp_mat3x3; /// 3 by 3 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef mat<3, 3, double, aligned_highp> aligned_highp_dmat3x3; /// 3 by 3 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef mat<3, 3, double, aligned_mediump> aligned_mediump_dmat3x3; /// 3 by 3 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef mat<3, 3, double, aligned_lowp> aligned_lowp_dmat3x3; /// 3 by 3 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef mat<3, 3, float, packed_highp> packed_highp_mat3x3; /// 3 by 3 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef mat<3, 3, float, packed_mediump> packed_mediump_mat3x3; /// 3 by 3 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef mat<3, 3, float, packed_lowp> packed_lowp_mat3x3; /// 3 by 3 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef mat<3, 3, double, packed_highp> packed_highp_dmat3x3; /// 3 by 3 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef mat<3, 3, double, packed_mediump> packed_mediump_dmat3x3; /// 3 by 3 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef mat<3, 3, double, packed_lowp> packed_lowp_dmat3x3; // -- *mat3x4 -- /// 3 by 4 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef mat<3, 4, float, aligned_highp> aligned_highp_mat3x4; /// 3 by 4 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef mat<3, 4, float, aligned_mediump> aligned_mediump_mat3x4; /// 3 by 4 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef mat<3, 4, float, aligned_lowp> aligned_lowp_mat3x4; /// 3 by 4 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef mat<3, 4, double, aligned_highp> aligned_highp_dmat3x4; /// 3 by 4 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef mat<3, 4, double, aligned_mediump> aligned_mediump_dmat3x4; /// 3 by 4 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef mat<3, 4, double, aligned_lowp> aligned_lowp_dmat3x4; /// 3 by 4 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef mat<3, 4, float, packed_highp> packed_highp_mat3x4; /// 3 by 4 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef mat<3, 4, float, packed_mediump> packed_mediump_mat3x4; /// 3 by 4 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef mat<3, 4, float, packed_lowp> packed_lowp_mat3x4; /// 3 by 4 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef mat<3, 4, double, packed_highp> packed_highp_dmat3x4; /// 3 by 4 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef mat<3, 4, double, packed_mediump> packed_mediump_dmat3x4; /// 3 by 4 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef mat<3, 4, double, packed_lowp> packed_lowp_dmat3x4; // -- *mat4x2 -- /// 4 by 2 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef mat<4, 2, float, aligned_highp> aligned_highp_mat4x2; /// 4 by 2 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef mat<4, 2, float, aligned_mediump> aligned_mediump_mat4x2; /// 4 by 2 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef mat<4, 2, float, aligned_lowp> aligned_lowp_mat4x2; /// 4 by 2 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef mat<4, 2, double, aligned_highp> aligned_highp_dmat4x2; /// 4 by 2 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef mat<4, 2, double, aligned_mediump> aligned_mediump_dmat4x2; /// 4 by 2 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef mat<4, 2, double, aligned_lowp> aligned_lowp_dmat4x2; /// 4 by 2 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef mat<4, 2, float, packed_highp> packed_highp_mat4x2; /// 4 by 2 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef mat<4, 2, float, packed_mediump> packed_mediump_mat4x2; /// 4 by 2 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef mat<4, 2, float, packed_lowp> packed_lowp_mat4x2; /// 4 by 2 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef mat<4, 2, double, packed_highp> packed_highp_dmat4x2; /// 4 by 2 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef mat<4, 2, double, packed_mediump> packed_mediump_dmat4x2; /// 4 by 2 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef mat<4, 2, double, packed_lowp> packed_lowp_dmat4x2; // -- *mat4x3 -- /// 4 by 3 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef mat<4, 3, float, aligned_highp> aligned_highp_mat4x3; /// 4 by 3 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef mat<4, 3, float, aligned_mediump> aligned_mediump_mat4x3; /// 4 by 3 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef mat<4, 3, float, aligned_lowp> aligned_lowp_mat4x3; /// 4 by 3 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef mat<4, 3, double, aligned_highp> aligned_highp_dmat4x3; /// 4 by 3 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef mat<4, 3, double, aligned_mediump> aligned_mediump_dmat4x3; /// 4 by 3 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef mat<4, 3, double, aligned_lowp> aligned_lowp_dmat4x3; /// 4 by 3 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef mat<4, 3, float, packed_highp> packed_highp_mat4x3; /// 4 by 3 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef mat<4, 3, float, packed_mediump> packed_mediump_mat4x3; /// 4 by 3 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef mat<4, 3, float, packed_lowp> packed_lowp_mat4x3; /// 4 by 3 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef mat<4, 3, double, packed_highp> packed_highp_dmat4x3; /// 4 by 3 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef mat<4, 3, double, packed_mediump> packed_mediump_dmat4x3; /// 4 by 3 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef mat<4, 3, double, packed_lowp> packed_lowp_dmat4x3; // -- *mat4x4 -- /// 4 by 4 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef mat<4, 4, float, aligned_highp> aligned_highp_mat4x4; /// 4 by 4 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef mat<4, 4, float, aligned_mediump> aligned_mediump_mat4x4; /// 4 by 4 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef mat<4, 4, float, aligned_lowp> aligned_lowp_mat4x4; /// 4 by 4 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef mat<4, 4, double, aligned_highp> aligned_highp_dmat4x4; /// 4 by 4 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef mat<4, 4, double, aligned_mediump> aligned_mediump_dmat4x4; /// 4 by 4 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef mat<4, 4, double, aligned_lowp> aligned_lowp_dmat4x4; /// 4 by 4 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef mat<4, 4, float, packed_highp> packed_highp_mat4x4; /// 4 by 4 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef mat<4, 4, float, packed_mediump> packed_mediump_mat4x4; /// 4 by 4 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef mat<4, 4, float, packed_lowp> packed_lowp_mat4x4; /// 4 by 4 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. typedef mat<4, 4, double, packed_highp> packed_highp_dmat4x4; /// 4 by 4 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. typedef mat<4, 4, double, packed_mediump> packed_mediump_dmat4x4; /// 4 by 4 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. typedef mat<4, 4, double, packed_lowp> packed_lowp_dmat4x4; // -- default -- #if(defined(GLM_PRECISION_LOWP_FLOAT)) typedef aligned_lowp_vec1 aligned_vec1; typedef aligned_lowp_vec2 aligned_vec2; typedef aligned_lowp_vec3 aligned_vec3; typedef aligned_lowp_vec4 aligned_vec4; typedef packed_lowp_vec1 packed_vec1; typedef packed_lowp_vec2 packed_vec2; typedef packed_lowp_vec3 packed_vec3; typedef packed_lowp_vec4 packed_vec4; typedef aligned_lowp_mat2 aligned_mat2; typedef aligned_lowp_mat3 aligned_mat3; typedef aligned_lowp_mat4 aligned_mat4; typedef packed_lowp_mat2 packed_mat2; typedef packed_lowp_mat3 packed_mat3; typedef packed_lowp_mat4 packed_mat4; typedef aligned_lowp_mat2x2 aligned_mat2x2; typedef aligned_lowp_mat2x3 aligned_mat2x3; typedef aligned_lowp_mat2x4 aligned_mat2x4; typedef aligned_lowp_mat3x2 aligned_mat3x2; typedef aligned_lowp_mat3x3 aligned_mat3x3; typedef aligned_lowp_mat3x4 aligned_mat3x4; typedef aligned_lowp_mat4x2 aligned_mat4x2; typedef aligned_lowp_mat4x3 aligned_mat4x3; typedef aligned_lowp_mat4x4 aligned_mat4x4; typedef packed_lowp_mat2x2 packed_mat2x2; typedef packed_lowp_mat2x3 packed_mat2x3; typedef packed_lowp_mat2x4 packed_mat2x4; typedef packed_lowp_mat3x2 packed_mat3x2; typedef packed_lowp_mat3x3 packed_mat3x3; typedef packed_lowp_mat3x4 packed_mat3x4; typedef packed_lowp_mat4x2 packed_mat4x2; typedef packed_lowp_mat4x3 packed_mat4x3; typedef packed_lowp_mat4x4 packed_mat4x4; #elif(defined(GLM_PRECISION_MEDIUMP_FLOAT)) typedef aligned_mediump_vec1 aligned_vec1; typedef aligned_mediump_vec2 aligned_vec2; typedef aligned_mediump_vec3 aligned_vec3; typedef aligned_mediump_vec4 aligned_vec4; typedef packed_mediump_vec1 packed_vec1; typedef packed_mediump_vec2 packed_vec2; typedef packed_mediump_vec3 packed_vec3; typedef packed_mediump_vec4 packed_vec4; typedef aligned_mediump_mat2 aligned_mat2; typedef aligned_mediump_mat3 aligned_mat3; typedef aligned_mediump_mat4 aligned_mat4; typedef packed_mediump_mat2 packed_mat2; typedef packed_mediump_mat3 packed_mat3; typedef packed_mediump_mat4 packed_mat4; typedef aligned_mediump_mat2x2 aligned_mat2x2; typedef aligned_mediump_mat2x3 aligned_mat2x3; typedef aligned_mediump_mat2x4 aligned_mat2x4; typedef aligned_mediump_mat3x2 aligned_mat3x2; typedef aligned_mediump_mat3x3 aligned_mat3x3; typedef aligned_mediump_mat3x4 aligned_mat3x4; typedef aligned_mediump_mat4x2 aligned_mat4x2; typedef aligned_mediump_mat4x3 aligned_mat4x3; typedef aligned_mediump_mat4x4 aligned_mat4x4; typedef packed_mediump_mat2x2 packed_mat2x2; typedef packed_mediump_mat2x3 packed_mat2x3; typedef packed_mediump_mat2x4 packed_mat2x4; typedef packed_mediump_mat3x2 packed_mat3x2; typedef packed_mediump_mat3x3 packed_mat3x3; typedef packed_mediump_mat3x4 packed_mat3x4; typedef packed_mediump_mat4x2 packed_mat4x2; typedef packed_mediump_mat4x3 packed_mat4x3; typedef packed_mediump_mat4x4 packed_mat4x4; #else //defined(GLM_PRECISION_HIGHP_FLOAT) /// 1 component vector aligned in memory of single-precision floating-point numbers. typedef aligned_highp_vec1 aligned_vec1; /// 2 components vector aligned in memory of single-precision floating-point numbers. typedef aligned_highp_vec2 aligned_vec2; /// 3 components vector aligned in memory of single-precision floating-point numbers. typedef aligned_highp_vec3 aligned_vec3; /// 4 components vector aligned in memory of single-precision floating-point numbers. typedef aligned_highp_vec4 aligned_vec4; /// 1 component vector tightly packed in memory of single-precision floating-point numbers. typedef packed_highp_vec1 packed_vec1; /// 2 components vector tightly packed in memory of single-precision floating-point numbers. typedef packed_highp_vec2 packed_vec2; /// 3 components vector tightly packed in memory of single-precision floating-point numbers. typedef packed_highp_vec3 packed_vec3; /// 4 components vector tightly packed in memory of single-precision floating-point numbers. typedef packed_highp_vec4 packed_vec4; /// 2 by 2 matrix tightly aligned in memory of single-precision floating-point numbers. typedef aligned_highp_mat2 aligned_mat2; /// 3 by 3 matrix tightly aligned in memory of single-precision floating-point numbers. typedef aligned_highp_mat3 aligned_mat3; /// 4 by 4 matrix tightly aligned in memory of single-precision floating-point numbers. typedef aligned_highp_mat4 aligned_mat4; /// 2 by 2 matrix tightly packed in memory of single-precision floating-point numbers. typedef packed_highp_mat2 packed_mat2; /// 3 by 3 matrix tightly packed in memory of single-precision floating-point numbers. typedef packed_highp_mat3 packed_mat3; /// 4 by 4 matrix tightly packed in memory of single-precision floating-point numbers. typedef packed_highp_mat4 packed_mat4; /// 2 by 2 matrix tightly aligned in memory of single-precision floating-point numbers. typedef aligned_highp_mat2x2 aligned_mat2x2; /// 2 by 3 matrix tightly aligned in memory of single-precision floating-point numbers. typedef aligned_highp_mat2x3 aligned_mat2x3; /// 2 by 4 matrix tightly aligned in memory of single-precision floating-point numbers. typedef aligned_highp_mat2x4 aligned_mat2x4; /// 3 by 2 matrix tightly aligned in memory of single-precision floating-point numbers. typedef aligned_highp_mat3x2 aligned_mat3x2; /// 3 by 3 matrix tightly aligned in memory of single-precision floating-point numbers. typedef aligned_highp_mat3x3 aligned_mat3x3; /// 3 by 4 matrix tightly aligned in memory of single-precision floating-point numbers. typedef aligned_highp_mat3x4 aligned_mat3x4; /// 4 by 2 matrix tightly aligned in memory of single-precision floating-point numbers. typedef aligned_highp_mat4x2 aligned_mat4x2; /// 4 by 3 matrix tightly aligned in memory of single-precision floating-point numbers. typedef aligned_highp_mat4x3 aligned_mat4x3; /// 4 by 4 matrix tightly aligned in memory of single-precision floating-point numbers. typedef aligned_highp_mat4x4 aligned_mat4x4; /// 2 by 2 matrix tightly packed in memory of single-precision floating-point numbers. typedef packed_highp_mat2x2 packed_mat2x2; /// 2 by 3 matrix tightly packed in memory of single-precision floating-point numbers. typedef packed_highp_mat2x3 packed_mat2x3; /// 2 by 4 matrix tightly packed in memory of single-precision floating-point numbers. typedef packed_highp_mat2x4 packed_mat2x4; /// 3 by 2 matrix tightly packed in memory of single-precision floating-point numbers. typedef packed_highp_mat3x2 packed_mat3x2; /// 3 by 3 matrix tightly packed in memory of single-precision floating-point numbers. typedef packed_highp_mat3x3 packed_mat3x3; /// 3 by 4 matrix tightly packed in memory of single-precision floating-point numbers. typedef packed_highp_mat3x4 packed_mat3x4; /// 4 by 2 matrix tightly packed in memory of single-precision floating-point numbers. typedef packed_highp_mat4x2 packed_mat4x2; /// 4 by 3 matrix tightly packed in memory of single-precision floating-point numbers. typedef packed_highp_mat4x3 packed_mat4x3; /// 4 by 4 matrix tightly packed in memory of single-precision floating-point numbers. typedef packed_highp_mat4x4 packed_mat4x4; #endif//GLM_PRECISION #if(defined(GLM_PRECISION_LOWP_DOUBLE)) typedef aligned_lowp_dvec1 aligned_dvec1; typedef aligned_lowp_dvec2 aligned_dvec2; typedef aligned_lowp_dvec3 aligned_dvec3; typedef aligned_lowp_dvec4 aligned_dvec4; typedef packed_lowp_dvec1 packed_dvec1; typedef packed_lowp_dvec2 packed_dvec2; typedef packed_lowp_dvec3 packed_dvec3; typedef packed_lowp_dvec4 packed_dvec4; typedef aligned_lowp_dmat2 aligned_dmat2; typedef aligned_lowp_dmat3 aligned_dmat3; typedef aligned_lowp_dmat4 aligned_dmat4; typedef packed_lowp_dmat2 packed_dmat2; typedef packed_lowp_dmat3 packed_dmat3; typedef packed_lowp_dmat4 packed_dmat4; typedef aligned_lowp_dmat2x2 aligned_dmat2x2; typedef aligned_lowp_dmat2x3 aligned_dmat2x3; typedef aligned_lowp_dmat2x4 aligned_dmat2x4; typedef aligned_lowp_dmat3x2 aligned_dmat3x2; typedef aligned_lowp_dmat3x3 aligned_dmat3x3; typedef aligned_lowp_dmat3x4 aligned_dmat3x4; typedef aligned_lowp_dmat4x2 aligned_dmat4x2; typedef aligned_lowp_dmat4x3 aligned_dmat4x3; typedef aligned_lowp_dmat4x4 aligned_dmat4x4; typedef packed_lowp_dmat2x2 packed_dmat2x2; typedef packed_lowp_dmat2x3 packed_dmat2x3; typedef packed_lowp_dmat2x4 packed_dmat2x4; typedef packed_lowp_dmat3x2 packed_dmat3x2; typedef packed_lowp_dmat3x3 packed_dmat3x3; typedef packed_lowp_dmat3x4 packed_dmat3x4; typedef packed_lowp_dmat4x2 packed_dmat4x2; typedef packed_lowp_dmat4x3 packed_dmat4x3; typedef packed_lowp_dmat4x4 packed_dmat4x4; #elif(defined(GLM_PRECISION_MEDIUMP_DOUBLE)) typedef aligned_mediump_dvec1 aligned_dvec1; typedef aligned_mediump_dvec2 aligned_dvec2; typedef aligned_mediump_dvec3 aligned_dvec3; typedef aligned_mediump_dvec4 aligned_dvec4; typedef packed_mediump_dvec1 packed_dvec1; typedef packed_mediump_dvec2 packed_dvec2; typedef packed_mediump_dvec3 packed_dvec3; typedef packed_mediump_dvec4 packed_dvec4; typedef aligned_mediump_dmat2 aligned_dmat2; typedef aligned_mediump_dmat3 aligned_dmat3; typedef aligned_mediump_dmat4 aligned_dmat4; typedef packed_mediump_dmat2 packed_dmat2; typedef packed_mediump_dmat3 packed_dmat3; typedef packed_mediump_dmat4 packed_dmat4; typedef aligned_mediump_dmat2x2 aligned_dmat2x2; typedef aligned_mediump_dmat2x3 aligned_dmat2x3; typedef aligned_mediump_dmat2x4 aligned_dmat2x4; typedef aligned_mediump_dmat3x2 aligned_dmat3x2; typedef aligned_mediump_dmat3x3 aligned_dmat3x3; typedef aligned_mediump_dmat3x4 aligned_dmat3x4; typedef aligned_mediump_dmat4x2 aligned_dmat4x2; typedef aligned_mediump_dmat4x3 aligned_dmat4x3; typedef aligned_mediump_dmat4x4 aligned_dmat4x4; typedef packed_mediump_dmat2x2 packed_dmat2x2; typedef packed_mediump_dmat2x3 packed_dmat2x3; typedef packed_mediump_dmat2x4 packed_dmat2x4; typedef packed_mediump_dmat3x2 packed_dmat3x2; typedef packed_mediump_dmat3x3 packed_dmat3x3; typedef packed_mediump_dmat3x4 packed_dmat3x4; typedef packed_mediump_dmat4x2 packed_dmat4x2; typedef packed_mediump_dmat4x3 packed_dmat4x3; typedef packed_mediump_dmat4x4 packed_dmat4x4; #else //defined(GLM_PRECISION_HIGHP_DOUBLE) /// 1 component vector aligned in memory of double-precision floating-point numbers. typedef aligned_highp_dvec1 aligned_dvec1; /// 2 components vector aligned in memory of double-precision floating-point numbers. typedef aligned_highp_dvec2 aligned_dvec2; /// 3 components vector aligned in memory of double-precision floating-point numbers. typedef aligned_highp_dvec3 aligned_dvec3; /// 4 components vector aligned in memory of double-precision floating-point numbers. typedef aligned_highp_dvec4 aligned_dvec4; /// 1 component vector tightly packed in memory of double-precision floating-point numbers. typedef packed_highp_dvec1 packed_dvec1; /// 2 components vector tightly packed in memory of double-precision floating-point numbers. typedef packed_highp_dvec2 packed_dvec2; /// 3 components vector tightly packed in memory of double-precision floating-point numbers. typedef packed_highp_dvec3 packed_dvec3; /// 4 components vector tightly packed in memory of double-precision floating-point numbers. typedef packed_highp_dvec4 packed_dvec4; /// 2 by 2 matrix tightly aligned in memory of double-precision floating-point numbers. typedef aligned_highp_dmat2 aligned_dmat2; /// 3 by 3 matrix tightly aligned in memory of double-precision floating-point numbers. typedef aligned_highp_dmat3 aligned_dmat3; /// 4 by 4 matrix tightly aligned in memory of double-precision floating-point numbers. typedef aligned_highp_dmat4 aligned_dmat4; /// 2 by 2 matrix tightly packed in memory of double-precision floating-point numbers. typedef packed_highp_dmat2 packed_dmat2; /// 3 by 3 matrix tightly packed in memory of double-precision floating-point numbers. typedef packed_highp_dmat3 packed_dmat3; /// 4 by 4 matrix tightly packed in memory of double-precision floating-point numbers. typedef packed_highp_dmat4 packed_dmat4; /// 2 by 2 matrix tightly aligned in memory of double-precision floating-point numbers. typedef aligned_highp_dmat2x2 aligned_dmat2x2; /// 2 by 3 matrix tightly aligned in memory of double-precision floating-point numbers. typedef aligned_highp_dmat2x3 aligned_dmat2x3; /// 2 by 4 matrix tightly aligned in memory of double-precision floating-point numbers. typedef aligned_highp_dmat2x4 aligned_dmat2x4; /// 3 by 2 matrix tightly aligned in memory of double-precision floating-point numbers. typedef aligned_highp_dmat3x2 aligned_dmat3x2; /// 3 by 3 matrix tightly aligned in memory of double-precision floating-point numbers. typedef aligned_highp_dmat3x3 aligned_dmat3x3; /// 3 by 4 matrix tightly aligned in memory of double-precision floating-point numbers. typedef aligned_highp_dmat3x4 aligned_dmat3x4; /// 4 by 2 matrix tightly aligned in memory of double-precision floating-point numbers. typedef aligned_highp_dmat4x2 aligned_dmat4x2; /// 4 by 3 matrix tightly aligned in memory of double-precision floating-point numbers. typedef aligned_highp_dmat4x3 aligned_dmat4x3; /// 4 by 4 matrix tightly aligned in memory of double-precision floating-point numbers. typedef aligned_highp_dmat4x4 aligned_dmat4x4; /// 2 by 2 matrix tightly packed in memory of double-precision floating-point numbers. typedef packed_highp_dmat2x2 packed_dmat2x2; /// 2 by 3 matrix tightly packed in memory of double-precision floating-point numbers. typedef packed_highp_dmat2x3 packed_dmat2x3; /// 2 by 4 matrix tightly packed in memory of double-precision floating-point numbers. typedef packed_highp_dmat2x4 packed_dmat2x4; /// 3 by 2 matrix tightly packed in memory of double-precision floating-point numbers. typedef packed_highp_dmat3x2 packed_dmat3x2; /// 3 by 3 matrix tightly packed in memory of double-precision floating-point numbers. typedef packed_highp_dmat3x3 packed_dmat3x3; /// 3 by 4 matrix tightly packed in memory of double-precision floating-point numbers. typedef packed_highp_dmat3x4 packed_dmat3x4; /// 4 by 2 matrix tightly packed in memory of double-precision floating-point numbers. typedef packed_highp_dmat4x2 packed_dmat4x2; /// 4 by 3 matrix tightly packed in memory of double-precision floating-point numbers. typedef packed_highp_dmat4x3 packed_dmat4x3; /// 4 by 4 matrix tightly packed in memory of double-precision floating-point numbers. typedef packed_highp_dmat4x4 packed_dmat4x4; #endif//GLM_PRECISION #if(defined(GLM_PRECISION_LOWP_INT)) typedef aligned_lowp_ivec1 aligned_ivec1; typedef aligned_lowp_ivec2 aligned_ivec2; typedef aligned_lowp_ivec3 aligned_ivec3; typedef aligned_lowp_ivec4 aligned_ivec4; #elif(defined(GLM_PRECISION_MEDIUMP_INT)) typedef aligned_mediump_ivec1 aligned_ivec1; typedef aligned_mediump_ivec2 aligned_ivec2; typedef aligned_mediump_ivec3 aligned_ivec3; typedef aligned_mediump_ivec4 aligned_ivec4; #else //defined(GLM_PRECISION_HIGHP_INT) /// 1 component vector aligned in memory of signed integer numbers. typedef aligned_highp_ivec1 aligned_ivec1; /// 2 components vector aligned in memory of signed integer numbers. typedef aligned_highp_ivec2 aligned_ivec2; /// 3 components vector aligned in memory of signed integer numbers. typedef aligned_highp_ivec3 aligned_ivec3; /// 4 components vector aligned in memory of signed integer numbers. typedef aligned_highp_ivec4 aligned_ivec4; /// 1 component vector tightly packed in memory of signed integer numbers. typedef packed_highp_ivec1 packed_ivec1; /// 2 components vector tightly packed in memory of signed integer numbers. typedef packed_highp_ivec2 packed_ivec2; /// 3 components vector tightly packed in memory of signed integer numbers. typedef packed_highp_ivec3 packed_ivec3; /// 4 components vector tightly packed in memory of signed integer numbers. typedef packed_highp_ivec4 packed_ivec4; #endif//GLM_PRECISION // -- Unsigned integer definition -- #if(defined(GLM_PRECISION_LOWP_UINT)) typedef aligned_lowp_uvec1 aligned_uvec1; typedef aligned_lowp_uvec2 aligned_uvec2; typedef aligned_lowp_uvec3 aligned_uvec3; typedef aligned_lowp_uvec4 aligned_uvec4; #elif(defined(GLM_PRECISION_MEDIUMP_UINT)) typedef aligned_mediump_uvec1 aligned_uvec1; typedef aligned_mediump_uvec2 aligned_uvec2; typedef aligned_mediump_uvec3 aligned_uvec3; typedef aligned_mediump_uvec4 aligned_uvec4; #else //defined(GLM_PRECISION_HIGHP_UINT) /// 1 component vector aligned in memory of unsigned integer numbers. typedef aligned_highp_uvec1 aligned_uvec1; /// 2 components vector aligned in memory of unsigned integer numbers. typedef aligned_highp_uvec2 aligned_uvec2; /// 3 components vector aligned in memory of unsigned integer numbers. typedef aligned_highp_uvec3 aligned_uvec3; /// 4 components vector aligned in memory of unsigned integer numbers. typedef aligned_highp_uvec4 aligned_uvec4; /// 1 component vector tightly packed in memory of unsigned integer numbers. typedef packed_highp_uvec1 packed_uvec1; /// 2 components vector tightly packed in memory of unsigned integer numbers. typedef packed_highp_uvec2 packed_uvec2; /// 3 components vector tightly packed in memory of unsigned integer numbers. typedef packed_highp_uvec3 packed_uvec3; /// 4 components vector tightly packed in memory of unsigned integer numbers. typedef packed_highp_uvec4 packed_uvec4; #endif//GLM_PRECISION #if(defined(GLM_PRECISION_LOWP_BOOL)) typedef aligned_lowp_bvec1 aligned_bvec1; typedef aligned_lowp_bvec2 aligned_bvec2; typedef aligned_lowp_bvec3 aligned_bvec3; typedef aligned_lowp_bvec4 aligned_bvec4; #elif(defined(GLM_PRECISION_MEDIUMP_BOOL)) typedef aligned_mediump_bvec1 aligned_bvec1; typedef aligned_mediump_bvec2 aligned_bvec2; typedef aligned_mediump_bvec3 aligned_bvec3; typedef aligned_mediump_bvec4 aligned_bvec4; #else //defined(GLM_PRECISION_HIGHP_BOOL) /// 1 component vector aligned in memory of bool values. typedef aligned_highp_bvec1 aligned_bvec1; /// 2 components vector aligned in memory of bool values. typedef aligned_highp_bvec2 aligned_bvec2; /// 3 components vector aligned in memory of bool values. typedef aligned_highp_bvec3 aligned_bvec3; /// 4 components vector aligned in memory of bool values. typedef aligned_highp_bvec4 aligned_bvec4; /// 1 components vector tightly packed in memory of bool values. typedef packed_highp_bvec1 packed_bvec1; /// 2 components vector tightly packed in memory of bool values. typedef packed_highp_bvec2 packed_bvec2; /// 3 components vector tightly packed in memory of bool values. typedef packed_highp_bvec3 packed_bvec3; /// 4 components vector tightly packed in memory of bool values. typedef packed_highp_bvec4 packed_bvec4; #endif//GLM_PRECISION /// @} }//namespace glm
Unknown
3D
mcellteam/mcell
libs/glm/gtc/noise.hpp
.hpp
1,553
62
/// @ref gtc_noise /// @file glm/gtc/noise.hpp /// /// @see core (dependence) /// /// @defgroup gtc_noise GLM_GTC_noise /// @ingroup gtc /// /// Include <glm/gtc/noise.hpp> to use the features of this extension. /// /// Defines 2D, 3D and 4D procedural noise functions /// Based on the work of Stefan Gustavson and Ashima Arts on "webgl-noise": /// https://github.com/ashima/webgl-noise /// Following Stefan Gustavson's paper "Simplex noise demystified": /// http://www.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf #pragma once // Dependencies #include "../detail/setup.hpp" #include "../detail/qualifier.hpp" #include "../detail/_noise.hpp" #include "../geometric.hpp" #include "../common.hpp" #include "../vector_relational.hpp" #include "../vec2.hpp" #include "../vec3.hpp" #include "../vec4.hpp" #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTC_noise extension included") #endif namespace glm { /// @addtogroup gtc_noise /// @{ /// Classic perlin noise. /// @see gtc_noise template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL T perlin( vec<L, T, Q> const& p); /// Periodic perlin noise. /// @see gtc_noise template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL T perlin( vec<L, T, Q> const& p, vec<L, T, Q> const& rep); /// Simplex noise. /// @see gtc_noise template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL T simplex( vec<L, T, Q> const& p); /// @} }//namespace glm #include "noise.inl"
Unknown
3D
mcellteam/mcell
libs/glm/gtc/integer.hpp
.hpp
2,110
66
/// @ref gtc_integer /// @file glm/gtc/integer.hpp /// /// @see core (dependence) /// @see gtc_integer (dependence) /// /// @defgroup gtc_integer GLM_GTC_integer /// @ingroup gtc /// /// Include <glm/gtc/integer.hpp> to use the features of this extension. /// /// @brief Allow to perform bit operations on integer values #pragma once // Dependencies #include "../detail/setup.hpp" #include "../detail/qualifier.hpp" #include "../common.hpp" #include "../integer.hpp" #include "../exponential.hpp" #include <limits> #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTC_integer extension included") #endif namespace glm { /// @addtogroup gtc_integer /// @{ /// Returns the log2 of x for integer values. Can be reliably using to compute mipmap count from the texture size. /// @see gtc_integer template<typename genIUType> GLM_FUNC_DECL genIUType log2(genIUType x); /// Returns a value equal to the nearest integer to x. /// The fraction 0.5 will round in a direction chosen by the /// implementation, presumably the direction that is fastest. /// /// @param x The values of the argument must be greater or equal to zero. /// @tparam T floating point scalar types. /// /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/round.xml">GLSL round man page</a> /// @see gtc_integer template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL vec<L, int, Q> iround(vec<L, T, Q> const& x); /// Returns a value equal to the nearest integer to x. /// The fraction 0.5 will round in a direction chosen by the /// implementation, presumably the direction that is fastest. /// /// @param x The values of the argument must be greater or equal to zero. /// @tparam T floating point scalar types. /// /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/round.xml">GLSL round man page</a> /// @see gtc_integer template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL vec<L, uint, Q> uround(vec<L, T, Q> const& x); /// @} } //namespace glm #include "integer.inl"
Unknown
3D
mcellteam/mcell
libs/glm/gtc/matrix_integer.hpp
.hpp
14,989
488
/// @ref gtc_matrix_integer /// @file glm/gtc/matrix_integer.hpp /// /// @see core (dependence) /// /// @defgroup gtc_matrix_integer GLM_GTC_matrix_integer /// @ingroup gtc /// /// Include <glm/gtc/matrix_integer.hpp> to use the features of this extension. /// /// Defines a number of matrices with integer types. #pragma once // Dependency: #include "../mat2x2.hpp" #include "../mat2x3.hpp" #include "../mat2x4.hpp" #include "../mat3x2.hpp" #include "../mat3x3.hpp" #include "../mat3x4.hpp" #include "../mat4x2.hpp" #include "../mat4x3.hpp" #include "../mat4x4.hpp" #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTC_matrix_integer extension included") #endif namespace glm { /// @addtogroup gtc_matrix_integer /// @{ /// High-qualifier signed integer 2x2 matrix. /// @see gtc_matrix_integer typedef mat<2, 2, int, highp> highp_imat2; /// High-qualifier signed integer 3x3 matrix. /// @see gtc_matrix_integer typedef mat<3, 3, int, highp> highp_imat3; /// High-qualifier signed integer 4x4 matrix. /// @see gtc_matrix_integer typedef mat<4, 4, int, highp> highp_imat4; /// High-qualifier signed integer 2x2 matrix. /// @see gtc_matrix_integer typedef mat<2, 2, int, highp> highp_imat2x2; /// High-qualifier signed integer 2x3 matrix. /// @see gtc_matrix_integer typedef mat<2, 3, int, highp> highp_imat2x3; /// High-qualifier signed integer 2x4 matrix. /// @see gtc_matrix_integer typedef mat<2, 4, int, highp> highp_imat2x4; /// High-qualifier signed integer 3x2 matrix. /// @see gtc_matrix_integer typedef mat<3, 2, int, highp> highp_imat3x2; /// High-qualifier signed integer 3x3 matrix. /// @see gtc_matrix_integer typedef mat<3, 3, int, highp> highp_imat3x3; /// High-qualifier signed integer 3x4 matrix. /// @see gtc_matrix_integer typedef mat<3, 4, int, highp> highp_imat3x4; /// High-qualifier signed integer 4x2 matrix. /// @see gtc_matrix_integer typedef mat<4, 2, int, highp> highp_imat4x2; /// High-qualifier signed integer 4x3 matrix. /// @see gtc_matrix_integer typedef mat<4, 3, int, highp> highp_imat4x3; /// High-qualifier signed integer 4x4 matrix. /// @see gtc_matrix_integer typedef mat<4, 4, int, highp> highp_imat4x4; /// Medium-qualifier signed integer 2x2 matrix. /// @see gtc_matrix_integer typedef mat<2, 2, int, mediump> mediump_imat2; /// Medium-qualifier signed integer 3x3 matrix. /// @see gtc_matrix_integer typedef mat<3, 3, int, mediump> mediump_imat3; /// Medium-qualifier signed integer 4x4 matrix. /// @see gtc_matrix_integer typedef mat<4, 4, int, mediump> mediump_imat4; /// Medium-qualifier signed integer 2x2 matrix. /// @see gtc_matrix_integer typedef mat<2, 2, int, mediump> mediump_imat2x2; /// Medium-qualifier signed integer 2x3 matrix. /// @see gtc_matrix_integer typedef mat<2, 3, int, mediump> mediump_imat2x3; /// Medium-qualifier signed integer 2x4 matrix. /// @see gtc_matrix_integer typedef mat<2, 4, int, mediump> mediump_imat2x4; /// Medium-qualifier signed integer 3x2 matrix. /// @see gtc_matrix_integer typedef mat<3, 2, int, mediump> mediump_imat3x2; /// Medium-qualifier signed integer 3x3 matrix. /// @see gtc_matrix_integer typedef mat<3, 3, int, mediump> mediump_imat3x3; /// Medium-qualifier signed integer 3x4 matrix. /// @see gtc_matrix_integer typedef mat<3, 4, int, mediump> mediump_imat3x4; /// Medium-qualifier signed integer 4x2 matrix. /// @see gtc_matrix_integer typedef mat<4, 2, int, mediump> mediump_imat4x2; /// Medium-qualifier signed integer 4x3 matrix. /// @see gtc_matrix_integer typedef mat<4, 3, int, mediump> mediump_imat4x3; /// Medium-qualifier signed integer 4x4 matrix. /// @see gtc_matrix_integer typedef mat<4, 4, int, mediump> mediump_imat4x4; /// Low-qualifier signed integer 2x2 matrix. /// @see gtc_matrix_integer typedef mat<2, 2, int, lowp> lowp_imat2; /// Low-qualifier signed integer 3x3 matrix. /// @see gtc_matrix_integer typedef mat<3, 3, int, lowp> lowp_imat3; /// Low-qualifier signed integer 4x4 matrix. /// @see gtc_matrix_integer typedef mat<4, 4, int, lowp> lowp_imat4; /// Low-qualifier signed integer 2x2 matrix. /// @see gtc_matrix_integer typedef mat<2, 2, int, lowp> lowp_imat2x2; /// Low-qualifier signed integer 2x3 matrix. /// @see gtc_matrix_integer typedef mat<2, 3, int, lowp> lowp_imat2x3; /// Low-qualifier signed integer 2x4 matrix. /// @see gtc_matrix_integer typedef mat<2, 4, int, lowp> lowp_imat2x4; /// Low-qualifier signed integer 3x2 matrix. /// @see gtc_matrix_integer typedef mat<3, 2, int, lowp> lowp_imat3x2; /// Low-qualifier signed integer 3x3 matrix. /// @see gtc_matrix_integer typedef mat<3, 3, int, lowp> lowp_imat3x3; /// Low-qualifier signed integer 3x4 matrix. /// @see gtc_matrix_integer typedef mat<3, 4, int, lowp> lowp_imat3x4; /// Low-qualifier signed integer 4x2 matrix. /// @see gtc_matrix_integer typedef mat<4, 2, int, lowp> lowp_imat4x2; /// Low-qualifier signed integer 4x3 matrix. /// @see gtc_matrix_integer typedef mat<4, 3, int, lowp> lowp_imat4x3; /// Low-qualifier signed integer 4x4 matrix. /// @see gtc_matrix_integer typedef mat<4, 4, int, lowp> lowp_imat4x4; /// High-qualifier unsigned integer 2x2 matrix. /// @see gtc_matrix_integer typedef mat<2, 2, uint, highp> highp_umat2; /// High-qualifier unsigned integer 3x3 matrix. /// @see gtc_matrix_integer typedef mat<3, 3, uint, highp> highp_umat3; /// High-qualifier unsigned integer 4x4 matrix. /// @see gtc_matrix_integer typedef mat<4, 4, uint, highp> highp_umat4; /// High-qualifier unsigned integer 2x2 matrix. /// @see gtc_matrix_integer typedef mat<2, 2, uint, highp> highp_umat2x2; /// High-qualifier unsigned integer 2x3 matrix. /// @see gtc_matrix_integer typedef mat<2, 3, uint, highp> highp_umat2x3; /// High-qualifier unsigned integer 2x4 matrix. /// @see gtc_matrix_integer typedef mat<2, 4, uint, highp> highp_umat2x4; /// High-qualifier unsigned integer 3x2 matrix. /// @see gtc_matrix_integer typedef mat<3, 2, uint, highp> highp_umat3x2; /// High-qualifier unsigned integer 3x3 matrix. /// @see gtc_matrix_integer typedef mat<3, 3, uint, highp> highp_umat3x3; /// High-qualifier unsigned integer 3x4 matrix. /// @see gtc_matrix_integer typedef mat<3, 4, uint, highp> highp_umat3x4; /// High-qualifier unsigned integer 4x2 matrix. /// @see gtc_matrix_integer typedef mat<4, 2, uint, highp> highp_umat4x2; /// High-qualifier unsigned integer 4x3 matrix. /// @see gtc_matrix_integer typedef mat<4, 3, uint, highp> highp_umat4x3; /// High-qualifier unsigned integer 4x4 matrix. /// @see gtc_matrix_integer typedef mat<4, 4, uint, highp> highp_umat4x4; /// Medium-qualifier unsigned integer 2x2 matrix. /// @see gtc_matrix_integer typedef mat<2, 2, uint, mediump> mediump_umat2; /// Medium-qualifier unsigned integer 3x3 matrix. /// @see gtc_matrix_integer typedef mat<3, 3, uint, mediump> mediump_umat3; /// Medium-qualifier unsigned integer 4x4 matrix. /// @see gtc_matrix_integer typedef mat<4, 4, uint, mediump> mediump_umat4; /// Medium-qualifier unsigned integer 2x2 matrix. /// @see gtc_matrix_integer typedef mat<2, 2, uint, mediump> mediump_umat2x2; /// Medium-qualifier unsigned integer 2x3 matrix. /// @see gtc_matrix_integer typedef mat<2, 3, uint, mediump> mediump_umat2x3; /// Medium-qualifier unsigned integer 2x4 matrix. /// @see gtc_matrix_integer typedef mat<2, 4, uint, mediump> mediump_umat2x4; /// Medium-qualifier unsigned integer 3x2 matrix. /// @see gtc_matrix_integer typedef mat<3, 2, uint, mediump> mediump_umat3x2; /// Medium-qualifier unsigned integer 3x3 matrix. /// @see gtc_matrix_integer typedef mat<3, 3, uint, mediump> mediump_umat3x3; /// Medium-qualifier unsigned integer 3x4 matrix. /// @see gtc_matrix_integer typedef mat<3, 4, uint, mediump> mediump_umat3x4; /// Medium-qualifier unsigned integer 4x2 matrix. /// @see gtc_matrix_integer typedef mat<4, 2, uint, mediump> mediump_umat4x2; /// Medium-qualifier unsigned integer 4x3 matrix. /// @see gtc_matrix_integer typedef mat<4, 3, uint, mediump> mediump_umat4x3; /// Medium-qualifier unsigned integer 4x4 matrix. /// @see gtc_matrix_integer typedef mat<4, 4, uint, mediump> mediump_umat4x4; /// Low-qualifier unsigned integer 2x2 matrix. /// @see gtc_matrix_integer typedef mat<2, 2, uint, lowp> lowp_umat2; /// Low-qualifier unsigned integer 3x3 matrix. /// @see gtc_matrix_integer typedef mat<3, 3, uint, lowp> lowp_umat3; /// Low-qualifier unsigned integer 4x4 matrix. /// @see gtc_matrix_integer typedef mat<4, 4, uint, lowp> lowp_umat4; /// Low-qualifier unsigned integer 2x2 matrix. /// @see gtc_matrix_integer typedef mat<2, 2, uint, lowp> lowp_umat2x2; /// Low-qualifier unsigned integer 2x3 matrix. /// @see gtc_matrix_integer typedef mat<2, 3, uint, lowp> lowp_umat2x3; /// Low-qualifier unsigned integer 2x4 matrix. /// @see gtc_matrix_integer typedef mat<2, 4, uint, lowp> lowp_umat2x4; /// Low-qualifier unsigned integer 3x2 matrix. /// @see gtc_matrix_integer typedef mat<3, 2, uint, lowp> lowp_umat3x2; /// Low-qualifier unsigned integer 3x3 matrix. /// @see gtc_matrix_integer typedef mat<3, 3, uint, lowp> lowp_umat3x3; /// Low-qualifier unsigned integer 3x4 matrix. /// @see gtc_matrix_integer typedef mat<3, 4, uint, lowp> lowp_umat3x4; /// Low-qualifier unsigned integer 4x2 matrix. /// @see gtc_matrix_integer typedef mat<4, 2, uint, lowp> lowp_umat4x2; /// Low-qualifier unsigned integer 4x3 matrix. /// @see gtc_matrix_integer typedef mat<4, 3, uint, lowp> lowp_umat4x3; /// Low-qualifier unsigned integer 4x4 matrix. /// @see gtc_matrix_integer typedef mat<4, 4, uint, lowp> lowp_umat4x4; #if(defined(GLM_PRECISION_HIGHP_INT)) typedef highp_imat2 imat2; typedef highp_imat3 imat3; typedef highp_imat4 imat4; typedef highp_imat2x2 imat2x2; typedef highp_imat2x3 imat2x3; typedef highp_imat2x4 imat2x4; typedef highp_imat3x2 imat3x2; typedef highp_imat3x3 imat3x3; typedef highp_imat3x4 imat3x4; typedef highp_imat4x2 imat4x2; typedef highp_imat4x3 imat4x3; typedef highp_imat4x4 imat4x4; #elif(defined(GLM_PRECISION_LOWP_INT)) typedef lowp_imat2 imat2; typedef lowp_imat3 imat3; typedef lowp_imat4 imat4; typedef lowp_imat2x2 imat2x2; typedef lowp_imat2x3 imat2x3; typedef lowp_imat2x4 imat2x4; typedef lowp_imat3x2 imat3x2; typedef lowp_imat3x3 imat3x3; typedef lowp_imat3x4 imat3x4; typedef lowp_imat4x2 imat4x2; typedef lowp_imat4x3 imat4x3; typedef lowp_imat4x4 imat4x4; #else //if(defined(GLM_PRECISION_MEDIUMP_INT)) /// Signed integer 2x2 matrix. /// @see gtc_matrix_integer typedef mediump_imat2 imat2; /// Signed integer 3x3 matrix. /// @see gtc_matrix_integer typedef mediump_imat3 imat3; /// Signed integer 4x4 matrix. /// @see gtc_matrix_integer typedef mediump_imat4 imat4; /// Signed integer 2x2 matrix. /// @see gtc_matrix_integer typedef mediump_imat2x2 imat2x2; /// Signed integer 2x3 matrix. /// @see gtc_matrix_integer typedef mediump_imat2x3 imat2x3; /// Signed integer 2x4 matrix. /// @see gtc_matrix_integer typedef mediump_imat2x4 imat2x4; /// Signed integer 3x2 matrix. /// @see gtc_matrix_integer typedef mediump_imat3x2 imat3x2; /// Signed integer 3x3 matrix. /// @see gtc_matrix_integer typedef mediump_imat3x3 imat3x3; /// Signed integer 3x4 matrix. /// @see gtc_matrix_integer typedef mediump_imat3x4 imat3x4; /// Signed integer 4x2 matrix. /// @see gtc_matrix_integer typedef mediump_imat4x2 imat4x2; /// Signed integer 4x3 matrix. /// @see gtc_matrix_integer typedef mediump_imat4x3 imat4x3; /// Signed integer 4x4 matrix. /// @see gtc_matrix_integer typedef mediump_imat4x4 imat4x4; #endif//GLM_PRECISION #if(defined(GLM_PRECISION_HIGHP_UINT)) typedef highp_umat2 umat2; typedef highp_umat3 umat3; typedef highp_umat4 umat4; typedef highp_umat2x2 umat2x2; typedef highp_umat2x3 umat2x3; typedef highp_umat2x4 umat2x4; typedef highp_umat3x2 umat3x2; typedef highp_umat3x3 umat3x3; typedef highp_umat3x4 umat3x4; typedef highp_umat4x2 umat4x2; typedef highp_umat4x3 umat4x3; typedef highp_umat4x4 umat4x4; #elif(defined(GLM_PRECISION_LOWP_UINT)) typedef lowp_umat2 umat2; typedef lowp_umat3 umat3; typedef lowp_umat4 umat4; typedef lowp_umat2x2 umat2x2; typedef lowp_umat2x3 umat2x3; typedef lowp_umat2x4 umat2x4; typedef lowp_umat3x2 umat3x2; typedef lowp_umat3x3 umat3x3; typedef lowp_umat3x4 umat3x4; typedef lowp_umat4x2 umat4x2; typedef lowp_umat4x3 umat4x3; typedef lowp_umat4x4 umat4x4; #else //if(defined(GLM_PRECISION_MEDIUMP_UINT)) /// Unsigned integer 2x2 matrix. /// @see gtc_matrix_integer typedef mediump_umat2 umat2; /// Unsigned integer 3x3 matrix. /// @see gtc_matrix_integer typedef mediump_umat3 umat3; /// Unsigned integer 4x4 matrix. /// @see gtc_matrix_integer typedef mediump_umat4 umat4; /// Unsigned integer 2x2 matrix. /// @see gtc_matrix_integer typedef mediump_umat2x2 umat2x2; /// Unsigned integer 2x3 matrix. /// @see gtc_matrix_integer typedef mediump_umat2x3 umat2x3; /// Unsigned integer 2x4 matrix. /// @see gtc_matrix_integer typedef mediump_umat2x4 umat2x4; /// Unsigned integer 3x2 matrix. /// @see gtc_matrix_integer typedef mediump_umat3x2 umat3x2; /// Unsigned integer 3x3 matrix. /// @see gtc_matrix_integer typedef mediump_umat3x3 umat3x3; /// Unsigned integer 3x4 matrix. /// @see gtc_matrix_integer typedef mediump_umat3x4 umat3x4; /// Unsigned integer 4x2 matrix. /// @see gtc_matrix_integer typedef mediump_umat4x2 umat4x2; /// Unsigned integer 4x3 matrix. /// @see gtc_matrix_integer typedef mediump_umat4x3 umat4x3; /// Unsigned integer 4x4 matrix. /// @see gtc_matrix_integer typedef mediump_umat4x4 umat4x4; #endif//GLM_PRECISION /// @} }//namespace glm
Unknown
3D
mcellteam/mcell
libs/glm/gtc/matrix_transform.hpp
.hpp
1,226
37
/// @ref gtc_matrix_transform /// @file glm/gtc/matrix_transform.hpp /// /// @see core (dependence) /// @see gtx_transform /// @see gtx_transform2 /// /// @defgroup gtc_matrix_transform GLM_GTC_matrix_transform /// @ingroup gtc /// /// Include <glm/gtc/matrix_transform.hpp> to use the features of this extension. /// /// Defines functions that generate common transformation matrices. /// /// The matrices generated by this extension use standard OpenGL fixed-function /// conventions. For example, the lookAt function generates a transform from world /// space into the specific eye space that the projective matrix functions /// (perspective, ortho, etc) are designed to expect. The OpenGL compatibility /// specifications defines the particular layout of this eye space. #pragma once // Dependencies #include "../mat4x4.hpp" #include "../vec2.hpp" #include "../vec3.hpp" #include "../vec4.hpp" #include "../ext/matrix_projection.hpp" #include "../ext/matrix_clip_space.hpp" #include "../ext/matrix_transform.hpp" #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTC_matrix_transform extension included") #endif #include "matrix_transform.inl"
Unknown
3D
mcellteam/mcell
libs/glm/gtc/matrix_inverse.hpp
.hpp
1,517
51
/// @ref gtc_matrix_inverse /// @file glm/gtc/matrix_inverse.hpp /// /// @see core (dependence) /// /// @defgroup gtc_matrix_inverse GLM_GTC_matrix_inverse /// @ingroup gtc /// /// Include <glm/gtc/matrix_integer.hpp> to use the features of this extension. /// /// Defines additional matrix inverting functions. #pragma once // Dependencies #include "../detail/setup.hpp" #include "../matrix.hpp" #include "../mat2x2.hpp" #include "../mat3x3.hpp" #include "../mat4x4.hpp" #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTC_matrix_inverse extension included") #endif namespace glm { /// @addtogroup gtc_matrix_inverse /// @{ /// Fast matrix inverse for affine matrix. /// /// @param m Input matrix to invert. /// @tparam genType Squared floating-point matrix: half, float or double. Inverse of matrix based of half-qualifier floating point value is highly innacurate. /// @see gtc_matrix_inverse template<typename genType> GLM_FUNC_DECL genType affineInverse(genType const& m); /// Compute the inverse transpose of a matrix. /// /// @param m Input matrix to invert transpose. /// @tparam genType Squared floating-point matrix: half, float or double. Inverse of matrix based of half-qualifier floating point value is highly innacurate. /// @see gtc_matrix_inverse template<typename genType> GLM_FUNC_DECL genType inverseTranspose(genType const& m); /// @} }//namespace glm #include "matrix_inverse.inl"
Unknown
3D
mcellteam/mcell
libs/glm/gtc/constants.hpp
.hpp
4,179
166
/// @ref gtc_constants /// @file glm/gtc/constants.hpp /// /// @see core (dependence) /// /// @defgroup gtc_constants GLM_GTC_constants /// @ingroup gtc /// /// Include <glm/gtc/constants.hpp> to use the features of this extension. /// /// Provide a list of constants and precomputed useful values. #pragma once // Dependencies #include "../ext/scalar_constants.hpp" #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTC_constants extension included") #endif namespace glm { /// @addtogroup gtc_constants /// @{ /// Return 0. /// @see gtc_constants template<typename genType> GLM_FUNC_DECL GLM_CONSTEXPR genType zero(); /// Return 1. /// @see gtc_constants template<typename genType> GLM_FUNC_DECL GLM_CONSTEXPR genType one(); /// Return pi * 2. /// @see gtc_constants template<typename genType> GLM_FUNC_DECL GLM_CONSTEXPR genType two_pi(); /// Return square root of pi. /// @see gtc_constants template<typename genType> GLM_FUNC_DECL GLM_CONSTEXPR genType root_pi(); /// Return pi / 2. /// @see gtc_constants template<typename genType> GLM_FUNC_DECL GLM_CONSTEXPR genType half_pi(); /// Return pi / 2 * 3. /// @see gtc_constants template<typename genType> GLM_FUNC_DECL GLM_CONSTEXPR genType three_over_two_pi(); /// Return pi / 4. /// @see gtc_constants template<typename genType> GLM_FUNC_DECL GLM_CONSTEXPR genType quarter_pi(); /// Return 1 / pi. /// @see gtc_constants template<typename genType> GLM_FUNC_DECL GLM_CONSTEXPR genType one_over_pi(); /// Return 1 / (pi * 2). /// @see gtc_constants template<typename genType> GLM_FUNC_DECL GLM_CONSTEXPR genType one_over_two_pi(); /// Return 2 / pi. /// @see gtc_constants template<typename genType> GLM_FUNC_DECL GLM_CONSTEXPR genType two_over_pi(); /// Return 4 / pi. /// @see gtc_constants template<typename genType> GLM_FUNC_DECL GLM_CONSTEXPR genType four_over_pi(); /// Return 2 / sqrt(pi). /// @see gtc_constants template<typename genType> GLM_FUNC_DECL GLM_CONSTEXPR genType two_over_root_pi(); /// Return 1 / sqrt(2). /// @see gtc_constants template<typename genType> GLM_FUNC_DECL GLM_CONSTEXPR genType one_over_root_two(); /// Return sqrt(pi / 2). /// @see gtc_constants template<typename genType> GLM_FUNC_DECL GLM_CONSTEXPR genType root_half_pi(); /// Return sqrt(2 * pi). /// @see gtc_constants template<typename genType> GLM_FUNC_DECL GLM_CONSTEXPR genType root_two_pi(); /// Return sqrt(ln(4)). /// @see gtc_constants template<typename genType> GLM_FUNC_DECL GLM_CONSTEXPR genType root_ln_four(); /// Return e constant. /// @see gtc_constants template<typename genType> GLM_FUNC_DECL GLM_CONSTEXPR genType e(); /// Return Euler's constant. /// @see gtc_constants template<typename genType> GLM_FUNC_DECL GLM_CONSTEXPR genType euler(); /// Return sqrt(2). /// @see gtc_constants template<typename genType> GLM_FUNC_DECL GLM_CONSTEXPR genType root_two(); /// Return sqrt(3). /// @see gtc_constants template<typename genType> GLM_FUNC_DECL GLM_CONSTEXPR genType root_three(); /// Return sqrt(5). /// @see gtc_constants template<typename genType> GLM_FUNC_DECL GLM_CONSTEXPR genType root_five(); /// Return ln(2). /// @see gtc_constants template<typename genType> GLM_FUNC_DECL GLM_CONSTEXPR genType ln_two(); /// Return ln(10). /// @see gtc_constants template<typename genType> GLM_FUNC_DECL GLM_CONSTEXPR genType ln_ten(); /// Return ln(ln(2)). /// @see gtc_constants template<typename genType> GLM_FUNC_DECL GLM_CONSTEXPR genType ln_ln_two(); /// Return 1 / 3. /// @see gtc_constants template<typename genType> GLM_FUNC_DECL GLM_CONSTEXPR genType third(); /// Return 2 / 3. /// @see gtc_constants template<typename genType> GLM_FUNC_DECL GLM_CONSTEXPR genType two_thirds(); /// Return the golden ratio constant. /// @see gtc_constants template<typename genType> GLM_FUNC_DECL GLM_CONSTEXPR genType golden_ratio(); /// @} } //namespace glm #include "constants.inl"
Unknown
3D
mcellteam/mcell
libs/glm/gtc/random.hpp
.hpp
2,689
83
/// @ref gtc_random /// @file glm/gtc/random.hpp /// /// @see core (dependence) /// @see gtx_random (extended) /// /// @defgroup gtc_random GLM_GTC_random /// @ingroup gtc /// /// Include <glm/gtc/random.hpp> to use the features of this extension. /// /// Generate random number from various distribution methods. #pragma once // Dependency: #include "../ext/scalar_int_sized.hpp" #include "../ext/scalar_uint_sized.hpp" #include "../detail/qualifier.hpp" #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTC_random extension included") #endif namespace glm { /// @addtogroup gtc_random /// @{ /// Generate random numbers in the interval [Min, Max], according a linear distribution /// /// @param Min Minimum value included in the sampling /// @param Max Maximum value included in the sampling /// @tparam genType Value type. Currently supported: float or double scalars. /// @see gtc_random template<typename genType> GLM_FUNC_DECL genType linearRand(genType Min, genType Max); /// Generate random numbers in the interval [Min, Max], according a linear distribution /// /// @param Min Minimum value included in the sampling /// @param Max Maximum value included in the sampling /// @tparam T Value type. Currently supported: float or double. /// /// @see gtc_random template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL vec<L, T, Q> linearRand(vec<L, T, Q> const& Min, vec<L, T, Q> const& Max); /// Generate random numbers in the interval [Min, Max], according a gaussian distribution /// /// @see gtc_random template<typename genType> GLM_FUNC_DECL genType gaussRand(genType Mean, genType Deviation); /// Generate a random 2D vector which coordinates are regulary distributed on a circle of a given radius /// /// @see gtc_random template<typename T> GLM_FUNC_DECL vec<2, T, defaultp> circularRand(T Radius); /// Generate a random 3D vector which coordinates are regulary distributed on a sphere of a given radius /// /// @see gtc_random template<typename T> GLM_FUNC_DECL vec<3, T, defaultp> sphericalRand(T Radius); /// Generate a random 2D vector which coordinates are regulary distributed within the area of a disk of a given radius /// /// @see gtc_random template<typename T> GLM_FUNC_DECL vec<2, T, defaultp> diskRand(T Radius); /// Generate a random 3D vector which coordinates are regulary distributed within the volume of a ball of a given radius /// /// @see gtc_random template<typename T> GLM_FUNC_DECL vec<3, T, defaultp> ballRand(T Radius); /// @} }//namespace glm #include "random.inl"
Unknown
3D
mcellteam/mcell
libs/glm/gtc/ulp.hpp
.hpp
625
25
/// @ref gtc_ulp /// @file glm/gtc/ulp.hpp /// /// @see core (dependence) /// /// @defgroup gtc_ulp GLM_GTC_ulp /// @ingroup gtc /// /// Include <glm/gtc/ulp.hpp> to use the features of this extension. /// /// Allow the measurement of the accuracy of a function against a reference /// implementation. This extension works on floating-point data and provide results /// in ULP. #pragma once // Dependencies #include "../ext/scalar_ulp.hpp" #include "../ext/vector_ulp.hpp" #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTC_ulp extension included") #endif
Unknown
3D
mcellteam/mcell
libs/glm/gtc/type_precision.hpp
.hpp
66,814
2,139
/// @ref gtc_type_precision /// @file glm/gtc/type_precision.hpp /// /// @see core (dependence) /// @see gtc_quaternion (dependence) /// /// @defgroup gtc_type_precision GLM_GTC_type_precision /// @ingroup gtc /// /// Include <glm/gtc/type_precision.hpp> to use the features of this extension. /// /// Defines specific C++-based qualifier types. #pragma once // Dependency: #include "../gtc/quaternion.hpp" #include "../gtc/vec1.hpp" #include "../ext/scalar_int_sized.hpp" #include "../ext/scalar_uint_sized.hpp" #include "../detail/type_vec2.hpp" #include "../detail/type_vec3.hpp" #include "../detail/type_vec4.hpp" #include "../detail/type_mat2x2.hpp" #include "../detail/type_mat2x3.hpp" #include "../detail/type_mat2x4.hpp" #include "../detail/type_mat3x2.hpp" #include "../detail/type_mat3x3.hpp" #include "../detail/type_mat3x4.hpp" #include "../detail/type_mat4x2.hpp" #include "../detail/type_mat4x3.hpp" #include "../detail/type_mat4x4.hpp" #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTC_type_precision extension included") #endif namespace glm { /////////////////////////// // Signed int vector types /// @addtogroup gtc_type_precision /// @{ /// Low qualifier 8 bit signed integer type. /// @see gtc_type_precision typedef detail::int8 lowp_int8; /// Low qualifier 16 bit signed integer type. /// @see gtc_type_precision typedef detail::int16 lowp_int16; /// Low qualifier 32 bit signed integer type. /// @see gtc_type_precision typedef detail::int32 lowp_int32; /// Low qualifier 64 bit signed integer type. /// @see gtc_type_precision typedef detail::int64 lowp_int64; /// Low qualifier 8 bit signed integer type. /// @see gtc_type_precision typedef detail::int8 lowp_int8_t; /// Low qualifier 16 bit signed integer type. /// @see gtc_type_precision typedef detail::int16 lowp_int16_t; /// Low qualifier 32 bit signed integer type. /// @see gtc_type_precision typedef detail::int32 lowp_int32_t; /// Low qualifier 64 bit signed integer type. /// @see gtc_type_precision typedef detail::int64 lowp_int64_t; /// Low qualifier 8 bit signed integer type. /// @see gtc_type_precision typedef detail::int8 lowp_i8; /// Low qualifier 16 bit signed integer type. /// @see gtc_type_precision typedef detail::int16 lowp_i16; /// Low qualifier 32 bit signed integer type. /// @see gtc_type_precision typedef detail::int32 lowp_i32; /// Low qualifier 64 bit signed integer type. /// @see gtc_type_precision typedef detail::int64 lowp_i64; /// Medium qualifier 8 bit signed integer type. /// @see gtc_type_precision typedef detail::int8 mediump_int8; /// Medium qualifier 16 bit signed integer type. /// @see gtc_type_precision typedef detail::int16 mediump_int16; /// Medium qualifier 32 bit signed integer type. /// @see gtc_type_precision typedef detail::int32 mediump_int32; /// Medium qualifier 64 bit signed integer type. /// @see gtc_type_precision typedef detail::int64 mediump_int64; /// Medium qualifier 8 bit signed integer type. /// @see gtc_type_precision typedef detail::int8 mediump_int8_t; /// Medium qualifier 16 bit signed integer type. /// @see gtc_type_precision typedef detail::int16 mediump_int16_t; /// Medium qualifier 32 bit signed integer type. /// @see gtc_type_precision typedef detail::int32 mediump_int32_t; /// Medium qualifier 64 bit signed integer type. /// @see gtc_type_precision typedef detail::int64 mediump_int64_t; /// Medium qualifier 8 bit signed integer type. /// @see gtc_type_precision typedef detail::int8 mediump_i8; /// Medium qualifier 16 bit signed integer type. /// @see gtc_type_precision typedef detail::int16 mediump_i16; /// Medium qualifier 32 bit signed integer type. /// @see gtc_type_precision typedef detail::int32 mediump_i32; /// Medium qualifier 64 bit signed integer type. /// @see gtc_type_precision typedef detail::int64 mediump_i64; /// High qualifier 8 bit signed integer type. /// @see gtc_type_precision typedef detail::int8 highp_int8; /// High qualifier 16 bit signed integer type. /// @see gtc_type_precision typedef detail::int16 highp_int16; /// High qualifier 32 bit signed integer type. /// @see gtc_type_precision typedef detail::int32 highp_int32; /// High qualifier 64 bit signed integer type. /// @see gtc_type_precision typedef detail::int64 highp_int64; /// High qualifier 8 bit signed integer type. /// @see gtc_type_precision typedef detail::int8 highp_int8_t; /// High qualifier 16 bit signed integer type. /// @see gtc_type_precision typedef detail::int16 highp_int16_t; /// 32 bit signed integer type. /// @see gtc_type_precision typedef detail::int32 highp_int32_t; /// High qualifier 64 bit signed integer type. /// @see gtc_type_precision typedef detail::int64 highp_int64_t; /// High qualifier 8 bit signed integer type. /// @see gtc_type_precision typedef detail::int8 highp_i8; /// High qualifier 16 bit signed integer type. /// @see gtc_type_precision typedef detail::int16 highp_i16; /// High qualifier 32 bit signed integer type. /// @see gtc_type_precision typedef detail::int32 highp_i32; /// High qualifier 64 bit signed integer type. /// @see gtc_type_precision typedef detail::int64 highp_i64; #if GLM_HAS_EXTENDED_INTEGER_TYPE using std::int8_t; using std::int16_t; using std::int32_t; using std::int64_t; #else /// 8 bit signed integer type. /// @see gtc_type_precision typedef detail::int8 int8_t; /// 16 bit signed integer type. /// @see gtc_type_precision typedef detail::int16 int16_t; /// 32 bit signed integer type. /// @see gtc_type_precision typedef detail::int32 int32_t; /// 64 bit signed integer type. /// @see gtc_type_precision typedef detail::int64 int64_t; #endif /// 8 bit signed integer type. /// @see gtc_type_precision typedef detail::int8 i8; /// 16 bit signed integer type. /// @see gtc_type_precision typedef detail::int16 i16; /// 32 bit signed integer type. /// @see gtc_type_precision typedef detail::int32 i32; /// 64 bit signed integer type. /// @see gtc_type_precision typedef detail::int64 i64; /// Low qualifier 8 bit signed integer scalar type. /// @see gtc_type_precision typedef vec<1, i8, lowp> lowp_i8vec1; /// Low qualifier 8 bit signed integer vector of 2 components type. /// @see gtc_type_precision typedef vec<2, i8, lowp> lowp_i8vec2; /// Low qualifier 8 bit signed integer vector of 3 components type. /// @see gtc_type_precision typedef vec<3, i8, lowp> lowp_i8vec3; /// Low qualifier 8 bit signed integer vector of 4 components type. /// @see gtc_type_precision typedef vec<4, i8, lowp> lowp_i8vec4; /// Medium qualifier 8 bit signed integer scalar type. /// @see gtc_type_precision typedef vec<1, i8, mediump> mediump_i8vec1; /// Medium qualifier 8 bit signed integer vector of 2 components type. /// @see gtc_type_precision typedef vec<2, i8, mediump> mediump_i8vec2; /// Medium qualifier 8 bit signed integer vector of 3 components type. /// @see gtc_type_precision typedef vec<3, i8, mediump> mediump_i8vec3; /// Medium qualifier 8 bit signed integer vector of 4 components type. /// @see gtc_type_precision typedef vec<4, i8, mediump> mediump_i8vec4; /// High qualifier 8 bit signed integer scalar type. /// @see gtc_type_precision typedef vec<1, i8, highp> highp_i8vec1; /// High qualifier 8 bit signed integer vector of 2 components type. /// @see gtc_type_precision typedef vec<2, i8, highp> highp_i8vec2; /// High qualifier 8 bit signed integer vector of 3 components type. /// @see gtc_type_precision typedef vec<3, i8, highp> highp_i8vec3; /// High qualifier 8 bit signed integer vector of 4 components type. /// @see gtc_type_precision typedef vec<4, i8, highp> highp_i8vec4; /// 8 bit signed integer scalar type. /// @see gtc_type_precision typedef vec<1, i8, defaultp> i8vec1; /// 8 bit signed integer vector of 2 components type. /// @see gtc_type_precision typedef vec<2, i8, defaultp> i8vec2; /// 8 bit signed integer vector of 3 components type. /// @see gtc_type_precision typedef vec<3, i8, defaultp> i8vec3; /// 8 bit signed integer vector of 4 components type. /// @see gtc_type_precision typedef vec<4, i8, defaultp> i8vec4; /// Low qualifier 16 bit signed integer scalar type. /// @see gtc_type_precision typedef vec<1, i16, lowp> lowp_i16vec1; /// Low qualifier 16 bit signed integer vector of 2 components type. /// @see gtc_type_precision typedef vec<2, i16, lowp> lowp_i16vec2; /// Low qualifier 16 bit signed integer vector of 3 components type. /// @see gtc_type_precision typedef vec<3, i16, lowp> lowp_i16vec3; /// Low qualifier 16 bit signed integer vector of 4 components type. /// @see gtc_type_precision typedef vec<4, i16, lowp> lowp_i16vec4; /// Medium qualifier 16 bit signed integer scalar type. /// @see gtc_type_precision typedef vec<1, i16, mediump> mediump_i16vec1; /// Medium qualifier 16 bit signed integer vector of 2 components type. /// @see gtc_type_precision typedef vec<2, i16, mediump> mediump_i16vec2; /// Medium qualifier 16 bit signed integer vector of 3 components type. /// @see gtc_type_precision typedef vec<3, i16, mediump> mediump_i16vec3; /// Medium qualifier 16 bit signed integer vector of 4 components type. /// @see gtc_type_precision typedef vec<4, i16, mediump> mediump_i16vec4; /// High qualifier 16 bit signed integer scalar type. /// @see gtc_type_precision typedef vec<1, i16, highp> highp_i16vec1; /// High qualifier 16 bit signed integer vector of 2 components type. /// @see gtc_type_precision typedef vec<2, i16, highp> highp_i16vec2; /// High qualifier 16 bit signed integer vector of 3 components type. /// @see gtc_type_precision typedef vec<3, i16, highp> highp_i16vec3; /// High qualifier 16 bit signed integer vector of 4 components type. /// @see gtc_type_precision typedef vec<4, i16, highp> highp_i16vec4; /// 16 bit signed integer scalar type. /// @see gtc_type_precision typedef vec<1, i16, defaultp> i16vec1; /// 16 bit signed integer vector of 2 components type. /// @see gtc_type_precision typedef vec<2, i16, defaultp> i16vec2; /// 16 bit signed integer vector of 3 components type. /// @see gtc_type_precision typedef vec<3, i16, defaultp> i16vec3; /// 16 bit signed integer vector of 4 components type. /// @see gtc_type_precision typedef vec<4, i16, defaultp> i16vec4; /// Low qualifier 32 bit signed integer scalar type. /// @see gtc_type_precision typedef vec<1, i32, lowp> lowp_i32vec1; /// Low qualifier 32 bit signed integer vector of 2 components type. /// @see gtc_type_precision typedef vec<2, i32, lowp> lowp_i32vec2; /// Low qualifier 32 bit signed integer vector of 3 components type. /// @see gtc_type_precision typedef vec<3, i32, lowp> lowp_i32vec3; /// Low qualifier 32 bit signed integer vector of 4 components type. /// @see gtc_type_precision typedef vec<4, i32, lowp> lowp_i32vec4; /// Medium qualifier 32 bit signed integer scalar type. /// @see gtc_type_precision typedef vec<1, i32, mediump> mediump_i32vec1; /// Medium qualifier 32 bit signed integer vector of 2 components type. /// @see gtc_type_precision typedef vec<2, i32, mediump> mediump_i32vec2; /// Medium qualifier 32 bit signed integer vector of 3 components type. /// @see gtc_type_precision typedef vec<3, i32, mediump> mediump_i32vec3; /// Medium qualifier 32 bit signed integer vector of 4 components type. /// @see gtc_type_precision typedef vec<4, i32, mediump> mediump_i32vec4; /// High qualifier 32 bit signed integer scalar type. /// @see gtc_type_precision typedef vec<1, i32, highp> highp_i32vec1; /// High qualifier 32 bit signed integer vector of 2 components type. /// @see gtc_type_precision typedef vec<2, i32, highp> highp_i32vec2; /// High qualifier 32 bit signed integer vector of 3 components type. /// @see gtc_type_precision typedef vec<3, i32, highp> highp_i32vec3; /// High qualifier 32 bit signed integer vector of 4 components type. /// @see gtc_type_precision typedef vec<4, i32, highp> highp_i32vec4; /// 32 bit signed integer scalar type. /// @see gtc_type_precision typedef vec<1, i32, defaultp> i32vec1; /// 32 bit signed integer vector of 2 components type. /// @see gtc_type_precision typedef vec<2, i32, defaultp> i32vec2; /// 32 bit signed integer vector of 3 components type. /// @see gtc_type_precision typedef vec<3, i32, defaultp> i32vec3; /// 32 bit signed integer vector of 4 components type. /// @see gtc_type_precision typedef vec<4, i32, defaultp> i32vec4; /// Low qualifier 64 bit signed integer scalar type. /// @see gtc_type_precision typedef vec<1, i64, lowp> lowp_i64vec1; /// Low qualifier 64 bit signed integer vector of 2 components type. /// @see gtc_type_precision typedef vec<2, i64, lowp> lowp_i64vec2; /// Low qualifier 64 bit signed integer vector of 3 components type. /// @see gtc_type_precision typedef vec<3, i64, lowp> lowp_i64vec3; /// Low qualifier 64 bit signed integer vector of 4 components type. /// @see gtc_type_precision typedef vec<4, i64, lowp> lowp_i64vec4; /// Medium qualifier 64 bit signed integer scalar type. /// @see gtc_type_precision typedef vec<1, i64, mediump> mediump_i64vec1; /// Medium qualifier 64 bit signed integer vector of 2 components type. /// @see gtc_type_precision typedef vec<2, i64, mediump> mediump_i64vec2; /// Medium qualifier 64 bit signed integer vector of 3 components type. /// @see gtc_type_precision typedef vec<3, i64, mediump> mediump_i64vec3; /// Medium qualifier 64 bit signed integer vector of 4 components type. /// @see gtc_type_precision typedef vec<4, i64, mediump> mediump_i64vec4; /// High qualifier 64 bit signed integer scalar type. /// @see gtc_type_precision typedef vec<1, i64, highp> highp_i64vec1; /// High qualifier 64 bit signed integer vector of 2 components type. /// @see gtc_type_precision typedef vec<2, i64, highp> highp_i64vec2; /// High qualifier 64 bit signed integer vector of 3 components type. /// @see gtc_type_precision typedef vec<3, i64, highp> highp_i64vec3; /// High qualifier 64 bit signed integer vector of 4 components type. /// @see gtc_type_precision typedef vec<4, i64, highp> highp_i64vec4; /// 64 bit signed integer scalar type. /// @see gtc_type_precision typedef vec<1, i64, defaultp> i64vec1; /// 64 bit signed integer vector of 2 components type. /// @see gtc_type_precision typedef vec<2, i64, defaultp> i64vec2; /// 64 bit signed integer vector of 3 components type. /// @see gtc_type_precision typedef vec<3, i64, defaultp> i64vec3; /// 64 bit signed integer vector of 4 components type. /// @see gtc_type_precision typedef vec<4, i64, defaultp> i64vec4; ///////////////////////////// // Unsigned int vector types /// Low qualifier 8 bit unsigned integer type. /// @see gtc_type_precision typedef detail::uint8 lowp_uint8; /// Low qualifier 16 bit unsigned integer type. /// @see gtc_type_precision typedef detail::uint16 lowp_uint16; /// Low qualifier 32 bit unsigned integer type. /// @see gtc_type_precision typedef detail::uint32 lowp_uint32; /// Low qualifier 64 bit unsigned integer type. /// @see gtc_type_precision typedef detail::uint64 lowp_uint64; /// Low qualifier 8 bit unsigned integer type. /// @see gtc_type_precision typedef detail::uint8 lowp_uint8_t; /// Low qualifier 16 bit unsigned integer type. /// @see gtc_type_precision typedef detail::uint16 lowp_uint16_t; /// Low qualifier 32 bit unsigned integer type. /// @see gtc_type_precision typedef detail::uint32 lowp_uint32_t; /// Low qualifier 64 bit unsigned integer type. /// @see gtc_type_precision typedef detail::uint64 lowp_uint64_t; /// Low qualifier 8 bit unsigned integer type. /// @see gtc_type_precision typedef detail::uint8 lowp_u8; /// Low qualifier 16 bit unsigned integer type. /// @see gtc_type_precision typedef detail::uint16 lowp_u16; /// Low qualifier 32 bit unsigned integer type. /// @see gtc_type_precision typedef detail::uint32 lowp_u32; /// Low qualifier 64 bit unsigned integer type. /// @see gtc_type_precision typedef detail::uint64 lowp_u64; /// Medium qualifier 8 bit unsigned integer type. /// @see gtc_type_precision typedef detail::uint8 mediump_uint8; /// Medium qualifier 16 bit unsigned integer type. /// @see gtc_type_precision typedef detail::uint16 mediump_uint16; /// Medium qualifier 32 bit unsigned integer type. /// @see gtc_type_precision typedef detail::uint32 mediump_uint32; /// Medium qualifier 64 bit unsigned integer type. /// @see gtc_type_precision typedef detail::uint64 mediump_uint64; /// Medium qualifier 8 bit unsigned integer type. /// @see gtc_type_precision typedef detail::uint8 mediump_uint8_t; /// Medium qualifier 16 bit unsigned integer type. /// @see gtc_type_precision typedef detail::uint16 mediump_uint16_t; /// Medium qualifier 32 bit unsigned integer type. /// @see gtc_type_precision typedef detail::uint32 mediump_uint32_t; /// Medium qualifier 64 bit unsigned integer type. /// @see gtc_type_precision typedef detail::uint64 mediump_uint64_t; /// Medium qualifier 8 bit unsigned integer type. /// @see gtc_type_precision typedef detail::uint8 mediump_u8; /// Medium qualifier 16 bit unsigned integer type. /// @see gtc_type_precision typedef detail::uint16 mediump_u16; /// Medium qualifier 32 bit unsigned integer type. /// @see gtc_type_precision typedef detail::uint32 mediump_u32; /// Medium qualifier 64 bit unsigned integer type. /// @see gtc_type_precision typedef detail::uint64 mediump_u64; /// High qualifier 8 bit unsigned integer type. /// @see gtc_type_precision typedef detail::uint8 highp_uint8; /// High qualifier 16 bit unsigned integer type. /// @see gtc_type_precision typedef detail::uint16 highp_uint16; /// High qualifier 32 bit unsigned integer type. /// @see gtc_type_precision typedef detail::uint32 highp_uint32; /// High qualifier 64 bit unsigned integer type. /// @see gtc_type_precision typedef detail::uint64 highp_uint64; /// High qualifier 8 bit unsigned integer type. /// @see gtc_type_precision typedef detail::uint8 highp_uint8_t; /// High qualifier 16 bit unsigned integer type. /// @see gtc_type_precision typedef detail::uint16 highp_uint16_t; /// High qualifier 32 bit unsigned integer type. /// @see gtc_type_precision typedef detail::uint32 highp_uint32_t; /// High qualifier 64 bit unsigned integer type. /// @see gtc_type_precision typedef detail::uint64 highp_uint64_t; /// High qualifier 8 bit unsigned integer type. /// @see gtc_type_precision typedef detail::uint8 highp_u8; /// High qualifier 16 bit unsigned integer type. /// @see gtc_type_precision typedef detail::uint16 highp_u16; /// High qualifier 32 bit unsigned integer type. /// @see gtc_type_precision typedef detail::uint32 highp_u32; /// High qualifier 64 bit unsigned integer type. /// @see gtc_type_precision typedef detail::uint64 highp_u64; #if GLM_HAS_EXTENDED_INTEGER_TYPE using std::uint8_t; using std::uint16_t; using std::uint32_t; using std::uint64_t; #else /// Default qualifier 8 bit unsigned integer type. /// @see gtc_type_precision typedef detail::uint8 uint8_t; /// Default qualifier 16 bit unsigned integer type. /// @see gtc_type_precision typedef detail::uint16 uint16_t; /// Default qualifier 32 bit unsigned integer type. /// @see gtc_type_precision typedef detail::uint32 uint32_t; /// Default qualifier 64 bit unsigned integer type. /// @see gtc_type_precision typedef detail::uint64 uint64_t; #endif /// Default qualifier 8 bit unsigned integer type. /// @see gtc_type_precision typedef detail::uint8 u8; /// Default qualifier 16 bit unsigned integer type. /// @see gtc_type_precision typedef detail::uint16 u16; /// Default qualifier 32 bit unsigned integer type. /// @see gtc_type_precision typedef detail::uint32 u32; /// Default qualifier 64 bit unsigned integer type. /// @see gtc_type_precision typedef detail::uint64 u64; ////////////////////// // Float vector types /// Single-qualifier floating-point scalar. /// @see gtc_type_precision typedef float float32; /// Double-qualifier floating-point scalar. /// @see gtc_type_precision typedef double float64; /// Low 32 bit single-qualifier floating-point scalar. /// @see gtc_type_precision typedef float32 lowp_float32; /// Low 64 bit double-qualifier floating-point scalar. /// @see gtc_type_precision typedef float64 lowp_float64; /// Low 32 bit single-qualifier floating-point scalar. /// @see gtc_type_precision typedef float32 lowp_float32_t; /// Low 64 bit double-qualifier floating-point scalar. /// @see gtc_type_precision typedef float64 lowp_float64_t; /// Low 32 bit single-qualifier floating-point scalar. /// @see gtc_type_precision typedef float32 lowp_f32; /// Low 64 bit double-qualifier floating-point scalar. /// @see gtc_type_precision typedef float64 lowp_f64; /// Low 32 bit single-qualifier floating-point scalar. /// @see gtc_type_precision typedef float32 lowp_float32; /// Low 64 bit double-qualifier floating-point scalar. /// @see gtc_type_precision typedef float64 lowp_float64; /// Low 32 bit single-qualifier floating-point scalar. /// @see gtc_type_precision typedef float32 lowp_float32_t; /// Low 64 bit double-qualifier floating-point scalar. /// @see gtc_type_precision typedef float64 lowp_float64_t; /// Low 32 bit single-qualifier floating-point scalar. /// @see gtc_type_precision typedef float32 lowp_f32; /// Low 64 bit double-qualifier floating-point scalar. /// @see gtc_type_precision typedef float64 lowp_f64; /// Low 32 bit single-qualifier floating-point scalar. /// @see gtc_type_precision typedef float32 lowp_float32; /// Low 64 bit double-qualifier floating-point scalar. /// @see gtc_type_precision typedef float64 lowp_float64; /// Low 32 bit single-qualifier floating-point scalar. /// @see gtc_type_precision typedef float32 lowp_float32_t; /// Low 64 bit double-qualifier floating-point scalar. /// @see gtc_type_precision typedef float64 lowp_float64_t; /// Low 32 bit single-qualifier floating-point scalar. /// @see gtc_type_precision typedef float32 lowp_f32; /// Low 64 bit double-qualifier floating-point scalar. /// @see gtc_type_precision typedef float64 lowp_f64; /// Medium 32 bit single-qualifier floating-point scalar. /// @see gtc_type_precision typedef float32 mediump_float32; /// Medium 64 bit double-qualifier floating-point scalar. /// @see gtc_type_precision typedef float64 mediump_float64; /// Medium 32 bit single-qualifier floating-point scalar. /// @see gtc_type_precision typedef float32 mediump_float32_t; /// Medium 64 bit double-qualifier floating-point scalar. /// @see gtc_type_precision typedef float64 mediump_float64_t; /// Medium 32 bit single-qualifier floating-point scalar. /// @see gtc_type_precision typedef float32 mediump_f32; /// Medium 64 bit double-qualifier floating-point scalar. /// @see gtc_type_precision typedef float64 mediump_f64; /// High 32 bit single-qualifier floating-point scalar. /// @see gtc_type_precision typedef float32 highp_float32; /// High 64 bit double-qualifier floating-point scalar. /// @see gtc_type_precision typedef float64 highp_float64; /// High 32 bit single-qualifier floating-point scalar. /// @see gtc_type_precision typedef float32 highp_float32_t; /// High 64 bit double-qualifier floating-point scalar. /// @see gtc_type_precision typedef float64 highp_float64_t; /// High 32 bit single-qualifier floating-point scalar. /// @see gtc_type_precision typedef float32 highp_f32; /// High 64 bit double-qualifier floating-point scalar. /// @see gtc_type_precision typedef float64 highp_f64; #if(defined(GLM_PRECISION_LOWP_FLOAT)) /// Default 32 bit single-qualifier floating-point scalar. /// @see gtc_type_precision typedef lowp_float32_t float32_t; /// Default 64 bit double-qualifier floating-point scalar. /// @see gtc_type_precision typedef lowp_float64_t float64_t; /// Default 32 bit single-qualifier floating-point scalar. /// @see gtc_type_precision typedef lowp_f32 f32; /// Default 64 bit double-qualifier floating-point scalar. /// @see gtc_type_precision typedef lowp_f64 f64; #elif(defined(GLM_PRECISION_MEDIUMP_FLOAT)) /// Default 32 bit single-qualifier floating-point scalar. /// @see gtc_type_precision typedef mediump_float32 float32_t; /// Default 64 bit double-qualifier floating-point scalar. /// @see gtc_type_precision typedef mediump_float64 float64_t; /// Default 32 bit single-qualifier floating-point scalar. /// @see gtc_type_precision typedef mediump_float32 f32; /// Default 64 bit double-qualifier floating-point scalar. /// @see gtc_type_precision typedef mediump_float64 f64; #else//(defined(GLM_PRECISION_HIGHP_FLOAT)) /// Default 32 bit single-qualifier floating-point scalar. /// @see gtc_type_precision typedef highp_float32_t float32_t; /// Default 64 bit double-qualifier floating-point scalar. /// @see gtc_type_precision typedef highp_float64_t float64_t; /// Default 32 bit single-qualifier floating-point scalar. /// @see gtc_type_precision typedef highp_float32_t f32; /// Default 64 bit double-qualifier floating-point scalar. /// @see gtc_type_precision typedef highp_float64_t f64; #endif /// Low single-qualifier floating-point vector of 1 component. /// @see gtc_type_precision typedef vec<1, float, lowp> lowp_fvec1; /// Low single-qualifier floating-point vector of 2 components. /// @see gtc_type_precision typedef vec<2, float, lowp> lowp_fvec2; /// Low single-qualifier floating-point vector of 3 components. /// @see gtc_type_precision typedef vec<3, float, lowp> lowp_fvec3; /// Low single-qualifier floating-point vector of 4 components. /// @see gtc_type_precision typedef vec<4, float, lowp> lowp_fvec4; /// Medium single-qualifier floating-point vector of 1 component. /// @see gtc_type_precision typedef vec<1, float, mediump> mediump_fvec1; /// Medium Single-qualifier floating-point vector of 2 components. /// @see gtc_type_precision typedef vec<2, float, mediump> mediump_fvec2; /// Medium Single-qualifier floating-point vector of 3 components. /// @see gtc_type_precision typedef vec<3, float, mediump> mediump_fvec3; /// Medium Single-qualifier floating-point vector of 4 components. /// @see gtc_type_precision typedef vec<4, float, mediump> mediump_fvec4; /// High single-qualifier floating-point vector of 1 component. /// @see gtc_type_precision typedef vec<1, float, highp> highp_fvec1; /// High Single-qualifier floating-point vector of 2 components. /// @see core_precision typedef vec<2, float, highp> highp_fvec2; /// High Single-qualifier floating-point vector of 3 components. /// @see core_precision typedef vec<3, float, highp> highp_fvec3; /// High Single-qualifier floating-point vector of 4 components. /// @see core_precision typedef vec<4, float, highp> highp_fvec4; /// Low single-qualifier floating-point vector of 1 component. /// @see gtc_type_precision typedef vec<1, f32, lowp> lowp_f32vec1; /// Low single-qualifier floating-point vector of 2 components. /// @see core_precision typedef vec<2, f32, lowp> lowp_f32vec2; /// Low single-qualifier floating-point vector of 3 components. /// @see core_precision typedef vec<3, f32, lowp> lowp_f32vec3; /// Low single-qualifier floating-point vector of 4 components. /// @see core_precision typedef vec<4, f32, lowp> lowp_f32vec4; /// Medium single-qualifier floating-point vector of 1 component. /// @see gtc_type_precision typedef vec<1, f32, mediump> mediump_f32vec1; /// Medium single-qualifier floating-point vector of 2 components. /// @see core_precision typedef vec<2, f32, mediump> mediump_f32vec2; /// Medium single-qualifier floating-point vector of 3 components. /// @see core_precision typedef vec<3, f32, mediump> mediump_f32vec3; /// Medium single-qualifier floating-point vector of 4 components. /// @see core_precision typedef vec<4, f32, mediump> mediump_f32vec4; /// High single-qualifier floating-point vector of 1 component. /// @see gtc_type_precision typedef vec<1, f32, highp> highp_f32vec1; /// High single-qualifier floating-point vector of 2 components. /// @see gtc_type_precision typedef vec<2, f32, highp> highp_f32vec2; /// High single-qualifier floating-point vector of 3 components. /// @see gtc_type_precision typedef vec<3, f32, highp> highp_f32vec3; /// High single-qualifier floating-point vector of 4 components. /// @see gtc_type_precision typedef vec<4, f32, highp> highp_f32vec4; /// Low double-qualifier floating-point vector of 1 component. /// @see gtc_type_precision typedef vec<1, f64, lowp> lowp_f64vec1; /// Low double-qualifier floating-point vector of 2 components. /// @see gtc_type_precision typedef vec<2, f64, lowp> lowp_f64vec2; /// Low double-qualifier floating-point vector of 3 components. /// @see gtc_type_precision typedef vec<3, f64, lowp> lowp_f64vec3; /// Low double-qualifier floating-point vector of 4 components. /// @see gtc_type_precision typedef vec<4, f64, lowp> lowp_f64vec4; /// Medium double-qualifier floating-point vector of 1 component. /// @see gtc_type_precision typedef vec<1, f64, mediump> mediump_f64vec1; /// Medium double-qualifier floating-point vector of 2 components. /// @see gtc_type_precision typedef vec<2, f64, mediump> mediump_f64vec2; /// Medium double-qualifier floating-point vector of 3 components. /// @see gtc_type_precision typedef vec<3, f64, mediump> mediump_f64vec3; /// Medium double-qualifier floating-point vector of 4 components. /// @see gtc_type_precision typedef vec<4, f64, mediump> mediump_f64vec4; /// High double-qualifier floating-point vector of 1 component. /// @see gtc_type_precision typedef vec<1, f64, highp> highp_f64vec1; /// High double-qualifier floating-point vector of 2 components. /// @see gtc_type_precision typedef vec<2, f64, highp> highp_f64vec2; /// High double-qualifier floating-point vector of 3 components. /// @see gtc_type_precision typedef vec<3, f64, highp> highp_f64vec3; /// High double-qualifier floating-point vector of 4 components. /// @see gtc_type_precision typedef vec<4, f64, highp> highp_f64vec4; ////////////////////// // Float matrix types /// Low single-qualifier floating-point 1x1 matrix. /// @see gtc_type_precision //typedef lowp_f32 lowp_fmat1x1; /// Low single-qualifier floating-point 2x2 matrix. /// @see gtc_type_precision typedef mat<2, 2, f32, lowp> lowp_fmat2x2; /// Low single-qualifier floating-point 2x3 matrix. /// @see gtc_type_precision typedef mat<2, 3, f32, lowp> lowp_fmat2x3; /// Low single-qualifier floating-point 2x4 matrix. /// @see gtc_type_precision typedef mat<2, 4, f32, lowp> lowp_fmat2x4; /// Low single-qualifier floating-point 3x2 matrix. /// @see gtc_type_precision typedef mat<3, 2, f32, lowp> lowp_fmat3x2; /// Low single-qualifier floating-point 3x3 matrix. /// @see gtc_type_precision typedef mat<3, 3, f32, lowp> lowp_fmat3x3; /// Low single-qualifier floating-point 3x4 matrix. /// @see gtc_type_precision typedef mat<3, 4, f32, lowp> lowp_fmat3x4; /// Low single-qualifier floating-point 4x2 matrix. /// @see gtc_type_precision typedef mat<4, 2, f32, lowp> lowp_fmat4x2; /// Low single-qualifier floating-point 4x3 matrix. /// @see gtc_type_precision typedef mat<4, 3, f32, lowp> lowp_fmat4x3; /// Low single-qualifier floating-point 4x4 matrix. /// @see gtc_type_precision typedef mat<4, 4, f32, lowp> lowp_fmat4x4; /// Low single-qualifier floating-point 1x1 matrix. /// @see gtc_type_precision //typedef lowp_fmat1x1 lowp_fmat1; /// Low single-qualifier floating-point 2x2 matrix. /// @see gtc_type_precision typedef lowp_fmat2x2 lowp_fmat2; /// Low single-qualifier floating-point 3x3 matrix. /// @see gtc_type_precision typedef lowp_fmat3x3 lowp_fmat3; /// Low single-qualifier floating-point 4x4 matrix. /// @see gtc_type_precision typedef lowp_fmat4x4 lowp_fmat4; /// Medium single-qualifier floating-point 1x1 matrix. /// @see gtc_type_precision //typedef mediump_f32 mediump_fmat1x1; /// Medium single-qualifier floating-point 2x2 matrix. /// @see gtc_type_precision typedef mat<2, 2, f32, mediump> mediump_fmat2x2; /// Medium single-qualifier floating-point 2x3 matrix. /// @see gtc_type_precision typedef mat<2, 3, f32, mediump> mediump_fmat2x3; /// Medium single-qualifier floating-point 2x4 matrix. /// @see gtc_type_precision typedef mat<2, 4, f32, mediump> mediump_fmat2x4; /// Medium single-qualifier floating-point 3x2 matrix. /// @see gtc_type_precision typedef mat<3, 2, f32, mediump> mediump_fmat3x2; /// Medium single-qualifier floating-point 3x3 matrix. /// @see gtc_type_precision typedef mat<3, 3, f32, mediump> mediump_fmat3x3; /// Medium single-qualifier floating-point 3x4 matrix. /// @see gtc_type_precision typedef mat<3, 4, f32, mediump> mediump_fmat3x4; /// Medium single-qualifier floating-point 4x2 matrix. /// @see gtc_type_precision typedef mat<4, 2, f32, mediump> mediump_fmat4x2; /// Medium single-qualifier floating-point 4x3 matrix. /// @see gtc_type_precision typedef mat<4, 3, f32, mediump> mediump_fmat4x3; /// Medium single-qualifier floating-point 4x4 matrix. /// @see gtc_type_precision typedef mat<4, 4, f32, mediump> mediump_fmat4x4; /// Medium single-qualifier floating-point 1x1 matrix. /// @see gtc_type_precision //typedef mediump_fmat1x1 mediump_fmat1; /// Medium single-qualifier floating-point 2x2 matrix. /// @see gtc_type_precision typedef mediump_fmat2x2 mediump_fmat2; /// Medium single-qualifier floating-point 3x3 matrix. /// @see gtc_type_precision typedef mediump_fmat3x3 mediump_fmat3; /// Medium single-qualifier floating-point 4x4 matrix. /// @see gtc_type_precision typedef mediump_fmat4x4 mediump_fmat4; /// High single-qualifier floating-point 1x1 matrix. /// @see gtc_type_precision //typedef highp_f32 highp_fmat1x1; /// High single-qualifier floating-point 2x2 matrix. /// @see gtc_type_precision typedef mat<2, 2, f32, highp> highp_fmat2x2; /// High single-qualifier floating-point 2x3 matrix. /// @see gtc_type_precision typedef mat<2, 3, f32, highp> highp_fmat2x3; /// High single-qualifier floating-point 2x4 matrix. /// @see gtc_type_precision typedef mat<2, 4, f32, highp> highp_fmat2x4; /// High single-qualifier floating-point 3x2 matrix. /// @see gtc_type_precision typedef mat<3, 2, f32, highp> highp_fmat3x2; /// High single-qualifier floating-point 3x3 matrix. /// @see gtc_type_precision typedef mat<3, 3, f32, highp> highp_fmat3x3; /// High single-qualifier floating-point 3x4 matrix. /// @see gtc_type_precision typedef mat<3, 4, f32, highp> highp_fmat3x4; /// High single-qualifier floating-point 4x2 matrix. /// @see gtc_type_precision typedef mat<4, 2, f32, highp> highp_fmat4x2; /// High single-qualifier floating-point 4x3 matrix. /// @see gtc_type_precision typedef mat<4, 3, f32, highp> highp_fmat4x3; /// High single-qualifier floating-point 4x4 matrix. /// @see gtc_type_precision typedef mat<4, 4, f32, highp> highp_fmat4x4; /// High single-qualifier floating-point 1x1 matrix. /// @see gtc_type_precision //typedef highp_fmat1x1 highp_fmat1; /// High single-qualifier floating-point 2x2 matrix. /// @see gtc_type_precision typedef highp_fmat2x2 highp_fmat2; /// High single-qualifier floating-point 3x3 matrix. /// @see gtc_type_precision typedef highp_fmat3x3 highp_fmat3; /// High single-qualifier floating-point 4x4 matrix. /// @see gtc_type_precision typedef highp_fmat4x4 highp_fmat4; /// Low single-qualifier floating-point 1x1 matrix. /// @see gtc_type_precision //typedef f32 lowp_f32mat1x1; /// Low single-qualifier floating-point 2x2 matrix. /// @see gtc_type_precision typedef mat<2, 2, f32, lowp> lowp_f32mat2x2; /// Low single-qualifier floating-point 2x3 matrix. /// @see gtc_type_precision typedef mat<2, 3, f32, lowp> lowp_f32mat2x3; /// Low single-qualifier floating-point 2x4 matrix. /// @see gtc_type_precision typedef mat<2, 4, f32, lowp> lowp_f32mat2x4; /// Low single-qualifier floating-point 3x2 matrix. /// @see gtc_type_precision typedef mat<3, 2, f32, lowp> lowp_f32mat3x2; /// Low single-qualifier floating-point 3x3 matrix. /// @see gtc_type_precision typedef mat<3, 3, f32, lowp> lowp_f32mat3x3; /// Low single-qualifier floating-point 3x4 matrix. /// @see gtc_type_precision typedef mat<3, 4, f32, lowp> lowp_f32mat3x4; /// Low single-qualifier floating-point 4x2 matrix. /// @see gtc_type_precision typedef mat<4, 2, f32, lowp> lowp_f32mat4x2; /// Low single-qualifier floating-point 4x3 matrix. /// @see gtc_type_precision typedef mat<4, 3, f32, lowp> lowp_f32mat4x3; /// Low single-qualifier floating-point 4x4 matrix. /// @see gtc_type_precision typedef mat<4, 4, f32, lowp> lowp_f32mat4x4; /// Low single-qualifier floating-point 1x1 matrix. /// @see gtc_type_precision //typedef detail::tmat1x1<f32, lowp> lowp_f32mat1; /// Low single-qualifier floating-point 2x2 matrix. /// @see gtc_type_precision typedef lowp_f32mat2x2 lowp_f32mat2; /// Low single-qualifier floating-point 3x3 matrix. /// @see gtc_type_precision typedef lowp_f32mat3x3 lowp_f32mat3; /// Low single-qualifier floating-point 4x4 matrix. /// @see gtc_type_precision typedef lowp_f32mat4x4 lowp_f32mat4; /// High single-qualifier floating-point 1x1 matrix. /// @see gtc_type_precision //typedef f32 mediump_f32mat1x1; /// Low single-qualifier floating-point 2x2 matrix. /// @see gtc_type_precision typedef mat<2, 2, f32, mediump> mediump_f32mat2x2; /// Medium single-qualifier floating-point 2x3 matrix. /// @see gtc_type_precision typedef mat<2, 3, f32, mediump> mediump_f32mat2x3; /// Medium single-qualifier floating-point 2x4 matrix. /// @see gtc_type_precision typedef mat<2, 4, f32, mediump> mediump_f32mat2x4; /// Medium single-qualifier floating-point 3x2 matrix. /// @see gtc_type_precision typedef mat<3, 2, f32, mediump> mediump_f32mat3x2; /// Medium single-qualifier floating-point 3x3 matrix. /// @see gtc_type_precision typedef mat<3, 3, f32, mediump> mediump_f32mat3x3; /// Medium single-qualifier floating-point 3x4 matrix. /// @see gtc_type_precision typedef mat<3, 4, f32, mediump> mediump_f32mat3x4; /// Medium single-qualifier floating-point 4x2 matrix. /// @see gtc_type_precision typedef mat<4, 2, f32, mediump> mediump_f32mat4x2; /// Medium single-qualifier floating-point 4x3 matrix. /// @see gtc_type_precision typedef mat<4, 3, f32, mediump> mediump_f32mat4x3; /// Medium single-qualifier floating-point 4x4 matrix. /// @see gtc_type_precision typedef mat<4, 4, f32, mediump> mediump_f32mat4x4; /// Medium single-qualifier floating-point 1x1 matrix. /// @see gtc_type_precision //typedef detail::tmat1x1<f32, mediump> f32mat1; /// Medium single-qualifier floating-point 2x2 matrix. /// @see gtc_type_precision typedef mediump_f32mat2x2 mediump_f32mat2; /// Medium single-qualifier floating-point 3x3 matrix. /// @see gtc_type_precision typedef mediump_f32mat3x3 mediump_f32mat3; /// Medium single-qualifier floating-point 4x4 matrix. /// @see gtc_type_precision typedef mediump_f32mat4x4 mediump_f32mat4; /// High single-qualifier floating-point 1x1 matrix. /// @see gtc_type_precision //typedef f32 highp_f32mat1x1; /// High single-qualifier floating-point 2x2 matrix. /// @see gtc_type_precision typedef mat<2, 2, f32, highp> highp_f32mat2x2; /// High single-qualifier floating-point 2x3 matrix. /// @see gtc_type_precision typedef mat<2, 3, f32, highp> highp_f32mat2x3; /// High single-qualifier floating-point 2x4 matrix. /// @see gtc_type_precision typedef mat<2, 4, f32, highp> highp_f32mat2x4; /// High single-qualifier floating-point 3x2 matrix. /// @see gtc_type_precision typedef mat<3, 2, f32, highp> highp_f32mat3x2; /// High single-qualifier floating-point 3x3 matrix. /// @see gtc_type_precision typedef mat<3, 3, f32, highp> highp_f32mat3x3; /// High single-qualifier floating-point 3x4 matrix. /// @see gtc_type_precision typedef mat<3, 4, f32, highp> highp_f32mat3x4; /// High single-qualifier floating-point 4x2 matrix. /// @see gtc_type_precision typedef mat<4, 2, f32, highp> highp_f32mat4x2; /// High single-qualifier floating-point 4x3 matrix. /// @see gtc_type_precision typedef mat<4, 3, f32, highp> highp_f32mat4x3; /// High single-qualifier floating-point 4x4 matrix. /// @see gtc_type_precision typedef mat<4, 4, f32, highp> highp_f32mat4x4; /// High single-qualifier floating-point 1x1 matrix. /// @see gtc_type_precision //typedef detail::tmat1x1<f32, highp> f32mat1; /// High single-qualifier floating-point 2x2 matrix. /// @see gtc_type_precision typedef highp_f32mat2x2 highp_f32mat2; /// High single-qualifier floating-point 3x3 matrix. /// @see gtc_type_precision typedef highp_f32mat3x3 highp_f32mat3; /// High single-qualifier floating-point 4x4 matrix. /// @see gtc_type_precision typedef highp_f32mat4x4 highp_f32mat4; /// Low double-qualifier floating-point 1x1 matrix. /// @see gtc_type_precision //typedef f64 lowp_f64mat1x1; /// Low double-qualifier floating-point 2x2 matrix. /// @see gtc_type_precision typedef mat<2, 2, f64, lowp> lowp_f64mat2x2; /// Low double-qualifier floating-point 2x3 matrix. /// @see gtc_type_precision typedef mat<2, 3, f64, lowp> lowp_f64mat2x3; /// Low double-qualifier floating-point 2x4 matrix. /// @see gtc_type_precision typedef mat<2, 4, f64, lowp> lowp_f64mat2x4; /// Low double-qualifier floating-point 3x2 matrix. /// @see gtc_type_precision typedef mat<3, 2, f64, lowp> lowp_f64mat3x2; /// Low double-qualifier floating-point 3x3 matrix. /// @see gtc_type_precision typedef mat<3, 3, f64, lowp> lowp_f64mat3x3; /// Low double-qualifier floating-point 3x4 matrix. /// @see gtc_type_precision typedef mat<3, 4, f64, lowp> lowp_f64mat3x4; /// Low double-qualifier floating-point 4x2 matrix. /// @see gtc_type_precision typedef mat<4, 2, f64, lowp> lowp_f64mat4x2; /// Low double-qualifier floating-point 4x3 matrix. /// @see gtc_type_precision typedef mat<4, 3, f64, lowp> lowp_f64mat4x3; /// Low double-qualifier floating-point 4x4 matrix. /// @see gtc_type_precision typedef mat<4, 4, f64, lowp> lowp_f64mat4x4; /// Low double-qualifier floating-point 1x1 matrix. /// @see gtc_type_precision //typedef lowp_f64mat1x1 lowp_f64mat1; /// Low double-qualifier floating-point 2x2 matrix. /// @see gtc_type_precision typedef lowp_f64mat2x2 lowp_f64mat2; /// Low double-qualifier floating-point 3x3 matrix. /// @see gtc_type_precision typedef lowp_f64mat3x3 lowp_f64mat3; /// Low double-qualifier floating-point 4x4 matrix. /// @see gtc_type_precision typedef lowp_f64mat4x4 lowp_f64mat4; /// Medium double-qualifier floating-point 1x1 matrix. /// @see gtc_type_precision //typedef f64 Highp_f64mat1x1; /// Medium double-qualifier floating-point 2x2 matrix. /// @see gtc_type_precision typedef mat<2, 2, f64, mediump> mediump_f64mat2x2; /// Medium double-qualifier floating-point 2x3 matrix. /// @see gtc_type_precision typedef mat<2, 3, f64, mediump> mediump_f64mat2x3; /// Medium double-qualifier floating-point 2x4 matrix. /// @see gtc_type_precision typedef mat<2, 4, f64, mediump> mediump_f64mat2x4; /// Medium double-qualifier floating-point 3x2 matrix. /// @see gtc_type_precision typedef mat<3, 2, f64, mediump> mediump_f64mat3x2; /// Medium double-qualifier floating-point 3x3 matrix. /// @see gtc_type_precision typedef mat<3, 3, f64, mediump> mediump_f64mat3x3; /// Medium double-qualifier floating-point 3x4 matrix. /// @see gtc_type_precision typedef mat<3, 4, f64, mediump> mediump_f64mat3x4; /// Medium double-qualifier floating-point 4x2 matrix. /// @see gtc_type_precision typedef mat<4, 2, f64, mediump> mediump_f64mat4x2; /// Medium double-qualifier floating-point 4x3 matrix. /// @see gtc_type_precision typedef mat<4, 3, f64, mediump> mediump_f64mat4x3; /// Medium double-qualifier floating-point 4x4 matrix. /// @see gtc_type_precision typedef mat<4, 4, f64, mediump> mediump_f64mat4x4; /// Medium double-qualifier floating-point 1x1 matrix. /// @see gtc_type_precision //typedef mediump_f64mat1x1 mediump_f64mat1; /// Medium double-qualifier floating-point 2x2 matrix. /// @see gtc_type_precision typedef mediump_f64mat2x2 mediump_f64mat2; /// Medium double-qualifier floating-point 3x3 matrix. /// @see gtc_type_precision typedef mediump_f64mat3x3 mediump_f64mat3; /// Medium double-qualifier floating-point 4x4 matrix. /// @see gtc_type_precision typedef mediump_f64mat4x4 mediump_f64mat4; /// High double-qualifier floating-point 1x1 matrix. /// @see gtc_type_precision //typedef f64 highp_f64mat1x1; /// High double-qualifier floating-point 2x2 matrix. /// @see gtc_type_precision typedef mat<2, 2, f64, highp> highp_f64mat2x2; /// High double-qualifier floating-point 2x3 matrix. /// @see gtc_type_precision typedef mat<2, 3, f64, highp> highp_f64mat2x3; /// High double-qualifier floating-point 2x4 matrix. /// @see gtc_type_precision typedef mat<2, 4, f64, highp> highp_f64mat2x4; /// High double-qualifier floating-point 3x2 matrix. /// @see gtc_type_precision typedef mat<3, 2, f64, highp> highp_f64mat3x2; /// High double-qualifier floating-point 3x3 matrix. /// @see gtc_type_precision typedef mat<3, 3, f64, highp> highp_f64mat3x3; /// High double-qualifier floating-point 3x4 matrix. /// @see gtc_type_precision typedef mat<3, 4, f64, highp> highp_f64mat3x4; /// High double-qualifier floating-point 4x2 matrix. /// @see gtc_type_precision typedef mat<4, 2, f64, highp> highp_f64mat4x2; /// High double-qualifier floating-point 4x3 matrix. /// @see gtc_type_precision typedef mat<4, 3, f64, highp> highp_f64mat4x3; /// High double-qualifier floating-point 4x4 matrix. /// @see gtc_type_precision typedef mat<4, 4, f64, highp> highp_f64mat4x4; /// High double-qualifier floating-point 1x1 matrix. /// @see gtc_type_precision //typedef highp_f64mat1x1 highp_f64mat1; /// High double-qualifier floating-point 2x2 matrix. /// @see gtc_type_precision typedef highp_f64mat2x2 highp_f64mat2; /// High double-qualifier floating-point 3x3 matrix. /// @see gtc_type_precision typedef highp_f64mat3x3 highp_f64mat3; /// High double-qualifier floating-point 4x4 matrix. /// @see gtc_type_precision typedef highp_f64mat4x4 highp_f64mat4; /// Low qualifier 8 bit unsigned integer scalar type. /// @see gtc_type_precision typedef vec<1, u8, lowp> lowp_u8vec1; /// Low qualifier 8 bit unsigned integer vector of 2 components type. /// @see gtc_type_precision typedef vec<2, u8, lowp> lowp_u8vec2; /// Low qualifier 8 bit unsigned integer vector of 3 components type. /// @see gtc_type_precision typedef vec<3, u8, lowp> lowp_u8vec3; /// Low qualifier 8 bit unsigned integer vector of 4 components type. /// @see gtc_type_precision typedef vec<4, u8, lowp> lowp_u8vec4; /// Medium qualifier 8 bit unsigned integer scalar type. /// @see gtc_type_precision typedef vec<1, u8, mediump> mediump_u8vec1; /// Medium qualifier 8 bit unsigned integer vector of 2 components type. /// @see gtc_type_precision typedef vec<2, u8, mediump> mediump_u8vec2; /// Medium qualifier 8 bit unsigned integer vector of 3 components type. /// @see gtc_type_precision typedef vec<3, u8, mediump> mediump_u8vec3; /// Medium qualifier 8 bit unsigned integer vector of 4 components type. /// @see gtc_type_precision typedef vec<4, u8, mediump> mediump_u8vec4; /// High qualifier 8 bit unsigned integer scalar type. /// @see gtc_type_precision typedef vec<1, u8, highp> highp_u8vec1; /// High qualifier 8 bit unsigned integer vector of 2 components type. /// @see gtc_type_precision typedef vec<2, u8, highp> highp_u8vec2; /// High qualifier 8 bit unsigned integer vector of 3 components type. /// @see gtc_type_precision typedef vec<3, u8, highp> highp_u8vec3; /// High qualifier 8 bit unsigned integer vector of 4 components type. /// @see gtc_type_precision typedef vec<4, u8, highp> highp_u8vec4; /// Default qualifier 8 bit unsigned integer scalar type. /// @see gtc_type_precision typedef vec<1, u8, defaultp> u8vec1; /// Default qualifier 8 bit unsigned integer vector of 2 components type. /// @see gtc_type_precision typedef vec<2, u8, defaultp> u8vec2; /// Default qualifier 8 bit unsigned integer vector of 3 components type. /// @see gtc_type_precision typedef vec<3, u8, defaultp> u8vec3; /// Default qualifier 8 bit unsigned integer vector of 4 components type. /// @see gtc_type_precision typedef vec<4, u8, defaultp> u8vec4; /// Low qualifier 16 bit unsigned integer scalar type. /// @see gtc_type_precision typedef vec<1, u16, lowp> lowp_u16vec1; /// Low qualifier 16 bit unsigned integer vector of 2 components type. /// @see gtc_type_precision typedef vec<2, u16, lowp> lowp_u16vec2; /// Low qualifier 16 bit unsigned integer vector of 3 components type. /// @see gtc_type_precision typedef vec<3, u16, lowp> lowp_u16vec3; /// Low qualifier 16 bit unsigned integer vector of 4 components type. /// @see gtc_type_precision typedef vec<4, u16, lowp> lowp_u16vec4; /// Medium qualifier 16 bit unsigned integer scalar type. /// @see gtc_type_precision typedef vec<1, u16, mediump> mediump_u16vec1; /// Medium qualifier 16 bit unsigned integer vector of 2 components type. /// @see gtc_type_precision typedef vec<2, u16, mediump> mediump_u16vec2; /// Medium qualifier 16 bit unsigned integer vector of 3 components type. /// @see gtc_type_precision typedef vec<3, u16, mediump> mediump_u16vec3; /// Medium qualifier 16 bit unsigned integer vector of 4 components type. /// @see gtc_type_precision typedef vec<4, u16, mediump> mediump_u16vec4; /// High qualifier 16 bit unsigned integer scalar type. /// @see gtc_type_precision typedef vec<1, u16, highp> highp_u16vec1; /// High qualifier 16 bit unsigned integer vector of 2 components type. /// @see gtc_type_precision typedef vec<2, u16, highp> highp_u16vec2; /// High qualifier 16 bit unsigned integer vector of 3 components type. /// @see gtc_type_precision typedef vec<3, u16, highp> highp_u16vec3; /// High qualifier 16 bit unsigned integer vector of 4 components type. /// @see gtc_type_precision typedef vec<4, u16, highp> highp_u16vec4; /// Default qualifier 16 bit unsigned integer scalar type. /// @see gtc_type_precision typedef vec<1, u16, defaultp> u16vec1; /// Default qualifier 16 bit unsigned integer vector of 2 components type. /// @see gtc_type_precision typedef vec<2, u16, defaultp> u16vec2; /// Default qualifier 16 bit unsigned integer vector of 3 components type. /// @see gtc_type_precision typedef vec<3, u16, defaultp> u16vec3; /// Default qualifier 16 bit unsigned integer vector of 4 components type. /// @see gtc_type_precision typedef vec<4, u16, defaultp> u16vec4; /// Low qualifier 32 bit unsigned integer scalar type. /// @see gtc_type_precision typedef vec<1, u32, lowp> lowp_u32vec1; /// Low qualifier 32 bit unsigned integer vector of 2 components type. /// @see gtc_type_precision typedef vec<2, u32, lowp> lowp_u32vec2; /// Low qualifier 32 bit unsigned integer vector of 3 components type. /// @see gtc_type_precision typedef vec<3, u32, lowp> lowp_u32vec3; /// Low qualifier 32 bit unsigned integer vector of 4 components type. /// @see gtc_type_precision typedef vec<4, u32, lowp> lowp_u32vec4; /// Medium qualifier 32 bit unsigned integer scalar type. /// @see gtc_type_precision typedef vec<1, u32, mediump> mediump_u32vec1; /// Medium qualifier 32 bit unsigned integer vector of 2 components type. /// @see gtc_type_precision typedef vec<2, u32, mediump> mediump_u32vec2; /// Medium qualifier 32 bit unsigned integer vector of 3 components type. /// @see gtc_type_precision typedef vec<3, u32, mediump> mediump_u32vec3; /// Medium qualifier 32 bit unsigned integer vector of 4 components type. /// @see gtc_type_precision typedef vec<4, u32, mediump> mediump_u32vec4; /// High qualifier 32 bit unsigned integer scalar type. /// @see gtc_type_precision typedef vec<1, u32, highp> highp_u32vec1; /// High qualifier 32 bit unsigned integer vector of 2 components type. /// @see gtc_type_precision typedef vec<2, u32, highp> highp_u32vec2; /// High qualifier 32 bit unsigned integer vector of 3 components type. /// @see gtc_type_precision typedef vec<3, u32, highp> highp_u32vec3; /// High qualifier 32 bit unsigned integer vector of 4 components type. /// @see gtc_type_precision typedef vec<4, u32, highp> highp_u32vec4; /// Default qualifier 32 bit unsigned integer scalar type. /// @see gtc_type_precision typedef vec<1, u32, defaultp> u32vec1; /// Default qualifier 32 bit unsigned integer vector of 2 components type. /// @see gtc_type_precision typedef vec<2, u32, defaultp> u32vec2; /// Default qualifier 32 bit unsigned integer vector of 3 components type. /// @see gtc_type_precision typedef vec<3, u32, defaultp> u32vec3; /// Default qualifier 32 bit unsigned integer vector of 4 components type. /// @see gtc_type_precision typedef vec<4, u32, defaultp> u32vec4; /// Low qualifier 64 bit unsigned integer scalar type. /// @see gtc_type_precision typedef vec<1, u64, lowp> lowp_u64vec1; /// Low qualifier 64 bit unsigned integer vector of 2 components type. /// @see gtc_type_precision typedef vec<2, u64, lowp> lowp_u64vec2; /// Low qualifier 64 bit unsigned integer vector of 3 components type. /// @see gtc_type_precision typedef vec<3, u64, lowp> lowp_u64vec3; /// Low qualifier 64 bit unsigned integer vector of 4 components type. /// @see gtc_type_precision typedef vec<4, u64, lowp> lowp_u64vec4; /// Medium qualifier 64 bit unsigned integer scalar type. /// @see gtc_type_precision typedef vec<1, u64, mediump> mediump_u64vec1; /// Medium qualifier 64 bit unsigned integer vector of 2 components type. /// @see gtc_type_precision typedef vec<2, u64, mediump> mediump_u64vec2; /// Medium qualifier 64 bit unsigned integer vector of 3 components type. /// @see gtc_type_precision typedef vec<3, u64, mediump> mediump_u64vec3; /// Medium qualifier 64 bit unsigned integer vector of 4 components type. /// @see gtc_type_precision typedef vec<4, u64, mediump> mediump_u64vec4; /// High qualifier 64 bit unsigned integer scalar type. /// @see gtc_type_precision typedef vec<1, u64, highp> highp_u64vec1; /// High qualifier 64 bit unsigned integer vector of 2 components type. /// @see gtc_type_precision typedef vec<2, u64, highp> highp_u64vec2; /// High qualifier 64 bit unsigned integer vector of 3 components type. /// @see gtc_type_precision typedef vec<3, u64, highp> highp_u64vec3; /// High qualifier 64 bit unsigned integer vector of 4 components type. /// @see gtc_type_precision typedef vec<4, u64, highp> highp_u64vec4; /// Default qualifier 64 bit unsigned integer scalar type. /// @see gtc_type_precision typedef vec<1, u64, defaultp> u64vec1; /// Default qualifier 64 bit unsigned integer vector of 2 components type. /// @see gtc_type_precision typedef vec<2, u64, defaultp> u64vec2; /// Default qualifier 64 bit unsigned integer vector of 3 components type. /// @see gtc_type_precision typedef vec<3, u64, defaultp> u64vec3; /// Default qualifier 64 bit unsigned integer vector of 4 components type. /// @see gtc_type_precision typedef vec<4, u64, defaultp> u64vec4; ////////////////////// // Float vector types /// 32 bit single-qualifier floating-point scalar. /// @see gtc_type_precision typedef float32 float32_t; /// 32 bit single-qualifier floating-point scalar. /// @see gtc_type_precision typedef float32 f32; # ifndef GLM_FORCE_SINGLE_ONLY /// 64 bit double-qualifier floating-point scalar. /// @see gtc_type_precision typedef float64 float64_t; /// 64 bit double-qualifier floating-point scalar. /// @see gtc_type_precision typedef float64 f64; # endif//GLM_FORCE_SINGLE_ONLY /// Single-qualifier floating-point vector of 1 component. /// @see gtc_type_precision typedef vec<1, float, defaultp> fvec1; /// Single-qualifier floating-point vector of 2 components. /// @see gtc_type_precision typedef vec<2, float, defaultp> fvec2; /// Single-qualifier floating-point vector of 3 components. /// @see gtc_type_precision typedef vec<3, float, defaultp> fvec3; /// Single-qualifier floating-point vector of 4 components. /// @see gtc_type_precision typedef vec<4, float, defaultp> fvec4; /// Single-qualifier floating-point vector of 1 component. /// @see gtc_type_precision typedef vec<1, f32, defaultp> f32vec1; /// Single-qualifier floating-point vector of 2 components. /// @see gtc_type_precision typedef vec<2, f32, defaultp> f32vec2; /// Single-qualifier floating-point vector of 3 components. /// @see gtc_type_precision typedef vec<3, f32, defaultp> f32vec3; /// Single-qualifier floating-point vector of 4 components. /// @see gtc_type_precision typedef vec<4, f32, defaultp> f32vec4; # ifndef GLM_FORCE_SINGLE_ONLY /// Double-qualifier floating-point vector of 1 component. /// @see gtc_type_precision typedef vec<1, f64, defaultp> f64vec1; /// Double-qualifier floating-point vector of 2 components. /// @see gtc_type_precision typedef vec<2, f64, defaultp> f64vec2; /// Double-qualifier floating-point vector of 3 components. /// @see gtc_type_precision typedef vec<3, f64, defaultp> f64vec3; /// Double-qualifier floating-point vector of 4 components. /// @see gtc_type_precision typedef vec<4, f64, defaultp> f64vec4; # endif//GLM_FORCE_SINGLE_ONLY ////////////////////// // Float matrix types /// Single-qualifier floating-point 1x1 matrix. /// @see gtc_type_precision //typedef detail::tmat1x1<f32> fmat1; /// Single-qualifier floating-point 2x2 matrix. /// @see gtc_type_precision typedef mat<2, 2, f32, defaultp> fmat2; /// Single-qualifier floating-point 3x3 matrix. /// @see gtc_type_precision typedef mat<3, 3, f32, defaultp> fmat3; /// Single-qualifier floating-point 4x4 matrix. /// @see gtc_type_precision typedef mat<4, 4, f32, defaultp> fmat4; /// Single-qualifier floating-point 1x1 matrix. /// @see gtc_type_precision //typedef f32 fmat1x1; /// Single-qualifier floating-point 2x2 matrix. /// @see gtc_type_precision typedef mat<2, 2, f32, defaultp> fmat2x2; /// Single-qualifier floating-point 2x3 matrix. /// @see gtc_type_precision typedef mat<2, 3, f32, defaultp> fmat2x3; /// Single-qualifier floating-point 2x4 matrix. /// @see gtc_type_precision typedef mat<2, 4, f32, defaultp> fmat2x4; /// Single-qualifier floating-point 3x2 matrix. /// @see gtc_type_precision typedef mat<3, 2, f32, defaultp> fmat3x2; /// Single-qualifier floating-point 3x3 matrix. /// @see gtc_type_precision typedef mat<3, 3, f32, defaultp> fmat3x3; /// Single-qualifier floating-point 3x4 matrix. /// @see gtc_type_precision typedef mat<3, 4, f32, defaultp> fmat3x4; /// Single-qualifier floating-point 4x2 matrix. /// @see gtc_type_precision typedef mat<4, 2, f32, defaultp> fmat4x2; /// Single-qualifier floating-point 4x3 matrix. /// @see gtc_type_precision typedef mat<4, 3, f32, defaultp> fmat4x3; /// Single-qualifier floating-point 4x4 matrix. /// @see gtc_type_precision typedef mat<4, 4, f32, defaultp> fmat4x4; /// Single-qualifier floating-point 1x1 matrix. /// @see gtc_type_precision //typedef detail::tmat1x1<f32, defaultp> f32mat1; /// Single-qualifier floating-point 2x2 matrix. /// @see gtc_type_precision typedef mat<2, 2, f32, defaultp> f32mat2; /// Single-qualifier floating-point 3x3 matrix. /// @see gtc_type_precision typedef mat<3, 3, f32, defaultp> f32mat3; /// Single-qualifier floating-point 4x4 matrix. /// @see gtc_type_precision typedef mat<4, 4, f32, defaultp> f32mat4; /// Single-qualifier floating-point 1x1 matrix. /// @see gtc_type_precision //typedef f32 f32mat1x1; /// Single-qualifier floating-point 2x2 matrix. /// @see gtc_type_precision typedef mat<2, 2, f32, defaultp> f32mat2x2; /// Single-qualifier floating-point 2x3 matrix. /// @see gtc_type_precision typedef mat<2, 3, f32, defaultp> f32mat2x3; /// Single-qualifier floating-point 2x4 matrix. /// @see gtc_type_precision typedef mat<2, 4, f32, defaultp> f32mat2x4; /// Single-qualifier floating-point 3x2 matrix. /// @see gtc_type_precision typedef mat<3, 2, f32, defaultp> f32mat3x2; /// Single-qualifier floating-point 3x3 matrix. /// @see gtc_type_precision typedef mat<3, 3, f32, defaultp> f32mat3x3; /// Single-qualifier floating-point 3x4 matrix. /// @see gtc_type_precision typedef mat<3, 4, f32, defaultp> f32mat3x4; /// Single-qualifier floating-point 4x2 matrix. /// @see gtc_type_precision typedef mat<4, 2, f32, defaultp> f32mat4x2; /// Single-qualifier floating-point 4x3 matrix. /// @see gtc_type_precision typedef mat<4, 3, f32, defaultp> f32mat4x3; /// Single-qualifier floating-point 4x4 matrix. /// @see gtc_type_precision typedef mat<4, 4, f32, defaultp> f32mat4x4; # ifndef GLM_FORCE_SINGLE_ONLY /// Double-qualifier floating-point 1x1 matrix. /// @see gtc_type_precision //typedef detail::tmat1x1<f64, defaultp> f64mat1; /// Double-qualifier floating-point 2x2 matrix. /// @see gtc_type_precision typedef mat<2, 2, f64, defaultp> f64mat2; /// Double-qualifier floating-point 3x3 matrix. /// @see gtc_type_precision typedef mat<3, 3, f64, defaultp> f64mat3; /// Double-qualifier floating-point 4x4 matrix. /// @see gtc_type_precision typedef mat<4, 4, f64, defaultp> f64mat4; /// Double-qualifier floating-point 1x1 matrix. /// @see gtc_type_precision //typedef f64 f64mat1x1; /// Double-qualifier floating-point 2x2 matrix. /// @see gtc_type_precision typedef mat<2, 2, f64, defaultp> f64mat2x2; /// Double-qualifier floating-point 2x3 matrix. /// @see gtc_type_precision typedef mat<2, 3, f64, defaultp> f64mat2x3; /// Double-qualifier floating-point 2x4 matrix. /// @see gtc_type_precision typedef mat<2, 4, f64, defaultp> f64mat2x4; /// Double-qualifier floating-point 3x2 matrix. /// @see gtc_type_precision typedef mat<3, 2, f64, defaultp> f64mat3x2; /// Double-qualifier floating-point 3x3 matrix. /// @see gtc_type_precision typedef mat<3, 3, f64, defaultp> f64mat3x3; /// Double-qualifier floating-point 3x4 matrix. /// @see gtc_type_precision typedef mat<3, 4, f64, defaultp> f64mat3x4; /// Double-qualifier floating-point 4x2 matrix. /// @see gtc_type_precision typedef mat<4, 2, f64, defaultp> f64mat4x2; /// Double-qualifier floating-point 4x3 matrix. /// @see gtc_type_precision typedef mat<4, 3, f64, defaultp> f64mat4x3; /// Double-qualifier floating-point 4x4 matrix. /// @see gtc_type_precision typedef mat<4, 4, f64, defaultp> f64mat4x4; # endif//GLM_FORCE_SINGLE_ONLY ////////////////////////// // Quaternion types /// Single-qualifier floating-point quaternion. /// @see gtc_type_precision typedef qua<f32, defaultp> f32quat; /// Low single-qualifier floating-point quaternion. /// @see gtc_type_precision typedef qua<f32, lowp> lowp_f32quat; /// Low double-qualifier floating-point quaternion. /// @see gtc_type_precision typedef qua<f64, lowp> lowp_f64quat; /// Medium single-qualifier floating-point quaternion. /// @see gtc_type_precision typedef qua<f32, mediump> mediump_f32quat; # ifndef GLM_FORCE_SINGLE_ONLY /// Medium double-qualifier floating-point quaternion. /// @see gtc_type_precision typedef qua<f64, mediump> mediump_f64quat; /// High single-qualifier floating-point quaternion. /// @see gtc_type_precision typedef qua<f32, highp> highp_f32quat; /// High double-qualifier floating-point quaternion. /// @see gtc_type_precision typedef qua<f64, highp> highp_f64quat; /// Double-qualifier floating-point quaternion. /// @see gtc_type_precision typedef qua<f64, defaultp> f64quat; # endif//GLM_FORCE_SINGLE_ONLY /// @} }//namespace glm #include "type_precision.inl"
Unknown
3D
mcellteam/mcell
libs/glm/gtc/vec1.hpp
.hpp
846
31
/// @ref gtc_vec1 /// @file glm/gtc/vec1.hpp /// /// @see core (dependence) /// /// @defgroup gtc_vec1 GLM_GTC_vec1 /// @ingroup gtc /// /// Include <glm/gtc/vec1.hpp> to use the features of this extension. /// /// Add vec1, ivec1, uvec1 and bvec1 types. #pragma once // Dependency: #include "../ext/vector_bool1.hpp" #include "../ext/vector_bool1_precision.hpp" #include "../ext/vector_float1.hpp" #include "../ext/vector_float1_precision.hpp" #include "../ext/vector_double1.hpp" #include "../ext/vector_double1_precision.hpp" #include "../ext/vector_int1.hpp" #include "../ext/vector_int1_precision.hpp" #include "../ext/vector_uint1.hpp" #include "../ext/vector_uint1_precision.hpp" #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTC_vec1 extension included") #endif
Unknown
3D
mcellteam/mcell
libs/glm/gtc/round.hpp
.hpp
7,029
203
/// @ref gtc_round /// @file glm/gtc/round.hpp /// /// @see core (dependence) /// @see gtc_round (dependence) /// /// @defgroup gtc_round GLM_GTC_round /// @ingroup gtc /// /// Include <glm/gtc/round.hpp> to use the features of this extension. /// /// Rounding value to specific boundings #pragma once // Dependencies #include "../detail/setup.hpp" #include "../detail/qualifier.hpp" #include "../detail/_vectorize.hpp" #include "../vector_relational.hpp" #include "../common.hpp" #include <limits> #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTC_integer extension included") #endif namespace glm { /// @addtogroup gtc_round /// @{ /// Return true if the value is a power of two number. /// /// @see gtc_round template<typename genIUType> GLM_FUNC_DECL bool isPowerOfTwo(genIUType v); /// Return true if the value is a power of two number. /// /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector /// @tparam T Floating-point or integer scalar types /// @tparam Q Value from qualifier enum /// /// @see gtc_round template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL vec<L, bool, Q> isPowerOfTwo(vec<L, T, Q> const& v); /// Return the power of two number which value is just higher the input value, /// round up to a power of two. /// /// @see gtc_round template<typename genIUType> GLM_FUNC_DECL genIUType ceilPowerOfTwo(genIUType v); /// Return the power of two number which value is just higher the input value, /// round up to a power of two. /// /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector /// @tparam T Floating-point or integer scalar types /// @tparam Q Value from qualifier enum /// /// @see gtc_round template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL vec<L, T, Q> ceilPowerOfTwo(vec<L, T, Q> const& v); /// Return the power of two number which value is just lower the input value, /// round down to a power of two. /// /// @see gtc_round template<typename genIUType> GLM_FUNC_DECL genIUType floorPowerOfTwo(genIUType v); /// Return the power of two number which value is just lower the input value, /// round down to a power of two. /// /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector /// @tparam T Floating-point or integer scalar types /// @tparam Q Value from qualifier enum /// /// @see gtc_round template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL vec<L, T, Q> floorPowerOfTwo(vec<L, T, Q> const& v); /// Return the power of two number which value is the closet to the input value. /// /// @see gtc_round template<typename genIUType> GLM_FUNC_DECL genIUType roundPowerOfTwo(genIUType v); /// Return the power of two number which value is the closet to the input value. /// /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector /// @tparam T Floating-point or integer scalar types /// @tparam Q Value from qualifier enum /// /// @see gtc_round template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL vec<L, T, Q> roundPowerOfTwo(vec<L, T, Q> const& v); /// Return true if the 'Value' is a multiple of 'Multiple'. /// /// @see gtc_round template<typename genIUType> GLM_FUNC_DECL bool isMultiple(genIUType v, genIUType Multiple); /// Return true if the 'Value' is a multiple of 'Multiple'. /// /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector /// @tparam T Floating-point or integer scalar types /// @tparam Q Value from qualifier enum /// /// @see gtc_round template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL vec<L, bool, Q> isMultiple(vec<L, T, Q> const& v, T Multiple); /// Return true if the 'Value' is a multiple of 'Multiple'. /// /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector /// @tparam T Floating-point or integer scalar types /// @tparam Q Value from qualifier enum /// /// @see gtc_round template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL vec<L, bool, Q> isMultiple(vec<L, T, Q> const& v, vec<L, T, Q> const& Multiple); /// Higher multiple number of Source. /// /// @tparam genType Floating-point or integer scalar or vector types. /// /// @param v Source value to which is applied the function /// @param Multiple Must be a null or positive value /// /// @see gtc_round template<typename genType> GLM_FUNC_DECL genType ceilMultiple(genType v, genType Multiple); /// Higher multiple number of Source. /// /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector /// @tparam T Floating-point or integer scalar types /// @tparam Q Value from qualifier enum /// /// @param v Source values to which is applied the function /// @param Multiple Must be a null or positive value /// /// @see gtc_round template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL vec<L, T, Q> ceilMultiple(vec<L, T, Q> const& v, vec<L, T, Q> const& Multiple); /// Lower multiple number of Source. /// /// @tparam genType Floating-point or integer scalar or vector types. /// /// @param v Source value to which is applied the function /// @param Multiple Must be a null or positive value /// /// @see gtc_round template<typename genType> GLM_FUNC_DECL genType floorMultiple(genType v, genType Multiple); /// Lower multiple number of Source. /// /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector /// @tparam T Floating-point or integer scalar types /// @tparam Q Value from qualifier enum /// /// @param v Source values to which is applied the function /// @param Multiple Must be a null or positive value /// /// @see gtc_round template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL vec<L, T, Q> floorMultiple(vec<L, T, Q> const& v, vec<L, T, Q> const& Multiple); /// Lower multiple number of Source. /// /// @tparam genType Floating-point or integer scalar or vector types. /// /// @param v Source value to which is applied the function /// @param Multiple Must be a null or positive value /// /// @see gtc_round template<typename genType> GLM_FUNC_DECL genType roundMultiple(genType v, genType Multiple); /// Lower multiple number of Source. /// /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector /// @tparam T Floating-point or integer scalar types /// @tparam Q Value from qualifier enum /// /// @param v Source values to which is applied the function /// @param Multiple Must be a null or positive value /// /// @see gtc_round template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL vec<L, T, Q> roundMultiple(vec<L, T, Q> const& v, vec<L, T, Q> const& Multiple); /// @} } //namespace glm #include "round.inl"
Unknown
3D
mcellteam/mcell
libs/glm/gtc/epsilon.hpp
.hpp
1,828
61
/// @ref gtc_epsilon /// @file glm/gtc/epsilon.hpp /// /// @see core (dependence) /// @see gtc_quaternion (dependence) /// /// @defgroup gtc_epsilon GLM_GTC_epsilon /// @ingroup gtc /// /// Include <glm/gtc/epsilon.hpp> to use the features of this extension. /// /// Comparison functions for a user defined epsilon values. #pragma once // Dependencies #include "../detail/setup.hpp" #include "../detail/qualifier.hpp" #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTC_epsilon extension included") #endif namespace glm { /// @addtogroup gtc_epsilon /// @{ /// Returns the component-wise comparison of |x - y| < epsilon. /// True if this expression is satisfied. /// /// @see gtc_epsilon template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL vec<L, bool, Q> epsilonEqual(vec<L, T, Q> const& x, vec<L, T, Q> const& y, T const& epsilon); /// Returns the component-wise comparison of |x - y| < epsilon. /// True if this expression is satisfied. /// /// @see gtc_epsilon template<typename genType> GLM_FUNC_DECL bool epsilonEqual(genType const& x, genType const& y, genType const& epsilon); /// Returns the component-wise comparison of |x - y| < epsilon. /// True if this expression is not satisfied. /// /// @see gtc_epsilon template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL vec<L, bool, Q> epsilonNotEqual(vec<L, T, Q> const& x, vec<L, T, Q> const& y, T const& epsilon); /// Returns the component-wise comparison of |x - y| >= epsilon. /// True if this expression is not satisfied. /// /// @see gtc_epsilon template<typename genType> GLM_FUNC_DECL bool epsilonNotEqual(genType const& x, genType const& y, genType const& epsilon); /// @} }//namespace glm #include "epsilon.inl"
Unknown
3D
mcellteam/mcell
libs/glm/gtc/bitfield.hpp
.hpp
10,144
267
/// @ref gtc_bitfield /// @file glm/gtc/bitfield.hpp /// /// @see core (dependence) /// @see gtc_bitfield (dependence) /// /// @defgroup gtc_bitfield GLM_GTC_bitfield /// @ingroup gtc /// /// Include <glm/gtc/bitfield.hpp> to use the features of this extension. /// /// Allow to perform bit operations on integer values #include "../detail/setup.hpp" #pragma once // Dependencies #include "../ext/scalar_int_sized.hpp" #include "../ext/scalar_uint_sized.hpp" #include "../detail/qualifier.hpp" #include "../detail/_vectorize.hpp" #include "type_precision.hpp" #include <limits> #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTC_bitfield extension included") #endif namespace glm { /// @addtogroup gtc_bitfield /// @{ /// Build a mask of 'count' bits /// /// @see gtc_bitfield template<typename genIUType> GLM_FUNC_DECL genIUType mask(genIUType Bits); /// Build a mask of 'count' bits /// /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector /// @tparam T Signed and unsigned integer scalar types /// @tparam Q Value from qualifier enum /// /// @see gtc_bitfield template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL vec<L, T, Q> mask(vec<L, T, Q> const& v); /// Rotate all bits to the right. All the bits dropped in the right side are inserted back on the left side. /// /// @see gtc_bitfield template<typename genIUType> GLM_FUNC_DECL genIUType bitfieldRotateRight(genIUType In, int Shift); /// Rotate all bits to the right. All the bits dropped in the right side are inserted back on the left side. /// /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector /// @tparam T Signed and unsigned integer scalar types /// @tparam Q Value from qualifier enum /// /// @see gtc_bitfield template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL vec<L, T, Q> bitfieldRotateRight(vec<L, T, Q> const& In, int Shift); /// Rotate all bits to the left. All the bits dropped in the left side are inserted back on the right side. /// /// @see gtc_bitfield template<typename genIUType> GLM_FUNC_DECL genIUType bitfieldRotateLeft(genIUType In, int Shift); /// Rotate all bits to the left. All the bits dropped in the left side are inserted back on the right side. /// /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector /// @tparam T Signed and unsigned integer scalar types /// @tparam Q Value from qualifier enum /// /// @see gtc_bitfield template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL vec<L, T, Q> bitfieldRotateLeft(vec<L, T, Q> const& In, int Shift); /// Set to 1 a range of bits. /// /// @see gtc_bitfield template<typename genIUType> GLM_FUNC_DECL genIUType bitfieldFillOne(genIUType Value, int FirstBit, int BitCount); /// Set to 1 a range of bits. /// /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector /// @tparam T Signed and unsigned integer scalar types /// @tparam Q Value from qualifier enum /// /// @see gtc_bitfield template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL vec<L, T, Q> bitfieldFillOne(vec<L, T, Q> const& Value, int FirstBit, int BitCount); /// Set to 0 a range of bits. /// /// @see gtc_bitfield template<typename genIUType> GLM_FUNC_DECL genIUType bitfieldFillZero(genIUType Value, int FirstBit, int BitCount); /// Set to 0 a range of bits. /// /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector /// @tparam T Signed and unsigned integer scalar types /// @tparam Q Value from qualifier enum /// /// @see gtc_bitfield template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL vec<L, T, Q> bitfieldFillZero(vec<L, T, Q> const& Value, int FirstBit, int BitCount); /// Interleaves the bits of x and y. /// The first bit is the first bit of x followed by the first bit of y. /// The other bits are interleaved following the previous sequence. /// /// @see gtc_bitfield GLM_FUNC_DECL int16 bitfieldInterleave(int8 x, int8 y); /// Interleaves the bits of x and y. /// The first bit is the first bit of x followed by the first bit of y. /// The other bits are interleaved following the previous sequence. /// /// @see gtc_bitfield GLM_FUNC_DECL uint16 bitfieldInterleave(uint8 x, uint8 y); /// Interleaves the bits of x and y. /// The first bit is the first bit of v.x followed by the first bit of v.y. /// The other bits are interleaved following the previous sequence. /// /// @see gtc_bitfield GLM_FUNC_DECL uint16 bitfieldInterleave(u8vec2 const& v); /// Deinterleaves the bits of x. /// /// @see gtc_bitfield GLM_FUNC_DECL glm::u8vec2 bitfieldDeinterleave(glm::uint16 x); /// Interleaves the bits of x and y. /// The first bit is the first bit of x followed by the first bit of y. /// The other bits are interleaved following the previous sequence. /// /// @see gtc_bitfield GLM_FUNC_DECL int32 bitfieldInterleave(int16 x, int16 y); /// Interleaves the bits of x and y. /// The first bit is the first bit of x followed by the first bit of y. /// The other bits are interleaved following the previous sequence. /// /// @see gtc_bitfield GLM_FUNC_DECL uint32 bitfieldInterleave(uint16 x, uint16 y); /// Interleaves the bits of x and y. /// The first bit is the first bit of v.x followed by the first bit of v.y. /// The other bits are interleaved following the previous sequence. /// /// @see gtc_bitfield GLM_FUNC_DECL uint32 bitfieldInterleave(u16vec2 const& v); /// Deinterleaves the bits of x. /// /// @see gtc_bitfield GLM_FUNC_DECL glm::u16vec2 bitfieldDeinterleave(glm::uint32 x); /// Interleaves the bits of x and y. /// The first bit is the first bit of x followed by the first bit of y. /// The other bits are interleaved following the previous sequence. /// /// @see gtc_bitfield GLM_FUNC_DECL int64 bitfieldInterleave(int32 x, int32 y); /// Interleaves the bits of x and y. /// The first bit is the first bit of x followed by the first bit of y. /// The other bits are interleaved following the previous sequence. /// /// @see gtc_bitfield GLM_FUNC_DECL uint64 bitfieldInterleave(uint32 x, uint32 y); /// Interleaves the bits of x and y. /// The first bit is the first bit of v.x followed by the first bit of v.y. /// The other bits are interleaved following the previous sequence. /// /// @see gtc_bitfield GLM_FUNC_DECL uint64 bitfieldInterleave(u32vec2 const& v); /// Deinterleaves the bits of x. /// /// @see gtc_bitfield GLM_FUNC_DECL glm::u32vec2 bitfieldDeinterleave(glm::uint64 x); /// Interleaves the bits of x, y and z. /// The first bit is the first bit of x followed by the first bit of y and the first bit of z. /// The other bits are interleaved following the previous sequence. /// /// @see gtc_bitfield GLM_FUNC_DECL int32 bitfieldInterleave(int8 x, int8 y, int8 z); /// Interleaves the bits of x, y and z. /// The first bit is the first bit of x followed by the first bit of y and the first bit of z. /// The other bits are interleaved following the previous sequence. /// /// @see gtc_bitfield GLM_FUNC_DECL uint32 bitfieldInterleave(uint8 x, uint8 y, uint8 z); /// Interleaves the bits of x, y and z. /// The first bit is the first bit of x followed by the first bit of y and the first bit of z. /// The other bits are interleaved following the previous sequence. /// /// @see gtc_bitfield GLM_FUNC_DECL int64 bitfieldInterleave(int16 x, int16 y, int16 z); /// Interleaves the bits of x, y and z. /// The first bit is the first bit of x followed by the first bit of y and the first bit of z. /// The other bits are interleaved following the previous sequence. /// /// @see gtc_bitfield GLM_FUNC_DECL uint64 bitfieldInterleave(uint16 x, uint16 y, uint16 z); /// Interleaves the bits of x, y and z. /// The first bit is the first bit of x followed by the first bit of y and the first bit of z. /// The other bits are interleaved following the previous sequence. /// /// @see gtc_bitfield GLM_FUNC_DECL int64 bitfieldInterleave(int32 x, int32 y, int32 z); /// Interleaves the bits of x, y and z. /// The first bit is the first bit of x followed by the first bit of y and the first bit of z. /// The other bits are interleaved following the previous sequence. /// /// @see gtc_bitfield GLM_FUNC_DECL uint64 bitfieldInterleave(uint32 x, uint32 y, uint32 z); /// Interleaves the bits of x, y, z and w. /// The first bit is the first bit of x followed by the first bit of y, the first bit of z and finally the first bit of w. /// The other bits are interleaved following the previous sequence. /// /// @see gtc_bitfield GLM_FUNC_DECL int32 bitfieldInterleave(int8 x, int8 y, int8 z, int8 w); /// Interleaves the bits of x, y, z and w. /// The first bit is the first bit of x followed by the first bit of y, the first bit of z and finally the first bit of w. /// The other bits are interleaved following the previous sequence. /// /// @see gtc_bitfield GLM_FUNC_DECL uint32 bitfieldInterleave(uint8 x, uint8 y, uint8 z, uint8 w); /// Interleaves the bits of x, y, z and w. /// The first bit is the first bit of x followed by the first bit of y, the first bit of z and finally the first bit of w. /// The other bits are interleaved following the previous sequence. /// /// @see gtc_bitfield GLM_FUNC_DECL int64 bitfieldInterleave(int16 x, int16 y, int16 z, int16 w); /// Interleaves the bits of x, y, z and w. /// The first bit is the first bit of x followed by the first bit of y, the first bit of z and finally the first bit of w. /// The other bits are interleaved following the previous sequence. /// /// @see gtc_bitfield GLM_FUNC_DECL uint64 bitfieldInterleave(uint16 x, uint16 y, uint16 z, uint16 w); /// @} } //namespace glm #include "bitfield.inl"
Unknown
3D
mcellteam/mcell
utils/plotting/plot_gdat_file.py
.py
2,327
75
#!/usr/bin/env python """ This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For more information, please refer to [http://unlicense.org] """ import numpy as np import pandas as pd import matplotlib.pyplot as plt import os import sys from io import StringIO def main(): if len(sys.argv) != 2 and len(sys.argv) != 3: sys.exit("Expecting exactly one argument that is the .gdat " "file and optionally comma-separated column indices.") # load all .dat files in directory passed as the first argument file = sys.argv[1] if not os.path.exists(file): sys.exit("File " + file + " does not exist.") wholefile = open(file).read() df = pd.read_csv(StringIO(wholefile[1:]), index_col=0, skipinitialspace=True, delim_whitespace=True) #df = df.set_index('time') print(df) col_names = pd.DataFrame if len(sys.argv) == 3: sel = [int(i) for i in sys.argv[2].split(',') ] col_names = df.columns[sel] print(col_names) if not col_names.empty: df_sel = df[col_names] else: df_sel = df df_sel.plot(kind='line') plt.show() if __name__ == '__main__': main()
Python
3D
mcellteam/mcell
utils/plotting/plot_averages_into_images.py
.py
8,218
246
#!/usr/bin/env python """ This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For more information, please refer to [http://unlicense.org] """ import numpy as np import pandas as pd import matplotlib.pyplot as plt import os import sys import argparse class Options: def __init__(self): self.mcell3_dir = None self.mcell4_dir = None self.bng_dir = None self.single_bng_run = False self.labels = ['MCell4', 'MCell3R', 'NFSim'] def create_argparse(): parser = argparse.ArgumentParser(description='MCell4 Runner') parser.add_argument('-m4', '--mcell4', type=str, help='mcell4 react_data directory') parser.add_argument('-m3', '--mcell3', type=str, help='mcell3 react_data directory') parser.add_argument('-b', '--bng', type=str, help='bionetgen directory') parser.add_argument('-s', '--single_bng_run', action='store_true', help='the bionetgen directory contains only a single .gdat file') parser.add_argument('-l', '--labels', type=str, help='comma-separated list of labels (used in order -m4,-m3,-b') return parser def process_opts(): parser = create_argparse() args = parser.parse_args() opts = Options() if args.mcell4: opts.mcell4_dir = args.mcell4 if args.mcell3: opts.mcell3_dir = args.mcell3 if args.bng: opts.bng_dir = args.bng if args.single_bng_run: opts.single_bng_run = args.single_bng_run if args.labels: opts.labels = args.labels.split(',') return opts def get_mcell_observables_counts(dir): counts = {} seed_dirs = os.listdir(dir) for seed_dir in seed_dirs: if not seed_dir.startswith('seed_'): continue file_list = os.listdir(os.path.join(dir, seed_dir)) for file in file_list: file_path = os.path.join(dir, seed_dir, file) if os.path.isfile(file_path) and file.endswith('.dat'): observable = os.path.splitext(file)[0] if observable.endswith('_MDLString'): observable = observable[:-len('_MDLString')] if observable not in counts: index = 0 else: index = counts[observable].shape[1] - 1 col_name = 'count' + str(index) df = pd.read_csv(file_path, sep=' ', names=['time', col_name]) if observable not in counts: counts[observable] = df else: # add new column counts[observable][col_name] = df[col_name] return counts def get_bng_observables_counts(file, counts): if not os.path.exists(file): print("Expected file " + file + " not found, skipping it") return with open(file, 'r') as f: first_line = f.readline() header = first_line.split()[1:] df = pd.read_csv(file, delim_whitespace=True, comment='#', names=header) return df def process_nsfim_gdat_file(full_dir, counts): df = get_bng_observables_counts(os.path.join(full_dir, 'test.gdat'), counts) # transform into separate dataframes based on observable for i in range(1, df.shape[1]): observable = df.columns[i] if observable not in counts: col_name = 'count0' # select time and the current observable counts[observable] = pd.DataFrame() counts[observable]['time'] = df.iloc[:, 0] counts[observable][col_name] = df.iloc[:, i] else: col_name = 'count' + str(counts[observable].shape[1] - 1) counts[observable][col_name] = df.iloc[:, i] def get_nfsim_observables_counts(opts): single_bng_run = opts.single_bng_run dir = opts.bng_dir counts = {} if not single_bng_run: nf_dirs = os.listdir(dir) for nf_dir in nf_dirs: full_dir = os.path.join(dir, nf_dir) if not nf_dir.startswith('nf_') or not os.path.isdir(full_dir): continue process_nsfim_gdat_file(full_dir, counts) else: process_nsfim_gdat_file(dir, counts) return counts def main(): opts = process_opts() counts = [] if opts.mcell4_dir: if os.path.exists(opts.mcell4_dir): print("Reading MCell data from " + opts.mcell4_dir) counts.append(get_mcell_observables_counts(opts.mcell4_dir)) else: print("Directory " + opts.mcell4_dir + " with MCell4 data not found, ignored") sys.exit(1) else: counts.append({}) if opts.mcell3_dir: if os.path.exists(opts.mcell3_dir): print("Reading MCell data from " + opts.mcell3_dir) counts.append(get_mcell_observables_counts(opts.mcell3_dir)) else: print("Error: directory " + opts.mcell3_dir + " with MCell3 data not found, ignored") sys.exit(1) else: counts.append({}) # get_nfsim_observables_counts may return an empty dict if opts.bng_dir: if os.path.exists(opts.bng_dir): print("Reading BNG data from " + opts.bng_dir) counts.append(get_nfsim_observables_counts(opts)) else: print("Error: directory " + opts.bng_dir + " with BNG data not found, ignored") sys.exit(1) else: counts.append({}) clrs = ['b', 'g', 'r'] all_observables = set(counts[0].keys()) all_observables = all_observables.union(set(counts[1].keys())) all_observables = all_observables.union(set(counts[2].keys())) for obs in sorted(all_observables): print("Processing observable " + obs) fig,ax = plt.subplots() ax.set_title(obs) legend_names = [] for i in range(len(counts)): if obs not in counts[i]: continue data = counts[i][obs] df = pd.DataFrame() df['time'] = data.iloc[:, 0] df['means'] = data.iloc[:, 1:].mean(axis=1) print(opts.labels[i], df['means']) df['mean_minus_std'] = df['means'] - data.iloc[:, 1:].std(axis=1) df['mean_plus_std'] = df['means'] + data.iloc[:, 1:].std(axis=1) # free collected data to decrease memory consumption del data ax.plot(df['time'], df['means'], label=obs + "1", c=clrs[i]) ax.fill_between( df['time'], df['mean_minus_std'], df['mean_plus_std'], alpha=0.1, facecolor=clrs[i]) legend_names.append(opts.labels[i]) plt.legend(legend_names) plt.xlabel("time [s]") plt.ylabel("N(t)") plt.savefig(obs + '.png', dpi=600) plt.close(fig) if __name__ == '__main__': main()
Python
3D
mcellteam/mcell
utils/plotting/plot_dat_files.py
.py
2,402
77
#!/usr/bin/env python """ This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For more information, please refer to [http://unlicense.org] """ import numpy as np import pandas as pd import matplotlib.pyplot as plt import os import sys import glob def load_dat_files(dat_dir): counts = {} res = pd.DataFrame # read all .dat files dat_files = sorted(glob.glob(os.path.join(dat_dir, "*.dat"))) for file in dat_files: observable = os.path.splitext(os.path.basename(file))[0] df = pd.read_csv(file, sep=' ', index_col='time', names=['time', observable]) # use the first data frame as basis and the join with new observables # to create a single data frame if res.empty: res = df else: res = res.join(df) return res def main(): if len(sys.argv) != 2: sys.exit("Expecting exactly one argument that is the path to directory with .dat files.") # load all .dat files in directory passed as the first argument dat_dir = sys.argv[1] if not os.path.exists(dat_dir): sys.exit("Directory " + dat_dir + " does not exist.") df = load_dat_files(dat_dir) df.plot(kind='line') plt.show() if __name__ == '__main__': main()
Python
3D
mcellteam/mcell
utils/validation/validate.py
.py
3,589
121
#!/usr/bin/env python3 """ This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For more information, please refer to [http://unlicense.org] """ import sys import utils import random import multiprocessing from collections import Counter MAIN_MDL_FILE = 'Scene.main.mdl' # TODO: find automatically, allow to override MCELL_EXECUTABLE = '/home/ahusar/src4_display/mcell/build/release/mcell' g_extra_arg = '' def run_mcell(seed): cmd = [MCELL_EXECUTABLE, '-seed', str(seed), MAIN_MDL_FILE] if g_extra_arg: cmd.append(g_extra_arg) ec = utils.run(cmd, fout_name='mcell_' + str(seed) + '.out') if ec != 0: print("Fatal error, run with seed " + str(seed) + "failed.") sys.exit(1) def get_molecule_counts_from_ascii_file(filename): counts = {} with open(filename, 'r') as fin: for line in fin: # the first item is the ID id = line.split(' ')[0] if id in counts: counts[id] = counts[id] + 1 else: counts[id] = 1 return counts # single threaded execution for now def get_molecule_counts_for_multiple_runs(seeds): counts = {} current_run = 1 #for s in seeds: # print("RUN " + str(current_run) + ", SEED " + str(s)) # current_run += 1 # run_mcell(s) # Set up the parallel task pool to use all available processors count = 12 # multiprocessing.cpu_count() pool = multiprocessing.Pool(processes=count) # Run the jobs pool.map(run_mcell, seeds) for s in seeds: # TODO: find the last .ascii file automatically curr_counts = get_molecule_counts_from_ascii_file('viz_data/seed_' + str(s).zfill(5) + '/Scene.ascii.1000.dat') # add values with common key counts = Counter(counts) + Counter(curr_counts) return counts def generate_seeds(count): res = [] random.seed(a=200) for i in range(0, count): res.append(random.randint(1, 65535)) return res # just one variant for now, but this could grow int oa more versatile tool def main(): nr_runs = 1 if len(sys.argv) >= 2: nr_runs = int(sys.argv[1]) if len(sys.argv) >= 3: global g_extra_arg g_extra_arg = sys.argv[2] seeds = generate_seeds(nr_runs) res = get_molecule_counts_for_multiple_runs(seeds) print(str(res)) if __name__ == "__main__": main()
Python
3D
mcellteam/mcell
utils/validation/avg_react_data.py
.py
2,685
78
#!/usr/bin/env python3 """ This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For more information, please refer to [http://unlicense.org] """ import os import sys def get_last_line_count(file): last_line = '' with open(file, 'r') as f: for line in f: if line: last_line = line return float(last_line.split()[1]) def add_last_line_observables_counts(dir, counts): seed_dir = os.path.join(os.getcwd(), dir) file_list = os.listdir(seed_dir) for file in file_list: file_path = os.path.join(seed_dir, file) if os.path.isfile(file_path) and file.endswith('.dat'): cnt = get_last_line_count(file_path) observable = os.path.splitext(file)[0] if observable.endswith('_MDLString'): observable = observable[:-len('_MDLString')] if observable in counts: counts[observable] += cnt else: counts[observable] = cnt # just one variant for now, but this could grow int oa more versatile tool def main(): # go through all seed_xxx directories in the current directory dir_list = os.listdir(os.getcwd()) num_dirs = 0 counts = {} for dir in dir_list: if os.path.isdir(dir) and dir.startswith('seed_'): add_last_line_observables_counts(dir, counts) num_dirs += 1 for name, count in sorted(counts.items()): print(name.ljust(20) + ': ' + format(float(count)/num_dirs, '.4f')) if __name__ == "__main__": main()
Python
3D
mcellteam/mcell
utils/validation/utils.py
.py
4,153
137
""" This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For more information, please refer to [http://unlicense.org] """ import os import sys import subprocess import shutil from threading import Timer from subprocess import Popen, PIPE def get_cwd_no_link(): # get current working directory even though we are in a symlinked directory # the shell argument must be set to True in this case cwd = Popen(['pwd'], stdout=PIPE, shell=True).communicate()[0].strip() return cwd.decode('ascii') def kill_proc(proc, f, timeout_is_fatal): proc.kill() f.write("Terminated after timeout") if timeout_is_fatal: sys.exit(1) def print_file(file_name): with open(file_name, "r") as fin: for line in fin: print(line) def run_with_ascii_output(cmd, cwd): # does not return exit code, neither provides timeout return Popen(cmd, cwd=cwd, stdout=PIPE).communicate()[0].strip().decode('ascii') def execute(cmd, cwd, timeout_sec, timeout_is_fatal, outfile, shell=False): if shell: # for shell=True, the command must be a single string cmd = str.join(" ", cmd) proc = Popen(cmd, shell=shell, cwd=cwd, stdout=outfile, stderr=subprocess.STDOUT) timer = Timer(timeout_sec, kill_proc, [proc, outfile, timeout_is_fatal]) try: timer.start() exit_code = proc.wait() finally: timer.cancel() return exit_code # can be simplified by using subprocess.run from Python 3.5 def run( cmd, cwd=os.getcwd(), fout_name="", append_path_to_output=False, print_redirected_output=False, timeout_sec=60, timeout_is_fatal = True, verbose=True, shell=False ): if verbose: log(" Executing: '" + str.join(" ", cmd) + "' " + str(cmd) + " in '" + cwd + "'") if fout_name: if append_path_to_output: full_fout_path = os.path.join(cwd, fout_name) else: full_fout_path = fout_name with open(full_fout_path, "w") as f: f.write("cwd: " + cwd + "\n") f.write(str.join(" ", cmd) + "\n") # first item is the command being executed # run the actual command exit_code = execute(cmd, cwd, timeout_sec, timeout_is_fatal, f, shell=shell) if (print_redirected_output): print_file(full_fout_path) else: exit_code = execute(cmd, cwd, timeout_sec, timeout_is_fatal, sys.stdout, shell=shell) if verbose: log("Exit code: " + str(exit_code)) return exit_code def log(msg): print("* " + msg) sys.stdout.flush() def warning(msg): print("* Warning: " + msg) sys.stdout.flush() def fatal_error(msg): print("* Error: " + msg) sys.stdout.flush() sys.exit(1) def check_ec(ec, cmd): if ec != 0: cmd_str = str.join(" ", cmd) fatal_error("Error: command '" + cmd_str + "' failed, terminating.")
Python
3D
mcellteam/mcell
utils/visualize/visualize.sh
.sh
2,468
63
#!/bin/bash # This is free and unencumbered software released into the public domain. # # Anyone is free to copy, modify, publish, use, compile, sell, or # distribute this software, either in source code form or as a compiled # binary, for any purpose, commercial or non-commercial, and by any # means. # # In jurisdictions that recognize copyright laws, the author or authors # of this software dedicate any and all copyright interest in the # software to the public domain. We make this dedication for the benefit # of the public at large and to the detriment of our heirs and # successors. We intend this dedication to be an overt act of # relinquishment in perpetuity of all present and future rights to this # software under copyright law. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. # IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR # OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR # OTHER DEALINGS IN THE SOFTWARE. # # For more information, please refer to [http://unlicense.org] if [ "$MCELL_PATH" == "" ]; then echo "System variable MCELL_PATH is not set, don't know where to find CellBlender" exit 1 fi if [ "$1" == "" ]; then echo "Expecing one argument that is the path to the viz output directory, e.g. viz_data/seed_00001/" exit 1 fi if [ "$(uname)" == "Darwin" ]; then # path on MacOS # /Applications/Blender-2.93-CellBlender/blender.app/Contents/Resources/2.93/scripts/addons/cellblender/extensions/mcell/ REL_BLENDER_PATH=$MCELL_PATH/../../../../../../../../../ else REL_BLENDER_PATH=$MCELL_PATH/../../../../../../ fi # get absolute path to the REL_BLENDER_PATH to deal with links ABS_BLENDER_PATH=`cd $REL_BLENDER_PATH; pwd` if [ "$(uname)" == "Darwin" ]; then VIZ_MCELL_SCRIPT=$ABS_BLENDER_PATH/blender.app/Contents/Resources/2.93/scripts/addons/cellblender/developer_utilities/mol_viz_scripts/viz_mcell_run.py else VIZ_MCELL_SCRIPT=$ABS_BLENDER_PATH/2.93/scripts/addons/cellblender/developer_utilities/mol_viz_scripts/viz_mcell_run.py fi if [ "$(uname)" == "Darwin" -o "$(uname)" == "Linux" ]; then $ABS_BLENDER_PATH/my_blender -P $VIZ_MCELL_SCRIPT -- $1 else # Windows $ABS_BLENDER_PATH/blender.exe -P $VIZ_MCELL_SCRIPT -- $1 fi
Shell
3D
mcellteam/mcell
utils/visualize/visualize.py
.py
3,071
79
# This is free and unencumbered software released into the public domain. # # Anyone is free to copy, modify, publish, use, compile, sell, or # distribute this software, either in source code form or as a compiled # binary, for any purpose, commercial or non-commercial, and by any # means. # # In jurisdictions that recognize copyright laws, the author or authors # of this software dedicate any and all copyright interest in the # software to the public domain. We make this dedication for the benefit # of the public at large and to the detriment of our heirs and # successors. We intend this dedication to be an overt act of # relinquishment in perpetuity of all present and future rights to this # software under copyright law. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. # IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR # OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR # OTHER DEALINGS IN THE SOFTWARE. # # For more information, please refer to [http://unlicense.org] import sys import os import platform import subprocess MCELL_PATH = os.environ.get('MCELL_PATH', '') if MCELL_PATH: lib_path = os.path.join(MCELL_PATH, 'lib') if os.path.exists(os.path.join(lib_path, 'mcell.so')) or \ os.path.exists(os.path.join(lib_path, 'mcell.pyd')): sys.path.append(lib_path) else: print("Error: Python module mcell.so or mcell.pyd was not found in " "directory '" + lib_path + "' constructed from system variable " "MCELL_PATH.") sys.exit(1) else: print("Error: system variable MCELL_PATH that is used to find the mcell " "library was not set.") sys.exit(1) if len(sys.argv) != 2: sys.exit("Expecing one argument that is the path to the viz output directory, e.g. viz_data/seed_00001/") REL_BLENDER_PATH = None if platform.system() == 'Darwin': REL_BLENDER_PATH = os.path.join(MCELL_PATH, '..', '..', '..', '..', '..', '..', '..', '..', '..') else: REL_BLENDER_PATH = os.path.join(MCELL_PATH, '..', '..', '..', '..', '..', '..') ABS_BLENDER_PATH = os.path.abspath(REL_BLENDER_PATH) if platform.system() == 'Darwin': VIZ_MCELL_SCRIPT = \ os.path.join(ABS_BLENDER_PATH, 'blender.app', 'Contents', 'Resources', '2.93', 'scripts', 'addons', 'cellblender', 'developer_utilities', 'mol_viz_scripts', 'viz_mcell_run.py') else: VIZ_MCELL_SCRIPT = \ os.path.join(ABS_BLENDER_PATH, '2.93', 'scripts', 'addons', 'cellblender', 'developer_utilities', 'mol_viz_scripts', 'viz_mcell_run.py') if 'Windows' in platform.system(): CMD = os.path.join(ABS_BLENDER_PATH, 'blender.exe') else: CMD = 'bash ' + os.path.join(ABS_BLENDER_PATH, 'my_blender') CMD += ' -P ' + VIZ_MCELL_SCRIPT + ' -- ' + sys.argv[1] subprocess.run(CMD, shell=True)
Python
3D
mcellteam/mcell
utils/react_data_analyzer/reac_data_analyzer.py
.py
3,780
106
#!/usr/bin/env python """ This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For more information, please refer to [http://unlicense.org] """ import numpy as np import pandas as pd import matplotlib.pyplot as plt import os import sys from itertools import count # for now a simple scripts that prints averages of last n values of react_data files # usage: # python3 reac_data_analyzer.py N # - N is the number of the last observable counts from react_data outputs that will be averaged # # function collectreturns def get_last_observable_counts(num_last_samples_to_avg=1): counts = {} num_seeds = 0 seed_dirs = os.listdir() # go through all seed_* directories for seed_dir in seed_dirs: if not seed_dir.startswith('seed_'): continue # we need the total number of directories to compute an average later num_seeds += 1 # go through all *.dat files in the seed directory file_list = os.listdir(seed_dir) for file in file_list: file_path = os.path.join(seed_dir, file) # we care only about .dat files if os.path.isfile(file_path) and file.endswith('.dat'): print("Processing " + file_path) observable = os.path.splitext(file)[0] if observable.endswith('_MDLString'): observable = observable[:-len('_MDLString')] # read the .dat file into a pandas dataframe df = pd.read_csv(file_path, sep=' ', names=['time', 'count']) #print(df.tail(num_last_samples_to_avg)['count'].mean()) #print("From " + observable) #sys.exit() # get average of the last N items avg_cnt = df.tail(num_last_samples_to_avg)['count'].mean() # and accumulate the observable count if observable in counts: counts[observable] += avg_cnt else: counts[observable] = avg_cnt # compute average of the sums of averages we computed above res = {} for v,c in sorted(counts.items()): res[v] = c / num_seeds return res # process argument num_last_samples_to_avg = 1 if len(sys.argv) == 2: num_last_samples_to_avg = int(sys.argv[1]) # read all *.dat files in the current directory and return a # dictionary observable -> average count avg_counts = get_last_observable_counts(num_last_samples_to_avg) for v,c in sorted(avg_counts.items()): print(v + ": " + str(c))
Python
3D
mcellteam/mcell
utils/bng_analyzer_py/bng_analysis_example.py
.py
2,820
88
""" This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For more information, please refer to [http://unlicense.org] """ import sys import os import pandas as pd MCELL_PATH = os.environ.get('MCELL_PATH', '') if MCELL_PATH: sys.path.append(os.path.join(MCELL_PATH, 'lib')) else: print("Error: variable MCELL_PATH that is used to find the mcell library was not set.") sys.exit(1) import mcell as m # utility module to load ASCII viz_output .dat file from import viz_reader # arbitrary values are used here WEIGHTS = { 'ampar_tarp': 1.5, 'psd95': 2.5, 'syngap': 3.5, } def analyze_dat_file(file_name): # read the .dat file and parse complexes to the internal MCell # representation complex_counts = viz_reader.read_dat_file(file_name) #print(complex_counts[0][0]) #print(complex_counts[0][1]) # process the read data for (complex, count) in complex_counts: weight = 0.0 # iterate over elementary molecules from which the # complex is composed for mi in complex.elementary_molecules: name = mi.elementary_molecule_type.name if name not in WEIGHTS: print("Error: unknown molecular weight of " + name) sys.exit(1) weight += WEIGHTS[name] print("----------------------------------") print(complex.to_bngl_str()) print("") print("weight: " + str(weight) + ", copy nr.: " + str(count)) if __name__ == '__main__': if len(sys.argv) != 2: print("Expected .dat file name as argument") sys.exit(1) analyze_dat_file(sys.argv[1])
Python
3D
mcellteam/mcell
utils/bng_analyzer_py/viz_reader.py
.py
2,989
81
""" This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For more information, please refer to [http://unlicense.org] """ import sys import os import pandas as pd MCELL_PATH = os.environ.get('MCELL_PATH', '') if MCELL_PATH: sys.path.append(os.path.join(MCELL_PATH, 'lib')) else: print("Error: variable MCELL_PATH that is used to find the mcell library was not set.") sys.exit(1) import mcell as m def load_counts_from_dat_file(file_name): # using pandas read_cvs because it is usually faster # we could also read the file line by line and count the number of occurences df = pd.read_csv( file_name, sep=' ', names=['name', 'id', 'x', 'y', 'z', 'nx', 'ny', 'nz']) # create a dataframe with counts per unique species counts = df['name'].value_counts().rename_axis('species').reset_index(name='count') # need to sort the data to get consistent results counts = counts.sort_values(['count','species'], ascending=(False, True)) return counts def parse_bngl_strings_to_complex_representations(counts_df): # returns a list of pairs (mcell.Complex, int), the second item is count res = [] for index, row in counts_df.iterrows(): # constructor m.Complex parses the BNGL representaion into # a MCell4 API representation # (see https://cnl.salk.edu/~ahusar/mcell4_documentation/generated/subsystem.html#complex cplx = m.Complex(row['species']) res.append((cplx, row['count'])) return res def read_dat_file(file_name): # returns a list of pairs (mcell.Complex, int), the second item is count # load the .dat file as a pandas dataframe counts_df = load_counts_from_dat_file(file_name) # parse the BNGL representations complex_counts = parse_bngl_strings_to_complex_representations(counts_df) return complex_counts
Python
3D
mcellteam/mcell
utils/bngl/generate_bngl_function.py
.py
2,557
73
""" This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For more information, please refer to [http://unlicense.org] """ import sys import pandas as pd import numpy as np # set this to change the precision of the values printed, it must be a string DIGITS = '6' def write_bngl_function(input_fname, param): # load the input file, make sure that the values are floats df = pd.read_csv( input_fname, delim_whitespace=True, comment='#', names=['time', 'value'], dtype={'time':np.float64, 'value':np.float64}) #print(df['time']) #print(df['value']) if df['time'][0] != 0: print("First time must be 0") sys.exit(1) ind = " " for i in range(1, len(df)): print( ind + "(if((" + param + "<" + str.format('{0:.' + DIGITS + '}', df['time'][i]) + "), " + "(" + str.format('{0:.' + DIGITS + '}', df['value'][i - 1]) + "), \\") # last value print(ind + " (" + str.format('{0:.' + DIGITS + '}', df['value'].iloc[-1]) + ") \\") print(ind, end='') for i in range(1, len(df)): print("))", end = '') print() def main(): if len(sys.argv) != 3: print("Expecting input file as 1st argument and input variable name (usually time) as 2nd argument") sys.exit(1) write_bngl_function(sys.argv[1], sys.argv[2]) if __name__ == "__main__": main()
Python
3D
mcellteam/mcell
utils/blender_debug_scripts/dyn_vertex_check.py
.py
2,626
94
""" This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For more information, please refer to [http://unlicense.org] """ # Bring in Blender's Python API import bpy def add_mesh(verts, faces, name): mesh = bpy.data.meshes.new(name) mesh.from_pydata(verts, [], faces) mesh.update() obj = bpy.data.objects.new("Obj_" + name, mesh) scene = bpy.context.scene scene.objects.link(obj) return obj def add_point(pos, name): point_to_triangle = [ # insert position of the molecule here pos, ( pos[0], pos[1] + 0.01, pos[2] + 10), ( pos[0], pos[1] + 0.01, pos[2] - 0.01), ] point_faces = [ (0, 1, 2) ] pt = bpy.data.meshes.new("molecule") pt.from_pydata(point_to_triangle, [], point_faces) pt.update() obj = bpy.data.objects.new("Obj_" + name, pt) scene = bpy.context.scene scene.objects.link(obj) return obj # add generated code below mesh_verts = [ (0, 0, 2), #0 (-1, -2, -1), #1 (2, 0, -1), #2 (0, 0, 1), #3 (-1, -2, -1), #4 (2, 0, -1), #5 ] mesh_faces = [ (0, 1, 2, ), (3, 4, 5, ), (0, 1, 3, ), (3, 1, 4, ), (1, 2, 4, ), (4, 2, 5, ), (2, 0, 5, ), (5, 0, 3, ), ] add_mesh(mesh_verts, mesh_faces, "my_mesh") mol0 = (0.583606, 0.255219, 0.63674) add_point(mol0, "molecule0") mol1 = (0.413867, 0.175317, -0.334765) add_point(mol1, "molecule1") mol2 = (0.195182, -0.446152, 0.66672) add_point(mol2, "molecule2") mol3 = (-0.47739, 0.532683, -0.000138335) add_point(mol3, "molecule3")
Python
3D
mcellteam/mcell
utils/data_model_to_constants/datamodel_to_constants.py
.py
997
40
#!/usr/bin/env python3 """ Auxiliary script to generate constant definitiosn from a JSON FILE """ import json import sys def process(json_object, keys, values): if type(json_object) == dict: for key, value in json_object.items(): keys.append(key) process(value, keys, values) elif type(json_object) == list: for v in json_object: process(v, keys, values) else: values.append(str(json_object)) def print_as_const(lst, prefix): for s in lst: if not s.isidentifier(): continue print("const char* const " + prefix + s.upper() + " = \"" + s + "\";") if __name__ == '__main__': with open(sys.argv[1], "r") as f: json_object = json.load(f) # using list so that we get related keys and values close to each other keys = [] values = [] process(json_object, keys, values) print_as_const(keys, "KEY_") print_as_const(values, "VALUE_")
Python
3D
mcellteam/mcell
utils/mcell4_runner/mcell3_runner.py
.py
3,857
127
#!/usr/bin/env python """ This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For more information, please refer to [http://unlicense.org] """ import os import sys import shutil import glob import pathlib import argparse import itertools import multiprocessing import re import subprocess from mcell4_runner import * def run_mcell3(args_str_w_opts): args_str = args_str_w_opts[0] opts = args_str_w_opts[1] if os.name == 'nt': ext = '.exe' else: ext = '' mcell_path = os.environ.get('MCELL_PATH', '') cmd_str = os.path.join(mcell_path, 'mcell' + ext) + ' ' + opts.main_model_file + ' ' cmd_str += args_str print("Running " + cmd_str) args_log = args_str.replace(' ', '_').replace('-', '_').replace('\\', '_').replace('/', '_') log_name = os.path.join(LOGS_DIR, os.path.splitext(opts.main_model_file)[0] + '_' + args_log + '.mcell3.log') exit_code = 1 with open(log_name, "w") as f: proc = subprocess.Popen(cmd_str, shell=True, cwd=os.getcwd(), stdout=f, stderr=subprocess.STDOUT) proc.communicate() exit_code = proc.returncode with open(log_name, "a") as f: f.write("DIR:" + os.getcwd() + "\n") f.write("CMD:" + cmd_str + "\n") if exit_code != 0: print("MCell3 failed, see '" + os.path.join(os.getcwd(), log_name) + "'.") return exit_code else: return 0 def run_mcell3_parallel(opts, args): # set up the parallel task pool to use all available processors ot the # maximum specified if opts.max_cores: cpu_count = int(opts.max_cores) else: cpu_count = multiprocessing.cpu_count() # create logs directory if not os.path.exists(LOGS_DIR): os.mkdir(LOGS_DIR) # run the jobs pool = multiprocessing.Pool(processes=cpu_count) args_str_w_opts = zip(args, itertools.repeat(opts)) res_codes = pool.map(run_mcell3, args_str_w_opts, 1) num_total = 0 num_failed = 0 for i in range(len(res_codes)): c = res_codes[i] if c != 0: print("MCell run with args '" + args[i] + "' failed with exit code " + str(c) + ".") num_failed += 1 num_total += 1 if num_failed == 0: print("Finished, all runs passed.") return 0 else: print("Finished with errors, " + str(num_failed) + "/" + str(num_total) + " runs failed.") return 1 if __name__ == '__main__': file_markers_start() check_prerequisites() opts = process_opts('MCell3') args = prepare_args(opts) exit_code = run_mcell3_parallel(opts, args) file_markers_finish() sys.exit(exit_code)
Python
3D
mcellteam/mcell
utils/mcell4_runner/bng_runner.py
.py
7,230
225
#!/usr/bin/env python """ This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For more information, please refer to [http://unlicense.org] """ import os import sys import shutil import glob import pathlib import argparse import itertools import multiprocessing import re import subprocess from mcell4_runner import file_markers_start, file_markers_finish, generate_seeds TEST_BNGL = 'test.bngl' class Options: def __init__(self): self.seeds_str = None self.bng2pl_path = None self.max_cores = None self.main_model_file = None def create_argparse(): parser = argparse.ArgumentParser(description='MCell4 Runner') parser.add_argument( '-s', '--seeds', type=str, help='seeds in the form first:last:step, e.g. 1:100:2 will use seeds 1 through 100 in steps of 2, ' 'model must accept "-seed N" argument, ' 'the output directories are different for different seeds, ODE model ignores this argument') parser.add_argument('-j', '--max-cores', type=int, help='sets maximum number of cores for running, default is all if -j is not used') parser.add_argument('-b', '--bng2pl', type=str, help='sets path to BNG2.pl') parser.add_argument('main_model_file', help='sets path to the BNGL model') return parser def process_opts(): parser = create_argparse() args = parser.parse_args() opts = Options() if args.seeds: opts.seeds_str = args.seeds else: print("Error: argument -s/--seeds must be specified.") sys.exit(1) if args.bng2pl: if os.path.exists(args.bng2pl): opts.bng2pl_path = args.bng2pl else: print("Error: file " + args.bng2pl + " does not exist.") sys.exit(1) else: print("Error: argument -b/--bng2pl must be specified.") sys.exit(1) if args.max_cores: opts.max_cores = args.max_cores if args.main_model_file: if os.path.exists(args.main_model_file): opts.main_model_file = args.main_model_file else: print("Error: file " + args.main_model_file + " does not exist.") sys.exit(1) else: print("Error: main model file must be specified as a positional argument.") sys.exit(1) return opts def run_bng(abs_dir, opts): os.chdir(abs_dir) cmd_str = 'perl ' + opts.bng2pl_path + ' ' + TEST_BNGL print("Running " + cmd_str + " in " + abs_dir) log_name = opts.main_model_file + '_' + os.path.basename(abs_dir) + '.bng2pl.log' exit_code = 1 with open(log_name, "w") as f: proc = subprocess.Popen(cmd_str, shell=True, cwd=os.getcwd(), stdout=f, stderr=subprocess.STDOUT) proc.communicate() exit_code = proc.returncode with open(log_name, "a") as f: f.write("DIR:" + os.getcwd() + "\n") f.write("CMD:" + cmd_str + "\n") if exit_code != 0: print("BNG2.pl failed, see '" + os.path.join(os.getcwd(), log_name) + "'.") return exit_code else: return 0 def find_in_file(fname, search_for): lines = [] with open(fname, "r") as infile: for line in infile: if search_for in line: return line return '' def replace_in_file(fname, search_for, replace_with): lines = [] with open(fname, "r") as infile: for line in infile: line = line.replace(search_for, replace_with) lines.append(line) with open(fname, "w") as outfile: for line in lines: outfile.write(line) def run_bng_parallel(opts, seeds): # nfsim or ode? # does not handle comments line_nf = find_in_file(opts.main_model_file, 'method=>"nf"') line_ssa = find_in_file(opts.main_model_file, 'method=>"ssa"') if not line_nf and not line_ssa: # ODE dir = os.path.join('bng', 'ode') os.makedirs(dir) shutil.copy(TEST_BNGL, dir) run_bng(dir, opts) else: # NFSim - multiple runs are needed cwd = os.getcwd() dirs = [] for s in seeds: dir = os.path.join('bng', 'nf_' + str(s).zfill(5)) if not os.path.exists(dir): os.makedirs(dir) shutil.copy(opts.main_model_file, os.path.join(dir, TEST_BNGL)) # copy also all other .bngl files from the main file's directory files = glob.iglob(os.path.join(os.path.dirname(opts.main_model_file), "*.bngl")) for file in files: if file != opts.main_model_file and os.path.isfile(file): shutil.copy2(file, dir) # update seed value replace_in_file(os.path.join(dir, TEST_BNGL), 'seed=>1', 'seed=>' + str(s)) dirs.append(os.path.join(cwd, dir)) if opts.max_cores: # maximum number of processes specified cpu_count = int(opts.max_cores) else: cpu_count = multiprocessing.cpu_count() pool = multiprocessing.Pool(processes=cpu_count) # run in parallel res_codes = pool.starmap(run_bng, zip(dirs, itertools.repeat(opts)), 1) num_total = 0 num_failed = 0 for i in range(len(res_codes)): c = res_codes[i] if c != 0: print("BNG run with seed '" + str(seeds[i]) + "' failed with exit code " + str(c) + ".") num_failed += 1 if num_failed == 0: print("Finished, all runs passed.") return 0 else: print("Finished with errors, " + str(num_failed) + "/" + str(num_total) + " runs failed.") return 1 if __name__ == '__main__': file_markers_start() opts = process_opts() seeds = generate_seeds(opts.seeds_str) exit_code = run_bng_parallel(opts, seeds) file_markers_finish() sys.exit(exit_code)
Python
3D
mcellteam/mcell
utils/mcell4_runner/mcell4_runner.py
.py
8,603
270
#!/usr/bin/env python """ This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For more information, please refer to [http://unlicense.org] """ import os import sys import shutil import glob import argparse import itertools import multiprocessing import re import subprocess MCELL_PATH = '' RUNNING_MARKER = 'running.marker' FINISHED_MARKER = 'finished.marker' LOGS_DIR = 'logs' class Options: def __init__(self): self.seeds_str = None self.extra_arg = '' self.args_file = None self.max_cores = None self.main_model_file = None def create_argparse(name): parser = argparse.ArgumentParser(description=name + ' Runner') parser.add_argument( '-s', '--seeds', type=str, help='seeds in the form first:last:step, e.g. 1:100:2 will use seeds 1 through 100 in steps of 2, ' 'model must accept "-seed N" argument, ' 'model must make sure that the output directories are different for different seeds, ' 'can be used with argument -x') parser.add_argument( '-x', '--extra-arg', type=str, help='optional extra argument to be passed when -s is used') parser.add_argument( '-a', '--args-file', type=str, help='arguments file where each line contains arguments passed to the main model file, ' 'model must make sure that the output directories are different for different arguments') parser.add_argument('-j', '--max-cores', type=int, help='sets maximum number of cores for running, default is all if -j is not used') parser.add_argument('main_model_file', help='sets path to the MCell4 model') return parser def process_opts(name = 'MCell4'): parser = create_argparse(name) args = parser.parse_args() opts = Options() if args.seeds and args.args_file: sys.exit("Error: only one argument -s/--seeds or -a/--args-file must be specified, not both.") if not args.seeds and not args.args_file: sys.exit("Error: one of arguments -s/--seeds or -a/--args-file must be specified.") if args.seeds: opts.seeds_str = args.seeds if args.extra_arg: opts.extra_arg = args.extra_arg if args.args_file: if os.path.exists(args.args_file): opts.args_file = args.args_file else: sys.exit("Error: file " + args.args_file + " does not exist.") if args.extra_arg: sys.exit("Error: argument -x/-extra-args cannot be used with -a/--args-file.") if args.max_cores: opts.max_cores = args.max_cores if args.main_model_file: if os.path.exists(args.main_model_file): opts.main_model_file = args.main_model_file else: sys.exit("Error: file " + args.main_model_file + " does not exist.") else: sys.exit("Error: main model file must be specified as a positional argument.") return opts def check_prerequisites(): global MCELL_PATH MCELL_PATH = os.environ.get('MCELL_PATH', '') if MCELL_PATH: sys.path.append(os.path.join(MCELL_PATH, 'lib')) else: sys.exit("Error: system variable MCELL_PATH that is used to find the mcell library was not set.") if os.name == 'nt': ext = '.pyd' else: ext = '.so' mcell_so_path = os.path.join(MCELL_PATH, 'lib', 'mcell' + ext) if not os.path.exists(mcell_so_path): sys.exit("Could not find library '" + mcell_so_path + ".") def generate_seeds(seeds_str): seeds_info = seeds_str.split(':') if len(seeds_info) != 3 or \ not seeds_info[0].isdigit() or \ not seeds_info[1].isdigit() or \ not seeds_info[2].isdigit(): sys.exit("Error: invalid seed string, must be in for form min:max:step, given '" + seeds_str + "'.") res = [] for i in range(int(seeds_info[0]), int(seeds_info[1]) + 1, int(seeds_info[2])): res.append(i) return res def prepare_args(opts): if opts.seeds_str: seeds = generate_seeds(opts.seeds_str) return ['-seed ' + str(i) + ' ' + opts.extra_arg for i in seeds ] elif opts.args_file: res = [] with open(opts.args_file, 'r') as f: for line in f: if not line.isspace(): if line.endswith('\n'): res.append(line[:-1]) else: res.append(line[:-1]) return res def run_mcell4(args_str_w_opts): args_str = args_str_w_opts[0] opts = args_str_w_opts[1] cmd_str = sys.executable + ' ' + opts.main_model_file + ' ' cmd_str += args_str print("Running " + cmd_str) args_log = args_str.replace(' ', '_').replace('-', '_').replace('\\', '_').replace('/', '_') log_name = os.path.join( LOGS_DIR, os.path.splitext(os.path.basename(opts.main_model_file))[0] + '_' + args_log + '.mcell4.log') with open(log_name, "w") as f: f.write("DIR:" + os.getcwd() + "\n") f.write("CMD:" + cmd_str + "\n") exit_code = 1 with open(log_name, "a") as f: proc = subprocess.Popen(cmd_str, shell=True, cwd=os.getcwd(), stdout=f, stderr=subprocess.STDOUT) proc.communicate() exit_code = proc.returncode if exit_code != 0: print("MCell4 failed, see '" + os.path.join(os.getcwd(), log_name) + "'.") return exit_code else: return 0 def run_mcell4_parallel(opts, args): # set up the parallel task pool to use all available processors ot the # maximum specified if opts.max_cores: cpu_count = int(opts.max_cores) else: cpu_count = multiprocessing.cpu_count() # create logs directory if not os.path.exists(LOGS_DIR): os.mkdir(LOGS_DIR) # run the jobs pool = multiprocessing.Pool(processes=cpu_count) args_str_w_opts = zip(args, itertools.repeat(opts)) res_codes = pool.map(run_mcell4, args_str_w_opts, 1) num_total = 0 num_failed = 0 for i in range(len(res_codes)): c = res_codes[i] if c != 0: print("MCell run with args '" + args[i] + "' failed with exit code " + str(c) + ".") num_failed += 1 num_total += 1 if num_failed == 0: print("Finished, all runs passed.") return 0 else: print("Finished with errors, " + str(num_failed) + "/" + str(num_total) + " runs failed.") return 1 def my_touch(fname): # emulates 'touch', pathlib.Path(FINISHED_MARKER).touch() may not be available try: if os.path.exists(fname): os.utime(fname, None) else: open(fname, 'a').close() except: print("Warning: could not 'touch' file " + fname + ".") def file_markers_start(): if (os.path.exists(FINISHED_MARKER)): os.remove(FINISHED_MARKER) my_touch(RUNNING_MARKER) def file_markers_finish(): if (os.path.exists(RUNNING_MARKER)): os.remove(RUNNING_MARKER) my_touch(FINISHED_MARKER) if __name__ == '__main__': file_markers_start() check_prerequisites() opts = process_opts() args = prepare_args(opts) exit_code = run_mcell4_parallel(opts, args) file_markers_finish() sys.exit(exit_code)
Python
3D
mcellteam/mcell
utils/mcell4_runner/run_remotely.sh
.sh
873
34
#!/bin/bash # Example: # first 'cd' to the directory with your model then run: # run_remotely.sh $USER@<machine>:/home/$USER/tmp/my_model <path to mcell4_runner>/mcell4_runner.py . "model.py -s 1:10:1" USAGE=\ "$1 - remote machine with user and working directory e.g. user@a.server.com:/home/user/tmp\n"\ "$2 - local path to mcell4_runner.py script (including the script name)\n"\ "$3 - directory with model\n"\ "$4 - arguments for mcell4_runner.py script (enclosed in quotes)\n" if [ "$#" != "4" ]; then echo "Error: expected 4 arguments:\n $USAGE" exit 1 fi DST=$1 RUNNER_PY=$2 SRC=$3 ARGS=$4 # copy model directory rsync --delete -arv $SRC $DST || exit 1 # copy script rsync --delete -arv $2 $DST || exit 1 URL=`echo $DST | cut -d: -f1` DIR=`echo $DST | cut -d: -f2` CMD="conda activate py35; cd $DIR; nohup python mcell4_runner.py $4" ssh $URL $CMD
Shell
3D
mcellteam/mcell
utils/bng_species_reader_py/species_reader.py
.py
2,225
59
""" This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For more information, please refer to [http://unlicense.org] """ import sys import os import pandas as pd MCELL_PATH = os.environ.get('MCELL_PATH', '') if MCELL_PATH: sys.path.append(os.path.join(MCELL_PATH, 'lib')) else: print("Error: variable MCELL_PATH that is used to find the mcell library was not set.") sys.exit(1) import mcell as m def read_species_file(file_name): # load the .species file as a list of pairs (mcell.Complex, int), the second item is count res = [] with open(file_name, 'r') as f: for line in f: if not line.strip(): continue items = line.split() assert len(items) == 2, "Invalid input file contents " + line # constructor m.Complex parses the BNGL representaion into # a MCell4 API representation # (see https://cnl.salk.edu/~ahusar/mcell4_documentation/generated/subsystem.html#complex cplx = m.Complex(items[0]) res.append((cplx, str(items[1]))) return res
Python
3D
mcellteam/mcell
utils/bng_species_reader_py/bng_species_reader_example.py
.py
5,253
141
""" This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For more information, please refer to [http://unlicense.org] """ import sys import os import pandas as pd MCELL_PATH = os.environ.get('MCELL_PATH', '') if MCELL_PATH: sys.path.append(os.path.join(MCELL_PATH, 'lib')) else: print("Error: variable MCELL_PATH that is used to find the mcell library was not set.") sys.exit(1) import mcell as m # utility module to load ASCII viz_output .dat file from import species_reader def get_bound_em(complex, src_em, comp_name): # assuming that there is a single component in src_em # (source elementary molecule) with comp_name that is bound bond_index = -1 for c in src_em.components: if c.component_type.name == comp_name: # not allowed cases, we need the number assert c.bond != m.BOND_UNBOUND # no bond assert c.bond != m.BOND_ANY # !? assert c.bond != m.BOND_BOUND # !+ bond_index = c.bond assert bond_index != -1, "Did not find " + comp_name + " in " + src_em.to_bngl_str() # find this bond in the complex (might be slow) for em in complex.elementary_molecules: if em is src_em: continue for c in em.components: if c.bond == bond_index: return em assert False, "Did not find paired bond " + str(bond_index) + " in " + complex.to_bngl_str() def convert_species_file(file_name): # read the .species file and parse complexes to the internal MCell # representation complex_counts = species_reader.read_species_file(file_name) # prepare the component type that we will append to the CaMKII molecules # the new component means 'upper' and has a boolean state ct_u = m.ComponentType('u', ['0','1']) # process the data by adding component 'u' to the CaMKII elementary molecules for (complex, count) in complex_counts: # if this a CaMKII dodecamer? camkiis = [] for em in complex.elementary_molecules: em_name = em.elementary_molecule_type.name if em_name == 'CaMKII': camkiis.append(em) if len(camkiis) != 12: # output it directly print(complex.to_bngl_str() + " " + str(count)) continue # ok, we have the holoenzyme, how can we figure out which # of the CaMKIIs belong to the upper and the lower # ring? # let's say that the first one is in the upper ring, # go along the 'r' upper_first = camkiis[0] upper_ring = [ upper_first ] curr = upper_first for i in range(1, 6): curr = get_bound_em(complex, curr, 'r') upper_ring.append(curr) assert upper_first is get_bound_em(complex, curr, 'r'), "A ring must be formed" # then go down along 'c' and go again along 'r' to get molecules of the lower ring lower_first = get_bound_em(complex, camkiis[0], 'c') lower_ring = [ lower_first ] curr = lower_first for i in range(1, 6): curr = get_bound_em(complex, curr, 'r') lower_ring.append(curr) assert lower_first is get_bound_em(complex, curr, 'r'), "A ring must be formed" # now the modifications - add components by instatiating the component type 'u' # the way how the complexes were is parsed was that each complex has its own instance # of the elementary molecule type for CaMKII so lets change one of them upper_first.elementary_molecule_type.components.append(ct_u) for em in upper_ring: em.components.append(ct_u.inst('1')) for em in lower_ring: em.components.append(ct_u.inst('0')) print(complex.to_bngl_str() + " " + str(count)) if __name__ == '__main__': if len(sys.argv) != 2: print("Expected .species file name as argument") sys.exit(1) convert_species_file(sys.argv[1])
Python
3D
mcellteam/mcell
utils/bng_analyzer/nfsim_species_unifier.h
.h
1,010
38
/****************************************************************************** * * Copyright (C) 2020 by * The Salk Institute for Biological Studies * * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. * ******************************************************************************/ #ifndef UTILS_BNG_ANALYZER_NFSIM_SPECIES_UNIFIER_H_ #define UTILS_BNG_ANALYZER_NFSIM_SPECIES_UNIFIER_H_ #include <string> #include <map> #include "bng/bng.h" namespace MCell { class NFSimSpeciesUnifier { public: NFSimSpeciesUnifier() : bng_engine(bng_config) { } bool read_input_file(const std::string& input_file, const bool is_dat); bool print_unified_species(const std::string& out_file = ""); std::map<BNG::species_id_t, double> counts_per_unique_species; BNG::BNGConfig bng_config; BNG::BNGEngine bng_engine; }; } // namespace MCell #endif /* UTILS_BNG_ANALYZER_NFSIM_SPECIES_UNIFIER_H_ */
Unknown
3D
mcellteam/mcell
utils/bng_analyzer/nfsim_species_unifier.cpp
.cpp
3,438
136
/****************************************************************************** * * Copyright (C) 2020 by * The Salk Institute for Biological Studies * * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. * ******************************************************************************/ #include "nfsim_species_unifier.h" #include <iostream> #include <fstream> using namespace std; extern int bngldebug; namespace MCell { bool NFSimSpeciesUnifier::read_input_file(const std::string& input_file, const bool is_dat) { //bngldebug = 1; ifstream ifs; ifs.open(input_file, ifstream::in); if (!ifs.is_open()) { cerr << "Could not open input file " << input_file << ".\n"; return false; } string line; uint linenr = 0; while (getline(ifs, line)) { linenr++; if (line.empty()) { continue; } if (line[0] == '#') { // comment continue; } // expecting that each line will be in this form: // NFSim Species: // BNGL_COMPLEX count // .dat (MCell viz output) // BNGL_COMPLEX position normal size_t cplx_end = line.find(' '); if (cplx_end == string::npos) { cerr << "Did not find a separator ' ' on line " << linenr << ".\n"; return false; } string cplx_string = line.substr(0, cplx_end); string count_string; if (!is_dat) { count_string = line.substr(cplx_end); } else { count_string = "1"; // each line in .dat files is one instance } // parse cplx string BNG::Cplx cplx_inst(&bng_engine.get_data()); int num_errors = BNG::parse_single_cplx_string( cplx_string, bng_engine.get_data(), cplx_inst ); if (num_errors != 0) { cerr << "Could not parse complex instance '" << cplx_string << "' on line " << linenr << ".\n"; ifs.close(); return false; } assert(!cplx_inst.elem_mols.empty()); // see what species it is BNG::Species new_species = BNG::Species(cplx_inst, bng_engine.get_data(), bng_engine.get_config(), false); BNG::species_id_t id = bng_engine.get_all_species().find_or_add(new_species); // convert count double count; try { count = stod(count_string); } catch (const std::invalid_argument& ia) { cerr << "Could not convert count '" << count_string << "' on line " << linenr << ".\n"; ifs.close(); return false; } // remember this count auto it = counts_per_unique_species.find(id); if (it == counts_per_unique_species.end()) { counts_per_unique_species[id] = count; } else { counts_per_unique_species[id] += count; } } return true; } // out_file may be an empty string, in this case the output is printed to bool NFSimSpeciesUnifier::print_unified_species(const std::string& out_file) { ostream* out; ofstream ofile; if (out_file != "") { ofile.open(out_file, ofstream::out); if (!ofile.is_open()) { cerr << "Could not open output file " << out_file << ".\n"; return false; } out = &ofile; } else { out = &cout; } for (auto it: counts_per_unique_species) { BNG::Species& s = bng_engine.get_all_species().get(it.first); *out << s.to_str() << " " << it.second << "\n"; } if (out_file != "") { ofile.close(); } return true; } } // namespace MCell
C++
3D
mcellteam/mcell
utils/bng_analyzer/bng_analyzer.cpp
.cpp
3,059
134
/****************************************************************************** * * Copyright (C) 2020 by * The Salk Institute for Biological Studies * * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. * ******************************************************************************/ #include <iostream> #include <cassert> #include <string> #ifndef _MSC_VER #include <getopt.h> #else #include "win_getopt/win_getopt.h" #endif #include "nfsim_species_unifier.h" using namespace std; /* Command-line arguments structure: * long arg name * has argument * pointer to flag (should always be 0) * short argument letter */ static const option long_options[] = { { "help", 0, 0, 'h' }, { "version", 0, 0, 'v' }, { "dat", 0, 0, 'd' }, { "output", 1, 0, 'o' }, { nullptr, 0, 0, 0 } }; void print_usage(const char* argv0) { cout << " [-d] INPUT_FILE [-o OUTPUT_FILE]\n" " -d Optional argument that specifies that the input is a .dat ascii file \n" " for MCell visualization, NFSim .species file otherwise\n"; } void print_version(const char* argv0) { cout << "TODO\n"; } const int ARG_PARSE_ERROR = 1; const int ARG_PARSE_QUIT = 0; const int ARG_PARSE_OK = -1; // returns ARG_PARSE_OK if execution should continue // ARG_PARSE_END to end with exit code 0, // ARG_PARSE_ERROR to end with exit code 1, int process_args( const int argc, char* argv[], string& input_file, string& output_file, bool& is_dat ) { input_file = ""; output_file = ""; is_dat = false; assert(argc > 0); while (1) { // get the next argument int c = getopt_long_only(argc, argv, "hvo:", long_options, nullptr); if (c == -1) break; switch (c) { case 'h': print_usage(argv[0]); return ARG_PARSE_QUIT; case 'v': print_version(argv[0]); return ARG_PARSE_QUIT; case 'o': output_file = optarg; break; case 'd': is_dat = true; break; default: cerr << "Invalid arguments.\n"; return ARG_PARSE_ERROR; } } if (optind < argc) { if (argc - optind > 1) { cerr << "Only one input file can be specified.\n"; return ARG_PARSE_ERROR; } input_file = argv[optind]; } else { cerr << "Input file was not specified.\n"; return ARG_PARSE_ERROR; } return ARG_PARSE_OK; } int main(const int argc, char* argv[]) { string input_file; string output_file; bool is_dat; int arg_process_res = process_args(argc, argv, input_file, output_file, is_dat); if (arg_process_res != ARG_PARSE_OK) { return arg_process_res; } MCell::NFSimSpeciesUnifier nfsim_unifier; bool ok; ok = nfsim_unifier.read_input_file(input_file, is_dat); if (!ok) { cerr << "There was an error while reading " << input_file << ".\n"; return 1; } ok = nfsim_unifier.print_unified_species(output_file); return ok ? 0 : 1; }
C++
3D
mcellteam/mcell
utils/pybind11_build_example/import_mcell.py
.py
95
7
import sys sys.path.append("build") print("before import") import mcell print("after import")
Python
3D
mcellteam/mcell
utils/pybind11_build_example/test.cpp
.cpp
2,632
88
#define _hypot hypot #include <cmath> #include <pybind11/pybind11.h> #include <string> #include <vector> namespace py = pybind11; int add(int i, int j) { return i + j; } enum class Orientation { DOWN = -1, NONE = 0, UP = 1, NOT_SET = 2, ANY = 3, DEFAULT = 4 }; #define POS_INVALID 0 struct Vec3 { Vec3() = default; Vec3(const Vec3& a) { } Vec3(const float x_, const float y_, const float z_) { x = x_; y = y_; z = z_; } Vec3(const float xyz) { x = xyz; y = xyz; z = xyz; } Vec3(const std::vector<float>& xyz) { assert(xyz.size() == 3); x = xyz[0]; y = xyz[1]; z = xyz[2]; } bool is_valid() const { return !(x == POS_INVALID || y == POS_INVALID || z == POS_INVALID); } std::string to_string() const; void dump(const std::string extra_comment, const std::string ind) const; float x, y, z; }; void define_pybinding_Vec3(py::module& m) { py::class_<Vec3>(m, "Vec3") .def( py::init<>() ) .def( py::init<const float>(), py::arg("xyz") ) .def( py::init<const float, const float, const float>(), py::arg("x"), py::arg("y"), py::arg("z") ) .def("__add__", [](const Vec3& a, const Vec3& b) { return Vec3(a.x + b.x); } ) .def("__sub__", [](const Vec3& a, const Vec3& b) { return Vec3(a.x - b.x); } ) .def("__mul__", [](const Vec3& a, const Vec3& b) { return Vec3(a.x * b.x); } ) .def("__truediv__", [](const Vec3& a, const Vec3& b) { return Vec3(a.x / b.x); } ) .def("__eq__", [](const Vec3& a, const Vec3& b) { return a.x == b.x; } ) .def("__str__", [](const Vec3& a) { return "(" + std::to_string(a.x) + ", " + std::to_string(a.y) + ", " + std::to_string(a.z) + ")"; } ) .def("__repr__", [](const Vec3& a) { return "(" + std::to_string(a.x) + ", " + std::to_string(a.y) + ", " + std::to_string(a.z) + ")"; } ) .def("to_list", [](const Vec3& a) { return std::vector<float>{a.x, a.y, a.z}; } ) .def_readwrite("x", &Vec3::x) .def_readwrite("y", &Vec3::y) .def_readwrite("z", &Vec3::z) ; } PYBIND11_MODULE(mcell, m) { m.doc() = "pybind11 example plugin"; // optional module docstring py::enum_<Orientation>(m, "Orientation", py::arithmetic()) .value("DOWN", Orientation::DOWN) .value("NONE", Orientation::NONE) .value("UP", Orientation::UP) .value("NOT_SET", Orientation::NOT_SET) .value("ANY", Orientation::ANY) .value("DEFAULT", Orientation::DEFAULT) .export_values(); define_pybinding_Vec3(m); m.def("add", &add, "A function which adds two numbers"); }
C++
3D
mcellteam/mcell
utils/data_model_to_pymcell/generator_structs.h
.h
4,978
173
/****************************************************************************** * * Copyright (C) 2020 by * The Salk Institute for Biological Studies * * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. * ******************************************************************************/ #ifndef UTILS_DATA_MODEL_TO_PYMCELL_GENERATOR_STRUCTS_H_ #define UTILS_DATA_MODEL_TO_PYMCELL_GENERATOR_STRUCTS_H_ #include <string> #include <algorithm> #include <set> #include "json/json.h" #include "datamodel_defines.h" #include "generator_utils.h" namespace MCell { // auxiliary struct used when generating species or molecule types struct SpeciesOrMolType { SpeciesOrMolType(const std::string& name_, const bool is_species_ = true) : name(name_), is_species(is_species_) { } SpeciesOrMolType(const SpeciesOrMolType& other) : name(other.name), is_species(other.is_species) { } // ignores type bool operator == (const SpeciesOrMolType& other) const { return name == other.name; } std::string name; bool is_species; // mol type when false }; struct IdLoc { IdLoc(const std::string& name_, const bool in_python_ = true) : name(name_), in_python(in_python_) { } // ignores type bool operator == (const IdLoc& other) const { return name == other.name; } std::string name; bool in_python; // BNGL when false }; // data and configuration shared among generators struct SharedGenData { void reset() { input_file = ""; output_files_prefix = ""; debug_mode = false; testing_mode = false; bng_mode = false; not_overridable_python_params = false; unnamed_rxn_counter = 0; all_species_and_mol_type_names.clear(); all_reaction_rules_names.clear(); bngl_reaction_rules_used_in_observables.clear(); all_count_term_names.clear(); defined_python_objects.clear(); surface_to_volume_compartments_map.clear(); has_default_compartment_object = false; } uint unnamed_rxn_counter; std::string input_file; std::string output_files_prefix; bool bng_mode; bool debug_mode; bool testing_mode; std::vector<int> checkpoint_iterations; bool not_overridable_python_params; std::vector<SpeciesOrMolType> all_species_and_mol_type_names; std::vector<IdLoc> all_reaction_rules_names; std::vector<std::string> bngl_reaction_rules_used_in_observables; std::vector<std::string> all_count_term_names; // set in PythonGenerator::generate_geometry bool has_default_compartment_object; // set in MCell4Generator::analyze_and_generate_bngl_compartments std::set<std::string> used_compartments; // key is object name, value is class name std::map<std::string, std::string> defined_python_objects; // key is surface compartment name, value is volume compartment name std::map<std::string, std::string> surface_to_volume_compartments_map; // output file name to be used when loading observables from BNGL, // empty for DAT format std::string bng_observables_output_gdat_file; const SpeciesOrMolType* find_species_or_mol_type_info(const std::string& name) const { auto it = std::find( all_species_and_mol_type_names.begin(), all_species_and_mol_type_names.end(), SpeciesOrMolType(name)); if (it != all_species_and_mol_type_names.end()) { return &*it; } else { return nullptr; } } const IdLoc* find_reaction_rule_info(const std::string& rxn_name) const { auto it = std::find(all_reaction_rules_names.begin(), all_reaction_rules_names.end(), IdLoc(rxn_name)); if (it != all_reaction_rules_names.end()) { return &*it; } else { return nullptr; } } bool is_used_compartment(Json::Value& model_object) { const std::string& vol_comp = model_object[KEY_NAME].asString(); assert(vol_comp != ""); const std::string& surf_comp = model_object[KEY_MEMBRANE_NAME].asString(); return used_compartments.count(vol_comp) != 0 || (surf_comp != "" && used_compartments.count(surf_comp) != 0); } bool is_already_defined(const std::string& obj_name, const char* class_name) { //return false; if (defined_python_objects.count(obj_name) != 0) { return defined_python_objects[obj_name] == std::string(class_name); } else { return false; } } // also adds void check_if_already_defined_and_add(const std::string& obj_name, const char* class_name) { //return; if (defined_python_objects.count(obj_name) != 0) { ERROR("Duplicate object name '" + obj_name + "', used for '" + class_name + "' and '" + defined_python_objects[obj_name] + "'. Object names must be unique."); } else { defined_python_objects[obj_name] = class_name; } } // mcell node of the loaded JSON file Json::Value mcell; }; } // namespace MCell #endif /* UTILS_DATA_MODEL_TO_PYMCELL_GENERATOR_STRUCTS_H_ */
Unknown
3D
mcellteam/mcell
utils/data_model_to_pymcell/python_generator.h
.h
4,558
127
/****************************************************************************** * * Copyright (C) 2020 by * The Salk Institute for Biological Studies * * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. * ******************************************************************************/ #ifndef UTILS_DATA_MODEL_TO_PYMCELL_PYTHON_GENERATOR_H_ #define UTILS_DATA_MODEL_TO_PYMCELL_PYTHON_GENERATOR_H_ #include <iostream> #include <string> #include <vector> #include "generator_structs.h" namespace MCell { class MCell4Generator; class PythonGenerator { public: PythonGenerator(SharedGenData& data_) : data(data_), mcell(data_.mcell), unnamed_surf_class_counter(0) { } void generate_parameters(std::ostream& out); void generate_species_and_mol_types(std::ostream& out, std::vector<SpeciesOrMolType>& species_and_mt_info); void generate_surface_classes(std::ostream& out, std::vector<std::string>& sc_names); // the parameters file must be closed because we might append some code to it std::string generate_single_reaction_rule(std::ostream& out, Json::Value& reaction_list_item); void generate_reaction_rules(std::ostream& out, std::vector<IdLoc>& rxn_names); void generate_geometry_package(const std::string& geom_dir, std::vector<std::string>& geometry_objects); void generate_geometry(std::ostream& out, std::vector<std::string>& geometry_objects); void generate_release_sites(std::ostream& out, std::vector<std::string>& release_site_names); void generate_surface_classes_assignments(std::ostream& out); void generate_compartment_assignments(std::ostream& out); void generate_viz_outputs(std::ostream& out, const bool cellblender_viz, std::vector<std::string>& viz_output_names); void generate_all_bngl_reaction_rules_used_in_observables(std::ostream& out); void generate_single_count( std::ostream& out, const std::string& count_name, const std::string& observable_name, const std::string& file_name, const std::string& count_term_name, const std::string& mul_div_str, const std::string& rxn_step); std::string generate_count_terms_for_expression( ostream& out, const string& mdl_string, // may be empty, in that case we use what_to_count and where_to_count const std::string& what_to_count, const std::string& where_to_count, const std::string& orientation, const bool rxn_not_mol); std::string generate_single_molecule_release_info_array( std::ostream& out, std::string& rel_site_name, Json::Value& release_site_list, Json::Value::ArrayIndex begin, Json::Value::ArrayIndex end); void generate_release_pattern(std::ostream& out, const std::string& name, std::string& delay_string); private: void generate_single_parameter(std::ostream& out, Json::Value& parameter); std::string generate_component_type( std::ostream& out, Json::Value& bngl_component_item, const std::string& mol_type_name); std::string generate_single_species_or_mol_type( std::ostream& out, Json::Value& molecule_list_item, const bool generate_species, const std::vector<std::string>& component_names = std::vector<std::string>()); SpeciesOrMolType generate_single_species_or_mol_type_w_components( std::ostream& out, Json::Value& molecule_list_item); std::string generate_single_count_term( ostream& out, const std::string& what_to_count, const std::string& where_to_count, const std::string& orientation, const bool molecules_not_species, const bool rxn_not_mol); void generate_rxn_rule_side(std::ostream& out, Json::Value& substances_node); void get_surface_class_property_info( const string& sc_name, Json::Value& property, std::string& name, std::string& type_name, std::string& affected_mols, std::string& orientation, std::string& clamp_concentration); void generate_variable_rate(const std::string& rate_array_name, Json::Value& variable_rate_text); std::string generate_single_geometry_object( std::ostream& out, const int index, Json::Value& object); bool is_volume_mol_type(const std::string& mol_type_name); std::vector<std::string> get_species_to_visualize(); private: SharedGenData& data; // owned by MCell4Generator Json::Value& mcell; uint unnamed_surf_class_counter; }; } /* namespace MCell */ #endif /* UTILS_DATA_MODEL_TO_PYMCELL_PYTHON_GENERATOR_H_ */
Unknown
3D
mcellteam/mcell
utils/data_model_to_pymcell/bngl_generator.cpp
.cpp
20,526
612
/****************************************************************************** * * Copyright (C) 2020 by * The Salk Institute for Biological Studies * * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. * ******************************************************************************/ #include <stdexcept> #include "generator_utils.h" #include "generator_structs.h" #include "bngl_generator.h" #include "data_model_geometry.h" #include "libmcell/api/api_utils.h" #include "bng/bng_defines.h" #include "bng/bngl_names.h" using namespace std; namespace MCell { using Json::Value; using namespace API; void BNGLGenerator::generate_units_information_header() { bool use_bng_units = false; if (data.mcell.isMember(KEY_USE_BNG_UNITS)) { use_bng_units = data.mcell[KEY_USE_BNG_UNITS].asBool(); } bng_out << "\n"; if (use_bng_units) { bng_out << "# File uses BioNetGen ODE/SSA/PLA units for bimolecular reactions (um^3*N^-1*s^-1).\n"; bng_out << "# When used with MCell, global option Model.config.use_bng_units must be set to True.\n"; bng_out << "# WARNING: NFSim simulation won't produce correct result because NFSim uses different units than BioNetGen ODE.\n"; } else { bng_out << "# File uses standard MCell units for bimolecular reactions (M^-1*s^-1 and um^2*N^-1*s^-1).\n"; bng_out << "# When used with MCell, global option Model.config.use_bng_units must be set to False.\n"; bng_out << "# WARNING: Simulation with BioNetGen won't produce correct results because BioNetGen uses different units than MCell.\n"; } bng_out << "\n"; } void BNGLGenerator::generate_single_bngl_parameter(Value& parameter) { if (parameter[KEY_PAR_DESCRIPTION].asString() != "") { bng_out << IND << "# " << parameter[KEY_PAR_DESCRIPTION].asString() << "\n"; } bng_out << IND << fix_param_id(parameter[KEY_PAR_NAME].asString()) << " " << replace_function_calls_in_expr(parameter[KEY_PAR_EXPRESSION].asString(), false); string units = parameter[KEY_PAR_UNITS].asString(); if (units != "") { bng_out << " # units: " << units; } bng_out << "\n\n"; } void BNGLGenerator::generate_single_python_parameter(std::ostream& python_out, Value& parameter) { string name = fix_param_id(parameter[KEY_PAR_NAME].asString()); // skip MCELL_REDEFINE_ params if (name.find(BNG::MCELL_REDEFINE_PREFIX) == 0) { return; } data.check_if_already_defined_and_add(name, NAME_PARAMETER); python_out << name << " = " << VAR_BNGL_PARAMS << "['" << name << "']\n"; } // NOTE: this belongs rather to the python generator void BNGLGenerator::generate_parameters(std::ostream& python_out) { python_out << "# load parameters from BNGL\n"; python_out << VAR_BNGL_PARAMS << " = m.bngl_utils." << NAME_LOAD_BNGL_PARAMETERS << "(" << get_abs_path(bngl_filename) << ", " << S(SHARED) + "." + PARAMETER_OVERRIDES << ")\n\n"; // and generate BNGL parameters and also their Python representations bng_out << BNG::BEGIN_PARAMETERS << "\n"; Value& parameter_system = get_node(data.mcell, KEY_PARAMETER_SYSTEM); if (parameter_system.isMember(KEY_MODEL_PARAMETERS)) { Value& parameter_list = get_node(parameter_system, KEY_MODEL_PARAMETERS); for (Value::ArrayIndex i = 0; i < parameter_list.size(); i++) { generate_single_bngl_parameter(parameter_list[i]); generate_single_python_parameter(python_out, parameter_list[i]); } } bng_out << BNG::END_PARAMETERS << "\n\n"; python_out << "\n"; } void BNGLGenerator::generate_bngl_mol_type(Json::Value& molecule_list_item) { string name = make_id(molecule_list_item[KEY_MOL_NAME].asString()); gen_description(bng_out, molecule_list_item, IND); bng_out << IND << name; bool has_components = false; if (molecule_list_item.isMember(KEY_BNGL_COMPONENT_LIST) && molecule_list_item[KEY_BNGL_COMPONENT_LIST].size() > 0) { has_components = true; } if (has_components) { bng_out << "("; // Components Value& bngl_component_list = get_node(molecule_list_item, KEY_BNGL_COMPONENT_LIST); for (Value::ArrayIndex i = 0; i < bngl_component_list.size(); i++) { Value& bngl_component = bngl_component_list[i]; bng_out << bngl_component[KEY_CNAME].asString(); Value& cstates = bngl_component[KEY_CSTATES]; for (Value::ArrayIndex i = 0; i < cstates.size(); i++) { bng_out << "~" << cstates[i].asString(); } if (i + 1 != bngl_component_list.size()) { bng_out << ","; } } bng_out << ")"; } bng_out << "\n"; } void BNGLGenerator::generate_python_mol_type_info( std::ostream& python_out, Json::Value& molecule_list_item) { string name = make_id(molecule_list_item[KEY_MOL_NAME].asString()); python_out << IND4 << name << " = subsystem." << NAME_FIND_ELEMENTARY_MOLECULE_TYPE << "('" << name << "')\n"; python_out << IND4 << "assert " << name << ", \"Elementary molecule type '" + name + "' was not found\"\n"; string mol_type = molecule_list_item[KEY_MOL_TYPE].asString(); CHECK_PROPERTY(mol_type == VALUE_MOL_TYPE_2D || mol_type == VALUE_MOL_TYPE_3D); python_out << IND4; if (mol_type == VALUE_MOL_TYPE_3D) { gen_assign(python_out, name, NAME_DIFFUSION_CONSTANT_3D, molecule_list_item[KEY_DIFFUSION_CONSTANT].asString()); } else { gen_assign(python_out, name, NAME_DIFFUSION_CONSTANT_2D, molecule_list_item[KEY_DIFFUSION_CONSTANT].asString()); } bool has_custom_time_step = molecule_list_item[KEY_CUSTOM_TIME_STEP].asString() != ""; bool has_custom_space_step = molecule_list_item[KEY_CUSTOM_SPACE_STEP].asString() != ""; CHECK_PROPERTY(!(has_custom_time_step && has_custom_space_step) && "Only one of custom time or space step may be set"); if (has_custom_time_step) { python_out << IND4; gen_assign(python_out, name, NAME_CUSTOM_TIME_STEP, molecule_list_item[KEY_CUSTOM_TIME_STEP].asString()); } else if (has_custom_space_step) { python_out << IND4; gen_assign(python_out, name, NAME_CUSTOM_SPACE_STEP, molecule_list_item[NAME_CUSTOM_SPACE_STEP].asString()); } if (molecule_list_item[KEY_TARGET_ONLY].asBool()) { python_out << IND4; gen_assign(python_out, name, NAME_TARGET_ONLY, true); } python_out << "\n"; } void BNGLGenerator::generate_mol_types(std::ostream& python_out) { bng_out << BNG::BEGIN_MOLECULE_TYPES << "\n"; python_out << "# set additional information about species and molecule types that cannot be stored in BNGL,\n" "# elementary molecule types are already in the subsystem after they were loaded from BNGL\n" "def " << SET_BNGL_MOLECULE_TYPES_INFO << "(subsystem):\n"; Value& define_molecules = get_node(data.mcell, KEY_DEFINE_MOLECULES); check_version(KEY_DEFINE_MOLECULES, define_molecules, VER_DM_2014_10_24_1638); Value& molecule_list = get_node(define_molecules, KEY_MOLECULE_LIST); if (molecule_list.empty()) { python_out << IND4 << "pass # no molecule types are defined\n"; } for (Value::ArrayIndex i = 0; i < molecule_list.size(); i++) { Value& molecule_list_item = molecule_list[i]; check_version(KEY_MOLECULE_LIST, molecule_list_item, VER_DM_2018_10_16_1632); generate_bngl_mol_type(molecule_list_item); generate_python_mol_type_info(python_out, molecule_list_item); } bng_out << BNG::END_MOLECULE_TYPES << "\n\n"; } Json::Value& BNGLGenerator::find_geometry_object(const std::string& name) { Value& geometrical_objects = get_node(data.mcell, KEY_GEOMETRICAL_OBJECTS); if (!geometrical_objects.isMember(KEY_OBJECT_LIST)) { throw ConversionError("Could not find object for compartment " + name + "."); } Value& object_list = get_node(geometrical_objects, KEY_OBJECT_LIST); for (Value::ArrayIndex i = 0; i < object_list.size(); i++) { Value& object = object_list[i]; if (object[KEY_NAME].asString() == name) { return object; } } throw ConversionError("Could not find object for compartment " + name + "."); } void BNGLGenerator::get_compartment_volume_and_area(const std::string& name, double& volume, double& area) { auto it = compartment_name_to_volume_area_cache.find(name); if (it != compartment_name_to_volume_area_cache.end()) { volume = it->second.first; area = it->second.second; return; } string msg; try { // find object with name under geometrical_objects/object_list Json::Value& geometry_object = find_geometry_object(name); compute_volume_and_area(geometry_object, volume, area); } catch (const std::exception& ex) { cerr << "Warning: could not compute volume of a geometry object: " << ex.what() << " Compartment volume won't be correct.\n"; bng_out << "\n" << IND << "# Warning: compartment volume and area is not correct: " << ex.what() << "\n"; volume = 1; area = 0; } // remember in cache even if computation failed compartment_name_to_volume_area_cache[name] = make_pair(volume, area); } void BNGLGenerator::generate_single_compartment(Json::Value& model_object) { const string& name = model_object[KEY_NAME].asString(); const string& membrane_name = model_object[KEY_MEMBRANE_NAME].asString(); const string& parent_object = model_object[KEY_PARENT_OBJECT].asString(); double volume, area; get_compartment_volume_and_area(name, volume, area); // subtract children from volume auto it = volume_compartment_children.find(name); if (it != volume_compartment_children.end()) { for (const string& child: it->second) { double child_volume, child_area; get_compartment_volume_and_area(child, child_volume, child_area); volume -= child_volume; assert(volume > 0); } } // 2d compartment first if (membrane_name != "") { bng_out << IND << membrane_name << " " << "2" << " " << // surface volume is ignored by MCell area << " * 0.01 " << // parent object may be unset parent_object << " # volume = area * 0.01 um thickness\n"; } // 3d compartment second bng_out << IND << name << " " << "3" << " " << // volume is ignored by MCell volume << " " << // parent is the membrane, may be unset membrane_name << "\n"; } static void add_parent_compartments_recursively( SharedGenData& data, Value& model_object_list, Value& model_object, ParentToChildCompartmentsMap& volume_compartment_children) { // simply keep inserting until we reach the top compartment const std::string& vol_comp = model_object[KEY_NAME].asString(); assert(vol_comp != ""); data.used_compartments.insert(vol_comp); const std::string& surf_comp = model_object[KEY_MEMBRANE_NAME].asString(); if (surf_comp != "") { data.used_compartments.insert(surf_comp); } const std::string& parent_comp = model_object[KEY_PARENT_OBJECT].asString(); if (parent_comp != "") { // create a mapping so that one can find volume compartment children volume_compartment_children[parent_comp].insert(vol_comp); // find corresponding parent for (Value::ArrayIndex i = 0; i < model_object_list.size(); i++) { Value& parent_object = model_object_list[i]; if (parent_object[KEY_NAME].asString() == parent_comp) { add_parent_compartments_recursively( data, model_object_list, parent_object, volume_compartment_children); } } } } void BNGLGenerator::generate_compartments() { Value& model_objects = get_node(data.mcell, KEY_MODEL_OBJECTS); check_version(KEY_MODEL_OBJECTS, model_objects, VER_DM_2018_01_11_1330); Value& model_object_list = get_node(model_objects, KEY_MODEL_OBJECT_LIST); bool generate_compartments = false; for (Value::ArrayIndex i = 0; i < model_object_list.size(); i++) { Value& model_object = model_object_list[i]; // generate the compartments that we need for rxns and recursively their parents if (data.is_used_compartment(model_object)) { generate_compartments = true; // recursively add compartment parents to used compartments, we need to generate them as well // because their children reference them // also compute mapping volume parent -> volume children add_parent_compartments_recursively( data, model_object_list, model_object, volume_compartment_children); } } // do not generate empty section if (!generate_compartments) { return; } bng_out << BNG::BEGIN_COMPARTMENTS << "\n"; bng_out << IND << "# Note: Compartments are defined for MCell in Python using class GeometryObject,\n" << IND << "# MCell ignores the volume/area set here\n"; for (Value::ArrayIndex i = 0; i < model_object_list.size(); i++) { Value& model_object = model_object_list[i]; // generate only the compartments that we need for rxns if (data.is_used_compartment(model_object)) { generate_single_compartment(model_object); } } bng_out << BNG::END_COMPARTMENTS << "\n\n"; } static void fix_dots_in_simple_substances(vector<string>& substances) { for (string& s: substances) { s = fix_dots_in_simple_species(s); } } static bool has_in_out_compartments(const vector<string>& substances) { bool res = false; for (const string& s: substances) { size_t pos_in = s.find(S("@") + BNG::COMPARTMENT_NAME_IN); size_t pos_out = s.find(S("@") + BNG::COMPARTMENT_NAME_OUT); if (pos_in != string::npos || pos_out != string::npos) { return true; } } return false; } static void check_that_only_allowed_orientations_are_set( const vector<string>& orientations, const bool has_in_out_compartments) { // causes weird behavior on macos // if IN/OUT is not used, volume molecules must not have orientation and // surface molecules must be UP // NOTE: this check can be improed with detection of what type of complex it is surface or volume for (const string& s: orientations) { release_assert( ((s == "" || s == "'") || (has_in_out_compartments && (s == "'" || s == ","))) && "Orientation in BNGL is not supported, should have been checked before"); } } std::string BNGLGenerator::generate_single_reaction_rule(Json::Value& reaction_list_item, const bool generate_name) { string rxn_type = reaction_list_item[KEY_RXN_TYPE].asString(); CHECK_PROPERTY(rxn_type == VALUE_IRREVERSIBLE || rxn_type == VALUE_REVERSIBLE); bool is_reversible = rxn_type == VALUE_REVERSIBLE; string name = get_rxn_id(reaction_list_item, data.unnamed_rxn_counter); gen_description(bng_out, reaction_list_item, IND); bng_out << IND; if (generate_name) { // printing out name all the time would make the BNGL file hard to read bng_out << name << ": "; } vector<string> reac_substances; vector<string> reac_orientations; // reactants parse_rxn_rule_side(reaction_list_item[KEY_REACTANTS], reac_substances, reac_orientations); fix_dots_in_simple_substances(reac_substances); bool has_in_out = has_in_out_compartments(reac_substances); // in/out must be used in reactants to be allowed check_that_only_allowed_orientations_are_set(reac_orientations, has_in_out); for (size_t i = 0; i < reac_substances.size(); i++) { bng_out << reac_substances[i]; if (i != reac_substances.size() - 1) { bng_out << " + "; } } bng_out << " "; bng_out << ((is_reversible) ? "<->" : "->") << " "; vector<string> prod_substances; vector<string> prod_orientations; // products parse_rxn_rule_side(reaction_list_item[KEY_PRODUCTS], prod_substances, prod_orientations); fix_dots_in_simple_substances(prod_substances); check_that_only_allowed_orientations_are_set(prod_orientations, has_in_out); for (size_t i = 0; i < prod_substances.size(); i++) { if (prod_substances[i] == VALUE_NULL) { // BNGL does not allow "NULL" bng_out << "0"; } else { bng_out << prod_substances[i]; } if (i != prod_substances.size() - 1) { bng_out << " + "; } } bng_out << " "; // rates bng_out << reaction_list_item[KEY_FWD_RATE].asString(); if (is_reversible) { bng_out << ", " << reaction_list_item[KEY_BKWD_RATE].asString(); } bng_out << "\n"; return name; } // rather limited for now bool BNGLGenerator::can_express_count_with_bngl( const bool single_term, const bool rxn_not_mol, const std::string& where_to_count, const std::string& orientation, const std::string& mul_div_str, const std::string& rxn_step ) const { if (!single_term) { return false; } if (rxn_not_mol) { return false; } if (where_to_count != "" && where_to_count != VALUE_COUNT_LOCATION_WORLD) { return false; } if (orientation != "") { return false; } if (mul_div_str != "") { return false; } if (rxn_step != "") { // TODO: add test that uses parameters for both examined values double rxn_step_val; bool ok = get_parameter_value(data.mcell, rxn_step, rxn_step_val); if (!ok) { return false; } double time_step_val; const string& time_step = data.mcell[KEY_INITIALIZATION][KEY_TIME_STEP].asString(); ok = get_parameter_value(data.mcell, time_step, time_step_val); if (!ok) { return false; } // time step and rxn step must be the same if (!cmp_eq(rxn_step_val, time_step_val)) { return false; } } return true; } void BNGLGenerator::generate_single_count( const std::string& observable_name, const std::string& what_to_count, const std::string& description, const bool molecules_not_species) { gen_description(bng_out, description, IND); bng_out << IND; // there is some issue with macos Apple LLVM version 10.0.0 (clang-1000.10.44.4) // this gets miscompiled with optimizations enabled: ((molecules_not_species) ? BNG::OBSERVABLE_MOLECULES : BNG::OBSERVABLE_SPECIES) if (molecules_not_species) { bng_out << BNG::OBSERVABLE_MOLECULES; } else { bng_out << BNG::OBSERVABLE_SPECIES; } bng_out << " " << fix_id(observable_name) << " " << what_to_count << "\n"; } bool BNGLGenerator::can_express_release_with_bngl(Json::Value& release_site_item) { // for now only volume molecules, little limited, // mainly for data model generated by MCell4 reading a BNGL file // must be released into an object if (release_site_item[KEY_SHAPE].asString() != VALUE_OBJECT) { return false; } // must have a single compartment (probably too strict) bool multiple_compartments; string compartment = get_single_compartment(release_site_item[KEY_MOLECULE].asString(), &multiple_compartments); if (multiple_compartments) { return false; } // compartment must correspond to the object, or it must be empty and the object must the special default_comartment if (compartment == "" && release_site_item[KEY_OBJECT_EXPR].asString() != S(BNG::DEFAULT_COMPARTMENT_NAME) + "[ALL]") { return false; } if (compartment != "") { if (data.surface_to_volume_compartments_map.count(compartment) == 0) { if (release_site_item[KEY_OBJECT_EXPR].asString() != compartment + "[ALL]" && release_site_item[KEY_OBJECT_EXPR].asString() != compartment) { return false; } } else { // get volume compartment name if this is a surface compartment because that is what appears in the data model string vol_compartment = data.surface_to_volume_compartments_map[compartment]; if (release_site_item[KEY_OBJECT_EXPR].asString() != vol_compartment + "[ALL]" && release_site_item[KEY_OBJECT_EXPR].asString() != vol_compartment) { return false; } } } if (release_site_item[KEY_QUANTITY_TYPE].asString() != VALUE_NUMBER_TO_RELEASE) { return false; } if (release_site_item[KEY_RELEASE_PROBABILITY].asString() != "1") { return false; } if (release_site_item[KEY_STDDEV].asString() != "0") { return false; } if (release_site_item[KEY_ORIENT].asString() != ";" && release_site_item[KEY_ORIENT].asString() != "'" ) { return false; } if (release_site_item[KEY_PATTERN].asString() != "") { return false; } return true; } void BNGLGenerator::generate_single_release_site( const std::string& bngl_cplx, const std::string& quantity, const std::string& description) { gen_description(bng_out, description, IND); bng_out << IND << bngl_cplx << " " << fix_param_id(quantity) << "\n"; } } /* namespace MCell */
C++
3D
mcellteam/mcell
utils/data_model_to_pymcell/mcell4_generator.h
.h
2,909
91
/****************************************************************************** * * Copyright (C) 2020 by * The Salk Institute for Biological Studies * * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. * ******************************************************************************/ // TODO: add assert after every find_* call or add a call that checks that // the thing we are searching for exists #ifndef SRC4_MCELL4_GENERATOR_H_ #define SRC4_MCELL4_GENERATOR_H_ #include <string> #include <fstream> #include "json/json.h" #include "generator_structs.h" #include "python_generator.h" #include "bngl_generator.h" // TODO: use a different namespace, we are not using anything from MCell // except for constants namespace MCell { class MCell4Generator { public: bool generate(const SharedGenData& opts); private: void reset(); std::string get_module_name(const std::string file_suffix); std::string make_import(const std::string file_suffix); void open_and_check_file( const std::string file_suffix, std::ofstream& out, const bool for_append = false, const bool bngl = false); void generate_customization(); void generate_shared(); void generate_simulation_setup_parameter(std::ostream& out, const string& name, const string& value); void generate_parameters(); std::string generate_species_and_mol_types(std::ostream& out, std::vector<SpeciesOrMolType>& species_and_mt_info); void generate_variable_rate(const std::string& rate_array_name, Json::Value& variable_rate_text); std::vector<IdLoc> generate_reaction_rules(std::ostream& out, const std::vector<std::string>& surf_class_names); void find_required_compartments(std::set<std::string>& compartments); void analyze_and_generate_bngl_compartments(std::ostream& out); void generate_subsystem(); std::string generate_single_geometry_object( std::ofstream& out, const int index, Json::Value& object); std::vector<std::string> generate_geometry_package(); std::vector<std::string> generate_geometry(); void generate_release_sites(std::ostream& out, std::vector<std::string>& release_site_names); void generate_instantiation(const std::vector<std::string>& geometry_objects); void generate_counts(std::ostream& out, std::vector<std::string>& python_counts, bool& has_bng_observables); void generate_observables(); void generate_config(std::ostream& out); void generate_model(const bool print_failed_marker); void generate_customization_template(); private: BNGLGenerator* bng_gen; std::ofstream bng_out; PythonGenerator* python_gen; // parameters, subsystem, and instantiation are always generated bool geometry_generated; bool observables_generated; SharedGenData data; }; } /* namespace MCell */ #endif /* SRC4_MCELL4_GENERATOR_H_ */
Unknown
3D
mcellteam/mcell
utils/data_model_to_pymcell/data_model_geometry.cpp
.cpp
4,839
143
/****************************************************************************** * * Copyright (C) 2021 by * The Salk Institute for Biological Studies * * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. * ******************************************************************************/ #include "data_model_geometry.h" #include <stdexcept> #include <vtkSmartPointer.h> #include <vtkTriangle.h> #include <vtkCleanPolyData.h> #include <vtkTriangleFilter.h> #include <vtkTransform.h> #include <vtkPointData.h> #include <vtkFeatureEdges.h> #include <vtkMassProperties.h> #include <vtkPolyDataNormals.h> #include <vtkPolyDataMapper.h> #include "include/datamodel_defines.h" #include "generator_utils.h" using namespace Json; using Json::Value; namespace MCell { static double is_watertight(vtkSmartPointer<vtkPolyData> polydata) { // check if the object is watertight, // based on https://lorensen.github.io/VTKExamples/site/Cxx/Meshes/BoundaryEdges/ vtkSmartPointer<vtkFeatureEdges> featureEdges = vtkSmartPointer<vtkFeatureEdges>::New(); featureEdges->SetInputData(polydata.Get()); featureEdges->BoundaryEdgesOn(); featureEdges->FeatureEdgesOff(); featureEdges->ManifoldEdgesOff(); featureEdges->NonManifoldEdgesOff(); featureEdges->Update(); // if there are no edges, the object is watertight return featureEdges->GetOutput()->GetNumberOfCells() < 1; } static vtkSmartPointer<vtkPolyData> convert_dm_object_to_polydata( Json::Value& model_object) { string name = model_object[KEY_NAME].asString(); // we need to convert each geometry object into VTK's polydata representation // example: https://vtk.org/Wiki/VTK/Examples/Cxx/PolyData/TriangleArea vtkSmartPointer<vtkPoints> points = vtkSmartPointer<vtkPoints>::New(); vtkSmartPointer<vtkCellArray> triangles = vtkSmartPointer<vtkCellArray>::New(); Value& vertex_list = get_node(name, model_object, KEY_VERTEX_LIST); Value& element_connections = get_node(name, model_object, KEY_ELEMENT_CONNECTIONS); // assuming the the data model is correct for (Value::ArrayIndex i = 0; i < vertex_list.size(); i++) { Value& vertex = vertex_list[i]; points->InsertNextPoint(vertex[0].asDouble(), vertex[1].asDouble(), vertex[2].asDouble()); } // store triangles for (Value::ArrayIndex i = 0; i < element_connections.size(); i++) { Value& element = element_connections[i]; vtkSmartPointer<vtkTriangle> triangle = vtkSmartPointer<vtkTriangle>::New(); for (uint i = 0; i < VERTICES_IN_TRIANGLE; i++) { triangle->GetPointIds()->SetId(i, element[i].asInt()); } triangles->InsertNextCell(triangle); } // create input polydata vtkSmartPointer<vtkPolyData> polydata = vtkSmartPointer<vtkPolyData>::New(); polydata->SetPoints(points); polydata->SetPolys(triangles); // clean them up vtkSmartPointer<vtkTriangleFilter> tri = vtkSmartPointer<vtkTriangleFilter>::New(); tri->SetInputData(polydata); vtkSmartPointer<vtkCleanPolyData> clean = vtkSmartPointer<vtkCleanPolyData>::New(); clean->SetInputConnection(tri->GetOutputPort()); clean->Update(); // also copy this information to our object return clean->GetOutput(); } // practically the same as in vtk_utils // auxiliary function to compute volume, not related to counted volumes but uses VTK // returns FLT_INVALID if the object is not watertight static void get_polydata_volume_and_area( vtkSmartPointer<vtkPolyData> polydata, double& volume, double& area) { // volume computation is based on // https://lorensen.github.io/VTKExamples/site/Cxx/Utilities/MassProperties/ vtkSmartPointer<vtkTriangleFilter> triangleFilter = vtkSmartPointer<vtkTriangleFilter>::New(); triangleFilter->SetInputData(polydata); // Make the triangle windong order consistent vtkSmartPointer<vtkPolyDataNormals> normals = vtkSmartPointer<vtkPolyDataNormals>::New(); normals->SetInputConnection(triangleFilter->GetOutputPort()); normals->ConsistencyOn(); normals->SplittingOff(); vtkSmartPointer<vtkMassProperties> massProperties = vtkSmartPointer<vtkMassProperties>::New(); massProperties->SetInputConnection(normals->GetOutputPort()); massProperties->Update(); volume = massProperties->GetVolume(); area = massProperties->GetSurfaceArea(); } void compute_volume_and_area(Json::Value& model_object, double& volume, double& area) { string name = model_object[KEY_NAME].asString(); vtkSmartPointer<vtkPolyData> polydata = convert_dm_object_to_polydata(model_object); if (!is_watertight(polydata)) { throw ConversionError("Geometry object " + name + " is not watertight, could not compute volume."); } get_polydata_volume_and_area(polydata, volume, area); } } // namespace MCell
C++
3D
mcellteam/mcell
utils/data_model_to_pymcell/data_model_geometry.h
.h
758
25
/****************************************************************************** * * Copyright (C) 2021 by * The Salk Institute for Biological Studies * * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. * ******************************************************************************/ #ifndef UTILS_DATA_MODEL_GEOMETRY_H_ #define UTILS_DATA_MODEL_GEOMETRY_H_ #include "json/json.h" namespace MCell { // throws ConversionError if computation was not successful (may possibly throw other exceptions) void compute_volume_and_area(Json::Value& model_object, double& volume, double& area); } // namespace MCell #endif /* UTILS_DATA_MODEL_GEOMETRY_H_ */
Unknown
3D
mcellteam/mcell
utils/data_model_to_pymcell/generator_utils.h
.h
7,623
242
/****************************************************************************** * * Copyright (C) 2020 by * The Salk Institute for Biological Studies * * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. * ******************************************************************************/ /** * This file is directly included because it contains templates and also to avoid the * need to have two declarations (in .h + in .cpp) for each function. */ #ifndef SRC4_PYMCELLCONVERTER_GENERATOR_UTILS_H_ #define SRC4_PYMCELLCONVERTER_GENERATOR_UTILS_H_ #include <iostream> #include <string> #include <cassert> #include <regex> #include "libmcell/generated/gen_names.h" #include "include/datamodel_defines.h" #include "libmcell/api/api_utils.h" #include "libmcell/api/python_export_constants.h" #include "libmcell/api/python_export_utils.h" #include "libmcell/api/api_common.h" using namespace std; namespace MCell { using namespace API; using Json::Value; struct SharedGenData; const uint TESTING_RXN_CLASS_CLEANUP_PERIODICITY = 100; const uint TESTING_SPECIES_CLEANUP_PERIODICITY = 500; const char* const NAME_PARAMETER = "parameter"; // using exception catching to recover from errors #define CHECK(stmt, failed) \ do { \ try { \ (stmt); \ } \ catch (exception& e) { \ cerr << e.what() << "\n"; \ cerr << "Exception caught in '" << __FUNCTION__ << "' after conversion error.\n"; \ failed = true; \ } \ } while (0) #define CHECK_PROPERTY(cond) \ do { \ if(!(cond)) { \ throw ConversionError(S("Error: Expected '") + #cond + "' is false. (" + __FUNCTION__ + " - " + __FILE__ + ":" + to_string(__LINE__) + ")"); \ } \ } while (0) #define ERROR(msg) throw ConversionError(S("Error: ") + msg + " (function " + __FUNCTION__ + ")") // key - MDL name, used in data model, value.first - Python name, value.second - BNGL name const std::map<const std::string, std::pair<const std::string, const std::string>> mdl_functions_to_py_bngl_map { { "SQRT", {"math.sqrt", "sqrt"} }, { "EXP", {"math.exp", "exp"} }, { "LOG", {"math.log", "ln"} }, { "LOG10", {"math.log10", "log10"} }, { "SIN", {"math.sin", "sin"} }, { "COS", {"math.cos", "cos"} }, { "TAN", {"math.tan", "tan"} }, { "ASIN", {"math.asin", "asin"} }, { "ACOS", {"math.acos", "acos"} }, { "ATAN", {"math.atan", "atan"} }, { "ABS", {"abs", "abs"} }, { "CEIL", {"math.ceil", "ceil"} }, { "FLOOR", {"math.floor", "floor"} }, { "MAX", {"max", "max"} }, { "MIN", {"min", "min"} } }; // TODO: use also in other places where it may be useful, currently just for release site quantity void check_not_empty(const Value& parent, const char* key, const std::string& msg_location); // when use_python_functions is true, function calls are replaced with Python function names // when False, they are replaced with BNGL function names std::string replace_function_calls_in_expr(const std::string& data_model_expr, const bool use_python_functions); std::string get_module_name_w_prefix(const std::string& output_files_prefix, const std::string file_suffix); void parse_rxn_rule_side( Json::Value& substances_node, std::vector<std::string>& substances, std::vector<std::string>& orientations); // throws exception when the member is member is there static Value& get_node(const string parent_name, Value& parent, const string name) { if (!parent.isMember(name)) { throw ConversionError("Error: Node '" + parent_name + "' does not contain expected node '" + name + "'."); } return parent[name]; } // used when we know that the member is there static Value& get_node(Value& parent, const string name) { assert(parent.isMember(name)); return parent[name]; } static string fix_dots_in_simple_species(const string& s) { string res = s; if (API::is_simple_species(s)) { replace(res.begin(), res.end(), '.', '_'); } return res; } string remove_compartments(const std::string& species_name); string get_single_compartment(const std::string& name, bool* has_multiple_compartments = nullptr); string make_species_or_cplx( const SharedGenData& data, const std::string& name, const std::string& orient = "", const std::string& compartment = ""); static string make_species(const string bngl_str) { return S(MDOT) + API::NAME_CLASS_SPECIES + "('" + fix_dots_in_simple_species(bngl_str) + "')"; } static void check_versions( const string node_name, Json::Value& node, const char* const version1, const char* const version2) { if (node[KEY_DATA_MODEL_VERSION].asString() != version1 && node[KEY_DATA_MODEL_VERSION].asString() != version2) { throw ConversionError( "Error: version for " + node_name + " is " + node[KEY_DATA_MODEL_VERSION].asString() + ", expected " + version1 + " or " + version2 + "."); } } static void check_version(const string node_name, Json::Value& node, const char* const version) { if (!node.isMember(KEY_DATA_MODEL_VERSION) || node[KEY_DATA_MODEL_VERSION].asString() == "") { cout << "Warning: data model node " + node_name + " does not have its version specified, not checking the version.\n"; } else if (node[KEY_DATA_MODEL_VERSION].asString() != version) { throw ConversionError( "Error: version for " + node_name + " is " + node[KEY_DATA_MODEL_VERSION].asString() + ", expected " + version + "."); } } static string convert_orientation(const string s, const bool return_any_orientation = false) { if (s == "\'") { return API::NAME_EV_UP; } else if (s == ",") { return API::NAME_EV_DOWN; } else if (s == ";" || s == "") { if (return_any_orientation && s == ";") { return API::NAME_EV_ANY; } else { return ""; } } else { ERROR("Invalid orientation '" + s + "'."); return "INVALID_ORIENTATION"; } } // NOTE: the same code is in mcell3_world_converter.cpp static bool ends_with(std::string const & value, std::string const & ending) { if (ending.size() > value.size()) { return false; } return std::equal(ending.rbegin(), ending.rend(), value.rbegin()); } static string trim(const string& str) { size_t first = str.find_first_not_of(' '); if (string::npos == first) { return str; } size_t last = str.find_last_not_of(' '); return str.substr(first, (last - first + 1)); } string get_rxn_id(Json::Value& reaction_list_item, uint& unnamed_rxn_counter); string create_count_name( const string& what_to_count, const string& where_to_count, const bool molecules_not_species); uint get_num_counts_in_mdl_string(const string& mdl_string); string remove_c_comment(const string& str); string remove_whitespace(const string& str); size_t find_end_brace_pos(const string& str, const size_t start); void process_single_count_term( const SharedGenData& data, const string& mdl_string, bool& rxn_not_mol, bool& molecules_not_species, string& what_to_count, string& where_to_count, string& orientation); // sets val if the name_or_value is a floating point value, // if not, tries to find the parameter and reads its value // returns true on success // parameters are not evaluated and only one level is tried, // returns false if value was not obtained bool get_parameter_value(Json::Value& mcell, const string& name_or_value, double& val); bool is_volume_species(Json::Value& mcell, const std::string& species_name); } // namespace MCell #endif // SRC4_PYMCELLCONVERTER_GENERATOR_UTILS_H_
Unknown
3D
mcellteam/mcell
utils/data_model_to_pymcell/mcell4_generator.cpp
.cpp
45,796
1,403
/****************************************************************************** * * Copyright (C) 2020 by * The Salk Institute for Biological Studies * * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. * ******************************************************************************/ #include <algorithm> #include "generator_utils.h" #include "mcell4_generator.h" #include "bng/bng_defines.h" #include "src/util.h" #include "bng/filesystem_utils.h" using namespace std; using namespace MCell::API; namespace MCell { using Json::Value; string MCell4Generator::get_module_name(const string file_suffix) { return get_module_name_w_prefix(data.output_files_prefix, file_suffix); } string MCell4Generator::make_import(const string file_suffix) { return "from " + get_module_name(file_suffix) + " import *\n"; } void MCell4Generator::open_and_check_file( const string file_suffix, ofstream& out, const bool for_append, const bool bngl) { open_and_check_file_w_prefix(data.output_files_prefix, file_suffix, out, for_append, bngl); } void MCell4Generator::reset() { data.reset(); geometry_generated = false; observables_generated = false; bng_gen = nullptr; python_gen = nullptr; } // the aim is to generate as much of output as possible, // therefore we are using exceptions bool MCell4Generator::generate(const SharedGenData& opts) { reset(); bool failed = false; data = opts; // copy options // load json file ifstream file; file.open(opts.input_file); if (!file.is_open()) { cerr << "Could not open file '" << opts.input_file << "' for reading.\n"; return false; } Value root; file >> root; file.close(); data.mcell = get_node(KEY_ROOT, root, KEY_MCELL); // create generators if (data.bng_mode) { open_and_check_file(MODEL, bng_out, false, true); bng_out << GENERATED_WARNING; bng_gen = new BNGLGenerator( get_filename(data.output_files_prefix, MODEL, BNGL_EXT), bng_out, data); bng_gen->generate_units_information_header(); } python_gen = new PythonGenerator(data); CHECK(generate_customization(), failed); CHECK(generate_shared(), failed); CHECK(generate_parameters(), failed); CHECK(generate_subsystem(), failed); std::vector<std::string> geometry_names; // CHECK(geometry_names = generate_geometry(), failed); CHECK(geometry_names = generate_geometry_package(), failed); CHECK(generate_instantiation(geometry_names), failed); CHECK(generate_observables(), failed); CHECK(generate_model(failed), failed); CHECK(generate_customization_template(), failed); // delete generators if (data.bng_mode) { delete bng_gen; bng_gen = nullptr; bng_out.close(); } delete python_gen; python_gen = nullptr; return !failed; } static std::string get_file_base_name(const std::string& path) { size_t pos = path.find_last_of("/\\"); if (pos != string::npos) { return path.substr(pos + 1); } else { return path; } } void MCell4Generator::generate_customization() { // first check unsupported MCell3 scripting Value& scripting = get_node(data.mcell, KEY_SCRIPTING); if (scripting.isMember(KEY_SCRIPTING_LIST)) { Value& scripting_list = get_node(scripting, KEY_SCRIPTING_LIST); if (!scripting_list.empty()) { ERROR("Data model contains MCell3 scripting. To convert this model: 1) disable MCell3 mode, 2) generate MDL, " "3) convert MDL to data model and 4) use this converter. " "Conversion will now continue, but it will be missing the scripted code." ); } } // copy files from MCell4 scripting if (scripting.isMember(KEY_MCELL4_SCRIPTING_LIST)) { Value& mcell4_scripting_list = get_node(scripting, KEY_MCELL4_SCRIPTING_LIST); for (Value::ArrayIndex i = 0; i < mcell4_scripting_list.size(); i++) { Value& item = mcell4_scripting_list[i]; bool internal; string internal_external = get_node(item, KEY_INTERNAL_EXTERNAL).asString(); if (internal_external == VALUE_INTERNAL) { internal = true; } else if (internal_external == VALUE_EXTERNAL) { internal = false; } else { ERROR(S(KEY_INTERNAL_EXTERNAL) + " may be either " + VALUE_INTERNAL + " or " + VALUE_EXTERNAL + ", not " + internal_external + "."); } if (internal) { // create a file from internal script string fname = get_node(item, KEY_INTERNAL_FILE_NAME).asString(); Value& script_texts = get_node(scripting, KEY_SCRIPT_TEXTS); if (!script_texts.isMember(fname)) { ERROR("Internal script " + fname + " was not found."); } // expecting the the file can be represented as text (it must be since it is in a JSON format) string code = get_node(script_texts, fname).asString(); ofstream fout; fout.open(fname); if (!fout.is_open()) { ERROR("Could not open file " + fname + " for writing for internal script export."); } cout << "Creating " + fname + " from internal script file.\n"; fout.write(code.c_str(), code.size()); fout.close(); } else { // copy external file string fname = get_node(item, KEY_EXTERNAL_FILE_NAME).asString(); ifstream fin; fin.open(fname); if (!fin.is_open()) { ERROR("Could not open file " + fname + " for reading for external script export."); } // get base path string exported_fname = get_file_base_name(fname); cout << "exported_fname: " << exported_fname << "\n"; ofstream fout; fout.open(exported_fname); if (!fout.is_open()) { fin.close(); ERROR("Could not open file " + fname + " for writing for external script export."); } // copy data cout << "Copying " + fname + " to " + exported_fname + ".\n"; fout << fin.rdbuf(); fin.close(); fout.close(); } } } } void MCell4Generator::generate_shared() { ofstream out; open_and_check_file_w_prefix("", SHARED, out); out << GENERATED_WARNING << "\n"; out << "# This is an auxiliary module containing only a dictionary for parameter overrides.\n" << "# It has to be a separate module so that it can be shared easily among all modules.\n"; out << PARAMETER_OVERRIDES << " = {}\n"; out.close(); } void MCell4Generator::generate_simulation_setup_parameter( std::ostream& out, const string& name, const string& value) { string ind; if (!data.not_overridable_python_params) { // allow params to be overridden out << "if " << NOT_DEFINED << "('" << name << "'):\n"; ind = IND4; } out << ind << name << " = " << value << "\n\n"; } void MCell4Generator::generate_parameters() { ofstream out; open_and_check_file(PARAMETERS, out); out << GENERATED_WARNING << "\n"; out << IMPORT_SYS_OS; out << IMPORT_MATH; out << IMPORT_SHARED; out << IMPORT_MCELL_AS_M; out << MODEL_PATH_SETUP << "\n"; out << make_section_comment("model parameters"); out << "# declare all items from parameter_overrides as variables\n" << "for parameter_name, value in " << SHARED << "." << PARAMETER_OVERRIDES << ".items():\n" << " setattr(sys.modules[__name__], parameter_name, value)\n" << "\n" << "# auxiliary function used to determine whether a parameter was defined\n" << "def " << NOT_DEFINED << "(parameter_name):\n" << " return parameter_name not in globals()\n\n"; if (data.mcell.isMember(KEY_PARAMETER_SYSTEM)) { if (data.bng_mode) { bng_gen->generate_parameters(out); } else { python_gen->generate_parameters(out); } } out << make_section_comment("simulation setup"); generate_simulation_setup_parameter(out, PARAM_ITERATIONS, data.mcell[KEY_INITIALIZATION][KEY_ITERATIONS].asString()); generate_simulation_setup_parameter(out, PARAM_TIME_STEP, data.mcell[KEY_INITIALIZATION][KEY_TIME_STEP].asString()); generate_simulation_setup_parameter(out, PARAM_DUMP, (data.debug_mode ? "True" : "False")); generate_simulation_setup_parameter(out, PARAM_EXPORT_DATA_MODEL, "True"); generate_simulation_setup_parameter(out, PARAM_SEED, "1"); out << "\n"; out.close(); } std::string MCell4Generator::generate_species_and_mol_types( ostream& out, vector<SpeciesOrMolType>& species_and_mt_info) { // skip if there are no species/mol types if (!data.mcell.isMember(KEY_DEFINE_MOLECULES)) { return ""; } if (data.bng_mode) { // molecule types are optional but they allow for better BNGL semantic checks // - we also need to generate code that sets diffusion constant, // custom time/space step and other parameters to molecule types, // - it must be executed after bngl file is loaded, so we should not be putting it into // subsystem, the new file can be called bngl_molecule_types_info.py // - all this extra information should be put preferably into the BNGL file // but for now we would like it to be BNGL compatible and parsing comments or MCELL_ parameters is not really nice stringstream mt_info_out; bng_gen->generate_mol_types(mt_info_out); return mt_info_out.str(); } else { python_gen->generate_species_and_mol_types(out, species_and_mt_info); return ""; } } static bool rxn_uses_mcell_orientation(Value& reaction_list_item) { string substances = reaction_list_item[KEY_REACTANTS].asString() + " " + reaction_list_item[KEY_PRODUCTS].asString(); size_t pos_in = substances.find(S("@") + BNG::COMPARTMENT_NAME_IN); size_t pos_out = substances.find(S("@") + BNG::COMPARTMENT_NAME_OUT); bool has_in_out_compartments = pos_in != string::npos || pos_out != string::npos; // looking for ',; outside of parentheses bool in_paren = false; size_t i = 0; while (i < substances.size()) { char c = substances[i]; if (c == '(') { CHECK_PROPERTY(!in_paren && "Malformed reaction definition - embedded parentheses"); in_paren = true; } else if (c == ')') { CHECK_PROPERTY(in_paren && "Malformed reaction definition - unexpected closing parenthesis"); in_paren = false; } else if (!in_paren && (c == ',' || c == '\'' || c == ';')) { // UP is allowed when compartment class @IN or @OUT is used if (!(has_in_out_compartments && c == '\'')) { return true; } } i++; } return false; } static bool rxn_has_variable_rate(Value& reaction_list_item) { return reaction_list_item[KEY_VARIABLE_RATE_SWITCH].asBool(); } static bool rxn_uses_surf_class( Value& reaction_list_item, const std::vector<std::string>& surf_class_names) { vector<string> substances; vector<string> orientations; Value& reactants = reaction_list_item[KEY_REACTANTS]; parse_rxn_rule_side(reactants, substances, orientations); for (const string& reac: substances) { if (find(surf_class_names.begin(), surf_class_names.end(), reac) != surf_class_names.end()) { return true; } } return false; } // returns true if the rxn name might be referenced by counts static bool is_rxn_used_in_observables(Value& mcell, const string& rxn_name) { if (rxn_name == "") { return false; } Value& reaction_data_output = get_node(mcell, KEY_REACTION_DATA_OUTPUT); Value& reaction_output_list = get_node(reaction_data_output, KEY_REACTION_OUTPUT_LIST); for (Value::ArrayIndex i = 0; i < reaction_output_list.size(); i++) { Value& reaction_output_item = reaction_output_list[i]; string count_mdl_string = reaction_output_item[KEY_MDL_STRING].asString(); string count_rxn_name = reaction_output_item[KEY_REACTION_NAME].asString(); string string_to_check = count_mdl_string + " " +count_rxn_name; if (string_to_check.find(rxn_name) != string::npos) { return true; } } return false; } vector<IdLoc> MCell4Generator::generate_reaction_rules(ostream& out, const std::vector<std::string>& surf_class_names) { vector<IdLoc> rxn_names_w_loc; if (!data.mcell.isMember(KEY_DEFINE_REACTIONS)) { return rxn_names_w_loc; } if (data.bng_mode) { // put into BNG all rxn rules that, // 1) don't use MCell orientation or // 2) variable rxn rates // rest goes into python Value& define_reactions = get_node(data.mcell, KEY_DEFINE_REACTIONS); check_version(KEY_DEFINE_REACTIONS, define_reactions, VER_DM_2014_10_24_1638); bng_gen->open_reaction_rules_section(); Value& reaction_list = get_node(define_reactions, KEY_REACTION_LIST); for (Value::ArrayIndex i = 0; i < reaction_list.size(); i++) { Value& reaction_list_item = reaction_list[i]; check_version(KEY_MOLECULE_LIST, reaction_list_item, VER_DM_2018_01_11_1330); if (!rxn_uses_mcell_orientation(reaction_list_item) && !rxn_has_variable_rate(reaction_list_item) && !rxn_uses_surf_class(reaction_list_item, surf_class_names)) { bool used_in_observables = is_rxn_used_in_observables(data.mcell, reaction_list_item[KEY_RXN_NAME].asString()); bool rxn_has_name = (reaction_list_item[KEY_RXN_NAME].asString() != ""); string name = bng_gen->generate_single_reaction_rule(reaction_list_item, rxn_has_name); // string name = bng_gen->generate_single_reaction_rule(reaction_list_item, used_in_observables); rxn_names_w_loc.push_back(IdLoc(name, false)); if (used_in_observables) { data.bngl_reaction_rules_used_in_observables.push_back(name); } } else { string name = python_gen->generate_single_reaction_rule(out, reaction_list_item); bng_gen->add_comment( S(IND) + "reaction '" + reaction_list_item[KEY_RXN_NAME].asString() + "' was generated as Python code because it contains features not supported by BNGL"); rxn_names_w_loc.push_back(IdLoc(name, true)); } } bng_gen->close_reaction_rules_section(); } else { python_gen->generate_reaction_rules(out, rxn_names_w_loc); } return rxn_names_w_loc; } static void insert_compartments_in_string(const std::string& str_w_compartments, std::set<std::string>& compartments) { regex exp("@([0-9a-zA-Z_]+)"); smatch res; string str = str_w_compartments; while (regex_search(str, res, exp)) { // not sure how else to cut off the leading '@' compartments.insert(string(res[0]).substr(1)); str = res.suffix(); } } void MCell4Generator::find_required_compartments(std::set<std::string>& compartments) { // rxns and release sites in data model may use compartments, // releases and observables use directly objects if (data.mcell.isMember(KEY_DEFINE_REACTIONS)) { Value& define_reactions = get_node(data.mcell, KEY_DEFINE_REACTIONS); Value& reaction_list = get_node(define_reactions, KEY_REACTION_LIST); for (Value::ArrayIndex i = 0; i < reaction_list.size(); i++) { Value& reaction_list_item = reaction_list[i]; insert_compartments_in_string(reaction_list_item[KEY_REACTANTS].asString(), compartments); insert_compartments_in_string(reaction_list_item[KEY_PRODUCTS].asString(), compartments); } } if (data.mcell.isMember(KEY_RELEASE_SITES)) { Value& release_sites = get_node(data.mcell, KEY_RELEASE_SITES); Value& release_site_list = get_node(release_sites, KEY_RELEASE_SITE_LIST); for (Value::ArrayIndex i = 0; i < release_site_list.size(); i++) { Value& release_site_item = release_site_list[i]; if (release_site_item.isMember(KEY_MOLECULE)) { insert_compartments_in_string(release_site_item[KEY_MOLECULE].asString(), compartments); } } } // and add all compartments used as parents & membranes Value& model_objects = get_node(data.mcell, KEY_MODEL_OBJECTS); Value& model_object_list = get_node(model_objects, KEY_MODEL_OBJECT_LIST); for (Value::ArrayIndex i = 0; i < model_object_list.size(); i++) { Value& model_object = model_object_list[i]; const string& name = model_object[KEY_NAME].asString(); const string& membrane_name = model_object[KEY_MEMBRANE_NAME].asString(); const string& parent_object = model_object[KEY_PARENT_OBJECT].asString(); if (compartments.count(name) != 0) { compartments.insert(membrane_name); compartments.insert(parent_object); } } } void MCell4Generator::analyze_and_generate_bngl_compartments(std::ostream& out) { // 1) figure out whether what compartments we need // not every named object must be a compartment find_required_compartments(data.used_compartments); // 2) add to BNGL file if needed if (data.bng_mode) { bng_gen->generate_compartments(); } } void MCell4Generator::generate_subsystem() { ofstream out; open_and_check_file(SUBSYSTEM, out); out << GENERATED_WARNING << "\n"; out << IMPORT_OS; out << IMPORT_SHARED; out << IMPORT_MCELL_AS_M; out << make_import(PARAMETERS); out << "\n"; out << make_section_comment(SUBSYSTEM); out << MODEL_PATH_SETUP << "\n"; string bngl_mol_types_initialization = generate_species_and_mol_types(out, data.all_species_and_mol_type_names); analyze_and_generate_bngl_compartments(out); vector<string> surface_class_names; python_gen->generate_surface_classes(out, surface_class_names); data.all_reaction_rules_names = generate_reaction_rules(out, surface_class_names); out << make_section_comment("create subsystem object and add components"); gen_ctor_call(out, SUBSYSTEM, NAME_CLASS_SUBSYSTEM, false); for (SpeciesOrMolType& info: data.all_species_and_mol_type_names) { if (info.is_species) { gen_method_call(out, SUBSYSTEM, NAME_ADD_SPECIES, info.name); } else { gen_method_call(out, SUBSYSTEM, NAME_ADD_ELEMENTARY_MOLECULE_TYPE, info.name); } } for (string& sc: surface_class_names) { gen_method_call(out, SUBSYSTEM, NAME_ADD_SURFACE_CLASS, sc); } for (IdLoc& r_loc: data.all_reaction_rules_names) { if (r_loc.in_python) { gen_method_call(out, SUBSYSTEM, NAME_ADD_REACTION_RULE, r_loc.name); } } if (data.bng_mode) { // each part of the bngl file is loaded separately from specific modules, // there is a single bngl file because later it will contain all the information needed // to run in it BioNetGen out << "\n# load subsystem information from bngl file\n"; gen_method_call( out, SUBSYSTEM, NAME_LOAD_BNGL_MOLECULE_TYPES_AND_REACTION_RULES, get_abs_path(get_filename(data.output_files_prefix, MODEL, BNGL_EXT)), S(SHARED) + "." + PARAMETER_OVERRIDES ); out << "\n" << bngl_mol_types_initialization; out << SET_BNGL_MOLECULE_TYPES_INFO << "(" << SUBSYSTEM << ")\n"; } out.close(); } vector<string> MCell4Generator::generate_geometry_package() { vector<string> geometry_objects; // TODO: check versions if (!data.mcell.isMember(KEY_GEOMETRICAL_OBJECTS)) { return geometry_objects; } Value& geometrical_objects = get_node(data.mcell, KEY_GEOMETRICAL_OBJECTS); if (!geometrical_objects.isMember(KEY_OBJECT_LIST)) { return geometry_objects; } // Make subdir for geometry modules string geom_dir = get_filename(data.output_files_prefix, GEOMETRY, "")+"/"; FSUtils::make_dir_w_multiple_attempts(geom_dir); // Generate geometry as a python package (with __init__.py) in geom_dir // Generate individual geometry objects as python modules in geom_dir python_gen->generate_geometry_package(geom_dir, geometry_objects); geometry_generated = true; return geometry_objects; } vector<string> MCell4Generator::generate_geometry() { vector<string> geometry_objects; // TODO: check versions if (!data.mcell.isMember(KEY_GEOMETRICAL_OBJECTS)) { return geometry_objects; } Value& geometrical_objects = get_node(data.mcell, KEY_GEOMETRICAL_OBJECTS); if (!geometrical_objects.isMember(KEY_OBJECT_LIST)) { return geometry_objects; } ofstream out; open_and_check_file(GEOMETRY, out); out << GENERATED_WARNING << "\n"; out << IMPORT_MCELL_AS_M; python_gen->generate_geometry(out, geometry_objects); // NOTE: we can generate BNGL compartments from geometry here out.close(); geometry_generated = true; return geometry_objects; } void MCell4Generator::generate_release_sites(std::ostream& out, std::vector<std::string>& release_site_names) { if (!data.mcell.isMember(KEY_RELEASE_SITES)) { return; } Value& release_sites = data.mcell[KEY_RELEASE_SITES]; check_version(KEY_RELEASE_SITES, release_sites, VER_DM_2014_10_24_1638); Value& release_site_list = release_sites[KEY_RELEASE_SITE_LIST]; if (release_site_list.empty()) { return; } if (data.bng_mode) { bool can_express_all_releases_with_bngl = true; for (Value::ArrayIndex i = 0; i < release_site_list.size(); i++) { // simulation result differs based on the order of releases so we must either generate all // releases into BNGL or none Value& release_site_item = release_site_list[i]; if (!bng_gen->can_express_release_with_bngl(release_site_item)) { can_express_all_releases_with_bngl = false; break; } } if (can_express_all_releases_with_bngl) { bng_gen->open_seed_species_section(); for (Value::ArrayIndex i = 0; i < release_site_list.size(); i++) { // simulation result differs based on the order of releases so we must either generate all // releases into BNGL or none const Value& release_site_item = release_site_list[i]; check_not_empty(release_site_item, KEY_QUANTITY, "Release site"); bng_gen->generate_single_release_site( release_site_item[KEY_MOLECULE].asString(), release_site_item[KEY_QUANTITY].asString(), get_description(release_site_item)); } bng_gen->close_seed_species_section(); // all done return; } } // python variant - used either without bng mode or as a fallback for bng mode python_gen->generate_release_sites(out, release_site_names); } void MCell4Generator::generate_instantiation(const vector<string>& geometry_objects) { ofstream out; open_and_check_file(INSTANTIATION, out); out << GENERATED_WARNING << "\n"; out << IMPORT_OS; out << IMPORT_SHARED; out << IMPORT_MCELL_AS_M; out << make_import(PARAMETERS); out << make_import(SUBSYSTEM); if (geometry_generated) { out << make_import(GEOMETRY); } out << MODEL_PATH_SETUP << "\n"; out << "\n"; out << make_section_comment(INSTANTIATION); out << make_section_comment("release sites"); out << make_section_comment("surface classes assignment"); python_gen->generate_surface_classes_assignments(out); out << make_section_comment("compartments assignment"); python_gen->generate_compartment_assignments(out); vector<string> release_sites; generate_release_sites(out, release_sites); out << make_section_comment("create instantiation object and add components"); gen_ctor_call(out, INSTANTIATION, NAME_CLASS_INSTANTIATION, false); for (const string& s: geometry_objects) { gen_method_call(out, INSTANTIATION, NAME_ADD_GEOMETRY_OBJECT, s); } for (const string& r: release_sites) { gen_method_call(out, INSTANTIATION, NAME_ADD_RELEASE_SITE, r); } if (data.bng_mode) { out << "\n# load seed species information from bngl file\n"; gen_method_call( out, INSTANTIATION, NAME_LOAD_BNGL_COMPARTMENTS_AND_SEED_SPECIES, get_abs_path(get_filename(data.output_files_prefix, MODEL, BNGL_EXT)), data.has_default_compartment_object ? BNG::DEFAULT_COMPARTMENT_NAME : "None", S(SHARED) + "." + PARAMETER_OVERRIDES ); out << "\n"; } out.close(); } static size_t find_closing_bracket_pos(const string& s, const size_t start_pos) { if (start_pos == string::npos) { return string::npos; } assert(s[start_pos] == '['); size_t pos = start_pos + 1; int bracket_count = 1; while (pos < s.size() && bracket_count != 0) { switch (s[pos]) { case '[': bracket_count++; break; case ']': bracket_count--; break; default: // skip break; } pos++; } if (bracket_count != 0) { return string::npos; } else { return pos - 1; } } // also checks that the MDLString is correctly formed static string check_mdlstring_count_and_get_mult_or_div(const string& mdl_string) { const string format_msg = ". MDL string supported by MCell4 must be in format 'COUNT[pattern,region] *|/ const_expr' or " "{(} COUNT[pattern,region] { +|- {(} COUNT[pattern,region] {)} } {)} *|/ const_expr' " "({x} means 0..n of repetitions of x, and x|y means x or y)."; string mdl_string_wo_comment = remove_c_comment(mdl_string); string str = remove_whitespace(mdl_string_wo_comment); int num_parens = 0; size_t pos = 0; const string COUNT = "COUNT"; // check until we process all COUNTs with all parentheses while (pos < str.size() && !(str.find(COUNT, pos) == string::npos && num_parens == 0)) { switch (str[pos]) { case 'C': { // this must be COUNT[...] size_t count_pos = str.find(COUNT, pos); size_t opening_bracket_pos = str.find('[', pos); // brackets are allowed inside e,g, such as here: COUNT[sm1,Scene.Cube[ALL]] size_t closing_bracket_pos = find_closing_bracket_pos(str, opening_bracket_pos); if (pos != count_pos || opening_bracket_pos == string::npos || closing_bracket_pos == string::npos) { ERROR("Could not parse COUNT specifier in " + mdl_string_wo_comment + format_msg); } pos = closing_bracket_pos + 1; } break; case '(': num_parens++; pos++; break; case ')': num_parens--; pos++; break; case '+': case '-': // allowed pos++; break; default: ERROR("Unexpected character '" + str[pos] + "' in MDL string " + mdl_string_wo_comment + format_msg); break; } } if (num_parens != 0) { ERROR("Not matching parentheses in MDL string " + mdl_string_wo_comment + format_msg); } if (pos == str.size()) { // all checked, nothing more to process return ""; } if (pos < str.size() && str.find(COUNT, pos) != string::npos) { ERROR("Unexpected COUNT specifier in MDL string " + mdl_string_wo_comment + format_msg); } // what optionally follows must be * or / string mul_or_div_expr_str = str.substr(pos); char first_expr_char = mul_or_div_expr_str[0]; if (first_expr_char != '*' && first_expr_char != '/') { ERROR("The only allowed operator following COUNT expression(s) is '*' or '/', error for '" + first_expr_char + "' in " + mdl_string_wo_comment + format_msg); } return mul_or_div_expr_str; } // sets is_gdat, may return empty string meaning that the name must be determined automatically static string get_count_file_name(Value& reaction_output_item, bool& is_gdat) { if (reaction_output_item.isMember(KEY_OUTPUT_FILE_OVERRIDE)) { string res = reaction_output_item[KEY_OUTPUT_FILE_OVERRIDE].asString(); string gdat = "gdat"; is_gdat = res.size() > gdat.size() && res.substr(res.size() - gdat.size()) == gdat; return res; } else { // default string mdl_file_prefix = reaction_output_item[KEY_MDL_FILE_PREFIX].asString(); is_gdat = false; if (mdl_file_prefix == "") { // not set return ""; } else { return mdl_file_prefix + ".dat"; } } } void MCell4Generator::generate_counts( std::ostream& out, std::vector<std::string>& python_counts, bool& has_bng_observables) { if (!data.mcell.isMember(KEY_REACTION_DATA_OUTPUT)) { return; } if (data.bng_mode) { python_gen->generate_all_bngl_reaction_rules_used_in_observables(out); } has_bng_observables = false; Value& reaction_data_output = get_node(data.mcell, KEY_REACTION_DATA_OUTPUT); check_version(KEY_DEFINE_MOLECULES, reaction_data_output, VER_DM_2016_03_15_1800); string rxn_step = reaction_data_output[KEY_RXN_STEP].asString(); Value& reaction_output_list = get_node(reaction_data_output, KEY_REACTION_OUTPUT_LIST); for (Value::ArrayIndex i = 0; i < reaction_output_list.size(); i++) { Value& reaction_output_item = reaction_output_list[i]; string observable_name = reaction_output_item[KEY_MDL_FILE_PREFIX].asString(); bool is_gdat = false; string file_name = get_count_file_name(reaction_output_item, is_gdat); bool must_be_in_python = false; bool rxn_not_mol; bool molecules_not_species; bool single_term; string what_to_count; string where_to_count; // empty for WORLD string orientation; string count_location = reaction_output_item[KEY_COUNT_LOCATION].asString(); string rxn_or_mol = reaction_output_item[KEY_RXN_OR_MOL].asString(); string mul_div_str = ""; if (rxn_or_mol == VALUE_FILE) { // Always skip "FILE:" observables continue; } else if (rxn_or_mol == VALUE_MDLSTRING) { // first check whether we need to generate count_terms string mdl_string = reaction_output_item[KEY_MDL_STRING].asString(); uint num_counts = get_num_counts_in_mdl_string(mdl_string); if (num_counts == 0) { ERROR("There is no 'COUNT' in mdl_string for output with filename " + observable_name + "."); } else if (num_counts == 1) { single_term = true; process_single_count_term( data, mdl_string, rxn_not_mol, molecules_not_species, what_to_count, where_to_count, orientation); } else { must_be_in_python = true; single_term = false; } mul_div_str = check_mdlstring_count_and_get_mult_or_div(mdl_string); assert(mul_div_str.empty() || mul_div_str[0] == '*' || mul_div_str[0] == '/'); } else if (rxn_or_mol == VALUE_REACTION) { single_term = true; rxn_not_mol = true; what_to_count = reaction_output_item[KEY_REACTION_NAME].asString(); if (count_location == VALUE_COUNT_LOCATION_OBJECT) { where_to_count = reaction_output_item[KEY_OBJECT_NAME].asString(); } else if (count_location == VALUE_COUNT_LOCATION_REGION) { where_to_count = reaction_output_item[KEY_REGION_NAME].asString(); } else { assert(count_location == VALUE_COUNT_LOCATION_WORLD); } } else if (rxn_or_mol == VALUE_MOLECULE) { single_term = true; rxn_not_mol = false; what_to_count = reaction_output_item[KEY_MOLECULE_NAME].asString(); if (count_location == VALUE_COUNT_LOCATION_OBJECT) { where_to_count = reaction_output_item[KEY_OBJECT_NAME].asString(); } else if (count_location == VALUE_COUNT_LOCATION_REGION) { where_to_count = reaction_output_item[KEY_REGION_NAME].asString(); } else { assert(count_location == VALUE_COUNT_LOCATION_WORLD); } } else { ERROR("Invalid rxn_or_mol '" + rxn_or_mol + "' in reaction_output_list for output with filename " + observable_name + "."); } if (observable_name == "") { // this is a case where mdl_string is empty string where = where_to_count; if (where == "") { where = WORLD_FIRST_UPPER; } // using underscore instead of '.' that was used in MCell3, '.' cannot be used in BNGL observable_name = what_to_count + "_" + where; if (mul_div_str != "") { observable_name += '_' + fix_id(mul_div_str); } // TODO: this might need further checks if (observable_name.find_first_of(" ,+*/\\") != string::npos) { cout << "Warning: count file prefix '" + observable_name + "' is probably invalid.\n"; } if (file_name == "") { file_name = observable_name + ".dat"; } } if (data.bng_mode && !must_be_in_python && bng_gen->can_express_count_with_bngl( single_term, rxn_not_mol, where_to_count, orientation, mul_div_str, rxn_step)) { if (!has_bng_observables) { bng_gen->open_observables_section(); } bng_gen->generate_single_count( observable_name, what_to_count, get_description(reaction_output_item), molecules_not_species); has_bng_observables = true; if (is_gdat) { if (data.bng_observables_output_gdat_file == "") { data.bng_observables_output_gdat_file = file_name; } else if (file_name != data.bng_observables_output_gdat_file) { ERROR("Cannot use multiple GDAT output files with BNGL mode, error for " + file_name); } } } else { string name = fix_id(COUNT_PREFIX + observable_name); // prepare count terms string mdl_string = reaction_output_item[KEY_MDL_STRING].asString(); string count_term_name = python_gen->generate_count_terms_for_expression( out, mdl_string, what_to_count, where_to_count, orientation, rxn_not_mol); where_to_count = ""; gen_description(out, reaction_output_item); python_gen->generate_single_count( out, name, observable_name, file_name, count_term_name, mul_div_str, rxn_step ); python_counts.push_back(name); } } } void MCell4Generator::generate_observables() { ofstream out; open_and_check_file(OBSERVABLES, out); out << GENERATED_WARNING << "\n"; out << IMPORT_OS; out << IMPORT_SHARED; out << IMPORT_MCELL_AS_M; out << make_import(PARAMETERS); out << make_import(SUBSYSTEM); if (geometry_generated) { out << make_import(GEOMETRY); } out << MODEL_PATH_SETUP << "\n"; out << "\n"; out << make_section_comment(OBSERVABLES); bool use_cellblender_output; if (data.mcell[KEY_INITIALIZATION].isMember(KEY_EXPORT_ALL_ASCII)) { use_cellblender_output = !data.mcell[KEY_INITIALIZATION][KEY_EXPORT_ALL_ASCII].asBool(); } else { use_cellblender_output = false; } vector<string> viz_outputs; python_gen->generate_viz_outputs(out, use_cellblender_output, viz_outputs); vector<string> counts; bool has_bngl_observables; generate_counts(out, counts, has_bngl_observables); out << make_section_comment("create observables object and add components"); gen_ctor_call(out, OBSERVABLES, NAME_CLASS_OBSERVABLES, false); for (const string& s: viz_outputs) { gen_method_call(out, OBSERVABLES, NAME_ADD_VIZ_OUTPUT, s); } for (const string& r: counts) { gen_method_call(out, OBSERVABLES, NAME_ADD_COUNT, r); } if (has_bngl_observables) { out << "\n# load observables information from bngl file\n"; gen_method_call( out, OBSERVABLES, NAME_LOAD_BNGL_OBSERVABLES, get_abs_path(get_filename(data.output_files_prefix, MODEL, BNGL_EXT)) + ", " + "'" + DEFAULT_RXN_OUTPUT_FILENAME_PREFIX + data.bng_observables_output_gdat_file + "'", S(SHARED) + "." + PARAMETER_OVERRIDES ); bng_gen->close_observables_section(); } observables_generated = true; out.close(); } // returns true for "ON and false for "OFF, fails when a different value is used static std::string convert_warning_level(const std::string& value) { if (value == VALUE_ERROR) { return S(MDOT) + NAME_ENUM_WARNING_LEVEL + "." + NAME_EV_ERROR; } else if (value == VALUE_WARNING) { return S(MDOT) + NAME_ENUM_WARNING_LEVEL + "." + NAME_EV_WARNING; } else if (value == VALUE_IGNORED) { return S(MDOT) + NAME_ENUM_WARNING_LEVEL + "." + NAME_EV_IGNORE; } else { ERROR("Invalid value " + value + ", expected only WARNING or IGNORED.\n"); } } void MCell4Generator::generate_config(ostream& out) { out << make_section_comment("configuration"); // using values from generated parameters.py where applicable gen_assign(out, MODEL, NAME_CONFIG, NAME_TIME_STEP, PARAM_TIME_STEP); if (data.mcell.isMember(KEY_USE_BNG_UNITS) && data.mcell[KEY_USE_BNG_UNITS].asBool()) { gen_assign(out, MODEL, NAME_CONFIG, NAME_USE_BNG_UNITS, true); } gen_assign(out, MODEL, NAME_CONFIG, NAME_SEED, PARAM_SEED); gen_assign(out, MODEL, NAME_CONFIG, NAME_TOTAL_ITERATIONS, PARAM_ITERATIONS); out << "\n"; Value& initialization = data.mcell[KEY_INITIALIZATION]; if (initialization.isMember(KEY_WARNINGS)) { Value& warnings = initialization[KEY_WARNINGS]; if (warnings.isMember(KEY_HIGH_REACTION_PROBABILITY)) { gen_assign(out, MODEL, NAME_WARNINGS, NAME_HIGH_REACTION_PROBABILITY, convert_warning_level(warnings[KEY_HIGH_REACTION_PROBABILITY].asString()) ); } if (warnings.isMember(KEY_MOLECULE_PLACEMENT_FAILURE)) { gen_assign(out, MODEL, NAME_WARNINGS, NAME_MOLECULE_PLACEMENT_FAILURE, convert_warning_level(warnings[KEY_HIGH_REACTION_PROBABILITY].asString()) ); } } if (initialization.isMember(KEY_NOTIFICATIONS)) { Value& notifications = initialization[KEY_NOTIFICATIONS]; if (notifications.isMember(KEY_SPECIES_REACTIONS_REPORT)) { gen_assign(out, MODEL, NAME_NOTIFICATIONS, NAME_RXN_AND_SPECIES_REPORT, notifications[KEY_SPECIES_REACTIONS_REPORT].asBool() ); } if (notifications.isMember(KEY_VARYING_PROBABILITY_REPORT)) { gen_assign(out, MODEL, NAME_NOTIFICATIONS, NAME_RXN_PROBABILITY_CHANGED, notifications[KEY_VARYING_PROBABILITY_REPORT].asBool() ); } } out << "\n"; if (!data.mcell.isMember(KEY_INITIALIZATION)) { ERROR(S("Data model does not contain key ") + KEY_INITIALIZATION + "."); } Value& partitions = initialization[KEY_PARTITIONS]; // choose the largest value for partition size and the smallest step double x_start = stod(partitions[KEY_X_START].asString()); double x_end = stod(partitions[KEY_X_END].asString()); double x_step = stod(partitions[KEY_X_STEP].asString()); double y_start = stod(partitions[KEY_Y_START].asString()); double y_end = stod(partitions[KEY_Y_END].asString()); double y_step = stod(partitions[KEY_Y_STEP].asString()); double z_start = stod(partitions[KEY_Z_START].asString()); double z_end = stod(partitions[KEY_Z_END].asString()); double z_step = stod(partitions[KEY_Z_STEP].asString()); double partition_dimension; if (!cmp_eq(x_start, -x_end) || !cmp_eq(y_start, -y_end) || !cmp_eq(y_start, -y_end) || !cmp_eq(x_start, y_start) || !cmp_eq(y_start, z_start) || !cmp_eq(x_end, y_end) || !cmp_eq(y_end, z_end) ) { gen_assign_vec3(out, MODEL, NAME_CONFIG, NAME_INITIAL_PARTITION_ORIGIN, x_start, y_start, z_start); // select the largest difference as partition dimension Vec3 dims = Vec3(x_end - x_start, y_end - y_start, z_end - z_start); partition_dimension = max3(dims); } else { partition_dimension = x_end * 2; } double partition_step; if (!cmp_eq(x_step, y_step) || !cmp_eq(y_step, z_step)) { cout << "Message: Individual partition step sizes are different, changing the step to be the smallest of them.\n"; partition_step = min3d(x_step, y_step, z_step); } else { partition_step = x_step; } gen_assign(out, MODEL, NAME_CONFIG, NAME_PARTITION_DIMENSION, partition_dimension); gen_assign(out, MODEL, NAME_CONFIG, NAME_SUBPARTITION_DIMENSION, partition_step); out << "\n"; out << make_section_comment("default configuration overrides"); // FIXME: check the value against the default in the yaml API file bool center_molecules_on_grid = initialization[KEY_CENTER_MOLECULES_ON_GRID].asBool(); if (center_molecules_on_grid) { gen_assign(out, MODEL, NAME_CONFIG, NAME_CENTER_MOLECULES_ON_GRID, center_molecules_on_grid); } string radius = initialization[KEY_INTERACTION_RADIUS].asString(); if (radius != "") { gen_assign(out, MODEL, NAME_CONFIG, NAME_INTERACTION_RADIUS, radius); } string surf_grid_density = initialization[KEY_SURFACE_GRID_DENSITY].asString(); if (surf_grid_density != "" && surf_grid_density != "10000") { gen_assign(out, MODEL, NAME_CONFIG, NAME_SURFACE_GRID_DENSITY, surf_grid_density); } string vacancy_search_distance = initialization[KEY_VACANCY_SEARCH_DISTANCE].asString(); if (vacancy_search_distance != "" && vacancy_search_distance != "10") { gen_assign(out, MODEL, NAME_CONFIG, NAME_VACANCY_SEARCH_DISTANCE, vacancy_search_distance); } } void MCell4Generator::generate_model(const bool print_failed_marker) { ofstream out; open_and_check_file(MODEL, out); out << INTERPRETER; out << GENERATED_WARNING << "\n"; if (print_failed_marker) { out << "ERROR: Conversion from data model failed, these generated sources are result of a " "best-effort conversion and will contain errors that might need to be fixed manually.\n\n"; } out << IMPORT_SYS_OS; out << get_import("importlib.util"); out << "\n"; out << MODEL_PATH_SETUP; out << "\n"; out << MCELL_PATH_SETUP; out << "\n"; out << IMPORT_MCELL_AS_M; string customization_module = CUSTOMIZATION; string shared_module = SHARED; out << "\n" << make_section_comment("customization and argument processing"); out << "# this module is used to hold any overrides of parameter values\n"; out << IMPORT_SHARED; out << "# import the customization.py module if it exists\n"; out << get_customization_import(customization_module); out << "\n"; if (data.testing_mode) { out << CHECKPOINT_ITERATION << " = None\n\n"; } out << "# process command-line arguments\n"; out << get_argparse_w_customization_begin(customization_module); if (data.testing_mode) { out << get_argparse_checkpoint_iteration(); } out << get_argparse_w_customization_end(); out << "\n"; out << S("\n# the module parameters uses ") + SHARED + "." + PARAMETER_OVERRIDES + " to override parameter values\n"; out << make_import(PARAMETERS); out << "\n\n"; out << get_resume_from_checkpoint_code(); out << "\n" << make_section_comment("model creation and simulation"); out << "# create main model object\n"; gen_ctor_call(out, MODEL, NAME_CLASS_MODEL, false); out << "\n"; generate_config(out); if (data.testing_mode) { out << make_section_comment("testing-specific configuration"); gen_assign(out, MODEL, NAME_CONFIG, NAME_REACTION_CLASS_CLEANUP_PERIODICITY, TESTING_RXN_CLASS_CLEANUP_PERIODICITY); gen_assign(out, MODEL, NAME_CONFIG, NAME_SPECIES_CLEANUP_PERIODICITY, TESTING_SPECIES_CLEANUP_PERIODICITY); out << "\n"; } out << make_section_comment("add components"); out << get_import(get_module_name(SUBSYSTEM)); out << get_import(get_module_name(INSTANTIATION)); if (observables_generated) { out << get_import(get_module_name(OBSERVABLES)); } out << "\n"; gen_method_call(out, MODEL, NAME_ADD_SUBSYSTEM, get_module_name(SUBSYSTEM) + "." + SUBSYSTEM); gen_method_call(out, MODEL, NAME_ADD_INSTANTIATION, get_module_name(INSTANTIATION) + "." + INSTANTIATION); if (observables_generated) { gen_method_call(out, MODEL, NAME_ADD_OBSERVABLES, get_module_name(OBSERVABLES) + "." + OBSERVABLES); } out << "\n"; out << get_user_defined_configuration(customization_module); out << "\n"; out << make_section_comment("initialization and execution"); out << "if " << customization_module << " and '" << CUSTOM_INIT_AND_RUN << "' in dir(" << customization_module << "):\n" << IND4 << customization_module << "." << CUSTOM_INIT_AND_RUN << "(" << MODEL << ")\n" << "else:\n" ; out << IND4; gen_method_call(out, MODEL, NAME_INITIALIZE); out << "\n"; if (!data.checkpoint_iterations.empty()) { out << make_section_comment("checkpoint iterations"); for (int it: data.checkpoint_iterations) { out << IND4; gen_method_call(out, MODEL, NAME_SCHEDULE_CHECKPOINT, to_string(it)); } out << "\n"; } out << IND4 << "if " << PARAM_DUMP << ":\n"; out << IND8; gen_method_call(out, MODEL, NAME_DUMP_INTERNAL_STATE); out << "\n"; // method export_data_model uses target directory from viz_outputs out << IND4 << "if " << PARAM_EXPORT_DATA_MODEL << " and " << MODEL << "." << NAME_VIZ_OUTPUTS << ":\n"; out << IND8; gen_method_call(out, MODEL, NAME_EXPORT_DATA_MODEL); out << "\n"; out << IND4; gen_method_call(out, MODEL, NAME_RUN_ITERATIONS, PARAM_ITERATIONS); out << IND4; gen_method_call(out, MODEL, NAME_END_SIMULATION); } void MCell4Generator::generate_customization_template() { // check if file exists, do not overwrite string cust_filename = S(CUSTOMIZATION) + PY_EXT; ifstream tmp; tmp.open(cust_filename); if (tmp.is_open()) { cout << "Message: custom file " + cust_filename + " already exists, keeping it as it is.\n"; tmp.close(); return; } ofstream out; open_and_check_file_w_prefix("", CUSTOMIZATION, out); out << "# This file contains hooks to override default MCell4 model\n" "# code behavior for models generated from CellBlender\n" "# WARNING: do not import file parameters.py at the top level of this file,\n" "# only from individual functions if needed, parameters such as SEED\n" "# will not be set correctly if parameters are imported too early\n"; out << IMPORT_SYS_OS; out << IMPORT_SHARED; out << IMPORT_MCELL_AS_M; out << TEMPLATE_CUSTOM_ARGPARSE_AND_PARAMETERS << "\n"; out << TEMPLATE_CUSTOM_CONFIG << "\n"; out << get_template_custom_init_and_run(get_module_name(PARAMETERS)) << "\n"; } } // namespace MCell
C++
3D
mcellteam/mcell
utils/data_model_to_pymcell/bngl_generator.h
.h
3,357
95
/****************************************************************************** * * Copyright (C) 2020 by * The Salk Institute for Biological Studies * * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. * ******************************************************************************/ #ifndef UTILS_DATA_MODEL_TO_PYMCELL_BNGL_GENERATOR_H_ #define UTILS_DATA_MODEL_TO_PYMCELL_BNGL_GENERATOR_H_ #include <string> #include <iostream> #include "json/json.h" #include "bng/bngl_names.h" namespace MCell { typedef std::map<std::string, std::set<std::string>> ParentToChildCompartmentsMap; class BNGLGenerator { public: BNGLGenerator( const std::string& bngl_filename_, std::ostream& bng_out_, SharedGenData& data_) : bngl_filename(bngl_filename_), bng_out(bng_out_), data(data_) { } void generate_units_information_header(); void generate_parameters(std::ostream& python_out); void generate_mol_types(std::ostream& python_out); void generate_compartments(); void open_reaction_rules_section() { bng_out << BNG::BEGIN_REACTION_RULES << "\n"; } std::string generate_single_reaction_rule(Json::Value& reaction_list_item, const bool generate_name); void close_reaction_rules_section() { bng_out << BNG::END_REACTION_RULES << "\n\n"; } bool can_express_count_with_bngl( const bool single_term, const bool rxn_not_mol, const std::string& where_to_count, const std::string& orientation, const std::string& mul_div_str, const std::string& rxn_step) const; void open_observables_section() { bng_out << BNG::BEGIN_OBSERVABLES << "\n"; } void generate_single_count( const std::string& observable_name, const std::string& what_to_count, const std::string& description, const bool molecules_not_species); void close_observables_section() { bng_out << BNG::END_OBSERVABLES << "\n\n"; } bool can_express_release_with_bngl(Json::Value& release_site_item); void open_seed_species_section() { bng_out << BNG::BEGIN_SEED_SPECIES << "\n"; } void generate_single_release_site( const std::string& bngl_cplx, const std::string& quantity, const std::string& description); void close_seed_species_section() { bng_out << BNG::END_SEED_SPECIES << "\n\n"; } void add_comment(const std::string& text) { bng_out << "# " << text << "\n"; } private: void generate_single_bngl_parameter(Json::Value& parameter); void generate_single_python_parameter(std::ostream& python_out, Json::Value& parameter); void generate_bngl_mol_type(Json::Value& molecule_list_item); void generate_python_mol_type_info(std::ostream& python_out, Json::Value& molecule_list_item); void get_compartment_volume_and_area(const std::string& name, double& volume, double& area); Json::Value& find_geometry_object(const std::string& name); void generate_single_compartment(Json::Value& model_object); const std::string bngl_filename; std::ostream& bng_out; SharedGenData& data; // owned by MCell4Generator std::map<std::string, std::pair<double, double>> compartment_name_to_volume_area_cache; ParentToChildCompartmentsMap volume_compartment_children; }; } /* namespace MCell */ #endif /* UTILS_DATA_MODEL_TO_PYMCELL_BNGL_GENERATOR_H_ */
Unknown
3D
mcellteam/mcell
utils/data_model_to_pymcell/generator_utils.cpp
.cpp
18,740
699
/****************************************************************************** * * Copyright (C) 2020 by * The Salk Institute for Biological Studies * * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. * ******************************************************************************/ #include <fstream> #include <algorithm> #include <ctype.h> #include "generator_utils.h" #include "api/python_export_constants.h" #include "api/compartment_utils.h" #include "generator_structs.h" using namespace MCell::API; namespace MCell { void check_not_empty(const Value& parent, const char* key, const std::string& msg_location) { string s = parent[key].asString(); bool white_space = std::all_of(s.begin(), s.end(), ::isspace); if (s == "" || white_space) { ERROR("Unexpected empty string as value of " + msg_location + " - " + key + "."); } } static std::string replace_id_with_function(const std::string& id, const bool use_python_functions) { const auto& func_it = mdl_functions_to_py_bngl_map.find(id); if (func_it != mdl_functions_to_py_bngl_map.end()) { // replace if (use_python_functions) { return func_it->second.first; } else { // BNGL variant return func_it->second.second; } } else { // other id, keep it as it is return id; } } // when use_python_functions is true, function calls are replaced with Python function names // when false, they are replaced with BNGL function names std::string replace_function_calls_in_expr(const std::string& data_model_expr, const bool use_python_functions) { std::string res; // all function names are represented as ids, i.e. [a-zA-Z_][a-zA-Z0-9_]* // practically the same automaton as in get_used_ids enum state_t { START, IN_ID, IN_NUM }; state_t state = START; string curr_id; for (size_t i = 0; i < data_model_expr.size(); i++) { char c = data_model_expr[i]; switch (state) { case START: if (isalpha(c) || c == '_') { state = IN_ID; curr_id += c; } else if (isdigit(c)) { state = IN_NUM; res += c; } else { res += c; } break; case IN_ID: if (isalnum(c) || c == '_') { curr_id += c; } else { res += replace_id_with_function(curr_id, use_python_functions); res += c; curr_id = ""; state = START; } break; case IN_NUM: if (isdigit(c) || c == '.' || c == 'e' || c == '+' || c == '-') { // ok - but must not be exp res += c; } else { if (isalpha(c) || c == '_') { state = IN_ID; curr_id += c; } else { state = START; res += c; } } break; } } if (state == IN_ID) { res += replace_id_with_function(curr_id, use_python_functions); } return res; } std::string get_module_name_w_prefix(const std::string& output_files_prefix, const std::string file_suffix) { if (output_files_prefix == "" || output_files_prefix.back() == '/' || output_files_prefix.back() == '\\') { return file_suffix; } else { size_t pos = output_files_prefix.find_last_of("/\\"); if (pos == string::npos) { return output_files_prefix + "_" + file_suffix; } else { return output_files_prefix.substr(pos) + "_" + file_suffix; } } } void parse_rxn_rule_side( Json::Value& substances_node, std::vector<std::string>& substances, std::vector<std::string>& orientations) { // cannot use BNGL parser directly because reactions may contain orientations substances.clear(); orientations.clear(); string str = substances_node.asString(); // finite automata to parse the reaction side string, e.g. "a + b" enum state_t { START, CPLX, IN_PAREN, AFTER_MOL, AFTER_ORIENT, AFTER_PLUS }; state_t state = START; string current_id; for (size_t i = 0; i < str.size(); i++) { char c = str[i]; switch (state) { case START: if (isalnum(c) || c == '_' || c == '.' || c == '@') { state = CPLX; current_id = c; } else if (isblank(c)) { // ok } else { ERROR("Could not parse reaction side " + str + " (START)."); } break; case CPLX: if (isalnum(c) || c == '_' || c == '.' || c == '@' || c == ':') { current_id += c; } else if (c == '(') { state = IN_PAREN; current_id += '('; } else if (isblank(c) || c == '+' || c == '\'' || c == ',' || c == ';') { substances.push_back(current_id); orientations.push_back(""); if (c == '\'' || c == ',' || c == ';') { orientations.back() = c; } current_id = ""; if (c == '+') { state = AFTER_PLUS; } else { state = AFTER_MOL; } } else { ERROR("Could not parse reaction side " + str + " (MOL_ID)."); } break; case IN_PAREN: if (isalnum(c) || c == '_' || c == ',' || c == '~' || c == '!' || c == '+' || c == '?') { current_id += c; } else if (c == ')') { state = CPLX; current_id += ')'; } else { ERROR("Could not parse reaction side " + str + " (IN_PAREN)."); } break; case AFTER_MOL: if (c == '+') { state = AFTER_PLUS; } else if (c == '\'') { state = AFTER_ORIENT; orientations.back() = c; } else if (c == ',') { state = AFTER_ORIENT; orientations.back() = c; } else if (c == ';') { state = AFTER_ORIENT; orientations.back() = c; } else if (isblank(c)) { // ok } else { ERROR("Could not parse reaction side " + str + " (AFTER_MOL)."); } break; case AFTER_ORIENT: if (c == '+') { state = AFTER_PLUS; } else if (isblank(c)) { // ok } else { ERROR("Could not parse reaction side " + str + " (AFTER_ORIENT)."); } break; case AFTER_PLUS: if (isalnum(c) || c == '_' || c == '@') { state = CPLX; current_id = c; } else if (isblank(c)) { // ok } else { ERROR("Could not parse reaction side " + str + " (AFTER_PLUS)."); } break; default: assert(false); } } if (current_id != "") { substances.push_back(current_id); orientations.push_back(""); } } string remove_compartments(const std::string& species_name) { size_t i = 0; string res; bool in_compartment = false; while (i < species_name.size()) { char c = species_name[i]; if (c == '@') { assert(!in_compartment); in_compartment = true; } else if (in_compartment && (!isalnum(c) && c != '_')) { in_compartment = false; if (c != ':') { res += c; } } else if (!in_compartment) { res += c; } i++; } return res; } // returns "" if there are multiple compartments and sets *has_multiple_compartments to // true if it is not nullptr string get_single_compartment(const std::string& name, bool* has_multiple_compartments) { std::vector<std::string> compartments; API::get_compartment_names(name, compartments); if (has_multiple_compartments != nullptr) { *has_multiple_compartments = false; } if (compartments.empty()) { return ""; } else { string res = compartments[0]; for (size_t i = 1; i < compartments.size(); i++) { if (res != compartments[i]) { // multiple compartments if (has_multiple_compartments != nullptr) { *has_multiple_compartments = true; } return ""; } } return res; } } static string make_cplx(const string bngl_str, const string orient = "", const string compartment = "") { string res = S(MDOT) + API::NAME_CLASS_COMPLEX + "('" + fix_dots_in_simple_species(bngl_str) + "'"; if (orient != "") { res += S(", ") + API::NAME_ORIENTATION + " = " + MDOT + API::NAME_ENUM_ORIENTATION + "." + orient; } if (compartment != "") { res += S(", ") + API::NAME_COMPARTMENT_NAME + " = '" + compartment + "'"; } res += ")"; return res; } bool static is_mdot_superclass(const std::string& name) { return name == S(MDOT) + API::NAME_CV_AllMolecules || name == S(MDOT) + API::NAME_CV_AllVolumeMolecules || name == S(MDOT) + API::NAME_CV_AllSurfaceMolecules; } string make_species_or_cplx( const SharedGenData& data, const std::string& name, const std::string& orient, const std::string& compartment) { bool is_superclass = is_mdot_superclass(name); if (is_superclass && orient == "" && compartment == "") { return name; } if (is_superclass || !data.bng_mode) { stringstream ss; const SpeciesOrMolType* species_info = data.find_species_or_mol_type_info(name); if (is_superclass || (species_info != nullptr && species_info->is_species)) { // substance was declared as species, we can use its id directly ss << make_id(name) << "." << API::NAME_INST << "("; if (orient != "") { assert(compartment == ""); ss << API::NAME_ORIENTATION << " = " << MDOT << API::NAME_ENUM_ORIENTATION << "." << orient; } if (compartment != "") { assert(orient == ""); ss << API::NAME_COMPARTMENT_NAME << " = '" << compartment << "'"; } ss << ")"; return ss.str(); } } // otherwise we will generate a BNGL string return make_cplx(name, orient, compartment); } string reaction_name_to_id(const string& json_name) { string res_name = json_name; replace(res_name.begin(), res_name.end(), ' ', '_'); replace(res_name.begin(), res_name.end(), '.', '_'); replace(res_name.begin(), res_name.end(), ')', '_'); replace(res_name.begin(), res_name.end(), '(', '_'); replace(res_name.begin(), res_name.end(), '!', '_'); replace(res_name.begin(), res_name.end(), '~', '_'); replace(res_name.begin(), res_name.end(), ':', '_'); res_name = regex_replace(res_name, regex("<->"), "revto"); res_name = regex_replace(res_name, regex("->"), "to"); res_name = regex_replace(res_name, regex("\\+"), "plus"); res_name = regex_replace(res_name, regex("\\?"), "any_bond"); res_name = regex_replace(res_name, regex("'"), "_up"); res_name = regex_replace(res_name, regex(","), "_down"); res_name = regex_replace(res_name, regex(";"), "_any"); res_name = regex_replace(res_name, regex("@"), "_at_"); return res_name; } string get_rxn_id(Json::Value& reaction_list_item, uint& unnamed_rxn_counter) { string name = reaction_list_item[KEY_RXN_NAME].asString(); if (name == "") { name = UNNAMED_REACTION_RULE_PREFIX + to_string(unnamed_rxn_counter); unnamed_rxn_counter++; } else { name = reaction_name_to_id(name); } return name; } string create_count_name( const string& what_to_count, const string& where_to_count, const bool molecules_not_species) { // first remove all cterm_refixes regex pattern_cterm(COUNT_TERM_PREFIX); string what_to_count_no_cterm = regex_replace(what_to_count, pattern_cterm, ""); string res = COUNT_PREFIX + fix_id(what_to_count_no_cterm); if (!molecules_not_species) { res += "_species"; } if (where_to_count != WORLD && where_to_count != "") { res += "_" + where_to_count; } return res; } uint get_num_counts_in_mdl_string(const string& mdl_string) { uint res = 0; size_t pos = 0; while ((pos = mdl_string.find(COUNT, pos)) != string::npos) { res++; pos += strlen(COUNT); } return res; } string remove_c_comment(const string& str) { std::regex e ("/\\*.*\\*/"); return std::regex_replace(str, e, ""); } string remove_whitespace(const string& str) { std::regex e ("[ \t]"); return std::regex_replace(str, e, ""); } size_t find_end_brace_pos(const string& str, const size_t start) { int braces_count = 1; assert(str[start] == '['); size_t i = start + 1; while (braces_count > 0 && i < str.size()) { if (str[i] == '[') { braces_count++; } else if (str[i] == ']') { braces_count--; } i++; } return i - 1; } void process_single_count_term( const SharedGenData& data, const string& mdl_string, bool& rxn_not_mol, bool& molecules_not_species, string& what_to_count, string& where_to_count, string& orientation) { // mdl_string is always in the form COUNT[what,where] size_t start_brace = mdl_string.find('['); size_t comma = mdl_string.rfind(','); size_t end_brace = find_end_brace_pos(mdl_string, start_brace); if (mdl_string.find(COUNT) == string::npos) { ERROR("String 'COUNT' was not found in mdl_string '" + mdl_string + "'."); } if (start_brace == string::npos || comma == string::npos || end_brace == string::npos || start_brace > comma || start_brace > end_brace || comma > end_brace ) { ERROR("Malformed mdl_string '" + mdl_string + "'."); } what_to_count = mdl_string.substr(start_brace + 1, comma - start_brace - 1); what_to_count = trim(what_to_count); // default is 'molecules_pattern', for now we are storing the // as a comment because the counting type belongs to the count term, // not to the whole 'reaction_output_list' // TODO: this should resolved in a better way molecules_not_species = true; if (what_to_count.find(MARKER_SPECIES_COMMENT) != string::npos) { molecules_not_species = false; } what_to_count = remove_c_comment(what_to_count); // process orientation orientation = ""; assert(what_to_count != ""); char last_c = what_to_count.back(); if (last_c == '\'' || last_c == ',' || last_c == ';') { string s; s = last_c; orientation = convert_orientation(s); what_to_count = what_to_count.substr(0, what_to_count.size() - 1); } if (data.find_reaction_rule_info(what_to_count) != nullptr) { rxn_not_mol = true; } else { // if we did not find the name to be a reaction, we assume it is a BNGL pattern rxn_not_mol = false; } string where_tmp = mdl_string.substr(comma + 1, end_brace - comma - 1); size_t dot_pos = where_tmp.find('.'); if (dot_pos != string::npos) { // no completely sure when a '.' can appear where_tmp = where_tmp.substr(dot_pos + 1); } where_tmp = trim(where_tmp); if (where_tmp == WORLD) { where_tmp = ""; } // remove all [ALL] and replace box1[box1_sr1] -> box1_box1_sr1 where_to_count = ""; size_t i = 0; while (i < where_tmp.size()) { char c = where_tmp[i]; if (c == '[') { // followed by ALL]? if (i + 4 < where_tmp.size() && where_tmp.substr(i + 1, 4) == "ALL]") { // skip i += 5; } else { // replace where_to_count += '_'; i++; } } else if (c == ']') { // ignore i++; } else { // keep character where_to_count += c; i++; } } } // sets val if the name_or_value is a floating point value, // if not, tries to find the parameter and reads its value // returns true on success // parameters are not evaluated and only one level is tried, // returns false if value was not obtained bool get_parameter_value(Json::Value& mcell, const string& name_or_value, double& val) { try { val = stod(name_or_value); return true; } catch (const std::invalid_argument&) { // not a float, try to get parameter value if (mcell.isMember(KEY_PARAMETER_SYSTEM) && mcell.isMember(KEY_MODEL_PARAMETERS)) { Json::Value& params = mcell[KEY_PARAMETER_SYSTEM][KEY_MODEL_PARAMETERS]; for (Value::ArrayIndex i = 0; i < params.size(); i++) { if (params[i][KEY_NAME].asString() == name_or_value) { try { if (params[i].isMember(KEY__EXTRAS)) { val = stod(params[i][KEY__EXTRAS][KEY_PAR_VALUE].asString()); } else { val = stod(params[i][KEY_PAR_EXPRESSION].asString()); } return true; } catch (const std::invalid_argument&) { return false; } } } } } return false; } bool is_volume_mol_type(Json::Value& mcell, const std::string& mol_type_name) { string mol_type_name_no_comp = remove_compartments(mol_type_name); Value& define_molecules = get_node(mcell, KEY_DEFINE_MOLECULES); check_version(KEY_DEFINE_MOLECULES, define_molecules, VER_DM_2014_10_24_1638); Value& molecule_list = get_node(define_molecules, KEY_MOLECULE_LIST); for (Value::ArrayIndex i = 0; i < molecule_list.size(); i++) { Value& molecule_list_item = molecule_list[i]; check_version(KEY_MOLECULE_LIST, molecule_list_item, VER_DM_2018_10_16_1632); string name = molecule_list_item[KEY_MOL_NAME].asString(); if (name != mol_type_name_no_comp) { continue; } string mol_type = molecule_list_item[KEY_MOL_TYPE].asString(); CHECK_PROPERTY(mol_type == VALUE_MOL_TYPE_2D || mol_type == VALUE_MOL_TYPE_3D); return mol_type == VALUE_MOL_TYPE_3D; } ERROR("Could not find species or molecule type '" + mol_type_name_no_comp + "'."); } static void get_mol_types_in_species(const std::string& species_name, vector<string>& mol_types) { mol_types.clear(); size_t i = 0; string current_name; bool in_name = true; while (i < species_name.size()) { char c = species_name[i]; if (c == '(') { in_name = false; assert(current_name != ""); mol_types.push_back(current_name); current_name = ""; } else if (c == '.') { in_name = true; } else if (in_name && !isspace(c)) { current_name += c; } i++; } if (current_name != "") { mol_types.push_back(current_name); } } bool is_volume_species(Json::Value& mcell, const std::string& species_name) { if (is_simple_species(species_name)) { return is_volume_mol_type(mcell, species_name); } else { vector<string> mol_types; get_mol_types_in_species( species_name, mol_types); for (string& mt: mol_types) { if (!is_volume_mol_type(mcell, mt)) { // surface return false; } } return true; } } } // namespace MCell
C++
3D
mcellteam/mcell
utils/data_model_to_pymcell/python_generator.cpp
.cpp
51,891
1,506
/****************************************************************************** * * Copyright (C) 2020 by * The Salk Institute for Biological Studies * * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. * ******************************************************************************/ #include <fstream> #include <regex> #include <ctype.h> #include "libmcell/api/api_utils.h" #include "python_generator.h" #include "generator_utils.h" #include "mcell4_generator.h" #include "bng/bng_defines.h" using namespace std; using namespace MCell::API; namespace MCell { using Json::Value; void PythonGenerator::generate_single_parameter(std::ostream& out, Json::Value& parameter) { if (parameter[KEY_PAR_DESCRIPTION].asString() != "") { out << "# " << parameter[KEY_PAR_DESCRIPTION].asString() << "\n"; } string python_expr; // replace operator ^ with operator ** python_expr = regex_replace(parameter[KEY_PAR_EXPRESSION].asString(), regex("\\^"), "**"); python_expr = replace_function_calls_in_expr(python_expr, true); string name = fix_param_id(parameter[KEY_PAR_NAME].asString()); data.check_if_already_defined_and_add(name, NAME_PARAMETER); string ind; if (!data.not_overridable_python_params) { // allow params to be overridden out << "if " << NOT_DEFINED << "('" << name << "'):\n"; ind = IND4; } out << ind << name << " = " << python_expr; string units = parameter[KEY_PAR_UNITS].asString(); if (units != "") { out << " # units: " << units; } out << "\n\n"; } static void get_used_ids(const string& expr, vector<string>& used_ids) { used_ids.clear(); // same automaton but with different actions is used in replace_function_calls_in_expr enum state_t { START, IN_ID, IN_NUM }; state_t state = START; string curr_id; for (size_t i = 0; i < expr.size(); i++) { char c = expr[i]; switch (state) { case START: if (isalpha(c) || c == '_') { state = IN_ID; curr_id += c; } else if (isdigit(c)) { state = IN_NUM; } break; case IN_ID: if (isalnum(c) || c == '_') { curr_id += c; } else { if (mdl_functions_to_py_bngl_map.count(curr_id) == 0) { // count only IDs used_ids.push_back(curr_id); } curr_id = ""; state = START; } break; case IN_NUM: if (isdigit(c) || c == '.' || c == 'e' || c == '+' || c == '-') { // ok } else { if (isalpha(c) || c == '_') { state = IN_ID; curr_id += c; } else { state = START; } } break; } } if (state == IN_ID) { if (mdl_functions_to_py_bngl_map.count(curr_id) == 0) { // count only IDs used_ids.push_back(curr_id); } } } struct ExprDepNode { size_t index; vector<ExprDepNode*> parents; vector<ExprDepNode*> children; }; // simple class used mainly to delete all created nodes class ExprDepNodeContainer { public: ~ExprDepNodeContainer() { for (ExprDepNode* n: nodes) { delete n; } nodes.clear(); } ExprDepNode* create_node(const size_t index) { ExprDepNode* res = new ExprDepNode(); nodes.push_back(res); res->index = index; return res; } vector<ExprDepNode*> nodes; }; // collects static void traverse_given_level( const ExprDepNode* n, const uint level, vector<size_t>& level_ordering) { if (level == 0) { level_ordering.push_back(n->index); } else { // recursion stops if there are no children for (ExprDepNode* child: n->children) { traverse_given_level(child, level-1, level_ordering); } } } static void level_order_traversal( ExprDepNode* root, vector<size_t>& ordering) { vector<size_t> level_ordering; uint level = 1; // we are not counting the root node do { level_ordering.clear(); traverse_given_level(root, level, level_ordering); ordering.insert(ordering.end(), level_ordering.begin(), level_ordering.end()); level++; } while (!level_ordering.empty()); } // not very efficient but the parameter systems in data models are not so huge static void order_by_dependencies(const vector<ExprDepNode*>& nodes, vector<size_t>& ordering) { vector<bool> already_handled(nodes.size(), false); while (ordering.size() != nodes.size()) { for (size_t i = 0; i < nodes.size(); i++) { ExprDepNode* n = nodes[i]; if (already_handled[n->index]) { continue; } bool all_parents_are_handled = true; for (auto& p: n->parents) { if (!already_handled[p->index]) { // skip, not ready for this parameter yet all_parents_are_handled = false; break; } } if (!all_parents_are_handled) { continue; } ordering.push_back(n->index); already_handled[n->index] = true; } } } static void define_parameter_ordering(Value& parameter_list, vector<size_t>& ordering) { ExprDepNodeContainer nodes; map<string, ExprDepNode*> defines; // first create all nodes for (Value::ArrayIndex i = 0; i < parameter_list.size(); i++) { const string& name = parameter_list[i][KEY_PAR_NAME].asString(); defines[name] = nodes.create_node(i); } // then define dependencies for (Value::ArrayIndex i = 0; i < parameter_list.size(); i++) { const string& name = parameter_list[i][KEY_PAR_NAME].asString(); const string& expr = parameter_list[i][KEY_PAR_EXPRESSION].asString(); ExprDepNode* n = defines[name]; vector<string> used_ids; // e.g. our parameter is a = b + c // parents of a are b and c (since // and child of b, resp. c, is a get_used_ids(expr, used_ids); for (const string& id: used_ids) { ExprDepNode* used_node = defines[id]; // check function name if (used_node == nullptr) { assert(mdl_functions_to_py_bngl_map.count(id) == 0); ERROR("Did not find definition of identifier '" + id + "' when converting parameters, some MDL " "constants or functions are not supported." ); } // make a bidirectional link n->parents.push_back(used_node); used_node->children.push_back(n); } } // now we might have multiple roots (nodes without uses), create just one /*ExprDepNode* root = nodes.create_node(INDEX_INVALID); for (auto node_it: defines) { if (node_it.second->parents.empty()) { root->children.push_back(node_it.second); node_it.second->parents.push_back(root); } }*/ // order nodes by dependencies order_by_dependencies(nodes.nodes, ordering); // finally do a level-order traversal of the created dependency graph //level_order_traversal(root, ordering); } void PythonGenerator::generate_parameters(std::ostream& out) { Value& parameter_system = get_node(mcell, KEY_PARAMETER_SYSTEM); if (parameter_system.isMember(KEY_MODEL_PARAMETERS)) { Value& parameter_list = get_node(parameter_system, KEY_MODEL_PARAMETERS); vector<size_t> ordering; // sort parameters by their dependence define_parameter_ordering(parameter_list, ordering); // define_parameter_ordering can insert several parameters multiple times into ordering // TODO: make a better fix if needed, skipping duplicates for now set<size_t> already_generated; for (Value::ArrayIndex i: ordering) { if (already_generated.count(i) == 0) { generate_single_parameter(out, parameter_list[i]); } already_generated.insert(i); } } out << "\n"; } std::string PythonGenerator::generate_component_type( std::ostream& out, Json::Value& bngl_component_item, const std::string& mol_type_name) { const string& cname = bngl_component_item[KEY_CNAME].asString(); bool has_states = bngl_component_item.isMember(KEY_CSTATES) && !bngl_component_item[KEY_CSTATES].empty(); string name = COMPONENT_PREFIX + mol_type_name + '_' + make_id(cname); // generate only once // TODO: do we need to check here that all the declarations are the same? if (data.is_already_defined(name, NAME_CLASS_COMPONENT_TYPE)) { return name; } data.check_if_already_defined_and_add(name, NAME_CLASS_COMPONENT_TYPE); gen_ctor_call(out, name, NAME_CLASS_COMPONENT_TYPE); gen_param(out, NAME_NAME, cname, has_states); vector<string> state_names; if (has_states) { Value& cstates = bngl_component_item[KEY_CSTATES]; for (Value::ArrayIndex i = 0; i < cstates.size(); i++) { state_names.push_back(cstates[i].asString()); } gen_param_list(out, NAME_STATES, state_names, false, true); } out << CTOR_END; return name; } std::string PythonGenerator::generate_single_species_or_mol_type( std::ostream& out, Json::Value& molecule_list_item, const bool generate_species, const std::vector<string>& component_names) { assert(generate_species == component_names.empty()); string orig_name = molecule_list_item[KEY_MOL_NAME].asString(); string name = make_id(orig_name); const char* type = (generate_species) ? NAME_CLASS_SPECIES : NAME_CLASS_ELEMENTARY_MOLECULE_TYPE; data.check_if_already_defined_and_add(name, type); gen_description(out, molecule_list_item); string python_name = (generate_species) ? name : ELEMENTARY_MOLECULE_TYPE_PREFIX + name; gen_ctor_call(out, python_name, type); string name_to_generate = orig_name; if (API::is_simple_species(orig_name)) { // simple species must not contain dots in their name name_to_generate = name; } gen_param(out, NAME_NAME, name_to_generate, true); // using original name if (!generate_species) { gen_param_list(out, NAME_COMPONENTS, component_names, true); } bool has_target_only = molecule_list_item[KEY_TARGET_ONLY].asBool(); bool has_custom_time_step = molecule_list_item[KEY_CUSTOM_TIME_STEP].asString() != ""; bool has_custom_space_step = molecule_list_item[KEY_CUSTOM_SPACE_STEP].asString() != ""; bool has_extra_args = has_target_only || has_custom_time_step || has_custom_space_step; string mol_type = molecule_list_item[KEY_MOL_TYPE].asString(); CHECK_PROPERTY(mol_type == VALUE_MOL_TYPE_2D || mol_type == VALUE_MOL_TYPE_3D); if (mol_type == VALUE_MOL_TYPE_3D) { gen_param_expr(out, NAME_DIFFUSION_CONSTANT_3D, molecule_list_item[KEY_DIFFUSION_CONSTANT], has_extra_args); } else { gen_param_expr(out, NAME_DIFFUSION_CONSTANT_2D, molecule_list_item[KEY_DIFFUSION_CONSTANT], has_extra_args); } CHECK_PROPERTY(!(has_custom_time_step && has_custom_space_step) && "Only one of custom time or space step may be set"); if (has_custom_time_step) { gen_param_expr(out, NAME_CUSTOM_TIME_STEP, molecule_list_item[KEY_CUSTOM_TIME_STEP], has_target_only); } else if (has_custom_space_step) { gen_param_expr(out, NAME_CUSTOM_SPACE_STEP, molecule_list_item[KEY_CUSTOM_SPACE_STEP], has_target_only); } if (has_target_only) { gen_param(out, NAME_TARGET_ONLY, true, false); } out << CTOR_END; return python_name; } SpeciesOrMolType PythonGenerator::generate_single_species_or_mol_type_w_components( std::ostream& out, Json::Value& molecule_list_item) { bool has_components = false; if (molecule_list_item.isMember(KEY_BNGL_COMPONENT_LIST) && molecule_list_item[KEY_BNGL_COMPONENT_LIST].size() > 0) { has_components = true; } // molecules in CellBlender represent either Species if they are a simple ComplexInstance or ElementaryMoleculeTypes // two different generation modes - when components are present then // we generate ElementaryMoleculeType, Species are a specific instantiation, // otherwise Species without components can be defined directly in the MCell3 species style if (has_components) { vector<string> component_names; string component_prefix = make_id(molecule_list_item[KEY_MOL_NAME].asString()); // Components Value& bngl_component_list = get_node(molecule_list_item, KEY_BNGL_COMPONENT_LIST); for (Value::ArrayIndex i = 0; i < bngl_component_list.size(); i++) { string component_name = generate_component_type(out, bngl_component_list[i], component_prefix); component_names.push_back(component_name); } // Molecule Type string name = generate_single_species_or_mol_type(out, molecule_list_item, false, component_names); return SpeciesOrMolType(name, false); } else { string name = generate_single_species_or_mol_type(out, molecule_list_item, true); return SpeciesOrMolType(name, true); } } void PythonGenerator::generate_species_and_mol_types( std::ostream& out, std::vector<SpeciesOrMolType>& species_and_mt_info) { Value& define_molecules = get_node(mcell, KEY_DEFINE_MOLECULES); check_version(KEY_DEFINE_MOLECULES, define_molecules, VER_DM_2014_10_24_1638); Value& molecule_list = get_node(define_molecules, KEY_MOLECULE_LIST); for (Value::ArrayIndex i = 0; i < molecule_list.size(); i++) { Value& molecule_list_item = molecule_list[i]; check_version(KEY_MOLECULE_LIST, molecule_list_item, VER_DM_2018_10_16_1632); SpeciesOrMolType info = generate_single_species_or_mol_type_w_components(out, molecule_list_item); species_and_mt_info.push_back(info); } } void PythonGenerator::get_surface_class_property_info( const string& sc_name, Value& property, string& name, string& type_name, string& affected_mols, string& orientation, string& clamp_concentration ) { check_version(KEY_SURFACE_CLASS_PROP_LIST, property, VER_DM_2015_11_08_1756); affected_mols = property[KEY_AFFECTED_MOLS].asString(); if (affected_mols == BNG::ALL_MOLECULES) { affected_mols = S(MDOT) + NAME_CV_AllMolecules; } else if (affected_mols == BNG::ALL_VOLUME_MOLECULES) { affected_mols = S(MDOT) + NAME_CV_AllVolumeMolecules; } else if (affected_mols == BNG::ALL_SURFACE_MOLECULES) { affected_mols = S(MDOT) + NAME_CV_AllSurfaceMolecules; } else if (affected_mols == VALUE_SINGLE) { affected_mols = property[KEY_MOLECULE].asString(); } orientation = convert_orientation(property[KEY_SURF_CLASS_ORIENT].asString()); clamp_concentration = ""; string surf_class_type = property[KEY_SURF_CLASS_TYPE].asString(); if (surf_class_type == VALUE_TRANSPARENT) { type_name = NAME_EV_TRANSPARENT; } else if (surf_class_type == VALUE_REFLECTIVE) { type_name = NAME_EV_REFLECTIVE; } else if (surf_class_type == VALUE_ABSORPTIVE) { type_name = NAME_EV_ABSORPTIVE; } else if (surf_class_type == VALUE_CLAMP_CONCENTRATION) { type_name = NAME_EV_CONCENTRATION_CLAMP; clamp_concentration = property[KEY_CLAMP_VALUE].asString(); } else if (surf_class_type == VALUE_CLAMP_FLUX) { type_name = NAME_EV_FLUX_CLAMP; clamp_concentration = property[KEY_CLAMP_VALUE].asString(); } else if (surf_class_type == "") { type_name = NAME_EV_REACTIVE; } else { ERROR(S("Invalid type/property ") + KEY_SURF_CLASS_TYPE + " " + surf_class_type + " of surface class '" + sc_name + "0'."); } name = make_id(property[KEY_NAME].asString()); if (name == "") { string tn_lower = type_name; transform(tn_lower.begin(), tn_lower.end(), tn_lower.begin(), ::tolower); // to be sure that there is no conflict, let's put a number at the end name = SURFACE_CLASS_PREFIX + tn_lower + "_" + affected_mols + to_string(unnamed_surf_class_counter); unnamed_surf_class_counter++; } } void PythonGenerator::generate_surface_classes( std::ostream& out, std::vector<std::string>& sc_names) { if (!mcell.isMember(KEY_DEFINE_SURFACE_CLASSES)) { return; } Value& define_surface_classes = get_node(mcell, KEY_DEFINE_SURFACE_CLASSES); check_version(KEY_DEFINE_SURFACE_CLASSES, define_surface_classes, VER_DM_2014_10_24_1638); Value& surface_class_list = get_node(define_surface_classes, KEY_SURFACE_CLASS_LIST); for (Value::ArrayIndex i = 0; i < surface_class_list.size(); i++) { Value& surface_class_list_item = surface_class_list[i]; Value& surface_class_prop_list = get_node(surface_class_list_item, KEY_SURFACE_CLASS_PROP_LIST); string sc_name = make_id(surface_class_list_item[KEY_NAME].asString()); sc_names.push_back(sc_name); vector<string> sc_prop_names; if (surface_class_prop_list.size() > 1) { for (Value::ArrayIndex i = 0; i < surface_class_prop_list.size(); i++) { Value& surface_class_prop_item = surface_class_prop_list[i]; string name, type_name, affected_mols, orientation_name, clamp_concentration; get_surface_class_property_info( sc_name, surface_class_prop_item, name, type_name, affected_mols, orientation_name, clamp_concentration); bool is_clamp = type_name == NAME_EV_CONCENTRATION_CLAMP || type_name == NAME_EV_FLUX_CLAMP; bool has_affected_mols = affected_mols != ""; sc_prop_names.push_back(name); data.check_if_already_defined_and_add(name, NAME_CLASS_SURFACE_PROPERTY); gen_ctor_call(out, name, NAME_CLASS_SURFACE_PROPERTY, true); gen_param_enum(out, NAME_TYPE, NAME_ENUM_SURFACE_PROPERTY_TYPE, type_name, has_affected_mols || is_clamp); if (has_affected_mols) { gen_param_expr( out, NAME_AFFECTED_COMPLEX_PATTERN, make_species_or_cplx(data, affected_mols, orientation_name), is_clamp); } if (is_clamp) { gen_param_expr(out, NAME_CONCENTRATION, clamp_concentration, false); } out << CTOR_END; } } gen_description(out, surface_class_list_item); data.check_if_already_defined_and_add(sc_name, NAME_CLASS_SURFACE_CLASS); gen_ctor_call(out, sc_name, NAME_CLASS_SURFACE_CLASS, true); gen_param(out, NAME_NAME, sc_name, true); if (!sc_prop_names.empty()) { // use a list of properties gen_param_list(out, NAME_PROPERTIES, sc_prop_names, false); } else { // simplified setup, directly set members string name, type_name, affected_mols, orientation_name, clamp_concentration; get_surface_class_property_info( sc_name, surface_class_prop_list[0], name, type_name, affected_mols, orientation_name, clamp_concentration); bool is_clamp = type_name == NAME_EV_CONCENTRATION_CLAMP || type_name == NAME_EV_FLUX_CLAMP; bool has_affected_mols = affected_mols != ""; gen_param_enum(out, NAME_TYPE, NAME_ENUM_SURFACE_PROPERTY_TYPE, type_name, has_affected_mols || is_clamp); if (has_affected_mols) { gen_param_expr( out, NAME_AFFECTED_COMPLEX_PATTERN, make_species_or_cplx(data, affected_mols, orientation_name), is_clamp); } if (is_clamp) { gen_param_expr(out, NAME_CONCENTRATION, clamp_concentration, false); } } out << CTOR_END; } } void PythonGenerator::generate_variable_rate(const std::string& rate_array_name, Json::Value& variable_rate_text) { // append to the parameters file ofstream out; open_and_check_file_w_prefix(data.output_files_prefix, PARAMETERS, out, true); out << "\n" << make_section_comment("variable rate"); out << rate_array_name << " = [\n"; string vr = variable_rate_text.asString(); size_t pos = 0; bool print_comma = false; while (pos < vr.size()) { size_t tab = vr.find('\t', pos + 1); size_t space = vr.find(' ', pos + 1); if (tab == string::npos || space < tab) { tab = space; } size_t nl = vr.find('\n', pos + 1); if (nl == string::npos) { nl = vr.size(); } if (tab > nl || tab == pos || nl == pos) { ERROR("Malformed variable_rate_text in datamodel."); } if (tab == string::npos) { break; // end of input } string time = vr.substr(pos, tab - pos); string rate = vr.substr(tab + 1, nl - (tab + 1)); time = trim(time); rate = trim(rate); if (print_comma) { out << ",\n"; } print_comma = true; out << " [" << time << ", " << rate << "]"; pos = nl; pos++; } out << "\n] # " << rate_array_name << "\n\n"; out.close(); } void PythonGenerator::generate_rxn_rule_side(std::ostream& out, Json::Value& substances_node) { string str = substances_node.asString(); // special case for rxns without products if (str == NULL_PRODUCTS) { out << "[ ]"; return; } vector<string> substances; vector<string> orientations; parse_rxn_rule_side(substances_node, substances, orientations); out << "[ "; for (size_t i = 0; i < substances.size(); i++) { string orient = convert_orientation(orientations[i], true); string compartment = get_single_compartment(substances[i]); out << make_species_or_cplx(data, substances[i], orient, compartment); print_comma(out, i, substances); } out << " ]"; } std::string PythonGenerator::generate_single_reaction_rule(std::ostream& out, Json::Value& reaction_list_item) { check_version(KEY_MOLECULE_LIST, reaction_list_item, VER_DM_2018_01_11_1330); string name = get_rxn_id(reaction_list_item, data.unnamed_rxn_counter); gen_description(out, reaction_list_item); data.check_if_already_defined_and_add(name, NAME_CLASS_REACTION_RULE); gen_ctor_call(out, name, NAME_CLASS_REACTION_RULE); gen_param(out, NAME_NAME, name, true); // single line for now out << IND << NAME_REACTANTS << " = "; generate_rxn_rule_side(out, reaction_list_item[KEY_REACTANTS]); out << ",\n"; out << IND << NAME_PRODUCTS << " = "; generate_rxn_rule_side(out, reaction_list_item[KEY_PRODUCTS]); out << ",\n"; if (reaction_list_item[KEY_VARIABLE_RATE_SWITCH].asBool()) { // variable rates CHECK_PROPERTY(reaction_list_item[KEY_VARIABLE_RATE_VALID].asBool() && "variable_rate_switch must be equal to variable_rate_valid"); string rate_array_name = reaction_list_item[KEY_VARIABLE_RATE].asString(); size_t dot = rate_array_name.rfind('.'); if (dot != string::npos) { // remove file extension rate_array_name = rate_array_name.substr(0, dot); } // and remove possibly other dots in the name rate_array_name = make_id(rate_array_name); generate_variable_rate(rate_array_name, reaction_list_item[KEY_VARIABLE_RATE_TEXT]); gen_param_id(out, NAME_VARIABLE_RATE, rate_array_name, false); // module parameters is imported as * } else { // fwd or rev rates string rxn_type = reaction_list_item[KEY_RXN_TYPE].asString(); CHECK_PROPERTY(rxn_type == VALUE_IRREVERSIBLE || rxn_type == VALUE_REVERSIBLE); bool is_reversible = rxn_type == VALUE_REVERSIBLE; gen_param_expr(out, NAME_FWD_RATE, reaction_list_item[KEY_FWD_RATE], is_reversible); if (is_reversible) { gen_param(out, NAME_REV_NAME, name + REV_RXN_SUFFIX, true); gen_param_expr(out, NAME_REV_RATE, reaction_list_item[KEY_BKWD_RATE], false); } } out << CTOR_END; return name; } void PythonGenerator::generate_reaction_rules( ostream& out, std::vector<IdLoc>& rxn_names) { Value& define_reactions = get_node(mcell, KEY_DEFINE_REACTIONS); check_version(KEY_DEFINE_REACTIONS, define_reactions, VER_DM_2014_10_24_1638); Value& reaction_list = get_node(define_reactions, KEY_REACTION_LIST); for (Value::ArrayIndex i = 0; i < reaction_list.size(); i++) { Value& reaction_list_item = reaction_list[i]; string name = generate_single_reaction_rule(out, reaction_list_item); rxn_names.push_back(IdLoc(name, true)); } } string PythonGenerator::generate_single_geometry_object( ostream& out, const int index, Value& object) { string parent_name = S(KEY_OBJECT_LIST) + "[" + to_string(index) + "]"; string name = make_id(get_node(parent_name, object, KEY_NAME).asString()); data.check_if_already_defined_and_add(name, NAME_CLASS_GEOMETRY_OBJECT); Value& vertex_list = get_node(parent_name, object, KEY_VERTEX_LIST); Value& element_connections = get_node(parent_name, object, KEY_ELEMENT_CONNECTIONS); // TODO: material_names out << make_start_block_comment(name); // vertex_list string id_vertex_list = name + "_" + NAME_VERTEX_LIST; out << id_vertex_list << " = [\n"; for (Value::ArrayIndex i = 0; i < vertex_list.size(); i++) { out << IND << "["; Value& vertex = vertex_list[i]; for (Value::ArrayIndex k = 0; k < vertex.size(); k++) { out << vertex[k].asDouble(); gen_comma(out, k, vertex); } out << "]"; gen_comma(out, i, vertex_list); out << "\n"; } out << "] # " << id_vertex_list << "\n\n"; // element_connections string id_element_connections = name + "_" + NAME_WALL_LIST; out << id_element_connections << " = [\n"; for (Value::ArrayIndex i = 0; i < element_connections.size(); i++) { out << IND << "["; Value& element = element_connections[i]; for (Value::ArrayIndex k = 0; k < element.size(); k++) { out << element[k].asInt(); gen_comma(out, k, element); } out << "]"; gen_comma(out, i, element_connections); out << "\n"; } out << "] # " << id_element_connections << "\n\n"; // surface areas vector<string> sr_global_names; if (object.isMember(KEY_DEFINE_SURFACE_REGIONS)) { Value& define_surface_regions = object[KEY_DEFINE_SURFACE_REGIONS]; for (Value::ArrayIndex i = 0; i < define_surface_regions.size(); i++) { string sr_name = make_id(get_node( KEY_DEFINE_SURFACE_REGIONS, define_surface_regions[i], KEY_NAME).asString()); Value& include_elements = get_node( KEY_DEFINE_SURFACE_REGIONS, define_surface_regions[i], KEY_INCLUDE_ELEMENTS); string sr_global_name = name + "_" + sr_name; string sr_element_connections_name = sr_global_name + "_" + NAME_WALL_INDICES; out << sr_element_connections_name << " = ["; for (Value::ArrayIndex k = 0; k < include_elements.size(); k++) { if (k % 16 == 0) { out << "\n" << IND; } out << include_elements[k].asInt(); gen_comma(out, k, include_elements); } out << "\n] #" << sr_element_connections_name << "\n\n"; out << sr_global_name << " = " << MDOT << NAME_CLASS_SURFACE_REGION << "(\n"; out << IND << NAME_NAME << " = '" << sr_name << "',\n"; out << IND << NAME_WALL_INDICES << " = " << sr_element_connections_name << "\n"; out << CTOR_END; sr_global_names.push_back(sr_global_name); } } // object creation itself out << name << " = " << MDOT << NAME_CLASS_GEOMETRY_OBJECT << "(\n"; gen_param(out, NAME_NAME, name, true); gen_param_id(out, NAME_VERTEX_LIST, id_vertex_list, true); gen_param_id(out, NAME_WALL_LIST, id_element_connections, true); out << IND << NAME_SURFACE_REGIONS << " = ["; for (size_t i = 0; i < sr_global_names.size(); i++) { out << sr_global_names[i]; print_comma(out, i, sr_global_names); } out << "]\n)\n"; out << make_end_block_comment(name); return name; } // Generate geometry as a python package (with __init__.py) in geom_dir // Generate individual geometry objects as python modules in geom_dir void PythonGenerator::generate_geometry_package(const std::string& geom_dir, std::vector<std::string>& geometry_objects) { ofstream initpy_out; open_and_check_file_w_prefix(geom_dir, "__init__", initpy_out, false); initpy_out << "import sys\n"; initpy_out << "import os\n\n"; initpy_out << "sys.path.append(os.path.dirname(os.path.abspath(__file__)))\n\n"; ofstream geom_out; Value& geometrical_objects = get_node(mcell, KEY_GEOMETRICAL_OBJECTS); if (!geometrical_objects.isMember(KEY_OBJECT_LIST)) { return; } Value& object_list = get_node(geometrical_objects, KEY_OBJECT_LIST); for (Value::ArrayIndex i = 0; i < object_list.size(); i++) { Value& object = object_list[i]; string parent_name = S(KEY_OBJECT_LIST) + "[" + to_string(i) + "]"; string geom_name = make_id(get_node(parent_name, object, KEY_NAME).asString()); open_and_check_file_w_prefix(geom_dir, geom_name, geom_out, false); geom_out << "import mcell as m\n\n"; string name = generate_single_geometry_object(geom_out, i, object); if (name == BNG::DEFAULT_COMPARTMENT_NAME) { data.has_default_compartment_object = true; } geom_out.close(); geometry_objects.push_back(name); initpy_out << "from " + geom_name + " import *\n"; } initpy_out.close(); } void PythonGenerator::generate_geometry(std::ostream& out, std::vector<std::string>& geometry_objects) { Value& geometrical_objects = get_node(mcell, KEY_GEOMETRICAL_OBJECTS); if (!geometrical_objects.isMember(KEY_OBJECT_LIST)) { return; } Value& object_list = get_node(geometrical_objects, KEY_OBJECT_LIST); for (Value::ArrayIndex i = 0; i < object_list.size(); i++) { Value& object = object_list[i]; string name = generate_single_geometry_object(out, i, object); if (name == BNG::DEFAULT_COMPARTMENT_NAME) { data.has_default_compartment_object = true; } geometry_objects.push_back(name); } } // returns true if the two release sites can be merged into a single one static bool can_be_in_same_list_release_site(Value& rs1, Value& rs2) { return rs1[KEY_SHAPE].asString() == VALUE_LIST && rs2[KEY_SHAPE].asString() == VALUE_LIST && rs1[KEY_PATTERN].asString() == rs2[KEY_PATTERN].asString() && rs1[KEY_QUANTITY].asString() == rs2[KEY_QUANTITY].asString() && rs1[KEY_QUANTITY_TYPE].asString() == rs2[KEY_QUANTITY_TYPE].asString() && rs1[KEY_RELEASE_PROBABILITY].asString() == rs2[KEY_RELEASE_PROBABILITY].asString() && rs1[KEY_SITE_DIAMETER].asString() == rs2[KEY_SITE_DIAMETER].asString() && rs1[KEY_STDDEV].asString() == rs2[KEY_STDDEV].asString(); } std::string PythonGenerator::generate_single_molecule_release_info_array( std::ostream& out, std::string& rel_site_name, Json::Value& release_site_list, Json::Value::ArrayIndex begin, Json::Value::ArrayIndex end) { string name = MOLECULE_LIST_PREFIX + rel_site_name; out << name << " = [\n"; for (Value::ArrayIndex rs_index = begin; rs_index < end; rs_index++) { Value& release_site_item = release_site_list[rs_index]; Value& points_list = release_site_item[KEY_POINTS_LIST]; for (Value::ArrayIndex i = 0; i < points_list.size(); i++) { out << " " << MDOT << NAME_CLASS_MOLECULE_RELEASE_INFO << "(\n"; string cplx = release_site_item[KEY_MOLECULE].asString(); bool is_vol = is_volume_species(mcell, cplx); string orient = convert_orientation(release_site_item[KEY_ORIENT].asString(), !is_vol); out << " "; gen_param_expr(out, NAME_COMPLEX, make_species_or_cplx(data, cplx, orient), true); Value& point = points_list[i]; if (point.size() != 3) { ERROR("Release site " + rel_site_name + ": points_list item does not have three values."); } out << " " << NAME_LOCATION << " = [" << point[0].asDouble() << ", " << point[1].asDouble() << ", " << point[2].asDouble() << "]"; out << "\n )"; if (i + 1 != points_list.size()) { out << ", "; } } if (rs_index + 1 != end) { out << ", "; } out << "\n"; } out << "] # " << name << "\n\n"; return name; } static void gen_region_expr_assignment_for_rel_site(ostream& out, string region_expr) { // we don't really need to parse the expression, just dump it in a right way // example: Cell[ALL] - (Organelle_1[ALL] + Organelle_2[ALL]) // remove [ALL] // replace [text] with _text regex pattern_all("\\[ALL\\]"); region_expr = regex_replace(region_expr, pattern_all, ""); regex pattern_surf_region("\\[([^\\]]*)\\]"); region_expr = regex_replace(region_expr, pattern_surf_region, "_$1"); gen_param_expr(out, NAME_REGION, region_expr, true); } static void error_release_pattern(const string& name) { ERROR("Requested release pattern " + name + " not found in data model."); } void PythonGenerator::generate_release_pattern(std::ostream& out, const std::string& name, std::string& delay_string) { // generate only once, however we must return the delay string bool already_generated = data.is_already_defined(name, NAME_CLASS_RELEASE_PATTERN); if (!mcell.isMember(KEY_DEFINE_RELEASE_PATTERNS)) { error_release_pattern(name); } Value& define_release_patterns = get_node(mcell, KEY_DEFINE_RELEASE_PATTERNS); Value& release_pattern_list = get_node(define_release_patterns, KEY_RELEASE_PATTERN_LIST); for (Value::ArrayIndex i = 0; i < release_pattern_list.size(); i++) { Value& release_pattern_item = release_pattern_list[i]; if (release_pattern_item[KEY_NAME].asString() != name) { continue; } if (!already_generated) { // we found the release pattern check_version(KEY_RELEASE_PATTERN_LIST, release_pattern_item, VER_DM_2018_01_11_1330); data.check_if_already_defined_and_add(name, NAME_CLASS_RELEASE_PATTERN); gen_ctor_call(out, name, NAME_CLASS_RELEASE_PATTERN); gen_param(out, NAME_NAME, name, true); gen_param_expr(out, NAME_RELEASE_INTERVAL, release_pattern_item[KEY_RELEASE_INTERVAL], true); gen_param_expr(out, NAME_TRAIN_DURATION, release_pattern_item[KEY_TRAIN_DURATION], true); gen_param_expr(out, NAME_TRAIN_INTERVAL, release_pattern_item[KEY_TRAIN_INTERVAL], true); gen_param_expr(out, NAME_NUMBER_OF_TRAINS, release_pattern_item[KEY_NUMBER_OF_TRAINS], false); out << CTOR_END; } delay_string = release_pattern_item[KEY_DELAY].asString(); return; } error_release_pattern(name); } void PythonGenerator::generate_release_sites(std::ostream& out, std::vector<std::string>& release_site_names) { if (!mcell.isMember(KEY_RELEASE_SITES)) { return; } Value& release_sites = mcell[KEY_RELEASE_SITES]; check_version(KEY_RELEASE_SITES, release_sites, VER_DM_2014_10_24_1638); Value& release_site_list = release_sites[KEY_RELEASE_SITE_LIST]; Value::ArrayIndex i = 0; while (i < release_site_list.size()) { Value& release_site_item = release_site_list[i]; check_version(KEY_RELEASE_SITE_LIST, release_site_item, VER_DM_2018_01_11_1330); string name = make_id(release_site_item[KEY_NAME].asString()); string shape = release_site_item[KEY_SHAPE].asString(); string molecule_list_name = ""; if (shape == VALUE_LIST) { // 1) try to find the largest number of subsequent // release sites that can be represented by a single ReleaseSite Value::ArrayIndex matching_end = i + 1; while (matching_end < release_site_list.size() && can_be_in_same_list_release_site(release_site_item, release_site_list[matching_end])) { matching_end++; } // remove suffix from release name if (i < matching_end - 1 && name.substr(name.size() - 2) == "_0") { name = name.substr(0, name.size() - 2); } // 2) generate an array of SingleMoleculeReleaseInfo objects molecule_list_name = generate_single_molecule_release_info_array(out, name, release_site_list, i, matching_end); // skip all release sites we handled here i = matching_end - 1; } // generate release pattern if needed string rel_pat_name = release_site_item[KEY_PATTERN].asString(); string delay_string = ""; if (rel_pat_name != "") { generate_release_pattern(out, rel_pat_name, delay_string); } release_site_names.push_back(name); gen_description(out, release_site_item); data.check_if_already_defined_and_add(name, NAME_CLASS_RELEASE_SITE); gen_ctor_call(out, name, NAME_CLASS_RELEASE_SITE); gen_param(out, NAME_NAME, name, true); string compartment; if (shape != VALUE_LIST) { string cplx = release_site_item[KEY_MOLECULE].asString(); if (cplx == "") { ERROR("Release site '" + name + "' does not have its molecule/complex to be released set."); } bool is_vol = is_volume_species(data.mcell, cplx); string orientation = convert_orientation(release_site_item[KEY_ORIENT].asString(), !is_vol); if (orientation != "" && is_vol) { cout << "Ignoring orientation set for release site " << name << " with species " << cplx << ", this species represent volume molecules.\n"; orientation = ""; } compartment = get_single_compartment(cplx); gen_param_expr(out, NAME_COMPLEX, make_species_or_cplx(data, cplx, orientation, compartment), true); } if (delay_string != "" && delay_string != "0") { gen_param_expr(out, NAME_RELEASE_TIME, delay_string, true); } if (rel_pat_name != "") { gen_param_id(out, NAME_RELEASE_PATTERN, rel_pat_name, true); } string prob = release_site_item[KEY_RELEASE_PROBABILITY].asString(); bool prob_not_1 = (prob != "1" && prob != "1.0"); if (shape == VALUE_SPHERICAL) { if (compartment != "") { ERROR("Cannot use compartment " + compartment + " with spherical release."); } gen_param_enum(out, NAME_SHAPE, NAME_ENUM_SHAPE, NAME_EV_SPHERICAL, true); gen_param_list_3_floats( out, NAME_LOCATION, release_site_item[KEY_LOCATION_X], release_site_item[KEY_LOCATION_Y], release_site_item[KEY_LOCATION_Z], true ); gen_param_expr(out, NAME_SITE_DIAMETER, release_site_item[KEY_SITE_DIAMETER], true); } else if (shape == VALUE_OBJECT) { gen_region_expr_assignment_for_rel_site(out, release_site_item[KEY_OBJECT_EXPR].asString()); } else if (shape == VALUE_LIST) { // FIXME: check that no compartments are used here assert(molecule_list_name != ""); bool diam_is_zero = release_site_item[KEY_SITE_DIAMETER] == "0"; gen_param_id(out, NAME_MOLECULE_LIST, molecule_list_name, !diam_is_zero); if (!diam_is_zero) { gen_param_expr(out, NAME_SITE_DIAMETER, release_site_item[KEY_SITE_DIAMETER], prob_not_1); } } else { ERROR("Shape " + shape + " is not supported yet"); } if (shape != VALUE_LIST) { string quantity_type = release_site_item[KEY_QUANTITY_TYPE].asString(); if (quantity_type == VALUE_NUMBER_TO_RELEASE) { check_not_empty(release_site_item, KEY_QUANTITY, "Release site"); gen_param_expr(out, NAME_NUMBER_TO_RELEASE, release_site_item[KEY_QUANTITY], prob_not_1); } else if (quantity_type == VALUE_DENSITY) { string species_name = release_site_item[KEY_MOLECULE].asString(); if (is_volume_species(data.mcell, species_name)) { gen_param_expr(out, NAME_CONCENTRATION, release_site_item[KEY_QUANTITY], prob_not_1); } else { gen_param_expr(out, NAME_DENSITY, release_site_item[KEY_QUANTITY], prob_not_1); } } else { ERROR("Quantity type " + quantity_type + " is not supported yet"); } } if (prob_not_1) { gen_param_expr(out, NAME_RELEASE_PROBABILITY, prob, false); } out << CTOR_END; i++; } } std::vector<std::string> PythonGenerator::get_species_to_visualize() { vector<string> res; Value& define_molecules = get_node(mcell, KEY_DEFINE_MOLECULES); check_version(KEY_DEFINE_MOLECULES, define_molecules, VER_DM_2014_10_24_1638); Value& molecule_list = get_node(define_molecules, KEY_MOLECULE_LIST); for (Value::ArrayIndex i = 0; i < molecule_list.size(); i++) { Value& molecule_list_item = molecule_list[i]; check_version(KEY_MOLECULE_LIST, molecule_list_item, VER_DM_2018_10_16_1632); if (molecule_list_item[KEY_EXPORT_VIZ].asBool()) { if (data.bng_mode) { res.push_back(make_species(molecule_list_item[KEY_MOL_NAME].asString())); } else { res.push_back(molecule_list_item[KEY_MOL_NAME].asString()); } } } return res; } void PythonGenerator::generate_viz_outputs( std::ostream& out, const bool cellblender_viz, std::vector<std::string>& viz_output_names) { if (!mcell.isMember(KEY_VIZ_OUTPUT)) { return; } Value& viz_output = mcell[KEY_VIZ_OUTPUT]; check_version(KEY_VIZ_OUTPUT, viz_output, VER_DM_2014_10_24_1638); // species_list vector<string> viz_species = get_species_to_visualize(); if (!viz_output[KEY_EXPORT_ALL].asBool() && viz_species.empty()) { return; // nothing to generate } string name = VIZ_OUTPUT_NAME; // there is only one in datamodel now viz_output_names.push_back(name); // CHECK_PROPERTY(viz_output[KEY_ALL_ITERATIONS].asBool()); // don't care CHECK_PROPERTY(viz_output[KEY_START].asString() == "0"); data.check_if_already_defined_and_add(name, NAME_CLASS_VIZ_OUTPUT); gen_ctor_call(out, name, NAME_CLASS_VIZ_OUTPUT); // mode is ascii by default, this information is not in datamodel const char* mode = (cellblender_viz) ? NAME_EV_CELLBLENDER : NAME_EV_ASCII; gen_param_enum(out, NAME_MODE, NAME_ENUM_VIZ_MODE, mode, true); gen_param(out, NAME_OUTPUT_FILES_PREFIX, DEFAULT_VIZ_OUTPUT_FILENAME_PREFIX, true); // species_list if (!viz_output[KEY_EXPORT_ALL].asBool() && !viz_species.empty()) { gen_param_list(out, NAME_SPECIES_LIST, viz_species, true); } if (viz_output[KEY_STEP].asString() == "0") { cout << "Viz output specification has periodicity (" << NAME_EVERY_N_TIMESTEPS << ") value 0. " << "This is probably caused by conversion from MDL where the number of simulated iterations " << "lower than the actual periodicity. It is not possible to determine the periodicity in this case.\n"; } if (!viz_output[KEY_ALL_ITERATIONS].asBool()) { gen_param_expr(out, NAME_EVERY_N_TIMESTEPS, viz_output[KEY_STEP], false); } else { gen_param_expr(out, NAME_EVERY_N_TIMESTEPS, "1", false); } // ignoring KEY_END out << CTOR_END; } std::string PythonGenerator::generate_single_count_term( ostream& out, const std::string& what_to_count, const std::string& where_to_count, const std::string& orientation, const bool molecules_not_species, const bool rxn_not_mol ) { string name = COUNT_TERM_PREFIX + create_count_name(what_to_count, where_to_count, molecules_not_species); // generate the count term object definition if we don't already have it // TODO: move this into a function if (find(data.all_count_term_names.begin(), data.all_count_term_names.end(), name) == data.all_count_term_names.end()) { data.all_count_term_names.push_back(name); data.check_if_already_defined_and_add(name, NAME_CLASS_COUNT_TERM); gen_ctor_call(out, name, NAME_CLASS_COUNT_TERM); bool comma_after = (where_to_count != ""); if (rxn_not_mol) { gen_param_expr(out, NAME_REACTION_RULE, what_to_count, comma_after); } else { gen_param_expr( out, molecules_not_species ? NAME_MOLECULES_PATTERN : NAME_SPECIES_PATTERN, make_species_or_cplx(data, what_to_count, orientation, ""), comma_after); } if (where_to_count != "") { gen_param_expr(out, NAME_REGION, where_to_count, false); } out << CTOR_END; } return fix_id(name); } // stores multiplier value into the multiplier argument as a string // if present, the expected form is mult*(<counts>) string PythonGenerator::generate_count_terms_for_expression( ostream& out, const string& mdl_string, // may be empty, in that case we use what_to_count and where_to_count const std::string& what_to_count, const std::string& where_to_count, const std::string& orientation, const bool rxn_not_mol ) { string res_expr; if (mdl_string != "") { size_t last_end = 0; uint num_counts = get_num_counts_in_mdl_string(mdl_string); // the first count term item must be positive for (uint i = 0; i < num_counts; i++) { size_t start = mdl_string.find(COUNT, last_end); size_t end = find_end_brace_pos(mdl_string, start + strlen(COUNT)); if (end == string::npos) { end = mdl_string.size(); } bool rxn_not_mol; bool molecules_not_species; string what_to_count; string where_to_count; string orientation; process_single_count_term( data, mdl_string.substr(start, end - start + 1), rxn_not_mol, molecules_not_species, what_to_count, where_to_count, orientation ); string name = generate_single_count_term( out, what_to_count, where_to_count, orientation, molecules_not_species, rxn_not_mol); // for the res_expr, we cut all the COUNT[..] and replace them with // the ids of the CountTerm objects if (last_end != 0) res_expr += " " + mdl_string.substr(last_end + 1, start - (last_end + 1)) + " " + name; else { res_expr += name; } last_end = end; } } else { bool molecules_not_species = false; // MCell base counting always uses molecules string name = COUNT_TERM_PREFIX + create_count_name(what_to_count, where_to_count, molecules_not_species); res_expr = generate_single_count_term( out, what_to_count, where_to_count, orientation, molecules_not_species, rxn_not_mol); } return res_expr; } void PythonGenerator::generate_single_count( std::ostream& out, const std::string& count_name, const std::string& observable_name, const std::string& file_name, const std::string& count_term_name, const std::string& mul_div_str, const std::string& rxn_step ) { data.check_if_already_defined_and_add(count_name, NAME_CLASS_COUNT); gen_ctor_call(out, count_name, NAME_CLASS_COUNT); gen_param(out, NAME_NAME, observable_name, true); gen_param_expr(out, NAME_EXPRESSION, count_term_name, true); gen_param(out, NAME_FILE_NAME, DEFAULT_RXN_OUTPUT_FILENAME_PREFIX + file_name, mul_div_str != "" || rxn_step != ""); if (mul_div_str != "") { if (mul_div_str[0] == '*') { gen_param_expr(out, NAME_MULTIPLIER, mul_div_str.substr(1), rxn_step != ""); } else if (mul_div_str[0] == '/') { gen_param_expr(out, NAME_MULTIPLIER, "(1.0/" + mul_div_str.substr(1) + ")", rxn_step != ""); } else { release_assert(false && "Invalid count multiplier or divider."); } } if (rxn_step != "") { // rxn_step is specified in seconds, need to convert to seconds const string& time_step = mcell[KEY_INITIALIZATION][KEY_TIME_STEP].asString(); gen_param_expr(out, NAME_EVERY_N_TIMESTEPS, rxn_step + "/" + time_step, false); } out << CTOR_END; } void PythonGenerator::generate_all_bngl_reaction_rules_used_in_observables(std::ostream& out) { // bngl_reaction_rules_used_in_observables are initialized in MCell4Generator::generate_reaction_rules out << "# ---- declaration of rxn rules defined in BNGL and used in counts ----\n"; for (string& name: data.bngl_reaction_rules_used_in_observables) { out << name << " = " << get_module_name_w_prefix(data.output_files_prefix, SUBSYSTEM) << "." << NAME_FIND_REACTION_RULE << "('" << name << "')\n"; out << "assert " << name << ", \"Reaction rule '" + name + "' was not found\"\n\n"; } out << "\n"; } void PythonGenerator::generate_surface_classes_assignments(ostream& out) { if (!data.mcell.isMember(KEY_MODIFY_SURFACE_REGIONS)) { return; } Value& modify_surface_regions = data.mcell[KEY_MODIFY_SURFACE_REGIONS]; check_version(KEY_MODIFY_SURFACE_REGIONS, modify_surface_regions, VER_DM_2014_10_24_1638); Value& modify_surface_regions_list = modify_surface_regions[KEY_MODIFY_SURFACE_REGIONS_LIST]; for (Value::ArrayIndex i = 0; i < modify_surface_regions_list.size(); i++) { Value& modify_surface_regions_item = modify_surface_regions_list[i]; check_versions( KEY_MODIFY_SURFACE_REGIONS_LIST, modify_surface_regions_item, VER_DM_2018_01_11_1330, VER_DM_2020_07_12_1600 ); string object_name = modify_surface_regions_item[KEY_OBJECT_NAME].asString(); CHECK_PROPERTY(object_name != ""); string region_selection = modify_surface_regions_item[KEY_REGION_SELECTION].asString(); string obj_or_region_name; if (region_selection == VALUE_ALL) { obj_or_region_name = object_name; } else if (region_selection == VALUE_SEL) { obj_or_region_name = object_name + "_" + modify_surface_regions_item[KEY_REGION_NAME].asString(); } else { ERROR("Unexpected value " + region_selection + " of " + KEY_REGION_SELECTION + "."); } // handle initial_region_molecules_list if present if (modify_surface_regions_item.isMember(KEY_INITIAL_REGION_MOLECULES_LIST)) { string initial_region_molecules_name = obj_or_region_name + "_" + NAME_INITIAL_SURFACE_RELEASES; out << initial_region_molecules_name << " = [\n"; Value& initial_region_molecules_list = modify_surface_regions_item[KEY_INITIAL_REGION_MOLECULES_LIST]; for (Value::ArrayIndex rel_i = 0; rel_i < initial_region_molecules_list.size(); rel_i++) { Value& item = initial_region_molecules_list[rel_i]; out << " "; gen_ctor_call(out, "", NAME_CLASS_INITIAL_SURFACE_RELEASE, true); out << " "; string species_str = item[KEY_MOLECULE].asString(); string orient = convert_orientation(item[KEY_ORIENT].asString(), true); gen_param_expr(out, NAME_COMPLEX, make_species_or_cplx(data, species_str, orient), true); out << " "; if (item.isMember(KEY_MOLECULE_NUMBER)) { gen_param_expr(out, NAME_NUMBER_TO_RELEASE, item[KEY_MOLECULE_NUMBER], false); } else if (item.isMember(KEY_MOLECULE_DENSITY)) { gen_param_expr(out, NAME_DENSITY, item[KEY_MOLECULE_DENSITY], false); } else { ERROR( S("Missing ") + KEY_MOLECULE_NUMBER + " or " + KEY_MOLECULE_DENSITY + " in " + KEY_INITIAL_REGION_MOLECULES_LIST + "." ); } out << " )"; gen_comma(out, rel_i, initial_region_molecules_list); out << "\n"; } out << "]\n\n"; out << obj_or_region_name << "." << NAME_INITIAL_SURFACE_RELEASES << " = " << initial_region_molecules_name << "\n"; } // and also surface class name if (modify_surface_regions_item.isMember(KEY_SURF_CLASS_NAME)) { gen_description(out, modify_surface_regions_item); string surf_class_name = modify_surface_regions_item[KEY_SURF_CLASS_NAME].asString(); out << obj_or_region_name << "." << NAME_SURFACE_CLASS << " = " << surf_class_name << "\n"; } } } void PythonGenerator::generate_compartment_assignments(std::ostream& out) { Value& model_objects = get_node(data.mcell, KEY_MODEL_OBJECTS); Value& model_object_list = get_node(model_objects, KEY_MODEL_OBJECT_LIST); if (model_object_list.empty()) { return; } for (Value::ArrayIndex i = 0; i < model_object_list.size(); i++) { Value& model_object = model_object_list[i]; // older data model files don't have to have this attribute // therefore we are also checking for used compartments in // data.is_used_compartment bool is_bngl_compartment = model_object.isMember(KEY_IS_BNGL_COMPARTMENT) && model_object[KEY_IS_BNGL_COMPARTMENT].asBool(); if (is_bngl_compartment || data.is_used_compartment(model_object)) { // name is the name of the object const string& name = model_object[KEY_NAME].asString(); const string& membrane_name = model_object[KEY_MEMBRANE_NAME].asString(); gen_assign(out, name, NAME_IS_BNGL_COMPARTMENT, true); if (membrane_name != "") { gen_assign_str(out, name, NAME_SURFACE_COMPARTMENT_NAME, membrane_name); data.surface_to_volume_compartments_map[membrane_name] = name; } out << "\n"; } } } } /* namespace MCell */
C++
3D
mcellteam/mcell
utils/data_model_to_pymcell/data_model_to_pymcell.cpp
.cpp
4,635
200
/****************************************************************************** * * Copyright (C) 2020 by * The Salk Institute for Biological Studies * * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. * ******************************************************************************/ #ifndef _MSC_VER #include <getopt.h> #else #include "win_getopt/win_getopt.h" #endif #include <iostream> #include <cassert> #include <string> #include <ctype.h> #include "mcell4_generator.h" #include "generator_structs.h" #include "version.h" using namespace std; /* Command-line arguments structure: * long arg name * has argument * pointer to flag (should always be 0) * short argument letter */ static const option long_options[] = { { "help", 0, 0, 'h' }, { "version", 0, 0, 'v' }, { "debug", 0, 0, 'g' }, { "testing", 0, 0, 't' }, { "checkpoint_iters", 1, 0, 'k' }, { "bng", 0, 0, 'b' }, { "not_overridable_python_params", 0, 0, 'p'}, { "output_file_prefix", 1, 0, 'o'}, { nullptr, 0, 0, 0 } }; void print_usage(const char* argv0) { cout << argv0 << " options:\n"; size_t i = 0; while (long_options[i].name != nullptr) { cout << " -" << (char)long_options[i].val << "| -" << long_options[i].name << "\n"; i++; } } void print_version(const char* argv0) { cout << argv0 << " version:" << MCELL_VERSION << "\n"; } // iters_arg is a list of integers separated by comma std::vector<int> parse_checkpoint_iters(char* iters_arg) { assert(iters_arg != nullptr); std::vector<int> res; string current; char* c = iters_arg; while (*c != '\0') { if (*c == ' ') { // continue } if (isdigit(*c)) { current += *c; } else if (*c == ',') { if (current == "") { cerr << "Could not parse comma-separated list of integers for argument -k: '" << iters_arg << "'.\n"; exit(1); } // conversion is safe because we are in res.push_back(stoi(current)); current = ""; } else { cerr << "Could not parse comma-separated list of integers for argument -k: '" << iters_arg << "'.\n"; exit(1); } c++; } if (current != "") { res.push_back(stoi(current)); } return res; } const int ARG_PARSE_ERROR = 1; const int ARG_PARSE_QUIT = 0; const int ARG_PARSE_OK = -1; // returns ARG_PARSE_OK if execution should continue // ARG_PARSE_END to end with exit code 0, // ARG_PARSE_ERROR to end with exit code 1, int process_args( const int argc, char* argv[], MCell::SharedGenData& opts ) { opts.reset(); assert(argc > 0); while (1) { // get the next argument int c = getopt_long_only(argc, argv, "hvgtk:cbo:", long_options, nullptr); if (c == -1) break; switch (c) { case 'h': print_usage(argv[0]); return ARG_PARSE_QUIT; case 'v': print_version(argv[0]); return ARG_PARSE_QUIT; case 'g': opts.debug_mode = true; break; case 't': opts.testing_mode = true; break; case 'p': opts.not_overridable_python_params = true; break; case 'k': opts.checkpoint_iterations = parse_checkpoint_iters(optarg); opts.testing_mode = true; break; case 'b': opts.bng_mode = true; break; case 'o': opts.output_files_prefix = optarg; break; default: cerr << "Invalid arguments.\n"; print_usage(argv[0]); return ARG_PARSE_ERROR; } } if (optind < argc) { if (argc - optind > 1) { cerr << "Only one input data model file can be specified.\n"; return ARG_PARSE_ERROR; } opts.input_file = argv[optind]; } else { cerr << "Input data model file file was not specified.\n"; return ARG_PARSE_ERROR; } if (opts.output_files_prefix == "Untitled" || opts.output_files_prefix == "Scene") { cout << "Ignoring files prefix '" << opts.output_files_prefix << "'.\n"; opts.output_files_prefix = ""; } return ARG_PARSE_OK; } int main(const int argc, char* argv[]) { MCell::SharedGenData opts; int arg_process_res = process_args(argc, argv, opts); if (arg_process_res != ARG_PARSE_OK) { return arg_process_res; } MCell::MCell4Generator converter; bool ok = converter.generate(opts); if (!ok) { cerr << "There was an error while converting " << opts.input_file << " to pymcell code.\n"; return 1; } return 0; }
C++
3D
mcellteam/mcell
utils/hpc_scripts/mcell_pbs_run_range.py
.py
2,221
64
#!/usr/bin/env python import sys import os import math if __name__ == '__main__': if (len(sys.argv)<4): print ('\nUsage: %s seed_list_spec seeds_per_node mdl_file\n' % (sys.argv[0])) print ('\n Example: %s "1:100:2" 8 Scene.main.mdl\n' % (sys.argv[0])) print (' This would submit mcell jobs to simulate Scene.main.mdl') print (' using seeds 1 through 100 in steps of 2,') print (' with 8 individual simulations running concurrently in each job \n\n') sys.exit() else: seed_list_spec = sys.argv[1] seeds_per_node = int(sys.argv[2]) mdl_file = sys.argv[3] seed_list = [] seed_list_toks = seed_list_spec.split(',') for seed_list_tok in seed_list_toks: seed_range_toks = seed_list_tok.split(':') if (len(seed_range_toks) > 1): if (len(seed_range_toks) == 2): seed_list.extend(range(int(seed_range_toks[0]),int(seed_range_toks[1])+1)) else: seed_list.extend(range(int(seed_range_toks[0]),int(seed_range_toks[1])+1,int(seed_range_toks[2]))) else: seed_list.append(int(seed_list_tok)) mcell_exec = '$HOME/bin/mcell3.5/mcell' mcell_cmd = 'source ~/.bashrc ; %s -seed $seed %s' % (mcell_exec,mdl_file) job_script_template = '%s; for seed in ${seeds[@]}; do { %s & }; done; wait;' job_name_template = 'mcell_%04d_%04d' qsub_option_template = '-l nodes=1 -l walltime=48:00:00 -m n -A kennedy-lab -d ./ -S /bin/bash -N %s -o qsub_%s.out -e qsub_%s.err' for start_i in range(0,len(seed_list),seeds_per_node): end_i = start_i + seeds_per_node - 1 if end_i > len(seed_list)-1: end_i = len(seed_list)-1 seed_chunk = 'seeds=(' for seed in seed_list[start_i:end_i+1]: seed_chunk = seed_chunk + ' ' + str(seed) seed_chunk = seed_chunk + ' )' job_script = job_script_template % (seed_chunk, mcell_cmd) job_name = job_name_template % (seed_list[start_i], seed_list[end_i]) qsub_options = qsub_option_template % (job_name, job_name, job_name) cmd = "echo '%s' | qsub %s -" % (job_script, qsub_options) print(cmd) os.system(cmd)
Python
3D
mcellteam/mcell
utils/hpc_scripts/mcell3r_pbs_run_range.py
.py
2,305
65
#!/usr/bin/env python import sys import os import math if __name__ == '__main__': if (len(sys.argv)<5): print ('\nUsage: %s seed_list_spec seeds_per_node rules_file mdl_file\n' % (sys.argv[0])) print ('\n Example: %s "1:100:2" 8 Scene.mdlr_rules.xml Scene.main.mdl\n' % (sys.argv[0])) print (' This would submit mcell jobs to simulate Scene.main.mdl') print (' using seeds 1 through 100 in steps of 2,') print (' with 8 individual simulations running concurrently in each job \n\n') sys.exit() else: seed_list_spec = sys.argv[1] seeds_per_node = int(sys.argv[2]) rules_file = sys.argv[3] mdl_file = sys.argv[4] seed_list = [] seed_list_toks = seed_list_spec.split(',') for seed_list_tok in seed_list_toks: seed_range_toks = seed_list_tok.split(':') if (len(seed_range_toks) > 1): if (len(seed_range_toks) == 2): seed_list.extend(range(int(seed_range_toks[0]),int(seed_range_toks[1])+1)) else: seed_list.extend(range(int(seed_range_toks[0]),int(seed_range_toks[1])+1,int(seed_range_toks[2]))) else: seed_list.append(int(seed_list_tok)) mcell_exec = '$HOME/bin/mcell3.5/mcell3r.py' mcell_cmd = 'source ~/.bashrc ; %s -s $seed -r %s -m %s' % (mcell_exec,rules_file,mdl_file) job_script_template = '%s; for seed in ${seeds[@]}; do { %s & }; done; wait;' job_name_template = 'mcell_%04d_%04d' qsub_option_template = '-l nodes=1 -l walltime=48:00:00 -m n -A kennedy-lab -d ./ -S /bin/bash -N %s -o qsub_%s.out -e qsub_%s.err' for start_i in range(0,len(seed_list),seeds_per_node): end_i = start_i + seeds_per_node - 1 if end_i > len(seed_list)-1: end_i = len(seed_list)-1 seed_chunk = 'seeds=(' for seed in seed_list[start_i:end_i+1]: seed_chunk = seed_chunk + ' ' + str(seed) seed_chunk = seed_chunk + ' )' job_script = job_script_template % (seed_chunk, mcell_cmd) job_name = job_name_template % (seed_list[start_i], seed_list[end_i]) qsub_options = qsub_option_template % (job_name, job_name, job_name) cmd = "echo '%s' | qsub %s -" % (job_script, qsub_options) print(cmd) os.system(cmd)
Python
3D
mcellteam/mcell
utils/hpc_scripts/mcell_slurm_run_range.py
.py
2,360
67
#!/usr/bin/env python import sys import os import math if __name__ == '__main__': if (len(sys.argv)<4): print ('\nUsage: %s seed_list_spec seeds_per_node mdl_file\n' % (sys.argv[0])) print ('\n Example: %s "1:100:2" 8 Scene.main.mdl\n' % (sys.argv[0])) print (' This would submit mcell jobs to simulate Scene.main.mdl') print (' using seeds 1 through 100 in steps of 2,') print (' with 8 individual simulations running concurrently in each job \n\n') sys.exit() else: seed_list_spec = sys.argv[1] seeds_per_node = int(sys.argv[2]) mdl_file = sys.argv[3] seed_list = [] seed_list_toks = seed_list_spec.split(',') for seed_list_tok in seed_list_toks: seed_range_toks = seed_list_tok.split(':') if (len(seed_range_toks) > 1): if (len(seed_range_toks) == 2): seed_list.extend(range(int(seed_range_toks[0]),int(seed_range_toks[1])+1)) else: seed_list.extend(range(int(seed_range_toks[0]),int(seed_range_toks[1])+1,int(seed_range_toks[2]))) else: seed_list.append(int(seed_list_tok)) # For mcell3: mcell_exec = '$HOME/bin/mcell3.5/bin/mcell' mcell_cmd = '%s -seed $seed %s' % (mcell_exec,mdl_file) # job_script_template = '%s; for seed in ${seeds[@]}; do { %s & }; done; wait;' job_script_template = 'module load python3/3.6.4; %s; for seed in ${seeds[@]}; do { %s & }; done; wait;' job_name_template = 'mcell_%04d_%04d' sbatch_option_template = '--nodes=1 --ntasks=%d --mem-per-cpu=5800 --time=48:00:00 -J %s' for start_i in range(0,len(seed_list),seeds_per_node): end_i = start_i + seeds_per_node - 1 if end_i > len(seed_list)-1: end_i = len(seed_list)-1 seed_chunk = 'seeds=(' for seed in seed_list[start_i:end_i+1]: seed_chunk = seed_chunk + ' ' + str(seed) seed_chunk = seed_chunk + ' )' job_script = job_script_template % (seed_chunk, mcell_cmd) job_name = job_name_template % (seed_list[start_i], seed_list[end_i]) sbatch_options = sbatch_option_template % (seeds_per_node, job_name) # cmd = "echo '%s' | sbatch %s" % (job_script, sbatch_options) cmd = "sbatch %s --wrap='%s'" % (sbatch_options, job_script) print(cmd) os.system(cmd)
Python
3D
mcellteam/mcell
utils/hpc_scripts/mcell3r_slurm_run_range.py
.py
2,467
70
#!/usr/bin/env python import sys import os import math if __name__ == '__main__': if (len(sys.argv)<5): print ('\nUsage: %s seed_list_spec seeds_per_node rules_file mdl_file\n' % (sys.argv[0])) print ('\n Example: %s "1:100:2" 8 Scene.mdlr_rules.xml Scene.main.mdl\n' % (sys.argv[0])) print (' This would submit mcell jobs to simulate Scene.main.mdl') print (' using seeds 1 through 100 in steps of 2,') print (' with 8 individual simulations running concurrently in each job \n\n') sys.exit() else: seed_list_spec = sys.argv[1] seeds_per_node = int(sys.argv[2]) rules_file = sys.argv[3] mdl_file = sys.argv[4] seed_list = [] seed_list_toks = seed_list_spec.split(',') for seed_list_tok in seed_list_toks: seed_range_toks = seed_list_tok.split(':') if (len(seed_range_toks) > 1): if (len(seed_range_toks) == 2): seed_list.extend(range(int(seed_range_toks[0]),int(seed_range_toks[1])+1)) else: seed_list.extend(range(int(seed_range_toks[0]),int(seed_range_toks[1])+1,int(seed_range_toks[2]))) else: seed_list.append(int(seed_list_tok)) # For mcell3r: mcell_exec = '$HOME/bin/mcell3.5/mcell3r.py' mcell_cmd = '%s -s $seed -r %s -m %s' % (mcell_exec,rules_file,mdl_file) # template without loading optional modules # job_script_template = '%s; for seed in ${seeds[@]}; do { %s & }; done; wait;' # template including loading optional modules job_script_template = 'module load python3/3.6.4; %s; for seed in ${seeds[@]}; do { %s & }; done; wait;' job_name_template = 'mcell_%04d_%04d' sbatch_option_template = '--nodes=1 --ntasks=%d --mem-per-cpu=5800 --time=48:00:00 -J %s' for start_i in range(0,len(seed_list),seeds_per_node): end_i = start_i + seeds_per_node - 1 if end_i > len(seed_list)-1: end_i = len(seed_list)-1 seed_chunk = 'seeds=(' for seed in seed_list[start_i:end_i+1]: seed_chunk = seed_chunk + ' ' + str(seed) seed_chunk = seed_chunk + ' )' job_script = job_script_template % (seed_chunk, mcell_cmd) job_name = job_name_template % (seed_list[start_i], seed_list[end_i]) sbatch_options = sbatch_option_template % (seeds_per_node, job_name) cmd = "sbatch %s --wrap='%s'" % (sbatch_options, job_script) print(cmd) os.system(cmd)
Python
3D
mcellteam/mcell
include/debug.h
.h
2,495
93
/****************************************************************************** * * Copyright (C) 2020 by * The Salk Institute for Biological Studies and * Pittsburgh Supercomputing Center, Carnegie Mellon University * * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. * ******************************************************************************/ #include "defines.h" namespace MCell { // TODO: move to cpp static void dump_vol_mol_timing( std::string extra_comment, uint64_t iteration, molecule_id_t id, double scheduled_time, double max_time, double unimol_time, double rate_factor, double r_rate_factor, double steps, double t_steps ) { std::cout << extra_comment << ": it:" << iteration << ", id:" << id << ", scheduled_time: " << scheduled_time << ", max_time: " << max_time << ", unimol_time: " << ((unimol_time != TIME_INVALID && unimol_time != scheduled_time) ? unimol_time : 0) << ", rate_factor: " << rate_factor << ", r_rate_factor: " << r_rate_factor << ", steps: " << steps << ", t_steps: " << t_steps << "\n"; } static void dump_surf_mol_timing( std::string extra_comment, uint64_t iteration, molecule_id_t id, double scheduled_time, double max_time, double unimol_time, double space_factor, double steps, double t_steps ) { std::cout << extra_comment << ": it:" << iteration << ", id:" << id << ", scheduled_time: " << scheduled_time << ", max_time: " << max_time << ", unimol_time: " << ((unimol_time != TIME_INVALID && unimol_time != scheduled_time) ? unimol_time : 0) << ", space_factor: " << space_factor << ", steps: " << steps << ", t_steps: " << t_steps << "\n"; } static void dump_react_2D_all_neighbors_timing( double time, double mol_time ) { std::cout << "react_2D_all_neighbors: " << "time: " << time << ", mol_time (sm->t): " << mol_time << "\n"; } static void dump_outcome_bimolecular_timing( double time ) { std::cout << "outcome_bimolecular: time: " << time << "\n"; } static void dump_uint_vector(const std::vector<uint> v) { for (uint i = 0; i < v.size(); i++) { std::cout << v[i] << ", "; } std::cout << "\n"; } static void dump_uint_set(const std::set<uint> s) { for (uint val: s) { std::cout << val << ", "; } std::cout << "\n"; } } // namespace?
Unknown