KiCad PCB EDA Suite
C3D_RENDER_OGL_LEGACY Class Reference

The C3D_RENDER_OGL_LEGACY class render the board using openGL legacy mode. More...

#include <c3d_render_ogl_legacy.h>

Inheritance diagram for C3D_RENDER_OGL_LEGACY:
C3D_RENDER_BASE

Public Member Functions

 C3D_RENDER_OGL_LEGACY (CINFO3D_VISU &aSettings)
 
 ~C3D_RENDER_OGL_LEGACY ()
 
void SetCurWindowSize (const wxSize &aSize) override
 SetCurWindowSize - Before each render, the canvas will tell the render what is the size of its windows, so render can take actions if it changed. More...
 
bool Redraw (bool aIsMoving, REPORTER *aStatusTextReporter) override
 Redraw - Ask to redraw the view. More...
 
int GetWaitForEditingTimeOut () override
 GetWaitForEditingTimeOut - Give the interface the time (in ms) that it should wait for editing or movements before (this works for display preview mode) More...
 
const MAP_OGL_DISP_LISTSGetLayerDispListMap () const
 
const CLAYERS_OGL_DISP_LISTSGetLayerDispList (PCB_LAYER_ID aLayerId) const
 
const CLAYERS_OGL_DISP_LISTSGetBoardDispList () const
 
void ReloadRequest ()
 ReloadRequest - !TODO: this must be reviewed to add flags to improve specific render. More...
 
bool IsReloadRequestPending () const
 IsReloadRequestPending - Query if there is a pending reload request. More...
 
void SetBusyIndicatorFactory (BUSY_INDICATOR::FACTORY aNewFactory)
 Set a new busy indicator factory. More...
 

Protected Member Functions

std::unique_ptr< BUSY_INDICATORCreateBusyIndicator () const
 Return a created busy indicator, if a factory has been set, else a null pointer. More...
 

Protected Attributes

CINFO3D_VISUm_settings
 settings refrence in use for this render More...
 
bool m_is_opengl_initialized
 flag if the opengl specific for this render was already initialized More...
 
bool m_reloadRequested
 !TODO: this must be reviewed in order to flag change types More...
 
wxSize m_windowSize
 The window size that this camera is working. More...
 

Static Protected Attributes

static const wxChar * m_logTrace = wxT( "KI_TRACE_3D_RENDER" )
 Trace mask used to enable or disable the trace output of this class. More...
 

Private Member Functions

bool initializeOpenGL ()
 
void reload (REPORTER *aStatusTextReporter)
 
void ogl_set_arrow_material ()
 
void ogl_free_all_display_lists ()
 
void generate_through_outer_holes ()
 
void generate_through_inner_holes ()
 
CLAYERS_OGL_DISP_LISTSgenerate_holes_display_list (const LIST_OBJECT2D &aListHolesObject2d, const SHAPE_POLY_SET &aPoly, float aZtop, float aZbot, bool aInvertFaces)
 
void add_triangle_top_bot (CLAYER_TRIANGLES *aDst, const SFVEC2F &v0, const SFVEC2F &v1, const SFVEC2F &v2, float top, float bot)
 
void add_object_to_triangle_layer (const CRING2D *aRing, CLAYER_TRIANGLES *aDstLayer, float aZtop, float aZbot)
 
void add_object_to_triangle_layer (const CPOLYGON4PTS2D *aPoly, CLAYER_TRIANGLES *aDstLayer, float aZtop, float aZbot)
 
void add_object_to_triangle_layer (const CFILLEDCIRCLE2D *aFilledCircle, CLAYER_TRIANGLES *aDstLayer, float aZtop, float aZbot)
 
void add_object_to_triangle_layer (const CTRIANGLE2D *aTri, CLAYER_TRIANGLES *aDstLayer, float aZtop, float aZbot)
 
void add_object_to_triangle_layer (const CROUNDSEGMENT2D *aSeg, CLAYER_TRIANGLES *aDstLayer, float aZtop, float aZbot)
 
void render_solder_mask_layer (PCB_LAYER_ID aLayerID, float aZPosition, bool aIsRenderingOnPreviewMode)
 
void get_layer_z_pos (PCB_LAYER_ID aLayerID, float &aOutZtop, float &aOutZbot) const
 
void generate_ring_contour (const SFVEC2F &aCenter, float aInnerRadius, float aOuterRadius, unsigned int aNr_sides_per_circle, std::vector< SFVEC2F > &aInnerContourResult, std::vector< SFVEC2F > &aOuterContourResult, bool aInvertOrder)
 
void generate_cylinder (const SFVEC2F &aCenter, float aInnerRadius, float aOuterRadius, float aZtop, float aZbot, unsigned int aNr_sides_per_circle, CLAYER_TRIANGLES *aDstLayer)
 
void generate_3D_Vias_and_Pads ()
 
void load_3D_models (REPORTER *aStatusTextReporter)
 
void render_3D_models (bool aRenderTopOrBot, bool aRenderTransparentOnly)
 render_3D_models More...
 
void render_3D_module (const MODULE *module, bool aRenderTransparentOnly)
 
void setLight_Front (bool enabled)
 
void setLight_Top (bool enabled)
 
void setLight_Bottom (bool enabled)
 
void render_3D_arrows ()
 
void generate_new_3DGrid (GRID3D_TYPE aGridType)
 
void setupMaterials ()
 
void set_layer_material (PCB_LAYER_ID aLayerID)
 
SFVEC3F get_layer_color (PCB_LAYER_ID aLayerID)
 

Private Attributes

MAP_OGL_DISP_LISTS m_ogl_disp_lists_layers
 
MAP_OGL_DISP_LISTS m_ogl_disp_lists_layers_holes_outer
 
MAP_OGL_DISP_LISTS m_ogl_disp_lists_layers_holes_inner
 
CLAYERS_OGL_DISP_LISTSm_ogl_disp_list_board
 
CLAYERS_OGL_DISP_LISTSm_ogl_disp_list_through_holes_outer
 
CLAYERS_OGL_DISP_LISTSm_ogl_disp_list_through_holes_inner
 
CLAYERS_OGL_DISP_LISTSm_ogl_disp_list_through_holes_outer_with_npth
 
CLAYERS_OGL_DISP_LISTSm_ogl_disp_list_through_holes_vias_outer
 
CLAYERS_OGL_DISP_LISTSm_ogl_disp_list_vias_and_pad_holes_outer_contourn_and_caps
 
MAP_TRIANGLES m_triangles
 
GLuint m_ogl_circle_texture
 
GLuint m_ogl_disp_list_grid
 oGL list that stores current grid More...
 
GRID3D_TYPE m_last_grid_type
 Stores the last grid computed. More...
 
CLAYERS_OGL_DISP_LISTSm_ogl_disp_list_via
 
CLAYERS_OGL_DISP_LISTSm_ogl_disp_list_pads_holes
 
MAP_3DMODEL m_3dmodel_map
 
struct {
   SMATERIAL   m_Paste
 
   SMATERIAL   m_SilkSBot
 
   SMATERIAL   m_SilkSTop
 
   SMATERIAL   m_SolderMaskBot
 
   SMATERIAL   m_SolderMaskTop
 
   SMATERIAL   m_EpoxyBoard
 
   SMATERIAL   m_Copper
 
   SMATERIAL   m_Plastic
 
   SMATERIAL   m_GrayMaterial
 
m_materials
 

Detailed Description

The C3D_RENDER_OGL_LEGACY class render the board using openGL legacy mode.

Definition at line 59 of file c3d_render_ogl_legacy.h.

Constructor & Destructor Documentation

◆ C3D_RENDER_OGL_LEGACY()

C3D_RENDER_OGL_LEGACY::C3D_RENDER_OGL_LEGACY ( CINFO3D_VISU aSettings)
explicit

Definition at line 47 of file c3d_render_ogl_legacy.cpp.

47  :
48  C3D_RENDER_BASE( aSettings )
49 {
50  wxLogTrace( m_logTrace, wxT( "C3D_RENDER_OGL_LEGACY::C3D_RENDER_OGL_LEGACY" ) );
51 
55  m_triangles.clear();
57 
62  //m_ogl_disp_list_through_holes_vias_inner = NULL;
66 
70 
71  m_3dmodel_map.clear();
72 }
MAP_OGL_DISP_LISTS m_ogl_disp_lists_layers
MAP_OGL_DISP_LISTS m_ogl_disp_lists_layers_holes_outer
GRID3D_TYPE m_last_grid_type
Stores the last grid computed.
CLAYERS_OGL_DISP_LISTS * m_ogl_disp_list_through_holes_inner
CLAYERS_OGL_DISP_LISTS * m_ogl_disp_list_through_holes_outer
#define NULL
C3D_RENDER_BASE(CINFO3D_VISU &aSettings)
CLAYERS_OGL_DISP_LISTS * m_ogl_disp_list_through_holes_vias_outer
CLAYERS_OGL_DISP_LISTS * m_ogl_disp_list_via
GLuint m_ogl_disp_list_grid
oGL list that stores current grid
MAP_OGL_DISP_LISTS m_ogl_disp_lists_layers_holes_inner
CLAYERS_OGL_DISP_LISTS * m_ogl_disp_list_through_holes_outer_with_npth
CLAYERS_OGL_DISP_LISTS * m_ogl_disp_list_board
CLAYERS_OGL_DISP_LISTS * m_ogl_disp_list_vias_and_pad_holes_outer_contourn_and_caps
CLAYERS_OGL_DISP_LISTS * m_ogl_disp_list_pads_holes
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.

References m_3dmodel_map, m_last_grid_type, C3D_RENDER_BASE::m_logTrace, m_ogl_circle_texture, m_ogl_disp_list_board, m_ogl_disp_list_grid, m_ogl_disp_list_pads_holes, m_ogl_disp_list_through_holes_inner, m_ogl_disp_list_through_holes_outer, m_ogl_disp_list_through_holes_outer_with_npth, m_ogl_disp_list_through_holes_vias_outer, m_ogl_disp_list_via, m_ogl_disp_list_vias_and_pad_holes_outer_contourn_and_caps, m_ogl_disp_lists_layers, m_ogl_disp_lists_layers_holes_inner, m_ogl_disp_lists_layers_holes_outer, m_triangles, NONE, and NULL.

◆ ~C3D_RENDER_OGL_LEGACY()

C3D_RENDER_OGL_LEGACY::~C3D_RENDER_OGL_LEGACY ( )

Definition at line 75 of file c3d_render_ogl_legacy.cpp.

76 {
77  wxLogTrace( m_logTrace, wxT( "C3D_RENDER_OGL_LEGACY::~C3D_RENDER_OGL_LEGACY" ) );
78 
80 
81  glDeleteTextures( 1, &m_ogl_circle_texture );
82 }
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.

References C3D_RENDER_BASE::m_logTrace, m_ogl_circle_texture, and ogl_free_all_display_lists().

Member Function Documentation

◆ add_object_to_triangle_layer() [1/5]

void C3D_RENDER_OGL_LEGACY::add_object_to_triangle_layer ( const CRING2D aRing,
CLAYER_TRIANGLES aDstLayer,
float  aZtop,
float  aZbot 
)
private

Definition at line 129 of file c3d_render_createscene_ogl_legacy.cpp.

133 {
134  const SFVEC2F &center = aRing->GetCenter();
135  const float inner = aRing->GetInnerRadius();
136  const float outer = aRing->GetOuterRadius();
137 
138  std::vector< SFVEC2F > innerContour;
139  std::vector< SFVEC2F > outerContour;
140 
141  generate_ring_contour( center,
142  inner,
143  outer,
144  m_settings.GetNrSegmentsCircle( outer * 2.0f ),
145  innerContour,
146  outerContour,
147  false );
148 
149  // This will add the top and bot quads that will form the approximated ring
150 
151  for( unsigned int i = 0; i < ( innerContour.size() - 1 ); ++i )
152  {
153  const SFVEC2F &vi0 = innerContour[i + 0];
154  const SFVEC2F &vi1 = innerContour[i + 1];
155  const SFVEC2F &vo0 = outerContour[i + 0];
156  const SFVEC2F &vo1 = outerContour[i + 1];
157 
158  aDstLayer->m_layer_top_triangles->AddQuad( SFVEC3F( vi1.x, vi1.y, aZtop ),
159  SFVEC3F( vi0.x, vi0.y, aZtop ),
160  SFVEC3F( vo0.x, vo0.y, aZtop ),
161  SFVEC3F( vo1.x, vo1.y, aZtop ) );
162 
163  aDstLayer->m_layer_bot_triangles->AddQuad( SFVEC3F( vi1.x, vi1.y, aZbot ),
164  SFVEC3F( vo1.x, vo1.y, aZbot ),
165  SFVEC3F( vo0.x, vo0.y, aZbot ),
166  SFVEC3F( vi0.x, vi0.y, aZbot ) );
167  }
168 }
void generate_ring_contour(const SFVEC2F &aCenter, float aInnerRadius, float aOuterRadius, unsigned int aNr_sides_per_circle, std::vector< SFVEC2F > &aInnerContourResult, std::vector< SFVEC2F > &aOuterContourResult, bool aInvertOrder)
unsigned int GetNrSegmentsCircle(float aDiameter3DU) const
GetNrSegmentsCircle.
CINFO3D_VISU & m_settings
settings refrence in use for this render
float GetOuterRadius() const
Definition: cring2d.h:40
float GetInnerRadius() const
Definition: cring2d.h:39
glm::vec2 SFVEC2F
Definition: xv3d_types.h:45
const SFVEC2F & GetCenter() const
Definition: cring2d.h:38
CLAYER_TRIANGLE_CONTAINER * m_layer_top_triangles
CLAYER_TRIANGLE_CONTAINER * m_layer_bot_triangles
glm::vec3 SFVEC3F
Definition: xv3d_types.h:47
void AddQuad(const SFVEC3F &aV1, const SFVEC3F &aV2, const SFVEC3F &aV3, const SFVEC3F &aV4)
AddQuad.

References CLAYER_TRIANGLE_CONTAINER::AddQuad(), generate_ring_contour(), CRING2D::GetCenter(), CRING2D::GetInnerRadius(), CINFO3D_VISU::GetNrSegmentsCircle(), CRING2D::GetOuterRadius(), CLAYER_TRIANGLES::m_layer_bot_triangles, CLAYER_TRIANGLES::m_layer_top_triangles, and C3D_RENDER_BASE::m_settings.

Referenced by generate_holes_display_list(), and reload().

◆ add_object_to_triangle_layer() [2/5]

void C3D_RENDER_OGL_LEGACY::add_object_to_triangle_layer ( const CPOLYGON4PTS2D aPoly,
CLAYER_TRIANGLES aDstLayer,
float  aZtop,
float  aZbot 
)
private

Definition at line 78 of file c3d_render_createscene_ogl_legacy.cpp.

82 {
83  const SFVEC2F &v0 = aPoly->GetV0();
84  const SFVEC2F &v1 = aPoly->GetV1();
85  const SFVEC2F &v2 = aPoly->GetV2();
86  const SFVEC2F &v3 = aPoly->GetV3();
87 
88  add_triangle_top_bot( aDstLayer, v0, v2, v1, aZtop, aZbot );
89  add_triangle_top_bot( aDstLayer, v2, v0, v3, aZtop, aZbot );
90 }
const SFVEC2F & GetV0() const
const SFVEC2F & GetV3() const
const SFVEC2F & GetV2() const
glm::vec2 SFVEC2F
Definition: xv3d_types.h:45
const SFVEC2F & GetV1() const
void add_triangle_top_bot(CLAYER_TRIANGLES *aDst, const SFVEC2F &v0, const SFVEC2F &v1, const SFVEC2F &v2, float top, float bot)

References add_triangle_top_bot(), CPOLYGON4PTS2D::GetV0(), CPOLYGON4PTS2D::GetV1(), CPOLYGON4PTS2D::GetV2(), and CPOLYGON4PTS2D::GetV3().

◆ add_object_to_triangle_layer() [3/5]

void C3D_RENDER_OGL_LEGACY::add_object_to_triangle_layer ( const CFILLEDCIRCLE2D aFilledCircle,
CLAYER_TRIANGLES aDstLayer,
float  aZtop,
float  aZbot 
)
private

Definition at line 41 of file c3d_render_createscene_ogl_legacy.cpp.

45 {
46  const SFVEC2F &center = aFilledCircle->GetCenter();
47  const float radius = aFilledCircle->GetRadius() *
48  2.0f; // Double because the render triangle
49 
50  // This is a small adjustment to the circle texture
51  const float texture_factor = (8.0f / (float)SIZE_OF_CIRCLE_TEXTURE) + 1.0f;
52  const float f = (sqrtf(2.0f) / 2.0f) * radius * texture_factor;
53 
54  // Top and Bot segments ends are just triangle semi-circles, so need to add
55  // it in duplicated
56  aDstLayer->m_layer_top_segment_ends->AddTriangle( SFVEC3F( center.x + f, center.y, aZtop ),
57  SFVEC3F( center.x - f, center.y, aZtop ),
58  SFVEC3F( center.x,
59  center.y - f, aZtop ) );
60 
61  aDstLayer->m_layer_top_segment_ends->AddTriangle( SFVEC3F( center.x - f, center.y, aZtop ),
62  SFVEC3F( center.x + f, center.y, aZtop ),
63  SFVEC3F( center.x,
64  center.y + f, aZtop ) );
65 
66  aDstLayer->m_layer_bot_segment_ends->AddTriangle( SFVEC3F( center.x - f, center.y, aZbot ),
67  SFVEC3F( center.x + f, center.y, aZbot ),
68  SFVEC3F( center.x,
69  center.y - f, aZbot ) );
70 
71  aDstLayer->m_layer_bot_segment_ends->AddTriangle( SFVEC3F( center.x + f, center.y, aZbot ),
72  SFVEC3F( center.x - f, center.y, aZbot ),
73  SFVEC3F( center.x,
74  center.y + f, aZbot ) );
75 }
glm::vec2 SFVEC2F
Definition: xv3d_types.h:45
void AddTriangle(const SFVEC3F &aV1, const SFVEC3F &aV2, const SFVEC3F &aV3)
AddTriangle.
const SFVEC2F & GetCenter() const
#define SIZE_OF_CIRCLE_TEXTURE
CLAYER_TRIANGLE_CONTAINER * m_layer_bot_segment_ends
glm::vec3 SFVEC3F
Definition: xv3d_types.h:47
float GetRadius() const
CLAYER_TRIANGLE_CONTAINER * m_layer_top_segment_ends

References CLAYER_TRIANGLE_CONTAINER::AddTriangle(), CFILLEDCIRCLE2D::GetCenter(), CFILLEDCIRCLE2D::GetRadius(), CLAYER_TRIANGLES::m_layer_bot_segment_ends, CLAYER_TRIANGLES::m_layer_top_segment_ends, and SIZE_OF_CIRCLE_TEXTURE.

◆ add_object_to_triangle_layer() [4/5]

void C3D_RENDER_OGL_LEGACY::add_object_to_triangle_layer ( const CTRIANGLE2D aTri,
CLAYER_TRIANGLES aDstLayer,
float  aZtop,
float  aZbot 
)
private

Definition at line 171 of file c3d_render_createscene_ogl_legacy.cpp.

175 {
176  const SFVEC2F &v1 = aTri->GetP1();
177  const SFVEC2F &v2 = aTri->GetP2();
178  const SFVEC2F &v3 = aTri->GetP3();
179 
180  add_triangle_top_bot( aDstLayer, v1, v2, v3, aZtop, aZbot );
181 }
const SFVEC2F & GetP2() const
Definition: ctriangle2d.h:59
glm::vec2 SFVEC2F
Definition: xv3d_types.h:45
const SFVEC2F & GetP1() const
Definition: ctriangle2d.h:58
const SFVEC2F & GetP3() const
Definition: ctriangle2d.h:60
void add_triangle_top_bot(CLAYER_TRIANGLES *aDst, const SFVEC2F &v0, const SFVEC2F &v1, const SFVEC2F &v2, float top, float bot)

References add_triangle_top_bot(), CTRIANGLE2D::GetP1(), CTRIANGLE2D::GetP2(), and CTRIANGLE2D::GetP3().

◆ add_object_to_triangle_layer() [5/5]

void C3D_RENDER_OGL_LEGACY::add_object_to_triangle_layer ( const CROUNDSEGMENT2D aSeg,
CLAYER_TRIANGLES aDstLayer,
float  aZtop,
float  aZbot 
)
private

Definition at line 184 of file c3d_render_createscene_ogl_legacy.cpp.

188 {
189  const SFVEC2F& leftStart = aSeg->GetLeftStar();
190  const SFVEC2F& leftEnd = aSeg->GetLeftEnd();
191  const SFVEC2F& leftDir = aSeg->GetLeftDir();
192 
193  const SFVEC2F& rightStart = aSeg->GetRightStar();
194  const SFVEC2F& rightEnd = aSeg->GetRightEnd();
195  const SFVEC2F& rightDir = aSeg->GetRightDir();
196  const float radius = aSeg->GetRadius();
197 
198  const SFVEC2F& start = aSeg->GetStart();
199  const SFVEC2F& end = aSeg->GetEnd();
200 
201  const float texture_factor = (12.0f / (float)SIZE_OF_CIRCLE_TEXTURE) + 1.0f;
202  const float texture_factorF= ( 6.0f / (float)SIZE_OF_CIRCLE_TEXTURE) + 1.0f;
203 
204  const float radius_of_the_square = sqrtf( aSeg->GetRadiusSquared() * 2.0f );
205  const float radius_triangle_factor = (radius_of_the_square - radius) / radius;
206 
207  const SFVEC2F factorS = SFVEC2F( -rightDir.y * radius * radius_triangle_factor,
208  rightDir.x * radius * radius_triangle_factor );
209 
210  const SFVEC2F factorE = SFVEC2F( -leftDir.y * radius * radius_triangle_factor,
211  leftDir.x * radius * radius_triangle_factor );
212 
213  // Top end segment triangles (semi-circles)
215  SFVEC3F( rightEnd.x + texture_factor * factorS.x,
216  rightEnd.y + texture_factor * factorS.y,
217  aZtop ),
218  SFVEC3F( leftStart.x + texture_factor * factorE.x,
219  leftStart.y + texture_factor * factorE.y,
220  aZtop ),
221  SFVEC3F( start.x - texture_factorF * leftDir.x * radius * sqrtf( 2.0f ),
222  start.y - texture_factorF * leftDir.y * radius * sqrtf( 2.0f ),
223  aZtop ) );
224 
226  SFVEC3F( leftEnd.x + texture_factor * factorE.x,
227  leftEnd.y + texture_factor * factorE.y, aZtop ),
228  SFVEC3F( rightStart.x + texture_factor * factorS.x,
229  rightStart.y + texture_factor * factorS.y, aZtop ),
230  SFVEC3F( end.x - texture_factorF * rightDir.x * radius * sqrtf( 2.0f ),
231  end.y - texture_factorF * rightDir.y * radius * sqrtf( 2.0f ),
232  aZtop ) );
233 
234  // Bot end segment triangles (semi-circles)
236  SFVEC3F( leftStart.x + texture_factor * factorE.x,
237  leftStart.y + texture_factor * factorE.y,
238  aZbot ),
239  SFVEC3F( rightEnd.x + texture_factor * factorS.x,
240  rightEnd.y + texture_factor * factorS.y,
241  aZbot ),
242  SFVEC3F( start.x - texture_factorF * leftDir.x * radius * sqrtf( 2.0f ),
243  start.y - texture_factorF * leftDir.y * radius * sqrtf( 2.0f ),
244  aZbot ) );
245 
247  SFVEC3F( rightStart.x + texture_factor * factorS.x,
248  rightStart.y + texture_factor * factorS.y, aZbot ),
249  SFVEC3F( leftEnd.x + texture_factor * factorE.x,
250  leftEnd.y + texture_factor * factorE.y, aZbot ),
251  SFVEC3F( end.x - texture_factorF * rightDir.x * radius * sqrtf( 2.0f ),
252  end.y - texture_factorF * rightDir.y * radius * sqrtf( 2.0f ),
253  aZbot ) );
254 
255  // Segment top and bot planes
256  aDstLayer->m_layer_top_triangles->AddQuad(
257  SFVEC3F( rightEnd.x, rightEnd.y, aZtop ),
258  SFVEC3F( rightStart.x, rightStart.y, aZtop ),
259  SFVEC3F( leftEnd.x, leftEnd.y, aZtop ),
260  SFVEC3F( leftStart.x, leftStart.y, aZtop ) );
261 
262  aDstLayer->m_layer_bot_triangles->AddQuad(
263  SFVEC3F( rightEnd.x, rightEnd.y, aZbot ),
264  SFVEC3F( leftStart.x, leftStart.y, aZbot ),
265  SFVEC3F( leftEnd.x, leftEnd.y, aZbot ),
266  SFVEC3F( rightStart.x, rightStart.y, aZbot ) );
267 }
const SFVEC2F & GetRightEnd() const
const SFVEC2F & GetStart() const
const SFVEC2F & GetLeftStar() const
float GetRadius() const
const SFVEC2F & GetRightStar() const
const SFVEC2F & GetLeftEnd() const
const SFVEC2F & GetEnd() const
glm::vec2 SFVEC2F
Definition: xv3d_types.h:45
CLAYER_TRIANGLE_CONTAINER * m_layer_top_triangles
void AddTriangle(const SFVEC3F &aV1, const SFVEC3F &aV2, const SFVEC3F &aV3)
AddTriangle.
float GetRadiusSquared() const
const SFVEC2F & GetRightDir() const
const SFVEC2F & GetLeftDir() const
#define SIZE_OF_CIRCLE_TEXTURE
CLAYER_TRIANGLE_CONTAINER * m_layer_bot_segment_ends
CLAYER_TRIANGLE_CONTAINER * m_layer_bot_triangles
glm::vec3 SFVEC3F
Definition: xv3d_types.h:47
CLAYER_TRIANGLE_CONTAINER * m_layer_top_segment_ends
void AddQuad(const SFVEC3F &aV1, const SFVEC3F &aV2, const SFVEC3F &aV3, const SFVEC3F &aV4)
AddQuad.

References CLAYER_TRIANGLE_CONTAINER::AddQuad(), CLAYER_TRIANGLE_CONTAINER::AddTriangle(), CROUNDSEGMENT2D::GetEnd(), CROUNDSEGMENT2D::GetLeftDir(), CROUNDSEGMENT2D::GetLeftEnd(), CROUNDSEGMENT2D::GetLeftStar(), CROUNDSEGMENT2D::GetRadius(), CROUNDSEGMENT2D::GetRadiusSquared(), CROUNDSEGMENT2D::GetRightDir(), CROUNDSEGMENT2D::GetRightEnd(), CROUNDSEGMENT2D::GetRightStar(), CROUNDSEGMENT2D::GetStart(), CLAYER_TRIANGLES::m_layer_bot_segment_ends, CLAYER_TRIANGLES::m_layer_bot_triangles, CLAYER_TRIANGLES::m_layer_top_segment_ends, CLAYER_TRIANGLES::m_layer_top_triangles, and SIZE_OF_CIRCLE_TEXTURE.

◆ add_triangle_top_bot()

void C3D_RENDER_OGL_LEGACY::add_triangle_top_bot ( CLAYER_TRIANGLES aDst,
const SFVEC2F v0,
const SFVEC2F v1,
const SFVEC2F v2,
float  top,
float  bot 
)
private

Definition at line 657 of file c3d_render_createscene_ogl_legacy.cpp.

663 {
664  aDst->m_layer_bot_triangles->AddTriangle( SFVEC3F( v0.x, v0.y, bot ),
665  SFVEC3F( v1.x, v1.y, bot ),
666  SFVEC3F( v2.x, v2.y, bot ) );
667 
668  aDst->m_layer_top_triangles->AddTriangle( SFVEC3F( v2.x, v2.y, top ),
669  SFVEC3F( v1.x, v1.y, top ),
670  SFVEC3F( v0.x, v0.y, top ) );
671 }
CLAYER_TRIANGLE_CONTAINER * m_layer_top_triangles
void AddTriangle(const SFVEC3F &aV1, const SFVEC3F &aV2, const SFVEC3F &aV3)
AddTriangle.
CLAYER_TRIANGLE_CONTAINER * m_layer_bot_triangles
glm::vec3 SFVEC3F
Definition: xv3d_types.h:47

References CLAYER_TRIANGLE_CONTAINER::AddTriangle(), CLAYER_TRIANGLES::m_layer_bot_triangles, and CLAYER_TRIANGLES::m_layer_top_triangles.

Referenced by add_object_to_triangle_layer(), generate_3D_Vias_and_Pads(), and reload().

◆ CreateBusyIndicator()

std::unique_ptr< BUSY_INDICATOR > C3D_RENDER_BASE::CreateBusyIndicator ( ) const
protectedinherited

Return a created busy indicator, if a factory has been set, else a null pointer.

Definition at line 64 of file c3d_render_base.cpp.

65 {
66  std::unique_ptr<BUSY_INDICATOR> busy;
67 
69  busy = m_busyIndicatorFactory();
70 
71  return busy;
72 }
BUSY_INDICATOR::FACTORY m_busyIndicatorFactory
Factory that returns a suitable busy indicator for the context.

References C3D_RENDER_BASE::m_busyIndicatorFactory.

Referenced by Redraw(), and C3D_RENDER_RAYTRACING::Redraw().

◆ generate_3D_Vias_and_Pads()

void C3D_RENDER_OGL_LEGACY::generate_3D_Vias_and_Pads ( )
private

Definition at line 732 of file c3d_render_createscene_ogl_legacy.cpp.

