25 #ifndef BOARD_ADAPTER_H 26 #define BOARD_ADAPTER_H 30 #include "../3d_rendering/raytracing/accelerators/container_2d.h" 31 #include "../3d_rendering/raytracing/accelerators/container_3d.h" 32 #include "../3d_rendering/raytracing/shapes3D/bbox_3d.h" 33 #include "../3d_rendering/camera.h" 34 #include "../3d_enums.h" 35 #include "../3d_cache/3d_cache.h" 36 #include "../common_ogl/ogl_attr_list.h" 41 #include <wx/gdicmn.h> 57 typedef std::map< PCB_LAYER_ID, SHAPE_POLY_SET *>
MAP_POLY;
62 #define RANGE_SCALE_3D 8.0f 569 int aClearanceValue );
572 PCB_LAYER_ID aLayer,
const wxSize& aClearanceValue )
const;
578 bool aSkipNPTHPadsWihNoCopper,
bool aSkipPlatedPads,
579 bool aSkipNonPlatedPads );
593 int aClearanceValue );
599 int aCircleToSegmentsCount,
int aWidth,
788 #endif // BOARD_ADAPTER_H BVH_CONTAINER_2D m_throughHoleViaOds
List of through hole via inner diameters.
GRID3D_TYPE GetGridType() const noexcept
Get the current grid.
bool GetFlag(DISPLAY3D_FLG aFlag) const
Get a configuration status of a flag.
BVH_CONTAINER_2D * m_platedPadsFront
int m_RtShadowSampleCount
SFVEC4F m_SilkScreenColorBot
in realistic mode: SilkScreen color ( bot )
SHAPE_POLY_SET * m_backPlatedPadPolys
Polygon contours for hole outer diameters for each layer.
float m_solderPasteLayerThickness3DU
Number of tracks in the board.
BVH_CONTAINER_2D m_throughHoleIds
List of through hole vias with the radius of the hole inflated with the copper thickness.
bool IsFootprintShown(FOOTPRINT_ATTR_T aFPAttributes) const
Test if footprint should be displayed in relation to attributes and the flags.
void buildPadOutlineAsSegments(const PAD *aPad, CONTAINER_2D_BASE *aDstContainer, int aWidth)
float m_nonCopperLayerThickness3DU
solder paste layers thickness in 3D units.
SHAPE_POLY_SET * m_frontPlatedPadPolys
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
std::map< PCB_LAYER_ID, SHAPE_POLY_SET * > MAP_POLY
A type that stores polysets for each layer id.
void SetAntiAliasingMode(ANTIALIASING_MODE aAAmode)
Set the current antialiasing mode value.
const SHAPE_POLY_SET & GetOuterNonPlatedThroughHolePoly() const noexcept
OBJECT_2D * createPadWithDrill(const PAD *aPad, int aInflateValue)
Manage a bounding box defined by two SFVEC3F min max points.
SFVEC4F GetColor(const COLOR4D &aColor) const
float m_averageHoleDiameter
const BVH_CONTAINER_2D & GetThroughHoleAnnularRings() const noexcept
Get the through hole annular rings container.
static KIGFX::COLOR4D g_DefaultSilkscreen
const SHAPE_POLY_SET & GetThroughHoleOdPolys() const noexcept
Get through hole outside diameter 2D polygons.
void SetFlag(DISPLAY3D_FLG aFlag, bool aState)
Set the status of a flag.
COLOR_SETTINGS * m_colors
float GetAverageTrackWidth() const noexcept
Average width of the tracks.
SFVEC4F m_SolderMaskColorTop
in realistic mode: solder mask color ( top )
void createPadWithClearance(const PAD *aPad, CONTAINER_2D_BASE *aDstContainer, PCB_LAYER_ID aLayer, const wxSize &aClearanceValue) const
SHAPE_POLY_SET m_throughHoleAnnularRingPolys
const MAP_CONTAINER_2D_BASE & GetLayerMap() const noexcept
Get the map of containers that have the objects per layer.
MAP_CONTAINER_2D_BASE m_layerMap
2D elements for each layer.
void transformArcToSegments(const wxPoint &aCentre, const wxPoint &aStart, double aArcAngle, int aCircleToSegmentsCount, int aWidth, CONTAINER_2D_BASE *aDstContainer, const BOARD_ITEM &aBoardItem)
void transformFPShapesToPolygon(const FOOTPRINT *aFootprint, PCB_LAYER_ID aLayer, SHAPE_POLY_SET &aCornerBuffer) const
static KIGFX::COLOR4D g_DefaultSurfaceFinish
float GetAverageHoleDiameter() const noexcept
Average diameter of through holes.
float GetNonCopperLayerThickness() const noexcept
Get the current non copper layers thickness.
BVH_CONTAINER_2D m_throughHoleOds
List of plated through hole annular rings.
void InitSettings(REPORTER *aStatusReporter, REPORTER *aWarningReporter)
Function to be called by the render when it need to reload the settings for the board.
std::vector< SFVEC2F > m_RtLightSphericalCoords
SFVEC4F m_BoardBodyColor
in realistic mode: FR4 board color
SFVEC4F m_SolderPasteColor
in realistic mode: solder paste color
SHAPE_POLY_SET m_throughHoleViaOdPolys
Polygon contours for through hole via annular rings.
float m_averageTrackWidth
Number of through hole vias in the board.
SFVEC4F m_SolderMaskColorBot
in realistic mode: solder mask color ( bot )
void SetGridType(GRID3D_TYPE aGridType) noexcept
Set the current grid.
const SHAPE_POLY_SET & GetThroughHoleViaOdPolys() const noexcept
wxPoint m_boardPos
Board center position in board internal units.
const SHAPE_POLY_SET * GetFrontPlatedPadPolys()
std::vector< CUSTOM_COLOR_ITEM > CUSTOM_COLORS_LIST
Cache for storing the 3D shapes.
A pure virtual class used to derive REPORTER objects from.
std::array< float, PCB_LAYER_ID_COUNT > m_layerZcoordBottom
Copper thickness in 3D units.
float m_epoxyThickness3DU
Non copper layers thickness in 3D units.
void addFootprintShapesWithClearance(const FOOTPRINT *aFootprint, CONTAINER_2D_BASE *aDstContainer, PCB_LAYER_ID aLayerId, int aInflateValue)
static CUSTOM_COLORS_LIST g_BoardColors
float m_copperThickness3DU
Epoxy thickness in 3D units.
static KIGFX::COLOR4D g_DefaultBackgroundBot
MAP_POLY m_layerHoleIdPolys
Polygon contours for non plated through hole outer diameters.
float m_RtSpreadRefractions
SFVEC3F m_RtCameraLightColor
const SHAPE_POLY_SET * GetBackPlatedPadPolys()
static CUSTOM_COLORS_LIST g_FinishColors
const SHAPE_POLY_SET & GetThroughHoleAnnularRingPolys() const noexcept
void SetBoard(BOARD *aBoard) noexcept
Set current board to be rendered.
const BVH_CONTAINER_2D & GetThroughHoleIds() const noexcept
Get the through hole inner diameter container.
Classes used in Pcbnew, CvPcb and GerbView.
static CUSTOM_COLORS_LIST g_PasteColors
RENDER_ENGINE GetRenderEngine() const noexcept
A class used to derive camera objects from.
bool Is3dLayerEnabled(PCB_LAYER_ID aLayer) const
Check if a layer is enabled.
static KIGFX::COLOR4D g_DefaultSolderMask
static KIGFX::COLOR4D g_DefaultBoardBody
void addShapeWithClearance(const PCB_TEXT *aText, CONTAINER_2D_BASE *aDstContainer, PCB_LAYER_ID aLayerId, int aClearanceValue)
const BVH_CONTAINER_2D * GetPlatedPadsBack() const noexcept
int m_RtRecursiveReflectionCount
float m_RtSpreadReflections
SFVEC4F m_BgColorTop
background top color
unsigned int m_trackCount
Track average width.
std::vector< bool > m_drawFlags
std::array< float, PCB_LAYER_ID_COUNT > m_layerZcoordTop
Bottom (Start) Z position of each layer in 3D units.
void Set3dCacheManager(S3D_CACHE *aCachePointer) noexcept
Update the cache manager pointer.
SHAPE_POLY_SET m_board_poly
Board outline polygon.
S3D_CACHE * Get3dCacheManager() const noexcept
Return the 3D cache manager pointer.
BVH_CONTAINER_2D * m_platedPadsBack
The holes per each layer.
BBOX_3D m_boardBoundingBox
3D bounding box of the board in 3D units.
Represent a set of closed polygons.
wxPoint GetBoardPos() const noexcept
Get the board center.
float GetLayerTopZPos(PCB_LAYER_ID aLayerId) const noexcept
Get the top z position.
MAP_POLY m_layerHoleOdPolys
Polygon contours for hole inner diameters for each layer.
void buildPadOutlineAsPolygon(const PAD *aPad, SHAPE_POLY_SET &aCornerBuffer, int aWidth) const
MAP_CONTAINER_2D_BASE m_layerHoleMap
List of through holes with the radius of the hole inflated with the copper thickness.
float GetLayerBottomZPos(PCB_LAYER_ID aLayerId) const noexcept
Get the bottom z position.
void addSolidAreasShapes(const ZONE *aZoneContainer, CONTAINER_2D_BASE *aDstContainer, PCB_LAYER_ID aLayerId)
MATERIAL_MODE GetMaterialMode() const noexcept
SFVEC3F m_RtLightColorTop
static KIGFX::COLOR4D g_DefaultBackgroundTop
void SetMaterialMode(MATERIAL_MODE aMaterialMode) noexcept
double BiuTo3dUnits() const noexcept
Board integer units To 3D units.
void addPadsWithClearance(const FOOTPRINT *aFootprint, CONTAINER_2D_BASE *aDstContainer, PCB_LAYER_ID aLayerId, int aInflateValue, bool aSkipNPTHPadsWihNoCopper, bool aSkipPlatedPads, bool aSkipNonPlatedPads)
const BOARD * GetBoard() const noexcept
Get current board to be rendered.
const MAP_POLY & GetHoleIdPolysMap() const noexcept
double m_biuTo3Dunits
Top (End) Z position of each layer in 3D units.
SFVEC4F m_BgColorBot
background bottom color
void createTrack(const PCB_TRACK *aTrack, CONTAINER_2D_BASE *aDstContainer, int aClearanceValue)
ANTIALIASING_MODE
Anti-aliasing options.
Handle a list of polygons defining a copper zone.
BVH_CONTAINER_2D m_throughHoleAnnularRings
List of through hole inner diameters.
const BVH_CONTAINER_2D & GetThroughHoleOds() const noexcept
Get the inflated through hole outside diameters container.
const MAP_POLY & GetHoleOdPolysMap() const noexcept
unsigned int m_viaCount
Computed average diameter of the via holes in 3D units.
int m_RtRecursiveRefractionCount
std::vector< SFVEC3F > m_RtLightColor
const SHAPE_POLY_SET & GetBoardPoly() const noexcept
Get the current polygon of the epoxy board.
MATERIAL_MODE
Render 3d model shape materials mode.
std::map< PCB_LAYER_ID, BVH_CONTAINER_2D * > MAP_CONTAINER_2D_BASE
A type that stores a container of 2d objects for each layer id.
int m_RtRefractionSampleCount
SFVEC4F GetItemColor(int aItemId) const
Get the technical color of a layer.
void createLayers(REPORTER *aStatusReporter)
void SetRenderEngine(RENDER_ENGINE aRenderEngine) noexcept
const MAP_POLY & GetPolyMap() const noexcept
Get map of polygon's layers.
float GetFootprintZPos(bool aIsFlipped) const
Get the position of the footprint in 3d integer units considering if it is flipped or not.
DISPLAY3D_FLG
Flags used in rendering options.
RENDER_ENGINE m_renderEngine
S3D_CACHE * m_3dModelManager
const BBOX_3D & GetBBox() const noexcept
Get the board outling bounding box.
unsigned int GetViaCount() const noexcept
Get number of vias in this board.
wxSize m_boardSize
Board size in board internal units.
unsigned int GetHoleCount() const noexcept
Get number of holes in this board.
SFVEC4F GetLayerColor(PCB_LAYER_ID aLayerId) const
Get the technical color of a layer.
MATERIAL_MODE m_materialMode
const BVH_CONTAINER_2D * GetPlatedPadsFront() const noexcept
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.
ANTIALIASING_MODE GetAntiAliasingMode() const
Get the current antialiasing mode value.
virtual ~EDA_3D_BOARD_HOLDER()
Information pertinent to a Pcbnew printed circuit board.
static KIGFX::COLOR4D g_DefaultSolderPaste
PCB_LAYER_ID
A quick note on layer IDs:
unsigned int m_copperLayersCount
Scale factor to convert board internal units to 3D units normalized between -1.0 and 1....
const BVH_CONTAINER_2D & GetThroughHoleViaOds() const noexcept
bool createBoardPolygon(wxString *aErrorMsg)
Create the board outline polygon.
SFVEC4F m_CopperColor
in realistic mode: copper color
const SFVEC3F & GetBoardCenter() const noexcept
The board center position in 3D units.
BVH_CONTAINER_2D m_throughHoleViaIds
Number of copper layers actually used by the board.
virtual CAMERA & GetCurrentCamera()=0
float GetAverageViaHoleDiameter() const noexcept
Thee average diameter of the via holes.
RENDER_ENGINE
Render engine mode.
SFVEC3F m_OpenGlSelectionColor
Color settings are a bit different than most of the settings objects in that there can be more than o...
SFVEC4F m_SilkScreenColorTop
in realistic mode: SilkScreen color ( top )
static CUSTOM_COLORS_LIST g_MaskColors
float GetCopperThickness() const noexcept
Get the current copper layer thickness.
void SetColorSettings(COLOR_SETTINGS *aSettings) noexcept
ANTIALIASING_MODE m_antiAliasingMode
static CUSTOM_COLORS_LIST g_SilkscreenColors
SFVEC3F m_boardCenter
3D center position of the board in 3D units.
float GetEpoxyThickness() const noexcept
Get the current epoxy thickness.
float m_averageViaHoleDiameter
Number of holes in the board.
SFVEC3F m_RtLightColorBottom
const MAP_CONTAINER_2D_BASE & GetLayerHoleMap() const noexcept
Get the map of container that have the holes per layer.
virtual BOARD_ADAPTER & GetAdapter()=0
SHAPE_POLY_SET m_throughHoleOdPolys
Polygon contours for through holes via outer diameters.
wxSize GetBoardSize() const noexcept
Get the board size.
Helper class to handle information needed to display 3D board.
unsigned int GetCircleSegmentCount(float aDiameter3DU) const
int m_RtReflectionSampleCount
SHAPE_POLY_SET m_nonPlatedThroughHoleOdPolys
Polygon contours for through hole outer diameters.
unsigned int m_holeCount
Computed average diameter of the holes in 3D units.
int GetHolePlatingThickness() const noexcept
Get the current copper layer thickness.
A color representation with 4 components: red, green, blue, alpha.