More EDA_ANGLE changes.

This commit is contained in:
Jeff Young 2022-01-13 23:30:52 +00:00
parent 037dfb6e01
commit 1b19ff5f42
31 changed files with 170 additions and 218 deletions

View File

@ -75,7 +75,7 @@ ARRAY_OPTIONS::TRANSFORM ARRAY_GRID_OPTIONS::GetTransform( int n, const VECTOR2I
}
// this is already relative to the first array entry
return { point, 0.0 };
return { point, ANGLE_0 };
}
@ -107,23 +107,23 @@ int ARRAY_CIRCULAR_OPTIONS::GetArraySize() const
ARRAY_OPTIONS::TRANSFORM ARRAY_CIRCULAR_OPTIONS::GetTransform( int n, const VECTOR2I& aPos ) const
{
double angle;
EDA_ANGLE angle;
if( m_angle == 0 )
if( m_angle.IsZero() )
// angle is zero, divide evenly into m_nPts
angle = 10 * 360.0 * n / double( m_nPts );
angle = EDA_ANGLE( 360.0 * n / double( m_nPts ), DEGREES_T );
else
// n'th step
angle = m_angle * n;
angle = EDA_ANGLE( m_angle.AsDegrees() * n, DEGREES_T );
VECTOR2I new_pos = aPos;
RotatePoint( new_pos, m_centre, angle );
// take off the rotation (but not the translation) if needed
if( !m_rotateItems )
angle = 0;
angle = ANGLE_0;
return { new_pos - aPos, angle / 10.0 };
return { new_pos - aPos, angle };
}

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 1992-2013 Jean-Pierre Charras <jp.charras at wanadoo.fr>.
* Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -596,7 +596,7 @@ void DS_DATA_ITEM_TEXT::SyncDrawItems( DS_DRAW_ITEM_LIST* aCollector, KIGFX::VIE
text->SetHorizJustify( m_Hjustify ) ;
text->SetVertJustify( m_Vjustify );
text->SetTextAngle( m_Orient * 10 ); // graphic text orient unit = 0.1 degree
text->SetTextAngle( EDA_ANGLE( m_Orient, DEGREES_T ) );
text->SetMultilineAllowed( multilines );
// Increment label for the next text (has no meaning for multiline texts)
@ -697,7 +697,7 @@ void DS_DATA_ITEM_TEXT::SetConstrainedTextSize()
dummy.SetMultilineAllowed( true );
dummy.SetHorizJustify( m_Hjustify ) ;
dummy.SetVertJustify( m_Vjustify );
dummy.SetTextAngle( m_Orient * 10 );
dummy.SetTextAngle( EDA_ANGLE( m_Orient, DEGREES_T ) );
EDA_RECT rect = dummy.GetTextBox();
DSIZE size;

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 1992-2013 Jean-Pierre Charras <jp.charras at wanadoo.fr>.
* Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors.
*
*
* This program is free software; you can redistribute it and/or
@ -189,11 +189,6 @@ wxString DS_DRAW_ITEM_TEXT::GetSelectMenuText( EDA_UNITS aUnits ) const
}
void DS_DRAW_ITEM_TEXT::SetTextAngle( double aAngle )
{
EDA_TEXT::SetTextAngle( NormalizeAngle360Min( aAngle ) );
}
// ============================ POLYGON =================================
void DS_DRAW_ITEM_POLYPOLYGONS::PrintWsItem( const RENDER_SETTINGS* aSettings,

View File

@ -250,7 +250,7 @@ void LIB_TEXT::Rotate( const VECTOR2I& center, bool aRotateCCW )
else if( GetVertJustify() == GR_TEXT_V_ALIGN_BOTTOM )
SetVertJustify( GR_TEXT_V_ALIGN_TOP );
SetTextAngle( 0 );
SetTextAngle( ANGLE_0 );
}
NormalizeJustification( true );

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2020-2021 Roberto Fernandez Bautista <roberto.fer.bau@gmail.com>
* Copyright (C) 2020-2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2020-2022 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@ -2622,7 +2622,7 @@ void CADSTAR_SCH_ARCHIVE_LOADER::applyTextSettings( EDA_TEXT* aKiCadT
aKiCadTextItem->SetTextWidth( textWidth );
aKiCadTextItem->SetTextHeight( textHeight );
aKiCadTextItem->SetTextThickness( getKiCadLength( textCode.LineWidth ) );
aKiCadTextItem->SetTextAngle( getAngleTenthDegree( aCadstarOrientAngle ) );
aKiCadTextItem->SetTextAngle( EDA_ANGLE( getAngleDegrees( aCadstarOrientAngle ), DEGREES_T ) );
aKiCadTextItem->SetBold( textCode.Font.Modifier1 == FONT_BOLD );
aKiCadTextItem->SetItalic( textCode.Font.Italic );
@ -2704,30 +2704,32 @@ void CADSTAR_SCH_ARCHIVE_LOADER::applyTextSettings( EDA_TEXT* aKiCadT
{
// Spin style not used. All text justifications are permitted. However, only orientations
// of 0 deg or 90 deg are supported
double angleDeciDeg = NormalizeAnglePos( aKiCadTextItem->GetTextAngle().AsTenthsOfADegree() );
int quadrant = KiROUND( angleDeciDeg / 900.0 );
EDA_ANGLE angle = aKiCadTextItem->GetTextAngle();
angle.Normalize();
int quadrant = KiROUND( angle.AsDegrees() / 90.0 );
quadrant %= 4;
switch( quadrant )
{
case 0:
angleDeciDeg = 0;
angle = ANGLE_HORIZONTAL;
break;
case 1:
angleDeciDeg = 900;
angle = ANGLE_VERTICAL;
break;
case 2:
angleDeciDeg = 0;
angle = ANGLE_HORIZONTAL;
textAlignment = rotate180( textAlignment );
break;
case 3:
angleDeciDeg = 900;
angle = ANGLE_VERTICAL;
textAlignment = rotate180( textAlignment );
break;
default: wxFAIL_MSG( "Unknown Quadrant" );
}
aKiCadTextItem->SetTextAngle( angleDeciDeg );
aKiCadTextItem->SetTextAngle( angle );
setAlignment( aKiCadTextItem, textAlignment );
return;
}

View File

@ -255,13 +255,13 @@ static void eagleToKicadAlignment( EDA_TEXT* aText, int aEagleAlignment, int aRe
if( aRelDegress == 90 )
{
aText->SetTextAngle( 900 );
aText->SetTextAngle( ANGLE_VERTICAL );
}
else if( aRelDegress == 180 )
align = -align;
else if( aRelDegress == 270 )
{
aText->SetTextAngle( 900 );
aText->SetTextAngle( ANGLE_VERTICAL );
align = -align;
}

View File

@ -764,7 +764,7 @@ LIB_FIELD* SCH_SEXPR_PARSER::parseProperty( std::unique_ptr<LIB_SYMBOL>& aSymbol
case T_at:
field->SetPosition( parseXY() );
field->SetTextAngle( static_cast<int>( parseDouble( "text angle" ) * 10.0 ) );
field->SetTextAngle( EDA_ANGLE( parseDouble( "text angle" ), DEGREES_T ) );
NeedRIGHT();
break;
@ -1496,7 +1496,8 @@ LIB_TEXT* SCH_SEXPR_PARSER::parseText()
{
case T_at:
text->SetPosition( parseXY() );
text->SetTextAngle( parseDouble( "text angle" ) );
// Yes, LIB_TEXT is really decidegrees even though all the others are degrees. :(
text->SetTextAngle( EDA_ANGLE( parseDouble( "text angle" ), TENTHS_OF_A_DEGREE_T ) );
NeedRIGHT();
break;
@ -1723,7 +1724,7 @@ SCH_FIELD* SCH_SEXPR_PARSER::parseSchField( SCH_ITEM* aParent )
case T_at:
field->SetPosition( parseXY() );
field->SetTextAngle( static_cast<int>( parseDouble( "text angle" ) * 10.0 ) );
field->SetTextAngle( EDA_ANGLE( parseDouble( "text angle" ), DEGREES_T ) );
NeedRIGHT();
break;

View File

@ -1421,17 +1421,6 @@ void SCH_SEXPR_PLUGIN::saveText( SCH_TEXT* aText, int aNestLevel )
{
wxCHECK_RET( aText != nullptr && m_out != nullptr, "" );
double angle;
switch( aText->GetLabelSpinStyle() )
{
case LABEL_SPIN_STYLE::RIGHT: angle = 0.0; break;
case LABEL_SPIN_STYLE::UP: angle = 90.0; break;
case LABEL_SPIN_STYLE::LEFT: angle = 180.0; break;
case LABEL_SPIN_STYLE::BOTTOM: angle = 270.0; break;
default: wxFAIL; angle = 0.0; break;
}
m_out->Print( aNestLevel, "(%s %s",
getTextTypeToken( aText->Type() ),
m_out->Quotew( aText->GetText() ).c_str() );
@ -1456,7 +1445,7 @@ void SCH_SEXPR_PLUGIN::saveText( SCH_TEXT* aText, int aNestLevel )
m_out->Print( 0, " (at %s %s %s)",
FormatInternalUnits( aText->GetPosition().x ).c_str(),
FormatInternalUnits( aText->GetPosition().y ).c_str(),
FormatAngle( angle * 10.0 ).c_str() );
FormatAngle( aText->GetTextAngle().AsTenthsOfADegree() ).c_str() );
}
else
{

View File

@ -3386,8 +3386,9 @@ LIB_TEXT* SCH_LEGACY_PLUGIN_CACHE::loadText( std::unique_ptr<LIB_SYMBOL>& aSymbo
wxCHECK_MSG( strCompare( "T", line, &line ), nullptr, "Invalid LIB_TEXT definition" );
LIB_TEXT* text = new LIB_TEXT( aSymbol.get() );
double angleInTenths = parseInt( aReader, line, &line );
text->SetTextAngle( (double) parseInt( aReader, line, &line ) );
text->SetTextAngle( EDA_ANGLE( angleInTenths, TENTHS_OF_A_DEGREE_T ) );
VECTOR2I center;

View File

@ -25,7 +25,7 @@
#define PCBNEW_ARRAY_OPTIONS__H
#include <math/vector2d.h>
#include <eda_angle.h>
#include <array_axis.h>
/**
@ -57,8 +57,8 @@ public:
*/
struct TRANSFORM
{
VECTOR2I m_offset;
double m_rotation; // in degrees
VECTOR2I m_offset;
EDA_ANGLE m_rotation;
};
/**
@ -177,7 +177,7 @@ struct ARRAY_CIRCULAR_OPTIONS : public ARRAY_OPTIONS
ARRAY_CIRCULAR_OPTIONS()
: ARRAY_OPTIONS( ARRAY_CIRCULAR ),
m_nPts( 0 ),
m_angle( 0.0f ),
m_angle( ANGLE_0 ),
m_rotateItems( false )
{
}
@ -185,7 +185,7 @@ struct ARRAY_CIRCULAR_OPTIONS : public ARRAY_OPTIONS
/// number of point in the array
long m_nPts;
/// angle between points, or 0 for each point separated by this value (decideg)
double m_angle;
EDA_ANGLE m_angle;
VECTOR2I m_centre;
bool m_rotateItems;
ARRAY_AXIS m_axis;

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013-2014 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -318,8 +318,6 @@ public:
void PrintWsItem( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) override;
void SetTextAngle( double aAngle ) override;
VECTOR2I GetPosition() const override { return GetTextPos(); }
void SetPosition( const VECTOR2I& aPos ) override { SetTextPos( aPos ); }

View File

@ -119,14 +119,6 @@ public:
*/
int GetEffectiveTextPenWidth( int aDefaultWidth = 0 ) const;
virtual void SetTextAngle( double aAngleInTenthsOfADegree )
{
// Higher level classes may be more restrictive than this by overloading
// SetTextAngle() or merely calling EDA_TEXT::SetTextAngle() after clamping
// aAngle before calling this lowest inline accessor.
SetTextAngle( EDA_ANGLE( aAngleInTenthsOfADegree, TENTHS_OF_A_DEGREE_T ) );
}
virtual void SetTextAngle( const EDA_ANGLE& aAngle );
const EDA_ANGLE& GetTextAngle() const { return m_attributes.m_Angle; }

View File

@ -45,7 +45,7 @@ static void TransformItem( const ARRAY_OPTIONS& aArrOpts, int aIndex, BOARD_ITEM
const ARRAY_OPTIONS::TRANSFORM transform = aArrOpts.GetTransform( aIndex, aItem.GetPosition() );
aItem.Move( (wxPoint) transform.m_offset );
aItem.Rotate( aItem.GetPosition(), EDA_ANGLE( transform.m_rotation, DEGREES_T ) );
aItem.Rotate( aItem.GetPosition(), transform.m_rotation );
}

View File

@ -333,8 +333,8 @@ bool DIALOG_CREATE_ARRAY::TransferDataFromWindow()
bool ok = true;
// ints
ok = ok && validateLongEntry(*m_entryNx, newGrid->m_nx, _("horizontal count"), errors);
ok = ok && validateLongEntry(*m_entryNy, newGrid->m_ny, _("vertical count"), errors);
ok &= validateLongEntry(*m_entryNx, newGrid->m_nx, _("horizontal count"), errors);
ok &= validateLongEntry(*m_entryNy, newGrid->m_ny, _("vertical count"), errors);
newGrid->m_delta.x = m_hSpacing.GetValue();
newGrid->m_delta.y = m_vSpacing.GetValue();
@ -342,7 +342,7 @@ bool DIALOG_CREATE_ARRAY::TransferDataFromWindow()
newGrid->m_offset.x = m_hOffset.GetValue();
newGrid->m_offset.y = m_vOffset.GetValue();
ok = ok && validateLongEntry(*m_entryStagger, newGrid->m_stagger, _("stagger"), errors);
ok &= validateLongEntry(*m_entryStagger, newGrid->m_stagger, _("stagger"), errors);
newGrid->m_stagger_rows = m_radioBoxGridStaggerType->GetSelection() == 0;
@ -361,18 +361,19 @@ bool DIALOG_CREATE_ARRAY::TransferDataFromWindow()
// validate from the input fields
bool numOk = validateAxisOptions( *m_entryGridPriNumberingOffset,
*m_choicePriAxisNumbering, *m_entryGridPriNumberingStep,
newGrid->m_pri_axis, errors );
*m_choicePriAxisNumbering,
*m_entryGridPriNumberingStep,
newGrid->m_pri_axis, errors );
if( newGrid->m_2dArrayNumbering )
{
numOk = validateAxisOptions( *m_entryGridSecNumberingOffset,
*m_choiceSecAxisNumbering, *m_entryGridSecNumberingStep,
newGrid->m_sec_axis, errors )
&& numOk;
numOk &= validateAxisOptions( *m_entryGridSecNumberingOffset,
*m_choiceSecAxisNumbering,
*m_entryGridSecNumberingStep,
newGrid->m_sec_axis, errors );
}
ok = ok && numOk;
ok &= numOk;
}
else
{
@ -389,15 +390,15 @@ bool DIALOG_CREATE_ARRAY::TransferDataFromWindow()
}
else if( page == m_circularPanel )
{
auto newCirc = std::make_unique<ARRAY_CIRCULAR_OPTIONS>();
bool ok = true;
auto newCirc = std::make_unique<ARRAY_CIRCULAR_OPTIONS>();
bool ok = true;
double angle = DoubleValueFromString( EDA_UNITS::UNSCALED, m_entryCircAngle->GetValue() );
newCirc->m_centre.x = m_hCentre.GetValue();
newCirc->m_centre.y = m_vCentre.GetValue();
newCirc->m_angle = DoubleValueFromString( EDA_UNITS::DEGREES,
m_entryCircAngle->GetValue() );
newCirc->m_angle = EDA_ANGLE( angle, DEGREES_T );
ok = ok && validateLongEntry(*m_entryCircCount, newCirc->m_nPts, _("point count"), errors);
ok = validateLongEntry(*m_entryCircCount, newCirc->m_nPts, _("point count"), errors);
newCirc->m_rotateItems = m_entryRotateItemsCb->GetValue();
newCirc->SetShouldNumber( m_isFootprintEditor );
@ -408,9 +409,8 @@ bool DIALOG_CREATE_ARRAY::TransferDataFromWindow()
if( newCirc->GetNumberingStartIsSpecified() )
{
ok = ok
&& validateAxisOptions( *m_entryCircNumberingStart, *m_choiceCircNumbering,
*m_entryCircNumberingStep, newCirc->m_axis, errors );
ok &= validateAxisOptions( *m_entryCircNumberingStart, *m_choiceCircNumbering,
*m_entryCircNumberingStep, newCirc->m_axis, errors );
}
else
{

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2020 Jon Evans <jon@craftyjon.com>
* Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2020-2022 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@ -417,7 +417,7 @@ void DIALOG_DIMENSION_PROPERTIES::updateDimensionFromDialog( PCB_DIMENSION_BASE*
aTarget->SetKeepTextAligned( m_cbKeepAligned->GetValue() );
text.SetTextAngle( m_orientation.GetDoubleValue() );
text.SetTextAngle( EDA_ANGLE( m_orientation.GetDoubleValue(), TENTHS_OF_A_DEGREE_T ) );
text.SetTextWidth( m_textWidth.GetValue() );
text.SetTextHeight( m_textHeight.GetValue() );
text.SetTextThickness( m_textThickness.GetValue() );

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2004-2018 Jean-Pierre Charras jp.charras at wanadoo.fr
* Copyright (C) 2010-2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2010-2022 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -419,7 +419,7 @@ bool DIALOG_TEXT_PROPERTIES::TransferDataFromWindow()
m_edaText->SetTextThickness( maxPenWidth );
}
m_edaText->SetTextAngle( m_orientation.GetDoubleValue() );
m_edaText->SetTextAngle( EDA_ANGLE( m_orientation.GetDoubleValue(), TENTHS_OF_A_DEGREE_T ) );
m_edaText->SetVisible( m_Visible->GetValue() );

View File

@ -72,18 +72,6 @@ FP_TEXT::~FP_TEXT()
}
void FP_TEXT::SetTextAngle( double aAngle )
{
EDA_TEXT::SetTextAngle( NormalizeAngle360Min( aAngle ) );
}
void FP_TEXT::SetTextAngle( const EDA_ANGLE& aAngle )
{
EDA_TEXT::SetTextAngle( aAngle );
}
bool FP_TEXT::TextHitTest( const VECTOR2I& aPoint, int aAccuracy ) const
{
EDA_RECT rect = GetTextBox();

View File

@ -284,7 +284,8 @@ void FP_TEXT_GRID_TABLE::SetValue( int aRow, int aCol, const wxString &aValue )
break;
case FPT_ORIENTATION:
text.SetTextAngle( DoubleValueFromString( EDA_UNITS::DEGREES, aValue ) );
text.SetTextAngle( EDA_ANGLE( DoubleValueFromString( EDA_UNITS::UNSCALED, aValue ),
DEGREES_T ) );
text.SetDrawCoord();
break;

View File

@ -3,7 +3,7 @@
*
* Copyright (C) 2016 CERN
* @author Maciej Suminski <maciej.suminski@cern.ch>
* Copyright (C) 2018 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2018-2022 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -155,7 +155,7 @@ void GRAPHICS_IMPORTER_PCBNEW::AddText( const VECTOR2D& aOrigin, const wxString&
boardItem->SetLayer( GetLayer() );
textItem->SetTextThickness( MapLineWidth( aThickness ) );
textItem->SetTextPos( MapCoordinate( aOrigin ) );
textItem->SetTextAngle( aOrientation * 10.0 ); // Pcbnew uses the decidegree
textItem->SetTextAngle( EDA_ANGLE( aOrientation, DEGREES_T ) ); // Pcbnew uses the decidegree
textItem->SetTextWidth( aWidth * ImportScalingFactor() );
textItem->SetTextHeight( aHeight * ImportScalingFactor() );
textItem->SetVertJustify( aVJustify );

View File

@ -679,12 +679,11 @@ void PCB_DIM_ALIGNED::updateText()
if( m_keepTextAligned )
{
double textAngle = 3600 - RAD2DECIDEG( crossbarCenter.Angle() );
EDA_ANGLE textAngle = FULL_CIRCLE - EDA_ANGLE( crossbarCenter.Angle(), RADIANS_T );
textAngle.Normalize();
NORMALIZE_ANGLE_POS( textAngle );
if( textAngle > 900 && textAngle <= 2700 )
textAngle -= 1800;
if( textAngle > ANGLE_90 && textAngle <= ANGLE_270 )
textAngle -= ANGLE_180;
m_text.SetTextAngle( textAngle );
}
@ -859,14 +858,10 @@ void PCB_DIM_ORTHOGONAL::updateText()
if( m_keepTextAligned )
{
double textAngle;
if( abs( crossbarCenter.x ) > abs( crossbarCenter.y ) )
textAngle = 0;
m_text.SetTextAngle( ANGLE_HORIZONTAL );
else
textAngle = 900;
m_text.SetTextAngle( textAngle );
m_text.SetTextAngle( ANGLE_VERTICAL );
}
PCB_DIMENSION_BASE::updateText();
@ -1124,16 +1119,18 @@ void PCB_DIM_RADIAL::updateText()
{
if( m_keepTextAligned )
{
VECTOR2I textLine( Text().GetPosition() - GetKnee() );
double textAngle = 3600 - RAD2DECIDEG( textLine.Angle() );
VECTOR2I textLine( Text().GetPosition() - GetKnee() );
EDA_ANGLE textAngle = FULL_CIRCLE - EDA_ANGLE( textLine.Angle(), RADIANS_T );
NORMALIZE_ANGLE_POS( textAngle );
textAngle.Normalize();
if( textAngle > 900 && textAngle <= 2700 )
textAngle -= 1800;
if( textAngle > ANGLE_90 && textAngle <= ANGLE_270 )
textAngle -= ANGLE_180;
// Round to nearest degree
m_text.SetTextAngle( KiROUND( textAngle / 10 ) * 10 );
textAngle = EDA_ANGLE( KiROUND( textAngle.AsDegrees() ), DEGREES_T );
m_text.SetTextAngle( textAngle );
}
PCB_DIMENSION_BASE::updateText();

View File

@ -103,18 +103,6 @@ wxString PCB_TEXT::GetShownText( int aDepth ) const
}
void PCB_TEXT::SetTextAngle( double aAngle )
{
EDA_TEXT::SetTextAngle( NormalizeAngle360Min( aAngle ) );
}
void PCB_TEXT::SetTextAngle( const EDA_ANGLE& aAngle )
{
EDA_TEXT::SetTextAngle( aAngle );
}
void PCB_TEXT::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
{
EDA_UNITS units = aFrame->GetUserUnits();
@ -187,7 +175,7 @@ void PCB_TEXT::Flip( const VECTOR2I& aCentre, bool aFlipLeftRight )
else
{
SetTextY( MIRRORVAL( GetTextPos().y, aCentre.y ) );
SetTextAngle( 1800 - GetTextAngle().AsTenthsOfADegree() );
SetTextAngle( ANGLE_180 - GetTextAngle() );
}
SetLayer( FlipLayer( GetLayer(), GetBoard()->GetCopperLayerCount() ) );

View File

@ -88,9 +88,6 @@ public:
EDA_TEXT::Offset( aMoveVector );
}
void SetTextAngle( double aAngle ) override;
void SetTextAngle( const EDA_ANGLE& aAngle );
void Rotate( const VECTOR2I& aRotCentre, const EDA_ANGLE& aAngle ) override;
void Flip( const VECTOR2I& aCentre, bool aFlipLeftRight ) override;

View File

@ -2713,7 +2713,7 @@ void ALTIUM_PCB::ParseTexts6Data( const CFB::CompoundFileReader& aReader,
}
itm->SetPosition( elem.position );
tx->SetTextAngle( elem.rotation * 10. );
tx->SetTextAngle( EDA_ANGLE( elem.rotation, DEGREES_T ) );
if( elem.component != ALTIUM_COMPONENT_NONE )
{

View File

@ -2513,8 +2513,9 @@ void CADSTAR_PCB_ARCHIVE_LOADER::drawCadstarText(
aContainer->Add( txt );
txt->SetText( aCadstarText.Text );
VECTOR2I rotatedTextPos = getKiCadPoint( aCadstarText.Position );
RotatePoint( rotatedTextPos, aTransformCentre, aRotationAngle );
EDA_ANGLE rotationAngle( aRotationAngle, TENTHS_OF_A_DEGREE_T );
VECTOR2I rotatedTextPos = getKiCadPoint( aCadstarText.Position );
RotatePoint( rotatedTextPos, aTransformCentre, rotationAngle );
rotatedTextPos.x =
KiROUND( (double) ( rotatedTextPos.x - aTransformCentre.x ) * aScalingFactor );
rotatedTextPos.y =
@ -2523,7 +2524,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::drawCadstarText(
txt->SetTextPos( rotatedTextPos );
txt->SetPosition( rotatedTextPos );
txt->SetTextAngle( getAngleTenthDegree( aCadstarText.OrientAngle ) + aRotationAngle );
txt->SetTextAngle( getAngle( aCadstarText.OrientAngle ) + rotationAngle );
txt->SetMirrored( aCadstarText.Mirror );

View File

@ -768,7 +768,7 @@ void EAGLE_PLUGIN::loadPlain( wxXmlNode* aGraphics )
if( degrees == 90 || t.rot->spin )
{
pcbtxt->SetTextAngle( sign * t.rot->degrees * 10 );
pcbtxt->SetTextAngle( EDA_ANGLE( sign * t.rot->degrees, DEGREES_T ) );
}
else if( degrees == 180 )
{
@ -776,7 +776,7 @@ void EAGLE_PLUGIN::loadPlain( wxXmlNode* aGraphics )
}
else if( degrees == 270 )
{
pcbtxt->SetTextAngle( sign * 90 * 10 );
pcbtxt->SetTextAngle( EDA_ANGLE( sign * 90, DEGREES_T ) );
align = -align;
}
else
@ -785,21 +785,21 @@ void EAGLE_PLUGIN::loadPlain( wxXmlNode* aGraphics )
// placement right.
if( ( degrees > 0 ) && ( degrees < 90 ) )
{
pcbtxt->SetTextAngle( sign * t.rot->degrees * 10 );
pcbtxt->SetTextAngle( EDA_ANGLE( sign * t.rot->degrees, DEGREES_T ) );
}
else if( ( degrees > 90 ) && ( degrees < 180 ) )
{
pcbtxt->SetTextAngle( sign * ( t.rot->degrees + 180 ) * 10 );
pcbtxt->SetTextAngle( EDA_ANGLE( sign * ( t.rot->degrees + 180 ), DEGREES_T ) );
align = ETEXT::TOP_RIGHT;
}
else if( ( degrees > 180 ) && ( degrees < 270 ) )
{
pcbtxt->SetTextAngle( sign * ( t.rot->degrees - 180 ) * 10 );
pcbtxt->SetTextAngle( EDA_ANGLE( sign * ( t.rot->degrees - 180 ), DEGREES_T ) );
align = ETEXT::TOP_RIGHT;
}
else if( ( degrees > 270 ) && ( degrees < 360 ) )
{
pcbtxt->SetTextAngle( sign * t.rot->degrees * 10 );
pcbtxt->SetTextAngle( EDA_ANGLE( sign * t.rot->degrees, DEGREES_T ) );
align = ETEXT::BOTTOM_LEFT;
}
}
@ -1607,24 +1607,24 @@ void EAGLE_PLUGIN::orientFPText( FOOTPRINT* aFootprint, const EELEMENT& e, FP_TE
if( degrees == 90 || degrees == 0 || spin )
{
orient = degrees - aFootprint->GetOrientation().AsDegrees();
aFPText->SetTextAngle( sign * orient * 10 );
aFPText->SetTextAngle( EDA_ANGLE( sign * orient, DEGREES_T ) );
}
else if( degrees == 180 )
{
orient = 0 - aFootprint->GetOrientation().AsDegrees();
aFPText->SetTextAngle( sign * orient * 10 );
aFPText->SetTextAngle( EDA_ANGLE( sign * orient, DEGREES_T ) );
align = -align;
}
else if( degrees == 270 )
{
orient = 90 - aFootprint->GetOrientation().AsDegrees();
align = -align;
aFPText->SetTextAngle( sign * orient * 10 );
aFPText->SetTextAngle( EDA_ANGLE( sign * orient, DEGREES_T ) );
}
else
{
orient = 90 - degrees - aFootprint->GetOrientation().AsDegrees();
aFPText->SetTextAngle( sign * orient * 10 );
aFPText->SetTextAngle( EDA_ANGLE( sign * orient, DEGREES_T ) );
}
switch( align )
@ -1966,7 +1966,7 @@ void EAGLE_PLUGIN::packageText( FOOTPRINT* aFootprint, wxXmlNode* aTree ) const
if( degrees == 90 || t.rot->spin )
{
txt->SetTextAngle( sign * degrees * 10 );
txt->SetTextAngle( EDA_ANGLE( sign * degrees, DEGREES_T ) );
}
else if( degrees == 180 )
{
@ -1975,7 +1975,7 @@ void EAGLE_PLUGIN::packageText( FOOTPRINT* aFootprint, wxXmlNode* aTree ) const
else if( degrees == 270 )
{
align = ETEXT::TOP_RIGHT;
txt->SetTextAngle( sign * 90 * 10 );
txt->SetTextAngle( EDA_ANGLE( sign * 90, DEGREES_T ) );
}
}

View File

@ -393,7 +393,7 @@ FOOTPRINT* GPCB_FPL_CACHE::parseFOOTPRINT( LINE_READER* aLineReader )
}
int orientation = parseInt( parameters[paramCnt-4], 1.0 );
footprint->Reference().SetTextAngle(( orientation % 2) ? 900 : 0 );
footprint->Reference().SetTextAngle( ( orientation % 2) ? ANGLE_VERTICAL : ANGLE_HORIZONTAL );
// Calculate size: default height is 40 mils, width 30 mil.
// real size is: default * ibuf[idx+3] / 100 (size in gpcb is given in percent of default size

View File

@ -2831,7 +2831,7 @@ PCB_TEXT* PCB_PARSER::parsePCB_TEXT()
if( token == T_NUMBER )
{
text->SetTextAngle( parseAngle() );
text->SetTextAngle( EDA_ANGLE( parseAngle(), TENTHS_OF_A_DEGREE_T ) );
NeedRIGHT();
}
else if( token != T_RIGHT )
@ -3735,7 +3735,7 @@ FP_TEXT* PCB_PARSER::parseFP_TEXT()
if( CurTok() == T_NUMBER )
{
text->SetTextAngle( parseAngle() );
text->SetTextAngle( EDA_ANGLE( parseAngle(), TENTHS_OF_A_DEGREE_T ) );
NextTok();
}

View File

@ -2007,14 +2007,15 @@ void LEGACY_PLUGIN::loadPCB_TEXT()
}
else if( TESTLINE( "Po" ) )
{
wxSize size;
wxSize size;
BIU pos_x = biuParse( line + SZ( "Po" ), &data );
BIU pos_y = biuParse( data, &data );
BIU pos_x = biuParse( line + SZ( "Po" ), &data );
BIU pos_y = biuParse( data, &data );
size.x = biuParse( data, &data );
size.y = biuParse( data, &data );
BIU thickn = biuParse( data, &data );
double angle = degParse( data );
size.x = biuParse( data, &data );
size.y = biuParse( data, &data );
BIU thickn = biuParse( data, &data );
EDA_ANGLE angle = EDA_ANGLE( degParse( data ), TENTHS_OF_A_DEGREE_T );
pcbtxt->SetTextSize( size );
pcbtxt->SetTextThickness( thickn );
@ -2642,13 +2643,13 @@ void LEGACY_PLUGIN::loadDIMENSION()
}
else if( TESTLINE( "Po" ) )
{
BIU pos_x = biuParse( line + SZ( "Po" ), &data );
BIU pos_y = biuParse( data, &data );
BIU width = biuParse( data, &data );
BIU height = biuParse( data, &data );
BIU thickn = biuParse( data, &data );
double orient = degParse( data, &data );
char* mirror = strtok_r( (char*) data, delims, (char**) &data );
BIU pos_x = biuParse( line + SZ( "Po" ), &data );
BIU pos_y = biuParse( data, &data );
BIU width = biuParse( data, &data );
BIU height = biuParse( data, &data );
BIU thickn = biuParse( data, &data );
EDA_ANGLE orient = EDA_ANGLE( degParse( data, &data ), TENTHS_OF_A_DEGREE_T );
char* mirror = strtok_r( (char*) data, delims, (char**) &data );
dim->Text().SetTextPos( VECTOR2I( pos_x, pos_y ) );
dim->Text().SetTextSize( wxSize( width, height ) );

View File

@ -530,7 +530,7 @@ void PCB_FOOTPRINT::AddToBoard()
SetTextSizeFromStrokeFontHeight( ref_text, m_name.textHeight );
r = m_name.textRotation - m_rotation;
ref_text->SetTextAngle( r );
ref_text->SetTextAngle( EDA_ANGLE( r, TENTHS_OF_A_DEGREE_T ) );
ref_text->SetKeepUpright( false );
ref_text->SetItalic( m_name.isItalic );
@ -558,7 +558,7 @@ void PCB_FOOTPRINT::AddToBoard()
SetTextSizeFromStrokeFontHeight( val_text, m_Value.textHeight );
r = m_Value.textRotation - m_rotation;
val_text->SetTextAngle( r );
val_text->SetTextAngle( EDA_ANGLE( r, TENTHS_OF_A_DEGREE_T ) );
val_text->SetKeepUpright( false );
val_text->SetItalic( m_Value.isItalic );

View File

@ -122,9 +122,9 @@ void PCB_TEXT::AddToBoard()
pcbtxt->SetMirrored( m_name.mirror );
if( pcbtxt->IsMirrored() )
pcbtxt->SetTextAngle( 3600.0 - m_name.textRotation );
pcbtxt->SetTextAngle( ANGLE_360 - EDA_ANGLE( m_name.textRotation, TENTHS_OF_A_DEGREE_T ) );
else
pcbtxt->SetTextAngle( m_name.textRotation );
pcbtxt->SetTextAngle( EDA_ANGLE( m_name.textRotation, TENTHS_OF_A_DEGREE_T ) );
pcbtxt->SetLayer( m_KiCadLayer );
}

View File

@ -41,7 +41,7 @@
*/
std::ostream& operator<<( std::ostream& os, const ARRAY_OPTIONS::TRANSFORM& aObj )
{
os << "TRANSFORM[ " << aObj.m_offset << " r " << aObj.m_rotation << "deg"
os << "TRANSFORM[ " << aObj.m_offset << " r " << aObj.m_rotation.AsDegrees() << "deg"
<< " ]";
return os;
}
@ -53,7 +53,8 @@ std::ostream& operator<<( std::ostream& os, const ARRAY_OPTIONS::TRANSFORM& aObj
bool TransformIsClose( const ARRAY_OPTIONS::TRANSFORM& aL, const ARRAY_OPTIONS::TRANSFORM& aR )
{
return KI_TEST::IsVecWithinTol<VECTOR2I>( aL.m_offset, aR.m_offset, 1 )
&& KI_TEST::IsWithin<double>( aL.m_rotation, aR.m_rotation, 0.001 );
&& KI_TEST::IsWithin<double>( aL.m_rotation.AsDegrees(),
aR.m_rotation.AsDegrees(), 0.001 );
}
@ -129,12 +130,12 @@ static const std::vector<GRID_ARRAY_TEST_CASE> grid_geom_cases = {
},
{ 0, 0 },
{
{ { Millimeter2iu( 0 ), Millimeter2iu( 0 ) }, 0 },
{ { Millimeter2iu( 2 ), Millimeter2iu( 0 ) }, 0 },
{ { Millimeter2iu( 0 ), Millimeter2iu( 2 ) }, 0 },
{ { Millimeter2iu( 2 ), Millimeter2iu( 2 ) }, 0 },
{ { Millimeter2iu( 0 ), Millimeter2iu( 4 ) }, 0 },
{ { Millimeter2iu( 2 ), Millimeter2iu( 4 ) }, 0 },
{ { Millimeter2iu( 0 ), Millimeter2iu( 0 ) }, ANGLE_0 },
{ { Millimeter2iu( 2 ), Millimeter2iu( 0 ) }, ANGLE_0 },
{ { Millimeter2iu( 0 ), Millimeter2iu( 2 ) }, ANGLE_0 },
{ { Millimeter2iu( 2 ), Millimeter2iu( 2 ) }, ANGLE_0 },
{ { Millimeter2iu( 0 ), Millimeter2iu( 4 ) }, ANGLE_0 },
{ { Millimeter2iu( 2 ), Millimeter2iu( 4 ) }, ANGLE_0 },
},
},
{
@ -152,12 +153,12 @@ static const std::vector<GRID_ARRAY_TEST_CASE> grid_geom_cases = {
{ 0, 0 },
{
// add the offsets for each positions
{ { Millimeter2iu( 0 ), Millimeter2iu( 0 ) }, 0 },
{ { Millimeter2iu( 2 ), Millimeter2iu( 0.2 ) }, 0 },
{ { Millimeter2iu( 0.1 ), Millimeter2iu( 2 ) }, 0 },
{ { Millimeter2iu( 2.1 ), Millimeter2iu( 2.2 ) }, 0 },
{ { Millimeter2iu( 0.2 ), Millimeter2iu( 4.0 ) }, 0 },
{ { Millimeter2iu( 2.2 ), Millimeter2iu( 4.2 ) }, 0 },
{ { Millimeter2iu( 0 ), Millimeter2iu( 0 ) }, ANGLE_0 },
{ { Millimeter2iu( 2 ), Millimeter2iu( 0.2 ) }, ANGLE_0 },
{ { Millimeter2iu( 0.1 ), Millimeter2iu( 2 ) }, ANGLE_0 },
{ { Millimeter2iu( 2.1 ), Millimeter2iu( 2.2 ) }, ANGLE_0 },
{ { Millimeter2iu( 0.2 ), Millimeter2iu( 4.0 ) }, ANGLE_0 },
{ { Millimeter2iu( 2.2 ), Millimeter2iu( 4.2 ) }, ANGLE_0 },
},
},
{
@ -175,12 +176,12 @@ static const std::vector<GRID_ARRAY_TEST_CASE> grid_geom_cases = {
{ 0, 0 },
{
// add the offsets for each positions
{ { Millimeter2iu( 0 ), Millimeter2iu( 0 ) }, 0 },
{ { Millimeter2iu( 3 ), Millimeter2iu( 0 ) }, 0 },
{ { Millimeter2iu( 1 ), Millimeter2iu( 2 ) }, 0 },
{ { Millimeter2iu( 4 ), Millimeter2iu( 2 ) }, 0 },
{ { Millimeter2iu( 2 ), Millimeter2iu( 4 ) }, 0 },
{ { Millimeter2iu( 5 ), Millimeter2iu( 4 ) }, 0 },
{ { Millimeter2iu( 0 ), Millimeter2iu( 0 ) }, ANGLE_0 },
{ { Millimeter2iu( 3 ), Millimeter2iu( 0 ) }, ANGLE_0 },
{ { Millimeter2iu( 1 ), Millimeter2iu( 2 ) }, ANGLE_0 },
{ { Millimeter2iu( 4 ), Millimeter2iu( 2 ) }, ANGLE_0 },
{ { Millimeter2iu( 2 ), Millimeter2iu( 4 ) }, ANGLE_0 },
{ { Millimeter2iu( 5 ), Millimeter2iu( 4 ) }, ANGLE_0 },
},
},
{
@ -198,12 +199,12 @@ static const std::vector<GRID_ARRAY_TEST_CASE> grid_geom_cases = {
{ 0, 0 },
{
// add the offsets for each positions
{ { Millimeter2iu( 0 ), Millimeter2iu( 0 ) }, 0 },
{ { Millimeter2iu( 3 ), Millimeter2iu( 1 ) }, 0 },
{ { Millimeter2iu( 0 ), Millimeter2iu( 2 ) }, 0 },
{ { Millimeter2iu( 3 ), Millimeter2iu( 3 ) }, 0 },
{ { Millimeter2iu( 0 ), Millimeter2iu( 4 ) }, 0 },
{ { Millimeter2iu( 3 ), Millimeter2iu( 5 ) }, 0 },
{ { Millimeter2iu( 0 ), Millimeter2iu( 0 ) }, ANGLE_0 },
{ { Millimeter2iu( 3 ), Millimeter2iu( 1 ) }, ANGLE_0 },
{ { Millimeter2iu( 0 ), Millimeter2iu( 2 ) }, ANGLE_0 },
{ { Millimeter2iu( 3 ), Millimeter2iu( 3 ) }, ANGLE_0 },
{ { Millimeter2iu( 0 ), Millimeter2iu( 4 ) }, ANGLE_0 },
{ { Millimeter2iu( 3 ), Millimeter2iu( 5 ) }, ANGLE_0 },
},
},
{
@ -220,12 +221,12 @@ static const std::vector<GRID_ARRAY_TEST_CASE> grid_geom_cases = {
},
{ 0, 0 },
{
{ { Millimeter2iu( 0 ), Millimeter2iu( 0 ) }, 0 },
{ { Millimeter2iu( 2 ), Millimeter2iu( 0 ) }, 0 },
{ { Millimeter2iu( 2 ), Millimeter2iu( 2 ) }, 0 },
{ { Millimeter2iu( 0 ), Millimeter2iu( 2 ) }, 0 },
{ { Millimeter2iu( 0 ), Millimeter2iu( 4 ) }, 0 },
{ { Millimeter2iu( 2 ), Millimeter2iu( 4 ) }, 0 },
{ { Millimeter2iu( 0 ), Millimeter2iu( 0 ) }, ANGLE_0 },
{ { Millimeter2iu( 2 ), Millimeter2iu( 0 ) }, ANGLE_0 },
{ { Millimeter2iu( 2 ), Millimeter2iu( 2 ) }, ANGLE_0 },
{ { Millimeter2iu( 0 ), Millimeter2iu( 2 ) }, ANGLE_0 },
{ { Millimeter2iu( 0 ), Millimeter2iu( 4 ) }, ANGLE_0 },
{ { Millimeter2iu( 2 ), Millimeter2iu( 4 ) }, ANGLE_0 },
},
},
{
@ -242,12 +243,12 @@ static const std::vector<GRID_ARRAY_TEST_CASE> grid_geom_cases = {
},
{ 0, 0 },
{
{ { Millimeter2iu( 0 ), Millimeter2iu( 0 ) }, 0 },
{ { Millimeter2iu( 0 ), Millimeter2iu( 2 ) }, 0 },
{ { Millimeter2iu( 0 ), Millimeter2iu( 4 ) }, 0 },
{ { Millimeter2iu( 2 ), Millimeter2iu( 0 ) }, 0 },
{ { Millimeter2iu( 2 ), Millimeter2iu( 2 ) }, 0 },
{ { Millimeter2iu( 2 ), Millimeter2iu( 4 ) }, 0 },
{ { Millimeter2iu( 0 ), Millimeter2iu( 0 ) }, ANGLE_0 },
{ { Millimeter2iu( 0 ), Millimeter2iu( 2 ) }, ANGLE_0 },
{ { Millimeter2iu( 0 ), Millimeter2iu( 4 ) }, ANGLE_0 },
{ { Millimeter2iu( 2 ), Millimeter2iu( 0 ) }, ANGLE_0 },
{ { Millimeter2iu( 2 ), Millimeter2iu( 2 ) }, ANGLE_0 },
{ { Millimeter2iu( 2 ), Millimeter2iu( 4 ) }, ANGLE_0 },
},
},
};
@ -310,10 +311,10 @@ static const std::vector<CIRC_ARRAY_TEST_CASE> circ_geom_cases = {
{ Millimeter2iu( 10 ), 0 },
{
// diamond shape
{ { Millimeter2iu( 0 ), Millimeter2iu( 0 ) } , 0 },
{ { Millimeter2iu( -10 ), Millimeter2iu( -10 ) } , 0 },
{ { Millimeter2iu( -20 ), Millimeter2iu( 0 ) } , 0 },
{ {Millimeter2iu( -10 ), Millimeter2iu( 10 ) } , 0 },
{ { Millimeter2iu( 0 ), Millimeter2iu( 0 ) }, ANGLE_0 },
{ { Millimeter2iu( -10 ), Millimeter2iu( -10 ) }, ANGLE_0 },
{ { Millimeter2iu( -20 ), Millimeter2iu( 0 ) }, ANGLE_0 },
{ {Millimeter2iu( -10 ), Millimeter2iu( 10 ) }, ANGLE_0 },
},
},
{
@ -326,10 +327,10 @@ static const std::vector<CIRC_ARRAY_TEST_CASE> circ_geom_cases = {
},
{ Millimeter2iu( 10 ), 0 },
{
{ { Millimeter2iu( 0 ), Millimeter2iu( 0 ) } , 0 },
{ { Millimeter2iu( -10 ), Millimeter2iu( -10 ) } , 90 },
{ { Millimeter2iu( -20 ), Millimeter2iu( 0 ) } , 180 },
{ {Millimeter2iu( -10 ), Millimeter2iu( 10 ) } , 270 },
{ { Millimeter2iu( 0 ), Millimeter2iu( 0 ) }, ANGLE_0 },
{ { Millimeter2iu( -10 ), Millimeter2iu( -10 ) }, ANGLE_90 },
{ { Millimeter2iu( -20 ), Millimeter2iu( 0 ) }, ANGLE_180 },
{ {Millimeter2iu( -10 ), Millimeter2iu( 10 ) }, ANGLE_270 },
},
},
{
@ -342,10 +343,10 @@ static const std::vector<CIRC_ARRAY_TEST_CASE> circ_geom_cases = {
},
{ Millimeter2iu( 10 ), 0 },
{
{ { Millimeter2iu( 0 ), Millimeter2iu( 0 ) } , 0 },
{ { Millimeter2iu( 0 ), Millimeter2iu( 0 ) }, ANGLE_0 },
// 10 * [ 1-sin(45), sin(45) ]
{ { Millimeter2iu( -2.9289321881 ), Millimeter2iu( -7.0710678118 ) } , 45 },
{ { Millimeter2iu( -10 ), Millimeter2iu( -10 ) } , 90 },
{ { Millimeter2iu( -2.9289321881 ), Millimeter2iu( -7.0710678118 ) }, ANGLE_45 },
{ { Millimeter2iu( -10 ), Millimeter2iu( -10 ) }, ANGLE_90 },
},
},
};
@ -363,7 +364,7 @@ BOOST_AUTO_TEST_CASE( CircularGeometry )
ARRAY_CIRCULAR_OPTIONS grid_opts;
grid_opts.m_nPts = c.m_geom.n;
grid_opts.m_angle = 10 * c.m_geom.angle_offset;
grid_opts.m_angle = EDA_ANGLE( c.m_geom.angle_offset, DEGREES_T );
grid_opts.m_centre = c.m_geom.centre;
grid_opts.m_rotateItems = c.m_geom.rotate;