733 {
735  {
736  const unsigned int reserve_nr_triangles_estimation =
738  8 *
740 
741  CLAYER_TRIANGLES *layerTriangleVIA = new CLAYER_TRIANGLES( reserve_nr_triangles_estimation );
742 
743  // Insert plated vertical holes inside the board
744  // /////////////////////////////////////////////////////////////////////////
745 
746  // Insert vias holes (vertical cylinders)
747  for( auto track : m_settings.GetBoard()->Tracks() )
748  {
749  if( track->Type() == PCB_VIA_T )
750  {
751  const VIA *via = static_cast<const VIA*>(track);
752 
753  const float holediameter = via->GetDrillValue() * m_settings.BiuTo3Dunits();
754  const float thickness = m_settings.GetCopperThickness3DU();
755  const int nrSegments = m_settings.GetNrSegmentsCircle( via->GetDrillValue() );
756  const double correctionFactor = m_settings.GetCircleCorrectionFactor( nrSegments );
757  const float hole_inner_radius = ( holediameter / 2.0f ) * correctionFactor;
758 
759  const SFVEC2F via_center( via->GetStart().x * m_settings.BiuTo3Dunits(),
760  -via->GetStart().y * m_settings.BiuTo3Dunits() );
761 
762  PCB_LAYER_ID top_layer, bottom_layer;
763  via->LayerPair( &top_layer, &bottom_layer );
764 
765  float ztop, zbot, dummy;
766 
767  get_layer_z_pos( top_layer, ztop, dummy );
768  get_layer_z_pos( bottom_layer, dummy, zbot );
769 
770  wxASSERT( zbot < ztop );
771 
772  generate_cylinder( via_center,
773  hole_inner_radius,
774  hole_inner_radius + thickness,
775  ztop,
776  zbot,
777  nrSegments,
778  layerTriangleVIA );
779  }
780  }
781 
782  m_ogl_disp_list_via = new CLAYERS_OGL_DISP_LISTS( *layerTriangleVIA,
783  0,
784  0.0f,
785  0.0f );
786 
787  delete layerTriangleVIA;
788  }
789 
790 
791  if( m_settings.GetStats_Nr_Holes() > 0 )
792  {
793  SHAPE_POLY_SET tht_outer_holes_poly; // Stores the outer poly of the copper holes (the pad)
794  SHAPE_POLY_SET tht_inner_holes_poly; // Stores the inner poly of the copper holes (the hole)
795 
796  tht_outer_holes_poly.RemoveAllContours();
797  tht_inner_holes_poly.RemoveAllContours();
798 
799  // Insert pads holes (vertical cylinders)
800  for( const auto module : m_settings.GetBoard()->Modules() )
801  {
802  for( auto pad : module->Pads() )
803  {
804  if( pad->GetAttribute() != PAD_ATTRIB_HOLE_NOT_PLATED )
805  {
806  const wxSize drillsize = pad->GetDrillSize();
807  const bool hasHole = drillsize.x && drillsize.y;
808 
809  if( !hasHole )
810  continue;
811 
812  // we use the hole diameter to calculate the seg count.
813  // for round holes, drillsize.x == drillsize.y
814  // for slots, the diameter is the smaller of (drillsize.x, drillsize.y)
815  int copperThickness = m_settings.GetCopperThicknessBIU();
816  int radius = std::min( drillsize.x, drillsize.y ) / 2 + copperThickness;
817  int nrSegments = m_settings.GetNrSegmentsCircle( radius * 2 );
818  double correctionFactor = m_settings.GetCircleCorrectionFactor( nrSegments );
819  int correction = radius * ( correctionFactor - 1 );
820 
821  pad->BuildPadDrillShapePolygon(
822  tht_outer_holes_poly, copperThickness + correction );
823 
824  pad->BuildPadDrillShapePolygon( tht_inner_holes_poly, correction );
825  }
826  }
827  }
828 
829  // Subtract the holes
830  tht_outer_holes_poly.BooleanSubtract( tht_inner_holes_poly, SHAPE_POLY_SET::PM_FAST );
831 
832 
833  CCONTAINER2D holesContainer;
834 
835  Convert_shape_line_polygon_to_triangles( tht_outer_holes_poly,
836  holesContainer,
838  (const BOARD_ITEM &)*m_settings.GetBoard() );
839 
840  const LIST_OBJECT2D &listHolesObject2d = holesContainer.GetList();
841 
842  if( listHolesObject2d.size() > 0 )
843  {
844  float layer_z_top, layer_z_bot, dummy;
845 
846  get_layer_z_pos( F_Cu, layer_z_top, dummy );
847  get_layer_z_pos( B_Cu, dummy, layer_z_bot );
848 
849  CLAYER_TRIANGLES *layerTriangles = new CLAYER_TRIANGLES( listHolesObject2d.size() );
850 
851  // Convert the list of objects(triangles) to triangle layer structure
852  for( LIST_OBJECT2D::const_iterator itemOnLayer = listHolesObject2d.begin();
853  itemOnLayer != listHolesObject2d.end();
854  ++itemOnLayer )
855  {
856  const COBJECT2D *object2d_A = static_cast<const COBJECT2D *>(*itemOnLayer);
857 
858  wxASSERT( object2d_A->GetObjectType() == OBJECT2D_TYPE::TRIANGLE );
859 
860  const CTRIANGLE2D *tri = (const CTRIANGLE2D *)object2d_A;
861 
862  const SFVEC2F &v1 = tri->GetP1();
863  const SFVEC2F &v2 = tri->GetP2();
864  const SFVEC2F &v3 = tri->GetP3();
865 
866  add_triangle_top_bot( layerTriangles, v1, v2, v3,
867  layer_z_top, layer_z_bot );
868  }
869 
870  wxASSERT( tht_outer_holes_poly.OutlineCount() > 0 );
871 
872  if( tht_outer_holes_poly.OutlineCount() > 0 )
873  {
874  layerTriangles->AddToMiddleContourns( tht_outer_holes_poly,
875  layer_z_bot, layer_z_top,
877  false );
878 
880  *layerTriangles,
881  m_ogl_circle_texture, // not need
882  layer_z_top, layer_z_top );
883  }
884 
885  delete layerTriangles;
886  }
887  }
888 }
void LayerPair(PCB_LAYER_ID *top_layer, PCB_LAYER_ID *bottom_layer) const
Function LayerPair Return the 2 layers used by the via (the via actually uses all layers between thes...
unsigned int GetStats_Nr_Holes() const
GetStats_Nr_Holes - Get statistics of the nr of holes.
Definition: cinfo3d_visu.h:368
int OutlineCount() const
Returns the number of outlines in the set
The CLAYER_TRIANGLES class stores arrays of triangles to be used to create display lists.
OBJECT2D_TYPE GetObjectType() const
Definition: cobject2d.h:125
float GetStats_Med_Via_Hole_Diameter3DU() const
GetStats_Med_Via_Hole_Diameter3DU - Average diameter of the via holes.
Definition: cinfo3d_visu.h:374
like PAD_STANDARD, but not plated mechanical use only, no connection allowed
Definition: pad_shapes.h:66
BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class,...
const wxPoint & GetStart() const
Definition: class_track.h:109
unsigned int GetNrSegmentsCircle(float aDiameter3DU) const
GetNrSegmentsCircle.
CINFO3D_VISU & m_settings
settings refrence in use for this render
double BiuTo3Dunits() const
BiuTo3Dunits - Board integer units To 3D units.
Definition: cinfo3d_visu.h:141
const BOARD * GetBoard() const
GetBoard - Get current board to be rendered.
Definition: cinfo3d_visu.h:128
void get_layer_z_pos(PCB_LAYER_ID aLayerID, float &aOutZtop, float &aOutZbot) const
PCB_LAYER_ID
A quick note on layer IDs:
double GetCircleCorrectionFactor(int aNrSides) const
GetCircleCorrectionFactor - computes a angle correction factor used when creating circles.
glm::vec2 SFVEC2F
Definition: xv3d_types.h:45
int GetCopperThicknessBIU() const
GetCopperThicknessBIU - Get the current copper layer thickness.
int GetDrillValue() const
Function GetDrillValue "calculates" the drill value for vias (m-Drill if > 0, or default drill value ...
MODULES & Modules()
Definition: class_board.h:226
SHAPE_POLY_SET.
unsigned int GetStats_Nr_Vias() const
GetStats_Nr_Vias - Get statistics of the nr of vias.
Definition: cinfo3d_visu.h:362
void AddToMiddleContourns(const SHAPE_LINE_CHAIN &outlinePath, float zBot, float zTop, double aBiuTo3Du, bool aInvertFaceDirection)
CLAYERS_OGL_DISP_LISTS * m_ogl_disp_list_via
The CLAYERS_OGL_DISP_LISTS class stores the openGL display lists to related with a layer.
static LIB_PART * dummy()
Used to draw a dummy shape when a LIB_PART is not found in library.
std::list< COBJECT2D * > LIST_OBJECT2D
Definition: ccontainer2d.h:37
const SFVEC2F & GetP1() const
Definition: ctriangle2d.h:58
float GetCopperThickness3DU() const
GetCopperThickness3DU - Get the current copper layer thickness.
Definition: cinfo3d_visu.h:165
void RemoveAllContours()
Removes all outlines & holes (clears) the polygon set.
class VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:97
void BooleanSubtract(const SHAPE_POLY_SET &b, POLYGON_MODE aFastMode)
Performs boolean polyset difference For aFastMode meaning, see function booleanOp
void add_triangle_top_bot(CLAYER_TRIANGLES *aDst, const SFVEC2F &v0, const SFVEC2F &v1, const SFVEC2F &v2, float top, float bot)
CLAYERS_OGL_DISP_LISTS * m_ogl_disp_list_pads_holes
const LIST_OBJECT2D & GetList() const
Definition: ccontainer2d.h:64
TRACKS & Tracks()
Definition: class_board.h:217
void Convert_shape_line_polygon_to_triangles(SHAPE_POLY_SET &aPolyList, CGENERICCONTAINER2D &aDstContainer, float aBiuTo3DunitsScale, const BOARD_ITEM &aBoardItem)
void generate_cylinder(const SFVEC2F &aCenter, float aInnerRadius, float aOuterRadius, float aZtop, float aZbot, unsigned int aNr_sides_per_circle, CLAYER_TRIANGLES *aDstLayer)

References add_triangle_top_bot(), CLAYER_TRIANGLES::AddToMiddleContourns(), B_Cu, CINFO3D_VISU::BiuTo3Dunits(), SHAPE_POLY_SET::BooleanSubtract(), Convert_shape_line_polygon_to_triangles(), dummy(), F_Cu, generate_cylinder(), get_layer_z_pos(), CINFO3D_VISU::GetBoard(), CINFO3D_VISU::GetCircleCorrectionFactor(), CINFO3D_VISU::GetCopperThickness3DU(), CINFO3D_VISU::GetCopperThicknessBIU(), VIA::GetDrillValue(), CGENERICCONTAINER2D::GetList(), CINFO3D_VISU::GetNrSegmentsCircle(), COBJECT2D::GetObjectType(), TRACK::GetStart(), CINFO3D_VISU::GetStats_Med_Via_Hole_Diameter3DU(), CINFO3D_VISU::GetStats_Nr_Holes(), CINFO3D_VISU::GetStats_Nr_Vias(), VIA::LayerPair(), m_ogl_circle_texture, m_ogl_disp_list_pads_holes, m_ogl_disp_list_via, C3D_RENDER_BASE::m_settings, BOARD::Modules(), SHAPE_POLY_SET::OutlineCount(), PAD_ATTRIB_HOLE_NOT_PLATED, PCB_VIA_T, SHAPE_POLY_SET::PM_FAST, SHAPE_POLY_SET::RemoveAllContours(), BOARD::Tracks(), TRIANGLE, wxPoint::x, and wxPoint::y.

Referenced by reload().

◆ generate_cylinder()

void C3D_RENDER_OGL_LEGACY::generate_cylinder ( const SFVEC2F aCenter,
float  aInnerRadius,
float  aOuterRadius,
float  aZtop,
float  aZbot,
unsigned int  aNr_sides_per_circle,
CLAYER_TRIANGLES aDstLayer 
)
private

Definition at line 690 of file c3d_render_createscene_ogl_legacy.cpp.

697 {
698  std::vector< SFVEC2F > innerContour;
699  std::vector< SFVEC2F > outerContour;
700 
701  generate_ring_contour( aCenter,
702  aInnerRadius,
703  aOuterRadius,
704  aNr_sides_per_circle,
705  innerContour,
706  outerContour,
707  false );
708 
709  for( unsigned int i = 0; i < ( innerContour.size() - 1 ); ++i )
710  {
711  const SFVEC2F &vi0 = innerContour[i + 0];
712  const SFVEC2F &vi1 = innerContour[i + 1];
713  const SFVEC2F &vo0 = outerContour[i + 0];
714  const SFVEC2F &vo1 = outerContour[i + 1];
715 
716  aDstLayer->m_layer_top_triangles->AddQuad( SFVEC3F( vi1.x, vi1.y, aZtop ),
717  SFVEC3F( vi0.x, vi0.y, aZtop ),
718  SFVEC3F( vo0.x, vo0.y, aZtop ),
719  SFVEC3F( vo1.x, vo1.y, aZtop ) );
720 
721  aDstLayer->m_layer_bot_triangles->AddQuad( SFVEC3F( vi1.x, vi1.y, aZbot ),
722  SFVEC3F( vo1.x, vo1.y, aZbot ),
723  SFVEC3F( vo0.x, vo0.y, aZbot ),
724  SFVEC3F( vi0.x, vi0.y, aZbot ) );
725  }
726 
727  aDstLayer->AddToMiddleContourns( outerContour, aZbot, aZtop, true );
728  aDstLayer->AddToMiddleContourns( innerContour, aZbot, aZtop, false );
729 }
void generate_ring_contour(const SFVEC2F &aCenter, float aInnerRadius, float aOuterRadius, unsigned int aNr_sides_per_circle, std::vector< SFVEC2F > &aInnerContourResult, std::vector< SFVEC2F > &aOuterContourResult, bool aInvertOrder)
glm::vec2 SFVEC2F
Definition: xv3d_types.h:45
CLAYER_TRIANGLE_CONTAINER * m_layer_top_triangles
void AddToMiddleContourns(const SHAPE_LINE_CHAIN &outlinePath, float zBot, float zTop, double aBiuTo3Du, bool aInvertFaceDirection)
CLAYER_TRIANGLE_CONTAINER * m_layer_bot_triangles
glm::vec3 SFVEC3F
Definition: xv3d_types.h:47
void AddQuad(const SFVEC3F &aV1, const SFVEC3F &aV2, const SFVEC3F &aV3, const SFVEC3F &aV4)
AddQuad.

References CLAYER_TRIANGLE_CONTAINER::AddQuad(), CLAYER_TRIANGLES::AddToMiddleContourns(), generate_ring_contour(), CLAYER_TRIANGLES::m_layer_bot_triangles, and CLAYER_TRIANGLES::m_layer_top_triangles.

Referenced by generate_3D_Vias_and_Pads().

◆ generate_holes_display_list()

CLAYERS_OGL_DISP_LISTS * C3D_RENDER_OGL_LEGACY::generate_holes_display_list ( const LIST_OBJECT2D aListHolesObject2d,
const SHAPE_POLY_SET aPoly,
float  aZtop,
float  aZbot,
bool  aInvertFaces 
)
private

Definition at line 270 of file c3d_render_createscene_ogl_legacy.cpp.

276 {
278 
279  if( aListHolesObject2d.size() > 0 )
280  {
281  CLAYER_TRIANGLES *layerTriangles = new CLAYER_TRIANGLES( aListHolesObject2d.size() * 2 );
282 
283  // Convert the list of objects(filled circles) to triangle layer structure
284  for( LIST_OBJECT2D::const_iterator itemOnLayer = aListHolesObject2d.begin();
285  itemOnLayer != aListHolesObject2d.end();
286  ++itemOnLayer )
287  {
288  const COBJECT2D* object2d_A = static_cast<const COBJECT2D*>( *itemOnLayer );
289 
290  wxASSERT( ( object2d_A->GetObjectType() == OBJECT2D_TYPE::FILLED_CIRCLE )
291  || ( object2d_A->GetObjectType() == OBJECT2D_TYPE::ROUNDSEG ) );
292 
293  switch( object2d_A->GetObjectType() )
294  {
296  add_object_to_triangle_layer( static_cast<const CFILLEDCIRCLE2D*>( object2d_A ),
297  layerTriangles, aZtop, aZbot );
298  break;
299 
301  add_object_to_triangle_layer( static_cast<const CROUNDSEGMENT2D*>( object2d_A ),
302  layerTriangles, aZtop, aZbot );
303  break;
304 
305  default:
306  wxFAIL_MSG(
307  "C3D_RENDER_OGL_LEGACY::generate_holes_display_list: Object type is not implemented" );
308  break;
309  }
310  }
311 
312  // Note: he can have a aListHolesObject2d whith holes but without countours
313  // eg: when there are only NPTH on the list and the contours were not
314  // added
315 
316  if( aPoly.OutlineCount() > 0 )
317  {
318  layerTriangles->AddToMiddleContourns( aPoly,
319  aZbot,
320  aZtop,
322  aInvertFaces );
323  }
324 
325  ret = new CLAYERS_OGL_DISP_LISTS( *layerTriangles,
327  aZbot,
328  aZtop );
329 
330  delete layerTriangles;
331  }
332 
333  return ret;
334 }
void add_object_to_triangle_layer(const CRING2D *aRing, CLAYER_TRIANGLES *aDstLayer, float aZtop, float aZbot)
int OutlineCount() const
Returns the number of outlines in the set
The CLAYER_TRIANGLES class stores arrays of triangles to be used to create display lists.
OBJECT2D_TYPE GetObjectType() const
Definition: cobject2d.h:125
CINFO3D_VISU & m_settings
settings refrence in use for this render
double BiuTo3Dunits() const
BiuTo3Dunits - Board integer units To 3D units.
Definition: cinfo3d_visu.h:141
#define NULL
void AddToMiddleContourns(const SHAPE_LINE_CHAIN &outlinePath, float zBot, float zTop, double aBiuTo3Du, bool aInvertFaceDirection)
The CLAYERS_OGL_DISP_LISTS class stores the openGL display lists to related with a layer.

References add_object_to_triangle_layer(), CLAYER_TRIANGLES::AddToMiddleContourns(), CINFO3D_VISU::BiuTo3Dunits(), FILLED_CIRCLE, COBJECT2D::GetObjectType(), m_ogl_circle_texture, C3D_RENDER_BASE::m_settings, NULL, SHAPE_POLY_SET::OutlineCount(), and ROUNDSEG.

Referenced by reload().

◆ generate_new_3DGrid()

void C3D_RENDER_OGL_LEGACY::generate_new_3DGrid ( GRID3D_TYPE  aGridType)
private

Definition at line 1148 of file c3d_render_ogl_legacy.cpp.

1149 {
1150  if( glIsList( m_ogl_disp_list_grid ) )
1151  glDeleteLists( m_ogl_disp_list_grid, 1 );
1152 
1154 
1155  if( aGridType == GRID3D_TYPE::NONE )
1156  return;
1157 
1158  m_ogl_disp_list_grid = glGenLists( 1 );
1159 
1160  if( !glIsList( m_ogl_disp_list_grid ) )
1161  return;
1162 
1163  glNewList( m_ogl_disp_list_grid, GL_COMPILE );
1164 
1165  glEnable( GL_BLEND );
1166  glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
1167 
1168  const double zpos = 0.0;
1169 
1170  // Color of grid lines
1171  const SFVEC3F gridColor = m_settings.GetColor( DARKGRAY );
1172 
1173  // Color of grid lines every 5 lines
1174  const SFVEC3F gridColor_marker = m_settings.GetColor( LIGHTGRAY );
1175  const double scale = m_settings.BiuTo3Dunits();
1176  const double transparency = 0.35;
1177 
1178  double griSizeMM = 0.0;
1179 
1180  switch( aGridType )
1181  {
1182  default:
1183  case GRID3D_TYPE::NONE:
1184  return;
1185  case GRID3D_TYPE::GRID_1MM:
1186  griSizeMM = 1.0;
1187  break;
1189  griSizeMM = 2.5;
1190  break;
1191  case GRID3D_TYPE::GRID_5MM:
1192  griSizeMM = 5.0;
1193  break;
1195  griSizeMM = 10.0;
1196  break;
1197  }
1198 
1199  glNormal3f( 0.0, 0.0, 1.0 );
1200 
1201  const wxSize brd_size = m_settings.GetBoardSizeBIU();
1202  wxPoint brd_center_pos = m_settings.GetBoardPosBIU();
1203 
1204  brd_center_pos.y = -brd_center_pos.y;
1205 
1206  const int xsize = std::max( brd_size.x, Millimeter2iu( 100 ) ) * 1.2;
1207  const int ysize = std::max( brd_size.y, Millimeter2iu( 100 ) ) * 1.2;
1208 
1209  // Grid limits, in 3D units
1210  double xmin = (brd_center_pos.x - xsize / 2) * scale;
1211  double xmax = (brd_center_pos.x + xsize / 2) * scale;
1212  double ymin = (brd_center_pos.y - ysize / 2) * scale;
1213  double ymax = (brd_center_pos.y + ysize / 2) * scale;
1214  double zmin = Millimeter2iu( -50 ) * scale;
1215  double zmax = Millimeter2iu( 100 ) * scale;
1216 
1217  // Draw horizontal grid centered on 3D origin (center of the board)
1218  for( int ii = 0; ; ii++ )
1219  {
1220  if( (ii % 5) )
1221  glColor4f( gridColor.r, gridColor.g, gridColor.b, transparency );
1222  else
1223  glColor4f( gridColor_marker.r,
1224  gridColor_marker.g,
1225  gridColor_marker.b,
1226  transparency );
1227 
1228  const int delta = KiROUND( ii * griSizeMM * IU_PER_MM );
1229 
1230  if( delta <= xsize / 2 ) // Draw grid lines parallel to X axis
1231  {
1232  glBegin( GL_LINES );
1233  glVertex3f( (brd_center_pos.x + delta) * scale, -ymin, zpos );
1234  glVertex3f( (brd_center_pos.x + delta) * scale, -ymax, zpos );
1235  glEnd();
1236 
1237  if( ii != 0 )
1238  {
1239  glBegin( GL_LINES );
1240  glVertex3f( (brd_center_pos.x - delta) * scale, -ymin, zpos );
1241  glVertex3f( (brd_center_pos.x - delta) * scale, -ymax, zpos );
1242  glEnd();
1243  }
1244  }
1245 
1246  if( delta <= ysize / 2 ) // Draw grid lines parallel to Y axis
1247  {
1248  glBegin( GL_LINES );
1249  glVertex3f( xmin, -(brd_center_pos.y + delta) * scale, zpos );
1250  glVertex3f( xmax, -(brd_center_pos.y + delta) * scale, zpos );
1251  glEnd();
1252 
1253  if( ii != 0 )
1254  {
1255  glBegin( GL_LINES );
1256  glVertex3f( xmin, -(brd_center_pos.y - delta) * scale, zpos );
1257  glVertex3f( xmax, -(brd_center_pos.y - delta) * scale, zpos );
1258  glEnd();
1259  }
1260  }
1261 
1262  if( ( delta > ysize / 2 ) && ( delta > xsize / 2 ) )
1263  break;
1264  }
1265 
1266  // Draw vertical grid on Z axis
1267  glNormal3f( 0.0, -1.0, 0.0 );
1268 
1269  // Draw vertical grid lines (parallel to Z axis)
1270  double posy = -brd_center_pos.y * scale;
1271 
1272  for( int ii = 0; ; ii++ )
1273  {
1274  if( (ii % 5) )
1275  glColor4f( gridColor.r, gridColor.g, gridColor.b, transparency );
1276  else
1277  glColor4f( gridColor_marker.r,
1278  gridColor_marker.g,
1279  gridColor_marker.b,
1280  transparency );
1281 
1282  const double delta = ii * griSizeMM * IU_PER_MM;
1283 
1284  glBegin( GL_LINES );
1285  xmax = (brd_center_pos.x + delta) * scale;
1286 
1287  glVertex3f( xmax, posy, zmin );
1288  glVertex3f( xmax, posy, zmax );
1289  glEnd();
1290 
1291  if( ii != 0 )
1292  {
1293  glBegin( GL_LINES );
1294  xmin = (brd_center_pos.x - delta) * scale;
1295  glVertex3f( xmin, posy, zmin );
1296  glVertex3f( xmin, posy, zmax );
1297  glEnd();
1298  }
1299 
1300  if( delta > xsize / 2.0f )
1301  break;
1302  }
1303 
1304  // Draw horizontal grid lines on Z axis (parallel to X axis)
1305  for( int ii = 0; ; ii++ )
1306  {
1307  if( (ii % 5) )
1308  glColor4f( gridColor.r, gridColor.g, gridColor.b, transparency );
1309  else
1310  glColor4f( gridColor_marker.r,
1311  gridColor_marker.g,
1312  gridColor_marker.b,
1313  transparency );
1314 
1315  const double delta = ii * griSizeMM * IU_PER_MM * scale;
1316 
1317  if( delta <= zmax )
1318  {
1319  // Draw grid lines on Z axis (positive Z axis coordinates)
1320  glBegin( GL_LINES );
1321  glVertex3f( xmin, posy, delta );
1322  glVertex3f( xmax, posy, delta );
1323  glEnd();
1324  }
1325 
1326  if( delta <= -zmin && ( ii != 0 ) )
1327  {
1328  // Draw grid lines on Z axis (negative Z axis coordinates)
1329  glBegin( GL_LINES );
1330  glVertex3f( xmin, posy, -delta );
1331  glVertex3f( xmax, posy, -delta );
1332  glEnd();
1333  }
1334 
1335  if( ( delta > zmax ) && ( delta > -zmin ) )
1336  break;
1337  }
1338 
1339  glDisable( GL_BLEND );
1340 
1341  glEndList();
1342 }
wxSize GetBoardSizeBIU() const
GetBoardSizeBIU - Get the board size.
Definition: cinfo3d_visu.h:177
CINFO3D_VISU & m_settings
settings refrence in use for this render
double BiuTo3Dunits() const
BiuTo3Dunits - Board integer units To 3D units.
Definition: cinfo3d_visu.h:141
wxPoint GetBoardPosBIU() const
GetBoardPosBIU - Get the board size.
Definition: cinfo3d_visu.h:183
SFVEC3F GetColor(COLOR4D aColor) const
GetColor.
GLuint m_ogl_disp_list_grid
oGL list that stores current grid
const int scale
glm::vec3 SFVEC3F
Definition: xv3d_types.h:47
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: util.h:61

References CINFO3D_VISU::BiuTo3Dunits(), DARKGRAY, CINFO3D_VISU::GetBoardPosBIU(), CINFO3D_VISU::GetBoardSizeBIU(), CINFO3D_VISU::GetColor(), GRID_10MM, GRID_1MM, GRID_2P5MM, GRID_5MM, KiROUND(), LIGHTGRAY, m_ogl_disp_list_grid, C3D_RENDER_BASE::m_settings, NONE, scale, wxPoint::x, and wxPoint::y.

Referenced by Redraw().

◆ generate_ring_contour()

void C3D_RENDER_OGL_LEGACY::generate_ring_contour ( const SFVEC2F aCenter,
float  aInnerRadius,
float  aOuterRadius,
unsigned int  aNr_sides_per_circle,
std::vector< SFVEC2F > &  aInnerContourResult,
std::vector< SFVEC2F > &  aOuterContourResult,
bool  aInvertOrder 
)
private

Definition at line 93 of file c3d_render_createscene_ogl_legacy.cpp.

100 {
101  aInnerContourResult.clear();
102  aInnerContourResult.reserve( aNr_sides_per_circle + 2 );
103 
104  aOuterContourResult.clear();
105  aOuterContourResult.reserve( aNr_sides_per_circle + 2 );
106 
107  const int delta = 3600 / aNr_sides_per_circle;
108 
109  for( int ii = 0; ii < 3600; ii += delta )
110  {
111  float angle = (float)( aInvertOrder ? ( 3600 - ii ) : ii )
112  * 2.0f * glm::pi<float>() / 3600.0f;
113  const SFVEC2F rotatedDir = SFVEC2F( cos( angle ), sin( angle ) );
114 
115  aInnerContourResult.emplace_back( aCenter.x + rotatedDir.x * aInnerRadius,
116  aCenter.y + rotatedDir.y * aInnerRadius );
117 
118  aOuterContourResult.emplace_back( aCenter.x + rotatedDir.x * aOuterRadius,
119  aCenter.y + rotatedDir.y * aOuterRadius );
120  }
121 
122  aInnerContourResult.push_back( aInnerContourResult[0] );
123  aOuterContourResult.push_back( aOuterContourResult[0] );
124 
125  wxASSERT( aInnerContourResult.size() == aOuterContourResult.size() );
126 }
glm::vec2 SFVEC2F
Definition: xv3d_types.h:45
static DIRECTION_45::AngleType angle(const VECTOR2I &a, const VECTOR2I &b)

References PNS::angle().

Referenced by add_object_to_triangle_layer(), and generate_cylinder().

◆ generate_through_inner_holes()

void C3D_RENDER_OGL_LEGACY::generate_through_inner_holes ( )
private

◆ generate_through_outer_holes()

void C3D_RENDER_OGL_LEGACY::generate_through_outer_holes ( )
private

◆ get_layer_color()

SFVEC3F C3D_RENDER_OGL_LEGACY::get_layer_color ( PCB_LAYER_ID  aLayerID)
private

Definition at line 414 of file c3d_render_ogl_legacy.cpp.

415 {
416  SFVEC3F layerColor = m_settings.GetLayerColor( aLayerID );
417 
419  {
420  switch( aLayerID )
421  {
422  case B_Adhes:
423  case F_Adhes:
424  break;
425 
426  case B_Mask:
427  layerColor = m_settings.m_SolderMaskColorBot;
428  break;
429  case F_Mask:
430  layerColor = m_settings.m_SolderMaskColorTop;
431  break;
432 
433  case B_Paste:
434  case F_Paste:
435  layerColor = m_settings.m_SolderPasteColor;
436  break;
437 
438  case B_SilkS:
439  layerColor = m_settings.m_SilkScreenColorBot;
440  break;
441  case F_SilkS:
442  layerColor = m_settings.m_SilkScreenColorTop;
443  break;
444 
445  case Dwgs_User:
446  case Cmts_User:
447  case Eco1_User:
448  case Eco2_User:
449  case Edge_Cuts:
450  case Margin:
451  break;
452 
453  case B_CrtYd:
454  case F_CrtYd:
455  break;
456 
457  case B_Fab:
458  case F_Fab:
459  break;
460 
461  default:
462  layerColor = m_settings.m_CopperColor;
463  break;
464  }
465  }
466 
467  return layerColor;
468 }
SFVEC3D m_CopperColor
in realistic mode: copper color
Definition: cinfo3d_visu.h:505
SFVEC3D m_SolderMaskColorBot
in realistic mode: solder mask color ( bot )
Definition: cinfo3d_visu.h:500
SFVEC3D m_SolderMaskColorTop
in realistic mode: solder mask color ( top )
Definition: cinfo3d_visu.h:501
SFVEC3D m_SilkScreenColorTop
in realistic mode: SilkScreen color ( top )
Definition: cinfo3d_visu.h:504
CINFO3D_VISU & m_settings
settings refrence in use for this render
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.
SFVEC3D m_SilkScreenColorBot
in realistic mode: SilkScreen color ( bot )
Definition: cinfo3d_visu.h:503
SFVEC3D m_SolderPasteColor
in realistic mode: solder paste color
Definition: cinfo3d_visu.h:502
glm::vec3 SFVEC3F
Definition: xv3d_types.h:47

References B_Adhes, B_CrtYd, B_Fab, B_Mask, B_Paste, B_SilkS, Cmts_User, Dwgs_User, Eco1_User, Eco2_User, Edge_Cuts, F_Adhes, F_CrtYd, F_Fab, F_Mask, F_Paste, F_SilkS, FL_USE_REALISTIC_MODE, CINFO3D_VISU::GetFlag(), CINFO3D_VISU::GetLayerColor(), CINFO3D_VISU::m_CopperColor, C3D_RENDER_BASE::m_settings, CINFO3D_VISU::m_SilkScreenColorBot, CINFO3D_VISU::m_SilkScreenColorTop, CINFO3D_VISU::m_SolderMaskColorBot, CINFO3D_VISU::m_SolderMaskColorTop, CINFO3D_VISU::m_SolderPasteColor, and Margin.

Referenced by set_layer_material().

◆ get_layer_z_pos()

void C3D_RENDER_OGL_LEGACY::get_layer_z_pos ( PCB_LAYER_ID  aLayerID,
float &  aOutZtop,
float &  aOutZbot 
) const
private

Definition at line 674 of file c3d_render_createscene_ogl_legacy.cpp.

677 {
678  aOutZbot = m_settings.GetLayerBottomZpos3DU( aLayerID );
679  aOutZtop = m_settings.GetLayerTopZpos3DU( aLayerID );
680 
681  if( aOutZtop < aOutZbot )
682  {
683  float tmpFloat = aOutZbot;
684  aOutZbot = aOutZtop;
685  aOutZtop = tmpFloat;
686  }
687 }
CINFO3D_VISU & m_settings
settings refrence in use for this render
float GetLayerBottomZpos3DU(PCB_LAYER_ID aLayerId) const
GetLayerBottomZpos3DU - Get the bottom z position.
Definition: cinfo3d_visu.h:287
float GetLayerTopZpos3DU(PCB_LAYER_ID aLayerId) const
GetLayerTopZpos3DU - Get the top z position.
Definition: cinfo3d_visu.h:280

References CINFO3D_VISU::GetLayerBottomZpos3DU(), CINFO3D_VISU::GetLayerTopZpos3DU(), and C3D_RENDER_BASE::m_settings.

Referenced by generate_3D_Vias_and_Pads(), and reload().

◆ GetBoardDispList()

const CLAYERS_OGL_DISP_LISTS* C3D_RENDER_OGL_LEGACY::GetBoardDispList ( ) const
inline

Definition at line 219 of file c3d_render_ogl_legacy.h.

219 { return m_ogl_disp_list_board; }
CLAYERS_OGL_DISP_LISTS * m_ogl_disp_list_board

References m_ogl_disp_list_board.

◆ GetLayerDispList()

const CLAYERS_OGL_DISP_LISTS* C3D_RENDER_OGL_LEGACY::GetLayerDispList ( PCB_LAYER_ID  aLayerId) const
inline

Definition at line 218 of file c3d_render_ogl_legacy.h.

218 { return m_ogl_disp_lists_layers.at( aLayerId ); }
MAP_OGL_DISP_LISTS m_ogl_disp_lists_layers

References m_ogl_disp_lists_layers.

◆ GetLayerDispListMap()

const MAP_OGL_DISP_LISTS& C3D_RENDER_OGL_LEGACY::GetLayerDispListMap ( ) const
inline

Definition at line 217 of file c3d_render_ogl_legacy.h.

217 { return m_ogl_disp_lists_layers; }
MAP_OGL_DISP_LISTS m_ogl_disp_lists_layers

References m_ogl_disp_lists_layers.

◆ GetWaitForEditingTimeOut()

int C3D_RENDER_OGL_LEGACY::GetWaitForEditingTimeOut ( )
overridevirtual

GetWaitForEditingTimeOut - Give the interface the time (in ms) that it should wait for editing or movements before (this works for display preview mode)

Returns
a value in miliseconds

Implements C3D_RENDER_BASE.

Definition at line 85 of file c3d_render_ogl_legacy.cpp.

86 {
87  return 50; // ms
88 }

◆ initializeOpenGL()

bool C3D_RENDER_OGL_LEGACY::initializeOpenGL ( )
private

Definition at line 824 of file c3d_render_ogl_legacy.cpp.

825 {
826  glEnable( GL_LINE_SMOOTH );
827  glShadeModel( GL_SMOOTH );
828 
829  // 4-byte pixel alignment
830  glPixelStorei( GL_UNPACK_ALIGNMENT, 4 );
831 
832  // Initialize the open GL texture to draw the filled semi-circle of the segments
834 
835  if( !circleImage )
836  return false;
837 
838  circleImage->CircleFilled( (SIZE_OF_CIRCLE_TEXTURE / 2) - 0,
839  (SIZE_OF_CIRCLE_TEXTURE / 2) - 0,
840  (SIZE_OF_CIRCLE_TEXTURE / 2) - 4,
841  0xFF );
842 
843  //circleImage->CircleFilled( (SIZE_OF_CIRCLE_TEXTURE / 4)*1.5f - 1,
844  // (SIZE_OF_CIRCLE_TEXTURE / 4)*1.5f - 1,
845  // (SIZE_OF_CIRCLE_TEXTURE / 4)*1.5f - 2, 0xFF );
846 
847  CIMAGE *circleImage_Copy = new CIMAGE( *circleImage );
848 
849  circleImage->EfxFilter( circleImage_Copy, IMAGE_FILTER::BLUR_3X3 );
850 
851  m_ogl_circle_texture = OGL_LoadTexture( *circleImage );
852 
853  //circleImage_Copy->SaveAsPNG("circleImage.png");
854  delete circleImage_Copy;
855  circleImage_Copy = 0;
856 
857  //circleImage->SaveAsPNG("circleImage_blured.png");
858  delete circleImage;
859  circleImage = 0;
860 
861  init_lights();
862 
863  // Use this mode if you want see the triangle lines (debug proposes)
864  //glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );
865 
867 
868  return true;
869 }
void init_lights(void)
void CircleFilled(int aCx, int aCy, int aRadius, unsigned char aValue)
CircleFilled.
Definition: cimage.cpp:172
GLuint OGL_LoadTexture(const CIMAGE &aImage)
OGL_LoadTexture - generate a new OpenGL texture.
Definition: ogl_utils.cpp:80
bool m_is_opengl_initialized
flag if the opengl specific for this render was already initialized
#define SIZE_OF_CIRCLE_TEXTURE
CIMAGE manages a 8-bit channel image.
Definition: cimage.h:89
void EfxFilter(CIMAGE *aInImg, IMAGE_FILTER aFilterType)
Function EfxFilter apply a filter to the input image and stores it in the image class this <- FilterT...
Definition: cimage.cpp:471

References BLUR_3X3, CIMAGE::CircleFilled(), CIMAGE::EfxFilter(), init_lights(), C3D_RENDER_BASE::m_is_opengl_initialized, m_ogl_circle_texture, OGL_LoadTexture(), and SIZE_OF_CIRCLE_TEXTURE.

Referenced by Redraw().

◆ IsReloadRequestPending()

bool C3D_RENDER_BASE::IsReloadRequestPending ( ) const
inlineinherited

IsReloadRequestPending - Query if there is a pending reload request.

Returns
true if it wants to reload, false if there is no reload pending

Definition at line 81 of file c3d_render_base.h.

81 { return m_reloadRequested; }
bool m_reloadRequested
!TODO: this must be reviewed in order to flag change types

References C3D_RENDER_BASE::m_reloadRequested.

Referenced by EDA_3D_CANVAS::IsReloadRequestPending().

◆ load_3D_models()

void C3D_RENDER_OGL_LEGACY::load_3D_models ( REPORTER aStatusTextReporter)
private

Definition at line 897 of file c3d_render_createscene_ogl_legacy.cpp.

898 {
902  return;
903 
904  // Go for all modules
905  for( auto module : m_settings.GetBoard()->Modules() )
906  {
907  if( !module->Models().empty() )
908  {
909  // Get the list of model files for this model
910  auto sM = module->Models().begin();
911  auto eM = module->Models().end();
912 
913  while( sM != eM )
914  {
915  if( !sM->m_Filename.empty() )
916  {
917  if( aStatusTextReporter )
918  {
919  // Display the short filename of the 3D model loaded:
920  // (the full name is usually too long to be displayed)
921  wxFileName fn( sM->m_Filename );
922  wxString msg;
923  msg.Printf( _( "Loading %s" ), fn.GetFullName() );
924  aStatusTextReporter->Report( msg );
925  }
926 
927  // Check if the model is not present in our cache map
928  // (Not already loaded in memory)
929  if( m_3dmodel_map.find( sM->m_Filename ) == m_3dmodel_map.end() )
930  {
931  // It is not present, try get it from cache
932  const S3DMODEL *modelPtr =
933  m_settings.Get3DCacheManager()->GetModel( sM->m_Filename );
934 
935  // only add it if the return is not NULL
936  if( modelPtr )
937  {
938  C_OGL_3DMODEL* ogl_model =
939  new C_OGL_3DMODEL( *modelPtr,
941 
942  if( ogl_model )
943  m_3dmodel_map[ sM->m_Filename ] = ogl_model;
944  }
945  }
946  }
947 
948  ++sM;
949  }
950  }
951  }
952 }
CINFO3D_VISU & m_settings
settings refrence in use for this render
bool GetFlag(DISPLAY3D_FLG aFlag) const
GetFlag - get a configuration status of a flag.
S3DMODEL * GetModel(const wxString &aModelFileName)
Function GetModel attempts to load the scene data for a model and to translate it into an S3D_MODEL s...
Definition: 3d_cache.cpp:731
MATERIAL_MODE MaterialModeGet() const
MaterialModeGet.
Definition: cinfo3d_visu.h:246
const BOARD * GetBoard() const
GetBoard - Get current board to be rendered.
Definition: cinfo3d_visu.h:128
MODULES & Modules()
Definition: class_board.h:226
S3D_CACHE * Get3DCacheManager() const
Get3DCacheManager - Return the 3d cache manager pointer.
Definition: cinfo3d_visu.h:88
#define _(s)
Definition: 3d_actions.cpp:31
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_UNDEFINED)=0
Function Report is a pure virtual function to override in the derived object.
Store the a model based on meshes and materials.
Definition: c3dmodel.h:90

References _, FL_MODULE_ATTRIBUTES_NORMAL, FL_MODULE_ATTRIBUTES_NORMAL_INSERT, FL_MODULE_ATTRIBUTES_VIRTUAL, CINFO3D_VISU::Get3DCacheManager(), CINFO3D_VISU::GetBoard(), CINFO3D_VISU::GetFlag(), S3D_CACHE::GetModel(), m_3dmodel_map, C3D_RENDER_BASE::m_settings, CINFO3D_VISU::MaterialModeGet(), BOARD::Modules(), and REPORTER::Report().

Referenced by reload().

◆ ogl_free_all_display_lists()

void C3D_RENDER_OGL_LEGACY::ogl_free_all_display_lists ( )
private

Definition at line 891 of file c3d_render_ogl_legacy.cpp.

892 {
893  if( glIsList( m_ogl_disp_list_grid ) )
894  glDeleteLists( m_ogl_disp_list_grid, 1 );
895 
897 
898  for( MAP_OGL_DISP_LISTS::const_iterator ii = m_ogl_disp_lists_layers.begin();
899  ii != m_ogl_disp_lists_layers.end();
900  ++ii )
901  {
902  CLAYERS_OGL_DISP_LISTS *pLayerDispList = static_cast<CLAYERS_OGL_DISP_LISTS*>(ii->second);
903  delete pLayerDispList;
904  }
905 
906  m_ogl_disp_lists_layers.clear();
907 
908 
909  for( MAP_OGL_DISP_LISTS::const_iterator ii = m_ogl_disp_lists_layers_holes_outer.begin();
911  ++ii )
912  {
913  CLAYERS_OGL_DISP_LISTS *pLayerDispList = static_cast<CLAYERS_OGL_DISP_LISTS*>(ii->second);
914  delete pLayerDispList;
915  }
916 
918 
919 
920  for( MAP_OGL_DISP_LISTS::const_iterator ii = m_ogl_disp_lists_layers_holes_inner.begin();
922  ++ii )
923  {
924  CLAYERS_OGL_DISP_LISTS *pLayerDispList = static_cast<CLAYERS_OGL_DISP_LISTS*>(ii->second);
925  delete pLayerDispList;
926  }
927 
929 
930  for( MAP_TRIANGLES::const_iterator ii = m_triangles.begin();
931  ii != m_triangles.end();
932  ++ii )
933  {
934  CLAYER_TRIANGLES *pointer = static_cast<CLAYER_TRIANGLES*>(ii->second);
935  delete pointer;
936  }
937 
938  m_triangles.clear();
939 
940 
941  for( MAP_3DMODEL::const_iterator ii = m_3dmodel_map.begin();
942  ii != m_3dmodel_map.end();
943  ++ii )
944  {
945  C_OGL_3DMODEL *pointer = static_cast<C_OGL_3DMODEL*>(ii->second);
946  delete pointer;
947  }
948 
949  m_3dmodel_map.clear();
950 
951 
952  delete m_ogl_disp_list_board;
954 
957 
960 
963 
966 
967  delete m_ogl_disp_list_via;
969 
972 
975 }
MAP_OGL_DISP_LISTS m_ogl_disp_lists_layers
The CLAYER_TRIANGLES class stores arrays of triangles to be used to create display lists.
MAP_OGL_DISP_LISTS m_ogl_disp_lists_layers_holes_outer
CLAYERS_OGL_DISP_LISTS * m_ogl_disp_list_through_holes_inner
CLAYERS_OGL_DISP_LISTS * m_ogl_disp_list_through_holes_outer
CLAYERS_OGL_DISP_LISTS * m_ogl_disp_list_through_holes_vias_outer
CLAYERS_OGL_DISP_LISTS * m_ogl_disp_list_via
GLuint m_ogl_disp_list_grid
oGL list that stores current grid
MAP_OGL_DISP_LISTS m_ogl_disp_lists_layers_holes_inner
The CLAYERS_OGL_DISP_LISTS class stores the openGL display lists to related with a layer.
CLAYERS_OGL_DISP_LISTS * m_ogl_disp_list_through_holes_outer_with_npth
CLAYERS_OGL_DISP_LISTS * m_ogl_disp_list_board
CLAYERS_OGL_DISP_LISTS * m_ogl_disp_list_vias_and_pad_holes_outer_contourn_and_caps
CLAYERS_OGL_DISP_LISTS * m_ogl_disp_list_pads_holes

References m_3dmodel_map, m_ogl_disp_list_board, m_ogl_disp_list_grid, m_ogl_disp_list_pads_holes, m_ogl_disp_list_through_holes_inner, m_ogl_disp_list_through_holes_outer, m_ogl_disp_list_through_holes_outer_with_npth, m_ogl_disp_list_through_holes_vias_outer, m_ogl_disp_list_via, m_ogl_disp_list_vias_and_pad_holes_outer_contourn_and_caps, m_ogl_disp_lists_layers, m_ogl_disp_lists_layers_holes_inner, m_ogl_disp_lists_layers_holes_outer, and m_triangles.

Referenced by reload(), and ~C3D_RENDER_OGL_LEGACY().

◆ ogl_set_arrow_material()

void C3D_RENDER_OGL_LEGACY::ogl_set_arrow_material ( )
private

Definition at line 872 of file c3d_render_ogl_legacy.cpp.

873 {
874  glEnable( GL_COLOR_MATERIAL );
875  glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE );
876 
877  const SFVEC4F ambient = SFVEC4F( 0.0f, 0.0f, 0.0f, 1.0f );
878  const SFVEC4F diffuse = SFVEC4F( 0.0f, 0.0f, 0.0f, 1.0f );
879  const SFVEC4F emissive = SFVEC4F( 0.0f, 0.0f, 0.0f, 1.0f );
880  const SFVEC4F specular = SFVEC4F( 0.1f, 0.1f, 0.1f, 1.0f );
881 
882  glMaterialfv( GL_FRONT_AND_BACK, GL_SPECULAR, &specular.r );
883  glMaterialf( GL_FRONT_AND_BACK, GL_SHININESS, 96.0f );
884 
885  glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT, &ambient.r );
886  glMaterialfv( GL_FRONT_AND_BACK, GL_DIFFUSE, &diffuse.r );
887  glMaterialfv( GL_FRONT_AND_BACK, GL_EMISSION, &emissive.r );
888 }
glm::vec4 SFVEC4F
Definition: xv3d_types.h:49

Referenced by render_3D_arrows().

◆ Redraw()

bool C3D_RENDER_OGL_LEGACY::Redraw ( bool  aIsMoving,
REPORTER aStatusTextReporter 
)
overridevirtual

Redraw - Ask to redraw the view.

Parameters
aIsMovingif the user is moving the scene, it should be render in preview mode
aStatusTextReportera pointer to the status progress reporter
Returns
it will return true if the render would like to redraw again

Implements C3D_RENDER_BASE.

Definition at line 519 of file c3d_render_ogl_legacy.cpp.

521 {
522  // Initialize openGL
524  {
525  if( !initializeOpenGL() )
526  return false;
527  }
528 
529  if( m_reloadRequested )
530  {
531  std::unique_ptr<BUSY_INDICATOR> busy = CreateBusyIndicator();
532 
533  if( aStatusTextReporter )
534  aStatusTextReporter->Report( _( "Loading..." ) );
535 
536  reload( aStatusTextReporter );
537  setupMaterials();
538 
539  // generate a new 3D grid as the size of the board may had changed
542  }
543  else
544  {
545  // Check if grid was changed
547  {
548  // and generate a new one
551  }
552  }
553 
554  // Initial setup
555  // /////////////////////////////////////////////////////////////////////////
556  glDepthFunc( GL_LESS );
557  glEnable( GL_CULL_FACE );
558  glFrontFace( GL_CCW ); // This is the openGL default
559  glEnable( GL_NORMALIZE ); // This allow openGL to normalize the normals after transformations
560 
561  glViewport( 0, 0, m_windowSize.x, m_windowSize.y );
562 
563 
564  // clear color and depth buffers
565  // /////////////////////////////////////////////////////////////////////////
566  glClearColor( 0.0f, 0.0f, 0.0f, 1.0f );
567  glClearDepth( 1.0f );
568  glClearStencil( 0x00 );
569  glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT );
570 
571 
572  // Draw the background ( rectangle with color gradient)
573  // /////////////////////////////////////////////////////////////////////////
576 
577  glEnable( GL_DEPTH_TEST );
578 
579 
580  // Set projection and modelview matrixes
581  // /////////////////////////////////////////////////////////////////////////
582  glMatrixMode( GL_PROJECTION );
583  glLoadMatrixf( glm::value_ptr( m_settings.CameraGet().GetProjectionMatrix() ) );
584 
585  glMatrixMode( GL_MODELVIEW );
586  glLoadIdentity();
587  glLoadMatrixf( glm::value_ptr( m_settings.CameraGet().GetViewMatrix() ) );
588 
589 
590  // Position the headlight
591  // /////////////////////////////////////////////////////////////////////////
592 
593  setLight_Front( true );
594  setLight_Top( true );
595  setLight_Bottom( true );
596 
597  glEnable( GL_LIGHTING );
598 
599  {
600  const SFVEC3F &cameraPos = m_settings.CameraGet().GetPos();
601 
602  // Place the light at a minimun Z so the diffuse factor will not drop
603  // and the board will still look with good light.
604  float zpos;
605 
606  if( cameraPos.z > 0.0f )
607  {
608  zpos = glm::max( cameraPos.z, 0.5f ) + cameraPos.z * cameraPos.z;
609  }
610  else
611  {
612  zpos = glm::min( cameraPos.z,-0.5f ) - cameraPos.z * cameraPos.z;
613  }
614 
615  const GLfloat headlight_pos[] = { cameraPos.x,
616  cameraPos.y,
617  zpos,
618  1.0f }; // This is a point light
619 
620  glLightfv( GL_LIGHT0, GL_POSITION, headlight_pos );
621  }
622 
623 
624  // Display board body
625  // /////////////////////////////////////////////////////////////////////////
627  {
629  {
632 
633  OGL_SetMaterial( m_materials.m_EpoxyBoard );
634 
636 
638  {
642 
645  NULL );
646  }
647  else
648  {
650  }
651  }
652  }
653 
654 
656  {
657  // Draw vias and pad holes with copper material
659  }
660  else
661  {
662  OGL_SetMaterial( m_materials.m_GrayMaterial );
663  }
664 
665  if( m_ogl_disp_list_via )
666  {
668  }
669 
671  {
673  }
674 
675 
676  // Display copper and tech layers
677  // /////////////////////////////////////////////////////////////////////////
678  for( MAP_OGL_DISP_LISTS::const_iterator ii = m_ogl_disp_lists_layers.begin();
679  ii != m_ogl_disp_lists_layers.end();
680  ++ii )
681  {
682 
683  const PCB_LAYER_ID layer_id = (PCB_LAYER_ID)(ii->first);
684 
685  // Mask kayers are not processed here because they are a special case
686  if( (layer_id == B_Mask) || (layer_id == F_Mask) )
687  continue;
688 
689  // Do not show inner layers when it is displaying the board
691  {
692  if( (layer_id > F_Cu) && (layer_id < B_Cu) )
693  continue;
694  }
695 
696  glPushMatrix();
697 
698  // !TODO: if we want to increase the separation between layers
699  //glScalef( 1.0f, 1.0f, 3.0f );
700 
701 
702  CLAYERS_OGL_DISP_LISTS *pLayerDispList = static_cast<CLAYERS_OGL_DISP_LISTS*>(ii->second);
703  set_layer_material( layer_id );
704 
707  pLayerDispList->GetZBot(),
708  pLayerDispList->GetZTop() - pLayerDispList->GetZBot() );
709 
710  if( (layer_id >= F_Cu) && (layer_id <= B_Cu) )
711  {
712  if( m_ogl_disp_lists_layers_holes_outer.find( layer_id ) !=
714  {
715  const CLAYERS_OGL_DISP_LISTS* viasHolesLayer =
717 
718  wxASSERT( viasHolesLayer != NULL );
719 
720  if( viasHolesLayer != NULL )
721  {
722  pLayerDispList->DrawAllCameraCulledSubtractLayer(
724  viasHolesLayer,
725  (aIsMoving == false) );
726  }
727  }
728  else
729  {
730  pLayerDispList->DrawAllCameraCulledSubtractLayer(
732  NULL,
733  (aIsMoving == false) );
734  }
735  }
736  else
737  {
738  pLayerDispList->DrawAllCameraCulled( m_settings.CameraGet().GetPos().z,
739  (aIsMoving == false) );
740  }
741 
742  glPopMatrix();
743  }
744 
745 
746  // Render 3D Models (Non-transparent)
747  // /////////////////////////////////////////////////////////////////////////
748 
749  //setLight_Top( false );
750  //setLight_Bottom( true );
751  render_3D_models( false, false );
752 
753  //setLight_Top( true );
754  //setLight_Bottom( false );
755  render_3D_models( true, false );
756 
757 
758  // Display transparent mask layers
759  // /////////////////////////////////////////////////////////////////////////
761  {
762  //setLight_Top( true );
763  //setLight_Bottom( true );
764 
765  if( m_settings.CameraGet().GetPos().z > 0 )
766  {
768  aIsMoving );
769 
771  aIsMoving );
772  }
773  else
774  {
776  aIsMoving );
777 
779  aIsMoving );
780  }
781  }
782 
783 
784  // Render 3D Models (Transparent)
785  // /////////////////////////////////////////////////////////////////////////
786 
787  //setLight_Top( false );
788  //setLight_Bottom( true );
789  render_3D_models( false, true );
790 
791  //setLight_Top( true );
792  //setLight_Bottom( false );
793  render_3D_models( true, true );
794 
795 
796  // Render Grid
797  // /////////////////////////////////////////////////////////////////////////
798 
800  {
801  glDisable( GL_LIGHTING );
802 
803  if( glIsList( m_ogl_disp_list_grid ) )
804  glCallList( m_ogl_disp_list_grid );
805 
806  glEnable( GL_LIGHTING );
807  }
808 
809 
810  // Render 3D arrows
811  // /////////////////////////////////////////////////////////////////////////
812  if( m_settings.GetFlag( FL_AXIS ) )
814 
815  // Return back to the original viewport (this is important if we want
816  // to take a screenshot after the render)
817  // /////////////////////////////////////////////////////////////////////////
818  glViewport( 0, 0, m_windowSize.x, m_windowSize.y );
819 
820  return false;
821 }
MAP_OGL_DISP_LISTS m_ogl_disp_lists_layers
void DrawAllCameraCulledSubtractLayer(const CLAYERS_OGL_DISP_LISTS *aLayerToSubtractA, const CLAYERS_OGL_DISP_LISTS *aLayerToSubtractB, bool aDrawMiddle=true) const
void generate_new_3DGrid(GRID3D_TYPE aGridType)
MAP_OGL_DISP_LISTS m_ogl_disp_lists_layers_holes_outer
void render_3D_models(bool aRenderTopOrBot, bool aRenderTransparentOnly)
render_3D_models
GRID3D_TYPE GridGet() const
GridGet - get the current grid.
Definition: cinfo3d_visu.h:216
const SFVEC3F & GetPos() const
Definition: ccamera.h:109
SFVEC3D m_BgColorBot
background bottom color
Definition: cinfo3d_visu.h:497
CINFO3D_VISU & m_settings
settings refrence in use for this render
SFVEC3D m_BgColorTop
background top color
Definition: cinfo3d_visu.h:498
void ApplyScalePosition(float aZposition, float aZscale)
void setLight_Top(bool enabled)
float GetLayerBottomZpos3DU(PCB_LAYER_ID aLayerId) const
GetLayerBottomZpos3DU - Get the bottom z position.
Definition: cinfo3d_visu.h:287
GRID3D_TYPE m_last_grid_type
Stores the last grid computed.
bool GetFlag(DISPLAY3D_FLG aFlag) const
GetFlag - get a configuration status of a flag.
void OGL_DrawBackground(const SFVEC3F &aTopColor, const SFVEC3F &aBotColor)
OGL_DrawBackground.
Definition: ogl_utils.cpp:179
CLAYERS_OGL_DISP_LISTS * m_ogl_disp_list_through_holes_outer
void OGL_SetMaterial(const SMATERIAL &aMaterial)
OGL_SetMaterial - Set OpenGL materials.
Definition: ogl_utils.cpp:144
PCB_LAYER_ID
A quick note on layer IDs:
CCAMERA & CameraGet() const
CameraGet - get current camera in use.
Definition: cinfo3d_visu.h:210
void setLight_Front(bool enabled)
#define NULL
void setLight_Bottom(bool enabled)
bool m_is_opengl_initialized
flag if the opengl specific for this render was already initialized
void render_solder_mask_layer(PCB_LAYER_ID aLayerID, float aZPosition, bool aIsRenderingOnPreviewMode)
void reload(REPORTER *aStatusTextReporter)
wxSize m_windowSize
The window size that this camera is working.
float GetLayerTopZpos3DU(PCB_LAYER_ID aLayerId) const
GetLayerTopZpos3DU - Get the top z position.
Definition: cinfo3d_visu.h:280
float GetEpoxyThickness3DU() const
GetEpoxyThickness3DU - Get the current epoxy thickness.
Definition: cinfo3d_visu.h:153
void DrawAllCameraCulled(float zCameraPos, bool aDrawMiddle=true) const
DrawAllCameraCulled - Draw all layers if they are visible by the camera.
struct C3D_RENDER_OGL_LEGACY::@0 m_materials
std::unique_ptr< BUSY_INDICATOR > CreateBusyIndicator() const
Return a created busy indicator, if a factory has been set, else a null pointer.
CLAYERS_OGL_DISP_LISTS * m_ogl_disp_list_via
GLuint m_ogl_disp_list_grid
oGL list that stores current grid
void DrawAll(bool aDrawMiddle=true) const
DrawAll - This function calls all the display lists.
The CLAYERS_OGL_DISP_LISTS class stores the openGL display lists to related with a layer.
CLAYERS_OGL_DISP_LISTS * m_ogl_disp_list_through_holes_outer_with_npth
const glm::mat4 & GetViewMatrix() const
Definition: ccamera.cpp:419
bool m_reloadRequested
!TODO: this must be reviewed in order to flag change types
#define _(s)
Definition: 3d_actions.cpp:31
glm::vec3 SFVEC3F
Definition: xv3d_types.h:47
void SetItIsTransparent(bool aSetTransparent)
CLAYERS_OGL_DISP_LISTS * m_ogl_disp_list_board
const glm::mat4 & GetProjectionMatrix() const
Definition: ccamera.cpp:389
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_UNDEFINED)=0
Function Report is a pure virtual function to override in the derived object.
void set_layer_material(PCB_LAYER_ID aLayerID)
CLAYERS_OGL_DISP_LISTS * m_ogl_disp_list_pads_holes

