2018-08-03 12:18:26 +00:00
|
|
|
#ifndef SCH_VIEW_H_
|
|
|
|
#define SCH_VIEW_H_
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
#include <view/view.h>
|
2018-10-10 15:26:23 +00:00
|
|
|
#include <math/box2.h>
|
2018-08-03 12:18:26 +00:00
|
|
|
|
|
|
|
#include <view/wx_view_controls.h>
|
|
|
|
#include <worksheet_viewitem.h>
|
|
|
|
#include <layers_id_colors_and_visibility.h>
|
|
|
|
|
|
|
|
class SCH_SHEET;
|
|
|
|
class SCH_SCREEN;
|
|
|
|
class LIB_PART;
|
|
|
|
|
2018-09-16 21:19:33 +00:00
|
|
|
namespace KIGFX
|
|
|
|
{
|
2018-08-03 12:18:26 +00:00
|
|
|
class VIEW_GROUP;
|
2018-09-16 21:19:33 +00:00
|
|
|
class WORKSHEET_VIEWITEM;
|
2018-08-03 12:18:26 +00:00
|
|
|
|
2018-09-16 21:19:33 +00:00
|
|
|
namespace PREVIEW
|
|
|
|
{
|
|
|
|
class SELECTION_AREA;
|
|
|
|
};
|
2018-08-03 12:18:26 +00:00
|
|
|
|
|
|
|
class SCH_VIEW : public KIGFX::VIEW
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SCH_VIEW( bool aIsDynamic );
|
|
|
|
~SCH_VIEW();
|
|
|
|
|
2018-10-10 15:26:23 +00:00
|
|
|
virtual void Add( VIEW_ITEM* aItem, int aDrawPriority = -1 ) override;
|
|
|
|
virtual void Remove( VIEW_ITEM* aItem ) override;
|
|
|
|
|
2018-08-03 12:18:26 +00:00
|
|
|
void DisplaySheet( SCH_SHEET *aSheet );
|
|
|
|
void DisplaySheet( SCH_SCREEN *aSheet );
|
|
|
|
void DisplayComponent( LIB_PART *aPart );
|
|
|
|
|
|
|
|
KIGFX::PREVIEW::SELECTION_AREA* GetSelectionArea() const { return m_selectionArea.get(); }
|
|
|
|
|
|
|
|
KIGFX::VIEW_GROUP* GetPreview() const { return m_preview.get(); }
|
|
|
|
|
|
|
|
void ClearPreview();
|
|
|
|
void AddToPreview( EDA_ITEM *aItem, bool makeCopy = true );
|
|
|
|
|
|
|
|
void ShowSelectionArea( bool aShow = true );
|
|
|
|
void ShowPreview( bool aShow = true );
|
|
|
|
|
|
|
|
void ClearHiddenFlags();
|
|
|
|
void HideWorksheet();
|
|
|
|
|
2018-10-10 15:26:23 +00:00
|
|
|
virtual void Redraw() override;
|
|
|
|
|
2018-08-03 12:18:26 +00:00
|
|
|
private:
|
|
|
|
std::unique_ptr<WORKSHEET_VIEWITEM> m_worksheet;
|
|
|
|
std::unique_ptr<KIGFX::PREVIEW::SELECTION_AREA> m_selectionArea;
|
|
|
|
std::unique_ptr<KIGFX::VIEW_GROUP> m_preview;
|
|
|
|
std::vector<EDA_ITEM *> m_previewItems;
|
2018-10-10 15:26:23 +00:00
|
|
|
std::unordered_map<VIEW_ITEM*, BOX2I> m_cachedBBoxes;
|
2018-08-03 12:18:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}; // namespace
|
|
|
|
|
|
|
|
#endif
|