Code formatting.

This commit is contained in:
Maciej Suminski 2015-08-12 21:12:12 +02:00
parent a6c94e26f6
commit 127fcfa7c9
6 changed files with 37 additions and 37 deletions

View File

@ -50,8 +50,9 @@ enum LineMarker {
class PNS_OBJECT class PNS_OBJECT
{ {
public: public:
PNS_OBJECT (): PNS_OBJECT():
m_owner(NULL) {}; m_owner( NULL ) {}
~PNS_OBJECT() {}; ~PNS_OBJECT() {};
/** /**
@ -83,7 +84,7 @@ public:
PNS_OBJECT* Owner() const { return m_owner; } PNS_OBJECT* Owner() const { return m_owner; }
protected: protected:
PNS_OBJECT *m_owner; PNS_OBJECT* m_owner;
}; };

View File

@ -142,7 +142,7 @@ public:
void Clear() void Clear()
{ {
BOOST_FOREACH( PNS_ITEM *item, m_items ) BOOST_FOREACH( PNS_ITEM* item, m_items )
{ {
if( item->BelongsTo( this ) ) if( item->BelongsTo( this ) )
delete item; delete item;
@ -168,24 +168,24 @@ public:
} }
template<class T> template<class T>
T* FindByKind( PNS_ITEM::PnsKind kind, int index = 0 ) T* FindByKind( PNS_ITEM::PnsKind kind, int index = 0 )
{
int n = 0;
BOOST_FOREACH( PNS_ITEM* item, m_items )
{ {
int n = 0; if( item->OfKind( kind ) )
BOOST_FOREACH( PNS_ITEM* item, m_items )
{ {
if( item->OfKind (kind) ) if( index == n )
{ return static_cast<T*>( item );
if( index == n ) else
return static_cast<T*>( item ); n++;
else
n++;
}
} }
return NULL;
} }
return NULL;
}
private: private:
void release(); void release();
@ -193,7 +193,7 @@ private:
{ {
release(); release();
BOOST_FOREACH( PNS_ITEM *item, aOther.m_items ) BOOST_FOREACH( PNS_ITEM* item, aOther.m_items )
{ {
if( item->BelongsTo( &aOther ) ) if( item->BelongsTo( &aOther ) )
m_items.push_back( item->Clone() ); m_items.push_back( item->Clone() );

View File

@ -38,16 +38,16 @@ PNS_LINE::PNS_LINE( const PNS_LINE& aOther ) :
m_line( aOther.m_line ), m_line( aOther.m_line ),
m_width( aOther.m_width ) m_width( aOther.m_width )
{ {
m_net = aOther.m_net; m_net = aOther.m_net;
m_movable = aOther.m_movable; m_movable = aOther.m_movable;
m_layers = aOther.m_layers; m_layers = aOther.m_layers;
m_owner = aOther.m_owner; m_owner = NULL;
m_via = aOther.m_via; m_via = aOther.m_via;
m_hasVia = aOther.m_hasVia; m_hasVia = aOther.m_hasVia;
m_marker = aOther.m_marker; m_marker = aOther.m_marker;
m_rank = aOther.m_rank; m_rank = aOther.m_rank;
copyLinks( &aOther ); copyLinks( &aOther );
} }
@ -137,7 +137,7 @@ void PNS_LINE::copyLinks( const PNS_LINE* aParent )
} }
PNS_SEGMENT* PNS_SEGMENT::Clone( ) const PNS_SEGMENT* PNS_SEGMENT::Clone() const
{ {
PNS_SEGMENT* s = new PNS_SEGMENT; PNS_SEGMENT* s = new PNS_SEGMENT;

View File

@ -1110,13 +1110,12 @@ void PNS_NODE::GetUpdatedItems( ITEM_VECTOR& aRemoved, ITEM_VECTOR& aAdded )
aAdded.push_back( *i ); aAdded.push_back( *i );
} }
void PNS_NODE::releaseChildren() void PNS_NODE::releaseChildren()
{ {
// copy the kids as the PNS_NODE destructor erases the item from the parent node. // copy the kids as the PNS_NODE destructor erases the item from the parent node.
std::vector<PNS_NODE*> kids = m_children; std::vector<PNS_NODE*> kids = m_children;
BOOST_FOREACH( PNS_NODE * node, kids ) BOOST_FOREACH( PNS_NODE* node, kids )
{ {
node->releaseChildren(); node->releaseChildren();
delete node; delete node;
@ -1126,7 +1125,7 @@ void PNS_NODE::releaseChildren()
void PNS_NODE::releaseGarbage() void PNS_NODE::releaseGarbage()
{ {
if( !isRoot( ) ) if( !isRoot() )
return; return;
BOOST_FOREACH( PNS_ITEM* item, m_garbageItems ) BOOST_FOREACH( PNS_ITEM* item, m_garbageItems )
@ -1162,7 +1161,7 @@ void PNS_NODE::Commit( PNS_NODE* aNode )
void PNS_NODE::KillChildren() void PNS_NODE::KillChildren()
{ {
assert ( isRoot() ); assert( isRoot() );
releaseChildren(); releaseChildren();
} }

View File

@ -135,8 +135,8 @@ public:
typedef std::vector<PNS_ITEM*> ITEM_VECTOR; typedef std::vector<PNS_ITEM*> ITEM_VECTOR;
typedef std::vector<PNS_OBSTACLE> OBSTACLES; typedef std::vector<PNS_OBSTACLE> OBSTACLES;
PNS_NODE (); PNS_NODE();
~PNS_NODE (); ~PNS_NODE();
///> Returns the expected clearance between items a and b. ///> Returns the expected clearance between items a and b.
int GetClearance( const PNS_ITEM* aA, const PNS_ITEM* aB ) const; int GetClearance( const PNS_ITEM* aA, const PNS_ITEM* aB ) const;
@ -426,7 +426,7 @@ private:
return m_override.find( aItem ) != m_override.end(); return m_override.find( aItem ) != m_override.end();
} }
PNS_SEGMENT *findRedundantSegment ( PNS_SEGMENT* aSeg ); PNS_SEGMENT* findRedundantSegment( PNS_SEGMENT* aSeg );
///> scans the joint map, forming a line starting from segment (current). ///> scans the joint map, forming a line starting from segment (current).
void followLine( PNS_SEGMENT* aCurrent, void followLine( PNS_SEGMENT* aCurrent,
@ -466,7 +466,7 @@ private:
int m_depth; int m_depth;
///> optional collision filtering object ///> optional collision filtering object
PNS_COLLISION_FILTER *m_collisionFilter; PNS_COLLISION_FILTER* m_collisionFilter;
boost::unordered_set<PNS_ITEM*> m_garbageItems; boost::unordered_set<PNS_ITEM*> m_garbageItems;
}; };

View File

@ -78,7 +78,7 @@ const SHAPE_LINE_CHAIN PNS_VIA::Hull( int aClearance, int aWalkaroundThickness )
} }
PNS_VIA* PNS_VIA::Clone ( ) const PNS_VIA* PNS_VIA::Clone() const
{ {
PNS_VIA* v = new PNS_VIA(); PNS_VIA* v = new PNS_VIA();