Point Cloud Library (PCL) 1.13.0
Loading...
Searching...
No Matches
opennurbs_defines.h
1/* $NoKeywords: $ */
2/*
3//
4// Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
5// OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
6// McNeel & Associates.
7//
8// THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
9// ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
10// MERCHANTABILITY ARE HEREBY DISCLAIMED.
11//
12// For complete openNURBS copyright information see <http://www.opennurbs.org>.
13//
14////////////////////////////////////////////////////////////////
15*/
16
17////////////////////////////////////////////////////////////////
18//
19// Includes all openNURBS toolkit defines and enums.
20//
21////////////////////////////////////////////////////////////////
22
23#if !defined(OPENNURBS_DEFINES_INC_)
24#define OPENNURBS_DEFINES_INC_
25
26#include <pcl/pcl_exports.h>
27
28#if defined (cplusplus) || defined(_cplusplus) || defined(__cplusplus) || defined(ON_CPLUSPLUS)
29// C++ extern "C" declaration for C linkage
30
31#if !defined(ON_CPLUSPLUS)
32#define ON_CPLUSPLUS
33#endif
34#define ON_EXTERNC extern "C"
35#define ON_BEGIN_EXTERNC extern "C" {
36#define ON_END_EXTERNC }
37
38#else
39
40/* C file - no extern declaration required or permitted */
41
42#define ON_EXTERNC
43#define ON_BEGIN_EXTERNC
44#define ON_END_EXTERNC
45
46#endif
47
48
49#if defined(_DEBUG)
50/* enable OpenNurbs debugging code */
51#if !defined(ON_DEBUG)
52#define ON_DEBUG
53#endif
54#endif
55
56/*
57// Declarations in header (.H) files look like
58//
59// ON_DECL type function():
60// extern ON_EXTERN_DECL type global_variable;
61// class ON_CLASS classname {};
62// ON_TEMPLATE template class ON_CLASS template<T>;
63//
64*/
65
66#if defined(OPENNURBS_EXPORTS)
67// OPENNURBS_EXPORTS is Microsoft's prefered defined for building an opennurbs DLL.
68#if !defined(ON_DLL_EXPORTS)
69#define ON_DLL_EXPORTS
70#endif
71#if !defined(ON_COMPILING_OPENNURBS)
72#define ON_COMPILING_OPENNURBS
73#endif
74#endif
75
76#if defined(OPENNURBS_IMPORTS)
77// OPENNURBS_EXPORTS is Microsoft's prefered defined for linking with an opennurbs DLL.
78#if !defined(ON_DLL_IMPORTS)
79#define ON_DLL_IMPORTS
80#endif
81#endif
82
83#if defined(ON_DLL_EXPORTS) && defined(ON_DLL_IMPORTS)
84#error At most one of ON_DLL_EXPORTS and ON_DLL_IMPORTS can be defined.
85#endif
86
87/* export/import */
88#if defined(ON_DLL_EXPORTS)
89
90#if !defined(ON_COMPILING_OPENNURBS)
91#error When compiling an OpenNURBS DLL, ON_DLL_EXPORTS must be defined
92#endif
93
94/* compiling OpenNurbs as a Windows DLL - export classes, functions, templates, and globals */
95#define ON_CLASS __declspec(dllexport)
96#define ON_DECL __declspec(dllexport)
97#define ON_EXTERN_DECL __declspec(dllexport)
98#define ON_DLL_TEMPLATE
99
100#elif defined(ON_DLL_IMPORTS)
101
102#if defined(ON_COMPILING_OPENNURBS)
103#error When compiling an OpenNURBS DLL, ON_DLL_IMPORTS must NOT be defined
104#endif
105
106/* using OpenNurbs as a Windows DLL - import classes, functions, templates, and globals */
107#define ON_CLASS __declspec(dllimport)
108#define ON_DECL __declspec(dllimport)
109#define ON_EXTERN_DECL __declspec(dllimport)
110#define ON_DLL_TEMPLATE extern
111
112#else
113
114/* compiling or using OpenNurbs as a static library */
115#define ON_CLASS
116#define ON_DECL
117#define ON_EXTERN_DECL
118
119#if defined(ON_DLL_TEMPLATE)
120#undef ON_DLL_TEMPLATE
121#endif
122
123#endif
124
125
126// ON_DEPRECATED is used to mark deprecated functions.
127#if defined(ON_COMPILER_MSC)
128#define ON_DEPRECATED __declspec(deprecated)
129#else
130#define ON_DEPRECATED
131#endif
132
133#if defined(PI)
134#define ON_PI PI
135#else
136#define ON_PI 3.141592653589793238462643
137#endif
138
139#define ON_DEGREES_TO_RADIANS ON_PI/180.0
140#define ON_RADIANS_TO_DEGREES 180.0/ON_PI
141
142#define ON_SQRT2 1.414213562373095048801689
143#define ON_SQRT3 1.732050807568877293527446
144#define ON_SQRT3_OVER_2 0.8660254037844386467637230
145#define ON_1_OVER_SQRT2 0.7071067811865475244008445
146#define ON_SIN_PI_OVER_12 0.2588190451025207623488990
147#define ON_COS_PI_OVER_12 0.9659258262890682867497433
148
149#define ON_LOG2 0.6931471805599453094172321
150#define ON_LOG10 2.302585092994045684017991
151
152#define ON_ArrayCount(a) (sizeof(a)/sizeof((a)[0]))
153
154#if defined(DBL_MAX)
155#define ON_DBL_MAX DBL_MAX
156#else
157#define ON_DBL_MAX 1.7976931348623158e+308
158#endif
159
160#if defined(DBL_MIN)
161#define ON_DBL_MIN DBL_MIN
162#else
163#define ON_DBL_MIN 2.22507385850720200e-308
164#endif
165
166// ON_EPSILON = 2^-52
167#if defined(DBL_EPSILON)
168#define ON_EPSILON DBL_EPSILON
169#else
170#define ON_EPSILON 2.2204460492503131e-16
171#endif
172#define ON_SQRT_EPSILON 1.490116119385000000e-8
173
174#if defined(FLT_EPSILON)
175#define ON_FLOAT_EPSILON FLT_EPSILON
176#else
177#define ON_FLOAT_EPSILON 1.192092896e-07
178#endif
179#define ON_SQRT_FLOAT_EPSILON 3.452669830725202719e-4
180
181/*
182// In cases where lazy evaluation of a double value is
183// performed, b-rep tolerances being a notable example,
184// this value is used to indicate the value has not been
185// computed. This value must be < -1.0e308. and > -ON_DBL_MAX
186//
187// The reasons ON_UNSET_VALUE is a valid finite number are:
188//
189// 1) It needs to round trip through fprintf/sscanf.
190// 2) It needs to persist unchanged through assigment
191/ and not generate exceptions when assigned.
192// 3) ON_UNSET_VALUE == ON_UNSET_VALUE needs to be true.
193// 4) ON_UNSET_VALUE != ON_UNSET_VALUE needs to be false.
194//
195// Ideally, it would also have these SNaN attributes
196// * When used in a calculation, a floating point exception
197// occures.
198// * No possibility of a valid calculation would generate
199// ON_UNSET_VALUE.
200// * float f = (float)ON_UNSET_VALUE would create an invalid
201// float and generate an exception.
202*/
203#define ON_UNSET_VALUE -1.23432101234321e+308
204
205/*
206// ON_UNSET_FLOAT is used to indicate a texture coordinate
207// value cannot be calculated or is not well defined.
208// In hindsight, this value should have been ON_FLT_QNAN
209// because many calculation convert float texture coordinates
210// to doubles and the "unset"ness attribute is lost.
211*/
212#define ON_UNSET_FLOAT -1.234321e+38f
213
214
215ON_BEGIN_EXTERNC
216
217// IEEE 754 special values
218extern ON_EXTERN_DECL const double ON_DBL_QNAN;
219extern ON_EXTERN_DECL const double ON_DBL_PINF;
220extern ON_EXTERN_DECL const double ON_DBL_NINF;
221
222extern ON_EXTERN_DECL const float ON_FLT_QNAN;
223extern ON_EXTERN_DECL const float ON_FLT_PINF;
224extern ON_EXTERN_DECL const float ON_FLT_NINF;
225
226/*
227Description:
228Paramters:
229 x - [out] returned value of x is an SNan
230 (signalling not a number).
231Remarks:
232 Any time an SNaN passes through an Intel FPU, the result
233 is a QNaN (quiet nan) and the invalid operation excpetion
234 flag is set. If this exception is not masked, then the
235 exception handler is invoked.
236
237 double x, y;
238 ON_DBL_SNAN(&x);
239 y = x; // y = QNAN and invalid op exception occurs
240 z = sin(x) // z = QNAN and invalid op exception occurs
241
242 So, if you want to reliably initialize doubles to SNaNs,
243 you must use memcpy() or some other method that does not
244 use the Intel FPU.
245*/
246ON_DECL
247void ON_DBL_SNAN( double* x );
248
249ON_DECL
250void ON_FLT_SNAN( float* x );
251
252ON_END_EXTERNC
253
254/*
255// In cases where lazy evaluation of a color value is
256// performed, this value is used to indicate the value
257// has not been computed.
258*/
259#define ON_UNSET_COLOR 0xFFFFFFFF
260
261/*
262// In cases when an absolute "zero" tolerance
263// is required to compare model space coordinates,
264// ON_ZERO_TOLERANCE is used. The value of
265// ON_ZERO_TOLERANCE should be no smaller than
266// ON_EPSILON and should be several orders of
267// magnitude smaller than ON_SQRT_EPSILON
268//
269*/
270//#define ON_ZERO_TOLERANCE 1.0e-12
271// ON_ZERO_TOLERANCE = 2^-32
272#define ON_ZERO_TOLERANCE 2.3283064365386962890625e-10
273
274/*
275// In cases when an relative "zero" tolerance is
276// required for comparing model space coordinates,
277// (fabs(a)+fabs(b))*ON_RELATIVE_TOLERANCE is used.
278// ON_RELATIVE_TOLERANCE should be larger than
279// ON_EPSILON and smaller than no larger than
280// ON_ZERO_TOLERANCE*2^-10.
281//
282*/
283// ON_RELATIVE_TOLERANCE = 2^-42
284#define ON_RELATIVE_TOLERANCE 2.27373675443232059478759765625e-13
285
286/*
287// Bugs in geometry calculations involving world coordinates
288// values > ON_MAXIMUM_WORLD_COORDINATE_VALUE
289// will be a low priority.
290*/
291// ON_MAXIMUM_VALUE = 2^27
292#define ON_MAXIMUM_WORLD_COORDINATE_VALUE 1.34217728e8
293
294/*
295// The default test for deciding if a curvature value should be
296// treated as zero is
297// length(curvature) <= ON_ZERO_CURVATURE_TOLERANCE.
298// ON_ZERO_CURVATURE_TOLERANCE must be set so that
299// ON_ZERO_CURVATURE_TOLERANCE >= sqrt(3)*ON_ZERO_TOLERANCE
300// so that K.IsTiny() = true implies |K| <= ON_ZERO_CURVATURE_TOLERANCE
301*/
302#define ON_ZERO_CURVATURE_TOLERANCE 1.0e-8
303
304/* default value for angle tolerances = 1 degree */
305#define ON_DEFAULT_ANGLE_TOLERANCE (ON_PI/180.0)
306#define ON_DEFAULT_ANGLE_TOLERANCE_COSINE 0.99984769515639123915701155881391
307#define ON_MINIMUM_ANGLE_TOLERANCE (ON_DEFAULT_ANGLE_TOLERANCE/10.0)
308
309// pair of integer indices. This
310// is intentionally a struct/typedef
311// rather than a class so that it
312// can be used in other structs.
314{
315 int i;
316 int j;
317};
318
319typedef struct tagON_2dex ON_2dex;
320
321// triplet of integer indices. This
322// is intentionally a struct/typedef
323// rather than a class so that it
324// can be used in other structs.
326{
327 int i;
328 int j;
329 int k;
330};
331
332typedef struct tagON_3dex ON_3dex;
333
334
335// quadruplet of integer indices. This
336// is intentionally a struct/typedef
337// rather than a class so that it
338// can be used in other structs.
340{
341 int i;
342 int j;
343 int k;
344 int l;
345};
346
347typedef struct tagON_4dex ON_4dex;
348
349union ON_U
350{
351 char b[8]; // 8 bytes
352 ON__INT64 h; // 64 bit integer
353 ON__INT32 i; // 32 bit integer
354 int j[2]; // two 32 bit integers
355 void* p;
356 double d;
357};
358
359#if defined(ON_CPLUSPLUS)
360
361// OpenNurbs enums
362class PCL_EXPORTS ON_CLASS ON
363{
364public:
365 /*
366 Description:
367 Call before using openNURBS to ensure all class definitions
368 are linked.
369 */
370 static void Begin();
371
372
373 /*
374 Description:
375 Call when finished with openNURBS.
376 Remarks:
377 Currently does nothing.
378 */
379 static void End();
380
381 //////////
382 // Version of opennurbs (YYYYMMDDn)
383 static
384 int Version();
385
386 //////////
387 // McNeel subversion revsion used to build opennurbs
388 static
389 const char* SourceRevision();
390
391 static
392 const char* DocumentationRevision();
393
394 static
395 const char* SourceBranch();
396
397 static
398 const char* DocumentationBranch();
399
400
401 //// File open/close for DLL use ///////////////////////////////////////////////
402
403 static
404 FILE* OpenFile( // like fopen() - needed when OpenNURBS is used as a DLL
405 const char* filename,
406 const char* filemode
407 );
408
409 static
410 FILE* OpenFile( // like fopen() - needed when OpenNURBS is used as a DLL
411 const wchar_t* filename,
412 const wchar_t* filemode
413 );
414
415 static
416 int CloseFile( // like fclose() - needed when OpenNURBS is used as a DLL
417 FILE* // pointer returned by OpenFile()
418 );
419
420 static
421 int CloseAllFiles(); // like _fcloseall() - needed when OpenNURBS is used as a DLL
422
423 /*
424 Description:
425 Uses the flavor of fstat that is appropriate for the platform.
426 Parameters:
427 filename - [in]
428 fp - [in]
429 filesize - [out] (can be NULL if you do not want filesize)
430 create_time - [out] (can be NULL if you do not want last create time)
431 lastmodify_time - [out] (can be NULL if you do not want last modification time)
432 Returns:
433 True if file exists, can be opened for read, and fstat worked.
434 */
435 static
436 bool GetFileStats( const wchar_t* filename,
437 std::size_t* filesize,
438 time_t* create_time,
439 time_t* lastmodify_time
440 );
441
442 static
443 bool GetFileStats( FILE* fp,
444 std::size_t* filesize,
445 time_t* create_time,
446 time_t* lastmodify_time
447 );
448
449 /*
450 Returns true if pathname is a directory.
451 */
452 static bool IsDirectory( const wchar_t* pathname );
453 static bool IsDirectory( const char* utf8pathname );
454
455 /*
456 Returns
457 If the file is an opennurbs file, the version of the file
458 is returned (2,3,4,50,...).
459 If the file is not an opennurbs file, 0 is returned.
460 */
461 static int IsOpenNURBSFile( const wchar_t* pathname );
462 static int IsOpenNURBSFile( const char* utf8pathname );
463 static int IsOpenNURBSFile( FILE* fp );
464
465 //// Dimension Types ///////////////////////////////////////////////////////////
466 enum eAnnotationType
467 {
468 dtNothing,
469 dtDimLinear,
470 dtDimAligned,
471 dtDimAngular,
472 dtDimDiameter,
473 dtDimRadius,
474 dtLeader,
475 dtTextBlock,
476 dtDimOrdinate,
477 };
478
479 static eAnnotationType AnnotationType(int); // convert integer to eAnnotationType enum
480
481
482 //// Text Display Modes ///////////////////////////////////////////////////////////
483 enum eTextDisplayMode
484 {
485 dtNormal = 0,
486 dtHorizontal = 1,
487 dtAboveLine = 2,
488 dtInLine = 3,
489 };
490
491 static eTextDisplayMode TextDisplayMode( int);
492
493 // Defines the current working space.
494 enum active_space
495 {
496 no_space = 0,
497 model_space = 1, // 3d modeling or "world" space
498 page_space = 2 // page/layout/paper/printing space
499 };
500
501 static active_space ActiveSpace(int); // convert integer to active_space enum
502
503
504
505 //// unit_system ///////////////////////////////////////////////////////////////
506 enum unit_system
507 {
508 // The constant enum values are saved in 3dm files
509 // and must never be changed. The values > 11 were
510 // added 5 April 2006.
511 no_unit_system = 0,
512
513 // atomic distances
514 angstroms = 12, // 1.0e-10 meters
515
516 // SI units
517 nanometers = 13, // 1.0e-9 meters
518 microns = 1, // 1.0e-6 meters
519 millimeters = 2, // 1.0e-3 meters
520 centimeters = 3, // 1.0e-2 meters
521 decimeters = 14, // 1.0e-1 meters
522 meters = 4,
523 dekameters = 15, // 1.0e+1 meters
524 hectometers = 16, // 1.0e+2 meters
525 kilometers = 5, // 1.0e+3 meters
526 megameters = 17, // 1.0e+6 meters
527 gigameters = 18, // 1.0e+9 meters
528
529 // english distances
530 microinches = 6, // 2.54e-8 meters (1.0e-6 inches)
531 mils = 7, // 2.54e-5 meters (0.001 inches)
532 inches = 8, // 0.0254 meters
533 feet = 9, // 0.3408 meters (12 inches)
534 yards = 19, // 0.9144 meters (36 inches)
535 miles = 10, // 1609.344 meters (5280 feet)
536
537 // printer distances
538 printer_point = 20, // 1/72 inches (computer points)
539 printer_pica = 21, // 1/6 inches (computer picas)
540
541 // terrestrial distances
542 nautical_mile = 22, // 1852 meters
543 // Approximately 1 minute of arc on a terrestrial great circle.
544 // See http://en.wikipedia.org/wiki/Nautical_mile.
545
546 // astronomical distances
547 astronomical = 23, // 1.4959787e+11 // http://en.wikipedia.org/wiki/Astronomical_unit
548 // 1.495979e+11 // http://units.nist.gov/Pubs/SP811/appenB9.htm
549 // An astronomical unit (au) is the mean distance from the
550 // center of the earth to the center of the sun.
551 lightyears = 24, // 9.4607304725808e+15 // http://en.wikipedia.org/wiki/Light_year
552 // 9.46073e+15 meters // http://units.nist.gov/Pubs/SP811/appenB9.htm
553 // A light year is the distance light travels in one Julian year.
554 // The speed of light is exactly 299792458 meters/second.
555 // A Julian year is exactly 365.25 * 86400 seconds and is
556 // approximately the time it takes for one earth orbit.
557 parsecs = 25, // 3.08567758e+16 // http://en.wikipedia.org/wiki/Parsec
558 // 3.085678e+16 // http://units.nist.gov/Pubs/SP811/appenB9.htm
559
560 // Custom unit systems
561 custom_unit_system = 11 // x meters with x defined in ON_3dmUnitsAndTolerances.m_custom_unit_scale
562 };
563
564 static unit_system UnitSystem(int); // convert integer to unit_system enum
565
566 /*
567 Description:
568 Scale factor for changing unit "standard" systems.
569 Parameters:
570 us_from - [in]
571 us_to - [in]
572 For example:
573
574 100.0 = ON::UnitScale( ON::meters, ON::centimeters )
575 2.54 = ON::UnitScale( ON::inches, ON::centimeters )
576 12.0 = ON::UnitScale( ON::feet, ON::inches )
577
578 Remarks:
579 If you are using custom unit systems, use the version
580 that takes ON_UnitSystem or ON_3dmUnitsAndTolerances
581 parameters.
582 */
583 static double UnitScale(
584 ON::unit_system us_from,
585 ON::unit_system us_to
586 );
587 static double UnitScale(
588 const class ON_UnitSystem& us_from,
589 const class ON_UnitSystem& us_to
590 );
591 static double UnitScale(
592 ON::unit_system us_from,
593 const class ON_UnitSystem& us_to
594 );
595 static double UnitScale(
596 const class ON_UnitSystem& us_from,
597 ON::unit_system us_to
598 );
599 static double UnitScale(
600 const class ON_3dmUnitsAndTolerances& us_from,
601 const class ON_3dmUnitsAndTolerances& us_to
602 );
603
604
605 /*
606 Description:
607 Returns the string " : ". This is the string Rhino uses
608 to separate reference model names from the root name for
609 things like layer, block definition, material, linetype,
610 dimstyle and font names.
611 See Also:
612 ON::NameReferenceDelimiterLength()
613 ON::IsNameReferenceDelimiter()
614 */
615 static const wchar_t* NameReferenceDelimiter();
616
617 /*
618 Description:
619 Returns the number of characters in the string returned
620 by ON::NameReferenceDelimiter().
621 See Also:
622 ON::NameReferenceDelimiterLength()
623 ON::IsNameReferenceDelimiter()
624 */
625 static unsigned int NameReferenceDelimiterLength();
626
627 /*
628 Description:
629 Test a string to see if its beginning matches the
630 string returned by ON::NameReferenceDelimiter().
631 Parameters:
632 s - [in];
633 string to test.
634 Returns:
635 null:
636 The beginning of the string does not match ON::NameReferenceDelimiter().
637 non-null:
638 The beginning of the string matches ON::NameReferenceDelimiter(). The
639 returned pointer is the first character in s after the last character
640 of the delimiter. Put another way, if the beginning of s matches
641 the string ON::NameReferenceDelimiter(), then the returned pointer is
642 s + ON::NameReferenceDelimiterLength().
643 See Also:
644 ON::NameReferenceDelimiter()
645 ON::NameReferenceDelimiterLength()
646 */
647 static const wchar_t* IsNameReferenceDelimiter(const wchar_t* s);
648
649 //// distance_display_mode ///////////////////////////////////
650 enum distance_display_mode
651 {
652 decimal = 0,
653 fractional = 1,
654 feet_inches = 2
655 };
656
657 static distance_display_mode DistanceDisplayMode(int); // convert integer to distance_display_mode enum
658
659
660 //// point_style ///////////////////////////////////////////////////////////////
661 enum point_style
662 {
663 unknown_point_style = 0,
664 not_rational = 1,
665 homogeneous_rational = 2,
666 euclidean_rational = 3,
667 intrinsic_point_style = 4, // point format used in definition
668 point_style_count = 5
669 };
670
671 static point_style PointStyle(int); // convert integer to point_style enum
672
673 //// knot_style ///////////////////////////////////////////////////////////////
674 enum knot_style // if a knot vector meets the conditions of two styles,
675 { // then the style with the lowest value is used
676 unknown_knot_style = 0, // unknown knot style
677 uniform_knots = 1, // uniform knots (ends not clamped)
678 quasi_uniform_knots = 2, // uniform knots (clamped ends, degree >= 2)
679 piecewise_bezier_knots = 3, // all internal knots have full multiplicity
680 clamped_end_knots = 4, // clamped end knots (with at least 1 interior non-uniform knot)
681 non_uniform_knots = 5, // known to be none of the above
682 knot_style_count = 6
683 };
684
685 static knot_style KnotStyle(int); // convert integer to knot_style enum
686
687 //// continuity ////////////////////////////////////////////////////////////////
688 enum continuity
689 {
690 unknown_continuity = 0,
691
692 // These test for parametric continuity. In particular,
693 // all types of ON_Curves are considered infinitely
694 // continuous at the start/end of the evaluation domain.
695 C0_continuous = 1, // continuous function
696 C1_continuous = 2, // continuous first derivative
697 C2_continuous = 3, // continuous first and second derivative
698 G1_continuous = 4, // continuous unit tangent
699 G2_continuous = 5, // continuous unit tangent and curvature
700
701 // 20 March 2003 Dale Lear added these.
702 //
703 // Continuity tests using the following enum values
704 // are identical to tests using the preceding enum values
705 // on the INTERIOR of a curve's domain. At the END of
706 // a curve a "locus" test is performed in place of a
707 // parametric test. In particular, at the END of a domain,
708 // all open curves are locus discontinuous. At the END of
709 // a domain, all closed curves are at least C0_locus_continuous.
710 // By convention all ON_Curves are considered
711 // locus continuous at the START of the evaluation domain.
712 // This convention is not strictly correct, but is was
713 // adopted to make iterative kink finding tools easier to
714 // use and so that locus discontinuities are reported once
715 // at the end parameter of a curve rather than twice.
716 C0_locus_continuous = 6, // locus continuous function
717 C1_locus_continuous = 7, // locus continuous first derivative
718 C2_locus_continuous = 8, // locus continuous first and second derivative
719 G1_locus_continuous = 9, // locus continuous unit tangent
720 G2_locus_continuous = 10, // locus continuous unit tangent and curvature
721
722 Cinfinity_continuous = 11, // analytic discontinuity
723 Gsmooth_continuous = 12 // aesthetic discontinuity
724 };
725
726 /*
727 Description:
728 Convert int to ON::continuity enum value
729 */
730 static continuity Continuity(int);
731
732 /*
733 Description:
734 Convert int to ON::continuity enum value and
735 convert the locus flavored values to the parametric
736 flavored values.
737 */
738 static continuity ParametricContinuity(int);
739
740 /*
741 Description:
742 Convert int to ON::continuity enum value and
743 convert the higher order flavored values to
744 the corresponding C1 or G1 values needed to
745 test piecewise linear curves.
746 */
747 static continuity PolylineContinuity(int);
748
749 //// curve_style ///////////////////////////////////////////////////////////////
750 enum curve_style
751 {
752 unknown_curve_style = 0,
753 line = 1,
754 circle = 2,
755 ellipse = 3, // with distinct foci (not a circle)
756 parabola = 4,
757 hyperbola = 5,
758 planar_polyline = 6, // not a line segment
759 polyline = 7, // non-planar polyline
760 planar_freeform_curve = 8, // planar but none of the above
761 freeform_curve = 9, // known to be none of the above
762 curve_style_count = 10
763 };
764
765 static curve_style CurveStyle(int); // convert integer to curve_style enum
766
767 //// surface_style ///////////////////////////////////////////////////////////////
768 enum surface_style
769 {
770 unknown_surface_style = 0,
771 plane = 1,
772 circular_cylinder = 2, // portion of right circular cylinder
773 elliptical_cylinder = 3, // portion of right elliptical cylinder
774 circular_cone = 4, // portion of right circular cone
775 elliptical_cone = 5, // portion of right elliptical cone
776 sphere = 6, // portion of sphere
777 torus = 7, // portion of torus
778 surface_of_revolution = 8, // portion of surface of revolution that is none of the above
779 ruled_surface = 9, // portion of a ruled surface this is none of the above
780 freeform_surface = 10, // known to be none of the above
781 surface_style_count = 11
782 };
783
784 static surface_style SurfaceStyle(int); // convert integer to surface_style enum
785
786 //// sort_algorithm ///////////////////////////////////////////////////////////////
787 enum sort_algorithm
788 {
789 heap_sort = 0,
790 quick_sort = 1
791 };
792
793 static sort_algorithm SortAlgorithm(int); // convert integer to sort_method enum
794
795 //// endian-ness ///////////////////////////////////////////////////////////////
796 enum endian {
797 little_endian = 0, // least significant byte first or reverse byte order - Intel x86, ...
798 big_endian = 1 // most significant byte first - Motorola, Sparc, MIPS, ...
799 };
800
801 static endian Endian(int); // convert integer to endian enum
802 static endian Endian(); // returns endian-ness of current CPU
803
804 //// archive modes //////////////////////////////////////////////////////////////
805 enum archive_mode
806 {
807 unknown_archive_mode = 0,
808 read = 1, // all read modes have bit 0x0001 set
809 write = 2, // all write modes have bit 0x0002 set
810 readwrite = 3,
811 read3dm = 5,
812 write3dm = 6
813 };
814 static archive_mode ArchiveMode(int); // convert integer to endian enum
815
816
817 //// view projections ///////////////////////////////////////////////////////////
818
819 // The x/y/z_2pt_perspective_view projections are ordinary perspective
820 // projection. Using these values insures the ON_Viewport member
821 // fuctions properly constrain the camera up and camera direction vectors
822 // to preserve the specified perspective vantage.
823 enum view_projection
824 {
825 unknown_view = 0,
826 parallel_view = 1,
827 perspective_view = 2
828 };
829
830 /*
831 Description:
832 Converts integer into ON::view_projection enum value.
833 Parameters:
834 i - [in]
835 Returns:
836 ON::view_projection enum with same value as i.
837 If i is not an ON::view_projection enum value,
838 then ON::unknow_view is returned.
839 */
840 static view_projection ViewProjection(int i);
841
842 /*
843 Parameters:
844 projection - [in]
845 Returns:
846 True if projection is ON::perspective_view.
847 */
848 static bool IsPerspectiveProjection( ON::view_projection projection );
849
850
851 /*
852 Parameters:
853 projection - [in]
854 Returns:
855 True if projection is ON::parallel_view.
856 */
857 static bool IsParallelProjection( ON::view_projection projection );
858
859 //// view coordinates ///////////////////////////////////////////////////////////
860
861 enum coordinate_system
862 {
863 world_cs = 0,
864 camera_cs = 1,
865 clip_cs = 2,
866 screen_cs = 3
867 };
868
869 static coordinate_system CoordinateSystem(int); // convert integer to coordinate_system enum
870
871 //// exception types ///////////////////////////////////////////////////////////
872 enum exception_type
873 {
874 unknown_exception = 0,
875 out_of_memory,
876 corrupt_object, // invalid object encountered - continuing would crash or
877 // result in corrupt object being saved in archive.
878 unable_to_write_archive, // write operation failed - out of file space/read only mode/...?
879 unable_to_read_archive, // read operation failed - truncated archive/locked file/... ?
880 unable_to_seek_archive, // seek operation failed - locked file/size out of bounds/... ?
881 unexpected_end_of_archive, // truncated archive
882 unexpected_value_in_archive // corrupt archive?
883 };
884 static exception_type ExceptionType(int); // convert integer to exception_type enum
885
886 //// layer mode ///////////////////////////////////////////////////////////
887 // OBSOLETE
888 enum layer_mode
889 {
890 normal_layer = 0, // visible, objects on layer can be selected and changed
891 hidden_layer = 1, // not visible, objects on layer cannot be selected or changed
892 locked_layer = 2, // visible, objects on layer cannot be selected or changed
893 layer_mode_count = 3
894 };
895 static layer_mode LayerMode(int); // convert integer to layer_mode enum
896
897 //// object mode ///////////////////////////////////////////////////////////
898 enum object_mode
899 {
900 normal_object = 0, // object mode comes from layer
901 hidden_object = 1, // not visible, object cannot be selected or changed
902 locked_object = 2, // visible, object cannot be selected or changed
903 idef_object = 3, // object is part of an ON_InstanceDefinition. The
904 // ON_InstanceDefinition m_object_uuid[] array will
905 // contain this object attribute's uuid.
906 object_mode_count = 4
907 };
908 static object_mode ObjectMode(int); // convert integer to object_mode enum
909
910 //// object display color /////////////////////////////////////////////////////////
911 enum object_color_source
912 {
913 color_from_layer = 0, // use color assigned to layer
914 color_from_object = 1, // use color assigned to object
915 color_from_material = 2, // use diffuse render material color
916 color_from_parent = 3 // for objects with parents (like objects in instance references, use parent linetype)
917 // if no parent, treat as color_from_layer
918 };
919 static object_color_source ObjectColorSource(int); // convert integer to object_color_source enum
920
921 //// object plot color /////////////////////////////////////////////////////////
922 enum plot_color_source
923 {
924 plot_color_from_layer = 0, // use plot color assigned to layer
925 plot_color_from_object = 1, // use plot color assigned to object
926 plot_color_from_display = 2, // use display color
927 plot_color_from_parent = 3 // for objects with parents (like objects in instance references, use parent plot color)
928 // if no parent, treat as plot_color_from_layer
929 };
930 static plot_color_source PlotColorSource(int); // convert integer to plot_color_source enum
931
932 //// object plot weight /////////////////////////////////////////////////////////
933 enum plot_weight_source
934 {
935 plot_weight_from_layer = 0, // use plot color assigned to layer
936 plot_weight_from_object = 1, // use plot color assigned to object
937 plot_weight_from_parent = 3 // for objects with parents (like objects in instance references, use parent plot color)
938 // if no parent, treat as plot_color_from_layer
939 };
940 static plot_weight_source PlotWeightSource(int); // convert integer to plot_color_source enum
941
942 //// object linetype /////////////////////////////////////////////////////////
943 enum object_linetype_source
944 {
945 linetype_from_layer = 0, // use line style assigned to layer
946 linetype_from_object = 1, // use line style assigned to object
947 linetype_from_parent = 3 // for objects with parents (like objects in instance references, use parent linetype)
948 // if not parent, treat as linetype_from_layer.
949 };
950 static object_linetype_source ObjectLinetypeSource(int); // convert integer to object_linetype_source enum
951
952 //// object material /////////////////////////////////////////////////////////
953 enum object_material_source
954 {
955 material_from_layer = 0, // use material assigned to layer
956 material_from_object = 1, // use material assigned to object
957 material_from_parent = 3 // for objects with parents, like
958 // definition geometry in instance
959 // references and faces in polysurfaces,
960 // this value indicates the material
961 // definition should come from the parent.
962 // If the object does not have an
963 // obvious "parent", then treat
964 // it the same as material_from_layer.
965 };
966 static object_material_source ObjectMaterialSource(int); // convert integer to object_color_source enum
967
968 //// light style /////////////////////////////////////////////////////////////
969 enum light_style
970 {
971 unknown_light_style = 0,
972 //view_directional_light = 1, // light location and direction in clip coordinates
973 //view_point_light = 2,
974 //view_spot_light = 3,
975 camera_directional_light = 4, // light location and direction in camera coordinates
976 camera_point_light = 5, // +x points to right, +y points up, +z points towards camera
977 camera_spot_light = 6,
978 world_directional_light = 7, // light location and direction in world coordinates
979 world_point_light = 8,
980 world_spot_light = 9,
981 ambient_light = 10, // pure ambient light
982 world_linear_light = 11,
983 world_rectangular_light = 12,
984 light_style_count = 13
985 };
986 static light_style LightStyle(int); // convert integer to light_style enum
987
988 //// curvature style /////////////////////////////////////////////////////////
989 enum curvature_style
990 {
991 unknown_curvature_style = 0,
992 gaussian_curvature = 1,
993 mean_curvature = 2, // unsigned mean curvature
994 min_curvature = 3, // minimum unsigned radius of curvature
995 max_curvature = 4, // maximum unsigned radius of curvature
996 curvature_style_count = 5
997 };
998 static curvature_style CurvatureStyle(int); // convert integer to curvature_style enum
999
1000 //// view display mode /////////////////////////////////////////////////////////////
1001 enum display_mode
1002 {
1003 default_display = 0, // default display
1004 wireframe_display = 1, // wireframe display
1005 shaded_display = 2, // shaded display
1006 renderpreview_display = 3 // render preview display
1007 };
1008 static display_mode DisplayMode(int); // convert integer to display_mode enum
1009
1010
1011 enum view_type
1012 {
1013 model_view_type = 0, // standard model space 3d view
1014 page_view_type = 1, // a.k.a "paper space", "plot view", etc.
1015 // A page view must be orthographic,
1016 // the camera frame x,y,z direction must be
1017 // world x,y,z (which means the camera direction
1018 // is always (0,0,-1)).
1019 nested_view_type = 2, // This view is a "model" view that is nested
1020 // in another view. The nesting and parent
1021 // information is saved in ON_3dmView.
1022 };
1023 static view_type ViewType(int); // convert integer to display_mode enum
1024
1025
1026 //// texture mapping mode ///////////////////////////////////////////////////
1027 //
1028 // OBSOLETE
1029 enum texture_mode
1030 {
1031 no_texture = 0, // texture disabled
1032 modulate_texture = 1, // modulate with material diffuse color
1033 decal_texture = 2 // decal
1034 };
1035 // OBSOLETE
1036 static texture_mode TextureMode(int); // convert integer to texture_mode enum
1037 // OBSOLETE
1038 //
1039 /////////////////////////////////////////////////////////////////////////////
1040
1041 //// object_type ///////////////////////////////////////////////////
1042 enum object_type
1043 {
1044 // Use with ON_Object::ObjectType() in situations where
1045 // using a switch() is better than a long string of if else if ...
1046 // if ( ON_Curve::Cast() ) ... else if ( ON_Surface::Cast() ) ...
1047 // ...
1048 unknown_object_type = 0,
1049
1050 point_object = 1, // some type of ON_Point
1051 pointset_object = 2, // some type of ON_PointCloud, ON_PointGrid, ...
1052 curve_object = 4, // some type of ON_Curve like ON_LineCurve, ON_NurbsCurve, etc.
1053 surface_object = 8, // some type of ON_Surface like ON_PlaneSurface, ON_NurbsSurface, etc.
1054 brep_object = 0x10, // some type of ON_Brep
1055 mesh_object = 0x20, // some type of ON_Mesh
1056 layer_object = 0x40, // some type of ON_Layer
1057 material_object = 0x80, // some type of ON_Material
1058 light_object = 0x100, // some type of ON_Light
1059 annotation_object = 0x200, // some type of ON_Annotation
1060 userdata_object = 0x400, // some type of ON_UserData
1061 instance_definition = 0x800, // some type of ON_InstanceDefinition
1062 instance_reference = 0x1000, // some type of ON_InstanceRef
1063 text_dot = 0x2000, // some type of ON_TextDot
1064 grip_object = 0x4000, // selection filter value - not a real object type
1065 detail_object = 0x8000, // some type of ON_DetailView
1066 hatch_object = 0x10000, // some type of ON_Hatch
1067 morph_control_object = 0x20000, // some type of ON_MorphControl
1068 loop_object = 0x80000, // some type of ON_BrepLoop
1069 polysrf_filter = 0x200000, // selection filter value - not a real object type
1070 edge_filter = 0x400000, // selection filter value - not a real object type
1071 polyedge_filter = 0x800000, // selection filter value - not a real object type
1072 meshvertex_object = 0x01000000, // some type of ON_MeshVertexRef
1073 meshedge_object = 0x02000000, // some type of ON_MeshEdgeRef
1074 meshface_object = 0x04000000, // some type of ON_MeshFaceRef
1075 cage_object = 0x08000000, // some type of ON_NurbsCage
1076 phantom_object = 0x10000000,
1077 clipplane_object = 0x20000000,
1078 beam_object = 0x40000000, // obsolete - use extrusion_object
1079 extrusion_object = 0x40000000, // some type of ON_Extrusion
1080
1081 any_object = 0xFFFFFFFF
1082
1083 // Please discuss any changes with Dale Lear
1084 };
1085
1086 static object_type ObjectType(int); // convert integer to object_type enum
1087
1088 //// bitmap_type ///////////////////////////////////////////////////
1089 enum bitmap_type
1090 {
1091 unknown_bitmap_type = 0,
1092 windows_bitmap = 1, // BITMAPINFO style
1093 opengl_bitmap = 2, // unpacked OpenGL RGB or RGBA
1094 png_bitmap = 3
1095 };
1096 static bitmap_type BitmapType(int); // convert integer to bitmap_type enum
1097
1098 enum object_decoration
1099 {
1100 no_object_decoration = 0,
1101 start_arrowhead = 0x08, // arrow head at start
1102 end_arrowhead = 0x10, // arrow head at end
1103 both_arrowhead = 0x18 // arrow heads at start and end
1104 };
1105 static object_decoration ObjectDecoration(int); // convert integer to line_pattern enum
1106
1107 enum mesh_type
1108 {
1109 default_mesh = 0,
1110 render_mesh = 1,
1111 analysis_mesh = 2,
1112 preview_mesh = 3,
1113 any_mesh = 4
1114 };
1115 static mesh_type MeshType(int); // convert integer to mesh_type enum
1116
1117
1118 // Types of object snapping.
1119 // In situations where more than one type of snap applies,
1120 // snaps with higher value take precedence.
1121 // enum values must be a power of 2.
1122 // ON_ObjRef saves these values in files. Do not change
1123 // the values. The reason for the gaps between the enum
1124 // values is to leave room for future snaps with prededence
1125 // falling between existing snaps
1126 enum osnap_mode
1127 {
1128 os_none = 0,
1129 os_near = 2,
1130 os_focus = 8,
1131 os_center = 0x20,
1132 os_vertex = 0x40,
1133 os_knot = 0x80,
1134 os_quadrant = 0x200,
1135 os_midpoint = 0x800,
1136 os_intersection = 0x2000,
1137 os_end = 0x20000,
1138 os_perpendicular = 0x80000,
1139 os_tangent = 0x200000,
1140 os_point = 0x08000000,
1141 os_all_snaps = 0xFFFFFFFF
1142 };
1143 static osnap_mode OSnapMode(int); // convert integer to osnap_mode enum
1144
1145
1146 //// Types of Curves ///////////////////////////////////////////////////////////
1147 enum eCurveType
1148 {
1149 ctCurve, // nothing
1150 ctArc,
1151 ctCircle,
1152 ctLine,
1153 ctNurbs,
1154 ctOnsurface,
1155 ctProxy,
1156 ctPolycurve,
1157 ctPolyline,
1158 };
1159
1160
1161 //// surface_loft_end_condition //////////////////////////////////////////////
1162 //
1163 // End condition paramter values for ON_Curve::CreateCubicLoft() and
1164 // ON_Surface::CreateCubicLoft().
1165 enum cubic_loft_end_condition
1166 {
1167 cubic_loft_ec_quadratic = 0,
1168 cubic_loft_ec_linear = 1,
1169 cubic_loft_ec_cubic = 2,
1170 cubic_loft_ec_natural = 3,
1171 cubic_loft_ec_unit_tangent = 4,
1172 cubic_loft_ec_1st_derivative = 5,
1173 cubic_loft_ec_2nd_derivative = 6,
1174 cubic_loft_ec_free_cv = 7
1175 };
1176
1177 /*
1178 Description:
1179 Convert an integer to cubic_loft_end_condition enum.
1180 Parameters:
1181 i - [in]
1182 Returns:
1183 corresponding cubic_loft_end_condition enum value.
1184 Remarks:
1185 If i does not correspond to a cubic_loft_end_condition
1186 enum value, then cubic_loft_ec_quadratic is returned.
1187 */
1188 static
1189 cubic_loft_end_condition CubicLoftEndCondition(int i);
1190
1191private:
1192 // prohibit instantiaion
1193 //ON(); // no implementation
1194 //ON( const ON& ); // no implementation
1195 //~ON(); // no implementation
1196};
1197
1198
1199/*
1200Description:
1201 Component indices are used to provide a persistent way
1202 to identify portions of complex objects.
1203
1204*/
1205class ON_CLASS ON_COMPONENT_INDEX
1206{
1207public:
1208
1209 // Do not change these values; they are stored in 3dm archives
1210 // and provide a persistent way to indentify components of
1211 // complex objects.
1212 enum TYPE
1213 {
1214 invalid_type = 0,
1215
1216 brep_vertex = 1,
1217 brep_edge = 2,
1218 brep_face = 3,
1219 brep_trim = 4,
1220 brep_loop = 5,
1221
1222 mesh_vertex = 11,
1223 meshtop_vertex = 12,
1224 meshtop_edge = 13,
1225 mesh_face = 14,
1226
1227 idef_part = 21,
1228
1229 polycurve_segment = 31,
1230
1231 pointcloud_point = 41,
1232
1233 group_member = 51,
1234
1235
1236 extrusion_bottom_profile = 61, // 3d bottom profile curves
1237 // index identifies profile component
1238 extrusion_top_profile = 62, // 3d top profile curves
1239 // index identifies profile component
1240 extrusion_wall_edge = 63, // 3d wall edge curve
1241 // index/2: identifies profile component
1242 // index%2: 0 = start, 1 = end
1243 extrusion_wall_surface = 64, // side wall surfaces
1244 // index: identifies profile component
1245 extrusion_cap_surface = 65, // bottom and top cap surfaces
1246 // index: 0 = bottom, 1 = top
1247 extrusion_path = 66, // extrusion path (axis line)
1248 // index -1 = entire path, 0 = start point, 1 = endpoint
1249
1250 dim_linear_point = 100,
1251 dim_radial_point = 101,
1252 dim_angular_point = 102,
1253 dim_ordinate_point = 103,
1254 dim_text_point = 104,
1255
1256 no_type = 0xFFFFFFFF
1257 };
1258
1259 /*
1260 Description:
1261 Safe conversion of integer value to TYPE enum.
1262 Parameters:
1263 i - [in] integer with value equal to one of the TYPE enums.
1264 Returns:
1265 The TYPE enum with the same numeric value
1266 or ON_COMPONENT_INDEX::invalid_type if no corresponding enum
1267 exists.
1268 */
1269 static
1270 TYPE Type(int i);
1271
1272 /*
1273 Description:
1274 Dictionary compare on m_type, m_index as ints.
1275 Returns:
1276 < 0: a < b
1277 = 0: a = b
1278 > 0: a > b
1279 */
1280 static
1281 int Compare( const ON_COMPONENT_INDEX* a, const ON_COMPONENT_INDEX* b);
1282
1283 /*
1284 Description:
1285 Sets m_type = invalid_type and m_index = -1.
1286 */
1287 ON_COMPONENT_INDEX();
1288
1289 /*
1290 Description:
1291 Sets m_type = type and m_index = index.
1292 */
1293 ON_COMPONENT_INDEX(TYPE type,int index);
1294
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;
1299 bool operator>(const ON_COMPONENT_INDEX& other) const;
1300 bool operator>=(const ON_COMPONENT_INDEX& other) const;
1301
1302 void Set(TYPE type,int index);
1303
1304 /*
1305 Description:
1306 Sets m_type = invalid_type and m_index = -1.
1307 */
1308 void UnSet();
1309
1310 /*
1311 Returns:
1312 True if m_type is set to a TYPE enum value between
1313 brep_vertex and polycurve_segment.
1314 */
1315 bool IsSet() const;
1316
1317 /*
1318 Returns:
1319 True if m_type is set to one of the mesh or meshtop
1320 TYPE enum values and m_index >= 0.
1321 */
1322 bool IsMeshComponentIndex() const;
1323
1324 /*
1325 Returns:
1326 True if m_type is set to one of the
1327 brep TYPE enum values and m_index >= 0.
1328 */
1329 bool IsBrepComponentIndex() const;
1330
1331 /*
1332 Returns:
1333 True if m_type = idef_part and m_index >= 0.
1334 */
1335 bool IsIDefComponentIndex() const;
1336
1337 /*
1338 Returns:
1339 True if m_type = polycurve_segment and m_index >= 0.
1340 */
1341 bool IsPolyCurveComponentIndex() const;
1342
1343 /*
1344 Returns:
1345 True if m_type = group_member and m_index >= 0.
1346 */
1347 bool IsGroupMemberComponentIndex() const;
1348
1349 /*
1350 Returns:
1351 True if m_type = extrusion_bottom_profile or extrusion_top_profile
1352 and m_index >= 0.
1353 */
1354 bool IsExtrusionProfileComponentIndex() const;
1355
1356 /*
1357 Returns:
1358 True if m_type = extrusion_path and -1 <= m_index <= 1.
1359 */
1360 bool IsExtrusionPathComponentIndex() const;
1361
1362 /*
1363 Returns:
1364 True if m_type = extrusion_wall_edge and m_index >= 0.
1365 */
1366 bool IsExtrusionWallEdgeComponentIndex() const;
1367
1368 /*
1369 Returns:
1370 True if m_type = extrusion_wall_surface and m_index >= 0.
1371 */
1372 bool IsExtrusionWallSurfaceComponentIndex() const;
1373
1374 /*
1375 Returns:
1376 True if m_type = extrusion_wall_surface or extrusion_wall_edge
1377 and m_index >= 0.
1378 */
1379 bool IsExtrusionWallComponentIndex() const;
1380
1381 /*
1382 Returns:
1383 True if m_type = extrusion_bottom_profile, extrusion_top_profile,
1384 extrusion_wall_edge, extrusion_wall_surface, extrusion_cap_surface
1385 or extrusion_path and m_index is reasonable.
1386 */
1387 bool IsExtrusionComponentIndex() const;
1388
1389 /*
1390 Returns:
1391 True if m_type = pointcloud_point and m_index >= 0.
1392 */
1393 bool IsPointCloudComponentIndex() const;
1394
1395 /*
1396 Returns:
1397 True if m_type = dim_... and m_index >= 0.
1398 */
1399 bool IsAnnotationComponentIndex() const;
1400
1401 TYPE m_type;
1402
1403 /*
1404 The interpretation of m_index depends on the m_type value.
1405
1406 m_type m_index interpretation (0 based indices)
1407
1408 no_type used when context makes it clear what array is being index
1409 brep_vertex ON_Brep.m_V[] array index
1410 brep_edge ON_Brep.m_E[] array index
1411 brep_face ON_Brep.m_F[] array index
1412 brep_trim ON_Brep.m_T[] array index
1413 brep_loop ON_Brep.m_L[] array index
1414 mesh_vertex ON_Mesh.m_V[] array index
1415 meshtop_vertex ON_MeshTopology.m_topv[] array index
1416 meshtop_edge ON_MeshTopology.m_tope[] array index
1417 mesh_face ON_Mesh.m_F[] array index
1418 idef_part ON_InstanceDefinition.m_object_uuid[] array index
1419 polycurve_segment ON_PolyCurve::m_segment[] array index
1420
1421 extrusion_bottom_profile Use ON_Extrusion::Profile3d() to get 3d profile curve
1422 extrusion_top_profile Use ON_Extrusion::Profile3d() to get 3d profile curve
1423 extrusion_wall_edge Use ON_Extrusion::WallEdge() to get 3d line curve
1424 extrusion_wall_surface Use ON_Extrusion::WallSurface() to get 3d wall surface
1425 extrusion_cap_surface 0 = bottom cap, 1 = top cap
1426 extrusion_path -1 = entire path, 0 = start of path, 1 = end of path
1427
1428 dim_linear_point ON_LinearDimension2::POINT_INDEX
1429 dim_radial_point ON_RadialDimension2::POINT_INDEX
1430 dim_angular_point ON_AngularDimension2::POINT_INDEX
1431 dim_ordinate_point ON_OrdinateDimension2::POINT_INDEX
1432 dim_text_point ON_TextEntity2 origin point
1433 */
1434 int m_index;
1435};
1436
1437#endif
1438
1439ON_BEGIN_EXTERNC
1440
1441/*
1442Description:
1443 Sets Windows code page used to convert UNICODE (wchar_t) strings
1444 to multibyte (char) strings and vice verse.
1445Parameters:
1446 code_page - [in] code page to use when converting UNICODE strings
1447 to multibyte strings and vice verse.
1448Returns:
1449 previous value of Windows code page.
1450Remarks:
1451 For Windows NT/2000/XP, CP_THREAD_ACP will work for all
1452 locales if your app's thread is correctly configured.
1453 For Windows 95/98/ME you have to choose the locale.
1454
1455 Conversions between UNICODE and multibyte strings happens when
1456 ON_wString converts a char* string to a wchar_t* string and
1457 when and ON_String converts a wchar_t* string to a char* string.
1458
1459 All pertinant code is in opennurbs_defines.cpp.
1460
1461See Also:
1462 ON_GetStringConversionWindowsCodePage
1463 on_WideCharToMultiByte
1464 on_MultiByteToWideChar
1465 ON_wString::operator=(const char*)
1466 ON_String::operator=(const wchar_t*)
1467*/
1468ON_DECL
1469unsigned int ON_SetStringConversionWindowsCodePage(
1470 unsigned int code_page
1471 );
1472
1473/*
1474Description:
1475 Gets Windows code page used to convert UNICODE (wchar_t) strings
1476 to multibyte (char) strings and vice verse.
1477Returns:
1478 Value of Windows code page used to convert strings.
1479Remarks:
1480 For Windows NT/2000/XP, CP_THREAD_ACP will work for all
1481 locales if your app's thread is correctly configured.
1482 For Windows 95/98/ME you have to choose the locale.
1483
1484 Conversions between UNICODE and multibyte strings happens when
1485 ON_wString converts a char* string to a wchar_t* string and
1486 when and ON_String converts a wchar_t* string to a char* string.
1487
1488 All pertinant code is in opennurbs_defines.cpp.
1489
1490See Also:
1491 ON_GetStringConversionWindowsCodePage
1492 on_WideCharToMultiByte
1493 on_MultiByteToWideChar
1494 ON_wString::operator=(const char*)
1495 ON_String::operator=(const wchar_t*)
1496*/
1497ON_DECL
1498unsigned int ON_GetStringConversionWindowsCodePage();
1499
1500
1501/*
1502Description:
1503 Sets Windows locale id used in case insensitive string
1504 compares.
1505Parameters:
1506 locale_id - [in] Windows locale id to use in case insensitive
1507 string compares.
1508 bWin9X - [in] True if OS is Windows 95/98/ME (which has
1509 poor UNICODE support).
1510Returns:
1511 Previous value of Windows locale id.
1512Remarks:
1513 All pertinant code is in opennurbs_defines.cpp.
1514See Also:
1515 ON_GetStringConversionWindowsLocaleID
1516 on_wcsicmp
1517*/
1518ON_DECL
1519unsigned int ON_SetStringConversionWindowsLocaleID(
1520 unsigned int locale_id,
1521 ON_BOOL32 bWin9X
1522 );
1523
1524/*
1525Description:
1526 Gets Windows locale id used in case insensitive string
1527 compares.
1528Returns:
1529 Value of Windows locale id used in case insensitive string
1530 compares.
1531Remarks:
1532 All pertinant code is in opennurbs_defines.cpp.
1533See Also:
1534 ON_SetStringConversionWindowsLocaleID
1535 on_wcsicmp
1536*/
1537ON_DECL
1538unsigned int ON_GetStringConversionWindowsLocaleID();
1539
1540// on_wcsicmp() is a wrapper for case insensitive wide string compare
1541// and calls one of _wcsicmp() or wcscasecmp() depending on OS.
1542ON_DECL
1543int on_wcsicmp( const wchar_t*, const wchar_t* );
1544
1545// on_wcsupr() calls _wcsupr() or wcsupr() depending on OS
1546ON_DECL
1547wchar_t* on_wcsupr(wchar_t*);
1548
1549// on_wcslwr() calls _wcslwr() or wcslwr() depending on OS
1550ON_DECL
1551wchar_t* on_wcslwr(wchar_t*);
1552
1553// on_wcsrev() calls _wcsrev() or wcsrev() depending on OS
1554ON_DECL
1555wchar_t* on_wcsrev(wchar_t*);
1556
1557// on_stricmp() is a wrapper for case insensitive string compare
1558// and calls one of _stricmp(), stricmp(), or strcasecmp()
1559// depending on OS.
1560ON_DECL
1561int on_stricmp(const char*, const char*);
1562
1563// on_stricmp() is a wrapper for case insensitive string compare
1564// and calls one of _strnicmp() or strncasecmp()
1565// depending on OS.
1566ON_DECL
1567int on_strnicmp(const char * s1, const char * s2, int n);
1568
1569// on_strupr() calls _strupr() or strupr() depending on OS
1570ON_DECL
1571char* on_strupr(char*);
1572
1573// on_strlwr() calls _strlwr() or strlwr() depending on OS
1574ON_DECL
1575char* on_strlwr(char*);
1576
1577// on_strrev() calls _strrev() or strrev() depending on OS
1578ON_DECL
1579char* on_strrev(char*);
1580
1581/*
1582Description:
1583 Calls ON_ConvertWideCharToUTF8()
1584*/
1585ON_DECL
1586int on_WideCharToMultiByte(
1587 const wchar_t*, // lpWideCharStr,
1588 int, // cchWideChar,
1589 char*, // lpMultiByteStr,
1590 int // cchMultiByte,
1591 );
1592
1593/*
1594Description:
1595 Calls ON_ConvertUTF8ToWideChar()
1596*/
1597ON_DECL
1598int on_MultiByteToWideChar(
1599 const char*, // lpMultiByteStr,
1600 int, // cchMultiByte,
1601 wchar_t*, // lpWideCharStr,
1602 int // cchWideChar
1603 );
1604
1605/*
1606Description:
1607 Find the locations in a path the specify the drive, directory,
1608 file name and file extension.
1609Parameters:
1610 path - [in]
1611 UTF-8 encoded string that is a legitimate path to a file.
1612 drive - [out] (pass null if you don't need the drive)
1613 If drive is not null and the path parameter begins with
1614 an A-Z or a-z followed by a colon ( : ) then the returned
1615 value of *drive will equal the input value of path.
1616 dir - [out] (pass null if you don't need the directory)
1617 If dir is not null and the path parameter contains a
1618 directory specification, then the returned value of *dir
1619 will point to the character in path where the directory
1620 specification begins.
1621 fname - [out] (pass null if you don't need the file name)
1622 If fname is not null and the path parameter contains a
1623 file name specification, then the returned value of *fname
1624 will point to the character in path where the file name
1625 specification begins.
1626 ext - [out] (pass null if you don't need the extension)
1627 If ext is not null and the path parameter contains a
1628 file extension specification, then the returned value of
1629 *ext will point to the '.' character in path where the file
1630 extension specification begins.
1631Remarks:
1632 This function will treat a front slash ( / ) and a back slash
1633 ( \ ) as directory separators. Because this function parses
1634 file names store in .3dm files and the .3dm file may have been
1635 written on a Windows computer and then read on a another
1636 computer, it looks for a drive dpecification even when the
1637 operating system is not Windows.
1638 This function will not return an directory that does not
1639 end with a trailing slash.
1640 This function will not return an empty filename and a non-empty
1641 extension.
1642 This function parses the path string according to these rules.
1643 It does not check the actual file system to see if the answer
1644 is correct.
1645See Also:
1646 ON_String::SplitPath
1647*/
1648ON_DECL void on_splitpath(
1649 const char* path,
1650 const char** drive,
1651 const char** dir,
1652 const char** fname,
1653 const char** ext
1654 );
1655
1656/*
1657Description:
1658 Find the locations in a path the specify the drive, directory,
1659 file name and file extension.
1660Parameters:
1661 path - [in]
1662 UTF-8, UTF-16 or UTF-32 encoded wchar_t string that is a
1663 legitimate path to a file.
1664 drive - [out] (pass null if you don't need the drive)
1665 If drive is not null and the path parameter begins with
1666 an A-Z or a-z followed by a colon ( : ) then the returned
1667 value of *drive will equal the input value of path.
1668 dir - [out] (pass null if you don't need the directory)
1669 If dir is not null and the path parameter contains a
1670 directory specification, then the returned value of *dir
1671 will point to the character in path where the directory
1672 specification begins.
1673 fname - [out] (pass null if you don't need the file name)
1674 If fname is not null and the path parameter contains a
1675 file name specification, then the returned value of *fname
1676 will point to the character in path where the file name
1677 specification begins.
1678 ext - [out] (pass null if you don't need the extension)
1679 If ext is not null and the path parameter contains a
1680 file extension specification, then the returned value of
1681 *ext will point to the '.' character in path where the file
1682 extension specification begins.
1683Remarks:
1684 This function will treat a front slash ( / ) and a back slash
1685 ( \ ) as directory separators. Because this function parses
1686 file names store in .3dm files and the .3dm file may have been
1687 written on a Windows computer and then read on a another
1688 computer, it looks for a drive dpecification even when the
1689 operating system is not Windows.
1690 This function will not return an directory that does not
1691 end with a trailing slash.
1692 This function will not return an empty filename and a non-empty
1693 extension.
1694 This function parses the path string according to these rules.
1695 It does not check the actual file system to see if the answer
1696 is correct.
1697See Also:
1698 ON_wString::SplitPath
1699*/
1700ON_DECL void on_wsplitpath(
1701 const wchar_t* path,
1702 const wchar_t** drive,
1703 const wchar_t** dir,
1704 const wchar_t** fname,
1705 const wchar_t** ext
1706 );
1707
1708ON_END_EXTERNC
1709
1710
1711#endif
bool operator!=(const OpenNI2VideoMode &video_mode_a, const OpenNI2VideoMode &video_mode_b)
bool operator<(const PersonCluster< PointT > &c1, const PersonCluster< PointT > &c2)
void read(std::istream &stream, Type &value)
Function for reading data from a stream.
Definition region_xy.h:46
void write(std::ostream &stream, Type value)
Function for writing data to a stream.
Definition region_xy.h:63
bool operator==(const PCLHeader &lhs, const PCLHeader &rhs)
Definition PCLHeader.h:37
ON__INT64 h
char b[8]
ON__INT32 i