Commit 19347b12 authored by jean-pierre charras's avatar jean-pierre charras

3D viewer: minor fixes. Use our class REPORTER to show warning messages and...

3D viewer: minor fixes. Use our class REPORTER to show warning messages and activity info when building the 3D board view. Add a few comments in sources.
Very minor other fixes.
parent ae57c469
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
class BOARD_DESIGN_SETTINGS; class BOARD_DESIGN_SETTINGS;
class EDA_3D_FRAME; class EDA_3D_FRAME;
class CPOLYGONS_LIST; class CPOLYGONS_LIST;
class REPORTER;
class VIA; class VIA;
class D_PAD; class D_PAD;
...@@ -80,7 +81,8 @@ class EDA_3D_CANVAS : public wxGLCanvas ...@@ -80,7 +81,8 @@ class EDA_3D_CANVAS : public wxGLCanvas
{ {
private: private:
bool m_init; bool m_init;
bool m_reportWarnings; ///< true to report all wranings when build the 3D scene false to report errors only bool m_reportWarnings; ///< true to report all warnings when building the 3D scene
///< false to report errors only
GLuint m_glLists[GL_ID_END]; ///< GL lists GLuint m_glLists[GL_ID_END]; ///< GL lists
wxGLContext* m_glRC; wxGLContext* m_glRC;
wxRealPoint m_draw3dOffset; ///< offset to draw the 3D mesh. wxRealPoint m_draw3dOffset; ///< offset to draw the 3D mesh.
...@@ -148,11 +150,11 @@ public: ...@@ -148,11 +150,11 @@ public:
* Function CreateDrawGL_List * Function CreateDrawGL_List
* Prepares the parameters of the OpenGL draw list * Prepares the parameters of the OpenGL draw list
* creates the OpenGL draw list items (board, grid ...) * creates the OpenGL draw list items (board, grid ...)
* @param aErrorMessages = a wxString which will filled with error messages, * @param aErrorMessages = a REPORTER which will filled with error messages,
* if any * if any
* @param aShowWarnings = true to show all messages, false to show errors only * @param aActivity = a REPORTER to display activity state
*/ */
void CreateDrawGL_List( wxString* aErrorMessages, bool aShowWarnings ); void CreateDrawGL_List( REPORTER* aErrorMessages, REPORTER* aActivity );
void InitGL(); void InitGL();
void ReportWarnings( bool aReport ) { m_reportWarnings = aReport; } void ReportWarnings( bool aReport ) { m_reportWarnings = aReport; }
...@@ -231,24 +233,25 @@ private: ...@@ -231,24 +233,25 @@ private:
* Populates the OpenGL GL_ID_BOARD draw list with board items only on copper layers. * Populates the OpenGL GL_ID_BOARD draw list with board items only on copper layers.
* 3D footprint shapes, tech layers and aux layers are not on this list * 3D footprint shapes, tech layers and aux layers are not on this list
* Fills aErrorMessages with error messages created by some calculation function * Fills aErrorMessages with error messages created by some calculation function
* display activity state
* @param aBoardList = * @param aBoardList =
* @param aBodyOnlyList = * @param aBodyOnlyList =
* @param aErrorMessages = a wxString to add error and warning messages * @param aErrorMessages = a REPORTER to add error and warning messages
* created by the build process (can be NULL) * created by the build process (can be NULL)
* @param aShowWarnings = true to show all messages, false to show errors only * @param aActivity = a REPORTER to display activity state
*/ */
void buildBoard3DView( GLuint aBoardList, GLuint aBodyOnlyList, void buildBoard3DView( GLuint aBoardList, GLuint aBodyOnlyList,
wxString* aErrorMessages, bool aShowWarnings ); REPORTER* aErrorMessages, REPORTER* aActivity );
/** /**
* Function buildTechLayers3DView * Function buildTechLayers3DView
* Called by CreateDrawGL_List() * Called by CreateDrawGL_List()
* Populates the OpenGL GL_ID_TECH_LAYERS draw list with items on tech layers * Populates the OpenGL GL_ID_TECH_LAYERS draw list with items on tech layers
* @param aErrorMessages = a wxString to add error and warning messages * @param aErrorMessages = a REPORTER to add error and warning messages
* created by the build process (can be NULL) * created by the build process (can be NULL)
* @param aShowWarnings = true to show all messages, false to show errors only * @param aActivity = a REPORTER to display activity state
*/ */
void buildTechLayers3DView( wxString* aErrorMessages, bool aShowWarnings ); void buildTechLayers3DView( REPORTER* aErrorMessages, REPORTER* aActivity );
/** /**
* Function buildShadowList * Function buildShadowList
...@@ -263,17 +266,25 @@ private: ...@@ -263,17 +266,25 @@ private:
* draw lists with 3D footprint shapes * draw lists with 3D footprint shapes
* @param aOpaqueList is the gl list for non transparent items * @param aOpaqueList is the gl list for non transparent items
* @param aTransparentList is the gl list for non transparent items, * @param aTransparentList is the gl list for non transparent items,
* @param aErrorMessages = a REPORTER to add error and warning messages
* created by the build process (can be NULL)
* @param aActivity = a REPORTER to display activity state
* which need to be drawn after all other items * which need to be drawn after all other items
*/ */
void buildFootprintShape3DList( GLuint aOpaqueList, void buildFootprintShape3DList( GLuint aOpaqueList,
GLuint aTransparentList ); GLuint aTransparentList,
REPORTER* aErrorMessages, REPORTER* aActivity );
/** /**
* Function buildBoard3DAuxLayers * Function buildBoard3DAuxLayers
* Called by CreateDrawGL_List() * Called by CreateDrawGL_List()
* Fills the OpenGL GL_ID_AUX_LAYERS draw list * Fills the OpenGL GL_ID_AUX_LAYERS draw list
* with items on aux layers only * with items on aux layers only
* @param aErrorMessages = a REPORTER to add error and warning messages
* created by the build process (can be NULL)
* @param aActivity = a REPORTER to display activity state
* which need to be drawn after all other items
*/ */
void buildBoard3DAuxLayers(); void buildBoard3DAuxLayers( REPORTER* aErrorMessages, REPORTER* aActivity );
void draw3DGrid( double aGriSizeMM ); void draw3DGrid( double aGriSizeMM );
void draw3DAxis(); void draw3DAxis();
...@@ -329,11 +340,11 @@ private: ...@@ -329,11 +340,11 @@ private:
* function generateFakeShadowsTextures * function generateFakeShadowsTextures
* creates shadows of the board an footprints * creates shadows of the board an footprints
* for aesthetical purpose * for aesthetical purpose
* @param aErrorMessages = a wxString to add error and warning messages * @param aErrorMessages = a REPORTER to add error and warning messages
* created by the build process (can be NULL) * created by the build process (can be NULL)
* @param aShowWarnings = true to show all messages, false to show errors only * @param aActivity = a REPORTER to display activity state
*/ */
void generateFakeShadowsTextures( wxString* aErrorMessages, bool aShowWarnings ); void generateFakeShadowsTextures( REPORTER* aErrorMessages, REPORTER* aActivity );
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
......
This diff is collapsed.
...@@ -368,8 +368,9 @@ void EDA_3D_CANVAS::draw3DPadHole( const D_PAD* aPad ) ...@@ -368,8 +368,9 @@ void EDA_3D_CANVAS::draw3DPadHole( const D_PAD* aPad )
if( drillsize.x == drillsize.y ) // usual round hole if( drillsize.x == drillsize.y ) // usual round hole
{ {
int hole_radius = ( drillsize.x + thickness ) / 2;
Draw3D_ZaxisCylinder( aPad->GetPosition(), Draw3D_ZaxisCylinder( aPad->GetPosition(),
(drillsize.x + thickness / 2) / 2, holeHeight, hole_radius, holeHeight,
thickness, holeZpoz, GetPrm3DVisu().m_BiuTo3Dunits ); thickness, holeZpoz, GetPrm3DVisu().m_BiuTo3Dunits );
} }
else // Oblong hole else // Oblong hole
......
...@@ -138,7 +138,7 @@ public: ...@@ -138,7 +138,7 @@ public:
/** /**
* Class WX_STRING_REPROTER * Class WX_STRING_REPORTER
* is a wrapper for reporting to a wxString object. * is a wrapper for reporting to a wxString object.
*/ */
class WX_STRING_REPORTER : public REPORTER class WX_STRING_REPORTER : public REPORTER
......
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
// std::vector templates // std::vector templates
%template(VIA_DIMENSION_Vector) std::vector<VIA_DIMENSION>; %template(VIA_DIMENSION_Vector) std::vector<VIA_DIMENSION>;
%template (RASTNET_Vector) std::vector<RATSNEST_ITEM>; %template (RATSNET_Vector) std::vector<RATSNEST_ITEM>;
%extend BOARD %extend BOARD
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment