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 
43 const wxChar *CINFO3D_VISU::m_logTrace = wxT( "KI_TRACE_EDA_CINFO3D_VISU" );
44 
45 
47 
48 
50  m_currentCamera( m_trackBallCamera ),
51  m_trackBallCamera( RANGE_SCALE_3D )
52 {
53  wxLogTrace( m_logTrace, wxT( "CINFO3D_VISU::CINFO3D_VISU" ) );
54 
55  m_board = NULL;
56  m_3d_model_manager = NULL;
58  m_drawFlags.resize( FL_LAST, false );
59 
62 
63  m_boardPos = wxPoint();
64  m_boardSize = wxSize();
66 
69 
70  m_layers_container2D.clear();
71  m_layers_holes2D.clear();
74 
76  m_epoxyThickness3DU = 0.0f;
77  m_copperThickness3DU = 0.0f;
79  m_biuTo3Dunits = 1.0;
80 
82  m_stats_nr_vias = 0;
84  m_stats_nr_holes = 0;
87 
90 
91 
92  memset( m_layerZcoordTop, 0, sizeof( m_layerZcoordTop ) );
93  memset( m_layerZcoordBottom, 0, sizeof( m_layerZcoordBottom ) );
94 
97  SetFlag( FL_SHOW_BOARD_BODY, true );
102  SetFlag( FL_ZONE, true );
103  SetFlag( FL_SILKSCREEN, true );
104  SetFlag( FL_SOLDERMASK, true );
105 
106  m_BgColorBot = SFVEC3D( 0.4, 0.4, 0.5 );
107  m_BgColorTop = SFVEC3D( 0.8, 0.8, 0.9 );
108  m_BoardBodyColor = SFVEC3D( 0.4, 0.4, 0.5 );
109  m_SolderMaskColor = SFVEC3D( 0.1, 0.2, 0.1 );
110  m_SolderPasteColor = SFVEC3D( 0.4, 0.4, 0.4 );
111  m_SilkScreenColor = SFVEC3D( 0.9, 0.9, 0.9 );
112  m_CopperColor = SFVEC3D( 0.75, 0.61, 0.23 );
113 }
114 
115 
117 {
118  destroyLayers();
119 }
120 
121 
123 {
124  wxASSERT( aLayer < PCB_LAYER_ID_COUNT );
125 
126  DISPLAY3D_FLG flg;
127 
128  // see if layer needs to be shown
129  // check the flags
130  switch( aLayer )
131  {
132  case B_Adhes:
133  case F_Adhes:
134  flg = FL_ADHESIVE;
135  break;
136 
137  case B_Paste:
138  case F_Paste:
139  flg = FL_SOLDERPASTE;
140  break;
141 
142  case B_SilkS:
143  case F_SilkS:
144  flg = FL_SILKSCREEN;
145  break;
146 
147  case B_Mask:
148  case F_Mask:
149  flg = FL_SOLDERMASK;
150  break;
151 
152  case Dwgs_User:
153  case Cmts_User:
155  return false;
156 
157  flg = FL_COMMENTS;
158  break;
159 
160  case Eco1_User:
161  case Eco2_User:
163  return false;
164 
165  flg = FL_ECO;
166  break;
167 
168  case Edge_Cuts:
170  return false;
171 
172  return true;
173  break;
174 
175  case Margin:
177  return false;
178 
179  return true;
180  break;
181 
182  case B_Cu:
183  case F_Cu:
184  return m_board->GetDesignSettings().IsLayerVisible( aLayer ) ||
186  break;
187 
188  default:
189  // the layer is an internal copper layer, used the visibility
190  if( GetFlag( FL_SHOW_BOARD_BODY ) &&
192  {
193  // Do not render internal layers if it is overlap with the board
194  // (on OpenGL render)
195  return false;
196  }
197 
198  return m_board->GetDesignSettings().IsLayerVisible( aLayer );
199  }
200 
201  // The layer has a flag, return the flag
202  return GetFlag( flg );
203 }
204 
205 
207 {
208  wxASSERT( aFlag < FL_LAST );
209 
210  return m_drawFlags[aFlag];
211 }
212 
213 
214 void CINFO3D_VISU::SetFlag( DISPLAY3D_FLG aFlag, bool aState )
215 {
216  wxASSERT( aFlag < FL_LAST );
217 
218  m_drawFlags[aFlag] = aState;
219 }
220 
222 {
223  if( ( ( aModuleAttributs == MOD_DEFAULT ) &&
225  ( ( ( aModuleAttributs & MOD_CMS) == MOD_CMS ) &&
227  ( ( ( aModuleAttributs & MOD_VIRTUAL) == MOD_VIRTUAL ) &&
229  {
230  return true;
231  }
232 
233  return false;
234 }
235 
236 
237 // !TODO: define the actual copper thickness by user
238 #define COPPER_THICKNESS KiROUND( 0.035 * IU_PER_MM ) // for 35 um
239 #define TECH_LAYER_THICKNESS KiROUND( 0.04 * IU_PER_MM )
240 
242 {
243  return COPPER_THICKNESS;
244 }
245 
246 // Constant factors used for number of segments approximation calcs
247 #define MIN_SEG_PER_CIRCLE 12
248 #define MAX_SEG_PER_CIRCLE 48
249 
250 #define SEG_MIN_FACTOR_BIU ( 0.10f * IU_PER_MM )
251 #define SEG_MAX_FACTOR_BIU ( 6.00f * IU_PER_MM )
252 
253 
254 unsigned int CINFO3D_VISU::GetNrSegmentsCircle( float aDiameter3DU ) const
255 {
256  wxASSERT( aDiameter3DU > 0.0f );
257 
258  unsigned int result = mapf( aDiameter3DU,
260  (float)MIN_SEG_PER_CIRCLE, (float)MAX_SEG_PER_CIRCLE );
261  wxASSERT( result > 1 );
262 
263  return result;
264 }
265 
266 
267 unsigned int CINFO3D_VISU::GetNrSegmentsCircle( int aDiameterBUI ) const
268 {
269  wxASSERT( aDiameterBUI > 0 );
270 
271  unsigned int result = mapf( (float)aDiameterBUI,
272  (float)SEG_MIN_FACTOR_BIU, (float)SEG_MAX_FACTOR_BIU,
273  (float)MIN_SEG_PER_CIRCLE, (float)MAX_SEG_PER_CIRCLE );
274  wxASSERT( result > 1 );
275 
276  return result;
277 }
278 
279 
280 double CINFO3D_VISU::GetCircleCorrectionFactor( int aNrSides ) const
281 {
282  wxASSERT( aNrSides >= 3 );
283 
284  return 1.0 / cos( M_PI / ( (double)aNrSides * 2.0 ) );
285 }
286 
287 
288 void CINFO3D_VISU::InitSettings( REPORTER *aStatusTextReporter )
289 {
290  wxLogTrace( m_logTrace, wxT( "CINFO3D_VISU::InitSettings" ) );
291 
292  // Calculates the board bounding box
293  // First, use only the board outlines
294  EDA_RECT bbbox = m_board->ComputeBoundingBox( true );
295 
296  // If no outlines, use the board with items
297  if( ( bbbox.GetWidth() == 0 ) && ( bbbox.GetHeight() == 0 ) )
298  bbbox = m_board->ComputeBoundingBox( false );
299 
300  // Gives a non null size to avoid issues in zoom / scale calculations
301  if( ( bbbox.GetWidth() == 0 ) && ( bbbox.GetHeight() == 0 ) )
302  bbbox.Inflate( Millimeter2iu( 10 ) );
303 
304  m_boardSize = bbbox.GetSize();
305  m_boardPos = bbbox.Centre();
306 
307  wxASSERT( (m_boardSize.x > 0) && (m_boardSize.y > 0) );
308 
309  m_boardPos.y = -m_boardPos.y; // The y coord is inverted in 3D viewer
310 
312 
313  // Ensure the board has 2 sides for 3D views, because it is hard to find
314  // a *really* single side board in the true life...
315  if( m_copperLayersCount < 2 )
317 
318  // Calculate the convertion to apply to all positions.
320 
321  // Calculate factors for cicle segment approximation
323  m_calc_seg_max_factor3DU = (float)( SEG_MAX_FACTOR_BIU * m_biuTo3Dunits );
324 
327 
328  // !TODO: use value defined by user (currently use default values by ctor
331 
332  // Init Z position of each layer
333  // calculate z position for each copper layer
334  // Zstart = -m_epoxyThickness / 2.0 is the z position of the back (bottom layer) (layer id = 31)
335  // Zstart = +m_epoxyThickness / 2.0 is the z position of the front (top layer) (layer id = 0)
336  // all unused copper layer z position are set to 0
337 
338  // ____==__________==________==______ <- Bottom = +m_epoxyThickness / 2.0,
339  // | | Top = Bottom + m_copperThickness
340  // |__________________________________|
341  // == == == == <- Bottom = -m_epoxyThickness / 2.0,
342  // Top = Bottom - m_copperThickness
343 
344  unsigned int layer;
345 
346  for( layer = 0; layer < m_copperLayersCount; ++layer )
347  {
348  m_layerZcoordBottom[layer] = m_epoxyThickness3DU / 2.0f -
349  (m_epoxyThickness3DU * layer / (m_copperLayersCount - 1) );
350 
351  if( layer < (m_copperLayersCount / 2) )
353  else
355  }
356 
357  #define layerThicknessMargin 1.1
358  const float zpos_offset = m_nonCopperLayerThickness3DU * layerThicknessMargin;
359 
360  // Fill remaining unused copper layers and back layer zpos
361  // with -m_epoxyThickness / 2.0
362  for( ; layer < MAX_CU_LAYERS; layer++ )
363  {
364  m_layerZcoordBottom[layer] = -(m_epoxyThickness3DU / 2.0f);
366  }
367 
368  // This is the top of the copper layer thickness.
369  const float zpos_copperTop_back = m_layerZcoordTop[B_Cu];
370  const float zpos_copperTop_front = m_layerZcoordTop[F_Cu];
371 
372  // calculate z position for each non copper layer
373  // Solder mask and Solder paste have the same Z position
374  for( int layer_id = MAX_CU_LAYERS; layer_id < PCB_LAYER_ID_COUNT; ++layer_id )
375  {
376  float zposTop;
377  float zposBottom;
378 
379  switch( layer_id )
380  {
381  case B_Adhes:
382  zposBottom = zpos_copperTop_back - 2.0f * zpos_offset;
383  zposTop = zposBottom - m_nonCopperLayerThickness3DU;
384  break;
385 
386  case F_Adhes:
387  zposBottom = zpos_copperTop_front + 2.0f * zpos_offset;
388  zposTop = zposBottom + m_nonCopperLayerThickness3DU;
389  break;
390 
391  case B_Mask:
392  case B_Paste:
393  zposBottom = zpos_copperTop_back;
394  zposTop = zpos_copperTop_back - m_nonCopperLayerThickness3DU;
395  break;
396 
397  case F_Mask:
398  case F_Paste:
399  zposTop = zpos_copperTop_front + m_nonCopperLayerThickness3DU;
400  zposBottom = zpos_copperTop_front;
401  break;
402 
403  case B_SilkS:
404  zposBottom = zpos_copperTop_back - 1.0f * zpos_offset;
405  zposTop = zposBottom - m_nonCopperLayerThickness3DU;
406  break;
407 
408  case F_SilkS:
409  zposBottom = zpos_copperTop_front + 1.0f * zpos_offset;
410  zposTop = zposBottom + m_nonCopperLayerThickness3DU;
411  break;
412 
413  // !TODO: review
414  default:
415  zposTop = zpos_copperTop_front + (layer_id - MAX_CU_LAYERS + 3.0f) * zpos_offset;
416  zposBottom = zposTop - m_nonCopperLayerThickness3DU;
417  break;
418  }
419 
420  m_layerZcoordTop[layer_id] = zposTop;
421  m_layerZcoordBottom[layer_id] = zposBottom;
422  }
423 
424  m_boardCenter = SFVEC3F( m_boardPos.x * m_biuTo3Dunits,
425  m_boardPos.y * m_biuTo3Dunits,
426  0.0f );
427 
428  SFVEC3F boardSize = SFVEC3F( m_boardSize.x * m_biuTo3Dunits,
429  m_boardSize.y * m_biuTo3Dunits,
430  0.0f );
431  boardSize /= 2.0f;
432 
433  SFVEC3F boardMin = (m_boardCenter - boardSize);
434  SFVEC3F boardMax = (m_boardCenter + boardSize);
435 
436  boardMin.z = m_layerZcoordTop[B_Adhes];
437  boardMax.z = m_layerZcoordTop[F_Adhes];
438 
439  m_boardBoudingBox = CBBOX( boardMin, boardMax );
440 
441 #ifdef PRINT_STATISTICS_3D_VIEWER
442  unsigned stats_startCreateBoardPolyTime = GetRunningMicroSecs();
443 #endif
444 
445  if( aStatusTextReporter )
446  aStatusTextReporter->Report( _( "Build board body" ) );
447 
449 
450 #ifdef PRINT_STATISTICS_3D_VIEWER
451  unsigned stats_stopCreateBoardPolyTime = GetRunningMicroSecs();
452  unsigned stats_startCreateLayersTime = stats_stopCreateBoardPolyTime;
453 #endif
454 
455  if( aStatusTextReporter )
456  aStatusTextReporter->Report( _( "Create layers" ) );
457 
458  createLayers( aStatusTextReporter );
459 
460 #ifdef PRINT_STATISTICS_3D_VIEWER
461  unsigned stats_stopCreateLayersTime = GetRunningMicroSecs();
462 
463  printf( "CINFO3D_VISU::InitSettings times\n" );
464  printf( " CreateBoardPoly: %.3f ms\n",
465  (float)( stats_stopCreateBoardPolyTime - stats_startCreateBoardPolyTime ) / 1e3 );
466  printf( " CreateLayers and holes: %.3f ms\n",
467  (float)( stats_stopCreateLayersTime - stats_startCreateLayersTime ) / 1e3 );
468  printf( "\n" );
469 #endif
470 }
471 
472 
474 {
476 
477  wxString errmsg;
478 
479  if( !m_board->GetBoardPolygonOutlines( m_board_poly, /*allLayerHoles,*/ &errmsg ) )
480  {
481  errmsg.append( wxT( "\n\n" ) );
482  errmsg.append( _( "Cannot determine the board outline." ) );
483  wxLogMessage( errmsg );
484  }
485 
486  // Be sure the polygon is strictly simple to avoid issues.
488 
490 }
491 
492 
493 float CINFO3D_VISU::GetModulesZcoord3DIU( bool aIsFlipped ) const
494 {
495  if( aIsFlipped )
496  {
497  if( GetFlag( FL_SOLDERPASTE ) )
499  else
501  }
502  else
503  {
504  if( GetFlag( FL_SOLDERPASTE ) )
505  return m_layerZcoordTop[F_SilkS];
506  else
507  return m_layerZcoordTop[F_Paste];
508  }
509 }
510 
511 
513 {
514  switch( aCameraType )
515  {
516  case CAMERA_TRACKBALL:
518  break;
519 
520  default:
521  wxLogMessage( wxT( "CINFO3D_VISU::CameraSetType() error: unknown camera type %d" ),
522  (int)aCameraType );
523  break;
524  }
525 }
526 
527 
529 {
530  wxASSERT( aLayerId < PCB_LAYER_ID_COUNT );
531 
532  const COLOR4D color = m_board->Colors().GetLayerColor( aLayerId );
533 
534  return SFVEC3F( color.r, color.g, color.b );
535 }
536 
537 
539 {
540  return GetColor( m_board->Colors().GetItemColor( aItemId ) );
541 }
542 
543 
545 {
546  return SFVEC3F( aColor.r, aColor.g, aColor.b );
547 }
#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:287
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:288
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
const COLORS_DESIGN_SETTINGS & Colors() const
Function GetColorSettings.
Definition: class_board.h:563
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:532
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
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:286
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