Commit 56f44e2f authored by Brian Sidebotham's avatar Brian Sidebotham

* Merge in changes from TIP

parents dbd4ba84 76436943
......@@ -28,6 +28,7 @@ version.h
config.h
install_manifest.txt
Documentation/doxygen
Documentation/development/doxygen
*.bak
common/pcb_plot_params_keywords.cpp
include/pcb_plot_params_lexer.h
......
......@@ -45,16 +45,11 @@
#include <info3d_visu.h>
#include <trackball.h>
// Exported function:
void Set_Object_Data( std::vector< S3D_VERTEX >& aVertices, double aBiuTo3DUnits );
void S3D_MASTER::Set_Object_Coords( std::vector< S3D_VERTEX >& aVertices )
void S3D_MASTER::ObjectCoordsTo3DUnits( std::vector< S3D_VERTEX >& aVertices )
{
unsigned ii;
/* adjust object scale, rotation and offset position */
for( ii = 0; ii < aVertices.size(); ii++ )
for( unsigned ii = 0; ii < aVertices.size(); ii++ )
{
aVertices[ii].x *= m_MatScale.x;
aVertices[ii].y *= m_MatScale.y;
......@@ -62,13 +57,31 @@ void S3D_MASTER::Set_Object_Coords( std::vector< S3D_VERTEX >& aVertices )
// adjust rotation
if( m_MatRotation.x )
RotatePoint( &aVertices[ii].y, &aVertices[ii].z, m_MatRotation.x * 10 );
{
double a = aVertices[ii].y;
double b = aVertices[ii].z;
RotatePoint( &a, &b, m_MatRotation.x * 10 );
aVertices[ii].y = (float)a;
aVertices[ii].z = (float)b;
}
if( m_MatRotation.y )
RotatePoint( &aVertices[ii].z, &aVertices[ii].x, m_MatRotation.y * 10 );
{
double a = aVertices[ii].z;
double b = aVertices[ii].x;
RotatePoint( &a, &b, m_MatRotation.x * 10 );
aVertices[ii].z = (float)a;
aVertices[ii].x = (float)b;
}
if( m_MatRotation.z )
RotatePoint( &aVertices[ii].x, &aVertices[ii].y, m_MatRotation.z * 10 );
{
double a = aVertices[ii].x;
double b = aVertices[ii].y;
RotatePoint( &a, &b, m_MatRotation.x * 10 );
aVertices[ii].x = (float)a;
aVertices[ii].y = (float)b;
}
/* adjust offset position (offset is given in UNIT 3D (0.1 inch) */
#define SCALE_3D_CONV ((IU_PER_MILS * 1000) / UNITS3D_TO_UNITSPCB)
......@@ -79,7 +92,7 @@ void S3D_MASTER::Set_Object_Coords( std::vector< S3D_VERTEX >& aVertices )
}
void Set_Object_Data( std::vector< S3D_VERTEX >& aVertices, double aBiuTo3DUnits )
void TransfertToGLlist( std::vector< S3D_VERTEX >& aVertices, double aBiuTo3DUnits )
{
unsigned ii;
GLfloat ax, ay, az, bx, by, bz, nx, ny, nz, r;
......@@ -138,52 +151,14 @@ void Set_Object_Data( std::vector< S3D_VERTEX >& aVertices, double aBiuTo3DUnits
glEnd();
}
GLuint EDA_3D_CANVAS::DisplayCubeforTest()
{
GLuint gllist = glGenLists( 1 );
glNewList( gllist, GL_COMPILE_AND_EXECUTE );
/* draw six faces of a cube */
glBegin( GL_QUADS );
glNormal3f( 0.0F, 0.0F, 1.0F );
glVertex3f( 0.5F, 0.5F, 0.5F ); glVertex3f( -0.5F, 0.5F, 0.5F );
glVertex3f( -0.5F, -0.5F, 0.5F ); glVertex3f( 0.5F, -0.5F, 0.5F );
glNormal3f( 0.0F, 0.0F, -1.0F );
glVertex3f( -0.5F, -0.5F, -0.5F ); glVertex3f( -0.5F, 0.5F, -0.5F );
glVertex3f( 0.5F, 0.5F, -0.5F ); glVertex3f( 0.5F, -0.5F, -0.5F );
glNormal3f( 0.0F, 1.0F, 0.0F );
glVertex3f( 0.5F, 0.5F, 0.5F ); glVertex3f( 0.5F, 0.5F, -0.5F );
glVertex3f( -0.5F, 0.5F, -0.5F ); glVertex3f( -0.5F, 0.5F, 0.5F );
glNormal3f( 0.0F, -1.0F, 0.0F );
glVertex3f( -0.5F, -0.5F, -0.5F ); glVertex3f( 0.5F, -0.5F, -0.5F );
glVertex3f( 0.5F, -0.5F, 0.5F ); glVertex3f( -0.5F, -0.5F, 0.5F );
glNormal3f( 1.0F, 0.0F, 0.0F );
glVertex3f( 0.5F, 0.5F, 0.5F ); glVertex3f( 0.5F, -0.5F, 0.5F );
glVertex3f( 0.5F, -0.5F, -0.5F ); glVertex3f( 0.5F, 0.5F, -0.5F );
glNormal3f( -1.0F, 0.0F, 0.0F );
glVertex3f( -0.5F, -0.5F, -0.5F ); glVertex3f( -0.5F, -0.5F, 0.5F );
glVertex3f( -0.5F, 0.5F, 0.5F ); glVertex3f( -0.5F, 0.5F, -0.5F );
glEnd();
glEndList();
return gllist;
}
VERTEX_VALUE_CTRL::VERTEX_VALUE_CTRL( wxWindow* aParent, wxBoxSizer* aBoxSizer )
{
wxString text;
wxFlexGridSizer* gridSizer = new wxFlexGridSizer( 0, 2, 0, 0 );
gridSizer->AddGrowableCol( 1 );
gridSizer->SetFlexibleDirection( wxHORIZONTAL );
gridSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
gridSizer->AddGrowableCol( 1 );
gridSizer->SetFlexibleDirection( wxHORIZONTAL );
gridSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
aBoxSizer->Add( gridSizer, 0, wxEXPAND, 5 );
......
......@@ -16,17 +16,23 @@
#include <gestfich.h>
#ifdef __WINDOWS__
#include <GL/glew.h> // must be included before gl.h
#endif
#include <3d_viewer.h>
#include <3d_canvas.h>
#include <info3d_visu.h>
#include <trackball.h>
#include <3d_viewer_id.h>
#include <textures/text_silk.c>
#include <textures/text_pcb.c>
// -----------------
// helper function (from wxWidgets, opengl/cube.cpp sample
// -----------------
void CheckGLError()
void CheckGLError(const char *aFileName, int aLineNumber)
{
GLenum errLast = GL_NO_ERROR;
......@@ -46,8 +52,8 @@ void CheckGLError()
}
errLast = err;
wxLogError(wxT("OpenGL error %d"), err);
wxLogError( wxT( "OpenGL error %d At: %s, line: %d" ), err, GetChars( FROM_UTF8( aFileName ) ), aLineNumber );
}
}
......@@ -78,7 +84,12 @@ EDA_3D_CANVAS::EDA_3D_CANVAS( EDA_3D_FRAME* parent, int* attribList ) :
wxFULL_REPAINT_ON_RESIZE )
{
m_init = false;
m_gllist = 0;
m_shadow_init = false;
// Clear all gl list identifiers:
for( int ii = GL_ID_BEGIN; ii < GL_ID_END; ii++ )
m_glLists[ii] = 0;
// Explicitly create a new rendering context instance for this canvas.
m_glRC = new wxGLContext( this );
......@@ -94,12 +105,25 @@ EDA_3D_CANVAS::~EDA_3D_CANVAS()
}
void EDA_3D_CANVAS::ClearLists()
void EDA_3D_CANVAS::ClearLists( int aGlList )
{
if( m_gllist > 0 )
glDeleteLists( m_gllist, 1 );
if( aGlList )
{
if( m_glLists[aGlList] > 0 )
glDeleteLists( m_glLists[aGlList], 1 );
m_glLists[aGlList] = 0;
return;
}
for( int ii = GL_ID_BEGIN; ii < GL_ID_END; ii++ )
{
if( m_glLists[ii] > 0 )
glDeleteLists( m_glLists[ii], 1 );
m_gllist = 0;
m_glLists[ii] = 0;
}
}
......@@ -473,15 +497,46 @@ void EDA_3D_CANVAS::OnEraseBackground( wxEraseEvent& event )
// Do nothing, to avoid flashing.
}
typedef struct s_sImage
{
unsigned int width;
unsigned int height;
unsigned int bytes_per_pixel; /* 2:RGB16, 3:RGB, 4:RGBA */
unsigned char pixel_data[64 * 64 * 4 + 1];
}tsImage;
GLuint load_and_generate_texture( tsImage *image )
{
GLuint texture;
glPixelStorei (GL_UNPACK_ALIGNMENT, 1);
glPixelStorei (GL_PACK_ALIGNMENT, 1);
glGenTextures( 1, &texture );
glBindTexture( GL_TEXTURE_2D, texture );
gluBuild2DMipmaps( GL_TEXTURE_2D, GL_RGBA, image->width, image->height, GL_RGBA, GL_UNSIGNED_BYTE, image->pixel_data );
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR );
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_MIRRORED_REPEAT);
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_MIRRORED_REPEAT);
glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
return texture;
}
/* Initialize broad parameters for OpenGL */
void EDA_3D_CANVAS::InitGL()
{
wxSize size = GetClientSize();
if( !m_init )
{
m_init = true;
m_text_pcb = load_and_generate_texture( (tsImage *)&text_pcb );
m_text_silk = load_and_generate_texture( (tsImage *)&text_silk );
g_Parm_3D_Visu.m_Zoom = 1.0;
m_ZBottom = 1.0;
m_ZTop = 10.0;
......@@ -496,7 +551,7 @@ void EDA_3D_CANVAS::InitGL()
glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE );
// speedups
glEnable( GL_DITHER );
//glEnable( GL_DITHER );
glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_DONT_CARE );
glHint( GL_LINE_SMOOTH_HINT, GL_NICEST );
glHint( GL_POLYGON_SMOOTH_HINT, GL_NICEST );
......@@ -504,52 +559,7 @@ void EDA_3D_CANVAS::InitGL()
// Initialize alpha blending function.
glEnable( GL_BLEND );
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
}
// set viewing projection
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
#define MAX_VIEW_ANGLE 160.0 / 45.0
if( g_Parm_3D_Visu.m_Zoom > MAX_VIEW_ANGLE )
g_Parm_3D_Visu.m_Zoom = MAX_VIEW_ANGLE;
if( Parent()->ModeIsOrtho() )
{
// OrthoReductionFactor is chosen so as to provide roughly the same size as
// Perspective View
const double orthoReductionFactor = 400 / g_Parm_3D_Visu.m_Zoom;
// Initialize Projection Matrix for Ortographic View
glOrtho( -size.x / orthoReductionFactor, size.x / orthoReductionFactor,
-size.y / orthoReductionFactor, size.y / orthoReductionFactor, 1, 10 );
}
else
{
// Ratio width / height of the window display
double ratio_HV = (double) size.x / size.y;
// Initialize Projection Matrix for Perspective View
gluPerspective( 45.0 * g_Parm_3D_Visu.m_Zoom, ratio_HV, 1, 10 );
}
// position viewer
glMatrixMode( GL_MODELVIEW );
glLoadIdentity();
glTranslatef( 0.0F, 0.0F, -( m_ZBottom + m_ZTop) / 2 );
// clear color and depth buffers
glClearColor( g_Parm_3D_Visu.m_BgColor.m_Red,
g_Parm_3D_Visu.m_BgColor.m_Green,
g_Parm_3D_Visu.m_BgColor.m_Blue, 1 );
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
// Setup light sources:
SetLights();
CheckGLError();
}
}
......@@ -561,16 +571,19 @@ void EDA_3D_CANVAS::SetLights()
/* set viewing projection */
light_color[3] = 1.0;
GLfloat Z_axis_pos[4] = { 0.0, 0.0, 3.0, 0.0 };
GLfloat lowZ_axis_pos[4] = { 0.0, 0.0, -3.0, 0.5 };
GLfloat Z_axis_pos[4] = { 0.0, 0.0, 30.0, 0.0 };
GLfloat lowZ_axis_pos[4] = { 0.0, 0.0, -30.0, 0.5 };
/* activate light */
light = 1.0;
light_color[0] = light_color[1] = light_color[2] = light;
glLightfv( GL_LIGHT0, GL_POSITION, Z_axis_pos );
glLightfv( GL_LIGHT0, GL_DIFFUSE, light_color );
light = 0.3;
light_color[0] = light_color[1] = light_color[2] = light;
light_color[0] = 0.3;
light_color[1] = 0.3;
light_color[2] = 0.4;
glLightfv( GL_LIGHT1, GL_POSITION, lowZ_axis_pos );
glLightfv( GL_LIGHT1, GL_DIFFUSE, light_color );
glEnable( GL_LIGHT0 ); // White spot on Z axis
......@@ -637,7 +650,6 @@ void EDA_3D_CANVAS::TakeScreenshot( wxCommandEvent& event )
viewport.x, viewport.y,
GL_ALPHA, GL_UNSIGNED_BYTE, alphabuffer );
image.SetData( pixelbuffer );
image.SetAlpha( alphabuffer );
image = image.Mirror( false );
......
......@@ -46,28 +46,68 @@
class BOARD_DESIGN_SETTINGS;
class EDA_3D_FRAME;
class S3D_VERTEX;
class SEGVIA;
class VIA;
class D_PAD;
// We are using GL lists to store layers and other items
// to draw or not
// GL_LIST_ID are the GL lists indexes in m_glLists
enum GL_LIST_ID
{
GL_ID_BEGIN = 0,
GL_ID_AXIS = GL_ID_BEGIN, // list id for 3D axis
GL_ID_GRID, // list id for 3D grid
GL_ID_BOARD, // List id for copper layers
GL_ID_TECH_LAYERS, // List id for non copper layers (masks...)
GL_ID_AUX_LAYERS, // List id for user layers (draw, eco, comment)
GL_ID_3DSHAPES_SOLID_FRONT, // List id for 3D shapes, non transparent entities
GL_ID_3DSHAPES_TRANSP_FRONT,// List id for 3D shapes, transparent entities
GL_ID_3DSHAPES_SOLID_BACK, // List id for 3D shapes, non transparent entities
GL_ID_3DSHAPES_TRANSP_BACK,// List id for 3D shapes, transparent entities
GL_ID_SHADOW_FRONT,
GL_ID_SHADOW_BACK,
GL_ID_SHADOW_BOARD,
GL_ID_BODY, // Body only list
GL_ID_END
};
class EDA_3D_CANVAS : public wxGLCanvas
{
private:
bool m_init;
GLuint m_gllist;
GLuint m_glLists[GL_ID_END]; // GL lists
wxGLContext* m_glRC;
wxRealPoint m_draw3dOffset; // offset to draw the 3 mesh.
wxRealPoint m_draw3dOffset; // offset to draw the 3D mesh.
double m_ZBottom; // position of the back layer
double m_ZTop; // position of the front layer
GLuint m_text_pcb;
GLuint m_text_silk;
bool m_shadow_init;
GLuint m_text_fake_shadow_front;
GLuint m_text_fake_shadow_back;
GLuint m_text_fake_shadow_board;
void Create_and_Render_Shadow_Buffer( GLuint *aDst_gl_texture,
GLuint aTexture_size, bool aDraw_body, int aBlurPasses );
public:
EDA_3D_CANVAS( EDA_3D_FRAME* parent, int* attribList = 0 );
~EDA_3D_CANVAS();
EDA_3D_FRAME* Parent() { return (EDA_3D_FRAME*)GetParent(); }
EDA_3D_FRAME* Parent() const { return static_cast<EDA_3D_FRAME*>( GetParent() ); }
BOARD* GetBoard() { return Parent()->GetBoard(); }
void ClearLists();
/**
* Function ClearLists
* Clear the display list.
* @param aGlList = the list to clear.
* if 0 (default) all lists are cleared
*/
void ClearLists( int aGlList = 0 );
// Event functions:
void OnPaint( wxPaintEvent& event );
......@@ -81,7 +121,6 @@ public:
void OnEnterWindow( wxMouseEvent& event );
// Display functions
GLuint DisplayCubeforTest(); // Just a test function
void SetView3D( int keycode );
void DisplayStatus();
void Redraw();
......@@ -92,7 +131,7 @@ public:
* Prepares the parameters of the OpenGL draw list
* creates the OpenGL draw list items (board, grid ...
*/
GLuint CreateDrawGL_List();
void CreateDrawGL_List();
void InitGL();
void SetLights();
void SetOffset(double aPosX, double aPosY)
......@@ -100,19 +139,62 @@ public:
m_draw3dOffset.x = aPosX;
m_draw3dOffset.y = aPosY;
}
void SetGLTechLayersColor( LAYER_NUM aLayer );
void SetGLCopperColor();
void SetGLEpoxyColor( double aTransparency = 1.0 );
/**
* Function BuildBoard3DView
* Called by CreateDrawGL_List()
* Fills the OpenGL draw list with board items draw list.
* 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
*/
void BuildBoard3DView();
void BuildBoard3DView(GLuint aBoardList, GLuint aBodyOnlyList);
void DrawGrid( double aGriSizeMM );
void Draw3DViaHole( SEGVIA * aVia );
void Draw3DPadHole( D_PAD * aPad );
/**
* Function BuildTechLayers3DView
* Called by CreateDrawGL_List()
* Populates the OpenGL GL_ID_TECH_LAYERS draw list with items on tech layers
*/
void BuildTechLayers3DView();
/**
* Function BuildShadowList
* Called by CreateDrawGL_List()
*/
void BuildShadowList( GLuint aFrontList, GLuint aBacklist, GLuint aBoardList );
/**
* Function BuildFootprintShape3DList
* Called by CreateDrawGL_List()
* Fills the OpenGL GL_ID_3DSHAPES_SOLID and GL_ID_3DSHAPES_TRANSP
* draw lists with 3D footprint shapes
* @param aOpaqueList is the gl list for non transparent items
* @param aTransparentList is the gl list for non transparent items,
* which need to be drawn after all other items
*/
void BuildFootprintShape3DList( GLuint aOpaqueList,
GLuint aTransparentList,
bool aSideToLoad );
/**
* Function BuildBoard3DAuxLayers
* Called by CreateDrawGL_List()
* Fills the OpenGL GL_ID_AUX_LAYERS draw list
* with items on aux layers only
*/
void BuildBoard3DAuxLayers();
void Draw3DGrid( double aGriSizeMM );
void Draw3DAxis();
void Draw3DViaHole( const VIA * aVia );
void Draw3DPadHole( const D_PAD * aPad );
void GenerateFakeShadowsTextures();
DECLARE_EVENT_TABLE()
};
void CheckGLError(const char *aFileName, int aLineNumber);
#endif /* _3D_CANVAS_H_ */
......@@ -29,31 +29,24 @@
#include <fctsys.h>
#include <3d_viewer.h>
#include <3d_struct.h>
S3D_MATERIAL::S3D_MATERIAL( S3D_MASTER* father, const wxString& name ) :
EDA_ITEM( father, NOT_USED )
bool S3D_MASTER::IsOpenGlAllowed()
{
m_DiffuseColor.x = m_DiffuseColor.y = m_DiffuseColor.z = 1.0;
m_SpecularColor.x = m_SpecularColor.y = m_SpecularColor.z = 1.0;
m_AmbientIntensity = 1.0;
m_Transparency = 0.0;
m_Shininess = 1.0;
m_Name = name;
}
if( m_loadNonTransparentObjects ) // return true for non transparent objects only
{
if( m_lastTransparency == 0.0 )
return true;
}
if( m_loadTransparentObjects ) // return true for transparent objects only
{
if( m_lastTransparency != 0.0 )
return true;
}
void S3D_MATERIAL::SetMaterial()
{
glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE );
glColor4f( m_DiffuseColor.x * m_AmbientIntensity,
m_DiffuseColor.y * m_AmbientIntensity,
m_DiffuseColor.z * m_AmbientIntensity,
1.0 - m_Transparency );
#if 0
glColorMaterial( GL_FRONT_AND_BACK, GL_SPECULAR );
glColor3f( m_SpecularColor.x, m_SpecularColor.y, m_SpecularColor.z );
glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE );
#endif
return false;
}
......@@ -79,9 +72,17 @@ S3D_MASTER::S3D_MASTER( EDA_ITEM* aParent ) :
EDA_ITEM( aParent, NOT_USED )
{
m_MatScale.x = m_MatScale.y = m_MatScale.z = 1.0;
m_lastTransparency = 0.0;
m_3D_Drawings = NULL;
m_Materials = NULL;
m_ShapeType = FILE3D_NONE;
m_use_modelfile_diffuseColor = true;
m_use_modelfile_emissiveColor = false;
m_use_modelfile_specularColor = false;
m_use_modelfile_ambientIntensity = false;
m_use_modelfile_transparency = true;
m_use_modelfile_shininess = false;
}
......
This diff is collapsed.
......@@ -33,10 +33,7 @@
#include <3d_viewer.h>
#include <info3d_visu.h>
#include <3d_draw_basic_functions.h>
// Imported function:
extern void Set_Object_Data( std::vector<S3D_VERTEX>& aVertices, double aBiuTo3DUnits );
extern void CheckGLError();
#include <modelparsers.h>
// Number of segments to approximate a circle by segments
#define SEGM_PER_CIRCLE 16
......@@ -54,14 +51,15 @@ static void CALLBACK tessCPolyPt2Vertex( const GLvoid* data );
// 2 helper functions to set the current normal vector for gle items
static inline void SetNormalZpos()
{
glNormal3f( 0.0, 0.0, 1.0 );
//glNormal3f( 0.0, 0.0, 1.0 );
}
static inline void SetNormalZneg()
{
glNormal3f( 0.0, 0.0, -1.0 );
//glNormal3f( 0.0, 0.0, -1.0 );
}
void TransfertToGLlist( std::vector< S3D_VERTEX >& aVertices, double aBiuTo3DUnits );
/* Draw3D_VerticalPolygonalCylinder is a helper function.
*
......@@ -116,7 +114,7 @@ static void Draw3D_VerticalPolygonalCylinder( const CPOLYGONS_LIST& aPolysList,
coords[3].y = coords[2].y; // only z change
// Creates the GL_QUAD
Set_Object_Data( coords, aBiuTo3DUnits );
TransfertToGLlist( coords, aBiuTo3DUnits );
}
}
......@@ -132,6 +130,15 @@ void SetGLColor( EDA_COLOR_T color, double alpha )
glColor4f( red, green, blue, alpha );
}
static float m_texture_scale;
void SetGLTexture( GLuint text_id, float scale )
{
glEnable( GL_TEXTURE_2D );
glBindTexture( GL_TEXTURE_2D, text_id );
m_texture_scale = scale;
}
/* draw all solid polygons found in aPolysList
* aZpos = z position in board internal units
......@@ -152,9 +159,9 @@ void Draw3D_SolidHorizontalPolyPolygons( const CPOLYGONS_LIST& aPolysList,
gluTessCallback( tess, GLU_TESS_VERTEX, ( void (CALLBACK*) () )tessCPolyPt2Vertex );
GLdouble v_data[3];
double zpos = ( aZpos + (aThickness / 2) ) * aBiuTo3DUnits;
double zpos = ( aZpos + (aThickness / 2.0) ) * aBiuTo3DUnits;
g_Parm_3D_Visu.m_CurrentZpos = zpos;
v_data[2] = aZpos + (aThickness / 2);
v_data[2] = aZpos + (aThickness / 2.0);
// Set normal to toward positive Z axis, for a solid object only (to draw the top side)
if( aThickness )
......@@ -165,9 +172,11 @@ void Draw3D_SolidHorizontalPolyPolygons( const CPOLYGONS_LIST& aPolysList,
// Draw solid areas contained in this list
CPOLYGONS_LIST polylist = aPolysList; // temporary copy for gluTessVertex
int startContour;
for( int side = 0; side < 2; side++ )
{
int startContour = 1;
startContour = 1;
for( unsigned ii = 0; ii < polylist.GetCornersCount(); ii++ )
{
......@@ -178,6 +187,10 @@ void Draw3D_SolidHorizontalPolyPolygons( const CPOLYGONS_LIST& aPolysList,
startContour = 0;
}
// https://www.opengl.org/sdk/docs/man2/xhtml/gluTessNormal.xml
gluTessNormal( tess, 0.0, 0.0, 0.0 );
v_data[0] = polylist.GetX( ii ) * aBiuTo3DUnits;
v_data[1] = -polylist.GetY( ii ) * aBiuTo3DUnits;
// gluTessVertex store pointers on data, not data, so do not store
......@@ -186,6 +199,7 @@ void Draw3D_SolidHorizontalPolyPolygons( const CPOLYGONS_LIST& aPolysList,
// before calling gluDeleteTess
gluTessVertex( tess, v_data, &polylist[ii] );
if( polylist.IsEndContour( ii ) )
{
gluTessEndContour( tess );
......@@ -198,20 +212,28 @@ void Draw3D_SolidHorizontalPolyPolygons( const CPOLYGONS_LIST& aPolysList,
break;
// Prepare the bottom side of solid areas
zpos = ( aZpos - (aThickness / 2) ) * aBiuTo3DUnits;
zpos = ( aZpos - (aThickness / 2.0) ) * aBiuTo3DUnits;
g_Parm_3D_Visu.m_CurrentZpos = zpos;
v_data[2] = zpos;
// Now;, set normal to toward negative Z axis, for the solid object bottom side
SetNormalZneg();
}
if( startContour == 0 )
{
gluTessEndContour( tess );
gluTessEndPolygon( tess );
}
gluDeleteTess( tess );
if( aThickness == 0 )
{
return;
}
// Build the 3D data : vertical side
Draw3D_VerticalPolygonalCylinder( polylist, aThickness, aZpos - (aThickness / 2), false, aBiuTo3DUnits );
Draw3D_VerticalPolygonalCylinder( polylist, aThickness, aZpos - (aThickness / 2.0), false, aBiuTo3DUnits );
}
......@@ -400,6 +422,12 @@ void CALLBACK tessCPolyPt2Vertex( const GLvoid* data )
// cast back to double type
const CPolyPt* ptr = (const CPolyPt*) data;
if( g_Parm_3D_Visu.IsRealisticMode() && g_Parm_3D_Visu.HightQualityMode() )
{
glTexCoord2f( ptr->x* g_Parm_3D_Visu.m_BiuTo3Dunits * m_texture_scale,
-ptr->y * g_Parm_3D_Visu.m_BiuTo3Dunits * m_texture_scale);
}
glVertex3d( ptr->x * g_Parm_3D_Visu.m_BiuTo3Dunits,
-ptr->y * g_Parm_3D_Visu.m_BiuTo3Dunits,
g_Parm_3D_Visu.m_CurrentZpos );
......
......@@ -126,4 +126,12 @@ void Draw3D_ZaxisOblongCylinder( wxPoint aAxis1Pos, wxPoint aAxis2Pos,
void SetGLColor( EDA_COLOR_T aColor, double aTransparency = 1.0 );
/**
* Set a texture id and a scale to apply when rendering the polygons
* @param text_id = texture ID created by glGenTextures
* @param scale = scale to apply to texture coords
*/
void SetGLTexture( GLuint text_id, float scale );
#endif // _3D_DRAW_BASIC_FUNCTIONS_H_
This diff is collapsed.
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2014 Mario Luzeiro <mrluzeiro@gmail.com>
* Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file 3d_class.cpp
*/
#include <fctsys.h>
#include <3d_struct.h>
#include <3d_material.h>
#ifdef __WXMAC__
# ifdef __DARWIN__
# include <OpenGL/glu.h>
# else
# include <glu.h>
# endif
#else
# include <GL/glu.h>
#endif
S3D_MATERIAL::S3D_MATERIAL( S3D_MASTER* father, const wxString& name ) :
EDA_ITEM( father, NOT_USED )
{
m_Name = name;
m_AmbientColor.clear();
m_DiffuseColor.clear();
m_EmissiveColor.clear();
m_SpecularColor.clear();
m_Shininess.clear();
m_Transparency.clear();
}
void SetOpenGlDefaultMaterial()
{
glm::vec4 ambient( 0.15, 0.15, 0.15, 1.0 );
glm::vec4 specular( 0.1, 0.1, 0.1, 1.0 );
glm::vec4 emissive( 0.1, 0.1, 0.1, 1.0 );
GLint shininess_value = 80;
glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE );
//glColor4f( 1.0, 1.0, 1.0, 1.0 );
glMateriali ( GL_FRONT_AND_BACK, GL_SHININESS, shininess_value );
glMaterialfv( GL_FRONT_AND_BACK, GL_EMISSION, &emissive.x );
glMaterialfv( GL_FRONT_AND_BACK, GL_SPECULAR, &specular.x );
glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT, &ambient.x );
}
void S3D_MATERIAL::SetOpenGLMaterial( unsigned int materialIndex )
{
S3D_MASTER * s3dParent = (S3D_MASTER *) GetParent();
if( ! s3dParent->IsOpenGlAllowed() )
return;
float transparency_value = 0.0f;
if( m_Transparency.size() > materialIndex )
{
transparency_value = m_Transparency[materialIndex];
s3dParent->SetLastTransparency( transparency_value );
}
if( m_DiffuseColor.size() > materialIndex )
{
glm::vec3 color = m_DiffuseColor[materialIndex];
if( m_AmbientColor.size() == 0 )
{
glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE );
}
glColor4f( color.x, color.y, color.z, 1.0 - transparency_value );
}
if( m_Shininess.size() > materialIndex )
{
glMateriali(GL_FRONT_AND_BACK, GL_SHININESS, m_Shininess[materialIndex] );
}
// emissive
if( m_EmissiveColor.size() > materialIndex )
{
glm::vec4 emissive;
emissive[0] = m_EmissiveColor[materialIndex].x;
emissive[1] = m_EmissiveColor[materialIndex].y;
emissive[2] = m_EmissiveColor[materialIndex].z;
emissive[3] = 1.0f;
glMaterialfv( GL_FRONT_AND_BACK, GL_EMISSION, &emissive.x );
}
// specular
if( m_SpecularColor.size() > materialIndex )
{
glm::vec4 specular;
specular[0] = m_SpecularColor[materialIndex].x;
specular[1] = m_SpecularColor[materialIndex].y;
specular[2] = m_SpecularColor[materialIndex].z;
specular[3] = 1.0f;
glMaterialfv( GL_FRONT_AND_BACK, GL_SPECULAR, &specular.x );
}
// ambient
if( m_AmbientColor.size() > materialIndex )
{
glm::vec4 ambient;
ambient[0] = m_AmbientColor[materialIndex].x;
ambient[1] = m_AmbientColor[materialIndex].y;
ambient[2] = m_AmbientColor[materialIndex].z;
ambient[3] = 1.0f;
glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT, &ambient.x );
}
}
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2014 Mario Luzeiro <mrluzeiro@gmail.com>
* Copyright (C) 1992-2014 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file 3d_material.h
*/
#ifndef STRUCT_3D_MATERIAL_H
#define STRUCT_3D_MATERIAL_H
#include <common.h>
#include <base_struct.h>
#include <gal/opengl/glm/glm.hpp>
class S3D_MASTER;
class S3D_MATERIAL : public EDA_ITEM /* openGL "material" data*/
{
public:
wxString m_Name;
// Material list
std::vector< glm::vec3 > m_AmbientColor;
std::vector< glm::vec3 > m_DiffuseColor;
std::vector< glm::vec3 > m_EmissiveColor;
std::vector< glm::vec3 > m_SpecularColor;
std::vector< float > m_Shininess;
std::vector< float > m_Transparency;
public:
S3D_MATERIAL( S3D_MASTER* father, const wxString& name );
S3D_MATERIAL* Next() const { return (S3D_MATERIAL*) Pnext; }
S3D_MATERIAL* Back() const { return (S3D_MATERIAL*) Pback; }
void SetOpenGLMaterial(unsigned int materialIndex);
#if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override
#endif
};
void SetOpenGlDefaultMaterial();
#endif
This diff is collapsed.
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2014 Mario Luzeiro <mrluzeiro@gmail.com>
* Copyright (C) 1992-2014 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file 3d_mesh_model.h
* @brief
*/
#ifndef __3D_MESH_MODEL_H__
#define __3D_MESH_MODEL_H__
#include <fctsys.h>
#include <common.h>
#include <macros.h>
#include <base_struct.h>
#include <gal/opengl/glm/glm.hpp>
#include <vector>
#include <kicad_string.h>
#include <info3d_visu.h>
#ifdef __WXMAC__
# ifdef __DARWIN__
# include <OpenGL/glu.h>
# else
# include <glu.h>
# endif
#else
# include <GL/glu.h>
#endif
#include <wx/glcanvas.h>
class S3D_MESH;
class S3D_MESH
{
public:
S3D_MESH();
~S3D_MESH();
void openGL_Render();
void openGL_RenderAllChilds();
S3D_MATERIAL *m_Materials;
// Point and index list
std::vector< glm::vec3 > m_Point;
std::vector< std::vector<int> > m_CoordIndex;
std::vector< std::vector<int> > m_NormalIndex;
std::vector< glm::vec3 > m_PerFaceNormalsNormalized;
std::vector< glm::vec3 > m_PerVertexNormalsNormalized;
std::vector< int > m_MaterialIndex;
glm::vec3 m_translation;
glm::vec4 m_rotation;
glm::vec3 m_scale;
glm::vec4 m_scaleOrientation; // not used
glm::vec3 m_center; // not used
std::vector<S3D_MESH *> childs;
private:
std::vector< glm::vec3 > m_PerFaceNormalsRaw;
std::vector< std::vector< glm::vec3 > > m_PerFaceVertexNormals;
std::vector< glm::vec3 > m_PointNormalized;
std::vector< float > m_PerFaceSquaredArea;
std::vector< std::vector<int> > m_InvalidCoordIndexes; //!TODO: check for invalid CoordIndex in file and remove the index and the same material index
bool isPerFaceNormalsComputed;
void calcPerFaceNormals ();
bool isPointNormalizedComputed;
void calcPointNormalized();
bool isPerPointNormalsComputed;
void calcPerPointNormals();
};
#endif
......@@ -31,7 +31,7 @@
#include <common.h>
#include <macros.h>
#include <kicad_string.h>
#include <appl_wxstruct.h>
#include <pgm_base.h>
#include <3d_viewer.h>
#include <info3d_visu.h>
......
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2014 Mario Luzeiro <mrluzeiro@gmail.com>
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
......@@ -32,8 +33,9 @@
#include <common.h>
#include <base_struct.h>
#include <3d_material.h>
#include <gal/opengl/glm/glm.hpp>
/* 3D modeling units -> PCB units conversion scale:
* 1 "3D model unit" wings3d = 1 unit = 2.54 mm = 0.1 inch = 100 mils
*/
......@@ -44,48 +46,7 @@ class S3D_MASTER;
class STRUCT_3D_SHAPE;
/* S3D_VERTEX manages a 3D coordinate (3 float numbers: x,y,z coordinates)*/
class S3D_VERTEX
{
public:
double x, y, z;
public:
S3D_VERTEX()
{
x = y = z = 0.0;
}
S3D_VERTEX( double px, double py, double pz)
{
x = px;
y = py;
z = pz;
}
};
class S3D_MATERIAL : public EDA_ITEM /* openGL "material" data*/
{
public:
wxString m_Name;
S3D_VERTEX m_DiffuseColor;
S3D_VERTEX m_EmissiveColor;
S3D_VERTEX m_SpecularColor;
float m_AmbientIntensity;
float m_Transparency;
float m_Shininess;
public:
S3D_MATERIAL( S3D_MASTER* father, const wxString& name );
S3D_MATERIAL* Next() const { return (S3D_MATERIAL*) Pnext; }
S3D_MATERIAL* Back() const { return (S3D_MATERIAL*) Pback; }
void SetMaterial();
#if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override
#endif
};
#define S3D_VERTEX glm::vec3
/* Master structure for a 3D item description */
......@@ -106,9 +67,23 @@ public:
FILE3D_UNKNOWN
};
// Check defaults in S3D_MASTER
bool m_use_modelfile_diffuseColor;
bool m_use_modelfile_emissiveColor;
bool m_use_modelfile_specularColor;
bool m_use_modelfile_ambientIntensity;
bool m_use_modelfile_transparency;
bool m_use_modelfile_shininess;
private:
wxString m_Shape3DName; /* 3D shape name in 3D library */
FILE3D_TYPE m_ShapeType;
double m_lastTransparency; // last transparency value from
// last material in use
bool m_loadTransparentObjects;
bool m_loadNonTransparentObjects;
public:
S3D_MASTER( EDA_ITEM* aParent );
......@@ -117,11 +92,41 @@ public:
S3D_MASTER* Next() const { return (S3D_MASTER*) Pnext; }
S3D_MASTER* Back() const { return (S3D_MASTER*) Pback; }
// Accessors
void SetLastTransparency( double aValue ) { m_lastTransparency = aValue; }
void SetLoadTransparentObjects( bool aLoad )
{ m_loadTransparentObjects = aLoad; }
void SetLoadNonTransparentObjects( bool aLoad )
{ m_loadNonTransparentObjects = aLoad; }
void Insert( S3D_MATERIAL* aMaterial );
/**
* Function IsOpenGlAllowed
* @return true if opengl current list accepts a gl data
* used to filter transparent objects, which are drawn after
* non transparent objects
*/
bool IsOpenGlAllowed();
void Copy( S3D_MASTER* pattern );
/**
* Function ReadData
* Select the parser to read the 3D data file (vrml, x3d ...)
* and build the description objects list
*/
int ReadData();
void Set_Object_Coords( std::vector< S3D_VERTEX >& aVertices );
/**
* Function ObjectCoordsTo3DUnits
* @param aVertices = a list of 3D coordinates in shape units
* to convert to 3D canvas units, according to the
* footprint 3Dshape rotation, offset and scale parameters
*/
void ObjectCoordsTo3DUnits( std::vector< S3D_VERTEX >& aVertices );
#if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override
......@@ -147,6 +152,13 @@ public:
*/
const wxString GetShape3DFullFilename();
/**
* Function SetShape3DName
* @param aShapeName = file name of the data file relative to the 3D shape
*
* Set the filename of the 3D shape, and depending on the file extention
* (vrl, x3d, idf ) the type of file.
*/
void SetShape3DName( const wxString& aShapeName );
};
......
......@@ -153,26 +153,43 @@ void EDA_3D_FRAME::CreateMenuBar()
menuBar->Append( prefsMenu, _( "&Preferences" ) );
AddMenuItem( prefsMenu, ID_MENU3D_REALISTIC_MODE,
_( "Realistic Mode" ), KiBitmap( use_3D_copper_thickness_xpm ), wxITEM_CHECK );
_( "Realistic Mode" ),
KiBitmap( use_3D_copper_thickness_xpm ), wxITEM_CHECK );
AddMenuItem( prefsMenu, ID_MENU3D_MAX_QUALITY_FOR_REALISTIC_MODE,
_( "Max Quality in Realistic Mode" ),
_( "When using max quality, holes are removed from copper zones, "
"but the calculation time is longer" ),
KiBitmap( green_xpm ), wxITEM_CHECK );
prefsMenu->AppendSeparator();
AddMenuItem( prefsMenu, ID_MENU3D_BGCOLOR_SELECTION,
_( "Choose background color" ), KiBitmap( palette_xpm ) );
_( "Choose Background Color" ), KiBitmap( palette_xpm ) );
AddMenuItem( prefsMenu, ID_MENU3D_AXIS_ONOFF,
_( "Show 3D &Axis" ), KiBitmap( axis3d_front_xpm ), wxITEM_CHECK );
_( "Show 3D &Axis" ), KiBitmap( axis3d_front_xpm ), wxITEM_CHECK );
// Creates grid menu
wxMenu * gridlistMenu = new wxMenu;
AddMenuItem( prefsMenu, gridlistMenu, ID_MENU3D_GRID,
_( "3D Grid" ), KiBitmap( grid_xpm ) );
gridlistMenu->Append( ID_MENU3D_GRID_NOGRID, _( "No 3D Grid" ), wxEmptyString, true );
gridlistMenu->Check( ID_MENU3D_GRID_NOGRID, true );
gridlistMenu->Append( ID_MENU3D_GRID_10_MM, _( "3D Grid 10 mm" ), wxEmptyString, true );
gridlistMenu->Append( ID_MENU3D_GRID_5_MM, _( "3D Grid 5 mm" ), wxEmptyString, true );
gridlistMenu->Append( ID_MENU3D_GRID_2P5_MM, _( "3D Grid 2.5 mm" ), wxEmptyString, true );
gridlistMenu->Append( ID_MENU3D_GRID_1_MM, _( "3D Grid 1 mm" ), wxEmptyString, true );
gridlistMenu->Append( ID_MENU3D_GRID_NOGRID, _( "No 3D Grid" ), wxEmptyString, true );
gridlistMenu->Append( ID_MENU3D_GRID_10_MM, _( "3D Grid 10 mm" ), wxEmptyString, true );
gridlistMenu->Append( ID_MENU3D_GRID_5_MM, _( "3D Grid 5 mm" ), wxEmptyString, true );
gridlistMenu->Append( ID_MENU3D_GRID_2P5_MM, _( "3D Grid 2.5 mm" ), wxEmptyString, true );
gridlistMenu->Append( ID_MENU3D_GRID_1_MM, _( "3D Grid 1 mm" ), wxEmptyString, true );
// If the grid is on, check the corresponding menuitem showing the grid size
if( g_Parm_3D_Visu.GetFlag( FL_GRID ) )
{
gridlistMenu->Check( ID_MENU3D_GRID_10_MM, g_Parm_3D_Visu.m_3D_Grid == 10.0 );
gridlistMenu->Check( ID_MENU3D_GRID_5_MM, g_Parm_3D_Visu.m_3D_Grid == 5.0 );
gridlistMenu->Check( ID_MENU3D_GRID_2P5_MM, g_Parm_3D_Visu.m_3D_Grid == 2.5 );
gridlistMenu->Check( ID_MENU3D_GRID_1_MM, g_Parm_3D_Visu.m_3D_Grid == 1.0 );
}
else
gridlistMenu->Check( ID_MENU3D_GRID_NOGRID, true );
prefsMenu->AppendSeparator();
......@@ -222,40 +239,43 @@ void EDA_3D_FRAME::SetMenuBarOptionsState()
wxMenuItem* item;
// Set the state of toggle menus according to the current display options
item = menuBar->FindItem( ID_MENU3D_REALISTIC_MODE );
item->Check(g_Parm_3D_Visu.GetFlag( FL_USE_REALISTIC_MODE ) );
item->Check( g_Parm_3D_Visu.IsRealisticMode() );
item = menuBar->FindItem( ID_MENU3D_MAX_QUALITY_FOR_REALISTIC_MODE );
item->Check( g_Parm_3D_Visu.HightQualityMode() );
item = menuBar->FindItem( ID_MENU3D_SHOW_BOARD_BODY );
item->Check(g_Parm_3D_Visu.GetFlag( FL_SHOW_BOARD_BODY ) );
item->Check( g_Parm_3D_Visu.GetFlag( FL_SHOW_BOARD_BODY ) );
item = menuBar->FindItem( ID_MENU3D_USE_COPPER_THICKNESS );
item->Check(g_Parm_3D_Visu.GetFlag( FL_USE_COPPER_THICKNESS ) );
item->Check( g_Parm_3D_Visu.GetFlag( FL_USE_COPPER_THICKNESS ) );
item = menuBar->FindItem( ID_MENU3D_MODULE_ONOFF );
item->Check(g_Parm_3D_Visu.GetFlag( FL_MODULE ) );
item->Check( g_Parm_3D_Visu.GetFlag( FL_MODULE ) );
item = menuBar->FindItem( ID_MENU3D_ZONE_ONOFF );
item->Check(g_Parm_3D_Visu.GetFlag( FL_ZONE ) );
item->Check( g_Parm_3D_Visu.GetFlag( FL_ZONE ) );
item = menuBar->FindItem( ID_MENU3D_AXIS_ONOFF );
item->Check(g_Parm_3D_Visu.GetFlag( FL_AXIS ) );
item->Check( g_Parm_3D_Visu.GetFlag( FL_AXIS ) );
item = menuBar->FindItem( ID_MENU3D_ADHESIVE_ONOFF );
item->Check(g_Parm_3D_Visu.GetFlag( FL_ADHESIVE ) );
item->Check( g_Parm_3D_Visu.GetFlag( FL_ADHESIVE ) );
item = menuBar->FindItem( ID_MENU3D_SILKSCREEN_ONOFF );
item->Check(g_Parm_3D_Visu.GetFlag( FL_SILKSCREEN ) );
item->Check( g_Parm_3D_Visu.GetFlag( FL_SILKSCREEN ) );
item = menuBar->FindItem( ID_MENU3D_SOLDER_MASK_ONOFF );
item->Check(g_Parm_3D_Visu.GetFlag( FL_SOLDERMASK ) );
item->Check( g_Parm_3D_Visu.GetFlag( FL_SOLDERMASK ) );
item = menuBar->FindItem( ID_MENU3D_SOLDER_PASTE_ONOFF );
item->Check(g_Parm_3D_Visu.GetFlag( FL_SOLDERPASTE ) );
item->Check( g_Parm_3D_Visu.GetFlag( FL_SOLDERPASTE ) );
item = menuBar->FindItem( ID_MENU3D_COMMENTS_ONOFF );
item->Check(g_Parm_3D_Visu.GetFlag( FL_COMMENTS ) );
item->Check( g_Parm_3D_Visu.GetFlag( FL_COMMENTS ) );
item = menuBar->FindItem( ID_MENU3D_ECO_ONOFF );
item->Check(g_Parm_3D_Visu.GetFlag( FL_ECO ));
item->Check( g_Parm_3D_Visu.GetFlag( FL_ECO ));
}
void EDA_3D_FRAME::SetToolbars()
......
......@@ -30,53 +30,46 @@
#ifndef __3D_VIEWER_H__
#define __3D_VIEWER_H__
#include <wxstruct.h> // for EDA_BASE_FRAME.
#include <draw_frame.h>
#if !wxUSE_GLCANVAS
#error Please build wxWidgets with Opengl support (./configure --with-opengl)
#endif
#include <wx/glcanvas.h>
#ifdef __WXMAC__
# ifdef __DARWIN__
# include <OpenGL/glu.h>
# else
# include <glu.h>
# endif
#else
# include <GL/glu.h>
#endif
#include <3d_struct.h>
#define KISYS3DMOD "KISYS3DMOD"
#include <3d_struct.h>
class EDA_3D_CANVAS;
class PCB_BASE_FRAME;
#define KICAD_DEFAULT_3D_DRAWFRAME_STYLE wxDEFAULT_FRAME_STYLE | wxWANTS_CHARS
#define LIB3D_PATH wxT( "packages3d" )
#define KICAD_DEFAULT_3D_DRAWFRAME_STYLE (wxDEFAULT_FRAME_STYLE | wxWANTS_CHARS)
#define LIB3D_PATH wxT( "packages3d" )
class EDA_3D_FRAME : public EDA_BASE_FRAME
class EDA_3D_FRAME : public KIWAY_PLAYER
{
private:
EDA_3D_CANVAS* m_canvas;
bool m_reloadRequest;
wxString m_defaultFileName; /// Filename to propose for screenshot
/// Tracks whether to use Orthographic or Perspective projection
bool m_ortho;
public:
EDA_3D_FRAME( PCB_BASE_FRAME* parent, const wxString& title,
EDA_3D_FRAME( KIWAY* aKiway, PCB_BASE_FRAME* aParent, const wxString& aTitle,
long style = KICAD_DEFAULT_3D_DRAWFRAME_STYLE );
~EDA_3D_FRAME()
{
m_auimgr.UnInit();
};
PCB_BASE_FRAME* Parent() { return (PCB_BASE_FRAME*)GetParent(); }
PCB_BASE_FRAME* Parent() const { return (PCB_BASE_FRAME*)GetParent(); }
BOARD* GetBoard();
/**
* Function ReloadRequest
......@@ -93,8 +86,10 @@ public:
* Function NewDisplay
* Rebuild the display list.
* must be called when 3D opengl data is modified
* @param aGlList = the list to rebuild.
* if 0 (default) all lists are rebuilt
*/
void NewDisplay();
void NewDisplay( int aGlList = 0 );
void SetDefaultFileName(const wxString &aFn) { m_defaultFileName = aFn; }
const wxString &GetDefaultFileName() const { return m_defaultFileName; }
......@@ -121,8 +116,9 @@ private:
// to the current display options
void ReCreateMainToolbar();
void SetToolbars();
void GetSettings();
void SaveSettings();
void LoadSettings( wxConfigBase* aCfg ); // overload virtual
void SaveSettings( wxConfigBase* aCfg ); // overload virtual
// Other functions
void OnLeftClick( wxDC* DC, const wxPoint& MousePos );
......
......@@ -41,6 +41,7 @@ enum id_3dview_frm
ID_MENU3D_ECO_ONOFF,
ID_MENU3D_SHOW_BOARD_BODY,
ID_MENU3D_REALISTIC_MODE,
ID_MENU3D_MAX_QUALITY_FOR_REALISTIC_MODE,
ID_END_COMMAND_3D,
ID_TOOL_SET_VISIBLE_ITEMS,
......
......@@ -2,8 +2,10 @@ add_definitions(-DPCBNEW)
include_directories(BEFORE ${INC_BEFORE})
include_directories(
textures
../pcbnew
../polygon
${GLEW_INCLUDE_DIR}
${INC_AFTER}
)
......@@ -16,12 +18,17 @@ set(3D-VIEWER_SRCS
3d_draw.cpp
3d_draw_basic_functions.cpp
3d_frame.cpp
3d_material.cpp
3d_mesh_model.cpp
3d_read_mesh.cpp
3d_toolbar.cpp
info3d_visu.cpp
trackball.cpp
x3dmodelparser.cpp
vrmlmodelparser.cpp
vrml_aux.cpp
vrml_v1_modelparser.cpp
vrml_v2_modelparser.cpp
x3dmodelparser.cpp
)
add_library(3d-viewer STATIC ${3D-VIEWER_SRCS})
......@@ -62,9 +62,9 @@ INFO3D_VISU::INFO3D_VISU()
m_CopperLayersCount = 2;
m_BoardSettings = NULL;
m_CopperThickness = 0;
m_EpoxyThickness = 0;
m_NonCopperLayerThickness = 0;
m_copperThickness = 0;
m_epoxyThickness = 0;
m_nonCopperLayerThickness = 0;
// default all special item layers Visible
for( ii = 0; ii < FL_LAST; ii++ )
......@@ -72,6 +72,7 @@ INFO3D_VISU::INFO3D_VISU()
SetFlag( FL_GRID, false );
SetFlag( FL_USE_COPPER_THICKNESS, false );
SetFlag( FL_USE_MAXQUALITY_IN_REALISTIC_MODE, false );
}
......@@ -84,7 +85,7 @@ INFO3D_VISU::~INFO3D_VISU()
*/
void INFO3D_VISU::InitSettings( BOARD* aBoard )
{
EDA_RECT bbbox = aBoard->ComputeBoundingBox( false );
EDA_RECT bbbox = aBoard->ComputeBoundingBox( true );
if( bbbox.GetWidth() == 0 && bbbox.GetHeight() == 0 )
{
......@@ -92,6 +93,7 @@ void INFO3D_VISU::InitSettings( BOARD* aBoard )
bbbox.SetHeight( Millimeter2iu( 100 ) );
}
m_BoardSettings = &aBoard->GetDesignSettings();
m_BoardSize = bbbox.GetSize();
......@@ -107,97 +109,99 @@ void INFO3D_VISU::InitSettings( BOARD* aBoard )
m_BiuTo3Dunits = 2.0 / std::max( m_BoardSize.x, m_BoardSize.y );
m_EpoxyThickness = aBoard->GetDesignSettings().GetBoardThickness() * m_BiuTo3Dunits;
m_epoxyThickness = aBoard->GetDesignSettings().GetBoardThickness() * m_BiuTo3Dunits;
// TODO use value defined by user (currently use default values by ctor
m_CopperThickness = COPPER_THICKNESS * m_BiuTo3Dunits;
m_NonCopperLayerThickness = TECH_LAYER_THICKNESS * m_BiuTo3Dunits;
m_copperThickness = COPPER_THICKNESS * m_BiuTo3Dunits;
m_nonCopperLayerThickness = TECH_LAYER_THICKNESS * m_BiuTo3Dunits;
// Init Z position of each layer
// calculate z position for each copper layer
// Z = 0 is the z position of the back (bottom) layer (layer id = 31)
// Z = m_epoxyThickness is the z position of the front (top) layer (layer id = 0)
// all unused copper layer z position are set to 0
int layer;
int copper_layers_cnt = m_CopperLayersCount;
for( layer = 0; layer < copper_layers_cnt; layer++ )
{
m_LayerZcoord[layer] =
m_EpoxyThickness * layer / (copper_layers_cnt - 1);
m_layerZcoord[layer] =
m_epoxyThickness - (m_epoxyThickness * layer / (copper_layers_cnt - 1));
}
#define layerThicknessMargin 1.1
double zpos_offset = m_NonCopperLayerThickness * layerThicknessMargin;
double zpos_copper_back = m_LayerZcoord[0] - layerThicknessMargin*m_CopperThickness/2;
double zpos_copper_front = m_EpoxyThickness + layerThicknessMargin*m_CopperThickness/2;
double zpos_offset = m_nonCopperLayerThickness * layerThicknessMargin;
double zpos_copper_back = - layerThicknessMargin*m_copperThickness/2;
double zpos_copper_front = m_epoxyThickness + layerThicknessMargin*m_copperThickness/2;
// Fill remaining unused copper layers and front layer zpos
// with m_EpoxyThickness
// Solder mask and Solder paste have the same Z position
for( ; layer <= LAST_COPPER_LAYER; layer++ )
// Fill remaining unused copper layers and back layer zpos
// with 0
for( ; layer < MAX_CU_LAYERS; layer++ )
{
m_LayerZcoord[layer] = m_EpoxyThickness;
m_layerZcoord[layer] = 0;
}
// calculate z position for each non copper layer
for( int layer_id = FIRST_NON_COPPER_LAYER; layer_id < NB_PCB_LAYERS; layer_id++ )
// Solder mask and Solder paste have the same Z position
for( int layer_id = MAX_CU_LAYERS; layer_id < LAYER_ID_COUNT; layer_id++ )
{
double zpos;
switch( layer_id )
{
case ADHESIVE_N_BACK:
case B_Adhes:
zpos = zpos_copper_back - 3 * zpos_offset;
break;
case ADHESIVE_N_FRONT:
case F_Adhes:
zpos = zpos_copper_front + 3 * zpos_offset;
break;
case SOLDERPASTE_N_BACK:
case B_Paste:
zpos = zpos_copper_back - 1 * zpos_offset;
break;
case SOLDERPASTE_N_FRONT:
case F_Paste:
zpos = zpos_copper_front + 1 * zpos_offset;
break;
case SOLDERMASK_N_BACK:
case B_Mask:
zpos = zpos_copper_back - 1 * zpos_offset;
break;
case SOLDERMASK_N_FRONT:
case F_Mask:
zpos = zpos_copper_front + 1 * zpos_offset;
break;
case SILKSCREEN_N_BACK:
case B_SilkS:
zpos = zpos_copper_back - 2 * zpos_offset;
break;
case SILKSCREEN_N_FRONT:
case F_SilkS:
zpos = zpos_copper_front + 2 * zpos_offset;
break;
default:
zpos = zpos_copper_front +
(layer_id - FIRST_NON_COPPER_LAYER + 4) * zpos_offset;
zpos = zpos_copper_front + (layer_id - MAX_CU_LAYERS + 4) * zpos_offset;
break;
}
m_LayerZcoord[layer_id] = zpos;
m_layerZcoord[layer_id] = zpos;
}
}
/* return the Z position of 3D shapes, in 3D Units
* aIsFlipped: true for modules on Front (top) layer, false
* if on back (bottom) layer
* Note: in draw functions, the copper has a thickness = m_CopperThickness
* Vias and tracks are draw with the top side position = m_CopperThickness/2
* and the bottom side position = -m_CopperThickness/2 from the Z layer position
* Note: in draw functions, the copper has a thickness = m_copperThickness
* Vias and tracks are draw with the top side position = m_copperThickness/2
* and the bottom side position = -m_copperThickness/2 from the Z layer position
*/
double INFO3D_VISU::GetModulesZcoord3DIU( bool aIsFlipped )
{
if( aIsFlipped )
return m_LayerZcoord[LAYER_N_BACK] - ( m_CopperThickness / 2 );
return m_layerZcoord[B_Paste] - ( m_copperThickness / 2 ); //B_Cu NOTE: in order to display modules in top of Paste and near the shadow
else
return m_LayerZcoord[LAYER_N_FRONT] + ( m_CopperThickness / 2 );
return m_layerZcoord[F_Paste] + ( m_copperThickness / 2 ); //F_Cu
}
......@@ -71,10 +71,10 @@ enum DISPLAY3D_FLG {
FL_USE_COPPER_THICKNESS,
FL_SHOW_BOARD_BODY,
FL_USE_REALISTIC_MODE,
FL_USE_MAXQUALITY_IN_REALISTIC_MODE,
FL_LAST
};
class INFO3D_VISU
{
public:
......@@ -95,11 +95,14 @@ public:
// to scale 3D units between -1.0 and +1.0
double m_CurrentZpos; // temporary storage of current value of Z position,
// used in some calculation
double zpos_offset;
private:
double m_LayerZcoord[NB_LAYERS]; // Z position of each layer (normalized)
double m_CopperThickness; // Copper thickness (normalized)
double m_EpoxyThickness; // Epoxy thickness (normalized)
double m_NonCopperLayerThickness; // Non copper layers thickness
double m_layerZcoord[LAYER_ID_COUNT]; // Z position of each layer (normalized)
double m_copperThickness; // Copper thickness (normalized)
double m_epoxyThickness; // Epoxy thickness (normalized)
double m_nonCopperLayerThickness; // Non copper layers thickness
bool m_drawFlags[FL_LAST]; // Enable/disable flags (see DISPLAY3D_FLG list)
public: INFO3D_VISU();
......@@ -134,7 +137,7 @@ public: INFO3D_VISU();
*/
int GetLayerZcoordBIU( int aLayerId )
{
return KiROUND( m_LayerZcoord[aLayerId] / m_BiuTo3Dunits );
return KiROUND( m_layerZcoord[aLayerId] / m_BiuTo3Dunits );
}
/**
......@@ -148,11 +151,10 @@ public: INFO3D_VISU();
*/
int GetCopperThicknessBIU() const
{
bool use_thickness = GetFlag( FL_USE_COPPER_THICKNESS )
// || GetFlag( FL_USE_REALISTIC_MODE )
;
bool use_thickness = GetFlag( FL_USE_COPPER_THICKNESS );
return use_thickness ?
KiROUND( m_CopperThickness / m_BiuTo3Dunits )
KiROUND( m_copperThickness / m_BiuTo3Dunits )
: 0;
}
......@@ -162,7 +164,7 @@ public: INFO3D_VISU();
*/
int GetEpoxyThicknessBIU() const
{
return KiROUND( m_EpoxyThickness / m_BiuTo3Dunits );
return KiROUND( m_epoxyThickness / m_BiuTo3Dunits );
}
/**
......@@ -178,7 +180,7 @@ public: INFO3D_VISU();
// || GetFlag( FL_USE_REALISTIC_MODE )
;
return use_thickness ?
KiROUND( m_NonCopperLayerThickness / m_BiuTo3Dunits )
KiROUND( m_nonCopperLayerThickness / m_BiuTo3Dunits )
: 0;
}
......@@ -189,14 +191,16 @@ public: INFO3D_VISU();
*
* Note: if m_drawFlags[FL_USE_COPPER_THICKNESS] is not set, returns 0
*/
int GetLayerObjectThicknessBIU( int aLayerId) const
int GetLayerObjectThicknessBIU( int aLayerId ) const
{
return aLayerId >= FIRST_NON_COPPER_LAYER ?
GetNonCopperLayerThicknessBIU() :
GetCopperThicknessBIU();
return IsCopperLayer( aLayerId ) ?
GetCopperThicknessBIU() :
GetNonCopperLayerThicknessBIU()
;
}
bool IsRealisticMode() { return GetFlag( FL_USE_REALISTIC_MODE ); }
bool HightQualityMode() { return GetFlag( FL_USE_MAXQUALITY_IN_REALISTIC_MODE ); }
};
extern INFO3D_VISU g_Parm_3D_Visu;
......
......@@ -32,13 +32,9 @@
#include <map>
#include <vector>
#include <wx/string.h>
#include <3d_mesh_model.h>
class S3D_MASTER;
class S3D_VERTEX;
extern void Set_Object_Data( std::vector< S3D_VERTEX >& aVertices, double aBiuTo3DUnits );
class S3D_MODEL_PARSER;
class X3D_MODEL_PARSER;
......@@ -118,13 +114,17 @@ public:
static void GetNodeProperties( wxXmlNode* aNode, PROPERTY_MAP& aProps );
/**
* Return string representing x3d file in vrml format
* Return string representing x3d file in vrml2 format
* Function Load must be called before this function, otherwise empty
* data set is returned.
*/
wxString VRML_representation();
wxString VRML2_representation();
private:
wxString m_Filename;
S3D_MESH *m_model;
std::vector<S3D_MESH *> childs;
std::vector< wxString > vrml_materials;
std::vector< wxString > vrml_points;
std::vector< wxString > vrml_coord_indexes;
......@@ -137,57 +137,111 @@ private:
void rotate( S3D_VERTEX& aCoordinate, S3D_VERTEX& aRotAxis, double angle );
};
/**
* class WRL_MODEL_PARSER
* class VRML2_MODEL_PARSER
* Parses
*/
class VRML_MODEL_PARSER: public S3D_MODEL_PARSER
class VRML2_MODEL_PARSER: public S3D_MODEL_PARSER
{
public:
VRML_MODEL_PARSER( S3D_MASTER* aMaster );
~VRML_MODEL_PARSER();
VRML2_MODEL_PARSER( S3D_MASTER* aMaster );
~VRML2_MODEL_PARSER();
void Load( const wxString aFilename );
private:
/**
* Function ReadMaterial
* read the description of a 3D material definition in the form:
* DEF yellow material Material (
* DiffuseColor 1.00000 1.00000 0.00000e 0
* EmissiveColor 0.00000e 0 0.00000e 0 0.00000e 0
* SpecularColor 1.00000 1.00000 1.00000
* AmbientIntensity 1.00000
* Transparency 0.00000e 0
* Shininess 1.00000
*)
* Or type:
* USE yellow material
* Return string representing VRML2 file in vrml2 format
* Function Load must be called before this function, otherwise empty
* data set is returned.
*/
int readMaterial( FILE* file, int* LineNum );
int readChildren( FILE* file, int* LineNum );
int readShape( FILE* file, int* LineNum );
int readAppearance( FILE* file, int* LineNum );
int readGeometry( FILE* file, int* LineNum );
wxString VRML2_representation();
private:
int read_Transform();
int read_DEF();
int read_Shape();
int read_Appearance();
int read_material();
int read_Material();
int read_IndexedFaceSet();
int read_Coordinate();
int read_Normal();
int read_NormalIndex();
int read_Color();
int read_coordIndex();
int read_colorIndex();
bool m_normalPerVertex;
bool colorPerVertex;
S3D_MESH *m_model;
std::vector<S3D_MESH *> childs;
FILE *m_file;
S3D_MATERIAL *m_Materials;
wxString m_Filename;
};
/**
* class VRML1_MODEL_PARSER
* Parses
*/
class VRML1_MODEL_PARSER: public S3D_MODEL_PARSER
{
public:
VRML1_MODEL_PARSER( S3D_MASTER* aMaster );
~VRML1_MODEL_PARSER();
void Load( const wxString aFilename );
/**
* Function ReadCoordList
* reads 3D coordinate lists like:
* coord Coordinate { point [
* -5.24489 6.57640e-3 -9.42129e-2,
* -5.11821 6.57421e-3 0.542654,
* -3.45868 0.256565 1.32000 ] }
* or:
* normal Normal { vector [
* 0.995171 -6.08102e-6 9.81541e-2,
* 0.923880 -4.09802e-6 0.382683,
* 0.707107 -9.38186e-7 0.707107]
* }
*
* text_buffer contains the first line of this node :
* "coord Coordinate { point ["
* Return string representing VRML2 file in vrml2 format
* Function Load must be called before this function, otherwise empty
* data set is returned.
*/
void readCoordsList( FILE* file, char* text_buffer, std::vector< double >& aList,
int* LineNum );
wxString VRML2_representation();
private:
int read_separator();
int readMaterial();
int readCoordinate3();
int readIndexedFaceSet();
int readMaterial_ambientColor();
int readMaterial_diffuseColor();
int readMaterial_emissiveColor();
int readMaterial_specularColor();
int readMaterial_shininess();
int readMaterial_transparency();
int readCoordinate3_point();
int readIndexedFaceSet_coordIndex();
int readIndexedFaceSet_materialIndex();
bool m_normalPerVertex;
bool colorPerVertex;
S3D_MESH *m_model;
std::vector<S3D_MESH *> childs;
S3D_MATERIAL *m_Materials;
FILE *m_file;
wxString m_Filename;
};
/**
* class VRML_MODEL_PARSER
* Parses
*/
class VRML_MODEL_PARSER: public S3D_MODEL_PARSER
{
public:
VRML_MODEL_PARSER( S3D_MASTER* aMaster );
~VRML_MODEL_PARSER();
void Load( const wxString aFilename );
private:
VRML1_MODEL_PARSER *vrml1_parser;
VRML2_MODEL_PARSER *vrml2_parser;
};
#endif // MODELPARSERS_H
This diff is collapsed.
This diff is collapsed.
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2014 Mario Luzeiro <mrluzeiro@gmail.com>
* Copyright (C) 1992-2014 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file vrml_aux.cpp
*/
#include "vrml_aux.h"
char SkipGetChar ( FILE* File )
{
char c;
bool re_parse;
if( (c = fgetc( File )) == EOF )
{
//DBG( printf( "EOF\n" ) );
return EOF;
}
//DBG( printf( "c %c 0x%02X\n", c, c ) );
do
{
re_parse = false;
if ((c == ' ') || (c == '\t') || (c == '{') || (c == '['))
{
//DBG( printf( "Skipping space \\t or { or [\n" ) );
do
{
if( (c = fgetc( File )) == EOF )
{
//DBG( printf( "EOF\n" ) );
return EOF;
}
}
while((c == ' ') || (c == '\t') || (c == '{') || (c == '['));
}
if ((c == '#') || (c == '\n') || (c == '\r') || (c == 0) || (c == ','))
{
if (c == '#')
{
//DBG( printf( "Skipping # \\n or \\r or 0, 0x%02X\n", c ) );
do
{
if( (c = fgetc( File )) == EOF )
{
//DBG( printf( "EOF\n" ) );
return EOF;
}
}
while((c != '\n') && (c != '\r') && (c != 0) && (c != ','));
}
else
{
if( (c = fgetc( File )) == EOF )
{
//DBG( printf( "EOF\n" ) );
return EOF;
}
}
re_parse = true;
}
}while(re_parse == true);
return c;
}
char* GetNextTag( FILE* File, char* tag )
{
char c = SkipGetChar( File );
if (c == EOF)
{
return NULL;
}
tag[0] = c;
tag[1] = 0;
//DBG( printf( "tag[0] %c\n", tag[0] ) );
if( (c != '}') && (c != ']') )
{
char *dst = &tag[1];
while (fscanf( File, "%c", dst))
{
if( (*dst == ' ') || (*dst == '[') || (*dst == '{') || (*dst == '\t') || (*dst == '\n')|| (*dst == '\r') )
{
*dst = 0;
break;
}
dst++;
}
//DBG( printf( "tag %s\n", tag ) );
c = SkipGetChar( File );
if (c != EOF)
{
// Puts again the read char in the buffer
ungetc( c, File );
}
}
return tag;
}
int read_NotImplemented( FILE* File, char closeChar)
{
char c;
//DBG( printf( "look for %c\n", closeChar) );
while( (c = fgetc( File )) != EOF )
{
if( c == '{' )
{
//DBG( printf( "{\n") );
read_NotImplemented( File, '}' );
} else if( c == '[' )
{
//DBG( printf( "[\n") );
read_NotImplemented( File, ']' );
} else if( c == closeChar )
{
//DBG( printf( "%c\n", closeChar) );
return 0;
}
}
DBG( printf( " NotImplemented failed\n" ) );
return -1;
}
int parseVertexList( FILE* File, std::vector< glm::vec3 > &dst_vector)
{
//DBG( printf( " parseVertexList\n" ) );
dst_vector.clear();
glm::vec3 vertex;
while( parseVertex ( File, vertex ) == 3 )
{
dst_vector.push_back( vertex );
}
return 0;
}
int parseVertex( FILE* File, glm::vec3 &dst_vertex )
{
float a,b,c;
int ret = fscanf( File, "%e %e %e", &a, &b, &c );
dst_vertex.x = a;
dst_vertex.y = b;
dst_vertex.z = c;
char s = SkipGetChar( File );
if (s != EOF)
{
// Puts again the read char in the buffer
ungetc( s, File );
}
//DBG( printf( "ret%d(%.9f,%.9f,%.9f)", ret, a,b,c) );
return ret;
}
int parseFloat( FILE* File, float *dst_float )
{
float value;
int ret = fscanf( File, "%e", &value );
*dst_float = value;
return ret;
}
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2014 Mario Luzeiro <mrluzeiro@gmail.com>
* Copyright (C) 1992-2014 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file vrml_aux.h
*/
#ifndef _VRML_AUX_H
#define _VRML_AUX_H
#include <fctsys.h>
#include <common.h>
#include <macros.h>
#include <base_struct.h>
#include <gal/opengl/glm/glm.hpp>
#include <vector>
#include <kicad_string.h>
#include <info3d_visu.h>
#ifdef __WXMAC__
# ifdef __DARWIN__
# include <OpenGL/glu.h>
# else
# include <glu.h>
# endif
#else
# include <GL/glu.h>
#endif
#include <wx/glcanvas.h>
int read_NotImplemented( FILE* File, char closeChar);
char SkipGetChar ( FILE* File );
int parseVertexList( FILE* File, std::vector< glm::vec3 > &dst_vector);
int parseVertex( FILE* File, glm::vec3 &dst_vertex );
int parseFloat( FILE* File, float *dst_float );
char* GetNextTag( FILE* File, char* tag );
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -38,6 +38,12 @@
# Where the library is to be installed.
set( PREFIX ${DOWNLOAD_DIR}/avhttp )
if( KICAD_SKIP_BOOST )
set( AVHTTP_DEPEND "" )
else()
set( AVHTTP_DEPEND "boost" )
endif()
# Install the AVHTTP header only library ${PREFIX}
ExternalProject_Add( avhttp
......@@ -46,7 +52,7 @@ ExternalProject_Add( avhttp
# grab it from a local zip file for now, cmake caller's source dir
URL ${CMAKE_CURRENT_SOURCE_DIR}/avhttp-master.zip
DEPENDS boost
DEPENDS ${AVHTTP_DEPEND}
CONFIGURE_COMMAND ""
......
This diff is collapsed.
......@@ -33,7 +33,9 @@ set( CAIRO_ROOT "${PROJECT_SOURCE_DIR}/cairo_root" )
#-----</configure>---------------------------------------------------------------
find_package( BZip2 REQUIRED )
if( NOT BZIP2_FOUND )
find_package( BZip2 REQUIRED )
endif()
set( PREFIX ${DOWNLOAD_DIR}/cairo )
......@@ -42,7 +44,7 @@ if ( KICAD_BUILD_STATIC )
endif( KICAD_BUILD_STATIC )
if (APPLE)
if (APPLE)
set( CAIRO_CFLAGS "CFLAGS=" )
set( CAIRO_LDFLAGS "LDFLAGS=-framework CoreServices -framework Cocoa" )
......@@ -94,8 +96,14 @@ ExternalProject_Add( cairo
#BINARY_DIR "${PREFIX}"
BUILD_COMMAND $(MAKE)
BUILD_COMMAND $(MAKE)
INSTALL_DIR "${CAIRO_ROOT}"
INSTALL_COMMAND $(MAKE) install
)
# match these with whatever FindCairo.cmake sets
# Dick i'vent set it because /lib and /lib64 issue in non multiarch binaries OSs
#set( CAIRO_FOUND true )
set( CAIRO_INCLUDE_DIR ${CAIRO_ROOT}/include )
set( CAIRO_LIBRARIES ${CAIRO_ROOT}/lib )
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -33,7 +33,9 @@ set( PKGCONFIG_ROOT "${PROJECT_SOURCE_DIR}/pkgconfig_root" )
#-----</configure>---------------------------------------------------------------
find_package( BZip2 REQUIRED )
if( NOT BZIP2_FOUND )
find_package( BZip2 REQUIRED )
endif()
set( PREFIX ${DOWNLOAD_DIR}/pkgconfig )
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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