-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathopennurbs_annotation.cpp
732 lines (619 loc) · 18.4 KB
/
opennurbs_annotation.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
/* $NoKeywords: $ */
/*
//
// Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
// OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
// McNeel & Associates.
//
// THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
// ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
// MERCHANTABILITY ARE HEREBY DISCLAIMED.
//
// For complete openNURBS copyright information see <http://www.opennurbs.org>.
//
////////////////////////////////////////////////////////////////
*/
#include "opennurbs.h"
ON_VIRTUAL_OBJECT_IMPLEMENT( ON_Annotation, ON_Geometry, "ABAF5873-4145-11d4-800F-0010830122F0" );
ON_OBJECT_IMPLEMENT( ON_LinearDimension, ON_Annotation, "5DE6B20D-486B-11d4-8014-0010830122F0" );
ON_OBJECT_IMPLEMENT( ON_RadialDimension, ON_Annotation, "5DE6B20E-486B-11d4-8014-0010830122F0" );
ON_OBJECT_IMPLEMENT( ON_AngularDimension, ON_Annotation, "5DE6B20F-486B-11d4-8014-0010830122F0" );
ON_OBJECT_IMPLEMENT( ON_TextEntity, ON_Annotation, "5DE6B210-486B-11d4-8014-0010830122F0" );
ON_OBJECT_IMPLEMENT( ON_Leader, ON_Annotation, "5DE6B211-486B-11d4-8014-0010830122F0" );
ON_BOOL32 ON_LinearDimension::IsRealObject() const {return true;}
ON_BOOL32 ON_RadialDimension::IsRealObject() const {return true;}
ON_BOOL32 ON_AngularDimension::IsRealObject() const {return true;}
ON_BOOL32 ON_TextEntity::IsRealObject() const {return true;}
ON_BOOL32 ON_Leader::IsRealObject() const {return true;}
#define REALLY_BIG_NUMBER 1e150
static const ON_3dmAnnotationSettings* sglb_asets = 0;
void ON_Annotation::SetAnnotationSettings( const ON_3dmAnnotationSettings* p )
{
sglb_asets = p;
}
const ON_3dmAnnotationSettings& ON_Annotation::AnnotationSettings()
{
static ON_3dmAnnotationSettings defaults;
return sglb_asets ? *sglb_asets : defaults;
}
void ON_Annotation::Create()
{
// TODO: initialize class members assuming any member that is not a class
// is not initialized.
m_type = ON::dtNothing;
m_plane = ON_xy_plane;
m_points.EmergencyDestroy();
m_usertext.EmergencyDestroy();
m_defaulttext.EmergencyDestroy();
m_userpositionedtext = false;
}
void ON_Annotation::Destroy()
{
m_points.Destroy();
m_usertext.Destroy();
m_defaulttext.Destroy();
m_type = ON::dtNothing;
m_plane = ON_xy_plane;
m_userpositionedtext = false;
}
void ON_Annotation::EmergencyDestroy()
{
m_points.EmergencyDestroy();
m_usertext.EmergencyDestroy();
m_defaulttext.EmergencyDestroy();
m_type = ON::dtNothing;
m_plane = ON_xy_plane;
m_userpositionedtext = false;
}
ON_Annotation::ON_Annotation()
{
Create();
}
ON_Annotation::ON_Annotation(const ON_Annotation& src)
{
Create();
*this = src;
}
ON_Annotation::~ON_Annotation()
{
Destroy();
}
bool ON_Annotation::IsText() const { return Type() == ON::dtTextBlock; }
bool ON_Annotation::IsLeader() const { return Type() == ON::dtLeader; }
bool ON_Annotation::IsDimension() const { if( IsText() || IsLeader()) return false; return true; }
//virtual
double ON_Annotation::NumericValue() const { return 0.0; }
//virtual
void ON_Annotation::SetTextToDefault() { SetDefaultText( L""); }
void ON_Annotation::SetType( ON::eAnnotationType type ) { m_type = type; }
ON::eAnnotationType ON_Annotation::Type() const { return m_type; }
void ON_Annotation::SetTextDisplayMode( ON::eTextDisplayMode mode) { m_textdisplaymode = mode; }
ON::eTextDisplayMode ON_Annotation::TextDisplayMode() const { return m_textdisplaymode; }
void ON_Annotation::SetPlane( const ON_Plane& plane ) { m_plane = plane; }
ON_Plane ON_Annotation::Plane() const { return m_plane; }
int ON_Annotation::PointCount() const { return m_points.Count(); }
void ON_Annotation::SetPoints( const ON_SimpleArray<ON_2dPoint>& points ) { m_points = points; }
const ON_SimpleArray<ON_2dPoint>& ON_Annotation::Points() const { return m_points; }
void ON_Annotation::SetUserText( const wchar_t* string ) {m_usertext = string; }
const ON_wString& ON_Annotation::UserText() const { return m_usertext; }
void ON_Annotation::SetDefaultText( const wchar_t* string ) { m_defaulttext = string; }
const ON_wString& ON_Annotation::DefaultText() const { return m_defaulttext; }
void ON_Annotation::SetUserPositionedText( int bUserPositionedText ) { m_userpositionedtext = (bUserPositionedText?true:false); }
bool ON_Annotation::UserPositionedText() const { return m_userpositionedtext; }
ON_Annotation& ON_Annotation::operator=(const ON_Annotation& src)
{
if ( this != &src ) {
// get a clean and empty "this"
Destroy();
Create();
ON_Geometry::operator=(src);
// TODO: copy fields
m_type = src.m_type;
m_plane = src.m_plane;
m_points = src.m_points;
m_usertext = src.m_usertext;
m_userpositionedtext = src.m_userpositionedtext;
}
return *this;
}
ON_BOOL32 ON_Annotation::IsValid( ON_TextLog* text_log ) const
{
// TODO: quickly inspect object and return true/false
bool rc = true;
if ( ON::dtNothing == m_type )
{
if ( 0 != text_log )
text_log->Print("ON_Annotation has m_type = ON::dtNothing.\n");
rc = false;
}
return rc;
}
void ON_Annotation::Dump( ON_TextLog& dump ) const
{
// for debugging
dump.Print("ON_Annotation: ....\n");
}
ON_BOOL32 ON_Annotation::Write( ON_BinaryArchive& file ) const
{
int i;
ON_BOOL32 rc = file.Write3dmChunkVersion( 1, 0 );
// TODO: use
// if (rc) rc = file.WritePoint(....);
// if (rc) rc = file.WriteString(....);
// if (rc) rc = file.WriteDouble(....);
// to write object.
i = m_type;
if (rc)
rc = file.WriteInt( i );
if (rc)
rc = file.WritePlane( m_plane );
if (rc)
rc = file.WriteArray( m_points );
if (rc)
rc = file.WriteString( m_usertext );
if (rc)
rc = file.WriteString( m_defaulttext );
if( rc )
rc = file.WriteInt( m_userpositionedtext );
return rc;
}
ON_BOOL32 ON_Annotation::Read( ON_BinaryArchive& file )
{
Destroy();
int major_version = 0;
int minor_version = 0;
ON_BOOL32 rc = file.Read3dmChunkVersion(&major_version,&minor_version);
if ( rc && major_version == 1 )
{
int i;
if (rc)
{
rc = file.ReadInt( &i );
if (rc)
m_type = ON::AnnotationType(i);
}
if (rc)
rc = file.ReadPlane( m_plane );
if (rc)
rc = file.ReadArray( m_points );
if (rc)
rc = file.ReadString( m_usertext );
if (rc)
rc = file.ReadString( m_defaulttext );
if( rc )
{
rc = file.ReadInt( &i );
if (rc) m_userpositionedtext = i ? true : false;
}
}
if( fabs( m_plane.origin.x) > REALLY_BIG_NUMBER || fabs( m_plane.origin.y) > REALLY_BIG_NUMBER || fabs( m_plane.origin.z) > REALLY_BIG_NUMBER)
return false;
for( int i = 0; i < m_points.Count(); i++)
{
if( fabs( m_points[i].x) > REALLY_BIG_NUMBER || fabs( m_points[i].y) > REALLY_BIG_NUMBER)
return false;
}
return rc;
}
ON::object_type ON_Annotation::ObjectType() const
{
return ON::annotation_object;
}
int ON_Annotation::Dimension() const
{
return 3;
}
ON_BOOL32 ON_Annotation::GetBBox( // returns true if successful
double* boxmin,
double* boxmax,
ON_BOOL32 bGrowBox // default = false
) const
{
// TODO:
// If the class is not valid, return false.
//
// If the class is valid and bGrowBox is false,
// return the 3d bounding box of the annotation.
//
// If the class is valid and bGrowBox is true,
// return the union of the input box and the 3d bounding
// box of the annotation.
if( !bGrowBox )
{
boxmin[0] = boxmin[1] = boxmin[2] = 1e300;
boxmax[0] = boxmax[1] = boxmax[2] = -1e300;
}
ON_3dPoint wpt;
ON_Xform xform;
GetECStoWCSXform( xform );
for( int i = 0; i < m_points.Count(); i++ )
{
wpt = m_points[i];
if( wpt.y < boxmin[1] )
boxmin[1] = wpt.y;
if( wpt.z < boxmin[2] )
boxmin[2] = wpt.z;
if( wpt.x > boxmax[0] )
boxmax[0] = wpt.x;
if( wpt.y > boxmax[1] )
boxmax[1] = wpt.y;
if( wpt.z > boxmax[2] )
boxmax[2] = wpt.z;
}
return true;
}
ON_BOOL32 ON_Annotation::Transform( const ON_Xform& xform )
{
// TODO: Return false if class is invalid or xform cannot be applied.
// Otherwise, apply xform to geometry and return true.
TransformUserData(xform);
return m_plane.Transform( xform );
}
// Converts 2d points in annotation to 3d WCS points
bool ON_Annotation::GetECStoWCSXform( ON_Xform& xform ) const
{
ON_3dVector z = ON_CrossProduct( m_plane.xaxis, m_plane.yaxis );
return xform.ChangeBasis( m_plane.origin, m_plane.xaxis, m_plane.yaxis, z,
ON_origin, ON_xaxis, ON_yaxis, ON_zaxis );
}
// Converts from WCS 3d points to 2d points in annotation
bool ON_Annotation::GeWCStoECSXform( ON_Xform& xform ) const
{
ON_3dVector z = ON_CrossProduct( m_plane.xaxis, m_plane.yaxis );
return xform.ChangeBasis( ON_origin, ON_xaxis, ON_yaxis, ON_zaxis,
m_plane.origin, m_plane.xaxis, m_plane.yaxis, z );
}
void ON_Annotation::SetPoint( int idx, ON_3dPoint point )
{
if( idx >= 0 && idx < m_points.Count() )
m_points[idx] = point;
}
ON_2dPoint ON_Annotation::Point( int idx ) const
{
if( idx >= 0 && idx < m_points.Count() )
return m_points[idx];
return ON_2dPoint( 0.0, 0.0 );
}
//----- ON_LinearDimension ------------------------------------------
ON_LinearDimension::ON_LinearDimension()
{
}
ON_LinearDimension::ON_LinearDimension(const ON_LinearDimension& src) : ON_Annotation(src)
{
}
ON_LinearDimension::~ON_LinearDimension()
{
}
ON_LinearDimension& ON_LinearDimension::operator=(const ON_LinearDimension& src)
{
if ( this != &src ) {
ON_Annotation::operator=(src);
}
return *this;
}
void ON_LinearDimension::EmergencyDestroy()
{
ON_Annotation::EmergencyDestroy();
}
double ON_LinearDimension::NumericValue()
{
return (Point( 1) - Point( 3)).Length();
}
void ON_LinearDimension::SetTextToDefault()
{
SetUserText( L"<>");
}
//----- ON_RadialDimension ------------------------------------------
ON_RadialDimension::ON_RadialDimension()
{
}
ON_RadialDimension::ON_RadialDimension(const ON_RadialDimension& src) : ON_Annotation(src)
{
}
ON_RadialDimension::~ON_RadialDimension()
{
}
ON_RadialDimension& ON_RadialDimension::operator=(const ON_RadialDimension& src)
{
if ( this != &src ) {
ON_Annotation::operator=(src);
}
return *this;
}
void ON_RadialDimension::EmergencyDestroy()
{
ON_Annotation::EmergencyDestroy();
}
double ON_RadialDimension::NumericValue()
{
double d = (Point( 0) - Point( 1)).Length();
if( Type() == ON::dtDimDiameter)
d *= 2.0;
return d;
}
void ON_RadialDimension::SetTextToDefault()
{
ON_wString s;
if( Type() == ON::dtDimDiameter)
s.Format( L"%c<>", ON_Annotation::diametersym);
else
s.Format( L"%c<>", ON_Annotation::radiussym);
SetUserText( s);
}
//----- ON_AngularDimension -----------------------------------------
ON_AngularDimension::ON_AngularDimension() : m_angle(0.0), m_radius(0.0)
{
}
ON_AngularDimension::ON_AngularDimension(const ON_AngularDimension& src) : ON_Annotation(src)
{
m_angle = src.m_angle;
m_radius = src.m_radius;
}
ON_AngularDimension::~ON_AngularDimension()
{
}
ON_AngularDimension& ON_AngularDimension::operator=(const ON_AngularDimension& src)
{
if ( this != &src ) {
ON_Annotation::operator=(src);
m_angle = src.m_angle;
m_radius = src.m_radius;
}
return *this;
}
void ON_AngularDimension::EmergencyDestroy()
{
ON_Annotation::EmergencyDestroy();
}
ON_BOOL32 ON_AngularDimension::Write( ON_BinaryArchive& file ) const
{
ON_BOOL32 rc = ON_Annotation::Write( file );
if( rc )
rc = file.WriteDouble( m_angle );
if( rc )
rc = file.WriteDouble( m_radius );
return rc;
}
ON_BOOL32 ON_AngularDimension::Read( ON_BinaryArchive& file )
{
ON_BOOL32 rc = ON_Annotation::Read( file );
if( rc )
rc = file.ReadDouble( &m_angle );
if( rc )
rc = file.ReadDouble( &m_radius );
if( m_angle <= 0.0 || m_angle > REALLY_BIG_NUMBER)
return false;
if( m_radius <= 0.0 || m_radius > REALLY_BIG_NUMBER)
return false;
return rc;
}
double ON_AngularDimension::NumericValue()
{
return Angle() * 180.0 / ON_PI;
}
void ON_AngularDimension::SetTextToDefault()
{
ON_wString s;
s.Format( L"<>%c", ON_Annotation::degreesym);
SetUserText( s);
}
//----- ON_TextEntity -----------------------------------------------
ON_TextEntity::ON_TextEntity() : m_fontweight(400), m_height(20.0)
{
}
ON_TextEntity::ON_TextEntity(const ON_TextEntity& src) : ON_Annotation(src)
{
m_facename = src.m_facename;
m_fontweight = src.m_fontweight;
m_height = src.m_height;
}
ON_TextEntity::~ON_TextEntity()
{
m_facename.Destroy();
}
ON_TextEntity& ON_TextEntity::operator=(const ON_TextEntity& src)
{
if ( this != &src ) {
m_facename = src.m_facename;
m_fontweight = src.m_fontweight;
m_height = src.m_height;
ON_Annotation::operator=(src);
}
return *this;
}
void ON_TextEntity::EmergencyDestroy()
{
ON_Annotation::EmergencyDestroy();
m_facename.EmergencyDestroy();
}
ON_BOOL32 ON_TextEntity::Write( ON_BinaryArchive& file ) const
{
ON_BOOL32 rc = ON_Annotation::Write( file );
if( rc )
rc = file.WriteString( m_facename );
if( rc )
rc = file.WriteInt( m_fontweight );
if( rc )
rc = file.WriteDouble( m_height );
return rc;
}
ON_BOOL32 ON_TextEntity::Read( ON_BinaryArchive& file )
{
ON_BOOL32 rc = ON_Annotation::Read( file );
if( rc )
rc = file.ReadString( m_facename );
if( rc )
rc = file.ReadInt( &m_fontweight );
if( rc )
rc = file.ReadDouble( &m_height );
if( fabs( m_height) > REALLY_BIG_NUMBER)
return false;
return rc;
}
//----- ON_Leader ------------------------------------------
ON_Leader::ON_Leader()
{
}
ON_Leader::ON_Leader(const ON_Leader& src) : ON_Annotation(src)
{
}
ON_Leader::~ON_Leader()
{
}
ON_Leader& ON_Leader::operator=(const ON_Leader& src)
{
if ( this != &src ) {
ON_Annotation::operator=(src);
}
return *this;
}
void ON_Leader::EmergencyDestroy()
{
ON_Annotation::EmergencyDestroy();
}
ON_OBJECT_IMPLEMENT(ON_AnnotationTextDot,ON_Point,"8BD94E19-59E1-11d4-8018-0010830122F0");
ON_AnnotationTextDot::ON_AnnotationTextDot()
{}
ON_AnnotationTextDot::~ON_AnnotationTextDot()
{
m_text.Destroy();
}
ON_AnnotationTextDot::ON_AnnotationTextDot(const ON_AnnotationTextDot& src) : ON_Point(src), m_text(src.m_text)
{}
ON_AnnotationTextDot& ON_AnnotationTextDot::operator=(const ON_AnnotationTextDot& src)
{
if ( this != &src ) {
ON_Point::operator=(src);
m_text = src.m_text;
}
return *this;
}
ON_BOOL32 ON_AnnotationTextDot::IsValid( ON_TextLog* text_log ) const
{
bool rc = true;
if ( m_text.IsEmpty() )
{
if ( 0 != text_log )
text_log->Print("ON_AnnotationTextDot.m_text is empty\n");
rc = false;
}
return rc;
}
void ON_AnnotationTextDot::Dump( ON_TextLog& log ) const
{
log.Print("ON_AnnotationTextDot \"%ls\" at ",m_text.Array());
log.Print(point);
log.Print("\n");
}
ON_BOOL32 ON_AnnotationTextDot::Write( ON_BinaryArchive& file ) const
{
ON_BOOL32 rc = file.Write3dmChunkVersion(1,0);
if (rc) rc = file.WritePoint( point );
if (rc) rc = file.WriteString( m_text );
return rc;
}
ON_BOOL32 ON_AnnotationTextDot::Read( ON_BinaryArchive& file )
{
m_text.Destroy();
int major_version = 0;
int minor_version = 0;
ON_BOOL32 rc = file.Read3dmChunkVersion(&major_version,&minor_version);
if ( major_version == 1 ) {
if (rc) rc = file.ReadPoint( point );
if (rc) rc = file.ReadString( m_text );
}
else {
rc = false;
}
return rc;
}
ON_OBJECT_IMPLEMENT(ON_AnnotationArrow,ON_Geometry,"8BD94E1A-59E1-11d4-8018-0010830122F0");
ON_AnnotationArrow::ON_AnnotationArrow() : m_tail(0.0,0.0,0.0), m_head(0.0,0.0,0.0)
{}
ON_AnnotationArrow::~ON_AnnotationArrow()
{}
ON_AnnotationArrow::ON_AnnotationArrow(const ON_AnnotationArrow& src) : ON_Geometry(src), m_tail(src.m_tail), m_head(src.m_head)
{}
ON_AnnotationArrow& ON_AnnotationArrow::operator=(const ON_AnnotationArrow& src)
{
if ( this != &src ) {
ON_Geometry::operator=(src);
m_tail = src.m_tail;
m_head = src.m_head;
}
return *this;
}
ON_BOOL32 ON_AnnotationArrow::IsValid( ON_TextLog* text_log ) const
{
bool rc = true;
if (m_tail == m_head)
{
if ( 0 != text_log )
text_log->Print("ON_AnnotationArrow has m_head=m_tail.\n");
rc = false;
}
return rc;
}
void ON_AnnotationArrow::Dump( ON_TextLog& log ) const
{
log.Print("ON_AnnotationArrow: ");
log.Print(m_tail);
log.Print(" to ");
log.Print(m_head);
log.Print("\n");
}
ON_BOOL32 ON_AnnotationArrow::Write( ON_BinaryArchive& file ) const
{
ON_BOOL32 rc = file.Write3dmChunkVersion(1,0);
if (rc) rc = file.WritePoint( m_tail );
if (rc) rc = file.WritePoint( m_head );
return rc;
}
ON_BOOL32 ON_AnnotationArrow::Read(ON_BinaryArchive& file)
{
int major_version = 0;
int minor_version = 0;
ON_BOOL32 rc = file.Read3dmChunkVersion(&major_version,&minor_version);
if ( major_version == 1 ) {
if (rc) rc = file.ReadPoint( m_tail );
if (rc) rc = file.ReadPoint( m_head );
}
else {
rc = false;
}
return rc;
}
ON::object_type ON_AnnotationArrow::ObjectType() const
{
return ON::annotation_object;
}
int ON_AnnotationArrow::Dimension() const
{
return 3;
}
ON_BOOL32 ON_AnnotationArrow::GetBBox( double* boxmin, double* boxmax, ON_BOOL32 bGrowBox ) const
{
ON_BOOL32 rc = ON_GetPointListBoundingBox( 3, false, 1, 3, m_tail, boxmin, boxmax, bGrowBox?true:false );
if (rc)
rc = ON_GetPointListBoundingBox( 3, false, 1, 3, m_head, boxmin, boxmax, true );
return rc;
}
ON_BOOL32 ON_AnnotationArrow::Transform( const ON_Xform& xform )
{
TransformUserData(xform);
m_tail = xform*m_tail;
m_head = xform*m_head;
return true;
}
ON_3dVector ON_AnnotationArrow::Vector() const
{
return (m_head-m_tail);
}
ON_3dPoint ON_AnnotationArrow::Head() const
{
return m_head;
}
ON_3dPoint ON_AnnotationArrow::Tail() const
{
return m_tail;
}