References _, CLAYERS_OGL_DISP_LISTS::ApplyScalePosition(), B_Cu, B_Mask, CINFO3D_VISU::CameraGet(), C3D_RENDER_BASE::CreateBusyIndicator(), CLAYERS_OGL_DISP_LISTS::DrawAll(), CLAYERS_OGL_DISP_LISTS::DrawAllCameraCulled(), CLAYERS_OGL_DISP_LISTS::DrawAllCameraCulledSubtractLayer(), F_Cu, F_Mask, FL_AXIS, FL_SHOW_BOARD_BODY, FL_SOLDERMASK, FL_USE_REALISTIC_MODE, generate_new_3DGrid(), CINFO3D_VISU::GetEpoxyThickness3DU(), CINFO3D_VISU::GetFlag(), CINFO3D_VISU::GetLayerBottomZpos3DU(), CINFO3D_VISU::GetLayerTopZpos3DU(), CCAMERA::GetPos(), CCAMERA::GetProjectionMatrix(), CCAMERA::GetViewMatrix(), CLAYERS_OGL_DISP_LISTS::GetZBot(), CLAYERS_OGL_DISP_LISTS::GetZTop(), CINFO3D_VISU::GridGet(), initializeOpenGL(), CINFO3D_VISU::m_BgColorBot, CINFO3D_VISU::m_BgColorTop, C3D_RENDER_BASE::m_is_opengl_initialized, m_last_grid_type, m_materials, m_ogl_disp_list_board, m_ogl_disp_list_grid, m_ogl_disp_list_pads_holes, m_ogl_disp_list_through_holes_outer, m_ogl_disp_list_through_holes_outer_with_npth, m_ogl_disp_list_via, m_ogl_disp_lists_layers, m_ogl_disp_lists_layers_holes_outer, C3D_RENDER_BASE::m_reloadRequested, C3D_RENDER_BASE::m_settings, C3D_RENDER_BASE::m_windowSize, NONE, NULL, OGL_DrawBackground(), OGL_SetMaterial(), reload(), render_3D_arrows(), render_3D_models(), render_solder_mask_layer(), REPORTER::Report(), set_layer_material(), CLAYERS_OGL_DISP_LISTS::SetItIsTransparent(), setLight_Bottom(), setLight_Front(), setLight_Top(), and setupMaterials().

◆ reload()

void C3D_RENDER_OGL_LEGACY::reload ( REPORTER aStatusTextReporter)
private

Definition at line 337 of file c3d_render_createscene_ogl_legacy.cpp.

