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"
36 #include <colors_selection.h>
37 
44 const wxChar *CINFO3D_VISU::m_logTrace = wxT( "KI_TRACE_EDA_CINFO3D_VISU" );
45 
46 
48 
49 
51  m_currentCamera( m_trackBallCamera ),
52  m_trackBallCamera( RANGE_SCALE_3D )
53 {
54  wxLogTrace( m_logTrace, wxT( "CINFO3D_VISU::CINFO3D_VISU" ) );
55 
56  m_board = NULL;
57  m_3d_model_manager = NULL;
59  m_drawFlags.resize( FL_LAST, false );
60 
63 
64  m_boardPos = wxPoint();
65  m_boardSize = wxSize();
67 
70 
71  m_layers_container2D.clear();
72  m_layers_holes2D.clear();
75 
77  m_epoxyThickness3DU = 0.0f;
78  m_copperThickness3DU = 0.0f;
80  m_biuTo3Dunits = 1.0;
81 
83  m_stats_nr_vias = 0;
85  m_stats_nr_holes = 0;
88 
91 
92 
93  memset( m_layerZcoordTop, 0, sizeof( m_layerZcoordTop ) );
94  memset( m_layerZcoordBottom, 0, sizeof( m_layerZcoordBottom ) );
95 
98  SetFlag( FL_SHOW_BOARD_BODY, true );
103  SetFlag( FL_ZONE, true );
104  SetFlag( FL_SILKSCREEN, true );
105  SetFlag( FL_SOLDERMASK, true );
106 
107  m_BgColorBot = SFVEC3D( 0.4, 0.4, 0.5 );
108  m_BgColorTop = SFVEC3D( 0.8, 0.8, 0.9 );
109  m_BoardBodyColor = SFVEC3D( 0.4, 0.4, 0.5 );
110  m_SolderMaskColor = SFVEC3D( 0.1, 0.2, 0.1 );
111  m_SolderPasteColor = SFVEC3D( 0.4, 0.4, 0.4 );
112  m_SilkScreenColor = SFVEC3D( 0.9, 0.9, 0.9 );
113  m_CopperColor = SFVEC3D( 0.75, 0.61, 0.23 );
114 }
115 
116 
118 {
119  destroyLayers();
120 }
121 
122 
124 {
125  wxASSERT( aLayer < PCB_LAYER_ID_COUNT );
126 
127  DISPLAY3D_FLG flg;
128 
129  // see if layer needs to be shown
130  // check the flags
131  switch( aLayer )
132  {
133  case B_Adhes:
134  case F_Adhes:
135  flg = FL_ADHESIVE;
136  break;
137 
138  case B_Paste:
139  case F_Paste:
140  flg = FL_SOLDERPASTE;
141  break;
142 
143  case B_SilkS:
144  case F_SilkS:
145  flg = FL_SILKSCREEN;
146  break;
147 
148  case B_Mask:
149  case F_Mask:
150  flg = FL_SOLDERMASK;
151  break;
152 
153  case Dwgs_User:
154  case Cmts_User:
156  return false;
157 
158  flg = FL_COMMENTS;
159  break;
160 
161  case Eco1_User:
162  case Eco2_User:
164  return false;
165 
166  flg = FL_ECO;
167  break;
168 
169  case Edge_Cuts:
171  return false;
172 
173  return true;
174  break;
175 
176  case Margin:
178  return false;
179 
180  return true;
181  break;
182 
183  case B_Cu:
184  case F_Cu:
185  return m_board->GetDesignSettings().IsLayerVisible( aLayer ) ||
187  break;
188 
189  default:
190  // the layer is an internal copper layer, used the visibility
191  if( GetFlag( FL_SHOW_BOARD_BODY ) &&
193  {
194  // Do not render internal layers if it is overlap with the board
195  // (on OpenGL render)
196  return false;
197  }
198 
199  return m_board->GetDesignSettings().IsLayerVisible( aLayer );
200  }
201 
202  // The layer has a flag, return the flag
203  return GetFlag( flg );
204 }
205 
206 
208 {
209  wxASSERT( aFlag < FL_LAST );
210 
211  return m_drawFlags[aFlag];
212 }
213 
214 
215 void CINFO3D_VISU::SetFlag( DISPLAY3D_FLG aFlag, bool aState )
216 {
217  wxASSERT( aFlag < FL_LAST );
218 
219  m_drawFlags[aFlag] = aState;
220 }
221 
223 {
224  if( ( ( aModuleAttributs == MOD_DEFAULT ) &&
226  ( ( ( aModuleAttributs & MOD_CMS) == MOD_CMS ) &&
228  ( ( ( aModuleAttributs & MOD_VIRTUAL) == MOD_VIRTUAL ) &&
230  {
231  return true;
232  }
233 
234  return false;
235 }
236 
237 
238 // !TODO: define the actual copper thickness by user
239 #define COPPER_THICKNESS KiROUND( 0.035 * IU_PER_MM ) // for 35 um
240 #define TECH_LAYER_THICKNESS KiROUND( 0.04 * IU_PER_MM )
241 
243 {
244  return COPPER_THICKNESS;
245 }
246 
247 // Constant factors used for number of segments approximation calcs
248 #define MIN_SEG_PER_CIRCLE 12
249 #define MAX_SEG_PER_CIRCLE 48
250 
251 #define SEG_MIN_FACTOR_BIU ( 0.10f * IU_PER_MM )
252 #define SEG_MAX_FACTOR_BIU ( 6.00f * IU_PER_MM )
253 
254 
255 unsigned int CINFO3D_VISU::GetNrSegmentsCircle( float aDiameter3DU ) const
256 {
257  wxASSERT( aDiameter3DU > 0.0f );
258 
259  unsigned int result = mapf( aDiameter3DU,
261  (float)MIN_SEG_PER_CIRCLE, (float)MAX_SEG_PER_CIRCLE );
262  wxASSERT( result > 1 );
263 
264  return result;
265 }
266 
267 
268 unsigned int CINFO3D_VISU::GetNrSegmentsCircle( int aDiameterBUI ) const
269 {
270  wxASSERT( aDiameterBUI > 0 );
271 
272  unsigned int result = mapf( (float)aDiameterBUI,
273  (float)SEG_MIN_FACTOR_BIU, (float)SEG_MAX_FACTOR_BIU,
274  (float)MIN_SEG_PER_CIRCLE, (float)MAX_SEG_PER_CIRCLE );
275  wxASSERT( result > 1 );
276 
277  return result;
278 }
279 
280 
281 double CINFO3D_VISU::GetCircleCorrectionFactor( int aNrSides ) const
282 {
283  wxASSERT( aNrSides >= 3 );
284 
285  return 1.0 / cos( M_PI / ( (double)aNrSides * 2.0 ) );
286 }
287 
288 
289 void CINFO3D_VISU::InitSettings( REPORTER *aStatusTextReporter )
290 {
291  wxLogTrace( m_logTrace, wxT( "CINFO3D_VISU::InitSettings" ) );
292 
293  // Calculates the board bounding box
294  // First, use only the board outlines
295  EDA_RECT bbbox = m_board->ComputeBoundingBox( true );
296 
297  // If no outlines, use the board with items
298  if( ( bbbox.GetWidth() == 0 ) && ( bbbox.GetHeight() == 0 ) )
299  bbbox = m_board->ComputeBoundingBox( false );
300 
301  // Gives a non null size to avoid issues in zoom / scale calculations
302  if( ( bbbox.GetWidth() == 0 ) && ( bbbox.GetHeight() == 0 ) )
303  bbbox.Inflate( Millimeter2iu( 10 ) );
304 
305  m_boardSize = bbbox.GetSize();
306  m_boardPos = bbbox.Centre();
307 
308  wxASSERT( (m_boardSize.x > 0) && (m_boardSize.y > 0) );
309 
310  m_boardPos.y = -m_boardPos.y; // The y coord is inverted in 3D viewer
311 
313 
314  // Ensure the board has 2 sides for 3D views, because it is hard to find
315  // a *really* single side board in the true life...
316  if( m_copperLayersCount < 2 )
318 
319  // Calculate the convertion to apply to all positions.
321 
322  // Calculate factors for cicle segment approximation
324  m_calc_seg_max_factor3DU = (float)( SEG_MAX_FACTOR_BIU * m_biuTo3Dunits );
325 
328 
329  // !TODO: use value defined by user (currently use default values by ctor
332 
333  // Init Z position of each layer
334  // calculate z position for each copper layer
335  // Zstart = -m_epoxyThickness / 2.0 is the z position of the back (bottom layer) (layer id = 31)
336  // Zstart = +m_epoxyThickness / 2.0 is the z position of the front (top layer) (layer id = 0)
337  // all unused copper layer z position are set to 0
338 
339  // ____==__________==________==______ <- Bottom = +m_epoxyThickness / 2.0,
340  // | | Top = Bottom + m_copperThickness
341  // |__________________________________|
342  // == == == == <- Bottom = -m_epoxyThickness / 2.0,
343  // Top = Bottom - m_copperThickness
344 
345  unsigned int layer;
346 
347  for( layer = 0; layer < m_copperLayersCount; ++layer )
348  {
349  m_layerZcoordBottom[layer] = m_epoxyThickness3DU / 2.0f -
350  (m_epoxyThickness3DU * layer / (m_copperLayersCount - 1) );
351 
352  if( layer < (m_copperLayersCount / 2) )
354  else
356  }
357 
358  #define layerThicknessMargin 1.1
359  const float zpos_offset = m_nonCopperLayerThickness3DU * layerThicknessMargin;
360 
361  // Fill remaining unused copper layers and back layer zpos
362  // with -m_epoxyThickness / 2.0
363  for( ; layer < MAX_CU_LAYERS; layer++ )
364  {
365  m_layerZcoordBottom[layer] = -(m_epoxyThickness3DU / 2.0f);
367  }
368 
369  // This is the top of the copper layer thickness.
370  const float zpos_copperTop_back = m_layerZcoordTop[B_Cu];
371  const float zpos_copperTop_front = m_layerZcoordTop[F_Cu];
372 
373  // calculate z position for each non copper layer
374  // Solder mask and Solder paste have the same Z position
375  for( int layer_id = MAX_CU_LAYERS; layer_id < PCB_LAYER_ID_COUNT; ++layer_id )
376  {
377  float zposTop;
378  float zposBottom;
379 
380  switch( layer_id )
381  {
382  case B_Adhes:
383  zposBottom = zpos_copperTop_back - 2.0f * zpos_offset;
384  zposTop = zposBottom - m_nonCopperLayerThickness3DU;
385  break;
386 
387  case F_Adhes:
388  zposBottom = zpos_copperTop_front + 2.0f * zpos_offset;
389  zposTop = zposBottom + m_nonCopperLayerThickness3DU;
390  break;
391 
392  case B_Mask:
393  case B_Paste:
394  zposBottom = zpos_copperTop_back;
395  zposTop = zpos_copperTop_back - m_nonCopperLayerThickness3DU;
396  break;
397 
398  case F_Mask:
399  case F_Paste:
400  zposTop = zpos_copperTop_front + m_nonCopperLayerThickness3DU;
401  zposBottom = zpos_copperTop_front;
402  break;
403 
404  case B_SilkS:
405  zposBottom = zpos_copperTop_back - 1.0f * zpos_offset;
406  zposTop = zposBottom - m_nonCopperLayerThickness3DU;
407  break;
408 
409  case F_SilkS:
410  zposBottom = zpos_copperTop_front + 1.0f * zpos_offset;
411  zposTop = zposBottom + m_nonCopperLayerThickness3DU;
412  break;
413 
414  // !TODO: review
415  default:
416  zposTop = zpos_copperTop_front + (layer_id - MAX_CU_LAYERS + 3.0f) * zpos_offset;
417  zposBottom = zposTop - m_nonCopperLayerThickness3DU;
418  break;
419  }
420 
421  m_layerZcoordTop[layer_id] = zposTop;
422  m_layerZcoordBottom[layer_id] = zposBottom;
423  }
424 
425  m_boardCenter = SFVEC3F( m_boardPos.x * m_biuTo3Dunits,
426  m_boardPos.y * m_biuTo3Dunits,
427  0.0f );
428 
429  SFVEC3F boardSize = SFVEC3F( m_boardSize.x * m_biuTo3Dunits,
430  m_boardSize.y * m_biuTo3Dunits,
431  0.0f );
432  boardSize /= 2.0f;
433 
434  SFVEC3F boardMin = (m_boardCenter - boardSize);
435  SFVEC3F boardMax = (m_boardCenter + boardSize);
436 
437  boardMin.z = m_layerZcoordTop[B_Adhes];
438  boardMax.z = m_layerZcoordTop[F_Adhes];
439 
440  m_boardBoudingBox = CBBOX( boardMin, boardMax );
441 
442 #ifdef PRINT_STATISTICS_3D_VIEWER
443  unsigned stats_startCreateBoardPolyTime = GetRunningMicroSecs();
444 #endif
445 
446  if( aStatusTextReporter )
447  aStatusTextReporter->Report( _( "Build board body" ) );
448 
450 
451 #ifdef PRINT_STATISTICS_3D_VIEWER
452  unsigned stats_stopCreateBoardPolyTime = GetRunningMicroSecs();
453  unsigned stats_startCreateLayersTime = stats_stopCreateBoardPolyTime;
454 #endif
455 
456  if( aStatusTextReporter )
457  aStatusTextReporter->Report( _( "Create layers" ) );
458 
459  createLayers( aStatusTextReporter );
460 
461 #ifdef PRINT_STATISTICS_3D_VIEWER
462  unsigned stats_stopCreateLayersTime = GetRunningMicroSecs();
463 
464  printf( "CINFO3D_VISU::InitSettings times\n" );
465  printf( " CreateBoardPoly: %.3f ms\n",
466  (float)( stats_stopCreateBoardPolyTime - stats_startCreateBoardPolyTime ) / 1e3 );
467  printf( " CreateLayers and holes: %.3f ms\n",
468  (float)( stats_stopCreateLayersTime - stats_startCreateLayersTime ) / 1e3 );
469  printf( "\n" );
470 #endif
471 }
472 
473 
475 {
477 
478  wxString errmsg;
479 
480  if( !m_board->GetBoardPolygonOutlines( m_board_poly, /*allLayerHoles,*/ &errmsg ) )
481  {
482  errmsg.append( wxT( "\n\n" ) );
483  errmsg.append( _( "Cannot determine the board outline." ) );
484  wxLogMessage( errmsg );
485  }
486 
487  // Be sure the polygon is strictly simple to avoid issues.
489 
491 }
492 
493 
494 float CINFO3D_VISU::GetModulesZcoord3DIU( bool aIsFlipped ) const
495 {
496  if( aIsFlipped )
497  {
498  if( GetFlag( FL_SOLDERPASTE ) )
500  else
502  }
503  else
504  {
505  if( GetFlag( FL_SOLDERPASTE ) )
506  return m_layerZcoordTop[F_SilkS];
507  else
508  return m_layerZcoordTop[F_Paste];
509  }
510 }
511 
512 
514 {
515  switch( aCameraType )
516  {
517  case CAMERA_TRACKBALL:
519  break;
520 
521  default:
522  wxLogMessage( wxT( "CINFO3D_VISU::CameraSetType() error: unknown camera type %d" ),
523  (int)aCameraType );
524  break;
525  }
526 }
527 
528 
530 {
531  wxASSERT( aLayerId < PCB_LAYER_ID_COUNT );
532 
533  const COLOR4D color = g_ColorsSettings.GetLayerColor( aLayerId );
534 
535  return SFVEC3F( color.r, color.g, color.b );
536 }
537 
538 
540 {
541  return GetColor( g_ColorsSettings.GetItemColor( aItemId ) );
542 }
543 
544 
546 {
547  return SFVEC3F( aColor.r, aColor.g, aColor.b );
548 }
#define SEG_MIN_FACTOR_BIU
SFVEC3F GetLayerColor(PCB_LAYER_ID aLayerId) const
GetLayerColor - get the technical color of a layer.
void CameraSetType(CAMERA_TYPE aCameraType)
CameraSetType - Set the camera type to use.
void Polygon_Calc_BBox_3DU(const SHAPE_POLY_SET &aPolysList, CBBOX2D &aOutBBox, float aBiuTo3DunitsScale)
Definition: cpolygon2d.cpp:714
Defines math related functions.
wxPoint m_boardPos
center board actual position in board units
Definition: cinfo3d_visu.h:539
bool GetBoardPolygonOutlines(SHAPE_POLY_SET &aOutlines, wxString *aErrorText=NULL)
Function GetBoardPolygonOutlines Extracts the board outlines and build a closed polygon from lines...
CBBOX2D m_board2dBBox3DU
2d bouding box of the pcb board in 3d units
Definition: cinfo3d_visu.h:554
SFVEC3D m_CopperColor
in realistic mode: copper color
Definition: cinfo3d_visu.h:509
EDA_RECT ComputeBoundingBox(bool aBoardEdgesOnly=false) const
Function ComputeBoundingBox calculates the bounding box containing all board items (or board edge seg...
SFVEC3F GetItemColor(int aItemId) const
GetItemColor - get the technical color of a layer.
Class BOARD to handle a board.
CBBOX m_boardBoudingBox
3d bouding box of the pcb board in 3d units
Definition: cinfo3d_visu.h:551
float m_calc_seg_min_factor3DU
min factor used for cicle segment approximation calculation
Definition: cinfo3d_visu.h:641
MATERIAL_MODE m_material_mode
mode to render the 3d shape models material
Definition: cinfo3d_visu.h:533
int GetCopperLayerCount() const
Function GetCopperLayerCount.
int GetHeight() const
Set for modules listed in the automatic insertion list (usually SMD footprints)
Definition: class_module.h:77
Handles data related with the board to be visualized.
float mapf(float x, float in_min, float in_max, float out_min, float out_max)
Definition: 3d_math.h:136
float m_calc_seg_max_factor3DU
max factor used for cicle segment approximation calculation
Definition: cinfo3d_visu.h:644
double g
Green component.
Definition: color4d.h:282
int GetCopperThicknessBIU() const
GetCopperThicknessBIU - Get the current copper layer thickness.
#define RANGE_SCALE_3D
This defines the range that all coord will have to be rendered.
Definition: cinfo3d_visu.h:63
BOARD * m_board
Current board.
Definition: cinfo3d_visu.h:515
unsigned int m_stats_nr_holes
number of holes in the board
Definition: cinfo3d_visu.h:662
CINFO3D_VISU G_null_CINFO3D_VISU
This is a dummy visualization configuration.
SFVEC3D m_BgColorBot
background bottom color
Definition: cinfo3d_visu.h:503
float m_nonCopperLayerThickness3DU
Non copper layers thickness.
Definition: cinfo3d_visu.h:631
#define COPPER_THICKNESS
bool IsLayerVisible(PCB_LAYER_ID aLayerId) const
Function IsLayerVisible tests whether a given layer is visible.
Class REPORTER is a pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:61
std::vector< bool > m_drawFlags
options flags to render the board
Definition: cinfo3d_visu.h:524
CBVHCONTAINER2D m_through_holes_inner
It contains the list of throughHoles of the board, the radius is the inner hole.
Definition: cinfo3d_visu.h:598
float m_stats_via_med_hole_diameter
Computed medium diameter of the via holes in 3D units.
Definition: cinfo3d_visu.h:659
SFVEC3D m_BgColorTop
background top color
Definition: cinfo3d_visu.h:504
MAP_CONTAINER_2D m_layers_container2D
It contains the 2d elements of each layer.
Definition: cinfo3d_visu.h:587
float m_epoxyThickness3DU
Epoxy thickness (normalized)
Definition: cinfo3d_visu.h:628
SFVEC3D m_BoardBodyColor
in realistic mode: FR4 board color
Definition: cinfo3d_visu.h:505
double b
Blue component.
Definition: color4d.h:283
float m_stats_hole_med_diameter
Computed medium diameter of the holes in 3D units.
Definition: cinfo3d_visu.h:665
COLOR4D GetItemColor(int aItemIdx) const
Function GetItemColor.
void Reset()
Function Reset reset the bounding box to zero and de-initialized it.
Definition: cbbox2d.cpp:88
void createBoardPolygon()
PCB_LAYER_ID
A quick note on layer IDs:
#define layerThicknessMargin
unsigned int m_stats_nr_vias
Nr of vias.
Definition: cinfo3d_visu.h:656
void createLayers(REPORTER *aStatusTextReporter)
SFVEC3F m_boardCenter
3d center position of the pcb board in 3d units
Definition: cinfo3d_visu.h:545
wxSize m_boardSize
board actual size in board units
Definition: cinfo3d_visu.h:542
Class CINFO3D_VISU Helper class to handle information needed to display 3D board. ...
Definition: cinfo3d_visu.h:70
double m_biuTo3Dunits
Normalization scale to convert board internal units to 3D units to normalize 3D units between -1...
Definition: cinfo3d_visu.h:616
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:530
glm::dvec3 SFVEC3D
Definition: xv3d_types.h:48
MODULE_ATTR_T
Enum MODULE_ATTR_T is the set of attributes allowed within a MODULE, using MODULE::SetAttributes() an...
Definition: class_module.h:74
void Simplify(POLYGON_MODE aFastMode)
Simplifies the polyset (merges overlapping polys, eliminates degeneracy/self-intersections) For aFast...
wxPoint Centre() const
SHAPE_POLY_SET m_board_poly
PCB board outline polygon.
Definition: cinfo3d_visu.h:581
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.
Definition: cinfo3d_visu.h:673
COLORS_DESIGN_SETTINGS g_ColorsSettings
Definition: pcbnew.cpp:68
SFVEC3D m_SolderPasteColor
in realistic mode: solder paste color
Definition: cinfo3d_visu.h:507
bool Is3DLayerEnabled(PCB_LAYER_ID aLayer) const
Is3DLayerEnabled - Check if a layer is enabled.
SFVEC3D m_SolderMaskColor
in realistic mode: solder mask color
Definition: cinfo3d_visu.h:506
SFVEC3F GetColor(COLOR4D aColor) const
GetColor.
default
Definition: class_module.h:76
CCAMERA & m_currentCamera
Holds a pointer to current camera in use.
Definition: cinfo3d_visu.h:637
unsigned int GetNrSegmentsCircle(float aDiameter3DU) const
GetNrSegmentsCircle.
DISPLAY3D_FLG
Flags used in rendering options.
Definition: 3d_enums.h:34
float GetModulesZcoord3DIU(bool aIsFlipped) const
GetModulesZcoord3DIU - Get the position of the module in 3d integer units considering if it is flippe...
#define MIN_SEG_PER_CIRCLE
Use all material properties from model file.
Definition: 3d_enums.h:93
S3D_CACHE * m_3d_model_manager
pointer to the 3d model manager
Definition: cinfo3d_visu.h:518
bool GetFlag(DISPLAY3D_FLG aFlag) const
GetFlag - get a configuration status of a flag.
SFVEC3D m_SilkScreenColor
in realistic mode: SilkScreen color
Definition: cinfo3d_visu.h:508
double GetCircleCorrectionFactor(int aNrSides) const
GetCircleCorrectionFactor - computes a angle correction factor used when creating circles...
bool ShouldModuleBeDisplayed(MODULE_ATTR_T aModuleAttributs) const
ShouldModuleBeDisplayed - Test if module should be displayed in relation to attributs and the flags...
#define max(a, b)
Definition: auxiliary.h:86
#define TECH_LAYER_THICKNESS
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, mounting hole...)
Definition: class_module.h:79
#define SEG_MAX_FACTOR_BIU
float m_copperThickness3DU
Copper thickness (normalized)
Definition: cinfo3d_visu.h:625
void RemoveAllContours()
Removes all outlines & holes (clears) the polygon set.
Class EDA_RECT handles the component boundary box.
float m_stats_track_med_width
Track average width.
Definition: cinfo3d_visu.h:653
unsigned int m_copperLayersCount
Number of copper layers actually used by the board.
Definition: cinfo3d_visu.h:612
MAP_CONTAINER_2D m_layers_holes2D
It contains the holes per each layer.
Definition: cinfo3d_visu.h:590
RENDER_ENGINE m_render_engine
render engine currently on use
Definition: cinfo3d_visu.h:530
int GetWidth() const
float m_layerZcoordBottom[PCB_LAYER_ID_COUNT]
Bottom (Start) Z position of each layer (normalized)
Definition: cinfo3d_visu.h:622
COLOR4D GetLayerColor(LAYER_NUM aLayer) const
Function GetLayerColor.
CTRACK_BALL m_trackBallCamera
Definition: cinfo3d_visu.h:638
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_UNDEFINED)=0
Function Report is a pure virtual function to override in the derived object.
GRID3D_TYPE m_3D_grid_type
Stores the current grid type.
Definition: cinfo3d_visu.h:527
Defines math related functions.
float m_layerZcoordTop[PCB_LAYER_ID_COUNT]
Top (End) Z position of each layer (normalized)
Definition: cinfo3d_visu.h:619
double r
Red component.
Definition: color4d.h:281
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:594
void SetFlag(DISPLAY3D_FLG aFlag, bool aState)
SetFlag - set the status of a flag.
#define MAX_SEG_PER_CIRCLE
const wxSize & GetSize() const
CAMERA_TYPE
Camera types.
Definition: 3d_enums.h:65
Class 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
unsigned int m_stats_nr_tracks
Number of tracks in the board.
Definition: cinfo3d_visu.h:650
EDA_RECT & Inflate(wxCoord dx, wxCoord dy)
Function Inflate inflates the rectangle horizontally by dx and vertically by dy.
void InitSettings(REPORTER *aStatusTextReporter)
InitSettings - Function to be called by the render when it need to reload the settings for the board...
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39