23 #if !defined(OPENNURBS_DEFINES_INC_)
24 #define OPENNURBS_DEFINES_INC_
26 #if defined (cplusplus) || defined(_cplusplus) || defined(__cplusplus) || defined(ON_CPLUSPLUS)
29 #if !defined(ON_CPLUSPLUS)
32 #define ON_EXTERNC extern "C"
33 #define ON_BEGIN_EXTERNC extern "C" {
34 #define ON_END_EXTERNC }
41 #define ON_BEGIN_EXTERNC
42 #define ON_END_EXTERNC
49 #if !defined(ON_DEBUG)
64 #if defined(OPENNURBS_EXPORTS)
66 #if !defined(ON_DLL_EXPORTS)
67 #define ON_DLL_EXPORTS
69 #if !defined(ON_COMPILING_OPENNURBS)
70 #define ON_COMPILING_OPENNURBS
74 #if defined(OPENNURBS_IMPORTS)
76 #if !defined(ON_DLL_IMPORTS)
77 #define ON_DLL_IMPORTS
81 #if defined(ON_DLL_EXPORTS) && defined(ON_DLL_IMPORTS)
82 #error At most one of ON_DLL_EXPORTS and ON_DLL_IMPORTS can be defined.
86 #if defined(ON_DLL_EXPORTS)
88 #if !defined(ON_COMPILING_OPENNURBS)
89 #error When compiling an OpenNURBS DLL, ON_DLL_EXPORTS must be defined
93 #define ON_CLASS __declspec(dllexport)
94 #define ON_DECL __declspec(dllexport)
95 #define ON_EXTERN_DECL __declspec(dllexport)
96 #define ON_DLL_TEMPLATE
98 #elif defined(ON_DLL_IMPORTS)
100 #if defined(ON_COMPILING_OPENNURBS)
101 #error When compiling an OpenNURBS DLL, ON_DLL_IMPORTS must NOT be defined
105 #define ON_CLASS __declspec(dllimport)
106 #define ON_DECL __declspec(dllimport)
107 #define ON_EXTERN_DECL __declspec(dllimport)
108 #define ON_DLL_TEMPLATE extern
115 #define ON_EXTERN_DECL
117 #if defined(ON_DLL_TEMPLATE)
118 #undef ON_DLL_TEMPLATE
125 #if defined(ON_COMPILER_MSC)
126 #define ON_DEPRECATED __declspec(deprecated)
128 #define ON_DEPRECATED
134 #define ON_PI 3.141592653589793238462643
137 #define ON_DEGREES_TO_RADIANS ON_PI/180.0
138 #define ON_RADIANS_TO_DEGREES 180.0/ON_PI
140 #define ON_SQRT2 1.414213562373095048801689
141 #define ON_SQRT3 1.732050807568877293527446
142 #define ON_SQRT3_OVER_2 0.8660254037844386467637230
143 #define ON_1_OVER_SQRT2 0.7071067811865475244008445
144 #define ON_SIN_PI_OVER_12 0.2588190451025207623488990
145 #define ON_COS_PI_OVER_12 0.9659258262890682867497433
147 #define ON_LOG2 0.6931471805599453094172321
148 #define ON_LOG10 2.302585092994045684017991
150 #define ON_ArrayCount(a) (sizeof(a)/sizeof((a)[0]))
153 #define ON_DBL_MAX DBL_MAX
155 #define ON_DBL_MAX 1.7976931348623158e+308
159 #define ON_DBL_MIN DBL_MIN
161 #define ON_DBL_MIN 2.22507385850720200e-308
165 #if defined(DBL_EPSILON)
166 #define ON_EPSILON DBL_EPSILON
168 #define ON_EPSILON 2.2204460492503131e-16
170 #define ON_SQRT_EPSILON 1.490116119385000000e-8
172 #if defined(FLT_EPSILON)
173 #define ON_FLOAT_EPSILON FLT_EPSILON
175 #define ON_FLOAT_EPSILON 1.192092896e-07
177 #define ON_SQRT_FLOAT_EPSILON 3.452669830725202719e-4
201 #define ON_UNSET_VALUE -1.23432101234321e+308
210 #define ON_UNSET_FLOAT -1.234321e+38f
216 extern ON_EXTERN_DECL
const double ON_DBL_QNAN;
217 extern ON_EXTERN_DECL
const double ON_DBL_PINF;
218 extern ON_EXTERN_DECL
const double ON_DBL_NINF;
220 extern ON_EXTERN_DECL
const float ON_FLT_QNAN;
221 extern ON_EXTERN_DECL
const float ON_FLT_PINF;
222 extern ON_EXTERN_DECL
const float ON_FLT_NINF;
245 void ON_DBL_SNAN(
double* x );
248 void ON_FLT_SNAN(
float* x );
257 #define ON_UNSET_COLOR 0xFFFFFFFF
270 #define ON_ZERO_TOLERANCE 2.3283064365386962890625e-10
282 #define ON_RELATIVE_TOLERANCE 2.27373675443232059478759765625e-13
290 #define ON_MAXIMUM_WORLD_COORDINATE_VALUE 1.34217728e8
300 #define ON_ZERO_CURVATURE_TOLERANCE 1.0e-8
303 #define ON_DEFAULT_ANGLE_TOLERANCE (ON_PI/180.0)
304 #define ON_DEFAULT_ANGLE_TOLERANCE_COSINE 0.99984769515639123915701155881391
305 #define ON_MINIMUM_ANGLE_TOLERANCE (ON_DEFAULT_ANGLE_TOLERANCE/10.0)
357 #if defined(ON_CPLUSPLUS)
387 const char* SourceRevision();
390 const char* DocumentationRevision();
393 const char* SourceBranch();
396 const char* DocumentationBranch();
403 const char* filename,
409 const wchar_t* filename,
410 const wchar_t* filemode
434 bool GetFileStats(
const wchar_t* filename,
437 time_t* lastmodify_time
441 bool GetFileStats( FILE* fp,
444 time_t* lastmodify_time
450 static bool IsDirectory(
const wchar_t* pathname );
451 static bool IsDirectory(
const char* utf8pathname );
459 static int IsOpenNURBSFile(
const wchar_t* pathname );
460 static int IsOpenNURBSFile(
const char* utf8pathname );
461 static int IsOpenNURBSFile( FILE* fp );
477 static eAnnotationType AnnotationType(
int);
481 enum eTextDisplayMode
489 static eTextDisplayMode TextDisplayMode(
int);
499 static active_space ActiveSpace(
int);
559 custom_unit_system = 11
562 static unit_system UnitSystem(
int);
581 static double UnitScale(
582 ON::unit_system us_from,
583 ON::unit_system us_to
585 static double UnitScale(
589 static double UnitScale(
590 ON::unit_system us_from,
593 static double UnitScale(
595 ON::unit_system us_to
597 static double UnitScale(
613 static const wchar_t* NameReferenceDelimiter();
623 static unsigned int NameReferenceDelimiterLength();
645 static const wchar_t* IsNameReferenceDelimiter(
const wchar_t* s);
648 enum distance_display_mode
655 static distance_display_mode DistanceDisplayMode(
int);
661 unknown_point_style = 0,
663 homogeneous_rational = 2,
664 euclidean_rational = 3,
665 intrinsic_point_style = 4,
666 point_style_count = 5
669 static point_style PointStyle(
int);
674 unknown_knot_style = 0,
676 quasi_uniform_knots = 2,
677 piecewise_bezier_knots = 3,
678 clamped_end_knots = 4,
679 non_uniform_knots = 5,
683 static knot_style KnotStyle(
int);
688 unknown_continuity = 0,
714 C0_locus_continuous = 6,
715 C1_locus_continuous = 7,
716 C2_locus_continuous = 8,
717 G1_locus_continuous = 9,
718 G2_locus_continuous = 10,
720 Cinfinity_continuous = 11,
721 Gsmooth_continuous = 12
728 static continuity Continuity(
int);
736 static continuity ParametricContinuity(
int);
745 static continuity PolylineContinuity(
int);
750 unknown_curve_style = 0,
758 planar_freeform_curve = 8,
760 curve_style_count = 10
763 static curve_style CurveStyle(
int);
768 unknown_surface_style = 0,
770 circular_cylinder = 2,
771 elliptical_cylinder = 3,
776 surface_of_revolution = 8,
778 freeform_surface = 10,
779 surface_style_count = 11
782 static surface_style SurfaceStyle(
int);
791 static sort_algorithm SortAlgorithm(
int);
799 static endian Endian(
int);
800 static endian Endian();
805 unknown_archive_mode = 0,
812 static archive_mode ArchiveMode(
int);
838 static view_projection ViewProjection(
int i);
846 static bool IsPerspectiveProjection( ON::view_projection projection );
855 static bool IsParallelProjection( ON::view_projection projection );
859 enum coordinate_system
867 static coordinate_system CoordinateSystem(
int);
872 unknown_exception = 0,
876 unable_to_write_archive,
877 unable_to_read_archive,
878 unable_to_seek_archive,
879 unexpected_end_of_archive,
880 unexpected_value_in_archive
882 static exception_type ExceptionType(
int);
893 static layer_mode LayerMode(
int);
904 object_mode_count = 4
906 static object_mode ObjectMode(
int);
909 enum object_color_source
911 color_from_layer = 0,
912 color_from_object = 1,
913 color_from_material = 2,
914 color_from_parent = 3
917 static object_color_source ObjectColorSource(
int);
920 enum plot_color_source
922 plot_color_from_layer = 0,
923 plot_color_from_object = 1,
924 plot_color_from_display = 2,
925 plot_color_from_parent = 3
928 static plot_color_source PlotColorSource(
int);
931 enum plot_weight_source
933 plot_weight_from_layer = 0,
934 plot_weight_from_object = 1,
935 plot_weight_from_parent = 3
938 static plot_weight_source PlotWeightSource(
int);
941 enum object_linetype_source
943 linetype_from_layer = 0,
944 linetype_from_object = 1,
945 linetype_from_parent = 3
948 static object_linetype_source ObjectLinetypeSource(
int);
951 enum object_material_source
953 material_from_layer = 0,
954 material_from_object = 1,
955 material_from_parent = 3
964 static object_material_source ObjectMaterialSource(
int);
969 unknown_light_style = 0,
973 camera_directional_light = 4,
974 camera_point_light = 5,
975 camera_spot_light = 6,
976 world_directional_light = 7,
977 world_point_light = 8,
978 world_spot_light = 9,
980 world_linear_light = 11,
981 world_rectangular_light = 12,
982 light_style_count = 13
984 static light_style LightStyle(
int);
989 unknown_curvature_style = 0,
990 gaussian_curvature = 1,
994 curvature_style_count = 5
996 static curvature_style CurvatureStyle(
int);
1001 default_display = 0,
1002 wireframe_display = 1,
1004 renderpreview_display = 3
1006 static display_mode DisplayMode(
int);
1011 model_view_type = 0,
1017 nested_view_type = 2,
1021 static view_type ViewType(
int);
1030 modulate_texture = 1,
1034 static texture_mode TextureMode(
int);
1046 unknown_object_type = 0,
1049 pointset_object = 2,
1054 layer_object = 0x40,
1055 material_object = 0x80,
1056 light_object = 0x100,
1057 annotation_object = 0x200,
1058 userdata_object = 0x400,
1059 instance_definition = 0x800,
1060 instance_reference = 0x1000,
1062 grip_object = 0x4000,
1063 detail_object = 0x8000,
1064 hatch_object = 0x10000,
1065 morph_control_object = 0x20000,
1066 loop_object = 0x80000,
1067 polysrf_filter = 0x200000,
1068 edge_filter = 0x400000,
1069 polyedge_filter = 0x800000,
1070 meshvertex_object = 0x01000000,
1071 meshedge_object = 0x02000000,
1072 meshface_object = 0x04000000,
1073 cage_object = 0x08000000,
1074 phantom_object = 0x10000000,
1075 clipplane_object = 0x20000000,
1076 beam_object = 0x40000000,
1077 extrusion_object = 0x40000000,
1079 any_object = 0xFFFFFFFF
1084 static object_type ObjectType(
int);
1089 unknown_bitmap_type = 0,
1094 static bitmap_type BitmapType(
int);
1096 enum object_decoration
1098 no_object_decoration = 0,
1099 start_arrowhead = 0x08,
1100 end_arrowhead = 0x10,
1101 both_arrowhead = 0x18
1103 static object_decoration ObjectDecoration(
int);
1113 static mesh_type MeshType(
int);
1132 os_quadrant = 0x200,
1133 os_midpoint = 0x800,
1134 os_intersection = 0x2000,
1136 os_perpendicular = 0x80000,
1137 os_tangent = 0x200000,
1138 os_point = 0x08000000,
1139 os_all_snaps = 0xFFFFFFFF
1141 static osnap_mode OSnapMode(
int);
1163 enum cubic_loft_end_condition
1165 cubic_loft_ec_quadratic = 0,
1166 cubic_loft_ec_linear = 1,
1167 cubic_loft_ec_cubic = 2,
1168 cubic_loft_ec_natural = 3,
1169 cubic_loft_ec_unit_tangent = 4,
1170 cubic_loft_ec_1st_derivative = 5,
1171 cubic_loft_ec_2nd_derivative = 6,
1172 cubic_loft_ec_free_cv = 7
1187 cubic_loft_end_condition CubicLoftEndCondition(
int i);
1203 class ON_CLASS ON_COMPONENT_INDEX
1221 meshtop_vertex = 12,
1227 polycurve_segment = 31,
1229 pointcloud_point = 41,
1234 extrusion_bottom_profile = 61,
1236 extrusion_top_profile = 62,
1238 extrusion_wall_edge = 63,
1241 extrusion_wall_surface = 64,
1243 extrusion_cap_surface = 65,
1245 extrusion_path = 66,
1248 dim_linear_point = 100,
1249 dim_radial_point = 101,
1250 dim_angular_point = 102,
1251 dim_ordinate_point = 103,
1252 dim_text_point = 104,
1254 no_type = 0xFFFFFFFF
1279 int Compare(
const ON_COMPONENT_INDEX* a,
const ON_COMPONENT_INDEX* b);
1285 ON_COMPONENT_INDEX();
1291 ON_COMPONENT_INDEX(TYPE type,
int index);
1293 bool operator==(
const ON_COMPONENT_INDEX& other)
const;
1294 bool operator!=(
const ON_COMPONENT_INDEX& other)
const;
1295 bool operator<(
const ON_COMPONENT_INDEX& other)
const;
1296 bool operator<=(
const ON_COMPONENT_INDEX& other)
const;
1297 bool operator>(
const ON_COMPONENT_INDEX& other)
const;
1298 bool operator>=(
const ON_COMPONENT_INDEX& other)
const;
1300 void Set(TYPE type,
int index);
1320 bool IsMeshComponentIndex()
const;
1327 bool IsBrepComponentIndex()
const;
1333 bool IsIDefComponentIndex()
const;
1339 bool IsPolyCurveComponentIndex()
const;
1345 bool IsGroupMemberComponentIndex()
const;
1352 bool IsExtrusionProfileComponentIndex()
const;
1358 bool IsExtrusionPathComponentIndex()
const;
1364 bool IsExtrusionWallEdgeComponentIndex()
const;
1370 bool IsExtrusionWallSurfaceComponentIndex()
const;
1377 bool IsExtrusionWallComponentIndex()
const;
1385 bool IsExtrusionComponentIndex()
const;
1391 bool IsPointCloudComponentIndex()
const;
1397 bool IsAnnotationComponentIndex()
const;
1467 unsigned int ON_SetStringConversionWindowsCodePage(
1468 unsigned int code_page
1496 unsigned int ON_GetStringConversionWindowsCodePage();
1517 unsigned int ON_SetStringConversionWindowsLocaleID(
1518 unsigned int locale_id,
1536 unsigned int ON_GetStringConversionWindowsLocaleID();
1541 int on_wcsicmp(
const wchar_t*,
const wchar_t* );
1545 wchar_t* on_wcsupr(
wchar_t*);
1549 wchar_t* on_wcslwr(
wchar_t*);
1553 wchar_t* on_wcsrev(
wchar_t*);
1559 int on_stricmp(
const char*,
const char*);
1565 int on_strnicmp(
const char * s1,
const char * s2,
int n);
1569 char* on_strupr(
char*);
1573 char* on_strlwr(
char*);
1577 char* on_strrev(
char*);
1584 int on_WideCharToMultiByte(
1596 int on_MultiByteToWideChar(
1646 ON_DECL
void on_splitpath(
1698 ON_DECL
void on_wsplitpath(
1699 const wchar_t* path,
1700 const wchar_t** drive,
1701 const wchar_t** dir,
1702 const wchar_t** fname,
bool operator<(const PersonCluster< PointT > &c1, const PersonCluster< PointT > &c2)
void read(std::istream &stream, Type &value)
Function for reading data from a stream.
bool operator!=(const OpenNI2VideoMode &video_mode_a, const OpenNI2VideoMode &video_mode_b)
void write(std::ostream &stream, Type value)
Function for writing data to a stream.
bool operator==(const OpenNI2VideoMode &video_mode_a, const OpenNI2VideoMode &video_mode_b)