338 {
339  m_reloadRequested = false;
340 
342 
344 
345 #ifdef PRINT_STATISTICS_3D_VIEWER
346  printf("InitSettings...\n");
347 #endif
348 
349  unsigned stats_startReloadTime = GetRunningMicroSecs();
350 
351  m_settings.InitSettings( aStatusTextReporter );
352 
353 #ifdef PRINT_STATISTICS_3D_VIEWER
354  unsigned stats_endReloadTime = GetRunningMicroSecs();
355 #endif
356 
357  SFVEC3F camera_pos = m_settings.GetBoardCenter3DU();
358  m_settings.CameraGet().SetBoardLookAtPos( camera_pos );
359 
360 #ifdef PRINT_STATISTICS_3D_VIEWER
361  unsigned stats_start_OpenGL_Load_Time = GetRunningMicroSecs();
362 #endif
363 
364  if( aStatusTextReporter )
365  aStatusTextReporter->Report( _( "Load OpenGL: board" ) );
366 
367  // Create Board
368  // /////////////////////////////////////////////////////////////////////////
369 
370  CCONTAINER2D boardContainer;
373  boardContainer,
375  (const BOARD_ITEM &)*m_settings.GetBoard() );
376 
377  const LIST_OBJECT2D &listBoardObject2d = boardContainer.GetList();
378 
379  if( listBoardObject2d.size() > 0 )
380  {
381  // We will set a unitary Z so it will in future used with transformations
382  // since the board poly will be used not only to draw itself but also the
383  // solder mask layers.
384  const float layer_z_top = 1.0f;
385  const float layer_z_bot = 0.0f;
386 
387  CLAYER_TRIANGLES *layerTriangles = new CLAYER_TRIANGLES( listBoardObject2d.size() );
388 
389  // Convert the list of objects(triangles) to triangle layer structure
390  for( LIST_OBJECT2D::const_iterator itemOnLayer = listBoardObject2d.begin();
391  itemOnLayer != listBoardObject2d.end();
392  ++itemOnLayer )
393  {
394  const COBJECT2D *object2d_A = static_cast<const COBJECT2D *>(*itemOnLayer);
395 
396  wxASSERT( object2d_A->GetObjectType() == OBJECT2D_TYPE::TRIANGLE );
397 
398  const CTRIANGLE2D *tri = (const CTRIANGLE2D *)object2d_A;
399 
400  const SFVEC2F &v1 = tri->GetP1();
401  const SFVEC2F &v2 = tri->GetP2();
402  const SFVEC2F &v3 = tri->GetP3();
403 
404  add_triangle_top_bot( layerTriangles,
405  v1,
406  v2,
407  v3,
408  layer_z_top,
409  layer_z_bot );
410  }
411 
412  const SHAPE_POLY_SET &boardPoly = m_settings.GetBoardPoly();
413 
414  wxASSERT( boardPoly.OutlineCount() > 0 );
415 
416  if( boardPoly.OutlineCount() > 0 )
417  {
418  layerTriangles->AddToMiddleContourns( boardPoly,
419  layer_z_bot,
420  layer_z_top,
422  false );
423 
424  m_ogl_disp_list_board = new CLAYERS_OGL_DISP_LISTS( *layerTriangles,
426  layer_z_top,
427  layer_z_top );
428  }
429 
430  delete layerTriangles;
431  }
432 
433  // Create Through Holes and vias
434  // /////////////////////////////////////////////////////////////////////////
435 
436  if( aStatusTextReporter )
437  aStatusTextReporter->Report( _( "Load OpenGL: holes and vias" ) );
438 
442  1.0f,
443  0.0f,
444  false );
445 
447 
450 
453  bodyHoles,
454  1.0f,
455  0.0f,
456  false );
457 
461  1.0f,
462  0.0f,
463  true );
464 
465 
469  1.0f,
470  0.0f,
471  false );
472 
473  // Not in use
474  //m_ogl_disp_list_through_holes_vias_inner = generate_holes_display_list(
475  // m_settings.GetThroughHole_Vias_Inner().GetList(),
476  // m_settings.GetThroughHole_Vias_Inner_poly(),
477  // 1.0f, 0.0f,
478  // false );
479 
480  const MAP_POLY & innerMapHoles = m_settings.GetPolyMapHoles_Inner();
481  const MAP_POLY & outerMapHoles = m_settings.GetPolyMapHoles_Outer();
482 
483  wxASSERT( innerMapHoles.size() == outerMapHoles.size() );
484 
485  const MAP_CONTAINER_2D &map_holes = m_settings.GetMapLayersHoles();
486 
487  if( outerMapHoles.size() > 0 )
488  {
489  float layer_z_bot = 0.0f;
490  float layer_z_top = 0.0f;
491 
492  for( MAP_POLY::const_iterator ii = outerMapHoles.begin();
493  ii != outerMapHoles.end();
494  ++ii )
495  {
496  PCB_LAYER_ID layer_id = static_cast<PCB_LAYER_ID>(ii->first);
497  const SHAPE_POLY_SET *poly = static_cast<const SHAPE_POLY_SET *>(ii->second);
498  const CBVHCONTAINER2D *container = map_holes.at( layer_id );
499 
500  get_layer_z_pos( layer_id, layer_z_top, layer_z_bot );
501 
503  container->GetList(), *poly, layer_z_top, layer_z_bot, false );
504  }
505 
506  for( MAP_POLY::const_iterator ii = innerMapHoles.begin();
507  ii != innerMapHoles.end();
508  ++ii )
509  {
510  PCB_LAYER_ID layer_id = static_cast<PCB_LAYER_ID>(ii->first);
511  const SHAPE_POLY_SET *poly = static_cast<const SHAPE_POLY_SET *>(ii->second);
512  const CBVHCONTAINER2D *container = map_holes.at( layer_id );
513 
514  get_layer_z_pos( layer_id, layer_z_top, layer_z_bot );
515 
517  container->GetList(), *poly, layer_z_top, layer_z_bot, false );
518  }
519  }
520 
521  // Generate vertical cylinders of vias and pads (copper)
523 
524  // Add layers maps
525 
526  if( aStatusTextReporter )
527  aStatusTextReporter->Report( _( "Load OpenGL: layers" ) );
528 
529  for( MAP_CONTAINER_2D::const_iterator ii = m_settings.GetMapLayers().begin();
530  ii != m_settings.GetMapLayers().end();
531  ++ii )
532  {
533  PCB_LAYER_ID layer_id = static_cast<PCB_LAYER_ID>(ii->first);
534 
535  if( !m_settings.Is3DLayerEnabled( layer_id ) )
536  continue;
537 
538  const CBVHCONTAINER2D *container2d = static_cast<const CBVHCONTAINER2D *>(ii->second);
539  const LIST_OBJECT2D &listObject2d = container2d->GetList();
540 
541  if( listObject2d.size() == 0 )
542  continue;
543 
544  float layer_z_bot = 0.0f;
545  float layer_z_top = 0.0f;
546 
547  get_layer_z_pos( layer_id, layer_z_top, layer_z_bot );
548 
549  // Calculate an estimation for the nr of triangles based on the nr of objects
550  unsigned int nrTrianglesEstimation = listObject2d.size() * 8;
551 
552  CLAYER_TRIANGLES *layerTriangles = new CLAYER_TRIANGLES( nrTrianglesEstimation );
553 
554  m_triangles[layer_id] = layerTriangles;
555 
556  // Load the 2D (X,Y axis) component of shapes
557  for( LIST_OBJECT2D::const_iterator itemOnLayer = listObject2d.begin();
558  itemOnLayer != listObject2d.end();
559  ++itemOnLayer )
560  {
561  const COBJECT2D *object2d_A = static_cast<const COBJECT2D *>(*itemOnLayer);
562 
563  switch( object2d_A->GetObjectType() )
564  {
566  add_object_to_triangle_layer( (const CFILLEDCIRCLE2D *)object2d_A,
567  layerTriangles, layer_z_top, layer_z_bot );
568  break;
569 
571  add_object_to_triangle_layer( (const CPOLYGON4PTS2D *)object2d_A,
572  layerTriangles, layer_z_top, layer_z_bot );
573  break;
574 
575  case OBJECT2D_TYPE::RING:
576  add_object_to_triangle_layer( (const CRING2D *)object2d_A,
577  layerTriangles, layer_z_top, layer_z_bot );
578  break;
579 
581  add_object_to_triangle_layer( (const CTRIANGLE2D *)object2d_A,
582  layerTriangles, layer_z_top, layer_z_bot );
583  break;
584 
586  add_object_to_triangle_layer( (const CROUNDSEGMENT2D *) object2d_A,
587  layerTriangles, layer_z_top, layer_z_bot );
588  break;
589 
590  default:
591  wxFAIL_MSG("C3D_RENDER_OGL_LEGACY: Object type is not implemented");
592  break;
593  }
594  }
595 
596  const MAP_POLY &map_poly = m_settings.GetPolyMap();
597 
598  // Load the vertical (Z axis) component of shapes
599  if( map_poly.find( layer_id ) != map_poly.end() )
600  {
601  const SHAPE_POLY_SET *polyList = map_poly.at( layer_id );
602 
603  if( polyList->OutlineCount() > 0 )
604  layerTriangles->AddToMiddleContourns( *polyList, layer_z_bot, layer_z_top,
605  m_settings.BiuTo3Dunits(), false );
606  }
607 
608  // Create display list
609  // /////////////////////////////////////////////////////////////////////
610  m_ogl_disp_lists_layers[layer_id] = new CLAYERS_OGL_DISP_LISTS( *layerTriangles,
612  layer_z_bot,
613  layer_z_top );
614  }// for each layer on map
615 
616 #ifdef PRINT_STATISTICS_3D_VIEWER
617  unsigned stats_end_OpenGL_Load_Time = GetRunningMicroSecs();
618 #endif
619 
620  // Load 3D models
621  // /////////////////////////////////////////////////////////////////////////
622 #ifdef PRINT_STATISTICS_3D_VIEWER
623  unsigned stats_start_models_Load_Time = GetRunningMicroSecs();
624 #endif
625 
626  if( aStatusTextReporter )
627  aStatusTextReporter->Report( _( "Loading 3D models" ) );
628 
629  load_3D_models( aStatusTextReporter );
630 
631 #ifdef PRINT_STATISTICS_3D_VIEWER
632  unsigned stats_end_models_Load_Time = GetRunningMicroSecs();
633 
634 
635  printf( "C3D_RENDER_OGL_LEGACY::reload times:\n" );
636  printf( " Reload board: %.3f ms\n",
637  (float)( stats_endReloadTime - stats_startReloadTime ) / 1000.0f );
638  printf( " Loading to openGL: %.3f ms\n",
639  (float)( stats_end_OpenGL_Load_Time - stats_start_OpenGL_Load_Time ) / 1000.0f );
640  printf( " Loading 3D models: %.3f ms\n",
641  (float)( stats_end_models_Load_Time - stats_start_models_Load_Time ) / 1000.0f );
643 #endif
644 
645  if( aStatusTextReporter )
646  {
647  // Calculation time in seconds
648  const double calculation_time = (double)( GetRunningMicroSecs() -
649  stats_startReloadTime) / 1e6;
650 
651  aStatusTextReporter->Report( wxString::Format( _( "Reload time %.3f s" ),
652  calculation_time ) );
653  }
654 }
std::map< PCB_LAYER_ID, CBVHCONTAINER2D * > MAP_CONTAINER_2D
A type that stores a container of 2d objects for each layer id.
Definition: cinfo3d_visu.h:55
const SHAPE_POLY_SET & GetThroughHole_Outer_poly_NPTH() const
GetThroughHole_Outer_poly_NPTH -.
Definition: cinfo3d_visu.h:317
MAP_OGL_DISP_LISTS m_ogl_disp_lists_layers
std::map< PCB_LAYER_ID, SHAPE_POLY_SET * > MAP_POLY
A type that stores polysets for each layer id.
Definition: cinfo3d_visu.h:58
void add_object_to_triangle_layer(const CRING2D *aRing, CLAYER_TRIANGLES *aDstLayer, float aZtop, float aZbot)
int OutlineCount() const
Returns the number of outlines in the set
The CLAYER_TRIANGLES class stores arrays of triangles to be used to create display lists.
OBJECT2D_TYPE GetObjectType() const
Definition: cobject2d.h:125
const SHAPE_POLY_SET & GetThroughHole_Inner_poly() const
GetThroughHole_Inner_poly -.
Definition: cinfo3d_visu.h:356
void BooleanAdd(const SHAPE_POLY_SET &b, POLYGON_MODE aFastMode)
Performs boolean polyset union For aFastMode meaning, see function booleanOp
void PrintStats()
Definition: cobject2d.cpp:65
BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class,...
MAP_OGL_DISP_LISTS m_ogl_disp_lists_layers_holes_outer
const MAP_CONTAINER_2D & GetMapLayers() const
GetMapLayers - Get the map of container that have the objects per layer.
Definition: cinfo3d_visu.h:293
const MAP_POLY & GetPolyMapHoles_Inner() const
Definition: cinfo3d_visu.h:416
const MAP_CONTAINER_2D & GetMapLayersHoles() const
GetMapLayersHoles -Get the map of container that have the holes per layer.
Definition: cinfo3d_visu.h:299
CINFO3D_VISU & m_settings
settings refrence in use for this render
const CBVHCONTAINER2D & GetThroughHole_Vias_Outer() const
GetThroughHole_Vias_Outer -.
Definition: cinfo3d_visu.h:324
double BiuTo3Dunits() const
BiuTo3Dunits - Board integer units To 3D units.
Definition: cinfo3d_visu.h:141
const SFVEC3F & GetBoardCenter3DU() const
GetBoardCenter - the board center position in 3d units.
Definition: cinfo3d_visu.h:189
const SHAPE_POLY_SET & GetBoardPoly() const
GetBoardPoly - Get the current polygon of the epoxy board.
Definition: cinfo3d_visu.h:252
CLAYERS_OGL_DISP_LISTS * m_ogl_disp_list_through_holes_inner
CLAYERS_OGL_DISP_LISTS * m_ogl_disp_list_through_holes_outer
const BOARD * GetBoard() const
GetBoard - Get current board to be rendered.
Definition: cinfo3d_visu.h:128
void get_layer_z_pos(PCB_LAYER_ID aLayerID, float &aOutZtop, float &aOutZbot) const
PCB_LAYER_ID
A quick note on layer IDs:
CCAMERA & CameraGet() const
CameraGet - get current camera in use.
Definition: cinfo3d_visu.h:210
glm::vec2 SFVEC2F
Definition: xv3d_types.h:45
SHAPE_POLY_SET.
const MAP_POLY & GetPolyMapHoles_Outer() const
Definition: cinfo3d_visu.h:418
const SHAPE_POLY_SET & GetThroughHole_Outer_poly() const
GetThroughHole_Outer_poly -.
Definition: cinfo3d_visu.h:311
CLAYERS_OGL_DISP_LISTS * m_ogl_disp_list_through_holes_vias_outer
void AddToMiddleContourns(const SHAPE_LINE_CHAIN &outlinePath, float zBot, float zTop, double aBiuTo3Du, bool aInvertFaceDirection)
static COBJECT2D_STATS & Instance()
Definition: cobject2d.h:152
const CBVHCONTAINER2D & GetThroughHole_Inner() const
GetThroughHole_Inner - Get the ThroughHole container.
Definition: cinfo3d_visu.h:350
MAP_OGL_DISP_LISTS m_ogl_disp_lists_layers_holes_inner
const CBVHCONTAINER2D & GetThroughHole_Outer() const
GetThroughHole_Outer - Get the inflated ThroughHole container.
Definition: cinfo3d_visu.h:305
The CLAYERS_OGL_DISP_LISTS class stores the openGL display lists to related with a layer.
CLAYERS_OGL_DISP_LISTS * generate_holes_display_list(const LIST_OBJECT2D &aListHolesObject2d, const SHAPE_POLY_SET &aPoly, float aZtop, float aZbot, bool aInvertFaces)
CLAYERS_OGL_DISP_LISTS * m_ogl_disp_list_through_holes_outer_with_npth
This handles simple polygons with 4 points.
bool Is3DLayerEnabled(PCB_LAYER_ID aLayer) const
Is3DLayerEnabled - Check if a layer is enabled.
const MAP_POLY & GetPolyMap() const
GetPolyMap - Get maps of polygons's layers.
Definition: cinfo3d_visu.h:414
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
bool m_reloadRequested
!TODO: this must be reviewed in order to flag change types
void load_3D_models(REPORTER *aStatusTextReporter)
std::list< COBJECT2D * > LIST_OBJECT2D
Definition: ccontainer2d.h:37
const SFVEC2F & GetP1() const
Definition: ctriangle2d.h:58
#define _(s)
Definition: 3d_actions.cpp:31
unsigned GetRunningMicroSecs()
Function GetRunningMicroSecs An alternate way to calculate an elapset time (in microsecondes) to clas...
glm::vec3 SFVEC3F
Definition: xv3d_types.h:47
const SHAPE_POLY_SET & GetThroughHole_Vias_Outer_poly() const
GetThroughHole_Vias_Outer_poly -.
Definition: cinfo3d_visu.h:336
void SetBoardLookAtPos(const SFVEC3F &aBoardPos)
Definition: ccamera.h:114
void ResetStats()
Definition: cobject2d.h:135
CLAYERS_OGL_DISP_LISTS * m_ogl_disp_list_board
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_UNDEFINED)=0
Function Report is a pure virtual function to override in the derived object.
void add_triangle_top_bot(CLAYER_TRIANGLES *aDst, const SFVEC2F &v0, const SFVEC2F &v1, const SFVEC2F &v2, float top, float bot)
const LIST_OBJECT2D & GetList() const
Definition: ccontainer2d.h:64
void Convert_shape_line_polygon_to_triangles(SHAPE_POLY_SET &aPolyList, CGENERICCONTAINER2D &aDstContainer, float aBiuTo3DunitsScale, const BOARD_ITEM &aBoardItem)
void InitSettings(REPORTER *aStatusTextReporter)
InitSettings - Function to be called by the render when it need to reload the settings for the board.

