C3D Toolkit  Kernel - 117982, Vision - 2.9.2.2
mb_variables.h File Reference

Constants and variables. More...

#include <math_define.h>
#include <tool_uuid.h>
#include <tool_mutex.h>
#include <iostream>

Classes

class  Math
 Common static data of algorithms and functions. More...
 

Namespaces

 c3d
 C3D namespace declaration.
 

Enumerations

Assert violation notification.
enum  c3d::eAssertViolationNotify { c3d::avn_Mute , c3d::avn_CERR , c3d::avn_ASSERT }
 

Functions

size_t GetC3dVersionInfo (char *const buffer, size_t bufferSize)
 Get information about the c3d file version. More...
 
size_t GetC3dBuildInfo (char *const buffer, size_t bufferSize)
 Get information about the c3d file build option. More...
 
std::string GetC3dLibInfo (bool needVersionInfo=true)
 Get information about the c3d file. More...
 

Variables

constexpr double c3d::METRIC_PORTION = 0.075
 Proportion of distance between control points.
 
constexpr double c3d::METRIC_DELTA = 0.05
 Metric offset.
 
constexpr double c3d::PARAM_DELTA_MIN = 0.005
 Minimal portion of parameter increment.
 
constexpr double c3d::PARAM_DELTA_MAX = 1.0
 Maximal portion of parameter increment.
 
constexpr double c3d::MIN_LENGTH = 1.0E-4
 Minimal object length.
 
constexpr double c3d::MAX_LENGTH = 5.0E+7
 Maximal object length.
 
constexpr double c3d::MIN_RADIUS = 1.0E-4
 Minimal object radius.
 
constexpr double c3d::MAX_RADIUS = 2.5E+7
 Maximal object radius.
 
constexpr double c3d::DELTA_MIN = 1E-3
 Reduction factor.
 
constexpr double c3d::DELTA_MID = 1E-2
 Reduction factor.
 
constexpr double c3d::DELTA_MOD = 1E-1
 Reduction factor.
 
constexpr double c3d::DELTA_MAX = 1E+3
 Magnification factor.
 
constexpr double c3d::POWER_1 = 1E+1
 Magnification factor.
 
constexpr double c3d::POWER_2 = 1E+2
 Magnification factor.
 
constexpr double c3d::POWER_3 = 1E+3
 Magnification factor.
 
constexpr double c3d::POWER_4 = 1E+4
 Magnification factor.
 
constexpr double c3d::POWER_5 = 1E+5
 Magnification factor.
 
constexpr double c3d::ONE_THIRD = 0.33333333333333333333
 1/3.
 
constexpr double c3d::TWO_THIRD = 0.66666666666666666666
 2/3.
 
constexpr double c3d::ONE_SIXTH = 0.166666666666666666667
 1/6.
 
constexpr double c3d::ONE_FIFTH = 0.2
 1/5.
 
constexpr double c3d::TWO_FIFTH = 0.4
 2/5.
 
constexpr double c3d::ONE_QUARTER = 0.25
 1/4.
 
constexpr double c3d::ONE_HALF = 0.5
 1/2.
 
constexpr double c3d::ONE_SEVENTH = 0.14285714285714285714
 1/7.
 
constexpr double c3d::ONE_EIGHTH = 0.125
 1/8.
 
constexpr double c3d::_CONIC_MIN_ = 0.05
 Minimum factor of smooth surface section completeness (0.5 for parabola, less for ellipse).
 
constexpr double c3d::_CONIC_MAX_ = 0.95
 Maximum factor of smooth surface section completeness (0.5 for parabola, greater for hyperbola).
 
constexpr double c3d::_ARC_ = 0.0
 Factor of smooth surface section completeness in case of u = const corresponds to circle arc.
 
constexpr int32 c3d::TEN = 10
 Number 10.
 
constexpr int32 c3d::TWENTY = 20
 Number 20.
 
constexpr int32 c3d::TESSERA_MAX = 4000
 Maximum count of cell in rows and columns for triangulation grid.
 
