math.h/PI integration
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30991 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -23,15 +23,6 @@
|
|||||||
#include "wx/image.h"
|
#include "wx/image.h"
|
||||||
#include "wx/numdlg.h"
|
#include "wx/numdlg.h"
|
||||||
|
|
||||||
/* GRG: This is not ANSI standard, define M_PI explicitly
|
|
||||||
#include <math.h> // M_PI
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef M_PI
|
|
||||||
#define M_PI 3.1415926535897932384626433832795
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
class MyApp: public wxApp
|
class MyApp: public wxApp
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@@ -30,8 +30,6 @@
|
|||||||
|
|
||||||
#include "wx/dc.h"
|
#include "wx/dc.h"
|
||||||
|
|
||||||
#include <math.h>
|
|
||||||
|
|
||||||
// bool wxDCBase::sm_cacheing = false;
|
// bool wxDCBase::sm_cacheing = false;
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
@@ -319,7 +317,7 @@ void wxDCBase::DoDrawSpline( wxList *points )
|
|||||||
if (node == NULL)
|
if (node == NULL)
|
||||||
// empty list
|
// empty list
|
||||||
return;
|
return;
|
||||||
|
|
||||||
p = (wxPoint *)node->GetData();
|
p = (wxPoint *)node->GetData();
|
||||||
|
|
||||||
x1 = p->x;
|
x1 = p->x;
|
||||||
@@ -766,7 +764,7 @@ void wxDCBase::Rotate( wxList* points, double angle, wxPoint center )
|
|||||||
{
|
{
|
||||||
if( angle != 0.0 )
|
if( angle != 0.0 )
|
||||||
{
|
{
|
||||||
double pi(3.1415926536);
|
double pi(M_PI);
|
||||||
double dSinA = -sin(angle*2.0*pi/360.0);
|
double dSinA = -sin(angle*2.0*pi/360.0);
|
||||||
double dCosA = cos(angle*2.0*pi/360.0);
|
double dCosA = cos(angle*2.0*pi/360.0);
|
||||||
for ( wxNode* node = points->First(); node; node = node->Next() )
|
for ( wxNode* node = points->First(); node; node = node->Next() )
|
||||||
@@ -794,7 +792,7 @@ void wxDCBase::CalculateEllipticPoints( wxList* points,
|
|||||||
wxCoord w, wxCoord h,
|
wxCoord w, wxCoord h,
|
||||||
double sa, double ea )
|
double sa, double ea )
|
||||||
{
|
{
|
||||||
double pi = 3.1415926535;
|
double pi = M_PI;
|
||||||
double sar = 0;
|
double sar = 0;
|
||||||
double ear = 0;
|
double ear = 0;
|
||||||
int xsa = 0;
|
int xsa = 0;
|
||||||
|
@@ -29,11 +29,6 @@
|
|||||||
#include "wx/geometry.h"
|
#include "wx/geometry.h"
|
||||||
#include "wx/datstrm.h"
|
#include "wx/datstrm.h"
|
||||||
|
|
||||||
// normally this is defined in <math.h>
|
|
||||||
#ifndef M_PI
|
|
||||||
#define M_PI 3.14159265358979323846
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// wxPoint2D
|
// wxPoint2D
|
||||||
//
|
//
|
||||||
|
@@ -25,12 +25,12 @@
|
|||||||
|
|
||||||
#ifndef WX_PRECOMP
|
#ifndef WX_PRECOMP
|
||||||
#include "wx/defs.h"
|
#include "wx/defs.h"
|
||||||
|
#include "wx/math.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/matrix.h"
|
#include "wx/matrix.h"
|
||||||
#include <math.h>
|
|
||||||
|
|
||||||
static const double pi = 3.1415926535;
|
static const double pi = M_PI;
|
||||||
|
|
||||||
wxTransformMatrix::wxTransformMatrix(void)
|
wxTransformMatrix::wxTransformMatrix(void)
|
||||||
{
|
{
|
||||||
|
@@ -23,7 +23,6 @@
|
|||||||
#include "wx/log.h"
|
#include "wx/log.h"
|
||||||
|
|
||||||
#if __MSL__ >= 0x6000
|
#if __MSL__ >= 0x6000
|
||||||
#include "math.h"
|
|
||||||
namespace std {}
|
namespace std {}
|
||||||
using namespace std ;
|
using namespace std ;
|
||||||
#endif
|
#endif
|
||||||
@@ -47,11 +46,7 @@ IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject)
|
|||||||
#define twips2mm 0.0176388888889
|
#define twips2mm 0.0176388888889
|
||||||
#define mm2pt 2.83464566929
|
#define mm2pt 2.83464566929
|
||||||
#define pt2mm 0.352777777778
|
#define pt2mm 0.352777777778
|
||||||
#if !defined( __DARWIN__ ) || defined(__MWERKS__)
|
|
||||||
#ifndef M_PI
|
|
||||||
const double M_PI = 3.14159265358979 ;
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
const double RAD2DEG = 180.0 / M_PI;
|
const double RAD2DEG = 180.0 / M_PI;
|
||||||
const short kEmulatedMode = -1 ;
|
const short kEmulatedMode = -1 ;
|
||||||
const short kUnsupportedMode = -2 ;
|
const short kUnsupportedMode = -2 ;
|
||||||
|
@@ -23,7 +23,7 @@
|
|||||||
#include "wx/log.h"
|
#include "wx/log.h"
|
||||||
|
|
||||||
#if __MSL__ >= 0x6000
|
#if __MSL__ >= 0x6000
|
||||||
#include "math.h"
|
namespace std {}
|
||||||
using namespace std ;
|
using namespace std ;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -46,11 +46,7 @@ IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject)
|
|||||||
#define twips2mm 0.0176388888889
|
#define twips2mm 0.0176388888889
|
||||||
#define mm2pt 2.83464566929
|
#define mm2pt 2.83464566929
|
||||||
#define pt2mm 0.352777777778
|
#define pt2mm 0.352777777778
|
||||||
#if !defined( __DARWIN__ ) || defined(__MWERKS__)
|
|
||||||
#ifndef M_PI
|
|
||||||
const double M_PI = 3.14159265358979 ;
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
const double RAD2DEG = 180.0 / M_PI;
|
const double RAD2DEG = 180.0 / M_PI;
|
||||||
const short kEmulatedMode = -1 ;
|
const short kEmulatedMode = -1 ;
|
||||||
const short kUnsupportedMode = -2 ;
|
const short kUnsupportedMode = -2 ;
|
||||||
|
@@ -39,7 +39,6 @@
|
|||||||
#include "wx/log.h"
|
#include "wx/log.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <math.h>
|
|
||||||
#include <mgraph.hpp>
|
#include <mgraph.hpp>
|
||||||
|
|
||||||
|
|
||||||
@@ -48,10 +47,6 @@
|
|||||||
// constants
|
// constants
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
#ifndef M_PI
|
|
||||||
#define M_PI 3.14159265358979323846
|
|
||||||
#endif
|
|
||||||
|
|
||||||
const double mm2inches = 0.0393700787402;
|
const double mm2inches = 0.0393700787402;
|
||||||
const double inches2mm = 25.4;
|
const double inches2mm = 25.4;
|
||||||
const double mm2twips = 56.6929133859;
|
const double mm2twips = 56.6929133859;
|
||||||
|
@@ -54,7 +54,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <math.h>
|
|
||||||
|
|
||||||
#if wxUSE_COMMON_DIALOGS && !defined(__WXMICROWIN__)
|
#if wxUSE_COMMON_DIALOGS && !defined(__WXMICROWIN__)
|
||||||
#include <commdlg.h>
|
#include <commdlg.h>
|
||||||
@@ -94,11 +93,6 @@ static const int VIEWPORT_EXTENT = 1000;
|
|||||||
static const int MM_POINTS = 9;
|
static const int MM_POINTS = 9;
|
||||||
static const int MM_METRIC = 10;
|
static const int MM_METRIC = 10;
|
||||||
|
|
||||||
// usually this is defined in math.h
|
|
||||||
#ifndef M_PI
|
|
||||||
static const double M_PI = 3.14159265358979323846;
|
|
||||||
#endif // M_PI
|
|
||||||
|
|
||||||
// ROPs which don't have standard names (see "Ternary Raster Operations" in the
|
// ROPs which don't have standard names (see "Ternary Raster Operations" in the
|
||||||
// MSDN docs for how this and other numbers in wxDC::Blit() are obtained)
|
// MSDN docs for how this and other numbers in wxDC::Blit() are obtained)
|
||||||
#define DSTCOPY 0x00AA0029 // a.k.a. NOP operation
|
#define DSTCOPY 0x00AA0029 // a.k.a. NOP operation
|
||||||
|
@@ -32,7 +32,6 @@
|
|||||||
#include "wx/dcprint.h"
|
#include "wx/dcprint.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <math.h>
|
|
||||||
|
|
||||||
#include "wx/os2/private.h"
|
#include "wx/os2/private.h"
|
||||||
|
|
||||||
@@ -68,11 +67,6 @@ static const int VIEWPORT_EXTENT = 1000;
|
|||||||
static const int MM_POINTS = 9;
|
static const int MM_POINTS = 9;
|
||||||
static const int MM_METRIC = 10;
|
static const int MM_METRIC = 10;
|
||||||
|
|
||||||
// usually this is defined in math.h
|
|
||||||
#ifndef M_PI
|
|
||||||
static const double M_PI = 3.14159265358979323846;
|
|
||||||
#endif // M_PI
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// private functions
|
// private functions
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
// Author: William Osborne
|
// Author: William Osborne
|
||||||
// Modified by:
|
// Modified by:
|
||||||
// Created: 10/13/04
|
// Created: 10/13/04
|
||||||
// RCS-ID: $Id:
|
// RCS-ID: $Id:
|
||||||
// Copyright: (c) William Osborne
|
// Copyright: (c) William Osborne
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
@@ -50,7 +50,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <math.h>
|
|
||||||
|
|
||||||
#ifndef AC_SRC_ALPHA
|
#ifndef AC_SRC_ALPHA
|
||||||
#define AC_SRC_ALPHA 1
|
#define AC_SRC_ALPHA 1
|
||||||
@@ -72,11 +71,6 @@ static const int VIEWPORT_EXTENT = 1000;
|
|||||||
static const int MM_POINTS = 9;
|
static const int MM_POINTS = 9;
|
||||||
static const int MM_METRIC = 10;
|
static const int MM_METRIC = 10;
|
||||||
|
|
||||||
// usually this is defined in math.h
|
|
||||||
#ifndef M_PI
|
|
||||||
static const double M_PI = 3.14159265358979323846;
|
|
||||||
#endif // M_PI
|
|
||||||
|
|
||||||
#define DSTCOPY 0x00AA0029
|
#define DSTCOPY 0x00AA0029
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user