References _, add_object_to_triangle_layer(), add_triangle_top_bot(), CLAYER_TRIANGLES::AddToMiddleContourns(), CINFO3D_VISU::BiuTo3Dunits(), SHAPE_POLY_SET::BooleanAdd(), CINFO3D_VISU::CameraGet(), Convert_shape_line_polygon_to_triangles(), FILLED_CIRCLE, Format(), generate_3D_Vias_and_Pads(), generate_holes_display_list(), get_layer_z_pos(), CINFO3D_VISU::GetBoard(), CINFO3D_VISU::GetBoardCenter3DU(), CINFO3D_VISU::GetBoardPoly(), CGENERICCONTAINER2D::GetList(), CINFO3D_VISU::GetMapLayers(), CINFO3D_VISU::GetMapLayersHoles(), COBJECT2D::GetObjectType(), CINFO3D_VISU::GetPolyMap(), CINFO3D_VISU::GetPolyMapHoles_Inner(), CINFO3D_VISU::GetPolyMapHoles_Outer(), GetRunningMicroSecs(), CINFO3D_VISU::GetThroughHole_Inner(), CINFO3D_VISU::GetThroughHole_Inner_poly(), CINFO3D_VISU::GetThroughHole_Outer(), CINFO3D_VISU::GetThroughHole_Outer_poly(), CINFO3D_VISU::GetThroughHole_Outer_poly_NPTH(), CINFO3D_VISU::GetThroughHole_Vias_Outer(), CINFO3D_VISU::GetThroughHole_Vias_Outer_poly(), CINFO3D_VISU::InitSettings(), COBJECT2D_STATS::Instance(), CINFO3D_VISU::Is3DLayerEnabled(), load_3D_models(), m_ogl_circle_texture, m_ogl_disp_list_board, m_ogl_disp_list_through_holes_inner, m_ogl_disp_list_through_holes_outer, m_ogl_disp_list_through_holes_outer_with_npth, m_ogl_disp_list_through_holes_vias_outer, m_ogl_disp_lists_layers, m_ogl_disp_lists_layers_holes_inner, m_ogl_disp_lists_layers_holes_outer, C3D_RENDER_BASE::m_reloadRequested, C3D_RENDER_BASE::m_settings, m_triangles, ogl_free_all_display_lists(), SHAPE_POLY_SET::OutlineCount(), SHAPE_POLY_SET::PM_FAST, POLYGON4PT, COBJECT2D_STATS::PrintStats(), REPORTER::Report(), COBJECT2D_STATS::ResetStats(), RING, ROUNDSEG, CCAMERA::SetBoardLookAtPos(), and TRIANGLE.

Referenced by Redraw().

◆ ReloadRequest()

void C3D_RENDER_BASE::ReloadRequest ( )
inlineinherited

ReloadRequest - !TODO: this must be reviewed to add flags to improve specific render.

Definition at line 75 of file c3d_render_base.h.

75 { m_reloadRequested = true; }
bool m_reloadRequested
!TODO: this must be reviewed in order to flag change types

References C3D_RENDER_BASE::m_reloadRequested.

Referenced by EDA_3D_CANVAS::ReloadRequest(), EDA_3D_CANVAS::RenderEngineChanged(), and EDA_3D_CANVAS::RenderRaytracingRequest().

◆ render_3D_arrows()

void C3D_RENDER_OGL_LEGACY::render_3D_arrows ( )
private

Definition at line 130 of file c3d_render_ogl_legacy.cpp.

131 {
132  const float arrow_size = RANGE_SCALE_3D * 0.30f;
133 
134  glDisable( GL_CULL_FACE );
135 
136  // YxY squared view port, this is on propose
137  glViewport( 4, 4, m_windowSize.y / 8 , m_windowSize.y / 8 );
138  glClear( GL_DEPTH_BUFFER_BIT );
139 
140  glMatrixMode( GL_PROJECTION );
141  glLoadIdentity();
142  gluPerspective( 45.0f, 1.0f, 0.001f, RANGE_SCALE_3D );
143 
144  glMatrixMode( GL_MODELVIEW );
145  glLoadIdentity();
146 
147  const glm::mat4 TranslationMatrix = glm::translate(
148  glm::mat4(1.0f),
149  SFVEC3F( 0.0f, 0.0f, -(arrow_size * 2.75f) ) );
150 
151  const glm::mat4 ViewMatrix = TranslationMatrix *
153 
154  glLoadMatrixf( glm::value_ptr( ViewMatrix ) );
155 
157 
158  glColor3f( 0.9f, 0.0f, 0.0f );
159  OGL_draw_arrow( SFVEC3F( 0.0f, 0.0f, 0.0f ),
160  SFVEC3F( arrow_size, 0.0f, 0.0f ),
161  0.275f );
162 
163  glColor3f( 0.0f, 0.9f, 0.0f );
164  OGL_draw_arrow( SFVEC3F( 0.0f, 0.0f, 0.0f ),
165  SFVEC3F( 0.0f, arrow_size, 0.0f ),
166  0.275f );
167 
168  glColor3f( 0.0f, 0.0f, 0.9f );
169  OGL_draw_arrow( SFVEC3F( 0.0f, 0.0f, 0.0f ),
170  SFVEC3F( 0.0f, 0.0f, arrow_size ),
171  0.275f );
172 
173  glEnable( GL_CULL_FACE );
174 }
#define RANGE_SCALE_3D
This defines the range that all coord will have to be rendered.
Definition: cinfo3d_visu.h:63
CINFO3D_VISU & m_settings
settings refrence in use for this render
const glm::mat4 GetRotationMatrix() const
Function GetRotationMatrix Get the rotation matrix to be applied in a transformation camera.
Definition: ccamera.cpp:158
CCAMERA & CameraGet() const
CameraGet - get current camera in use.
Definition: cinfo3d_visu.h:210
wxSize m_windowSize
The window size that this camera is working.
glm::vec3 SFVEC3F
Definition: xv3d_types.h:47
void OGL_draw_arrow(SFVEC3F aPosition, SFVEC3F aTargetPos, float aSize)
OGL_draw_arrow - draw a round arrow.

References CINFO3D_VISU::CameraGet(), CCAMERA::GetRotationMatrix(), C3D_RENDER_BASE::m_settings, C3D_RENDER_BASE::m_windowSize, OGL_draw_arrow(), ogl_set_arrow_material(), and RANGE_SCALE_3D.

Referenced by Redraw().

◆ render_3D_models()

void C3D_RENDER_OGL_LEGACY::render_3D_models ( bool  aRenderTopOrBot,
bool  aRenderTransparentOnly 
)
private

render_3D_models

Parameters
aRenderTopOrBot- true will render Top, false will render bottom
aRenderTransparentOnly- true will render only the transparent objects, false will render opaque

Definition at line 1035 of file c3d_render_ogl_legacy.cpp.

1037 {
1038  // Go for all modules
1039  for( auto module : m_settings.GetBoard()->Modules() )
1040  {
1041  if( !module->Models().empty() )
1042  if( m_settings.ShouldModuleBeDisplayed( (MODULE_ATTR_T) module->GetAttributes() ) )
1043  if( ( aRenderTopOrBot && !module->IsFlipped() )
1044  || ( !aRenderTopOrBot && module->IsFlipped() ) )
1045  render_3D_module( module, aRenderTransparentOnly );
1046  }
1047 }
CINFO3D_VISU & m_settings
settings refrence in use for this render
const BOARD * GetBoard() const
GetBoard - Get current board to be rendered.
Definition: cinfo3d_visu.h:128
MODULES & Modules()
Definition: class_board.h:226
void render_3D_module(const MODULE *module, bool aRenderTransparentOnly)
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 ShouldModuleBeDisplayed(MODULE_ATTR_T aModuleAttributs) const
ShouldModuleBeDisplayed - Test if module should be displayed in relation to attributs and the flags.

References CINFO3D_VISU::GetBoard(), C3D_RENDER_BASE::m_settings, BOARD::Modules(), render_3D_module(), and CINFO3D_VISU::ShouldModuleBeDisplayed().

Referenced by Redraw().

◆ render_3D_module()

void C3D_RENDER_OGL_LEGACY::render_3D_module ( const MODULE module,
bool  aRenderTransparentOnly 
)
private

Definition at line 1050 of file c3d_render_ogl_legacy.cpp.

1052 {
1053  if( !module->Models().empty() )
1054  {
1055  const double zpos = m_settings.GetModulesZcoord3DIU( module->IsFlipped() );
1056 
1057  glPushMatrix();
1058 
1059  wxPoint pos = module->GetPosition();
1060 
1061  glTranslatef( pos.x * m_settings.BiuTo3Dunits(),
1062  -pos.y * m_settings.BiuTo3Dunits(),
1063  zpos );
1064 
1065  if( module->GetOrientation() )
1066  glRotated( (double) module->GetOrientation() / 10.0, 0.0, 0.0, 1.0 );
1067 
1068  if( module->IsFlipped() )
1069  {
1070  glRotatef( 180.0f, 0.0f, 1.0f, 0.0f );
1071  glRotatef( 180.0f, 0.0f, 0.0f, 1.0f );
1072  }
1073 
1074  double modelunit_to_3d_units_factor = m_settings.BiuTo3Dunits() * UNITS3D_TO_UNITSPCB;
1075 
1076  glScaled( modelunit_to_3d_units_factor,
1077  modelunit_to_3d_units_factor,
1078  modelunit_to_3d_units_factor );
1079 
1080  // Get the list of model files for this model
1081  auto sM = module->Models().begin();
1082  auto eM = module->Models().end();
1083 
1084  while( sM != eM )
1085  {
1086  if( !sM->m_Filename.empty() )
1087  {
1088  // Check if the model is present in our cache map
1089  if( m_3dmodel_map.find( sM->m_Filename ) != m_3dmodel_map.end() )
1090  {
1091  // It is not present, try get it from cache
1092  const C_OGL_3DMODEL *modelPtr = m_3dmodel_map[ sM->m_Filename ];
1093 
1094  if( modelPtr )
1095  {
1096  if( ( (!aRenderTransparentOnly) && modelPtr->Have_opaque() ) ||
1097  ( aRenderTransparentOnly && modelPtr->Have_transparent() ) )
1098  {
1099  glPushMatrix();
1100 
1101  glTranslatef( sM->m_Offset.x, sM->m_Offset.y, sM->m_Offset.z );
1102 
1103  glRotatef( -sM->m_Rotation.z, 0.0f, 0.0f, 1.0f );
1104  glRotatef( -sM->m_Rotation.y, 0.0f, 1.0f, 0.0f );
1105  glRotatef( -sM->m_Rotation.x, 1.0f, 0.0f, 0.0f );
1106 
1107  glScalef( sM->m_Scale.x, sM->m_Scale.y, sM->m_Scale.z );
1108 
1109  if( aRenderTransparentOnly )
1110  modelPtr->Draw_transparent();
1111  else
1112  modelPtr->Draw_opaque();
1113 
1115  {
1116  glEnable( GL_BLEND );
1117  glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
1118 
1119  glLineWidth( 1 );
1120  modelPtr->Draw_bboxes();
1121 
1122  glDisable( GL_LIGHTING );
1123 
1124  glColor4f( 0.0f, 1.0f, 0.0f, 1.0f );
1125 
1126  glLineWidth( 4 );
1127  modelPtr->Draw_bbox();
1128 
1129  glEnable( GL_LIGHTING );
1130  }
1131 
1132  glPopMatrix();
1133  }
1134  }
1135  }
1136  }
1137 
1138  ++sM;
1139  }
1140 
1141  glPopMatrix();
1142  }
1143 }
double GetOrientation() const
Definition: class_module.h:215
bool IsFlipped() const
function IsFlipped
Definition: class_module.h:292
CINFO3D_VISU & m_settings
settings refrence in use for this render
bool GetFlag(DISPLAY3D_FLG aFlag) const
GetFlag - get a configuration status of a flag.
double BiuTo3Dunits() const
BiuTo3Dunits - Board integer units To 3D units.
Definition: cinfo3d_visu.h:141
void Draw_transparent() const
Draw_transparent - render the model into the current context.
#define UNITS3D_TO_UNITSPCB
Scale convertion from 3d model units to pcb units.
bool Have_opaque() const
Have_opaque - return true if have opaque meshs to render.
bool Have_transparent() const
Have_transparent - return true if have transparent meshs to render.
std::list< MODULE_3D_SETTINGS > & Models()
Definition: class_module.h:205
void Draw_opaque() const
Draw_opaque - render the model into the current context.
void Draw_bboxes() const
Draw_bboxes - draw individual bounding boxes of each mesh.
void Draw_bbox() const
Draw_bbox - draw main bounding box of the model.
const wxPoint GetPosition() const override
Definition: class_module.h:210
float GetModulesZcoord3DIU(bool aIsFlipped) const
GetModulesZcoord3DIU - Get the position of the module in 3d integer units considering if it is flippe...

References CINFO3D_VISU::BiuTo3Dunits(), C_OGL_3DMODEL::Draw_bbox(), C_OGL_3DMODEL::Draw_bboxes(), C_OGL_3DMODEL::Draw_opaque(), C_OGL_3DMODEL::Draw_transparent(), FL_RENDER_OPENGL_SHOW_MODEL_BBOX, CINFO3D_VISU::GetFlag(), CINFO3D_VISU::GetModulesZcoord3DIU(), MODULE::GetOrientation(), MODULE::GetPosition(), C_OGL_3DMODEL::Have_opaque(), C_OGL_3DMODEL::Have_transparent(), MODULE::IsFlipped(), m_3dmodel_map, C3D_RENDER_BASE::m_settings, MODULE::Models(), UNITS3D_TO_UNITSPCB, wxPoint::x, and wxPoint::y.

Referenced by render_3D_models().

◆ render_solder_mask_layer()

void C3D_RENDER_OGL_LEGACY::render_solder_mask_layer ( PCB_LAYER_ID  aLayerID,
float  aZPosition,
bool  aIsRenderingOnPreviewMode 
)
private

Definition at line 978 of file c3d_render_ogl_legacy.cpp.

981 {
982  wxASSERT( (aLayerID == B_Mask) || (aLayerID == F_Mask) );
983 
985  {
986  if( m_ogl_disp_lists_layers.find( aLayerID ) !=
988  {
989  CLAYERS_OGL_DISP_LISTS *pLayerDispListMask = m_ogl_disp_lists_layers.at( aLayerID );
990 
993  aZPosition,
995 
997  aZPosition,
999 
1000  set_layer_material( aLayerID );
1001 
1003 
1005  pLayerDispListMask,
1007  !aIsRenderingOnPreviewMode );
1008  }
1009  else
1010  {
1011  // This case there is no layer with mask, so we will render the full board as mask
1012 
1015  aZPosition,
1017 
1019  aZPosition,
1021 
1022  set_layer_material( aLayerID );
1023 
1025 
1027  NULL,
1029  !aIsRenderingOnPreviewMode );
1030  }
1031  }
1032 }
MAP_OGL_DISP_LISTS m_ogl_disp_lists_layers
void DrawAllCameraCulledSubtractLayer(const CLAYERS_OGL_DISP_LISTS *aLayerToSubtractA, const CLAYERS_OGL_DISP_LISTS *aLayerToSubtractB, bool aDrawMiddle=true) const
CINFO3D_VISU & m_settings
settings refrence in use for this render
void ApplyScalePosition(float aZposition, float aZscale)
#define NULL
float GetNonCopperLayerThickness3DU() const
GetNonCopperLayerThickness3DU - Get the current non copper layers thickness.
Definition: cinfo3d_visu.h:159
CLAYERS_OGL_DISP_LISTS * m_ogl_disp_list_through_holes_vias_outer
The CLAYERS_OGL_DISP_LISTS class stores the openGL display lists to related with a layer.
void SetItIsTransparent(bool aSetTransparent)
CLAYERS_OGL_DISP_LISTS * m_ogl_disp_list_board
void set_layer_material(PCB_LAYER_ID aLayerID)

References CLAYERS_OGL_DISP_LISTS::ApplyScalePosition(), B_Mask, CLAYERS_OGL_DISP_LISTS::DrawAllCameraCulledSubtractLayer(), F_Mask, CINFO3D_VISU::GetNonCopperLayerThickness3DU(), m_ogl_disp_list_board, m_ogl_disp_list_through_holes_vias_outer, m_ogl_disp_lists_layers, C3D_RENDER_BASE::m_settings, NULL, set_layer_material(), and CLAYERS_OGL_DISP_LISTS::SetItIsTransparent().

Referenced by Redraw().

◆ set_layer_material()

void C3D_RENDER_OGL_LEGACY::set_layer_material ( PCB_LAYER_ID  aLayerID)
private

Definition at line 350 of file c3d_render_ogl_legacy.cpp.

351 {
352  switch( aLayerID )
353  {
354  case B_Mask:
355  m_materials.m_SolderMaskBot.m_Diffuse = get_layer_color( aLayerID );
356  OGL_SetMaterial( m_materials.m_SolderMaskBot );
357  break;
358  case F_Mask:
359  m_materials.m_SolderMaskTop.m_Diffuse = get_layer_color( aLayerID );
360  OGL_SetMaterial( m_materials.m_SolderMaskTop );
361  break;
362 
363  case B_Paste:
364  case F_Paste:
365  m_materials.m_Paste.m_Diffuse = get_layer_color( aLayerID );
366  OGL_SetMaterial( m_materials.m_Paste );
367  break;
368 
369  case B_SilkS:
370  m_materials.m_SilkSBot.m_Diffuse = get_layer_color( aLayerID );
371  OGL_SetMaterial( m_materials.m_SilkSBot );
372  case F_SilkS:
373  m_materials.m_SilkSTop.m_Diffuse = get_layer_color( aLayerID );
374  OGL_SetMaterial( m_materials.m_SilkSTop );
375  break;
376 
377  case B_Adhes:
378  case F_Adhes:
379  case Dwgs_User:
380  case Cmts_User:
381  case Eco1_User:
382  case Eco2_User:
383  case Edge_Cuts:
384  case Margin:
385  case B_CrtYd:
386  case F_CrtYd:
387  case B_Fab:
388  case F_Fab:
389  m_materials.m_Plastic.m_Diffuse = get_layer_color( aLayerID );
390  m_materials.m_Plastic.m_Ambient = SFVEC3F(
391  m_materials.m_Plastic.m_Diffuse.r * 0.05f,
392  m_materials.m_Plastic.m_Diffuse.g * 0.05f,
393  m_materials.m_Plastic.m_Diffuse.b * 0.05f );
394 
395  m_materials.m_Plastic.m_Specular = SFVEC3F(
396  m_materials.m_Plastic.m_Diffuse.r * 0.7f,
397  m_materials.m_Plastic.m_Diffuse.g * 0.7f,
398  m_materials.m_Plastic.m_Diffuse.b * 0.7f );
399 
400  m_materials.m_Plastic.m_Shininess = 0.078125f * 128.0f;
401  m_materials.m_Plastic.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f );
402  OGL_SetMaterial( m_materials.m_Plastic );
403  break;
404 
405  default:
406  m_materials.m_Copper.m_Diffuse = get_layer_color( aLayerID );
407  OGL_SetMaterial( m_materials.m_Copper );
408 
409  break;
410  }
411 }
void OGL_SetMaterial(const SMATERIAL &aMaterial)
OGL_SetMaterial - Set OpenGL materials.
Definition: ogl_utils.cpp:144
struct C3D_RENDER_OGL_LEGACY::@0 m_materials
glm::vec3 SFVEC3F
Definition: xv3d_types.h:47
SFVEC3F get_layer_color(PCB_LAYER_ID aLayerID)

References B_Adhes, B_CrtYd, B_Fab, B_Mask, B_Paste, B_SilkS, Cmts_User, Dwgs_User, Eco1_User, Eco2_User, Edge_Cuts, F_Adhes, F_CrtYd, F_Fab, F_Mask, F_Paste, F_SilkS, get_layer_color(), m_materials, Margin, and OGL_SetMaterial().

