Loading 3d-viewer/3d_canvas.h +1 −12 Original line number Original line Diff line number Diff line Loading @@ -30,15 +30,8 @@ #ifndef _3D_CANVAS_H_ #ifndef _3D_CANVAS_H_ #define _3D_CANVAS_H_ #define _3D_CANVAS_H_ #include <wxBasePcbFrame.h> // for m_auimanager member. #include <layers_id_colors_and_visibility.h> // Layers id definitions #include <PolyLine.h> // for CPolyPt #if !wxUSE_GLCANVAS #error Please set wxUSE_GLCANVAS to 1 in setup.h. #endif #include <wx/glcanvas.h> #include <wx/glcanvas.h> #include <wxBasePcbFrame.h> // for m_auimanager member. #ifdef __WXMAC__ #ifdef __WXMAC__ # ifdef __DARWIN__ # ifdef __DARWIN__ Loading @@ -53,10 +46,6 @@ #include <3d_struct.h> #include <3d_struct.h> class BOARD_DESIGN_SETTINGS; class BOARD_DESIGN_SETTINGS; class TRACK; class TEXTE_PCB; class DRAWSEGMENT; class ZONE_CONTAINER; class EDA_3D_FRAME; class EDA_3D_FRAME; class S3D_VERTEX; class S3D_VERTEX; class SEGVIA; class SEGVIA; Loading 3d-viewer/3d_draw.cpp +198 −169 Original line number Original line Diff line number Diff line Loading @@ -70,7 +70,7 @@ static GLfloat Get3DLayer_Z_Orientation( LAYER_NUM aLayer ); * Used only to draw pads outlines on silkscreen layers. * Used only to draw pads outlines on silkscreen layers. */ */ static void BuildPadShapeThickOutlineAsPolygon( D_PAD* aPad, static void BuildPadShapeThickOutlineAsPolygon( D_PAD* aPad, std::vector <CPolyPt>& aCornerBuffer, CPOLYGONS_LIST& aCornerBuffer, int aWidth, int aWidth, int aCircleToSegmentsCount, int aCircleToSegmentsCount, double aCorrectionFactor ) double aCorrectionFactor ) Loading @@ -83,7 +83,7 @@ static void BuildPadShapeThickOutlineAsPolygon( D_PAD * aPad, } } // For other shapes, draw polygon outlines // For other shapes, draw polygon outlines std::vector <CPolyPt> corners; CPOLYGONS_LIST corners; aPad->BuildPadShapePolygon( corners, wxSize( 0, 0 ), aPad->BuildPadShapePolygon( corners, wxSize( 0, 0 ), aCircleToSegmentsCount, aCorrectionFactor ); aCircleToSegmentsCount, aCorrectionFactor ); Loading @@ -97,6 +97,7 @@ static void BuildPadShapeThickOutlineAsPolygon( D_PAD * aPad, } } } } void EDA_3D_CANVAS::Redraw( bool finish ) void EDA_3D_CANVAS::Redraw( bool finish ) { { // SwapBuffer requires the window to be shown before calling // SwapBuffer requires the window to be shown before calling Loading Loading @@ -145,6 +146,7 @@ void EDA_3D_CANVAS::Redraw( bool finish ) SwapBuffers(); SwapBuffers(); } } void EDA_3D_CANVAS::BuildBoard3DView() void EDA_3D_CANVAS::BuildBoard3DView() { { PCB_BASE_FRAME* pcbframe = Parent()->Parent(); PCB_BASE_FRAME* pcbframe = Parent()->Parent(); Loading @@ -158,12 +160,13 @@ void EDA_3D_CANVAS::BuildBoard3DView() // for holes and items which do not need // for holes and items which do not need // a fine representation // a fine representation double correctionFactorLQ = 1.0 / cos( M_PI / (segcountLowQuality * 2) ); double correctionFactorLQ = 1.0 / cos( M_PI / (segcountLowQuality * 2) ); std::vector <CPolyPt> bufferPolys; CPOLYGONS_LIST bufferPolys; bufferPolys.reserve( 200000 ); // Reserve for large board (tracks mainly) bufferPolys.reserve( 200000 ); // Reserve for large board (tracks mainly) std::vector <CPolyPt> bufferZonesPolys; CPOLYGONS_LIST bufferZonesPolys; bufferPolys.reserve( 500000 ); // Reserve for large board ( copper zones mainly ) bufferPolys.reserve( 500000 ); // Reserve for large board ( copper zones mainly ) std::vector <CPolyPt> currLayerHoles; // Contains holes for the current layer CPOLYGONS_LIST currLayerHoles; // Contains holes for the current layer std::vector <CPolyPt> allLayerHoles; // Contains through holes, calculated only once CPOLYGONS_LIST allLayerHoles; // Contains through holes, calculated only once allLayerHoles.reserve( 20000 ); allLayerHoles.reserve( 20000 ); bool throughHolesListBuilt = false; // flag to build the through hole polygon list only once bool throughHolesListBuilt = false; // flag to build the through hole polygon list only once bool hightQualityMode = false; bool hightQualityMode = false; Loading @@ -171,13 +174,13 @@ void EDA_3D_CANVAS::BuildBoard3DView() for( LAYER_NUM layer = FIRST_COPPER_LAYER; layer <= LAST_COPPER_LAYER; for( LAYER_NUM layer = FIRST_COPPER_LAYER; layer <= LAST_COPPER_LAYER; layer++ ) layer++ ) { { if( layer != LAST_COPPER_LAYER if( layer != LAST_COPPER_LAYER && && layer >= g_Parm_3D_Visu.m_CopperLayersCount ) layer >= g_Parm_3D_Visu.m_CopperLayersCount ) continue; continue; if( !g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) ) if( !g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) ) continue; continue; bufferPolys.clear(); bufferPolys.clear(); bufferZonesPolys.clear(); bufferZonesPolys.clear(); currLayerHoles.clear(); currLayerHoles.clear(); Loading @@ -199,6 +202,7 @@ void EDA_3D_CANVAS::BuildBoard3DView() int holediameter = track->GetDrillValue(); int holediameter = track->GetDrillValue(); int thickness = g_Parm_3D_Visu.GetCopperThicknessBIU(); int thickness = g_Parm_3D_Visu.GetCopperThicknessBIU(); int hole_outer_radius = (holediameter + thickness) / 2; int hole_outer_radius = (holediameter + thickness) / 2; if( shape != VIA_THROUGH ) if( shape != VIA_THROUGH ) TransformCircleToPolygon( currLayerHoles, TransformCircleToPolygon( currLayerHoles, track->GetStart(), hole_outer_radius, track->GetStart(), hole_outer_radius, Loading @@ -214,16 +218,23 @@ void EDA_3D_CANVAS::BuildBoard3DView() for( MODULE* module = pcb->m_Modules; module != NULL; module = module->Next() ) for( MODULE* module = pcb->m_Modules; module != NULL; module = module->Next() ) { { module->TransformPadsShapesWithClearanceToPolygon( layer, module->TransformPadsShapesWithClearanceToPolygon( layer, bufferPolys, 0, segcountforcircle, correctionFactor ); bufferPolys, 0, segcountforcircle, correctionFactor ); // Micro-wave modukes may have items on copper layers // Micro-wave modukes may have items on copper layers module->TransformGraphicShapesWithClearanceToPolygonSet( layer, module->TransformGraphicShapesWithClearanceToPolygonSet( layer, bufferPolys, 0, segcountforcircle, correctionFactor ); bufferPolys, 0, segcountforcircle, correctionFactor ); // Add pad hole, if any // Add pad hole, if any if( !throughHolesListBuilt ) if( !throughHolesListBuilt ) { { D_PAD* pad = module->Pads(); D_PAD* pad = module->Pads(); for( ; pad != NULL; pad = pad->Next() ) for( ; pad != NULL; pad = pad->Next() ) pad->BuildPadDrillShapePolygon( allLayerHoles, 0, pad->BuildPadDrillShapePolygon( allLayerHoles, 0, segcountLowQuality ); segcountLowQuality ); Loading Loading @@ -283,6 +294,7 @@ void EDA_3D_CANVAS::BuildBoard3DView() // Add holes in polygon list // Add holes in polygon list currLayerHoles.insert( currLayerHoles.begin(), currLayerHoles.insert( currLayerHoles.begin(), allLayerHoles.begin(), allLayerHoles.end() ); allLayerHoles.begin(), allLayerHoles.end() ); if( currLayerHoles.size() > 0 ) if( currLayerHoles.size() > 0 ) AddPolygonCornersToKiPolygonList( currLayerHoles, polysetHoles ); AddPolygonCornersToKiPolygonList( currLayerHoles, polysetHoles ); Loading @@ -301,6 +313,7 @@ void EDA_3D_CANVAS::BuildBoard3DView() Draw3D_SolidHorizontalPolyPolygons( bufferPolys, zpos, Draw3D_SolidHorizontalPolyPolygons( bufferPolys, zpos, thickness, thickness, g_Parm_3D_Visu.m_BiuTo3Dunits ); g_Parm_3D_Visu.m_BiuTo3Dunits ); if( bufferZonesPolys.size() ) if( bufferZonesPolys.size() ) Draw3D_SolidHorizontalPolyPolygons( bufferZonesPolys, zpos, Draw3D_SolidHorizontalPolyPolygons( bufferZonesPolys, zpos, thickness, thickness, Loading @@ -315,6 +328,7 @@ void EDA_3D_CANVAS::BuildBoard3DView() if( track->Type() == PCB_VIA_T ) if( track->Type() == PCB_VIA_T ) Draw3DViaHole( (SEGVIA*) track ); Draw3DViaHole( (SEGVIA*) track ); } } // Draw pads holes (vertical cylinders) // Draw pads holes (vertical cylinders) for( MODULE* module = pcb->m_Modules; module != NULL; module = module->Next() ) for( MODULE* module = pcb->m_Modules; module != NULL; module = module->Next() ) { { Loading @@ -333,6 +347,7 @@ void EDA_3D_CANVAS::BuildBoard3DView() continue; continue; bufferPolys.clear(); bufferPolys.clear(); for( BOARD_ITEM* item = pcb->m_Drawings; item; item = item->Next() ) for( BOARD_ITEM* item = pcb->m_Drawings; item; item = item->Next() ) { { if( !item->IsOnLayer( layer ) ) if( !item->IsOnLayer( layer ) ) Loading Loading @@ -368,6 +383,7 @@ void EDA_3D_CANVAS::BuildBoard3DView() { { if( !pad->IsOnLayer( layer ) ) if( !pad->IsOnLayer( layer ) ) continue; continue; BuildPadShapeThickOutlineAsPolygon( pad, bufferPolys, BuildPadShapeThickOutlineAsPolygon( pad, bufferPolys, linewidth, linewidth, segcountforcircle, correctionFactor ); segcountforcircle, correctionFactor ); Loading @@ -375,10 +391,16 @@ void EDA_3D_CANVAS::BuildBoard3DView() } } else else module->TransformPadsShapesWithClearanceToPolygon( layer, module->TransformPadsShapesWithClearanceToPolygon( layer, bufferPolys, 0, segcountforcircle, correctionFactor ); bufferPolys, 0, segcountforcircle, correctionFactor ); module->TransformGraphicShapesWithClearanceToPolygonSet( layer, module->TransformGraphicShapesWithClearanceToPolygonSet( layer, bufferPolys, 0, segcountforcircle, correctionFactor ); bufferPolys, 0, segcountforcircle, correctionFactor ); } } // bufferPolys contains polygons to merge. Many overlaps . // bufferPolys contains polygons to merge. Many overlaps . Loading @@ -395,6 +417,7 @@ void EDA_3D_CANVAS::BuildBoard3DView() EDA_COLOR_T color = g_ColorsSettings.GetLayerColor( layer ); EDA_COLOR_T color = g_ColorsSettings.GetLayerColor( layer ); int thickness = g_Parm_3D_Visu.GetLayerObjectThicknessBIU( layer ); int thickness = g_Parm_3D_Visu.GetLayerObjectThicknessBIU( layer ); int zpos = g_Parm_3D_Visu.GetLayerZcoordBIU( layer ); int zpos = g_Parm_3D_Visu.GetLayerZcoordBIU( layer ); if( layer == EDGE_N ) if( layer == EDGE_N ) { { thickness = g_Parm_3D_Visu.GetLayerZcoordBIU( LAYER_N_FRONT ) thickness = g_Parm_3D_Visu.GetLayerZcoordBIU( LAYER_N_FRONT ) Loading @@ -417,6 +440,7 @@ void EDA_3D_CANVAS::BuildBoard3DView() module->ReadAndInsert3DComponentShape( this ); module->ReadAndInsert3DComponentShape( this ); } } GLuint EDA_3D_CANVAS::CreateDrawGL_List() GLuint EDA_3D_CANVAS::CreateDrawGL_List() { { PCB_BASE_FRAME* pcbframe = Parent()->Parent(); PCB_BASE_FRAME* pcbframe = Parent()->Parent(); Loading Loading @@ -543,6 +567,7 @@ void EDA_3D_CANVAS::DrawGrid( double aGriSizeMM ) glVertex3f( xmin, -(brd_center_pos.y + delta) * scale, zpos ); glVertex3f( xmin, -(brd_center_pos.y + delta) * scale, zpos ); glVertex3f( xmax, -(brd_center_pos.y + delta) * scale, zpos ); glVertex3f( xmax, -(brd_center_pos.y + delta) * scale, zpos ); glEnd(); glEnd(); if( ii != 0 ) if( ii != 0 ) { { glBegin( GL_LINES ); glBegin( GL_LINES ); Loading Loading @@ -597,7 +622,8 @@ void EDA_3D_CANVAS::DrawGrid( double aGriSizeMM ) double delta = ii * aGriSizeMM * IU_PER_MM * scale; double delta = ii * aGriSizeMM * IU_PER_MM * scale; if( delta <= zmax ) if( delta <= zmax ) { // Draw grid lines on Z axis (positive Z axis coordinates) { // Draw grid lines on Z axis (positive Z axis coordinates) glBegin( GL_LINES ); glBegin( GL_LINES ); glVertex3f( xmin, -brd_center_pos.y * scale, delta ); glVertex3f( xmin, -brd_center_pos.y * scale, delta ); glVertex3f( xmax, -brd_center_pos.y * scale, delta ); glVertex3f( xmax, -brd_center_pos.y * scale, delta ); Loading @@ -605,7 +631,8 @@ void EDA_3D_CANVAS::DrawGrid( double aGriSizeMM ) } } if( delta <= -zmin && ( ii != 0 ) ) if( delta <= -zmin && ( ii != 0 ) ) { // Draw grid lines on Z axis (negative Z axis coordinates) { // Draw grid lines on Z axis (negative Z axis coordinates) glBegin( GL_LINES ); glBegin( GL_LINES ); glVertex3f( xmin, -brd_center_pos.y * scale, -delta ); glVertex3f( xmin, -brd_center_pos.y * scale, -delta ); glVertex3f( xmax, -brd_center_pos.y * scale, -delta ); glVertex3f( xmax, -brd_center_pos.y * scale, -delta ); Loading @@ -617,6 +644,7 @@ void EDA_3D_CANVAS::DrawGrid( double aGriSizeMM ) } } } } void EDA_3D_CANVAS::Draw3DViaHole( SEGVIA* aVia ) void EDA_3D_CANVAS::Draw3DViaHole( SEGVIA* aVia ) { { LAYER_NUM top_layer, bottom_layer; LAYER_NUM top_layer, bottom_layer; Loading Loading @@ -688,7 +716,7 @@ void EDA_3D_CANVAS::Draw3DPadHole( D_PAD * aPad ) return; return; // Store here the points to approximate hole by segments // Store here the points to approximate hole by segments std::vector <CPolyPt> holecornersBuffer; CPOLYGONS_LIST holecornersBuffer; int thickness = g_Parm_3D_Visu.GetCopperThicknessBIU(); int thickness = g_Parm_3D_Visu.GetCopperThicknessBIU(); int height = g_Parm_3D_Visu.GetLayerZcoordBIU( LAYER_N_FRONT ) - int height = g_Parm_3D_Visu.GetLayerZcoordBIU( LAYER_N_FRONT ) - g_Parm_3D_Visu.GetLayerZcoordBIU( LAYER_N_BACK ); g_Parm_3D_Visu.GetLayerZcoordBIU( LAYER_N_BACK ); Loading Loading @@ -731,6 +759,7 @@ void EDA_3D_CANVAS::Draw3DPadHole( D_PAD * aPad ) } } } } bool Is3DLayerEnabled( LAYER_NUM aLayer ) bool Is3DLayerEnabled( LAYER_NUM aLayer ) { { int flg; int flg; Loading 3d-viewer/3d_draw_basic_functions.h +2 −2 Original line number Original line Diff line number Diff line Loading @@ -41,7 +41,7 @@ * The top side is located at aZpos + aThickness / 2 * The top side is located at aZpos + aThickness / 2 * The bottom side is located at aZpos - aThickness / 2 * The bottom side is located at aZpos - aThickness / 2 */ */ void Draw3D_SolidHorizontalPolyPolygons( const std::vector<CPolyPt>& aPolysList, void Draw3D_SolidHorizontalPolyPolygons( const CPOLYGONS_LIST& aPolysList, int aZpos, int aThickness, double aBiuTo3DUnits ); int aZpos, int aThickness, double aBiuTo3DUnits ); /** draw the solid polygon found in aPolysList /** draw the solid polygon found in aPolysList Loading @@ -55,7 +55,7 @@ void Draw3D_SolidHorizontalPolyPolygons( const std::vector<CPolyPt>& aPolysLi * The top side is located at aZpos + aThickness / 2 * The top side is located at aZpos + aThickness / 2 * The bottom side is located at aZpos - aThickness / 2 * The bottom side is located at aZpos - aThickness / 2 */ */ void Draw3D_SolidHorizontalPolygonWithHoles( const std::vector<CPolyPt>& aPolysList, void Draw3D_SolidHorizontalPolygonWithHoles( const CPOLYGONS_LIST& aPolysList, int aZpos, int aThickness, double aBiuTo3DUnits ); int aZpos, int aThickness, double aBiuTo3DUnits ); /** draw a thick segment using 3D primitives, in a XY plane /** draw a thick segment using 3D primitives, in a XY plane Loading 3d-viewer/3d_viewer.h +0 −2 Original line number Original line Diff line number Diff line Loading @@ -31,8 +31,6 @@ #define __3D_VIEWER_H__ #define __3D_VIEWER_H__ #include <wxBasePcbFrame.h> // for m_auimanager member. #include <wxBasePcbFrame.h> // for m_auimanager member. #include <layers_id_colors_and_visibility.h> // Layers id definitions #include <PolyLine.h> // fot CPolyPt #if !wxUSE_GLCANVAS #if !wxUSE_GLCANVAS #error Please set wxUSE_GLCANVAS to 1 in setup.h. #error Please set wxUSE_GLCANVAS to 1 in setup.h. Loading common/convert_basic_shapes_to_polygon.cpp +56 −52 Original line number Original line Diff line number Diff line Loading @@ -36,13 +36,13 @@ * We are using a lots polygons in calculations. * We are using a lots polygons in calculations. * and we are using 2 descriptions, * and we are using 2 descriptions, * one easy to use with boost::polygon (KI_POLYGON_SET) * one easy to use with boost::polygon (KI_POLYGON_SET) * one easy to use in zones and in draw functions (std::vector<CPolyPt>) * one easy to use in zones and in draw functions (CPOLYGONS_LIST) * Copy polygons from a KI_POLYGON_SET set of polygons to * Copy polygons from a KI_POLYGON_SET set of polygons to * a std::vector<CPolyPt> polygon list * a CPOLYGONS_LIST polygon list * Therefore we need conversion functions between these 2 descriptions * Therefore we need conversion functions between these 2 descriptions */ */ void CopyPolygonsFromKiPolygonListToPolysList( KI_POLYGON_SET& aKiPolyList, void CopyPolygonsFromKiPolygonListToPolysList( KI_POLYGON_SET& aKiPolyList, std::vector<CPolyPt>& aPolysList ) CPOLYGONS_LIST& aPolysList ) { { for( unsigned ii = 0; ii < aKiPolyList.size(); ii++ ) for( unsigned ii = 0; ii < aKiPolyList.size(); ii++ ) { { Loading @@ -64,14 +64,15 @@ void CopyPolygonsFromKiPolygonListToPolysList( KI_POLYGON_SET& aKiPolyList, } } } } /** /** * Helper function AddPolygonCornersToKiPolygonList * Helper function AddPolygonCornersToKiPolygonList * This function adds a KI_POLYGON_SET description to a * This function adds a KI_POLYGON_SET description to a * std::vector<CPolyPt> description * CPOLYGONS_LIST description * @param aCornersBuffer = source (set of polygons using CPolyPt corners descr) * @param aCornersBuffer = source (set of polygons using CPolyPt corners descr) * @param aPolysList = destination (set of polygons) * @param aPolysList = destination (set of polygons) */ */ void AddPolygonCornersToKiPolygonList( std::vector <CPolyPt>& aCornersBuffer, void AddPolygonCornersToKiPolygonList( CPOLYGONS_LIST& aCornersBuffer, KI_POLYGON_SET& aKiPolyList ) KI_POLYGON_SET& aKiPolyList ) { { std::vector<KI_POLY_POINT> cornerslist; std::vector<KI_POLY_POINT> cornerslist; Loading @@ -79,6 +80,7 @@ void AddPolygonCornersToKiPolygonList( std::vector <CPolyPt>& aCornersBuffer, // Count the number of polygons in aCornersBuffer // Count the number of polygons in aCornersBuffer int polycount = 0; int polycount = 0; for( unsigned ii = 0; ii < corners_count; ii++ ) for( unsigned ii = 0; ii < corners_count; ii++ ) { { if( aCornersBuffer[ii].end_contour ) if( aCornersBuffer[ii].end_contour ) Loading @@ -93,6 +95,7 @@ void AddPolygonCornersToKiPolygonList( std::vector <CPolyPt>& aCornersBuffer, cornerslist.clear(); cornerslist.clear(); unsigned ii; unsigned ii; for( ii = icnt; ii < aCornersBuffer.size(); ii++ ) for( ii = icnt; ii < aCornersBuffer.size(); ii++ ) { { cornerslist.push_back( KI_POLY_POINT( aCornersBuffer[ii].x, aCornersBuffer[ii].y ) ); cornerslist.push_back( KI_POLY_POINT( aCornersBuffer[ii].x, aCornersBuffer[ii].y ) ); Loading @@ -118,7 +121,7 @@ void AddPolygonCornersToKiPolygonList( std::vector <CPolyPt>& aCornersBuffer, * Note: the polygon is inside the circle, so if you want to have the polygon * Note: the polygon is inside the circle, so if you want to have the polygon * outside the circle, you should give aRadius calculated with a corrrection factor * outside the circle, you should give aRadius calculated with a corrrection factor */ */ void TransformCircleToPolygon( std::vector <CPolyPt>& aCornerBuffer, void TransformCircleToPolygon( CPOLYGONS_LIST& aCornerBuffer, wxPoint aCenter, int aRadius, wxPoint aCenter, int aRadius, int aCircleToSegmentsCount ) int aCircleToSegmentsCount ) { { Loading Loading @@ -153,7 +156,7 @@ void TransformCircleToPolygon( std::vector <CPolyPt>& aCornerBuffer, * Note: the polygon is inside the arc ends, so if you want to have the polygon * Note: the polygon is inside the arc ends, so if you want to have the polygon * outside the circle, you should give aStart and aEnd calculated with a correction factor * outside the circle, you should give aStart and aEnd calculated with a correction factor */ */ void TransformRoundedEndsSegmentToPolygon( std::vector <CPolyPt>& aCornerBuffer, void TransformRoundedEndsSegmentToPolygon( CPOLYGONS_LIST& aCornerBuffer, wxPoint aStart, wxPoint aEnd, wxPoint aStart, wxPoint aEnd, int aCircleToSegmentsCount, int aCircleToSegmentsCount, int aWidth ) int aWidth ) Loading Loading @@ -233,7 +236,7 @@ void TransformRoundedEndsSegmentToPolygon( std::vector <CPolyPt>& aCornerBuffer, * @param aCircleToSegmentsCount = the number of segments to approximate a circle * @param aCircleToSegmentsCount = the number of segments to approximate a circle * @param aWidth = width (thickness) of the line * @param aWidth = width (thickness) of the line */ */ void TransformArcToPolygon( std::vector <CPolyPt>& aCornerBuffer, void TransformArcToPolygon( CPOLYGONS_LIST& aCornerBuffer, wxPoint aCentre, wxPoint aStart, int aArcAngle, wxPoint aCentre, wxPoint aStart, int aArcAngle, int aCircleToSegmentsCount, int aWidth ) int aCircleToSegmentsCount, int aWidth ) { { Loading Loading @@ -272,6 +275,7 @@ void TransformArcToPolygon( std::vector <CPolyPt>& aCornerBuffer, aCircleToSegmentsCount, aWidth ); aCircleToSegmentsCount, aWidth ); } } /** /** * Function TransformRingToPolygon * Function TransformRingToPolygon * Creates a polygon from a ring * Creates a polygon from a ring Loading @@ -282,7 +286,7 @@ void TransformArcToPolygon( std::vector <CPolyPt>& aCornerBuffer, * @param aCircleToSegmentsCount = the number of segments to approximate a circle * @param aCircleToSegmentsCount = the number of segments to approximate a circle * @param aWidth = width (thickness) of the ring * @param aWidth = width (thickness) of the ring */ */ void TransformRingToPolygon( std::vector <CPolyPt>& aCornerBuffer, void TransformRingToPolygon( CPOLYGONS_LIST& aCornerBuffer, wxPoint aCentre, int aRadius, wxPoint aCentre, int aRadius, int aCircleToSegmentsCount, int aWidth ) int aCircleToSegmentsCount, int aWidth ) { { Loading Loading
3d-viewer/3d_canvas.h +1 −12 Original line number Original line Diff line number Diff line Loading @@ -30,15 +30,8 @@ #ifndef _3D_CANVAS_H_ #ifndef _3D_CANVAS_H_ #define _3D_CANVAS_H_ #define _3D_CANVAS_H_ #include <wxBasePcbFrame.h> // for m_auimanager member. #include <layers_id_colors_and_visibility.h> // Layers id definitions #include <PolyLine.h> // for CPolyPt #if !wxUSE_GLCANVAS #error Please set wxUSE_GLCANVAS to 1 in setup.h. #endif #include <wx/glcanvas.h> #include <wx/glcanvas.h> #include <wxBasePcbFrame.h> // for m_auimanager member. #ifdef __WXMAC__ #ifdef __WXMAC__ # ifdef __DARWIN__ # ifdef __DARWIN__ Loading @@ -53,10 +46,6 @@ #include <3d_struct.h> #include <3d_struct.h> class BOARD_DESIGN_SETTINGS; class BOARD_DESIGN_SETTINGS; class TRACK; class TEXTE_PCB; class DRAWSEGMENT; class ZONE_CONTAINER; class EDA_3D_FRAME; class EDA_3D_FRAME; class S3D_VERTEX; class S3D_VERTEX; class SEGVIA; class SEGVIA; Loading
3d-viewer/3d_draw.cpp +198 −169 Original line number Original line Diff line number Diff line Loading @@ -70,7 +70,7 @@ static GLfloat Get3DLayer_Z_Orientation( LAYER_NUM aLayer ); * Used only to draw pads outlines on silkscreen layers. * Used only to draw pads outlines on silkscreen layers. */ */ static void BuildPadShapeThickOutlineAsPolygon( D_PAD* aPad, static void BuildPadShapeThickOutlineAsPolygon( D_PAD* aPad, std::vector <CPolyPt>& aCornerBuffer, CPOLYGONS_LIST& aCornerBuffer, int aWidth, int aWidth, int aCircleToSegmentsCount, int aCircleToSegmentsCount, double aCorrectionFactor ) double aCorrectionFactor ) Loading @@ -83,7 +83,7 @@ static void BuildPadShapeThickOutlineAsPolygon( D_PAD * aPad, } } // For other shapes, draw polygon outlines // For other shapes, draw polygon outlines std::vector <CPolyPt> corners; CPOLYGONS_LIST corners; aPad->BuildPadShapePolygon( corners, wxSize( 0, 0 ), aPad->BuildPadShapePolygon( corners, wxSize( 0, 0 ), aCircleToSegmentsCount, aCorrectionFactor ); aCircleToSegmentsCount, aCorrectionFactor ); Loading @@ -97,6 +97,7 @@ static void BuildPadShapeThickOutlineAsPolygon( D_PAD * aPad, } } } } void EDA_3D_CANVAS::Redraw( bool finish ) void EDA_3D_CANVAS::Redraw( bool finish ) { { // SwapBuffer requires the window to be shown before calling // SwapBuffer requires the window to be shown before calling Loading Loading @@ -145,6 +146,7 @@ void EDA_3D_CANVAS::Redraw( bool finish ) SwapBuffers(); SwapBuffers(); } } void EDA_3D_CANVAS::BuildBoard3DView() void EDA_3D_CANVAS::BuildBoard3DView() { { PCB_BASE_FRAME* pcbframe = Parent()->Parent(); PCB_BASE_FRAME* pcbframe = Parent()->Parent(); Loading @@ -158,12 +160,13 @@ void EDA_3D_CANVAS::BuildBoard3DView() // for holes and items which do not need // for holes and items which do not need // a fine representation // a fine representation double correctionFactorLQ = 1.0 / cos( M_PI / (segcountLowQuality * 2) ); double correctionFactorLQ = 1.0 / cos( M_PI / (segcountLowQuality * 2) ); std::vector <CPolyPt> bufferPolys; CPOLYGONS_LIST bufferPolys; bufferPolys.reserve( 200000 ); // Reserve for large board (tracks mainly) bufferPolys.reserve( 200000 ); // Reserve for large board (tracks mainly) std::vector <CPolyPt> bufferZonesPolys; CPOLYGONS_LIST bufferZonesPolys; bufferPolys.reserve( 500000 ); // Reserve for large board ( copper zones mainly ) bufferPolys.reserve( 500000 ); // Reserve for large board ( copper zones mainly ) std::vector <CPolyPt> currLayerHoles; // Contains holes for the current layer CPOLYGONS_LIST currLayerHoles; // Contains holes for the current layer std::vector <CPolyPt> allLayerHoles; // Contains through holes, calculated only once CPOLYGONS_LIST allLayerHoles; // Contains through holes, calculated only once allLayerHoles.reserve( 20000 ); allLayerHoles.reserve( 20000 ); bool throughHolesListBuilt = false; // flag to build the through hole polygon list only once bool throughHolesListBuilt = false; // flag to build the through hole polygon list only once bool hightQualityMode = false; bool hightQualityMode = false; Loading @@ -171,13 +174,13 @@ void EDA_3D_CANVAS::BuildBoard3DView() for( LAYER_NUM layer = FIRST_COPPER_LAYER; layer <= LAST_COPPER_LAYER; for( LAYER_NUM layer = FIRST_COPPER_LAYER; layer <= LAST_COPPER_LAYER; layer++ ) layer++ ) { { if( layer != LAST_COPPER_LAYER if( layer != LAST_COPPER_LAYER && && layer >= g_Parm_3D_Visu.m_CopperLayersCount ) layer >= g_Parm_3D_Visu.m_CopperLayersCount ) continue; continue; if( !g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) ) if( !g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) ) continue; continue; bufferPolys.clear(); bufferPolys.clear(); bufferZonesPolys.clear(); bufferZonesPolys.clear(); currLayerHoles.clear(); currLayerHoles.clear(); Loading @@ -199,6 +202,7 @@ void EDA_3D_CANVAS::BuildBoard3DView() int holediameter = track->GetDrillValue(); int holediameter = track->GetDrillValue(); int thickness = g_Parm_3D_Visu.GetCopperThicknessBIU(); int thickness = g_Parm_3D_Visu.GetCopperThicknessBIU(); int hole_outer_radius = (holediameter + thickness) / 2; int hole_outer_radius = (holediameter + thickness) / 2; if( shape != VIA_THROUGH ) if( shape != VIA_THROUGH ) TransformCircleToPolygon( currLayerHoles, TransformCircleToPolygon( currLayerHoles, track->GetStart(), hole_outer_radius, track->GetStart(), hole_outer_radius, Loading @@ -214,16 +218,23 @@ void EDA_3D_CANVAS::BuildBoard3DView() for( MODULE* module = pcb->m_Modules; module != NULL; module = module->Next() ) for( MODULE* module = pcb->m_Modules; module != NULL; module = module->Next() ) { { module->TransformPadsShapesWithClearanceToPolygon( layer, module->TransformPadsShapesWithClearanceToPolygon( layer, bufferPolys, 0, segcountforcircle, correctionFactor ); bufferPolys, 0, segcountforcircle, correctionFactor ); // Micro-wave modukes may have items on copper layers // Micro-wave modukes may have items on copper layers module->TransformGraphicShapesWithClearanceToPolygonSet( layer, module->TransformGraphicShapesWithClearanceToPolygonSet( layer, bufferPolys, 0, segcountforcircle, correctionFactor ); bufferPolys, 0, segcountforcircle, correctionFactor ); // Add pad hole, if any // Add pad hole, if any if( !throughHolesListBuilt ) if( !throughHolesListBuilt ) { { D_PAD* pad = module->Pads(); D_PAD* pad = module->Pads(); for( ; pad != NULL; pad = pad->Next() ) for( ; pad != NULL; pad = pad->Next() ) pad->BuildPadDrillShapePolygon( allLayerHoles, 0, pad->BuildPadDrillShapePolygon( allLayerHoles, 0, segcountLowQuality ); segcountLowQuality ); Loading Loading @@ -283,6 +294,7 @@ void EDA_3D_CANVAS::BuildBoard3DView() // Add holes in polygon list // Add holes in polygon list currLayerHoles.insert( currLayerHoles.begin(), currLayerHoles.insert( currLayerHoles.begin(), allLayerHoles.begin(), allLayerHoles.end() ); allLayerHoles.begin(), allLayerHoles.end() ); if( currLayerHoles.size() > 0 ) if( currLayerHoles.size() > 0 ) AddPolygonCornersToKiPolygonList( currLayerHoles, polysetHoles ); AddPolygonCornersToKiPolygonList( currLayerHoles, polysetHoles ); Loading @@ -301,6 +313,7 @@ void EDA_3D_CANVAS::BuildBoard3DView() Draw3D_SolidHorizontalPolyPolygons( bufferPolys, zpos, Draw3D_SolidHorizontalPolyPolygons( bufferPolys, zpos, thickness, thickness, g_Parm_3D_Visu.m_BiuTo3Dunits ); g_Parm_3D_Visu.m_BiuTo3Dunits ); if( bufferZonesPolys.size() ) if( bufferZonesPolys.size() ) Draw3D_SolidHorizontalPolyPolygons( bufferZonesPolys, zpos, Draw3D_SolidHorizontalPolyPolygons( bufferZonesPolys, zpos, thickness, thickness, Loading @@ -315,6 +328,7 @@ void EDA_3D_CANVAS::BuildBoard3DView() if( track->Type() == PCB_VIA_T ) if( track->Type() == PCB_VIA_T ) Draw3DViaHole( (SEGVIA*) track ); Draw3DViaHole( (SEGVIA*) track ); } } // Draw pads holes (vertical cylinders) // Draw pads holes (vertical cylinders) for( MODULE* module = pcb->m_Modules; module != NULL; module = module->Next() ) for( MODULE* module = pcb->m_Modules; module != NULL; module = module->Next() ) { { Loading @@ -333,6 +347,7 @@ void EDA_3D_CANVAS::BuildBoard3DView() continue; continue; bufferPolys.clear(); bufferPolys.clear(); for( BOARD_ITEM* item = pcb->m_Drawings; item; item = item->Next() ) for( BOARD_ITEM* item = pcb->m_Drawings; item; item = item->Next() ) { { if( !item->IsOnLayer( layer ) ) if( !item->IsOnLayer( layer ) ) Loading Loading @@ -368,6 +383,7 @@ void EDA_3D_CANVAS::BuildBoard3DView() { { if( !pad->IsOnLayer( layer ) ) if( !pad->IsOnLayer( layer ) ) continue; continue; BuildPadShapeThickOutlineAsPolygon( pad, bufferPolys, BuildPadShapeThickOutlineAsPolygon( pad, bufferPolys, linewidth, linewidth, segcountforcircle, correctionFactor ); segcountforcircle, correctionFactor ); Loading @@ -375,10 +391,16 @@ void EDA_3D_CANVAS::BuildBoard3DView() } } else else module->TransformPadsShapesWithClearanceToPolygon( layer, module->TransformPadsShapesWithClearanceToPolygon( layer, bufferPolys, 0, segcountforcircle, correctionFactor ); bufferPolys, 0, segcountforcircle, correctionFactor ); module->TransformGraphicShapesWithClearanceToPolygonSet( layer, module->TransformGraphicShapesWithClearanceToPolygonSet( layer, bufferPolys, 0, segcountforcircle, correctionFactor ); bufferPolys, 0, segcountforcircle, correctionFactor ); } } // bufferPolys contains polygons to merge. Many overlaps . // bufferPolys contains polygons to merge. Many overlaps . Loading @@ -395,6 +417,7 @@ void EDA_3D_CANVAS::BuildBoard3DView() EDA_COLOR_T color = g_ColorsSettings.GetLayerColor( layer ); EDA_COLOR_T color = g_ColorsSettings.GetLayerColor( layer ); int thickness = g_Parm_3D_Visu.GetLayerObjectThicknessBIU( layer ); int thickness = g_Parm_3D_Visu.GetLayerObjectThicknessBIU( layer ); int zpos = g_Parm_3D_Visu.GetLayerZcoordBIU( layer ); int zpos = g_Parm_3D_Visu.GetLayerZcoordBIU( layer ); if( layer == EDGE_N ) if( layer == EDGE_N ) { { thickness = g_Parm_3D_Visu.GetLayerZcoordBIU( LAYER_N_FRONT ) thickness = g_Parm_3D_Visu.GetLayerZcoordBIU( LAYER_N_FRONT ) Loading @@ -417,6 +440,7 @@ void EDA_3D_CANVAS::BuildBoard3DView() module->ReadAndInsert3DComponentShape( this ); module->ReadAndInsert3DComponentShape( this ); } } GLuint EDA_3D_CANVAS::CreateDrawGL_List() GLuint EDA_3D_CANVAS::CreateDrawGL_List() { { PCB_BASE_FRAME* pcbframe = Parent()->Parent(); PCB_BASE_FRAME* pcbframe = Parent()->Parent(); Loading Loading @@ -543,6 +567,7 @@ void EDA_3D_CANVAS::DrawGrid( double aGriSizeMM ) glVertex3f( xmin, -(brd_center_pos.y + delta) * scale, zpos ); glVertex3f( xmin, -(brd_center_pos.y + delta) * scale, zpos ); glVertex3f( xmax, -(brd_center_pos.y + delta) * scale, zpos ); glVertex3f( xmax, -(brd_center_pos.y + delta) * scale, zpos ); glEnd(); glEnd(); if( ii != 0 ) if( ii != 0 ) { { glBegin( GL_LINES ); glBegin( GL_LINES ); Loading Loading @@ -597,7 +622,8 @@ void EDA_3D_CANVAS::DrawGrid( double aGriSizeMM ) double delta = ii * aGriSizeMM * IU_PER_MM * scale; double delta = ii * aGriSizeMM * IU_PER_MM * scale; if( delta <= zmax ) if( delta <= zmax ) { // Draw grid lines on Z axis (positive Z axis coordinates) { // Draw grid lines on Z axis (positive Z axis coordinates) glBegin( GL_LINES ); glBegin( GL_LINES ); glVertex3f( xmin, -brd_center_pos.y * scale, delta ); glVertex3f( xmin, -brd_center_pos.y * scale, delta ); glVertex3f( xmax, -brd_center_pos.y * scale, delta ); glVertex3f( xmax, -brd_center_pos.y * scale, delta ); Loading @@ -605,7 +631,8 @@ void EDA_3D_CANVAS::DrawGrid( double aGriSizeMM ) } } if( delta <= -zmin && ( ii != 0 ) ) if( delta <= -zmin && ( ii != 0 ) ) { // Draw grid lines on Z axis (negative Z axis coordinates) { // Draw grid lines on Z axis (negative Z axis coordinates) glBegin( GL_LINES ); glBegin( GL_LINES ); glVertex3f( xmin, -brd_center_pos.y * scale, -delta ); glVertex3f( xmin, -brd_center_pos.y * scale, -delta ); glVertex3f( xmax, -brd_center_pos.y * scale, -delta ); glVertex3f( xmax, -brd_center_pos.y * scale, -delta ); Loading @@ -617,6 +644,7 @@ void EDA_3D_CANVAS::DrawGrid( double aGriSizeMM ) } } } } void EDA_3D_CANVAS::Draw3DViaHole( SEGVIA* aVia ) void EDA_3D_CANVAS::Draw3DViaHole( SEGVIA* aVia ) { { LAYER_NUM top_layer, bottom_layer; LAYER_NUM top_layer, bottom_layer; Loading Loading @@ -688,7 +716,7 @@ void EDA_3D_CANVAS::Draw3DPadHole( D_PAD * aPad ) return; return; // Store here the points to approximate hole by segments // Store here the points to approximate hole by segments std::vector <CPolyPt> holecornersBuffer; CPOLYGONS_LIST holecornersBuffer; int thickness = g_Parm_3D_Visu.GetCopperThicknessBIU(); int thickness = g_Parm_3D_Visu.GetCopperThicknessBIU(); int height = g_Parm_3D_Visu.GetLayerZcoordBIU( LAYER_N_FRONT ) - int height = g_Parm_3D_Visu.GetLayerZcoordBIU( LAYER_N_FRONT ) - g_Parm_3D_Visu.GetLayerZcoordBIU( LAYER_N_BACK ); g_Parm_3D_Visu.GetLayerZcoordBIU( LAYER_N_BACK ); Loading Loading @@ -731,6 +759,7 @@ void EDA_3D_CANVAS::Draw3DPadHole( D_PAD * aPad ) } } } } bool Is3DLayerEnabled( LAYER_NUM aLayer ) bool Is3DLayerEnabled( LAYER_NUM aLayer ) { { int flg; int flg; Loading
3d-viewer/3d_draw_basic_functions.h +2 −2 Original line number Original line Diff line number Diff line Loading @@ -41,7 +41,7 @@ * The top side is located at aZpos + aThickness / 2 * The top side is located at aZpos + aThickness / 2 * The bottom side is located at aZpos - aThickness / 2 * The bottom side is located at aZpos - aThickness / 2 */ */ void Draw3D_SolidHorizontalPolyPolygons( const std::vector<CPolyPt>& aPolysList, void Draw3D_SolidHorizontalPolyPolygons( const CPOLYGONS_LIST& aPolysList, int aZpos, int aThickness, double aBiuTo3DUnits ); int aZpos, int aThickness, double aBiuTo3DUnits ); /** draw the solid polygon found in aPolysList /** draw the solid polygon found in aPolysList Loading @@ -55,7 +55,7 @@ void Draw3D_SolidHorizontalPolyPolygons( const std::vector<CPolyPt>& aPolysLi * The top side is located at aZpos + aThickness / 2 * The top side is located at aZpos + aThickness / 2 * The bottom side is located at aZpos - aThickness / 2 * The bottom side is located at aZpos - aThickness / 2 */ */ void Draw3D_SolidHorizontalPolygonWithHoles( const std::vector<CPolyPt>& aPolysList, void Draw3D_SolidHorizontalPolygonWithHoles( const CPOLYGONS_LIST& aPolysList, int aZpos, int aThickness, double aBiuTo3DUnits ); int aZpos, int aThickness, double aBiuTo3DUnits ); /** draw a thick segment using 3D primitives, in a XY plane /** draw a thick segment using 3D primitives, in a XY plane Loading
3d-viewer/3d_viewer.h +0 −2 Original line number Original line Diff line number Diff line Loading @@ -31,8 +31,6 @@ #define __3D_VIEWER_H__ #define __3D_VIEWER_H__ #include <wxBasePcbFrame.h> // for m_auimanager member. #include <wxBasePcbFrame.h> // for m_auimanager member. #include <layers_id_colors_and_visibility.h> // Layers id definitions #include <PolyLine.h> // fot CPolyPt #if !wxUSE_GLCANVAS #if !wxUSE_GLCANVAS #error Please set wxUSE_GLCANVAS to 1 in setup.h. #error Please set wxUSE_GLCANVAS to 1 in setup.h. Loading
common/convert_basic_shapes_to_polygon.cpp +56 −52 Original line number Original line Diff line number Diff line Loading @@ -36,13 +36,13 @@ * We are using a lots polygons in calculations. * We are using a lots polygons in calculations. * and we are using 2 descriptions, * and we are using 2 descriptions, * one easy to use with boost::polygon (KI_POLYGON_SET) * one easy to use with boost::polygon (KI_POLYGON_SET) * one easy to use in zones and in draw functions (std::vector<CPolyPt>) * one easy to use in zones and in draw functions (CPOLYGONS_LIST) * Copy polygons from a KI_POLYGON_SET set of polygons to * Copy polygons from a KI_POLYGON_SET set of polygons to * a std::vector<CPolyPt> polygon list * a CPOLYGONS_LIST polygon list * Therefore we need conversion functions between these 2 descriptions * Therefore we need conversion functions between these 2 descriptions */ */ void CopyPolygonsFromKiPolygonListToPolysList( KI_POLYGON_SET& aKiPolyList, void CopyPolygonsFromKiPolygonListToPolysList( KI_POLYGON_SET& aKiPolyList, std::vector<CPolyPt>& aPolysList ) CPOLYGONS_LIST& aPolysList ) { { for( unsigned ii = 0; ii < aKiPolyList.size(); ii++ ) for( unsigned ii = 0; ii < aKiPolyList.size(); ii++ ) { { Loading @@ -64,14 +64,15 @@ void CopyPolygonsFromKiPolygonListToPolysList( KI_POLYGON_SET& aKiPolyList, } } } } /** /** * Helper function AddPolygonCornersToKiPolygonList * Helper function AddPolygonCornersToKiPolygonList * This function adds a KI_POLYGON_SET description to a * This function adds a KI_POLYGON_SET description to a * std::vector<CPolyPt> description * CPOLYGONS_LIST description * @param aCornersBuffer = source (set of polygons using CPolyPt corners descr) * @param aCornersBuffer = source (set of polygons using CPolyPt corners descr) * @param aPolysList = destination (set of polygons) * @param aPolysList = destination (set of polygons) */ */ void AddPolygonCornersToKiPolygonList( std::vector <CPolyPt>& aCornersBuffer, void AddPolygonCornersToKiPolygonList( CPOLYGONS_LIST& aCornersBuffer, KI_POLYGON_SET& aKiPolyList ) KI_POLYGON_SET& aKiPolyList ) { { std::vector<KI_POLY_POINT> cornerslist; std::vector<KI_POLY_POINT> cornerslist; Loading @@ -79,6 +80,7 @@ void AddPolygonCornersToKiPolygonList( std::vector <CPolyPt>& aCornersBuffer, // Count the number of polygons in aCornersBuffer // Count the number of polygons in aCornersBuffer int polycount = 0; int polycount = 0; for( unsigned ii = 0; ii < corners_count; ii++ ) for( unsigned ii = 0; ii < corners_count; ii++ ) { { if( aCornersBuffer[ii].end_contour ) if( aCornersBuffer[ii].end_contour ) Loading @@ -93,6 +95,7 @@ void AddPolygonCornersToKiPolygonList( std::vector <CPolyPt>& aCornersBuffer, cornerslist.clear(); cornerslist.clear(); unsigned ii; unsigned ii; for( ii = icnt; ii < aCornersBuffer.size(); ii++ ) for( ii = icnt; ii < aCornersBuffer.size(); ii++ ) { { cornerslist.push_back( KI_POLY_POINT( aCornersBuffer[ii].x, aCornersBuffer[ii].y ) ); cornerslist.push_back( KI_POLY_POINT( aCornersBuffer[ii].x, aCornersBuffer[ii].y ) ); Loading @@ -118,7 +121,7 @@ void AddPolygonCornersToKiPolygonList( std::vector <CPolyPt>& aCornersBuffer, * Note: the polygon is inside the circle, so if you want to have the polygon * Note: the polygon is inside the circle, so if you want to have the polygon * outside the circle, you should give aRadius calculated with a corrrection factor * outside the circle, you should give aRadius calculated with a corrrection factor */ */ void TransformCircleToPolygon( std::vector <CPolyPt>& aCornerBuffer, void TransformCircleToPolygon( CPOLYGONS_LIST& aCornerBuffer, wxPoint aCenter, int aRadius, wxPoint aCenter, int aRadius, int aCircleToSegmentsCount ) int aCircleToSegmentsCount ) { { Loading Loading @@ -153,7 +156,7 @@ void TransformCircleToPolygon( std::vector <CPolyPt>& aCornerBuffer, * Note: the polygon is inside the arc ends, so if you want to have the polygon * Note: the polygon is inside the arc ends, so if you want to have the polygon * outside the circle, you should give aStart and aEnd calculated with a correction factor * outside the circle, you should give aStart and aEnd calculated with a correction factor */ */ void TransformRoundedEndsSegmentToPolygon( std::vector <CPolyPt>& aCornerBuffer, void TransformRoundedEndsSegmentToPolygon( CPOLYGONS_LIST& aCornerBuffer, wxPoint aStart, wxPoint aEnd, wxPoint aStart, wxPoint aEnd, int aCircleToSegmentsCount, int aCircleToSegmentsCount, int aWidth ) int aWidth ) Loading Loading @@ -233,7 +236,7 @@ void TransformRoundedEndsSegmentToPolygon( std::vector <CPolyPt>& aCornerBuffer, * @param aCircleToSegmentsCount = the number of segments to approximate a circle * @param aCircleToSegmentsCount = the number of segments to approximate a circle * @param aWidth = width (thickness) of the line * @param aWidth = width (thickness) of the line */ */ void TransformArcToPolygon( std::vector <CPolyPt>& aCornerBuffer, void TransformArcToPolygon( CPOLYGONS_LIST& aCornerBuffer, wxPoint aCentre, wxPoint aStart, int aArcAngle, wxPoint aCentre, wxPoint aStart, int aArcAngle, int aCircleToSegmentsCount, int aWidth ) int aCircleToSegmentsCount, int aWidth ) { { Loading Loading @@ -272,6 +275,7 @@ void TransformArcToPolygon( std::vector <CPolyPt>& aCornerBuffer, aCircleToSegmentsCount, aWidth ); aCircleToSegmentsCount, aWidth ); } } /** /** * Function TransformRingToPolygon * Function TransformRingToPolygon * Creates a polygon from a ring * Creates a polygon from a ring Loading @@ -282,7 +286,7 @@ void TransformArcToPolygon( std::vector <CPolyPt>& aCornerBuffer, * @param aCircleToSegmentsCount = the number of segments to approximate a circle * @param aCircleToSegmentsCount = the number of segments to approximate a circle * @param aWidth = width (thickness) of the ring * @param aWidth = width (thickness) of the ring */ */ void TransformRingToPolygon( std::vector <CPolyPt>& aCornerBuffer, void TransformRingToPolygon( CPOLYGONS_LIST& aCornerBuffer, wxPoint aCentre, int aRadius, wxPoint aCentre, int aRadius, int aCircleToSegmentsCount, int aWidth ) int aCircleToSegmentsCount, int aWidth ) { { Loading