constexpr int32 c3d::COUNT_MAX = 512
 Magnification factor.
 
constexpr int32 c3d::COUNT_MID = 256
 Magnification factor.
 
constexpr int32 c3d::COUNT_MIN = 128
 Magnification factor.
 
constexpr int32 c3d::COUNT_BIN = 64
 Inclusion level.
 
constexpr int32 c3d::WIRE_MAX = 256
 The maximum number of mesh lines.
 
constexpr int32 c3d::ITERATE_COUNT = 16
 Number of approximations in iterative method.
 
constexpr int32 c3d::ITERATE_LIMIT = 32
 Count of iterations for construction of tangent circles.
 
constexpr int32 c3d::NEWTON_COUNT = 8
 Number of approximations in iterative method.
 
constexpr int32 c3d::NEWTON_COUNT_2X = 16
 Number of approximations in iterative method.
 
constexpr int32 c3d::NEWTON_COUNT_3X = 24
 Number of approximations in iterative method.
 
constexpr int32 c3d::NEWTON_COUNT_4X = 32
 Number of approximations in iterative method.
 
constexpr int32 c3d::NEWTON_COUNT_8X = 64
 Number of approximations in iterative method.
 
constexpr int32 c3d::LIMIT_COUNT = 4
 Number of approximations in iterative method.
 
constexpr int32 c3d::COUNT_DELTA = 10
 Reduction or magnification factor.
 
constexpr int32 c3d::COUNT_DELTA_2X = 20
 Reduction or magnification factor.
 
constexpr int32 c3d::ITEMS_COUNT = 12
 Number of points in step method.
 
constexpr int32 c3d::BEZIER_DEGREE = 4
 Default degree of Bezier-spline.
 
constexpr int32 c3d::NURBS_DEGREE = 4
 Degree of NURBS.
 
constexpr int32 c3d::NURBS_POINTS_COUNT = 6
 Default number of points for NURBS direct editing.
 
constexpr int32 c3d::NURBS_POINTS_MAX_COUNT = 100
 Default maximum number of points for NURBS direct editing.
 
constexpr int32 c3d::APPROX_POINTS_MUL_COEFF = 3
 Factor of points count incrementing in method of least squares.
 
constexpr int32 c3d::SPACE_DIM = 3
 Dimension of 3D space.
 
constexpr int32 c3d::TRT_FREE = 0
 No conjugation.
 
constexpr int32 c3d::TRT_TANGENT = 1
 Tangent conjugation.
 
constexpr int32 c3d::TRT_NORMAL = 2
 Normal conjugation.
 
Common constants
constexpr double MB_INFINITY = std::numeric_limits<double>::infinity()
 Value representing infinity for double.
 
constexpr double MB_QNAN = std::numeric_limits<double>::quiet_NaN()
 Quiet Not-A-Number.
 
constexpr double MB_MAXDOUBLE = 1.0E+300
 Maximum value of double 1.7976931348623158E+308.
 
constexpr double MB_MINDOUBLE = 1.0E-300
 Minimum value of double 2.2250738585072014E-308.
 
constexpr double M_E = 2.71828182845904523536
 Exponent.
 
constexpr double M_LOG2E = 1.44269504088896340736
 Logarithm M_E to base 2.
 
constexpr double M_LOG10E = 0.434294481903251827651
 Logarithm M_E to base 10.
 
constexpr double M_LN2 = 0.693147180559945309417
 Natural logarithm 2.
 
constexpr double M_PI_4 = 0.785398163397448309616
 M_PI / 4.0.
 
constexpr double M_1_PI = 0.318309886183790671538
 1.0 / M_PI
 
constexpr double M_2_PI = 0.636619772367581343076
 2.0 / M_PI
 
constexpr double M_SQRT1_2 = 0.707106781186547524401
 Root of one half, sqrt(1/2).
 
constexpr double M_LN10 = 2.30258509299404568402
 Natural logarithm 10, ln(10).
 
constexpr double M_PI = 3.14159265358979323846
 Relation between circle length and its diameter, pi.
 
constexpr double M_PI_2 = 1.57079632679489661923
 M_PI / 2.0.
 
constexpr double M_2_SQRTPI = 1.12837916709551257390
 Two divided by root of pi, 2/sqrt(pi).
 
constexpr double M_SQRT2 = 1.41421356237309504880
 Root of two, sqrt(2).
 
constexpr double M_1_SQRTPI = 0.564189583547756286948
 One divided by root of pi, 1/sqrt(pi).
 
constexpr double M_FI = 1.61803398874989484
 Golden ratio, 1/M_FI = 0.6180339887499.
 
constexpr double MM_INCH = 25.4
 Millimeters per inch.
 
constexpr double EPSILON = 1E-10
 Tolerance.
 
constexpr double MAXIMON = 1E+10
 10 to the power of 10.
 
constexpr double MAX_OVERALL_DIM = 1E+12
 Maximal value of bounding box.
 
constexpr double DETERMINANT_MAX = 1E+137
 Maximal value.
 
constexpr double DETERMINANT_MIN = 1E-171
 Minimal value.
 
constexpr double NULL_EPSILON = 1E-30
 Tolerance for equality to zero.
 
constexpr double NULL_REGION = 1E-20
 Tolerance for equality to zero.
 
constexpr double DOUBLE_EPSILON = 1E-16
 Tolerance.
 
constexpr double DOUBLE_REGION = 1E-15
 Tolerance.
 
constexpr double EXTENT_EQUAL = 1E-14
 Tolerance.
 
constexpr double EXTENT_EPSILON = 1E-12
 Tolerance.
 
constexpr double EXTENT_REGION = 1E-11
 Tolerance.
 
constexpr double LENGTH_EPSILON = 1E-10
 Tolerance for length.
 
constexpr double LENGTH_REGION = 1E-9
 Tolerance for region.
 
constexpr double METRIC_EPSILON = 1E-8
 Tolerance for distance in iterative functions.
 
constexpr double METRIC_REGION = 1E-7
 Indistinguishable metric region.
 
constexpr double METRIC_PRECISION = 1E-6
 Metric tolerance.
 
constexpr double METRIC_ACCURACY = 1E-5
 The largest metric tolerance (absolute tolerance expressed in mm ("size" of atom is 5e-8 mm)).
 
constexpr double METRIC_NEAR = 1E-4
 Metric proximity tolerance.
 
constexpr double PARAM_EPSILON = 1E-8
 Tolerance for parameter in iterative functions.
 
constexpr double PARAM_REGION = 1E-7
 Indistinguishable parametric region.
 
constexpr double PARAM_PRECISION = 1E-6
 Parametric tolerance.
 
constexpr double PARAM_ACCURACY = 1E-5
 The largest parametric tolerance.
 
constexpr double PARAM_NEAR = 1E-4
 Parametric proximity.
 
constexpr ptrdiff_t UNDEFINED_INT_T = SYS_MIN_ST
 Undefined int.
 
constexpr size_t FAIR_MAX_DEGREE = 11
 Maxinum degree of the NURBS approximation.
 
constexpr double M_PI2 = M_PI * 2.0
 Relation between circle length and its radius, 2.0 * M_PI, 6.28318530717958647692.
 
constexpr double M_DEGRAD = M_PI / 180.0
 Factor of conversion from degrees to radians.
 
constexpr double M_RADDEG = 180.0 / M_PI
 Factor of conversion from radians to degrees.
 
constexpr double UNDEFINED_DBL = -MB_MAXDOUBLE
 Undefined double.
 
constexpr double DEVIATION_SAG = M_PI * 0.04
 Angular tolerance.
 
constexpr double ANGLE_EPSILON = PARAM_EPSILON * M_PI
 Angular tolerance.
 
constexpr double ANGLE_REGION = ANGLE_EPSILON * 40
 Angular tolerance for equality of angles.
 
constexpr float MB_AMBIENT = 0.4f
 Coefficient of backlighting.
 
constexpr float MB_DIFFUSE = 0.7f
 Coefficient of diffuse reflection.
 
