KiCad PCB EDA Suite
cinfo3d_visu.cpp
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 <mrluzeiro@ua.pt>
5  * Copyright (C) 1992-2016 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, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
30 #include "../3d_rendering/ccamera.h"
31 #include "cinfo3d_visu.h"
33 #include <class_board.h>
34 #include <3d_math.h>
35 #include "3d_fastmath.h"
37 #include <math/util.h> // for KiROUND
38 #include <pgm_base.h>
40 
47 const wxChar *CINFO3D_VISU::m_logTrace = wxT( "KI_TRACE_EDA_CINFO3D_VISU" );
48 
49 
51 
52 
54  m_currentCamera( m_trackBallCamera ),
55  m_trackBallCamera( RANGE_SCALE_3D )
56 {
57  wxLogTrace( m_logTrace, wxT( "CINFO3D_VISU::CINFO3D_VISU" ) );
58 
59  m_board = NULL;
62  m_drawFlags.resize( FL_LAST, false );
63 
64  if( PgmOrNull() )
65  m_colors = Pgm().GetSettingsManager().GetColorSettings();
66 
69 
70  m_boardPos = wxPoint();
71  m_boardSize = wxSize();
72  m_boardCenter = SFVEC3F( 0.0f );
73 
75 
76  m_layers_container2D.clear();
77  m_layers_holes2D.clear();
80 
82  m_epoxyThickness3DU = 0.0f;
83  m_copperThickness3DU = 0.0f;
85  m_biuTo3Dunits = 1.0;
86 
88  m_stats_nr_vias = 0;
90  m_stats_nr_holes = 0;
93 
96 
97 
98  memset( m_layerZcoordTop, 0, sizeof( m_layerZcoordTop ) );
99  memset( m_layerZcoordBottom, 0, sizeof( m_layerZcoordBottom ) );
100 
103  SetFlag( FL_SHOW_BOARD_BODY, true );
108  SetFlag( FL_ZONE, true );
109  SetFlag( FL_SILKSCREEN, true );
110  SetFlag( FL_SOLDERMASK, true );
112 
113  m_BgColorBot = SFVEC3D( 0.4, 0.4, 0.5 );
114  m_BgColorTop = SFVEC3D( 0.8, 0.8, 0.9 );
115  m_BoardBodyColor = SFVEC3D( 0.4, 0.4, 0.5 );
116  m_SolderMaskColorTop = SFVEC3D( 0.1, 0.2, 0.1 );
117  m_SolderMaskColorBot = SFVEC3D( 0.1, 0.2, 0.1 );
118  m_SolderPasteColor = SFVEC3D( 0.4, 0.4, 0.4 );
119  m_SilkScreenColorTop = SFVEC3D( 0.9, 0.9, 0.9 );
120  m_SilkScreenColorBot = SFVEC3D( 0.9, 0.9, 0.9 );
121  m_CopperColor = SFVEC3D( 0.75, 0.61, 0.23 );
122 }
123 
124 
126 {
127  destroyLayers();
128 }
129 
130 
132 {
133  wxASSERT( aLayer < PCB_LAYER_ID_COUNT );
134 
135  DISPLAY3D_FLG flg;
136 
137  // see if layer needs to be shown
138  // check the flags
139  switch( aLayer )
140  {
141  case B_Adhes:
142  case F_Adhes:
143  flg = FL_ADHESIVE;
144  break;
145 
146  case B_Paste:
147  case F_Paste:
148  flg = FL_SOLDERPASTE;
149  break;
150 
151  case B_SilkS:
152  case F_SilkS:
153  flg = FL_SILKSCREEN;
154  break;
155 
156  case B_Mask:
157  case F_Mask:
158  flg = FL_SOLDERMASK;
159  break;
160 
161  case Dwgs_User:
162  case Cmts_User:
164  return false;
165 
166  flg = FL_COMMENTS;
167  break;
168 
169  case Eco1_User:
170  case Eco2_User:
172  return false;
173 
174  flg = FL_ECO;
175  break;
176 
177  case Edge_Cuts:
179  return false;
180 
181  return true;
182  break;
183 
184  case Margin:
186  return false;
187 
188  return true;
189  break;
190 
191  case B_Cu:
192  case F_Cu:
193  return m_board->GetDesignSettings().IsLayerVisible( aLayer ) ||
195  break;
196 
197  default:
198  // the layer is an internal copper layer, used the visibility
200  {
201  // Do not render internal layers if it is overlap with the board
202  // (on OpenGL render)
203  return false;
204  }
205 
206  return m_board->GetDesignSettings().IsLayerVisible( aLayer );
207  }
208 
209  // The layer has a flag, return the flag
210  return GetFlag( flg );
211 }
212 
213 
215 {
216  wxASSERT( aFlag < FL_LAST );
217 
218  return m_drawFlags[aFlag];
219 }
220 
221 
222 void CINFO3D_VISU::SetFlag( DISPLAY3D_FLG aFlag, bool aState )
223 {
224  wxASSERT( aFlag < FL_LAST );
225 
226  m_drawFlags[aFlag] = aState;
227 }
228 
230 {
231  if( ( ( aModuleAttributs == MOD_DEFAULT ) &&
233  ( ( ( aModuleAttributs & MOD_CMS) == MOD_CMS ) &&
235  ( ( ( aModuleAttributs & MOD_VIRTUAL) == MOD_VIRTUAL ) &&
237  {
238  return true;
239  }
240 
241  return false;
242 }
243 
244 
245 // !TODO: define the actual copper thickness by user
246 #define COPPER_THICKNESS KiROUND( 0.035 * IU_PER_MM ) // for 35 um
247 #define TECH_LAYER_THICKNESS KiROUND( 0.04 * IU_PER_MM )
248 
250 {
251  return COPPER_THICKNESS;
252 }
253 
254 unsigned int CINFO3D_VISU::GetNrSegmentsCircle( float aDiameter3DU ) const
255 {
256  wxASSERT( aDiameter3DU > 0.0f );
257 
258  return GetNrSegmentsCircle( (int)( aDiameter3DU / m_biuTo3Dunits ) );
259 }
260 
261 
262 unsigned int CINFO3D_VISU::GetNrSegmentsCircle( int aDiameterBIU ) const
263 {
264  wxASSERT( aDiameterBIU > 0 );
265 
266  // Require at least 3 segments for a circle
267  return std::max( GetArcToSegmentCount( aDiameterBIU / 2, ARC_HIGH_DEF, 360.0 ), 3 );
268 }
269 
270 
271 double CINFO3D_VISU::GetCircleCorrectionFactor( int aNrSides ) const
272 {
273  wxASSERT( aNrSides >= 3 );
274 
275  return GetCircletoPolyCorrectionFactor( aNrSides );
276 }
277 
278 
279 void CINFO3D_VISU::InitSettings( REPORTER* aStatusTextReporter, REPORTER* aWarningTextReporter )
280 {
281  wxLogTrace( m_logTrace, wxT( "CINFO3D_VISU::InitSettings" ) );
282 
283  // Calculates the board bounding box
284  // First, use only the board outlines
285  EDA_RECT bbbox = m_board->ComputeBoundingBox( true );
286 
287  // If no outlines, use the board with items
288  if( ( bbbox.GetWidth() == 0 ) && ( bbbox.GetHeight() == 0 ) )
289  bbbox = m_board->ComputeBoundingBox( false );
290 
291  // Gives a non null size to avoid issues in zoom / scale calculations
292  if( ( bbbox.GetWidth() == 0 ) && ( bbbox.GetHeight() == 0 ) )
293  bbbox.Inflate( Millimeter2iu( 10 ) );
294 
295  m_boardSize = bbbox.GetSize();
296  m_boardPos = bbbox.Centre();
297 
298  wxASSERT( (m_boardSize.x > 0) && (m_boardSize.y > 0) );
299 
300  m_boardPos.y = -m_boardPos.y; // The y coord is inverted in 3D viewer
301 
303 
304  // Ensure the board has 2 sides for 3D views, because it is hard to find
305  // a *really* single side board in the true life...
306  if( m_copperLayersCount < 2 )
308 
309  // Calculate the convertion to apply to all positions.
311 
314 
315  // !TODO: use value defined by user (currently use default values by ctor
318 
319  // Init Z position of each layer
320  // calculate z position for each copper layer
321  // Zstart = -m_epoxyThickness / 2.0 is the z position of the back (bottom layer) (layer id = 31)
322  // Zstart = +m_epoxyThickness / 2.0 is the z position of the front (top layer) (layer id = 0)
323  // all unused copper layer z position are set to 0
324 
325  // ____==__________==________==______ <- Bottom = +m_epoxyThickness / 2.0,
326  // | | Top = Bottom + m_copperThickness
327  // |__________________________________|
328  // == == == == <- Bottom = -m_epoxyThickness / 2.0,
329  // Top = Bottom - m_copperThickness
330 
331  unsigned int layer;
332 
333  for( layer = 0; layer < m_copperLayersCount; ++layer )
334  {
335  m_layerZcoordBottom[layer] = m_epoxyThickness3DU / 2.0f -
336  (m_epoxyThickness3DU * layer / (m_copperLayersCount - 1) );
337 
338  if( layer < (m_copperLayersCount / 2) )
340  else
342  }
343 
344  #define layerThicknessMargin 1.1
345  const float zpos_offset = m_nonCopperLayerThickness3DU * layerThicknessMargin;
346 
347  // Fill remaining unused copper layers and back layer zpos
348  // with -m_epoxyThickness / 2.0
349  for( ; layer < MAX_CU_LAYERS; layer++ )
350  {
351  m_layerZcoordBottom[layer] = -(m_epoxyThickness3DU / 2.0f);
353  }
354 
355  // This is the top of the copper layer thickness.
356  const float zpos_copperTop_back = m_layerZcoordTop[B_Cu];
357  const float zpos_copperTop_front = m_layerZcoordTop[F_Cu];
358 
359  // calculate z position for each non copper layer
360  // Solder mask and Solder paste have the same Z position
361  for( int layer_id = MAX_CU_LAYERS; layer_id < PCB_LAYER_ID_COUNT; ++layer_id )
362  {
363  float zposTop;
364  float zposBottom;
365 
366  switch( layer_id )
367  {
368  case B_Adhes:
369  zposBottom = zpos_copperTop_back - 2.0f * zpos_offset;
370  zposTop = zposBottom - m_nonCopperLayerThickness3DU;
371  break;
372 
373  case F_Adhes:
374  zposBottom = zpos_copperTop_front + 2.0f * zpos_offset;
375  zposTop = zposBottom + m_nonCopperLayerThickness3DU;
376  break;
377 
378  case B_Mask:
379  case B_Paste:
380  zposBottom = zpos_copperTop_back;
381  zposTop = zpos_copperTop_back - m_nonCopperLayerThickness3DU;
382  break;
383 
384  case F_Mask:
385  case F_Paste:
386  zposTop = zpos_copperTop_front + m_nonCopperLayerThickness3DU;
387  zposBottom = zpos_copperTop_front;
388  break;
389 
390  case B_SilkS:
391  zposBottom = zpos_copperTop_back - 1.0f * zpos_offset;
392  zposTop = zposBottom - m_nonCopperLayerThickness3DU;
393  break;
394 
395  case F_SilkS:
396  zposBottom = zpos_copperTop_front + 1.0f * zpos_offset;
397  zposTop = zposBottom + m_nonCopperLayerThickness3DU;
398  break;
399 
400  // !TODO: review
401  default:
402  zposTop = zpos_copperTop_front + (layer_id - MAX_CU_LAYERS + 3.0f) * zpos_offset;
403  zposBottom = zposTop - m_nonCopperLayerThickness3DU;
404  break;
405  }
406 
407  m_layerZcoordTop[layer_id] = zposTop;
408  m_layerZcoordBottom[layer_id] = zposBottom;
409  }
410 
413  0.0f );
414 
415  SFVEC3F boardSize = SFVEC3F( m_boardSize.x * m_biuTo3Dunits,
417  0.0f );
418  boardSize /= 2.0f;
419 
420  SFVEC3F boardMin = (m_boardCenter - boardSize);
421  SFVEC3F boardMax = (m_boardCenter + boardSize);
422 
423  boardMin.z = m_layerZcoordTop[B_Adhes];
424  boardMax.z = m_layerZcoordTop[F_Adhes];
425 
426  m_boardBoundingBox = CBBOX( boardMin, boardMax );
427 
428 #ifdef PRINT_STATISTICS_3D_VIEWER
429  unsigned stats_startCreateBoardPolyTime = GetRunningMicroSecs();
430 #endif
431 
432  if( aStatusTextReporter )
433  aStatusTextReporter->Report( _( "Build board body" ) );
434 
435  if( !createBoardPolygon() )
436  aWarningTextReporter->Report( _( "Warning: Board outline is not closed" ) );
437  else
438  aWarningTextReporter->Report( wxEmptyString );
439 
440 #ifdef PRINT_STATISTICS_3D_VIEWER
441  unsigned stats_stopCreateBoardPolyTime = GetRunningMicroSecs();
442  unsigned stats_startCreateLayersTime = stats_stopCreateBoardPolyTime;
443 #endif
444 
445  if( aStatusTextReporter )
446  aStatusTextReporter->Report( _( "Create layers" ) );
447 
448  createLayers( aStatusTextReporter );
449 
450 #ifdef PRINT_STATISTICS_3D_VIEWER
451  unsigned stats_stopCreateLayersTime = GetRunningMicroSecs();
452 
453  printf( "CINFO3D_VISU::InitSettings times\n" );
454  printf( " CreateBoardPoly: %.3f ms\n",
455  (float)( stats_stopCreateBoardPolyTime - stats_startCreateBoardPolyTime ) / 1e3 );
456  printf( " CreateLayers and holes: %.3f ms\n",
457  (float)( stats_stopCreateLayersTime - stats_startCreateLayersTime ) / 1e3 );
458  printf( "\n" );
459 #endif
460 }
461 
462 
464 {
466 
467  wxString errmsg;
468 
469  return m_board->GetBoardPolygonOutlines( m_board_poly, &errmsg );
470 }
471 
472 
473 float CINFO3D_VISU::GetModulesZcoord3DIU( bool aIsFlipped ) const
474 {
475  if( aIsFlipped )
476  {
477  if( GetFlag( FL_SOLDERPASTE ) )
479  else
481  }
482  else
483  {
484  if( GetFlag( FL_SOLDERPASTE ) )
485  return m_layerZcoordTop[F_SilkS];
486  else
487  return m_layerZcoordTop[F_Paste];
488  }
489 }
490 
491 
493 {
494  switch( aCameraType )
495  {
498  break;
499 
500  default:
501  wxLogMessage( wxT( "CINFO3D_VISU::CameraSetType() error: unknown camera type %d" ),
502  (int)aCameraType );
503  break;
504  }
505 }
506 
507 
509 {
510  wxASSERT( aLayerId < PCB_LAYER_ID_COUNT );
511 
512  const COLOR4D color = m_colors->GetColor( aLayerId );
513 
514  return SFVEC3F( color.r, color.g, color.b );
515 }
516 
517 
519 {
520  return GetColor( m_colors->GetColor( aItemId ) );
521 }
522 
523 
525 {
526  return SFVEC3F( aColor.r, aColor.g, aColor.b );
527 }
void CameraSetType(CAMERA_TYPE aCameraType)
CameraSetType - Set the camera type to use.
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:103
Defines math related functions.
CBBOX m_boardBoundingBox
3d bounding box of the pcb board in 3d units
Definition: cinfo3d_visu.h:560
wxPoint m_boardPos
center board actual position in board units
Definition: cinfo3d_visu.h:548
SFVEC3D m_CopperColor
in realistic mode: copper color
Definition: cinfo3d_visu.h:516
unsigned int GetNrSegmentsCircle(float aDiameter3DU) const
GetNrSegmentsCircle.
SFVEC3D m_SolderMaskColorBot
in realistic mode: solder mask color ( bot )
Definition: cinfo3d_visu.h:511
int color
Definition: DXF_plotter.cpp:61
float m_calc_seg_min_factor3DU
min factor used for cicle segment approximation calculation
Definition: cinfo3d_visu.h:647
MATERIAL_MODE m_material_mode
mode to render the 3d shape models material
Definition: cinfo3d_visu.h:542
SFVEC3D m_SolderMaskColorTop
in realistic mode: solder mask color ( top )
Definition: cinfo3d_visu.h:512
int GetWidth() const
Definition: eda_rect.h:119
Set for modules listed in the automatic insertion list (usually SMD footprints)
Definition: class_module.h:74
Handles data related with the board to be visualized.
float m_calc_seg_max_factor3DU
max factor used for cicle segment approximation calculation
Definition: cinfo3d_visu.h:650
bool IsLayerVisible(PCB_LAYER_ID aLayerId) const
Function IsLayerVisible tests whether a given layer is visible.
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:512
double g
Green component.
Definition: color4d.h:303
#define RANGE_SCALE_3D
This defines the range that all coord will have to be rendered.
Definition: cinfo3d_visu.h:66
BOARD * m_board
Current board.
Definition: cinfo3d_visu.h:522
unsigned int m_stats_nr_holes
number of holes in the board
Definition: cinfo3d_visu.h:668
CINFO3D_VISU G_null_CINFO3D_VISU
This is a dummy visualization configuration.
SFVEC3D m_BgColorBot
background bottom color
Definition: cinfo3d_visu.h:508
SFVEC3D m_SilkScreenColorTop
in realistic mode: SilkScreen color ( top )
Definition: cinfo3d_visu.h:515
float m_nonCopperLayerThickness3DU
Non copper layers thickness.
Definition: cinfo3d_visu.h:637
#define COPPER_THICKNESS
REPORTER is a pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:62
std::vector< bool > m_drawFlags
options flags to render the board
Definition: cinfo3d_visu.h:533
CBVHCONTAINER2D m_through_holes_inner
It contains the list of throughHoles of the board, the radius is the inner hole.
Definition: cinfo3d_visu.h:604
float m_stats_via_med_hole_diameter
Computed medium diameter of the via holes in 3D units.
Definition: cinfo3d_visu.h:665
SFVEC3D m_BgColorTop
background top color
Definition: cinfo3d_visu.h:509
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)=0
Function Report is a pure virtual function to override in the derived object.
SFVEC3F GetLayerColor(PCB_LAYER_ID aLayerId) const
GetLayerColor - get the technical color of a layer.
bool GetFlag(DISPLAY3D_FLG aFlag) const
GetFlag - get a configuration status of a flag.
MAP_CONTAINER_2D m_layers_container2D
It contains the 2d elements of each layer.
Definition: cinfo3d_visu.h:593
float m_epoxyThickness3DU
Epoxy thickness (normalized)
Definition: cinfo3d_visu.h:634
SFVEC3D m_BoardBodyColor
in realistic mode: FR4 board color
Definition: cinfo3d_visu.h:510
double b
Blue component.
Definition: color4d.h:304
float m_stats_hole_med_diameter
Computed medium diameter of the holes in 3D units.
Definition: cinfo3d_visu.h:671
SFVEC3F GetItemColor(int aItemId) const
GetItemColor - get the technical color of a layer.
void InitSettings(REPORTER *aStatusTextReporter, REPORTER *aWarningTextReporter)
InitSettings - Function to be called by the render when it need to reload the settings for the board.
PCB_LAYER_ID
A quick note on layer IDs:
#define layerThicknessMargin
double GetCircleCorrectionFactor(int aNrSides) const
GetCircleCorrectionFactor - computes a angle correction factor used when creating circles.
SFVEC3D m_SilkScreenColorBot
in realistic mode: SilkScreen color ( bot )
Definition: cinfo3d_visu.h:514
#define NULL
int GetCopperThicknessBIU() const
GetCopperThicknessBIU - Get the current copper layer thickness.
unsigned int m_stats_nr_vias
Nr of vias.
Definition: cinfo3d_visu.h:662
double GetCircletoPolyCorrectionFactor(int aSegCountforCircle)
Use all material properties from model file.
void createLayers(REPORTER *aStatusTextReporter)
SFVEC3F m_boardCenter
3d center position of the pcb board in 3d units
Definition: cinfo3d_visu.h:554
wxSize m_boardSize
board actual size in board units
Definition: cinfo3d_visu.h:551
Class CINFO3D_VISU Helper class to handle information needed to display 3D board.
Definition: cinfo3d_visu.h:73
double m_biuTo3Dunits
Normalization scale to convert board internal units to 3D units to normalize 3D units between -1....
Definition: cinfo3d_visu.h:622
glm::dvec3 SFVEC3D
Definition: xv3d_types.h:48
a few functions useful in geometry calculations.
MODULE_ATTR_T
Enum MODULE_ATTR_T is the set of attributes allowed within a MODULE, using MODULE::SetAttributes() an...
Definition: class_module.h:71
bool GetBoardPolygonOutlines(SHAPE_POLY_SET &aOutlines, wxString *aErrorText=nullptr, wxPoint *aErrorLocation=nullptr)
Function GetBoardPolygonOutlines Extracts the board outlines and build a closed polygon from lines,...
SHAPE_POLY_SET m_board_poly
PCB board outline polygon.
Definition: cinfo3d_visu.h:587
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.
Definition: cinfo3d_visu.h:679
SFVEC3D m_SolderPasteColor
in realistic mode: solder paste color
Definition: cinfo3d_visu.h:513
SFVEC3F GetColor(COLOR4D aColor) const
GetColor.
int GetHeight() const
Definition: eda_rect.h:120
default
Definition: class_module.h:73
CCAMERA & m_currentCamera
Holds a pointer to current camera in use.
Definition: cinfo3d_visu.h:643
DISPLAY3D_FLG
Flags used in rendering options.
Definition: 3d_enums.h:34
S3D_CACHE * m_3d_model_manager
pointer to the 3d model manager
Definition: cinfo3d_visu.h:525
COLOR4D GetColor(int aLayer) const
see class PGM_BASE
bool Is3DLayerEnabled(PCB_LAYER_ID aLayer) const
Is3DLayerEnabled - Check if a layer is enabled.
#define TECH_LAYER_THICKNESS
#define _(s)
Definition: 3d_actions.cpp:33
unsigned GetRunningMicroSecs()
Function GetRunningMicroSecs An alternate way to calculate an elapset time (in microsecondes) to clas...
glm::vec3 SFVEC3F
Definition: xv3d_types.h:47
Virtual component: when created by copper shapes on board (Like edge card connectors,...
Definition: class_module.h:76
COLOR_SETTINGS * m_colors
pointer to current color settings
Definition: cinfo3d_visu.h:528
float m_copperThickness3DU
Copper thickness (normalized)
Definition: cinfo3d_visu.h:631
int GetCopperLayerCount() const
Function GetCopperLayerCount.
void RemoveAllContours()
Removes all outlines & holes (clears) the polygon set.
EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
float m_stats_track_med_width
Track average width.
Definition: cinfo3d_visu.h:659
unsigned int m_copperLayersCount
Number of copper layers actually used by the board.
Definition: cinfo3d_visu.h:618
MAP_CONTAINER_2D m_layers_holes2D
It contains the holes per each layer.
Definition: cinfo3d_visu.h:596
RENDER_ENGINE m_render_engine
render engine currently on use
Definition: cinfo3d_visu.h:539
float m_layerZcoordBottom[PCB_LAYER_ID_COUNT]
Bottom (Start) Z position of each layer (normalized)
Definition: cinfo3d_visu.h:628
bool createBoardPolygon()
Create the board outline polygon.
wxPoint Centre() const
Definition: eda_rect.h:62
CTRACK_BALL m_trackBallCamera
Definition: cinfo3d_visu.h:644
GRID3D_TYPE m_3D_grid_type
Stores the current grid type.
Definition: cinfo3d_visu.h:536
EDA_RECT ComputeBoundingBox(bool aBoardEdgesOnly=false) const
Function ComputeBoundingBox calculates the bounding box containing all board items (or board edge seg...
Defines math related functions.
float m_layerZcoordTop[PCB_LAYER_ID_COUNT]
Top (End) Z position of each layer (normalized)
Definition: cinfo3d_visu.h:625
double r
Red component.
Definition: color4d.h:302
CBVHCONTAINER2D m_through_holes_outer
It contains the list of throughHoles of the board, the radius of the hole is inflated with the copper...
Definition: cinfo3d_visu.h:600
PGM_BASE * PgmOrNull()
similat to PGM_BASE& Pgm(), but return a reference that can be nullptr when running a shared lib from...
void SetFlag(DISPLAY3D_FLG aFlag, bool aState)
SetFlag - set the status of a flag.
bool ShouldModuleBeDisplayed(MODULE_ATTR_T aModuleAttributs) const
ShouldModuleBeDisplayed - Test if module should be displayed in relation to attributs and the flags.
CAMERA_TYPE
Camera types.
Definition: 3d_enums.h:70
CBBOX manages a bounding box defined by two SFVEC3F min max points.
Definition: cbbox.h:40
void Reset()
Function Reset reset the bounding box to zero and de-initialized it.
Definition: cbbox.cpp:98
int GetArcToSegmentCount(int aRadius, int aErrorMax, double aArcAngleDegree)
float GetModulesZcoord3DIU(bool aIsFlipped) const
GetModulesZcoord3DIU - Get the position of the module in 3d integer units considering if it is flippe...
unsigned int m_stats_nr_tracks
Number of tracks in the board.
Definition: cinfo3d_visu.h:656
EDA_RECT & Inflate(wxCoord dx, wxCoord dy)
Function Inflate inflates the rectangle horizontally by dx and vertically by dy.
const wxSize GetSize() const
Definition: eda_rect.h:103
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:40