KiCad PCB EDA Suite
Loading...
Searching...
No Matches
render_3d_base.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2015-2016 Mario Luzeiro <[email protected]>
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
24
25#ifndef RENDER_3D_BASE_H
26#define RENDER_3D_BASE_H
27
28
29#include <pcb_base_frame.h>
31#include <reporter.h>
32
34
39{
40public:
41 explicit RENDER_3D_BASE( BOARD_ADAPTER& aBoardAdapter, CAMERA& aCamera );
42
43 virtual ~RENDER_3D_BASE() = 0;
44
51 virtual void SetCurWindowSize( const wxSize& aSize ) = 0;
52
59 virtual bool Redraw( bool aIsMoving ) = 0;
60
65
72
79 virtual int GetWaitForEditingTimeOut() = 0;
80
84 virtual void JoinBgWorker() {}
85
89 virtual void StopBgWorker() {}
90
98
105 void SetReporters( std::shared_ptr<REPORTER> aActivityReporter, std::shared_ptr<REPORTER> aWarningReporter )
106 {
107 m_activityReporter = aActivityReporter;
108 m_warningReporter = aWarningReporter;
109 }
110
111protected:
115 std::unique_ptr<BUSY_INDICATOR> CreateBusyIndicator() const;
116
119
121
124
127
130
131 std::shared_ptr<REPORTER> m_activityReporter;
132 std::shared_ptr<REPORTER> m_warningReporter;
133
140 static const wxChar* m_logTrace;
141
142private:
145};
146
147#endif // RENDER_3D_BASE_H
Helper class to handle information needed to display 3D board.
std::function< std::unique_ptr< BUSY_INDICATOR >()> FACTORY
A factory function that returns a new busy indicator.
A class used to derive camera objects from.
Definition camera.h:99
virtual void JoinBgWorker()
Block until any in-progress background loading has finished.
BUSY_INDICATOR::FACTORY m_busyIndicatorFactory
Factory that returns a suitable busy indicator for the context.
virtual bool Redraw(bool aIsMoving)=0
Redraw the view.
std::unique_ptr< BUSY_INDICATOR > CreateBusyIndicator() const
Return a created busy indicator, if a factory has been set, else a null pointer.
virtual int GetWaitForEditingTimeOut()=0
Give the interface the time (in ms) that it should wait for editing or movements before (this works f...
std::shared_ptr< REPORTER > m_warningReporter
RENDER_3D_BASE(BOARD_ADAPTER &aBoardAdapter, CAMERA &aCamera)
bool m_canvasInitialized
Flag if the canvas specific for this render was already initialized.
virtual void SetCurWindowSize(const wxSize &aSize)=0
Before each render, the canvas will tell the render what is the size of its windows,...
virtual ~RENDER_3D_BASE()=0
std::shared_ptr< REPORTER > m_activityReporter
void SetReporters(std::shared_ptr< REPORTER > aActivityReporter, std::shared_ptr< REPORTER > aWarningReporter)
Set the reporters for activity and warning messages.
virtual void StopBgWorker()
Request stop and join any in-progress background loading.
wxSize m_windowSize
The window size that this camera is working.
BOARD_ADAPTER & m_boardAdapter
Settings reference in use for this render.
void SetBusyIndicatorFactory(BUSY_INDICATOR::FACTORY aNewFactory)
Set a new busy indicator factory.
bool IsReloadRequestPending() const
Query if there is a pending reload request.
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.