KiCad PCB EDA Suite
SHAPE_COMPOUND Class Reference

#include <shape_compound.h>

Inheritance diagram for SHAPE_COMPOUND:
SHAPE SHAPE_BASE

Public Member Functions

 SHAPE_COMPOUND ()
 
 SHAPE_COMPOUND (const std::vector< SHAPE * > &aShapes)
 
 SHAPE_COMPOUND (const SHAPE_COMPOUND &aOther)
 
 ~SHAPE_COMPOUND ()
 
SHAPE_COMPOUNDClone () const override
 Return a dynamically allocated copy of the shape. More...
 
const std::string Format (bool aCplusPlus=true) const override
 
bool Collide (const SEG &aSeg, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const override
 Check if the boundary of shape (this) lies closer to the segment aSeg than aClearance, indicating a collision. More...
 
bool Collide (const SHAPE *aShape, int aClearance, VECTOR2I *aMTV) const override
 Check if the boundary of shape (this) lies closer to the shape aShape than aClearance, indicating a collision. More...
 
bool Collide (const SHAPE *aShape, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const override
 
const std::vector< SHAPE * > & Shapes () const
 
const BOX2I BBox (int aClearance=0) const override
 Compute a bounding box of the shape, with a margin of aClearance a collision. More...
 
int Distance (const SEG &aSeg) const
 
void Move (const VECTOR2I &aVector) override
 
void AddShape (SHAPE *aShape)
 
void AddShape (std::shared_ptr< SHAPE > aShape)
 
bool Empty () const
 
int Size () const
 
void Rotate (const EDA_ANGLE &aAngle, const VECTOR2I &aCenter={ 0, 0 }) override
 
bool IsSolid () const override
 
SHAPEUniqueSubshape () const
 
virtual bool HasIndexableSubshapes () const override
 
virtual size_t GetIndexableSubshapeCount () const override
 
virtual void GetIndexableSubshapes (std::vector< const SHAPE * > &aSubshapes) const override
 
bool ConvertToSimplePolygon (SHAPE_SIMPLE *aOut) const
 
int GetClearance (const SHAPE *aOther) const
 Return the actual minimum distance between two shapes. More...
 
bool IsNull () const
 Return true if the shape is a null shape. More...
 
virtual bool Collide (const VECTOR2I &aP, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const
 Check if the boundary of shape (this) lies closer to the point aP than aClearance, indicating a collision. More...
 
virtual VECTOR2I Centre () const
 Compute a center-of-mass of the shape. More...
 
virtual bool Parse (std::stringstream &aStream)
 
FACETNewFacet ()
 
SGNODECalcShape (SGNODE *aParent, SGNODE *aColor, WRL1_ORDER aVertexOrder, float aCreaseLimit=0.74317, bool isVRML2=false)
 
SHAPE_TYPE Type () const
 Return the type of the shape. More...
 
wxString TypeName () const
 

Static Public Attributes

static const int MIN_PRECISION_IU = 4
 This is the minimum precision for all the points in a shape. More...
 

Protected Types

typedef VECTOR2I::extended_type ecoord
 

Protected Attributes

SHAPE_TYPE m_type
 < type of our shape More...
 

Private Attributes

BOX2I m_cachedBBox
 
bool m_dirty
 
std::vector< SHAPE * > m_shapes
 
std::list< FACET * > facets
 

Detailed Description

Definition at line 38 of file shape_compound.h.

Member Typedef Documentation

◆ ecoord

typedef VECTOR2I::extended_type SHAPE::ecoord
protectedinherited

Definition at line 249 of file shape.h.

Constructor & Destructor Documentation

◆ SHAPE_COMPOUND() [1/3]

SHAPE_COMPOUND::SHAPE_COMPOUND ( )
inline

Definition at line 41 of file shape_compound.h.

41 :
43 m_dirty( true )
44 {
45 }
SHAPE(SHAPE_TYPE aType)
Create an empty shape of type aType.
Definition: shape.h:133
@ SH_COMPOUND
compound shape, consisting of multiple simple shapes
Definition: shape.h:50

Referenced by Clone().

◆ SHAPE_COMPOUND() [2/3]

SHAPE_COMPOUND::SHAPE_COMPOUND ( const std::vector< SHAPE * > &  aShapes)

Definition at line 42 of file shape_compound.cpp.

42 :
44 m_dirty( true ),
45 m_shapes( aShapes )
46{
47
48}
std::vector< SHAPE * > m_shapes

◆ SHAPE_COMPOUND() [3/3]

SHAPE_COMPOUND::SHAPE_COMPOUND ( const SHAPE_COMPOUND aOther)

Definition at line 51 of file shape_compound.cpp.

53{
54 for ( const SHAPE* shape : aOther.Shapes() )
55 m_shapes.push_back( shape->Clone() );
56
57 m_dirty = true;
58}
const std::vector< SHAPE * > & Shapes() const
An abstract shape on 2D plane.
Definition: shape.h:123

References m_dirty, m_shapes, and Shapes().

◆ ~SHAPE_COMPOUND()

SHAPE_COMPOUND::~SHAPE_COMPOUND ( )

Definition at line 63 of file shape_compound.cpp.

64{
65 for( auto shape : m_shapes )
66 delete shape;
67}

References m_shapes.

Member Function Documentation

◆ AddShape() [1/2]

void SHAPE_COMPOUND::AddShape ( SHAPE aShape)
inline

Definition at line 81 of file shape_compound.h.

82 {
83 // Don't make clients deal with nested SHAPE_COMPOUNDs
84 if( aShape->HasIndexableSubshapes() )
85 {
86 std::vector<const SHAPE*> subshapes;
87 aShape->GetIndexableSubshapes( subshapes );
88
89 for( const SHAPE* subshape : subshapes )
90 m_shapes.push_back( subshape->Clone() );
91
92 delete aShape;
93 }
94 else
95 {
96 m_shapes.push_back( aShape );
97 }
98
99 m_dirty = true;
100 }
virtual void GetIndexableSubshapes(std::vector< const SHAPE * > &aSubshapes) const
Definition: shape.h:112
virtual bool HasIndexableSubshapes() const
Definition: shape.h:105

References SHAPE_BASE::GetIndexableSubshapes(), SHAPE_BASE::HasIndexableSubshapes(), m_dirty, and m_shapes.

◆ AddShape() [2/2]

void SHAPE_COMPOUND::AddShape ( std::shared_ptr< SHAPE aShape)
inline

Definition at line 102 of file shape_compound.h.

103 {
104 // Don't make clients deal with nested SHAPE_COMPOUNDs
105 if( aShape->HasIndexableSubshapes() )
106 {
107 std::vector<const SHAPE*> subshapes;
108 aShape->GetIndexableSubshapes( subshapes );
109
110 for( const SHAPE* subshape : subshapes )
111 m_shapes.push_back( subshape->Clone() );
112 }
113 else
114 {
115 m_shapes.push_back( aShape->Clone() );
116 }
117
118 m_dirty = true;
119 }

References m_dirty, and m_shapes.

◆ BBox()

const BOX2I SHAPE_COMPOUND::BBox ( int  aClearance = 0) const
overridevirtual

Compute a bounding box of the shape, with a margin of aClearance a collision.

Parameters
aClearancehow much the bounding box is expanded wrs to the minimum enclosing rectangle for the shape.
Returns
the bounding box.

Implements SHAPE.

Definition at line 76 of file shape_compound.cpp.

77{
78 BOX2I bb;
79
80 if ( m_shapes.size() < 1 )
81 return bb;
82
83 bb = m_shapes[0]->BBox();
84
85 for( size_t i = 1; i < m_shapes.size(); i++ )
86 bb.Merge( m_shapes[i]->BBox() );
87
88 return bb;
89}
BOX2< Vec > & Merge(const BOX2< Vec > &aRect)
Modify the position and size of the rectangle in order to contain aRect.
Definition: box2.h:588

References m_shapes, and BOX2< Vec >::Merge().

◆ CalcShape()

SGNODE * SHAPE::CalcShape ( SGNODE aParent,
SGNODE aColor,
WRL1_ORDER  aVertexOrder,
float  aCreaseLimit = 0.74317,
bool  isVRML2 = false 
)
inherited

Definition at line 703 of file wrlfacet.cpp.

705{
706 if( facets.empty() || !facets.front()->HasMinPoints() )
707 return nullptr;
708
709 std::vector< std::list< FACET* > > flist;
710
711 // determine the max. index and size flist as appropriate
712 std::list< FACET* >::iterator sF = facets.begin();
713 std::list< FACET* >::iterator eF = facets.end();
714
715 int maxIdx = 0;
716 int tmi;
717 float maxV = 0.0;
718 float tV = 0.0;
719
720 while( sF != eF )
721 {
722 tV = ( *sF )->CalcFaceNormal();
723 tmi = ( *sF )->GetMaxIndex();
724
725 if( tmi > maxIdx )
726 maxIdx = tmi;
727
728 if( tV > maxV )
729 maxV = tV;
730
731 ++sF;
732 }
733
734 ++maxIdx;
735
736 if( maxIdx < 3 )
737 return nullptr;
738
739 flist.resize( maxIdx );
740
741 // create the lists of facets common to indices
742 sF = facets.begin();
743
744 while( sF != eF )
745 {
746 ( *sF )->Renormalize( tV );
747 ( *sF )->CollectVertices( flist );
748 ++sF;
749 }
750
751 // calculate the normals
752 size_t vs = flist.size();
753
754 for( size_t i = 0; i < vs; ++i )
755 {
756 sF = flist[i].begin();
757 eF = flist[i].end();
758
759 while( sF != eF )
760 {
761 ( *sF )->CalcVertexNormal( static_cast<int>( i ), flist[i], aCreaseLimit );
762 ++sF;
763 }
764 }
765
766 std::vector< WRLVEC3F > vertices;
767 std::vector< WRLVEC3F > normals;
768 std::vector< SGCOLOR > colors;
769
770 // push the facet data to the final output list
771 sF = facets.begin();
772 eF = facets.end();
773
774 while( sF != eF )
775 {
776 ( *sF )->GetData( vertices, normals, colors, aVertexOrder );
777 ++sF;
778 }
779
780 flist.clear();
781
782 if( vertices.size() < 3 )
783 return nullptr;
784
785 IFSG_SHAPE shapeNode( false );
786
787 if( !isVRML2 )
788 {
789 shapeNode.NewNode( aParent );
790
791 if( aColor )
792 {
793 if( nullptr == S3D::GetSGNodeParent( aColor ) )
794 shapeNode.AddChildNode( aColor );
795 else
796 shapeNode.AddRefNode( aColor );
797 }
798 }
799
800 std::vector< SGPOINT > lCPts; // vertex points in SGPOINT (double) format
801 std::vector< SGVECTOR > lCNorm; // per-vertex normals
802 vs = vertices.size();
803
804 for( size_t i = 0; i < vs; ++i )
805 {
806 SGPOINT pt;
807 pt.x = vertices[i].x;
808 pt.y = vertices[i].y;
809 pt.z = vertices[i].z;
810 lCPts.push_back( pt );
811 lCNorm.emplace_back( normals[i].x, normals[i].y, normals[i].z );
812 }
813
814 vertices.clear();
815 normals.clear();
816
817 IFSG_FACESET fsNode( false );
818
819 if( !isVRML2 )
820 fsNode.NewNode( shapeNode );
821 else
822 fsNode.NewNode( aParent );
823
824 IFSG_COORDS cpNode( fsNode );
825 cpNode.SetCoordsList( lCPts.size(), &lCPts[0] );
826 IFSG_COORDINDEX ciNode( fsNode );
827
828 for( int i = 0; i < (int)lCPts.size(); ++i )
829 ciNode.AddIndex( i );
830
831 IFSG_NORMALS nmNode( fsNode );
832 nmNode.SetNormalList( lCNorm.size(), &lCNorm[0] );
833
834 if( !colors.empty() )
835 {
836 IFSG_COLORS nmColor( fsNode );
837 nmColor.SetColorList( colors.size(), &colors[0] );
838 colors.clear();
839 }
840
841 if( !isVRML2 )
842 return shapeNode.GetRawPtr();
843
844 return fsNode.GetRawPtr();
845}
IFSG_COLORS is the wrapper for SGCOLORS.
Definition: ifsg_colors.h:42
IFSG_COORDINDEX is the wrapper for SGCOORDINDEX.
IFSG_COORDS is the wrapper for SGCOORDS.
Definition: ifsg_coords.h:41
IFSG_FACESET is the wrapper for the SGFACESET class.
Definition: ifsg_faceset.h:41
IFSG_NORMALS is the wrapper for the SGNORMALS class.
Definition: ifsg_normals.h:41
IFSG_SHAPE is the wrapper for the SGSHAPE class.
Definition: ifsg_shape.h:41
double z
Definition: sg_base.h:72
double x
Definition: sg_base.h:70
double y
Definition: sg_base.h:71
std::list< FACET * > facets
Definition: wrlfacet.h:143
SGLIB_API SGNODE * GetSGNodeParent(SGNODE *aNode)
Definition: ifsg_api.cpp:494

References IFSG_NODE::AddChildNode(), IFSG_INDEX::AddIndex(), IFSG_NODE::AddRefNode(), SHAPE::facets, IFSG_NODE::GetRawPtr(), S3D::GetSGNodeParent(), IFSG_FACESET::NewNode(), IFSG_SHAPE::NewNode(), IFSG_COLORS::SetColorList(), IFSG_COORDS::SetCoordsList(), IFSG_NORMALS::SetNormalList(), SGPOINT::x, SGPOINT::y, and SGPOINT::z.

Referenced by WRL2FACESET::TranslateToSG(), X3DIFACESET::TranslateToSG(), and WRL1FACESET::TranslateToSG().

◆ Centre()

virtual VECTOR2I SHAPE::Centre ( ) const
inlinevirtualinherited

Compute a center-of-mass of the shape.

Returns
the center-of-mass point

Definition at line 229 of file shape.h.

230 {
231 return BBox( 0 ).Centre(); // if nothing better is available....
232 }
Vec Centre() const
Definition: box2.h:70
virtual const BOX2I BBox(int aClearance=0) const =0
Compute a bounding box of the shape, with a margin of aClearance a collision.

References SHAPE::BBox(), and BOX2< Vec >::Centre().

Referenced by Collide().

◆ Clone()

SHAPE_COMPOUND * SHAPE_COMPOUND::Clone ( ) const
overridevirtual

Return a dynamically allocated copy of the shape.

Return values
copyof the shape

Reimplemented from SHAPE.

Definition at line 70 of file shape_compound.cpp.

71{
72 return new SHAPE_COMPOUND( *this );
73}

References SHAPE_COMPOUND().

◆ Collide() [1/4]

bool SHAPE_COMPOUND::Collide ( const SEG aSeg,
int  aClearance = 0,
int *  aActual = nullptr,
VECTOR2I aLocation = nullptr 
) const
overridevirtual

Check if the boundary of shape (this) lies closer to the segment aSeg than aClearance, indicating a collision.

Parameters
aActual[out] an optional pointer to an int to be updated with the actual distance int the event of a collision.
aLocation[out] an option pointer to a point to store a nearby location in the event of a collision.
Returns
true, if there is a collision.

Implements SHAPE.

Definition at line 117 of file shape_compound.cpp.

119{
120 int closest_dist = std::numeric_limits<int>::max();
121 VECTOR2I nearest;
122
123 for( SHAPE* item : m_shapes )
124 {
125 int actual = 0;
126 VECTOR2I pn;
127
128 if( item->Collide( aSeg, aClearance,
129 aActual || aLocation ? &actual : nullptr,
130 aLocation ? &pn : nullptr ) )
131 {
132 if( actual < closest_dist )
133 {
134 nearest = pn;
135 closest_dist = actual;
136
137 if( closest_dist == 0 || !aActual )
138 break;
139 }
140 }
141 }
142
143 if( closest_dist == 0 || closest_dist < aClearance )
144 {
145 if( aLocation )
146 *aLocation = nearest;
147
148 if( aActual )
149 *aActual = closest_dist;
150
151 return true;
152 }
153
154 return false;
155}

References m_shapes.

◆ Collide() [2/4]

bool SHAPE_COMPOUND::Collide ( const SHAPE aShape,
int  aClearance,
VECTOR2I aMTV 
) const
inlineoverridevirtual

Check if the boundary of shape (this) lies closer to the shape aShape than aClearance, indicating a collision.

Parameters
aShapeshape to check collision against
aClearanceminimum clearance
aMTVminimum translation vector
aActual[out] an optional pointer to an int to store the actual distance in the event of a collision.
aLocation[out] an option pointer to a point to store a nearby location in the event of a collision.
Returns
true, if there is a collision.

Reimplemented from SHAPE.

Definition at line 59 of file shape_compound.h.

60 {
61 return SHAPE::Collide( aShape, aClearance, aMTV );
62 }
virtual bool Collide(const VECTOR2I &aP, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const
Check if the boundary of shape (this) lies closer to the point aP than aClearance,...
Definition: shape.h:178

References SHAPE::Collide().

◆ Collide() [3/4]

bool SHAPE_COMPOUND::Collide ( const SHAPE aShape,
int  aClearance = 0,
int *  aActual = nullptr,
VECTOR2I aLocation = nullptr 
) const
inlineoverridevirtual

Reimplemented from SHAPE.

Definition at line 64 of file shape_compound.h.

66 {
67 return SHAPE::Collide( aShape, aClearance, aActual, aLocation );
68 }

References SHAPE::Collide().

◆ Collide() [4/4]

virtual bool SHAPE::Collide ( const VECTOR2I aP,
int  aClearance = 0,
int *  aActual = nullptr,
VECTOR2I aLocation = nullptr 
) const
inlinevirtualinherited

Check if the boundary of shape (this) lies closer to the point aP than aClearance, indicating a collision.

Parameters
aActual[out] an optional pointer to an int to store the actual distance in the event of a collision.
aLocation[out] an option pointer to a point to store a nearby location in the event of a collision.
Returns
true, if there is a collision.

Reimplemented in SHAPE_LINE_CHAIN_BASE, SHAPE_ARC, SHAPE_LINE_CHAIN, SHAPE_POLY_SET, and SHAPE_SEGMENT.

Definition at line 178 of file shape.h.

180 {
181 return Collide( SEG( aP, aP ), aClearance, aActual, aLocation );
182 }
Definition: seg.h:42

References SHAPE::Collide().

Referenced by BOOST_AUTO_TEST_CASE(), DRC_RTREE::CheckColliding(), FOOTPRINT::CheckShortingPads(), Collide(), SHAPE_RECT::Collide(), SHAPE_SEGMENT::Collide(), SHAPE_ARC::Collide(), SHAPE_POLY_SET::Collide(), SHAPE::Collide(), CN_ZONE_LAYER::Collide(), collide(), PNS::ITEM::collideSimple(), PNS::SHOVE::onCollidingVia(), PNS::HIT_VISITOR::operator()(), RN_NET::optimizeRNEdges(), PNS::VIA::PushoutForce(), DRC_RTREE::QueryColliding(), PNS::OPTIMIZER::smartPadsSingle(), DRC_TEST_PROVIDER_EDGE_CLEARANCE::testAgainstEdge(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testItemAgainstItem(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadAgainstItem(), and DRC_TEST_PROVIDER_COPPER_CLEARANCE::testTrackAgainstItem().

◆ ConvertToSimplePolygon()

bool SHAPE_COMPOUND::ConvertToSimplePolygon ( SHAPE_SIMPLE aOut) const

Definition at line 158 of file shape_compound.cpp.

159{
160 return false;
161}

◆ Distance()

int SHAPE_COMPOUND::Distance ( const SEG aSeg) const

Definition at line 98 of file shape_compound.cpp.

99{
100 assert(false);
101 return 0; // Make compiler happy
102}

◆ Empty()

bool SHAPE_COMPOUND::Empty ( ) const
inline

Definition at line 121 of file shape_compound.h.

122 {
123 return m_shapes.empty();
124 }

References m_shapes.

◆ Format()

const std::string SHAPE_COMPOUND::Format ( bool  aCplusPlus = true) const
overridevirtual

Reimplemented from SHAPE.

Definition at line 30 of file shape_compound.cpp.

31{
32 std::stringstream ss;
33
34 ss << "compound( ";
35
36 for( auto shape : m_shapes )
37 ss << shape->Format() << " ";
38
39 return ss.str();
40}

References m_shapes.

◆ GetClearance()

int SHAPE::GetClearance ( const SHAPE aOther) const
inherited

Return the actual minimum distance between two shapes.

Return values
distancein IU

Definition at line 49 of file shape.cpp.

50{
51 int actual_clearance = std::numeric_limits<int>::max();
52 std::vector<const SHAPE*> a_shapes;
53 std::vector<const SHAPE*> b_shapes;
54
55 GetIndexableSubshapes( a_shapes );
56 aOther->GetIndexableSubshapes( b_shapes );
57
58 if( GetIndexableSubshapeCount() == 0 )
59 a_shapes.push_back( this );
60
61 if( aOther->GetIndexableSubshapeCount() == 0 )
62 b_shapes.push_back( aOther );
63
64 for( const SHAPE* a : a_shapes )
65 {
66 for( const SHAPE* b : b_shapes )
67 {
68 int temp_dist = 0;
69 a->Collide( b, std::numeric_limits<int>::max() / 2, &temp_dist );
70
71 if( temp_dist < actual_clearance )
72 actual_clearance = temp_dist;
73 }
74 }
75
76 return actual_clearance;
77}
virtual size_t GetIndexableSubshapeCount() const
Definition: shape.h:110

References SHAPE_BASE::GetIndexableSubshapeCount(), and SHAPE_BASE::GetIndexableSubshapes().

◆ GetIndexableSubshapeCount()

virtual size_t SHAPE_COMPOUND::GetIndexableSubshapeCount ( ) const
inlineoverridevirtual

Reimplemented from SHAPE_BASE.

Definition at line 145 of file shape_compound.h.

146 {
147 return m_shapes.size();
148 }

References m_shapes.

◆ GetIndexableSubshapes()

virtual void SHAPE_COMPOUND::GetIndexableSubshapes ( std::vector< const SHAPE * > &  aSubshapes) const
inlineoverridevirtual

Reimplemented from SHAPE_BASE.

Definition at line 150 of file shape_compound.h.

151 {
152 aSubshapes.clear();
153 aSubshapes.reserve( m_shapes.size() );
154 std::copy( m_shapes.begin(), m_shapes.end(), std::back_inserter( aSubshapes ) );
155 }

References m_shapes.

◆ HasIndexableSubshapes()

virtual bool SHAPE_COMPOUND::HasIndexableSubshapes ( ) const
inlineoverridevirtual

Reimplemented from SHAPE_BASE.

Definition at line 140 of file shape_compound.h.

141 {
142 return true;
143 }

◆ IsNull()

bool SHAPE::IsNull ( ) const
inlineinherited

Return true if the shape is a null shape.

Return values
trueif null :-)

Definition at line 163 of file shape.h.

164 {
165 return m_type == SH_NULL;
166 }
SHAPE_TYPE m_type
< type of our shape
Definition: shape.h:116
@ SH_NULL
empty shape (no shape...),
Definition: shape.h:52

References SHAPE_BASE::m_type, and SH_NULL.

◆ IsSolid()

bool SHAPE_COMPOUND::IsSolid ( ) const
overridevirtual

Implements SHAPE.

Definition at line 111 of file shape_compound.cpp.

112{
113 return true;
114}

◆ Move()

void SHAPE_COMPOUND::Move ( const VECTOR2I aVector)
overridevirtual

Implements SHAPE.

Definition at line 91 of file shape_compound.cpp.

92{
93 for( auto& item : m_shapes )
94 item->Move( aVector );
95}

References m_shapes.

◆ NewFacet()

FACET * SHAPE::NewFacet ( )
inherited

Definition at line 695 of file wrlfacet.cpp.

696{
697 FACET* fp = new FACET;
698 facets.push_back( fp );
699 return fp;
700}
Definition: wrlfacet.h:43

References SHAPE::facets.

Referenced by WRL2FACESET::TranslateToSG(), X3DIFACESET::TranslateToSG(), and WRL1FACESET::TranslateToSG().

◆ Parse()

bool SHAPE::Parse ( std::stringstream &  aStream)
virtualinherited

Reimplemented in SHAPE_LINE_CHAIN, and SHAPE_POLY_SET.

Definition at line 34 of file shape.cpp.

35{
36 assert( false );
37 return false;
38}

◆ Rotate()

void SHAPE_COMPOUND::Rotate ( const EDA_ANGLE aAngle,
const VECTOR2I aCenter = { 0, 0 } 
)
overridevirtual
Parameters
aCenteris the rotation center.
aAnglerotation angle.

Implements SHAPE.

Definition at line 105 of file shape_compound.cpp.

106{
107 assert( false );
108}

◆ Shapes()

const std::vector< SHAPE * > & SHAPE_COMPOUND::Shapes ( ) const
inline

Definition at line 70 of file shape_compound.h.

71 {
72 return m_shapes;
73 }

References m_shapes.

Referenced by collideShapes(), PNS::SOLID::HoleHull(), PNS::SOLID::Hull(), and SHAPE_COMPOUND().

◆ Size()

int SHAPE_COMPOUND::Size ( ) const
inline

Definition at line 126 of file shape_compound.h.

127 {
128 return m_shapes.size();
129 }

References m_shapes.

◆ Type()

◆ TypeName()

wxString SHAPE_BASE::TypeName ( ) const
inlineinherited

Definition at line 100 of file shape.h.

101 {
102 return SHAPE_TYPE_asString( m_type );
103 }
static wxString SHAPE_TYPE_asString(SHAPE_TYPE a)
Definition: shape.h:56

References SHAPE_BASE::m_type, and SHAPE_TYPE_asString().

Referenced by Collide().

◆ UniqueSubshape()

SHAPE * SHAPE_COMPOUND::UniqueSubshape ( ) const
inline

Definition at line 135 of file shape_compound.h.

136 {
137 return m_shapes.size() != 1 ? nullptr : m_shapes[0];
138 }

References m_shapes.

Member Data Documentation

◆ facets

std::list< FACET* > SHAPE::facets
privateinherited

Definition at line 143 of file wrlfacet.h.

Referenced by SHAPE::CalcShape(), and SHAPE::NewFacet().

◆ m_cachedBBox

BOX2I SHAPE_COMPOUND::m_cachedBBox
private

Definition at line 160 of file shape_compound.h.

◆ m_dirty

bool SHAPE_COMPOUND::m_dirty
private

Definition at line 161 of file shape_compound.h.

Referenced by AddShape(), and SHAPE_COMPOUND().

◆ m_shapes

std::vector<SHAPE*> SHAPE_COMPOUND::m_shapes
private

◆ m_type

SHAPE_TYPE SHAPE_BASE::m_type
protectedinherited

< type of our shape

Definition at line 116 of file shape.h.

Referenced by SHAPE::Format(), SHAPE::IsNull(), SHAPE_BASE::Type(), and SHAPE_BASE::TypeName().

◆ MIN_PRECISION_IU

const int SHAPE::MIN_PRECISION_IU = 4
staticinherited

This is the minimum precision for all the points in a shape.

Definition at line 128 of file shape.h.

Referenced by BOOST_AUTO_TEST_CASE(), DIRECTION_45::BuildInitialTrace(), CompareLength(), CIRCLE::Contains(), EDIT_TOOL::FilletTracks(), and CIRCLE::IntersectLine().


The documentation for this class was generated from the following files: