kicad/eeschema/classes_body_items.cpp

601 lines
19 KiB
C++
Raw Normal View History

2008-09-13 18:59:57 +00:00
/************************/
/* class_body_items.cpp */
/************************/
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "class_drawpanel.h"
#include "drawtxt.h"
2008-09-13 18:59:57 +00:00
#include "program.h"
#include "libcmp.h"
#include "general.h"
#include "protos.h"
//#define DRAW_ARC_WITH_ANGLE // Used to draw arcs
2008-09-14 04:27:22 +00:00
/* Basic class (abstract) for components bodies items */
LibEDA_BaseStruct::LibEDA_BaseStruct( KICAD_T struct_type ) :
EDA_BaseStruct( struct_type )
{
m_Unit = 0; /* Unit identification (for multi part per package)
* 0 if the item is common to all units */
m_Convert = 0; /* Shape identification (for parts which have a convert shape)
* 0 if the item is common to all shapes */
2009-01-02 17:07:50 +00:00
m_Fill = NO_FILL;
2008-09-14 04:27:22 +00:00
}
2008-09-13 18:59:57 +00:00
/** Function Draw (virtual)
* Draw A body item
* @param aPanel = DrawPanel to use (can be null) mainly used for clipping purposes
* @param aDC = Device Context (can be null)
* @param aOffset = offset to draw
* @param aDrawMode = GR_OR, GR_XOR, ...
* @param aDisplay_mode = FILL_T value ( has meaning only for items what can be filled )
* @param aTransformMatrix = Transform Matrix
*/
/**********************************************************************************************/
void LibDrawArc::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aOffset, int aColor,
2009-01-02 17:07:50 +00:00
int aDrawMode, void* aData, const int aTransformMatrix[2][2] )
2008-09-13 18:59:57 +00:00
/**********************************************************************************************/
{
wxPoint pos1, pos2, posc;
int color = ReturnLayerColor( LAYER_DEVICE );
int linewidth = MAX( m_Width, g_DrawMinimunLineWidth );
2008-09-13 18:59:57 +00:00
if( aColor < 0 ) // Used normal color or selected color
{
if( (m_Selected & IS_SELECTED) )
color = g_ItemSelectetColor;
}
else
color = aColor;
pos1 = TransformCoordinate( aTransformMatrix, m_ArcEnd ) + aOffset;
pos2 = TransformCoordinate( aTransformMatrix, m_ArcStart ) + aOffset;
posc = TransformCoordinate( aTransformMatrix, m_Pos ) + aOffset;
int pt1 = t1;
int pt2 = t2;
bool swap = MapAngles( &pt1, &pt2, aTransformMatrix );
if( swap )
{
EXCHG( pos1.x, pos2.x );
EXCHG( pos1.y, pos2.y );
2008-09-13 18:59:57 +00:00
}
GRSetDrawMode( aDC, aDrawMode );
FILL_T fill = aData ? NO_FILL : m_Fill;
if( aColor >= 0 )
fill = NO_FILL;
if( fill == FILLED_WITH_BG_BODYCOLOR )
GRFilledArc( &aPanel->m_ClipBox, aDC, posc.x, posc.y, pt1, pt2,
2009-01-02 17:07:50 +00:00
m_Rayon, linewidth, color,
ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
2008-09-13 18:59:57 +00:00
else if( fill == FILLED_SHAPE && !aData )
GRFilledArc( &aPanel->m_ClipBox, aDC, posc.x, posc.y, pt1, pt2,
2009-01-02 17:07:50 +00:00
m_Rayon, color, color );
2008-09-13 18:59:57 +00:00
else
#ifdef DRAW_ARC_WITH_ANGLE
2008-09-14 04:27:22 +00:00
2008-09-13 18:59:57 +00:00
GRArc( &aPanel->m_ClipBox, aDC, posc.x, posc.y, pt1, pt2,
2009-01-02 17:07:50 +00:00
m_Rayon, linewidth, color );
2008-09-13 18:59:57 +00:00
#else
2008-09-14 04:27:22 +00:00
2008-09-13 18:59:57 +00:00
GRArc1( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, pos2.x, pos2.y,
2009-01-02 17:07:50 +00:00
posc.x, posc.y, linewidth, color );
2008-09-13 18:59:57 +00:00
#endif
}
/*************************************************************************************************/
void LibDrawCircle::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aOffset, int aColor,
2009-01-02 17:07:50 +00:00
int aDrawMode, void* aData, const int aTransformMatrix[2][2] )
2008-09-13 18:59:57 +00:00
/*************************************************************************************************/
{
wxPoint pos1;
int color = ReturnLayerColor( LAYER_DEVICE );
int linewidth = MAX( m_Width, g_DrawMinimunLineWidth );
2008-09-13 18:59:57 +00:00
if( aColor < 0 ) // Used normal color or selected color
{
if( (m_Selected & IS_SELECTED) )
color = g_ItemSelectetColor;
}
else
color = aColor;
pos1 = TransformCoordinate( aTransformMatrix, m_Pos ) + aOffset;
GRSetDrawMode( aDC, aDrawMode );
FILL_T fill = aData ? NO_FILL : m_Fill;
if( aColor >= 0 )
fill = NO_FILL;
if( fill == FILLED_WITH_BG_BODYCOLOR )
GRFilledCircle( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y,
2009-01-02 17:07:50 +00:00
m_Rayon, linewidth, color,
ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
2008-09-13 18:59:57 +00:00
else if( fill == FILLED_SHAPE )
GRFilledCircle( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y,
2009-01-02 17:07:50 +00:00
m_Rayon, 0, color, color );
2008-09-13 18:59:57 +00:00
else
GRCircle( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y,
2009-01-02 17:07:50 +00:00
m_Rayon, linewidth, color );
2008-09-13 18:59:57 +00:00
}
/*************************************************************************************************/
void LibDrawText::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aOffset, int aColor,
2009-01-02 17:07:50 +00:00
int aDrawMode, void* aData, const int aTransformMatrix[2][2] )
2008-09-13 18:59:57 +00:00
/*************************************************************************************************/
{
wxPoint pos1, pos2;
int color = ReturnLayerColor( LAYER_DEVICE );
int linewidth = MAX( m_Width, g_DrawMinimunLineWidth );
2008-09-13 18:59:57 +00:00
if( aColor < 0 ) // Used normal color or selected color
{
if( (m_Selected & IS_SELECTED) )
color = g_ItemSelectetColor;
}
else
color = aColor;
pos1 = TransformCoordinate( aTransformMatrix, m_Pos ) + aOffset;
/* The text orientation may need to be flipped if the
* transformation matrix causes xy axes to be flipped. */
int t1 = (aTransformMatrix[0][0] != 0) ^ (m_Orient != 0);
2008-09-13 18:59:57 +00:00
DrawGraphicText( aPanel, aDC, pos1, (EDA_Colors) color, m_Text,
2009-01-02 17:07:50 +00:00
t1 ? TEXT_ORIENT_HORIZ : TEXT_ORIENT_VERT,
m_Size,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, linewidth, m_Italic );
2008-09-13 18:59:57 +00:00
}
/*************************************************************************************************/
void LibDrawSquare::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aOffset, int aColor,
2009-01-02 17:07:50 +00:00
int aDrawMode, void* aData, const int aTransformMatrix[2][2] )
2008-09-13 18:59:57 +00:00
/*************************************************************************************************/
{
wxPoint pos1, pos2;
int color = ReturnLayerColor( LAYER_DEVICE );
int linewidth = MAX( m_Width, g_DrawMinimunLineWidth );
2008-09-13 18:59:57 +00:00
if( aColor < 0 ) // Used normal color or selected color
{
if( (m_Selected & IS_SELECTED) )
color = g_ItemSelectetColor;
}
else
color = aColor;
pos1 = TransformCoordinate( aTransformMatrix, m_Pos ) + aOffset;
pos2 = TransformCoordinate( aTransformMatrix, m_End ) + aOffset;
FILL_T fill = aData ? NO_FILL : m_Fill;
if( aColor >= 0 )
fill = NO_FILL;
if( fill == FILLED_WITH_BG_BODYCOLOR && !aData )
GRFilledRect( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, pos2.x, pos2.y,
2009-01-02 17:07:50 +00:00
linewidth, color,
ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
2008-09-13 18:59:57 +00:00
else if( m_Fill == FILLED_SHAPE && !aData )
GRFilledRect( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, pos2.x, pos2.y,
2009-01-02 17:07:50 +00:00
linewidth, color, color );
2008-09-13 18:59:57 +00:00
else
GRRect( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, pos2.x, pos2.y,
2009-01-02 17:07:50 +00:00
linewidth, color );
2008-09-13 18:59:57 +00:00
}
/*************************************************************************************************/
void LibDrawSegment::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aOffset, int aColor,
2009-01-02 17:07:50 +00:00
int aDrawMode, void* aData, const int aTransformMatrix[2][2] )
2008-09-13 18:59:57 +00:00
/*************************************************************************************************/
{
wxPoint pos1, pos2;
int color = ReturnLayerColor( LAYER_DEVICE );
int linewidth = MAX( m_Width, g_DrawMinimunLineWidth );
2008-09-13 18:59:57 +00:00
if( aColor < 0 ) // Used normal color or selected color
{
if( (m_Selected & IS_SELECTED) )
color = g_ItemSelectetColor;
}
else
color = aColor;
pos1 = TransformCoordinate( aTransformMatrix, m_Pos ) + aOffset;
pos2 = TransformCoordinate( aTransformMatrix, m_End ) + aOffset;
GRLine( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, pos2.x, pos2.y, linewidth, color );
2008-09-13 18:59:57 +00:00
}
/*************************************************************************************************/
void LibDrawPolyline::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC,
const wxPoint& aOffset, int aColor,
int aDrawMode, void* aData,
2009-01-02 17:07:50 +00:00
const int aTransformMatrix[2][2] )
2008-09-13 18:59:57 +00:00
/*************************************************************************************************/
{
2009-01-02 17:07:50 +00:00
wxPoint pos1;
2008-09-13 18:59:57 +00:00
2009-01-02 17:07:50 +00:00
int color = ReturnLayerColor( LAYER_DEVICE );
int linewidth = MAX( m_Width, g_DrawMinimunLineWidth );
static wxPoint* Buf_Poly_Drawings = NULL; // Buffer used to store current corners coordinates for drawings
static unsigned Buf_Poly_Size = 0; // Buffer used to store current corners coordinates for drawings
2008-09-13 18:59:57 +00:00
2009-01-02 17:07:50 +00:00
if( aColor < 0 ) // Used normal color or selected color
2008-09-13 18:59:57 +00:00
{
if( (m_Selected & IS_SELECTED) )
color = g_ItemSelectetColor;
}
else
color = aColor;
// Set the size of the buffer od coordinates
if( Buf_Poly_Drawings == NULL )
{
2009-01-02 13:19:34 +00:00
Buf_Poly_Size = m_PolyPoints.size();
Buf_Poly_Drawings = (wxPoint*) MyMalloc( sizeof(wxPoint) * Buf_Poly_Size );
2008-09-13 18:59:57 +00:00
}
2009-01-02 13:19:34 +00:00
else if( Buf_Poly_Size < m_PolyPoints.size() )
2008-09-13 18:59:57 +00:00
{
2009-01-02 13:19:34 +00:00
Buf_Poly_Size = m_PolyPoints.size();
Buf_Poly_Drawings = (wxPoint*) realloc( Buf_Poly_Drawings,
2009-01-02 17:07:50 +00:00
sizeof(wxPoint) * Buf_Poly_Size );
2008-09-13 18:59:57 +00:00
}
2009-01-02 13:19:34 +00:00
for( unsigned ii = 0; ii < m_PolyPoints.size(); ii++ )
2008-09-13 18:59:57 +00:00
{
2009-01-02 17:07:50 +00:00
Buf_Poly_Drawings[ii] =
TransformCoordinate( aTransformMatrix, m_PolyPoints[ii] ) + aOffset;
2008-09-13 18:59:57 +00:00
}
FILL_T fill = aData ? NO_FILL : m_Fill;
if( aColor >= 0 )
fill = NO_FILL;
if( fill == FILLED_WITH_BG_BODYCOLOR )
2009-01-02 13:19:34 +00:00
GRPoly( &aPanel->m_ClipBox, aDC, m_PolyPoints.size(),
2009-01-02 17:07:50 +00:00
Buf_Poly_Drawings, 1, linewidth, color,
ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
2008-09-13 18:59:57 +00:00
else if( fill == FILLED_SHAPE )
2009-01-02 17:07:50 +00:00
GRPoly( &aPanel->m_ClipBox, aDC, m_PolyPoints.size(),
Buf_Poly_Drawings, 1, linewidth, color, color );
2008-09-13 18:59:57 +00:00
else
2009-01-02 13:19:34 +00:00
GRPoly( &aPanel->m_ClipBox, aDC, m_PolyPoints.size(),
2009-01-02 17:07:50 +00:00
Buf_Poly_Drawings, 0, linewidth, color, color );
2008-09-13 18:59:57 +00:00
}
/*************************************************************************************************/
void LibDrawField::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aOffset, int aColor,
2009-01-02 17:07:50 +00:00
int aDrawMode, void* aData, const int aTransformMatrix[2][2] )
2008-09-13 18:59:57 +00:00
/*************************************************************************************************/
/* if aData not NULL, aData must point a wxString which is used instead of the m_Text
*/
2008-09-13 18:59:57 +00:00
{
wxPoint text_pos;
int color = aColor;
int linewidth = MAX( m_Width, g_DrawMinimunLineWidth );
if( aColor < 0 ) // Used normal color or selected color
{
if( (m_Selected & IS_SELECTED) )
color = g_ItemSelectetColor;
}
else
color = aColor;
if( color < 0 )
{
switch( m_FieldId )
{
case REFERENCE:
color = ReturnLayerColor( LAYER_REFERENCEPART );
break;
case VALUE:
color = ReturnLayerColor( LAYER_VALUEPART );
break;
default:
color = ReturnLayerColor( LAYER_FIELDS );
break;
}
}
text_pos = TransformCoordinate( aTransformMatrix, m_Pos ) + aOffset;
wxString* text = aData ? (wxString*) aData : &m_Text;
GRSetDrawMode( aDC, aDrawMode );
DrawGraphicText( aPanel, aDC, text_pos,
2009-01-02 17:07:50 +00:00
(EDA_Colors) color, text->GetData(),
m_Orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
m_Size,
m_HJustify, m_VJustify, linewidth, m_Italic );
}
/**
* Function HitTest
* tests if the given wxPoint is within the bounds of this object.
* @param refPos A wxPoint to test, in Field coordinate system
* @return bool - true if a hit, else false
*/
bool LibDrawField::HitTest( const wxPoint& refPos )
{
EDA_Rect bbox; // bounding box for the text
bbox.SetOrigin( m_Pos );
2009-01-02 17:07:50 +00:00
int dx; // X size for the full text
if( m_FieldId == REFERENCE )
dx = m_Size.x * (m_Text.Len() + 1); // The displayed text has one char more (U is displayed U?)
else
2009-01-02 17:07:50 +00:00
dx = m_Size.x * m_Text.Len();
dx = (int) ( (double) dx * 10.0 / 9 ); // spacing between char is 0.1 the char size
int dy = m_Size.y;
if( m_Orient )
EXCHG( dx, dy ); // Swap X and Y size for a vertical text
// adjust position of the left bottom corner according to the justification
// pos is at this point correct for a left and top justified text
// Horizontal justification
if( m_HJustify == GR_TEXT_HJUSTIFY_CENTER )
bbox.Offset( -dx / 2, 0 );
else if( m_HJustify == GR_TEXT_HJUSTIFY_RIGHT )
bbox.Offset( -dx, 0 );
// Vertical justification
if( m_VJustify == GR_TEXT_VJUSTIFY_CENTER )
bbox.Offset( 0, -dy / 2 );
else if( m_VJustify == GR_TEXT_VJUSTIFY_TOP )
bbox.Offset( 0, -dy );
bbox.SetSize( dx, dy );
if( bbox.Inside( refPos ) )
return true;
return false;
2008-09-13 18:59:57 +00:00
}
/**************************************************************/
LibDrawArc::LibDrawArc() : LibEDA_BaseStruct( COMPONENT_ARC_DRAW_TYPE )
/**************************************************************/
{
m_Rayon = 0;
2009-01-02 17:07:50 +00:00
t1 = t2 = 0;
m_Width = 0;
m_Fill = NO_FILL;
}
/************************************/
LibDrawArc* LibDrawArc::GenCopy()
/************************************/
{
LibDrawArc* newitem = new LibDrawArc();
2009-01-02 17:07:50 +00:00
newitem->m_Pos = m_Pos;
newitem->m_ArcStart = m_ArcStart;
newitem->m_ArcEnd = m_ArcEnd;
newitem->m_Rayon = m_Rayon;
2009-01-02 17:07:50 +00:00
newitem->t1 = t1;
newitem->t2 = t2;
newitem->m_Width = m_Width;
newitem->m_Unit = m_Unit;
newitem->m_Convert = m_Convert;
newitem->m_Flags = m_Flags;
newitem->m_Fill = m_Fill;
return newitem;
}
/**********************************************************************/
LibDrawCircle::LibDrawCircle() : LibEDA_BaseStruct( COMPONENT_CIRCLE_DRAW_TYPE )
/**********************************************************************/
{
m_Rayon = 0;
m_Fill = NO_FILL;
}
/*******************************************/
LibDrawCircle* LibDrawCircle::GenCopy()
/*******************************************/
{
LibDrawCircle* newitem = new LibDrawCircle();
newitem->m_Pos = m_Pos;
newitem->m_Rayon = m_Rayon;
newitem->m_Width = m_Width;
newitem->m_Unit = m_Unit;
newitem->m_Convert = m_Convert;
newitem->m_Flags = m_Flags;
newitem->m_Fill = m_Fill;
return newitem;
}
/*****************************************************************/
LibDrawText::LibDrawText() : LibEDA_BaseStruct( COMPONENT_GRAPHIC_TEXT_DRAW_TYPE ),
2009-01-02 17:07:50 +00:00
EDA_TextStruct()
/*****************************************************************/
{
2009-01-02 17:07:50 +00:00
m_Size = wxSize( 50, 50 );
}
/***************************************/
LibDrawText* LibDrawText::GenCopy()
/***************************************/
{
LibDrawText* newitem = new LibDrawText();
2009-01-02 17:07:50 +00:00
newitem->m_Pos = m_Pos;
newitem->m_Orient = m_Orient;
newitem->m_Size = m_Size;
newitem->m_Attributs = m_Attributs;
newitem->m_Unit = m_Unit;
newitem->m_Convert = m_Convert;
newitem->m_Flags = m_Flags;
newitem->m_Text = m_Text;
newitem->m_Width = m_Width;
newitem->m_Italic = m_Italic;
2009-01-02 17:07:50 +00:00
newitem->m_HJustify = m_HJustify;
newitem->m_VJustify = m_VJustify;
return newitem;
}
LibDrawSquare::LibDrawSquare() : LibEDA_BaseStruct( COMPONENT_RECT_DRAW_TYPE )
{
m_Width = 0;
m_Fill = NO_FILL;
}
LibDrawSquare* LibDrawSquare::GenCopy()
{
LibDrawSquare* newitem = new LibDrawSquare();
newitem->m_Pos = m_Pos;
newitem->m_End = m_End;
newitem->m_Width = m_Width;
newitem->m_Unit = m_Unit;
newitem->m_Convert = m_Convert;
newitem->m_Flags = m_Flags;
newitem->m_Fill = m_Fill;
return newitem;
}
LibDrawSegment::LibDrawSegment() : LibEDA_BaseStruct( COMPONENT_LINE_DRAW_TYPE )
{
m_Width = 0;
}
LibDrawSegment* LibDrawSegment::GenCopy()
{
LibDrawSegment* newitem = new LibDrawSegment();
newitem->m_Pos = m_Pos;
newitem->m_End = m_End;
newitem->m_Width = m_Width;
newitem->m_Unit = m_Unit;
newitem->m_Convert = m_Convert;
newitem->m_Flags = m_Flags;
return newitem;
}
LibDrawPolyline::LibDrawPolyline() : LibEDA_BaseStruct( COMPONENT_POLYLINE_DRAW_TYPE )
{
2009-01-02 17:07:50 +00:00
m_Fill = NO_FILL;
m_Width = 0;
}
/************************************************/
LibDrawPolyline* LibDrawPolyline::GenCopy()
/************************************************/
{
LibDrawPolyline* newitem = new LibDrawPolyline();
2009-01-02 17:07:50 +00:00
2009-01-02 13:19:34 +00:00
newitem->m_PolyPoints = m_PolyPoints; // Vector copy
newitem->m_Width = m_Width;
newitem->m_Unit = m_Unit;
newitem->m_Convert = m_Convert;
newitem->m_Flags = m_Flags;
newitem->m_Fill = m_Fill;
return newitem;
}
/***************************************************/
void LibDrawPolyline::AddPoint( const wxPoint& point )
/***************************************************/
2009-01-02 13:19:34 +00:00
/* add a point to the polyline coordinate list
*/
{
2009-01-02 13:19:34 +00:00
m_PolyPoints.push_back( point );
}
2009-01-02 13:19:34 +00:00
/** Function HitTest
* @return true if the point aPosRef is near a segment
* @param aPosRef = a wxPoint to test
* @param aThreshold = max distance to a segment
* @param aTransMat = the transform matrix
*/
2009-01-02 17:07:50 +00:00
bool LibDrawPolyline::HitTest( wxPoint aPosRef, int aThreshold, const int aTransMat[2][2] )
2009-01-02 13:19:34 +00:00
{
2009-01-02 17:07:50 +00:00
wxPoint ref, start, end;
2009-01-02 13:19:34 +00:00
for( unsigned ii = 1; ii < GetCornerCount(); ii++ )
2009-01-02 13:19:34 +00:00
{
start = TransformCoordinate( aTransMat, m_PolyPoints[ii-1] );
end = TransformCoordinate( aTransMat, m_PolyPoints[ii] );
2009-01-02 17:07:50 +00:00
ref = aPosRef - start;
end -= start;
2009-01-02 13:19:34 +00:00
2009-01-02 17:07:50 +00:00
if( distance( end.x, end.y, ref.x, ref.y, aThreshold ) )
return true;
2009-01-02 13:19:34 +00:00
}
return false;
}
2009-01-02 17:07:50 +00:00
2009-01-02 13:19:34 +00:00
/** Function GetBoundaryBox
* @return the boundary box for this, in library coordinates
*/
2009-01-02 17:07:50 +00:00
EDA_Rect LibDrawPolyline::GetBoundaryBox()
2009-01-02 13:19:34 +00:00
{
2009-01-02 17:07:50 +00:00
EDA_Rect BoundaryBox;
int xmin, xmax, ymin, ymax;
2009-01-02 13:19:34 +00:00
xmin = xmax = m_PolyPoints[0].x;
ymin = ymax = m_PolyPoints[0].y;
for( unsigned ii = 1; ii < GetCornerCount(); ii++ )
{
xmin = MIN( xmin, m_PolyPoints[ii].x );
xmax = MAX( xmax, m_PolyPoints[ii].x );
ymin = MIN( ymin, m_PolyPoints[ii].y );
ymax = MAX( ymax, m_PolyPoints[ii].y );
2009-01-02 13:19:34 +00:00
}
2009-01-02 17:07:50 +00:00
2009-01-02 13:19:34 +00:00
BoundaryBox.SetX( xmin ); BoundaryBox.SetWidth( xmax - xmin );
BoundaryBox.SetY( ymin ); BoundaryBox.SetHeight( ymax - ymin );
BoundaryBox.Inflate(m_Width, m_Width);
2009-01-02 13:19:34 +00:00
return BoundaryBox;
}