Skip to content

Commit

Permalink
Merge pull request mcneel#21 from mcneel/update-1599859769-7.x
Browse files Browse the repository at this point in the history
Sync changes from upstream repository
  • Loading branch information
sbaer authored Sep 11, 2020
2 parents e15c463 + 6a1fea7 commit 990401a
Show file tree
Hide file tree
Showing 74 changed files with 12,890 additions and 3,960 deletions.
12 changes: 7 additions & 5 deletions opennurbs_annotationbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1216,6 +1216,13 @@ bool ON_Annotation::Internal_GetBBox_TextGlyphBox(
text_glyph_box = ON_BoundingBox::UnsetBoundingBox;
if (m_text)
{
ON_Xform txf;
// 20 June 2017 S. Baer (RH-39835)
// GetTextXform can change cached information. Make sure this
// is called before m_text->BoundingBox()
// 23 June, 2020 - Lowell - Moved it above m_text->BoundingBox()
bool b = GetTextXform(vp, dimstyle, dimscale, txf);

text_glyph_box = m_text->BoundingBox();

// if mask, grow 2d bbox
Expand All @@ -1232,11 +1239,6 @@ bool ON_Annotation::Internal_GetBBox_TextGlyphBox(
text_glyph_box.m_max = bmax;
}

ON_Xform txf;
// 20 June 2017 S. Baer (RH-39835)
// GetTextXform can change cached information. Make sure this
// is called before m_text->BoundingBox()
bool b = GetTextXform(vp, dimstyle, dimscale, txf);
if (b)
{
text_glyph_box.Transform(txf);
Expand Down
49 changes: 49 additions & 0 deletions opennurbs_array.h
Original file line number Diff line number Diff line change
Expand Up @@ -1572,6 +1572,55 @@ template< class T>
static
int ON_CompareDecreasing( const T* a, const T* b);

void ON_SHA1_Accumulate2fPointArray(
class ON_SHA1& sha1,
const class ON_SimpleArray<ON_2fPoint>& a
);

void ON_SHA1_Accumulate3fPointArray(
class ON_SHA1& sha1,
const class ON_SimpleArray<ON_3fPoint>& a
);

void ON_SHA1_Accumulate4fPointArray(
class ON_SHA1& sha1,
const class ON_SimpleArray<ON_4fPoint>& a
);

void ON_SHA1_Accumulate2fVectorArray(
class ON_SHA1& sha1,
const class ON_SimpleArray<ON_2fVector>& a
);

void ON_SHA1_Accumulate3fVectorArray(
class ON_SHA1& sha1,
const class ON_SimpleArray<ON_3fVector>& a
);

void ON_SHA1_Accumulate2dPointArray(
class ON_SHA1& sha1,
const class ON_SimpleArray<ON_2dPoint>& a
);

void ON_SHA1_Accumulate3dPointArray(
class ON_SHA1& sha1,
const class ON_SimpleArray<ON_3dPoint>& a
);

void ON_SHA1_Accumulate4dPointArray(
class ON_SHA1& sha1,
const class ON_SimpleArray<ON_4dPoint>& a
);

void ON_SHA1_Accumulate2dVectorArray(
class ON_SHA1& sha1,
const class ON_SimpleArray<ON_2dVector>& a
);

void ON_SHA1_Accumulate3dVectorArray(
class ON_SHA1& sha1,
const class ON_SimpleArray<ON_3dVector>& a
);

// definitions of the template functions are in a different file
// so that Microsoft's developer studio's autocomplete utility
Expand Down
7 changes: 7 additions & 0 deletions opennurbs_bounding_box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1931,6 +1931,13 @@ bool ON_BoundingBox::SwapCoordinates( int i, int j )
return rc;
}

bool ON_BoundingBox::Expand(ON_3dVector delta)
{
m_min -= delta;
m_max += delta;
return IsValid();
}

bool ON_BoundingBox::IsDisjoint( const ON_BoundingBox& other_bbox ) const
{
if ( m_min.x > m_max.x || other_bbox.m_min.x > other_bbox.m_max.x
Expand Down
10 changes: 10 additions & 0 deletions opennurbs_bounding_box.h
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,16 @@ class ON_CLASS ON_BoundingBox

bool SwapCoordinates( int, int );

/*
Description:
Expand the box by adding delta to m_max and subtracting
it from m_min. So, when delta is positive and the interval is
increasing this function expands the box on each side.
Returns:
true if the result is Valid.
*/
bool Expand(ON_3dVector delta);

ON_3dPoint m_min;
ON_3dPoint m_max;
};
Expand Down
Loading

0 comments on commit 990401a

Please sign in to comment.