Referenced by Redraw(), and render_solder_mask_layer().

◆ SetBusyIndicatorFactory()

void C3D_RENDER_BASE::SetBusyIndicatorFactory ( BUSY_INDICATOR::FACTORY  aNewFactory)
inherited

Set a new busy indicator factory.

When set, this factory will be used to generate busy indicators when suitable. If not set, no busy indicator will be used.

Definition at line 58 of file c3d_render_base.cpp.

59 {
60  m_busyIndicatorFactory = aNewFactory;
61 }
BUSY_INDICATOR::FACTORY m_busyIndicatorFactory
Factory that returns a suitable busy indicator for the context.

References C3D_RENDER_BASE::m_busyIndicatorFactory.

◆ SetCurWindowSize()

void C3D_RENDER_OGL_LEGACY::SetCurWindowSize ( const wxSize &  aSize)
overridevirtual

SetCurWindowSize - Before each render, the canvas will tell the render what is the size of its windows, so render can take actions if it changed.

Parameters
aSizethe current size of the render window

Implements C3D_RENDER_BASE.

Definition at line 91 of file c3d_render_ogl_legacy.cpp.

92 {
93  if( m_windowSize != aSize )
94  {
95  m_windowSize = aSize;
96  glViewport( 0, 0, m_windowSize.x, m_windowSize.y );
97 
98  // Initialize here any screen dependent data here
99  }
100 }
wxSize m_windowSize
The window size that this camera is working.

References C3D_RENDER_BASE::m_windowSize.

◆ setLight_Bottom()

void C3D_RENDER_OGL_LEGACY::setLight_Bottom ( bool  enabled)
private

Definition at line 121 of file c3d_render_ogl_legacy.cpp.

122 {
123  if( enabled )
124  glEnable( GL_LIGHT2 );
125  else
126  glDisable( GL_LIGHT2 );
127 }

Referenced by Redraw().

◆ setLight_Front()

void C3D_RENDER_OGL_LEGACY::setLight_Front ( bool  enabled)
private

Definition at line 103 of file c3d_render_ogl_legacy.cpp.

104 {
105  if( enabled )
106  glEnable( GL_LIGHT0 );
107  else
108  glDisable( GL_LIGHT0 );
109 }

Referenced by Redraw().

◆ setLight_Top()

void C3D_RENDER_OGL_LEGACY::setLight_Top ( bool  enabled)
private

Definition at line 112 of file c3d_render_ogl_legacy.cpp.

113 {
114  if( enabled )
115  glEnable( GL_LIGHT1 );
116  else
117  glDisable( GL_LIGHT1 );
118 }

Referenced by Redraw().

◆ setupMaterials()

void C3D_RENDER_OGL_LEGACY::setupMaterials ( )
private

Definition at line 177 of file c3d_render_ogl_legacy.cpp.

178 {
179  m_materials = {};
180 
182  {
183  // http://devernay.free.fr/cours/opengl/materials.html
184 
185  // Copper material mixed with the copper color
186  m_materials.m_Copper.m_Ambient = SFVEC3F( m_settings.m_CopperColor.r * 0.1f,
187  m_settings.m_CopperColor.g * 0.1f,
188  m_settings.m_CopperColor.b * 0.1f);
189 
190  m_materials.m_Copper.m_Specular = SFVEC3F( m_settings.m_CopperColor.r * 0.75f + 0.25f,
191  m_settings.m_CopperColor.g * 0.75f + 0.25f,
192  m_settings.m_CopperColor.b * 0.75f + 0.25f );
193 
194  // This guess the material type(ex: copper vs gold) to determine the
195  // shininess factor between 0.1 and 0.4
196  float shininessfactor = 0.40f - mapf( fabs( m_settings.m_CopperColor.r -
198  0.15f, 1.00f,
199  0.00f, 0.30f );
200 
201  m_materials.m_Copper.m_Shininess = shininessfactor * 128.0f;
202  m_materials.m_Copper.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f );
203 
204 
205  // Paste material mixed with paste color
206  m_materials.m_Paste.m_Ambient = SFVEC3F( m_settings.m_SolderPasteColor.r,
209 
210  m_materials.m_Paste.m_Specular = SFVEC3F( m_settings.m_SolderPasteColor.r *
216 
217  m_materials.m_Paste.m_Shininess = 0.1f * 128.0f;
218  m_materials.m_Paste.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f );
219 
220 
221  // Silk screen material mixed with silk screen color
222  m_materials.m_SilkSTop.m_Ambient = SFVEC3F( m_settings.m_SilkScreenColorTop.r,
224 
225  m_materials.m_SilkSTop.m_Specular = SFVEC3F(
229 
230  m_materials.m_SilkSTop.m_Shininess = 0.078125f * 128.0f;
231  m_materials.m_SilkSTop.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f );
232 
233  // Silk screen material mixed with silk screen color
234  m_materials.m_SilkSBot.m_Ambient = SFVEC3F( m_settings.m_SilkScreenColorBot.r,
236 
237  m_materials.m_SilkSBot.m_Specular = SFVEC3F(
241 
242  m_materials.m_SilkSBot.m_Shininess = 0.078125f * 128.0f;
243  m_materials.m_SilkSBot.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f );
244 
245 
246  // Solder mask material mixed with solder mask color
247  m_materials.m_SolderMaskTop.m_Ambient = SFVEC3F( m_settings.m_SolderMaskColorTop.r * 0.3f,
249  m_settings.m_SolderMaskColorTop.b * 0.3f );
250 
251  m_materials.m_SolderMaskTop.m_Specular =
255 
256  m_materials.m_SolderMaskTop.m_Shininess = 0.8f * 128.0f;
257  m_materials.m_SolderMaskTop.m_Transparency = 0.17f;
258  m_materials.m_SolderMaskTop.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f );
259 
260  // Solder mask material mixed with solder mask color
261  m_materials.m_SolderMaskBot.m_Ambient = SFVEC3F( m_settings.m_SolderMaskColorBot.r * 0.3f,
263  m_settings.m_SolderMaskColorBot.b * 0.3f );
264 
265  m_materials.m_SolderMaskBot.m_Specular =
269 
270  m_materials.m_SolderMaskBot.m_Shininess = 0.8f * 128.0f;
271  m_materials.m_SolderMaskBot.m_Transparency = 0.17f;
272  m_materials.m_SolderMaskBot.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f );
273 
274 
275  // Epoxy material
276  m_materials.m_EpoxyBoard.m_Ambient = SFVEC3F( 117.0f / 255.0f,
277  97.0f / 255.0f,
278  47.0f / 255.0f );
279 
280  m_materials.m_EpoxyBoard.m_Diffuse = m_settings.m_BoardBodyColor;
281 
282  m_materials.m_EpoxyBoard.m_Specular = SFVEC3F( 18.0f / 255.0f,
283  3.0f / 255.0f,
284  20.0f / 255.0f );
285 
286  m_materials.m_EpoxyBoard.m_Shininess = 0.1f * 128.0f;
287  m_materials.m_EpoxyBoard.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f );
288  }
289  else // Technical Mode
290  {
291  const SFVEC3F matAmbientColor = SFVEC3F( 0.10f );
292  const SFVEC3F matSpecularColor = SFVEC3F( 0.10f );
293  const float matShininess = 0.1f * 128.0f;
294 
295  // Copper material
296  m_materials.m_Copper.m_Ambient = matAmbientColor;
297  m_materials.m_Copper.m_Specular = matSpecularColor;
298  m_materials.m_Copper.m_Shininess = matShininess;
299  m_materials.m_Copper.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f );
300 
301  // Paste material
302  m_materials.m_Paste.m_Ambient = matAmbientColor;
303  m_materials.m_Paste.m_Specular = matSpecularColor;
304  m_materials.m_Paste.m_Shininess = matShininess;
305  m_materials.m_Paste.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f );
306 
307  // Silk screen material
308  m_materials.m_SilkSTop.m_Ambient = matAmbientColor;
309  m_materials.m_SilkSTop.m_Specular = matSpecularColor;
310  m_materials.m_SilkSTop.m_Shininess = matShininess;
311  m_materials.m_SilkSTop.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f );
312 
313  // Silk screen material
314  m_materials.m_SilkSBot.m_Ambient = matAmbientColor;
315  m_materials.m_SilkSBot.m_Specular = matSpecularColor;
316  m_materials.m_SilkSBot.m_Shininess = matShininess;
317  m_materials.m_SilkSBot.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f );
318 
319  // Solder mask material
320  m_materials.m_SolderMaskTop.m_Ambient = matAmbientColor;
321  m_materials.m_SolderMaskTop.m_Specular = matSpecularColor;
322  m_materials.m_SolderMaskTop.m_Shininess = matShininess;
323  m_materials.m_SolderMaskTop.m_Transparency = 0.17f;
324  m_materials.m_SolderMaskTop.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f );
325 
326  // Solder mask material
327  m_materials.m_SolderMaskBot.m_Ambient = matAmbientColor;
328  m_materials.m_SolderMaskBot.m_Specular = matSpecularColor;
329  m_materials.m_SolderMaskBot.m_Shininess = matShininess;
330  m_materials.m_SolderMaskBot.m_Transparency = 0.17f;
331  m_materials.m_SolderMaskBot.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f );
332 
333  // Epoxy material
334  m_materials.m_EpoxyBoard.m_Ambient = matAmbientColor;
335  m_materials.m_EpoxyBoard.m_Diffuse = m_settings.m_BoardBodyColor;
336  m_materials.m_EpoxyBoard.m_Specular = matSpecularColor;
337  m_materials.m_EpoxyBoard.m_Shininess = matShininess;
338  m_materials.m_EpoxyBoard.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f );
339 
340  // Gray material (used for example in technical vias and pad holes)
341  m_materials.m_GrayMaterial.m_Ambient = SFVEC3F( 0.8f, 0.8f, 0.8f );
342  m_materials.m_GrayMaterial.m_Diffuse = SFVEC3F( 0.3f, 0.3f, 0.3f );
343  m_materials.m_GrayMaterial.m_Specular = SFVEC3F( 0.4f, 0.4f, 0.4f );
344  m_materials.m_GrayMaterial.m_Shininess = 0.01f * 128.0f;
345  m_materials.m_GrayMaterial.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f );
346  }
347 }
SFVEC3D m_CopperColor
in realistic mode: copper color
Definition: cinfo3d_visu.h:505
SFVEC3D m_SolderMaskColorBot
in realistic mode: solder mask color ( bot )
Definition: cinfo3d_visu.h:500
SFVEC3D m_SolderMaskColorTop
in realistic mode: solder mask color ( top )
Definition: cinfo3d_visu.h:501
float mapf(float x, float in_min, float in_max, float out_min, float out_max)
Definition: 3d_math.h:136
SFVEC3D m_SilkScreenColorTop
in realistic mode: SilkScreen color ( top )
Definition: cinfo3d_visu.h:504
CINFO3D_VISU & m_settings
settings refrence in use for this render
bool GetFlag(DISPLAY3D_FLG aFlag) const
GetFlag - get a configuration status of a flag.
SFVEC3D m_BoardBodyColor
in realistic mode: FR4 board color
Definition: cinfo3d_visu.h:499
SFVEC3D m_SilkScreenColorBot
in realistic mode: SilkScreen color ( bot )
Definition: cinfo3d_visu.h:503
struct C3D_RENDER_OGL_LEGACY::@0 m_materials
SFVEC3D m_SolderPasteColor
in realistic mode: solder paste color
Definition: cinfo3d_visu.h:502
glm::vec3 SFVEC3F
Definition: xv3d_types.h:47

References FL_USE_REALISTIC_MODE, CINFO3D_VISU::GetFlag(), CINFO3D_VISU::m_BoardBodyColor, CINFO3D_VISU::m_CopperColor, m_materials, C3D_RENDER_BASE::m_settings, CINFO3D_VISU::m_SilkScreenColorBot, CINFO3D_VISU::m_SilkScreenColorTop, CINFO3D_VISU::m_SolderMaskColorBot, CINFO3D_VISU::m_SolderMaskColorTop, CINFO3D_VISU::m_SolderPasteColor, and mapf().

Referenced by Redraw().

Member Data Documentation

◆ m_3dmodel_map

MAP_3DMODEL C3D_RENDER_OGL_LEGACY::m_3dmodel_map
private

◆ m_Copper

SMATERIAL C3D_RENDER_OGL_LEGACY::m_Copper

Definition at line 208 of file c3d_render_ogl_legacy.h.

◆ m_EpoxyBoard

SMATERIAL C3D_RENDER_OGL_LEGACY::m_EpoxyBoard

Definition at line 207 of file c3d_render_ogl_legacy.h.

◆ m_GrayMaterial

SMATERIAL C3D_RENDER_OGL_LEGACY::m_GrayMaterial

Definition at line 210 of file c3d_render_ogl_legacy.h.

◆ m_is_opengl_initialized

bool C3D_RENDER_BASE::m_is_opengl_initialized
protectedinherited

flag if the opengl specific for this render was already initialized

Definition at line 112 of file c3d_render_base.h.

Referenced by C3D_RENDER_BASE::C3D_RENDER_BASE(), C3D_RENDER_RAYTRACING::initializeOpenGL(), initializeOpenGL(), C3D_RENDER_RAYTRACING::Redraw(), and Redraw().

◆ m_last_grid_type

GRID3D_TYPE C3D_RENDER_OGL_LEGACY::m_last_grid_type
private

Stores the last grid computed.

Definition at line 102 of file c3d_render_ogl_legacy.h.

Referenced by C3D_RENDER_OGL_LEGACY(), and Redraw().

◆ m_logTrace

const wxChar * C3D_RENDER_BASE::m_logTrace = wxT( "KI_TRACE_3D_RENDER" )
staticprotectedinherited

Trace mask used to enable or disable the trace output of this class.

The debug output can be turned on by setting the WXTRACE environment variable to "KI_TRACE_3D_RENDER". See the wxWidgets documentation on wxLogTrace for more information.

Definition at line 126 of file c3d_render_base.h.

Referenced by C3D_RENDER_BASE::C3D_RENDER_BASE(), C3D_RENDER_OGL_LEGACY(), C3D_RENDER_RAYTRACING::C3D_RENDER_RAYTRACING(), C3D_RENDER_RAYTRACING::opengl_init_pbo(), ~C3D_RENDER_OGL_LEGACY(), and C3D_RENDER_RAYTRACING::~C3D_RENDER_RAYTRACING().

◆ m_materials

struct { ... } C3D_RENDER_OGL_LEGACY::m_materials

◆ m_ogl_circle_texture

GLuint C3D_RENDER_OGL_LEGACY::m_ogl_circle_texture
private

◆ m_ogl_disp_list_board

CLAYERS_OGL_DISP_LISTS* C3D_RENDER_OGL_LEGACY::m_ogl_disp_list_board
private

◆ m_ogl_disp_list_grid

GLuint C3D_RENDER_OGL_LEGACY::m_ogl_disp_list_grid
private

oGL list that stores current grid

Definition at line 100 of file c3d_render_ogl_legacy.h.

Referenced by C3D_RENDER_OGL_LEGACY(), generate_new_3DGrid(), ogl_free_all_display_lists(), and Redraw().

◆ m_ogl_disp_list_pads_holes

CLAYERS_OGL_DISP_LISTS* C3D_RENDER_OGL_LEGACY::m_ogl_disp_list_pads_holes
private

◆ m_ogl_disp_list_through_holes_inner

CLAYERS_OGL_DISP_LISTS* C3D_RENDER_OGL_LEGACY::m_ogl_disp_list_through_holes_inner
private

◆ m_ogl_disp_list_through_holes_outer

CLAYERS_OGL_DISP_LISTS* C3D_RENDER_OGL_LEGACY::m_ogl_disp_list_through_holes_outer
private

◆ m_ogl_disp_list_through_holes_outer_with_npth

CLAYERS_OGL_DISP_LISTS* C3D_RENDER_OGL_LEGACY::m_ogl_disp_list_through_holes_outer_with_npth
private

◆ m_ogl_disp_list_through_holes_vias_outer

CLAYERS_OGL_DISP_LISTS* C3D_RENDER_OGL_LEGACY::m_ogl_disp_list_through_holes_vias_outer
private

◆ m_ogl_disp_list_via

CLAYERS_OGL_DISP_LISTS* C3D_RENDER_OGL_LEGACY::m_ogl_disp_list_via
private

◆ m_ogl_disp_list_vias_and_pad_holes_outer_contourn_and_caps

CLAYERS_OGL_DISP_LISTS* C3D_RENDER_OGL_LEGACY::m_ogl_disp_list_vias_and_pad_holes_outer_contourn_and_caps
private

Definition at line 94 of file c3d_render_ogl_legacy.h.

Referenced by C3D_RENDER_OGL_LEGACY(), and ogl_free_all_display_lists().

◆ m_ogl_disp_lists_layers

MAP_OGL_DISP_LISTS C3D_RENDER_OGL_LEGACY::m_ogl_disp_lists_layers
private

◆ m_ogl_disp_lists_layers_holes_inner

MAP_OGL_DISP_LISTS C3D_RENDER_OGL_LEGACY::m_ogl_disp_lists_layers_holes_inner
private

◆ m_ogl_disp_lists_layers_holes_outer

MAP_OGL_DISP_LISTS C3D_RENDER_OGL_LEGACY::m_ogl_disp_lists_layers_holes_outer
private

◆ m_Paste

SMATERIAL C3D_RENDER_OGL_LEGACY::m_Paste

Definition at line 202 of file c3d_render_ogl_legacy.h.

◆ m_Plastic

SMATERIAL C3D_RENDER_OGL_LEGACY::m_Plastic

Definition at line 209 of file c3d_render_ogl_legacy.h.

◆ m_reloadRequested

bool C3D_RENDER_BASE::m_reloadRequested
protectedinherited

◆ m_settings

◆ m_SilkSBot

SMATERIAL C3D_RENDER_OGL_LEGACY::m_SilkSBot

Definition at line 203 of file c3d_render_ogl_legacy.h.

◆ m_SilkSTop

SMATERIAL C3D_RENDER_OGL_LEGACY::m_SilkSTop

Definition at line 204 of file c3d_render_ogl_legacy.h.

◆ m_SolderMaskBot

SMATERIAL C3D_RENDER_OGL_LEGACY::m_SolderMaskBot

Definition at line 205 of file c3d_render_ogl_legacy.h.

◆ m_SolderMaskTop

SMATERIAL C3D_RENDER_OGL_LEGACY::m_SolderMaskTop

Definition at line 206 of file c3d_render_ogl_legacy.h.

◆ m_triangles

MAP_TRIANGLES C3D_RENDER_OGL_LEGACY::m_triangles
private

◆ m_windowSize


The documentation for this class was generated from the following files: