KiCad PCB EDA Suite
Loading...
Searching...
No Matches
render_3d_raytrace_ram.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-2020 Mario Luzeiro <[email protected]>
5 * Copyright (C) 2024 Alex Shvartzkop <[email protected]>
6 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 */
21
22#ifndef RENDER_3D_RAYTRACE_RAM_H
23#define RENDER_3D_RAYTRACE_RAM_H
24
26
27
29{
30public:
31 // TODO: Take into account board thickness so that the camera won't move inside of the board
32 // when facing it perpendicularly.
33 static constexpr float MIN_DISTANCE_IU = 4 * PCB_IU_PER_MM;
34
35 explicit RENDER_3D_RAYTRACE_RAM( BOARD_ADAPTER& aAdapter, CAMERA& aCamera );
36
38
39 uint8_t* GetBuffer();
40 wxSize GetRealBufferSize();
41
42 void SetCurWindowSize( const wxSize& aSize ) override;
43 bool Redraw( bool aIsMoving, REPORTER* aStatusReporter, REPORTER* aWarningReporter ) override;
44
45private:
46 void initPbo() override;
47 void deletePbo() override;
48
50 uint32_t m_pboDataSize;
51};
52
53
54#endif // RENDER_3D_RAYTRACE_RAM_H
constexpr double PCB_IU_PER_MM
Pcbnew IU is 1 nanometer.
Definition base_units.h:68
Helper class to handle information needed to display 3D board.
A class used to derive camera objects from.
Definition camera.h:99
RENDER_3D_RAYTRACE_BASE(BOARD_ADAPTER &aAdapter, CAMERA &aCamera)
RENDER_3D_RAYTRACE_RAM(BOARD_ADAPTER &aAdapter, CAMERA &aCamera)
bool Redraw(bool aIsMoving, REPORTER *aStatusReporter, REPORTER *aWarningReporter) override
Redraw the view.
static constexpr float MIN_DISTANCE_IU
void SetCurWindowSize(const wxSize &aSize) override
Before each render, the canvas will tell the render what is the size of its windows,...
A pure virtual class used to derive REPORTER objects from.
Definition reporter.h:71