Commit a188f9d0 authored by jean-pierre charras's avatar jean-pierre charras

added orto2 patch

parent aa0fdb1c
......@@ -57,6 +57,7 @@ Pcb3D_GLCanvas::Pcb3D_GLCanvas( WinEDA3D_DrawFrame* parent ) :
m_init = FALSE;
m_gllist = 0;
m_Parent = parent;
m_ortho = false;
#if wxCHECK_VERSION( 2, 9, 0 )
......@@ -498,32 +499,44 @@ void Pcb3D_GLCanvas::InitGL()
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
}
/* set viewing projection */
// set viewing projection
// Ratio width / height of the window display
double ratio_HV = (double) size.x / size.y;
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( 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 );
}
// glFrustum(-1., 1.1F, -1.1F, 1.1F, ZBottom, ZTop);
/* position viewer */
// position viewer
glMatrixMode( GL_MODELVIEW );
glLoadIdentity();
glTranslatef( 0.0F, 0.0F, -( ZBottom + ZTop) / 2 );
/* clear color and depth buffers */
// 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 souces: */
// Setup light souces:
SetLights();
}
......
......@@ -293,6 +293,10 @@ void WinEDA3D_DrawFrame::Process_Special_Functions( wxCommandEvent& event )
m_Canvas->SetView3D( WXK_DOWN );
return;
case ID_ORTHO:
m_Canvas->ToggleOrtho();
return;
case ID_TOOL_SCREENCOPY_TOCLIBBOARD:
case ID_MENU_SCREENCOPY_PNG:
case ID_MENU_SCREENCOPY_JPEG:
......
......@@ -89,6 +89,11 @@ void WinEDA3D_DrawFrame::ReCreateHToolbar()
m_HToolBar->AddTool( ID_MOVE3D_DOWN, wxEmptyString, wxBitmap( down_xpm ),
_( "Move down" ) );
m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_ORTHO, wxEmptyString, wxBitmap( ortho_xpm ),
_( "Enable/Disable ortographic projection" ),
wxITEM_CHECK );
m_HToolBar->Realize();
}
......
......@@ -53,6 +53,7 @@ enum id_3dview_frm
ID_MOVE3D_RIGHT,
ID_MOVE3D_UP,
ID_MOVE3D_DOWN,
ID_ORTHO,
ID_MENU3D_BGCOLOR_SELECTION,
ID_MENU3D_AXIS_ONOFF,
ID_MENU3D_MODULE_ONOFF,
......@@ -137,6 +138,9 @@ public:
private:
bool m_init;
GLuint m_gllist;
/// Tracks whether to use Orthographic or Perspective projection
//TODO: Does this belong here, or in WinEDA3D_DrawFrame ???
bool m_ortho;
#if wxCHECK_VERSION( 2, 9, 0 )
wxGLContext* m_glRC;
#endif
......@@ -182,6 +186,12 @@ public:
void Draw3D_DrawSegment( DRAWSEGMENT* segment );
void Draw3D_DrawText( TEXTE_PCB* text );
/// Toggles ortographic projection on and off
void ToggleOrtho(){ m_ortho = !m_ortho ; Refresh(true);};
/// Returns the orthographic projection flag
bool ModeIsOrtho() { return m_ortho ;};
//int Get3DLayerEnable(int act_layer);
DECLARE_EVENT_TABLE()
......@@ -223,7 +233,7 @@ public:
/** function ReloadRequest
* must be called when reloading data from Pcbnew is needed
* mainly after edition of the board or footprint beeing displayed.
* mainly for the mudule editor.
* mainly for the module editor.
*/
void ReloadRequest( )
{
......
......@@ -285,6 +285,7 @@ set(BITMAP_SRCS
Options_Vias.xpm
opt_show_polygon.xpm
Orient.xpm
ortho.xpm
Pad_Sketch.xpm
pad.xpm
pads_mask_layers.xpm
......
/* XPM */
const char *ortho_xpm[]={
"16 15 2 1",
"# c #008080",
". c none",
"................",
"......####......",
".....######.....",
"....###..###....",
"....##....##....",
"...##......##...",
"...##......##...",
"...##......##...",
"...##......##...",
"...##......##...",
"....##....##....",
"....###..###....",
".....######.....",
"......####......",
"................"
};
......@@ -15,7 +15,7 @@
/* Implement wxSize array for grid list implementation. */
#include <wx/arrimpl.cpp>
WX_DEFINE_OBJARRAY( GridArray );
WX_DEFINE_OBJARRAY( GridArray )
BASE_SCREEN* ActiveScreen = NULL;
......
......@@ -44,7 +44,7 @@ ITEM_PICKER::ITEM_PICKER( EDA_BaseStruct* aItem, UndoRedoOpType aUndoRedoStatus
PICKED_ITEMS_LIST::PICKED_ITEMS_LIST()
{
m_Status = UR_UNSPECIFIED;
};
}
PICKED_ITEMS_LIST::~PICKED_ITEMS_LIST()
{
......@@ -321,7 +321,7 @@ bool PICKED_ITEMS_LIST::SetPickerFlags( int aFlags, unsigned aIdx )
/** function RemovePicker
* remove one entry (one picker) from the list of picked items
* remove one entry (one picker) from the list of picked items
* @param aIdx = index of the picker in the picked list
* @return true if ok, or false if did not exist
*/
......
......@@ -55,7 +55,7 @@
static inline double DegToRad( double deg )
{
return (deg * M_PI) / 180.0;
};
}
wxString wxColStr( wxColour c )
{
......@@ -180,17 +180,17 @@ wxSVGFileDC::wxSVGFileDC( wxString f )
{
// quarter 640x480 screen display at 72 dpi
Init( f, 320, 240, 72.0 );
};
}
wxSVGFileDC::wxSVGFileDC( wxString f, int Width, int Height )
{
Init( f, Width, Height, 72.0 );
};
}
wxSVGFileDC::wxSVGFileDC( wxString f, int Width, int Height, float dpi )
{
Init( f, Width, Height, dpi );
};
}
wxSVGFileDC::~wxSVGFileDC()
{
......@@ -217,7 +217,7 @@ void wxSVGFileDC::DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 )
CalcBoundingBox( x1, y1 );
CalcBoundingBox( x2, y2 );
return;
};
}
void wxSVGFileDC::DoDrawLines( int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset )
{
......
......@@ -26,7 +26,7 @@
#include <wx/arrimpl.cpp>
WX_DEFINE_OBJARRAY( Contributors );
WX_DEFINE_OBJARRAY( Contributors )
// Helper functions:
static wxString HtmlHyperlink( const wxString& url, const wxString& description = wxEmptyString );
......
......@@ -63,7 +63,7 @@ enum DrawPinShape {
LOWLEVEL_IN = 4,
LOWLEVEL_OUT = 8,
CLOCK_FALL = 0x10, /* this is common form for inverted clock in Eastern Block */
NONLOGIC = 0x20,
NONLOGIC = 0x20
};
......@@ -74,7 +74,7 @@ enum DrawPinOrient {
PIN_RIGHT = 'R',
PIN_LEFT = 'L',
PIN_UP = 'U',
PIN_DOWN = 'D',
PIN_DOWN = 'D'
};
......
......@@ -221,7 +221,7 @@ EDA_Rect SCH_JUNCTION::GetBoundingBox()
rect.Inflate( ( GetPenSize() + m_Size.x ) / 2 );
return rect;
};
}
/** Function HitTest
......
......@@ -190,7 +190,7 @@ bool WinEDA_SchematicFrame::LoadOneEEProject( const wxString& FileName, bool IsN
{
wxString prompt;
prompt.Printf( _( "Component library <%s> failed to load.\n\n\Error: %s" ),
prompt.Printf( _( "Component library <%s> failed to load.\n\n Error: %s" ),
GetChars( fn.GetFullPath() ),
GetChars( errMsg ) );
DisplayError( this, prompt );
......
......@@ -279,7 +279,7 @@ another pin. Continue?" ) );
DrawPanel->CursorOn( DC );
m_drawItem = NULL;
};
}
/**
......
......@@ -35,7 +35,7 @@ enum NumFieldType {
FIELD5,
FIELD6,
FIELD7,
FIELD8,
FIELD8
};
......
......@@ -54,7 +54,7 @@ enum AM_PRIMITIVE_ID {
AMP_OUTLINE = 4, // Free polyline (n corners + rotation)
AMP_POLYGON = 5, // Closed regular polygon(diameter, number of vertices (3 to 10), rotation)
AMP_MOIRE = 6, // A cross hair with n concentric circles + rotation
AMP_THERMAL = 7, // Thermal shape (pos, outer and inner diameter, cross hair thickness + rotation)
AMP_THERMAL = 7 // Thermal shape (pos, outer and inner diameter, cross hair thickness + rotation)
};
......
......@@ -65,7 +65,7 @@ enum Gerb_Interpolation
GERB_INTERPOL_LINEAR_01X,
GERB_INTERPOL_LINEAR_001X,
GERB_INTERPOL_ARC_NEG,
GERB_INTERPOL_ARC_POS,
GERB_INTERPOL_ARC_POS
};
......@@ -144,7 +144,7 @@ public:
FILE* m_FilesList[12]; // Files list
int m_FilesPtr; // Stack pointer for files list
int m_Selected_Tool; // Pour editions: Tool (Dcode) selectionn
int m_Selected_Tool; // Pour editions: Tool (Dcode) selectionn
int m_Transform[2][2]; // The rotation/mirror transformation matrix.
bool m_360Arc_enbl; // Enbl 360 deg circular interpolation
......
......@@ -28,7 +28,7 @@ enum id_gerbview_frm
ID_INC_LAYER_AND_APPEND_FILE,
ID_GERBVIEW_SHOW_SOURCE,
ID_GERBVIEW_EXPORT_TO_PCBNEW,
ID_GERBVIEW_POPUP_DELETE_DCODE_ITEMS,
ID_GERBVIEW_POPUP_DELETE_DCODE_ITEMS
};
......
......@@ -19,7 +19,7 @@ enum id_app_type {
APP_TYPE_PCBNEW,
APP_TYPE_CVPCB,
APP_TYPE_GERBVIEW,
APP_TYPE_KICAD,
APP_TYPE_KICAD
};
class wxConfigBase;
......@@ -227,6 +227,6 @@ public: WinEDA_App();
* of the application pointer all over the place or worse yet in a global
* variable.
*/
DECLARE_APP( WinEDA_App );
DECLARE_APP( WinEDA_App )
#endif /* APPL_WXSTRUCT_H */
......@@ -544,7 +544,7 @@ enum FILL_T {
NO_FILL, // Poly, Square, Circle, Arc = option No Fill
FILLED_SHAPE, /* Poly, Square, Circle, Arc = option Fill
* with current color ("Solid shape") */
FILLED_WITH_BG_BODYCOLOR, /* Poly, Square, Circle, Arc = option Fill
FILLED_WITH_BG_BODYCOLOR /* Poly, Square, Circle, Arc = option Fill
* with background body color, translucent
* (texts inside this shape can be seen)
* not filled in B&W mode when plotting or
......
......@@ -93,6 +93,7 @@ extern const char* delete_xpm[];
extern const char* directory_xpm[];
extern const char* display_options_xpm[];
extern const char* down_xpm[];
extern const char* ortho_xpm[];
extern const char* drag_module_xpm[];
extern const char* drag_outline_segment_xpm[];
extern const char* drag_pad_xpm[];
......
......@@ -65,7 +65,7 @@ enum DSN_SYNTAX_T {
DSN_RIGHT = -4, // right bracket, ')'
DSN_LEFT = -3, // left bracket, '('
DSN_STRING = -2, // a quoted string, stripped of the quotes
DSN_EOF = -1, // special case for end of file
DSN_EOF = -1 // special case for end of file
};
......
......@@ -102,18 +102,18 @@ static inline const wxChar* GetChars( const wxString& s )
#include "boost/typeof/typeof.hpp"
// we have to register the types used with the typeof keyword with boost
BOOST_TYPEOF_REGISTER_TYPE( wxPoint );
BOOST_TYPEOF_REGISTER_TYPE( wxSize );
BOOST_TYPEOF_REGISTER_TYPE( wxString );
BOOST_TYPEOF_REGISTER_TYPE( wxPoint )
BOOST_TYPEOF_REGISTER_TYPE( wxSize )
BOOST_TYPEOF_REGISTER_TYPE( wxString )
class DrawSheetLabelStruct;
BOOST_TYPEOF_REGISTER_TYPE( DrawSheetLabelStruct* );
BOOST_TYPEOF_REGISTER_TYPE( DrawSheetLabelStruct* )
class EDA_BaseStruct;
BOOST_TYPEOF_REGISTER_TYPE( EDA_BaseStruct* );
BOOST_TYPEOF_REGISTER_TYPE( EDA_BaseStruct* )
class D_PAD;
BOOST_TYPEOF_REGISTER_TYPE( D_PAD* );
BOOST_TYPEOF_REGISTER_TYPE( const D_PAD* );
BOOST_TYPEOF_REGISTER_TYPE( D_PAD* )
BOOST_TYPEOF_REGISTER_TYPE( const D_PAD* )
class BOARD_ITEM;
BOOST_TYPEOF_REGISTER_TYPE( BOARD_ITEM* );
BOOST_TYPEOF_REGISTER_TYPE( BOARD_ITEM* )
#define EXCHG( a, b ) { BOOST_TYPEOF( a ) __temp__ = (a); \
(a) = (b); \
......@@ -136,7 +136,7 @@ static inline void ADD_MENUITEM( wxMenu* menu, int id,
#endif /* !defined( __WXMAC__ ) */
menu->Append( l_item );
};
}
static inline void ADD_MENUITEM_WITH_HELP( wxMenu* menu, int id,
const wxString& text,
......@@ -152,7 +152,7 @@ static inline void ADD_MENUITEM_WITH_HELP( wxMenu* menu, int id,
#endif /* !defined( __WXMAC__ ) */
menu->Append( l_item );
};
}
#ifdef __WINDOWS__
static inline void ADD_MENUITEM_WITH_SUBMENU( wxMenu* menu, wxMenu* submenu,
......@@ -198,7 +198,7 @@ static inline void ADD_MENUITEM_WITH_SUBMENU( wxMenu* menu, wxMenu* submenu,
#endif /* !defined( __WXMAC__ ) */
menu->Append( l_item );
};
}
static inline void ADD_MENUITEM_WITH_HELP_AND_SUBMENU( wxMenu* menu,
wxMenu* submenu,
......@@ -217,7 +217,7 @@ static inline void ADD_MENUITEM_WITH_HELP_AND_SUBMENU( wxMenu* menu,
#endif /* !defined( __WXMAC__ ) */
menu->Append( l_item );
};
}
#endif
......
......@@ -21,7 +21,7 @@ enum paramcfg_id
PARAM_LIBNAME_LIST,
PARAM_WXSTRING,
PARAM_COMMAND_ERASE,
PARAM_FIELDNAME_LIST,
PARAM_FIELDNAME_LIST
};
#define MAX_COLOR 0x8001F
......
......@@ -480,7 +480,7 @@ public:
int aPrintMask, bool aPrintMirrorMode,
void * aData = NULL);
DECLARE_EVENT_TABLE();
DECLARE_EVENT_TABLE()
};
......
......@@ -28,7 +28,7 @@ RIGHT_KM_FRAME::RIGHT_KM_FRAME( WinEDA_MainFrame* parent ) :
wxDefaultPosition, wxDefaultSize,
wxTE_MULTILINE | wxSUNKEN_BORDER | wxTE_READONLY );
};
}
void RIGHT_KM_FRAME::OnSize( wxSizeEvent& event )
{
......
......@@ -50,7 +50,7 @@ enum id_kicad_frm {
ID_SELECT_PREFERED_PDF_BROWSER,
ID_SELECT_DEFAULT_PDF_BROWSER,
ID_SAVE_AND_ZIP_FILES,
ID_READ_ZIP_ARCHIVE,
ID_READ_ZIP_ARCHIVE
};
......@@ -133,7 +133,7 @@ enum TreeFileType {
TREE_NET,
TREE_UNKNOWN,
TREE_DIRECTORY,
TREE_MAX,
TREE_MAX
};
/** class RIGHT_KM_FRAME
......
......@@ -44,7 +44,7 @@ public:
};
WX_DECLARE_LIST( cmp, CmpList );
WX_DEFINE_LIST( CmpList );
WX_DEFINE_LIST( CmpList )
void WinEDA_PcbFrame::RecreateBOMFileFromBoard( wxCommandEvent& aEvent )
{
......
......@@ -204,9 +204,12 @@ void WinEDA_PcbFrame::Remove_One_Track( wxDC* DC, TRACK* pt_segm )
next_track = tracksegment->Next();
tracksegment->SetState( BUSY, OFF );
D( printf( "%s: track %p status=\"%s\"\n", __func__, tracksegment,
CONV_TO_UTF8( TRACK::ShowState( tracksegment->GetState( -1 ) ) )
); )
//D( printf( "%s: track %p status=\"%s\"\n", __func__, tracksegment,
// CONV_TO_UTF8( TRACK::ShowState( tracksegment->GetState( -1 ) ) )
// ); )
D( std::cout<<__func__<<": track "<<tracksegment<<" status=" \
<<CONV_TO_UTF8( TRACK::ShowState( tracksegment->GetState( -1 ) ) ) \
<<std::endl;)
GetBoard()->m_Track.Remove( tracksegment );
......
......@@ -52,7 +52,7 @@ enum {
GRID_VIASIZE,
GRID_VIADRILL,
GRID_uVIASIZE,
GRID_uVIADRILL,
GRID_uVIADRILL
};
const wxString DIALOG_DESIGN_RULES::wildCard = _( "* (Any)" );
......
......@@ -477,7 +477,7 @@ enum DSN_T {
T_write_resolution,
T_x,
T_xy,
T_y,
T_y
};
......
......@@ -86,7 +86,8 @@ int WinEDA_PcbFrame::EraseRedundantTrack(
/* Flags for cleaning the net. */
for( pt_del = BufDeb; pt_del; pt_del = pt_del->Next() )
{
D( printf( "track %p turning off BUSY | EDIT | CHAIN\n", pt_del ); )
//D( printf( "track %p turning off BUSY | EDIT | CHAIN\n", pt_del ); )
D( std::cout<<"track "<<pt_del<<" turning off BUSY | EDIT | CHAIN"<<std::endl; )
pt_del->SetState( BUSY | EDIT | CHAIN, OFF );
if( pt_del == BufEnd ) // Last segment reached
break;
......
......@@ -1193,7 +1193,7 @@ void CPolyLine::Hatch()
if( GetClosed() ) // If not closed, the poly is beeing created and not finalised. Not not hatch
{
enum {
MAXPTS = 100,
MAXPTS = 100
};
int xx[MAXPTS], yy[MAXPTS];
......
......@@ -164,13 +164,13 @@ void Bool_Engine::error( string text, string title )
Write_Log( "FATAL ERROR: ", title );
Write_Log( "FATAL ERROR: ", text );
throw Bool_Engine_Error( " Fatal Error", "Fatal Error", 9, 1 );
};
}
void Bool_Engine::info( string text, string title )
{
Write_Log( "FATAL ERROR: ", title );
Write_Log( "FATAL ERROR: ", text );
};
}
void Bool_Engine::SetMarge( double marge )
{
......
......@@ -88,7 +88,7 @@ kbGraph::~kbGraph()
kbLink* kbGraph::GetFirstLink()
{
return ( kbLink* ) _linklist->headitem();
};
}
void kbGraph::Prepare( int intersectionruns )
......@@ -2275,7 +2275,7 @@ void kbGraph::Make_Rounded_Shape( kbLink* a_link, double factor )
// make a link between the last and the first to close the graph
AddLink( _last_ins, _first );
};
}
//make the graph clockwise orientation,
//return if the graph needed redirection
......
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