Formatting.
Naming conventions.
Use of auto.
Use of STL cover types.
This commit is contained in:
Jeff Young 2021-10-03 13:58:56 +01:00
parent 0f48522342
commit 930c4e5582
14 changed files with 130 additions and 187 deletions

View File

@ -39,6 +39,7 @@
#include <memory>
#include <stdexcept>
#include <wx/log.h>
#include <wx/debug.h>
using namespace KIGFX;
@ -171,9 +172,8 @@ unsigned int OPENGL_COMPOSITOR::CreateBuffer( VECTOR2U aDimensions )
if( (int) usedBuffers() >= maxBuffers )
{
throw std::runtime_error(
"Cannot create more framebuffers. OpenGL rendering "
"backend requires at least 3 framebuffers. You may try to update/change "
throw std::runtime_error( "Cannot create more framebuffers. OpenGL rendering backend "
"requires at least 3 framebuffers. You may try to update/change "
"your graphic drivers." );
}
@ -218,46 +218,35 @@ unsigned int OPENGL_COMPOSITOR::CreateBuffer( VECTOR2U aDimensions )
{
case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT:
throw std::runtime_error( "The framebuffer attachment points are incomplete." );
break;
case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT:
throw std::runtime_error( "No images attached to the framebuffer." );
break;
case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT:
throw std::runtime_error( "The framebuffer does not have at least one "
"image attached to it." );
break;
case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT:
throw std::runtime_error( "The framebuffer read buffer is incomplete." );
break;
case GL_FRAMEBUFFER_UNSUPPORTED_EXT:
throw std::runtime_error(
"The combination of internal formats of the attached "
"images violates an implementation-dependent set of restrictions." );
break;
throw std::runtime_error( "The combination of internal formats of the attached "
"images violates an implementation-dependent set of "
"restrictions." );
case GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT:
throw std::runtime_error( "GL_RENDERBUFFER_SAMPLES is not the same for "
"all attached renderbuffers" );
break;
case GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT:
throw std::runtime_error( "Framebuffer incomplete layer targets errors." );
break;
case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT:
throw std::runtime_error( "Framebuffer attachments have different dimensions" );
break;
default:
throw std::runtime_error( "Unknown error occurred when creating the framebuffer." );
break;
}
return 0;
}
ClearBuffer( COLOR4D::BLACK );
@ -275,15 +264,15 @@ unsigned int OPENGL_COMPOSITOR::CreateBuffer( VECTOR2U aDimensions )
GLenum OPENGL_COMPOSITOR::GetBufferTexture( unsigned int aBufferHandle )
{
assert( aBufferHandle > 0 && aBufferHandle <= usedBuffers() );
wxASSERT( aBufferHandle > 0 && aBufferHandle <= usedBuffers() );
return m_buffers[aBufferHandle - 1].textureTarget;
}
void OPENGL_COMPOSITOR::SetBuffer( unsigned int aBufferHandle )
{
assert( m_initialized );
assert( aBufferHandle <= usedBuffers() );
wxASSERT( m_initialized );
wxASSERT( aBufferHandle <= usedBuffers() );
// Either unbind the FBO for direct rendering, or bind the one with target textures
bindFb( aBufferHandle == DIRECT_RENDERING ? DIRECT_RENDERING : m_mainFbo );
@ -307,7 +296,7 @@ void OPENGL_COMPOSITOR::SetBuffer( unsigned int aBufferHandle )
void OPENGL_COMPOSITOR::ClearBuffer( const COLOR4D& aColor )
{
assert( m_initialized );
wxASSERT( m_initialized );
glClearColor( aColor.r, aColor.g, aColor.b, 0.0f );
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT );
@ -334,9 +323,9 @@ void OPENGL_COMPOSITOR::DrawBuffer( unsigned int aBufferHandle )
void OPENGL_COMPOSITOR::DrawBuffer( unsigned int aSourceHandle, unsigned int aDestHandle )
{
assert( m_initialized );
assert( aSourceHandle != 0 && aSourceHandle <= usedBuffers() );
assert( aDestHandle <= usedBuffers() );
wxASSERT( m_initialized );
wxASSERT( aSourceHandle != 0 && aSourceHandle <= usedBuffers() );
wxASSERT( aDestHandle <= usedBuffers() );
// Switch to the destination buffer and blit the scene
SetBuffer( aDestHandle );
@ -388,7 +377,7 @@ void OPENGL_COMPOSITOR::Present()
void OPENGL_COMPOSITOR::bindFb( unsigned int aFb )
{
// Currently there are only 2 valid FBOs
assert( aFb == DIRECT_RENDERING || aFb == m_mainFbo );
wxASSERT( aFb == DIRECT_RENDERING || aFb == m_mainFbo );
if( m_curFbo != aFb )
{
@ -401,14 +390,12 @@ void OPENGL_COMPOSITOR::bindFb( unsigned int aFb )
void OPENGL_COMPOSITOR::clean()
{
assert( m_initialized );
wxASSERT( m_initialized );
bindFb( DIRECT_RENDERING );
for( OPENGL_BUFFERS::const_iterator it = m_buffers.begin(); it != m_buffers.end(); ++it )
{
glDeleteTextures( 1, &it->textureTarget );
}
for( const OPENGL_BUFFER& buffer : m_buffers )
glDeleteTextures( 1, &buffer.textureTarget );
m_buffers.clear();
@ -426,10 +413,8 @@ int OPENGL_COMPOSITOR::GetAntialiasSupersamplingFactor() const
{
switch ( m_currentAntialiasingMode )
{
case OPENGL_ANTIALIASING_MODE::SUPERSAMPLING:
return 2;
default:
return 1;
case OPENGL_ANTIALIASING_MODE::SUPERSAMPLING: return 2;
default: return 1;
}
}

View File

@ -90,13 +90,13 @@ int checkGlError( const std::string& aInfo, const char* aFile, int aLine, bool a
break;
case GL_FRAMEBUFFER_UNSUPPORTED_EXT:
errorMsg = "The combination of internal formats of the attached images violates an "
"implementation dependent set of restrictions.";
errorMsg = "The combination of internal formats of the attached images violates "
"an implementation dependent set of restrictions.";
break;
case GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT:
errorMsg =
"GL_RENDERBUFFER_SAMPLES is not the same for all attached render buffers.";
errorMsg = "GL_RENDERBUFFER_SAMPLES is not the same for all attached render "
"buffers.";
break;
case GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT:
@ -140,16 +140,20 @@ int checkGlError( const std::string& aInfo, const char* aFile, int aLine, bool a
if( aThrow )
{
wxLogTrace( traceGalOpenGlError, wxT( "Throwing exception for glGetError() '%s' "
"in file '%s' on line %d." ), errorMsg,
aFile, aLine );
"in file '%s' on line %d." ),
errorMsg,
aFile,
aLine );
throw std::runtime_error( (const char*) errorMsg.char_str() );
}
else
{
wxString msg;
wxString msg = wxString::Format( wxT( "glGetError() '%s' in file '%s' on line %d." ),
errorMsg,
aFile,
aLine );
msg.Printf( wxT( "glGetError() '%s' in file '%s' on line %d." ),
errorMsg, aFile, aLine );
DisplayErrorMessage( nullptr, "OpenGL Error", errorMsg );
}
}

View File

@ -53,14 +53,14 @@ EDIT_POINT* EDIT_POINTS::FindPoint( const VECTOR2I& aLocation, KIGFX::VIEW *aVie
if( m_allowPoints )
{
for( auto& point : m_points )
for( EDIT_POINT& point : m_points )
{
if( point.WithinPoint( aLocation, size ) )
return &point;
}
}
for( auto& line : m_lines )
for( EDIT_LINE& line : m_lines )
{
if( line.WithinPoint( aLocation, size ) )
return &line;
@ -244,8 +244,7 @@ const BOX2I EDIT_POINTS::ViewBBox() const
void EDIT_POINTS::ViewDraw( int aLayer, KIGFX::VIEW* aView ) const
{
auto gal = aView->GetGAL();
KIGFX::GAL* gal = aView->GetGAL();
KIGFX::RENDER_SETTINGS* settings = aView->GetPainter()->GetSettings();
KIGFX::COLOR4D drawColor = settings->GetLayerColor( LAYER_AUX_ITEMS );

View File

@ -2,6 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013-2017 CERN
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
* @author Maciej Suminski <maciej.suminski@cern.ch>
*
@ -119,7 +120,7 @@ bool SELECTION::HasType( KICAD_T aType ) const
}
const KIGFX::VIEW_GROUP::ITEMS SELECTION::updateDrawList() const
const std::vector<KIGFX::VIEW_ITEM*> SELECTION::updateDrawList() const
{
std::vector<VIEW_ITEM*> items;

View File

@ -64,7 +64,7 @@ public:
deleteGroups();
}
int getFlags() const
int GetFlags() const
{
return m_flags;
}
@ -124,7 +124,7 @@ private:
}
// If there was no entry for the given layer - create one
GroupPair* newGroups = new GroupPair[m_groupsSize + 1];
std::pair<int, int>* newGroups = new std::pair<int, int>[m_groupsSize + 1];
if( m_groupsSize > 0 )
{
@ -133,7 +133,7 @@ private:
}
m_groups = newGroups;
newGroups[m_groupsSize++] = GroupPair( aLayer, aGroup );
newGroups[m_groupsSize++] = { aLayer, aGroup };
}
@ -177,7 +177,8 @@ private:
{
new_layer = aReorderMap.at( orig_layer );
}
catch( const std::out_of_range& ) {}
catch( const std::out_of_range& )
{}
m_groups[i].first = new_layer;
}
@ -226,22 +227,16 @@ private:
return m_flags == VISIBLE;
}
VIEW* m_view; ///< Current dynamic view the item is assigned to.
int m_flags; ///< Visibility flags
int m_requiredUpdate; ///< Flag required for updating
int m_drawPriority; ///< Order to draw this item in a layer, lowest first
///< Helper for storing cached items group ids
typedef std::pair<int, int> GroupPair;
///< Indexes of cached GAL display lists corresponding to the item (for every layer it.
///< occupies)(in the std::pair "first" stores layer number, "second" stores group id).
GroupPair* m_groups;
std::pair<int, int>* m_groups; ///< layer_number:group_id pairs for each layer the
///< item occupies.
int m_groupsSize;
/// Stores layer numbers used by the item.
std::vector<int> m_layers;
std::vector<int> m_layers; /// Stores layer numbers used by the item.
};
@ -415,7 +410,7 @@ struct QUERY_VISITOR
bool operator()( VIEW_ITEM* aItem )
{
if( aItem->viewPrivData()->getFlags() & VISIBLE )
if( aItem->viewPrivData()->GetFlags() & VISIBLE )
m_cont.push_back( VIEW::LAYER_ITEM_PAIR( aItem, m_layer ) );
return true;
@ -946,8 +941,8 @@ struct VIEW::DRAW_ITEM_VISITOR
wxCHECK( aItem->viewPrivData(), false );
// Conditions that have to be fulfilled for an item to be drawn
bool drawCondition = aItem->viewPrivData()->isRenderable() &&
aItem->ViewGetLOD( layer, view ) < view->m_scale;
bool drawCondition = aItem->viewPrivData()->isRenderable()
&& aItem->ViewGetLOD( layer, view ) < view->m_scale;
if( !drawCondition )
return true;
@ -962,15 +957,21 @@ struct VIEW::DRAW_ITEM_VISITOR
void deferredDraw()
{
if( reverseDrawOrder )
{
std::sort( drawItems.begin(), drawItems.end(),
[]( VIEW_ITEM* a, VIEW_ITEM* b ) -> bool {
[]( VIEW_ITEM* a, VIEW_ITEM* b ) -> bool
{
return b->viewPrivData()->m_drawPriority < a->viewPrivData()->m_drawPriority;
});
}
else
{
std::sort( drawItems.begin(), drawItems.end(),
[]( VIEW_ITEM* a, VIEW_ITEM* b ) -> bool {
[]( VIEW_ITEM* a, VIEW_ITEM* b ) -> bool
{
return a->viewPrivData()->m_drawPriority < b->viewPrivData()->m_drawPriority;
});
}
for( VIEW_ITEM* item : drawItems )
view->draw( item, layer );
@ -1147,11 +1148,13 @@ void VIEW::Redraw()
rect.Normalize();
BOX2I recti( rect.GetPosition(), rect.GetSize() );
// The view rtree uses integer positions. Large screens can overflow
// this size so in this case, simply set the rectangle to the full rtree
if( rect.GetWidth() > std::numeric_limits<int>::max() ||
rect.GetHeight() > std::numeric_limits<int>::max() )
// The view rtree uses integer positions. Large screens can overflow this size so in
// this case, simply set the rectangle to the full rtree.
if( rect.GetWidth() > std::numeric_limits<int>::max()
|| rect.GetHeight() > std::numeric_limits<int>::max() )
{
recti.SetMaximum();
}
redrawRect( recti );
@ -1214,14 +1217,10 @@ void VIEW::invalidateItem( VIEW_ITEM* aItem, int aUpdateFlags )
// updateLayers updates geometry too, so we do not have to update both of them at the
// same time
if( aUpdateFlags & LAYERS )
{
updateLayers( aItem );
}
else if( aUpdateFlags & GEOMETRY )
{
updateBbox( aItem );
}
}
int layers[VIEW_MAX_LAYERS], layers_count;
aItem->ViewGetLayers( layers, layers_count );
@ -1376,11 +1375,10 @@ bool VIEW::areRequiredLayersEnabled( int aLayerId ) const
std::set<int>::const_iterator it, it_end;
for( it = m_layers.at( aLayerId ).requiredLayers.begin(),
it_end = m_layers.at( aLayerId ).requiredLayers.end(); it != it_end; ++it )
for( int layer : m_layers.at( aLayerId ).requiredLayers )
{
// That is enough if just one layer is not enabled
if( !m_layers.at( *it ).visible || !areRequiredLayersEnabled( *it ) )
if( !m_layers.at( layer ).visible || !areRequiredLayersEnabled( layer ) )
return false;
}

View File

@ -2,6 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013 CERN
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
* @author Maciej Suminski <maciej.suminski@cern.ch>
*
* This program is free software; you can redistribute it and/or
@ -31,7 +32,7 @@
*/
#include <set>
#include <algorithm>
#include <core/kicad_algo.h>
#include <view/view_group.h>
#include <view/view.h>
#include <painter.h>
@ -61,14 +62,7 @@ void VIEW_GROUP::Add( VIEW_ITEM* aItem )
void VIEW_GROUP::Remove( VIEW_ITEM* aItem )
{
for( auto iter = m_groupItems.begin(); iter != m_groupItems.end(); ++iter )
{
if( aItem == *iter )
{
m_groupItems.erase( iter );
break;
}
}
alg::delete_matching( m_groupItems, aItem );
}
@ -102,7 +96,7 @@ const BOX2I VIEW_GROUP::ViewBBox() const
{
bb = m_groupItems[0]->ViewBBox();
for( auto item : m_groupItems )
for( VIEW_ITEM* item : m_groupItems )
bb.Merge( item->ViewBBox() );
}
@ -204,7 +198,7 @@ void VIEW_GROUP::FreeItems()
}
const VIEW_GROUP::ITEMS VIEW_GROUP::updateDrawList() const
const std::vector<VIEW_ITEM*> VIEW_GROUP::updateDrawList() const
{
return m_groupItems;
}

View File

@ -2,6 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013-2016 CERN
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
*
* This program is free software; you can redistribute it and/or
@ -22,8 +23,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <gal/definitions.h>
#include <view/view_item.h>
#include <view/view.h>

View File

@ -61,8 +61,9 @@ struct VIEW_OVERLAY::COMMAND_LINE : public VIEW_OVERLAY::COMMAND
struct VIEW_OVERLAY::COMMAND_RECTANGLE : public VIEW_OVERLAY::COMMAND
{
COMMAND_RECTANGLE( const VECTOR2D& aP0, const VECTOR2D& aP1 ) :
m_p0( aP0 ), m_p1( aP1 )
{}
m_p0( aP0 ),
m_p1( aP1 )
{ }
virtual void Execute( VIEW* aView ) const override
{
@ -78,7 +79,8 @@ struct VIEW_OVERLAY::COMMAND_CIRCLE : public VIEW_OVERLAY::COMMAND
{
COMMAND_CIRCLE( const VECTOR2D& aCenter, double aRadius ) :
m_center(aCenter),
m_radius(aRadius) {}
m_radius(aRadius)
{ }
virtual void Execute( VIEW* aView ) const override
{
@ -114,7 +116,8 @@ struct VIEW_OVERLAY::COMMAND_ARC : public VIEW_OVERLAY::COMMAND
struct VIEW_OVERLAY::COMMAND_POLYGON : public VIEW_OVERLAY::COMMAND
{
COMMAND_POLYGON( const std::deque<VECTOR2D>& aPointList ) :
m_pointList( aPointList ) {}
m_pointList( aPointList )
{ }
virtual void Execute( VIEW* aView ) const override
{
@ -128,7 +131,8 @@ struct VIEW_OVERLAY::COMMAND_POLYGON : public VIEW_OVERLAY::COMMAND
struct VIEW_OVERLAY::COMMAND_POLY_POLYGON : public VIEW_OVERLAY::COMMAND
{
COMMAND_POLY_POLYGON( const SHAPE_POLY_SET& aPolySet ) :
m_polySet( aPolySet ) {}
m_polySet( aPolySet )
{ }
virtual void Execute( VIEW* aView ) const override
{
@ -161,7 +165,8 @@ struct VIEW_OVERLAY::COMMAND_POINT_POLYGON : public VIEW_OVERLAY::COMMAND
struct VIEW_OVERLAY::COMMAND_SET_STROKE : public VIEW_OVERLAY::COMMAND
{
COMMAND_SET_STROKE( bool aIsStroke ) :
m_isStroke( aIsStroke ) {}
m_isStroke( aIsStroke )
{ }
virtual void Execute( VIEW* aView ) const override
{
@ -175,7 +180,8 @@ struct VIEW_OVERLAY::COMMAND_SET_STROKE : public VIEW_OVERLAY::COMMAND
struct VIEW_OVERLAY::COMMAND_SET_FILL : public VIEW_OVERLAY::COMMAND
{
COMMAND_SET_FILL( bool aIsFill ) :
m_isFill( aIsFill ) {}
m_isFill( aIsFill )
{ }
virtual void Execute( VIEW* aView ) const override
{
@ -190,7 +196,8 @@ struct VIEW_OVERLAY::COMMAND_SET_COLOR : public VIEW_OVERLAY::COMMAND
{
COMMAND_SET_COLOR( bool aIsStroke, const COLOR4D& aColor ) :
m_isStroke( aIsStroke ),
m_color( aColor ) {}
m_color( aColor )
{ }
virtual void Execute( VIEW* aView ) const override
{
@ -208,7 +215,8 @@ struct VIEW_OVERLAY::COMMAND_SET_COLOR : public VIEW_OVERLAY::COMMAND
struct VIEW_OVERLAY::COMMAND_SET_WIDTH : public VIEW_OVERLAY::COMMAND
{
COMMAND_SET_WIDTH( double aWidth ) :
m_width( aWidth ) {}
m_width( aWidth )
{ }
virtual void Execute( VIEW* aView ) const override
{
@ -222,7 +230,8 @@ struct VIEW_OVERLAY::COMMAND_SET_WIDTH : public VIEW_OVERLAY::COMMAND
struct VIEW_OVERLAY::COMMAND_GLYPH_SIZE : public VIEW_OVERLAY::COMMAND
{
COMMAND_GLYPH_SIZE( const VECTOR2D aSize ) :
m_size( aSize ) {};
m_size( aSize )
{ };
virtual void Execute( VIEW* aView ) const override
{
@ -235,11 +244,11 @@ struct VIEW_OVERLAY::COMMAND_GLYPH_SIZE : public VIEW_OVERLAY::COMMAND
struct VIEW_OVERLAY::COMMAND_BITMAP_TEXT : public VIEW_OVERLAY::COMMAND
{
COMMAND_BITMAP_TEXT( const wxString& aText, const VECTOR2D& aPosition,
double aRotationAngle ) :
COMMAND_BITMAP_TEXT( const wxString& aText, const VECTOR2D& aPosition, double aRotationAngle ) :
m_text( aText ),
m_pos( aPosition ),
m_angle (aRotationAngle) {};
m_angle (aRotationAngle)
{ }
virtual void Execute( VIEW* aView ) const override
{
@ -264,7 +273,7 @@ VIEW_OVERLAY::~VIEW_OVERLAY()
void VIEW_OVERLAY::releaseCommands()
{
for( auto cmd : m_commands )
for( VIEW_OVERLAY::COMMAND* cmd : m_commands )
delete cmd;
m_commands.clear();
@ -288,7 +297,7 @@ const BOX2I VIEW_OVERLAY::ViewBBox() const
void VIEW_OVERLAY::ViewDraw( int aLayer, VIEW* aView ) const
{
for( const auto& cmd : m_commands )
for( const VIEW_OVERLAY::COMMAND* cmd : m_commands )
cmd->Execute( aView );
}
@ -323,10 +332,9 @@ void VIEW_OVERLAY::Polyline( const SHAPE_LINE_CHAIN& aPolyLine )
{
SetIsStroke( true );
SetIsFill( false );
for( int i = 0; i < aPolyLine.SegmentCount(); i++ )
{
Line( aPolyLine.CSegment( i ) );
}
}
@ -354,8 +362,8 @@ void VIEW_OVERLAY::Circle( const VECTOR2D& aCenterPoint, double aRadius )
}
void VIEW_OVERLAY::Arc( const VECTOR2D& aCenterPoint,
double aRadius, double aStartAngle, double aEndAngle )
void VIEW_OVERLAY::Arc( const VECTOR2D& aCenterPoint, double aRadius, double aStartAngle,
double aEndAngle )
{
m_commands.push_back( new COMMAND_ARC( aCenterPoint, aRadius, aStartAngle, aEndAngle ) );
}

View File

@ -2,6 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013-2017 CERN
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
* @author Maciej Suminski <maciej.suminski@cern.ch>
*
@ -171,7 +172,7 @@ public:
*/
bool HasType( KICAD_T aType ) const;
virtual const VIEW_GROUP::ITEMS updateDrawList() const override;
virtual const std::vector<KIGFX::VIEW_ITEM*> updateDrawList() const override;
bool HasReferencePoint() const
{

View File

@ -645,13 +645,6 @@ public:
m_dirtyTargets[i] = false;
}
/**
* Add an item to a list of items that are going to be refreshed upon the next frame rendering.
*
* @param aItem is the item to be refreshed.
*/
void MarkForUpdate( VIEW_ITEM* aItem );
/**
* Iterate through the list of items that asked for updating and updates them.
*/
@ -689,14 +682,6 @@ public:
m_useDrawPriority = aFlag;
}
/**
* @return true if draw order is reversed
*/
bool IsDrawOrderReversed() const
{
return m_reverseDrawOrder;
}
/**
* Only takes effect if UseDrawPriority is true.
*
@ -848,22 +833,12 @@ protected:
///< Center point of the VIEW (the point at which we are looking at).
VECTOR2D m_center;
///< Scale of displayed VIEW_ITEMs.
double m_scale;
///< View boundaries.
BOX2D m_boundary;
///< Scale lower limit.
double m_minScale;
///< Scale upper limit.
double m_maxScale;
///< Horizontal flip flag.
bool m_mirrorX;
///< Vertical flip flag.
bool m_mirrorY;
///< PAINTER contains information how do draw items.

View File

@ -51,22 +51,16 @@ public:
/**
* Return the number of stored items.
*
* @return Number of stored items.
*/
virtual unsigned int GetSize() const;
/**
* Add an item to the group.
*
* @param aItem is the item to be added.
*/
virtual void Add( VIEW_ITEM* aItem );
/**
* Remove an item from the group.
*
* @param aItem is the item to be removed.
*/
virtual void Remove( VIEW_ITEM* aItem );
@ -79,8 +73,6 @@ public:
/**
* Return the bounding box for all stored items covering all its layers.
*
* @return The current bounding box
*/
virtual const BOX2I ViewBBox() const override;
@ -102,8 +94,6 @@ public:
/**
* Set layer used to draw the group.
*
* @param aLayer is the layer used for drawing.
*/
inline virtual void SetLayer( int aLayer )
{
@ -116,15 +106,11 @@ public:
void FreeItems();
protected:
typedef std::vector<VIEW_ITEM*> ITEMS;
virtual const std::vector<VIEW_ITEM*> updateDrawList() const;
virtual const ITEMS updateDrawList() const;
///< Layer on which the group is drawn.
protected:
int m_layer;
///< Container for storing VIEW_ITEMs.
ITEMS m_groupItems;
std::vector<VIEW_ITEM*> m_groupItems;
};
} // namespace KIGFX

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013-2016 CERN
* Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2020-2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
*
@ -24,11 +24,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file view_item.h
* @brief VIEW_ITEM class definition.
*/
#ifndef __VIEW_ITEM_H
#define __VIEW_ITEM_H

View File

@ -4,7 +4,7 @@
* Copyright (C) 2013-2017 CERN
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
* @author Maciej Suminski <maciej.suminski@cern.ch>
* Copyright (C) 2017 KiCad Developers, see CHANGELOG.TXT for contributors.
* Copyright (C) 2017-2021 KiCad Developers, see CHANGELOG.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
@ -24,8 +24,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <limits>
#include <functional>
using namespace std::placeholders;
@ -84,7 +82,7 @@ EDA_ITEM* PCB_SELECTION::GetTopLeftItem( bool aFootprintsOnly ) const
}
const KIGFX::VIEW_GROUP::ITEMS PCB_SELECTION::updateDrawList() const
const std::vector<KIGFX::VIEW_ITEM*> PCB_SELECTION::updateDrawList() const
{
std::vector<VIEW_ITEM*> items;

View File

@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2019 KiCad Developers, see CHANGELOG.TXT for contributors.
* Copyright (C) 2019-2021 KiCad Developers, see CHANGELOG.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
@ -33,7 +33,7 @@ class PCB_SELECTION : public SELECTION
public:
EDA_ITEM* GetTopLeftItem( bool aFootprintsOnly = false ) const override;
const KIGFX::VIEW_GROUP::ITEMS updateDrawList() const override;
const std::vector<KIGFX::VIEW_ITEM*> updateDrawList() const override;
const LSET GetSelectionLayers();
};