constexpr float MB_SPECULARITY = 0.8f
 Coefficient of specular reflection.
 
constexpr float MB_SHININESS = 50.0f
 Shininess (index according to the law of specular reflection).
 
constexpr float MB_OPACITY = 1.0f
 Coefficient of total reflection (opacity coefficient).
 
constexpr float MB_EMISSION = 0.0f
 Emissivity coefficient.
 
constexpr uint32 MB_DEFCOLOR = 0x7F7F7F
 Default color for import and export (grey).
 
constexpr uint32 MB_C3DCOLOR = 0xFF7F00
 Default color for geometric objects.
 
constexpr uint32 MB_AMBIENT_UINT32 = 0xFF666666
 Coefficient of backlighting (equivalent of MB_AMBIENT).
 
constexpr uint32 MB_SPECULARITY_UINT32 = 0xFFCCCCCC
 Coefficient of specular reflection (equivalent of MB_SPECULARITY).
 
constexpr uint32 MB_EMISSION_UINT32 = 0xFF000000
 Emissivity coefficient (equivalent of MB_SPECULARITY).
 
constexpr uint8 MB_OPACITY_UINT8 = 255
 Coefficient of total reflection (equivalent of MB_OPACITY).
 
constexpr uint8 MB_SHININESS_UINT8 = 50
 Shininess (index according to the law of specular reflection). Equivalent of MB_SHININESS.
 
constexpr uint8 MB_IDENTITY = 0x00
 Bit flags for matrix and local coordinate system.
More...
 
constexpr uint8 MB_TRANSLATION = 0x01
 Translation.
 
constexpr uint8 MB_ROTATION = 0x02
 Rotation.
 
constexpr uint8 MB_SCALING = 0x04
 Scaling (factor is not equal to 1.0).
 
constexpr uint8 MB_REFLECTION = 0x08
 Reflection.
 
constexpr uint8 MB_LEFT = 0x08
 Reflection (left coordinate system attribute).
 
constexpr uint8 MB_ORTOGONAL = 0x10
 Orthogonality, is set up in case of affinity.
 
constexpr uint8 MB_AFFINE = 0x20
 Absence of orthogonality and normalization (affine transformation).
 
constexpr uint8 MB_PERSPECTIVE = 0x40
 Vector of perspective (non-zero).
 
constexpr uint8 MB_UNSET = 0x80
 Bit flags not set.
 

Detailed Description

Constants and variables.

Function Documentation

◆ GetC3dVersionInfo()

size_t GetC3dVersionInfo ( char *const  buffer,
size_t  bufferSize 
)

Get information about the c3d file version.

The function copies a string with information about the c3d file version to the specified buffer.

Parameters
[in]buffer- Pointer to the beginning of the buffer.
[in]bufferSize- The size of the buffer in characters.
Returns
Returns the number of copied characters, excluding the null character. If buffer = = nullptr returns the required buffer size without the null character. c3d.dll version information

◆ GetC3dBuildInfo()

size_t GetC3dBuildInfo ( char *const  buffer,
size_t  bufferSize 
)

Get information about the c3d file build option.

The function copies a string with information about the c3d file build option to the specified buffer.

Parameters
[in]buffer- Pointer to the beginning of the buffer.
[in]bufferSize- The size of the buffer in characters.
Returns
Returns the number of copied characters, excluding the null character. If buffer = = nullptr returns the required buffer size without the null character. c3d.dll building information

◆ GetC3dLibInfo()

std::string GetC3dLibInfo ( bool  needVersionInfo = true)
inline

Get information about the c3d file.

This function is a wrapper for the GetC3dVersionInfo and GetC3dBuildInfo functions. Returns a string with information about the file version or build version of the file.

Parameters
[in]needVersionInfo- need Version Info == true - returns information about the file version, otherwise information about the file build option.
Returns
Returns a string with the requested information.

Variable Documentation

◆ MB_IDENTITY

constexpr uint8 MB_IDENTITY = 0x00
constexpr

Bit flags for matrix and local coordinate system.

Identity.