13 #ifndef __A2DARTGLOB_H__
14 #define __A2DARTGLOB_H__
20 #include <wx/module.h>
22 #include "wx/geometry.h"
25 #ifdef A2DARTBASEMAKINGDLL
26 #define A2DARTBASEDLLEXP WXEXPORT
27 #define A2DARTBASEDLLEXP_DATA(type) WXEXPORT type
28 #define A2DARTBASEDLLEXP_CTORFN
29 #elif defined(WXART2D_USINGDLL)
30 #define A2DARTBASEDLLEXP WXIMPORT
31 #define A2DARTBASEDLLEXP_DATA(type) WXIMPORT type
32 #define A2DARTBASEDLLEXP_CTORFN
33 #else // not making nor using DLL
34 #define A2DARTBASEDLLEXP
35 #define A2DARTBASEDLLEXP_DATA(type) type
36 #define A2DARTBASEDLLEXP_CTORFN
51 A2DARTBASEDLLEXP_DATA(
extern const double )
wxPI;
54 extern A2DARTBASEDLLEXP
double wxDegToRad(
double deg );
57 extern A2DARTBASEDLLEXP
double wxRadToDeg(
double rad );
60 #define Round( x ) (int) floor( (x) + 0.5 )
63 extern A2DARTBASEDLLEXP
void Aberration(
double aber,
double angle,
double radius,
double& dphi,
unsigned int& segments );
66 inline double wxSqr(
double x ) {
return x * x; }
82 virtual bool OnInit();
83 virtual void OnExit();
107 void Aberration(
double angle,
double radius,
double& dphi,
unsigned int& segments );
120 static void SetRoundFactor(
double roundFactor ) { m_roundFactor = roundFactor; }
134 inline static void SetPrimitiveThreshold( wxUint16 pixels,
bool asrect =
true ) { m_drawingthreshold = pixels; m_asrectangle = asrect; }
189 static double m_poly2arcaber;
191 static double m_displayaberration;
193 static double m_roundFactor;
215 a2dDoMu(
double number,
double multi = 1,
bool normalize =
true );
217 a2dDoMu(
double number,
const wxString& multi );
219 a2dDoMu(
const wxString& number,
const wxString& multi );
222 a2dDoMu(
const wxString& numberMulti );
225 bool Eval(
const wxString& param );
250 operator double()
const;
253 int operator==(
const a2dDoMu& )
const;
254 int operator!=(
const a2dDoMu& )
const;
291 #include <wx/dynarray.h>
293 #include <wx/listimpl.cpp>
295 #if defined(WXART2D_USINGDLL)
296 template class A2DARTBASEDLLEXP std::allocator<wxPoint>;
297 template class A2DARTBASEDLLEXP std::vector<wxPoint>;
298 template class A2DARTBASEDLLEXP std::allocator<wxRealPoint>;
299 template class A2DARTBASEDLLEXP std::vector<wxRealPoint>;
309 void CalculateLineParameters(
const wxRealPoint& p1 ,
const wxRealPoint& p2 );
310 void CalculateXs(
double y );
323 WX_DECLARE_LIST_WITH_DECL(
a2dAET, a2dAETList,
class A2DARTBASEDLLEXP );
326 WX_DECLARE_LIST_WITH_DECL(
int, a2dCriticalPointList,
class A2DARTBASEDLLEXP );
328 #include <wx/listimpl.cpp>
331 WX_DECLARE_LIST_WITH_DECL( wxRegion, a2dClipRegionList,
class A2DARTBASEDLLEXP );
wxPoint2DDouble a2dPoint2D
this to define if coordinate numbers are integer or doubles
static void SetAccuracy(int accur)
when converting a number to a string this accuracy will be used
static wxUint16 GetPrimitiveThreshold()
get drawing threshold
static void SetAberPolyToArc(double aber)
conversion from polygon/polyline into arc in database units
wxString GetValueString() const
get the number 1.1 um -> "1.1 um"
const int SPLINE_STEP
number of steps when converting a spline to lines.
One Global instance of this class exists, in order to get to global needed objects.
static bool m_asrectangle
underneath the threshold draw rectangles if true else nothing
double wxDegToRad(double deg)
conversion from degrees to radians
a2dGlobal * a2dGlobals
global a2dCanvasGlobal to have easy access to global settings
a2dPathList & GetIconPathList()
Path for Icons and small bitmaps.
wxUint16 GetPolygonFillThreshold()
get threshold at which polygon is drawn filled or only outline
static int m_accuracy
how much fractional digits, when conversion to string
void SetPolygonFillThreshold(wxUint16 pixels)
set threshold at which polygon is drawn filled or only outline
initiation module for the wxArt2D library
store and convert number to number with unit and visa versa. e.g. 1.23e-6 => 1.23 * 1e-6 ...
a2dDrawStyle
Define the manner in which a2dCanvasView draws to the device.
double GetNumber() const
get the number 1.1 um -> 1.1
static void SetDisplayAberration(double aber)
set the display aberation, display of curved shapes
bool Eval(const wxString ¶m)
compose a unit based a string "1.1um"
static wxUint16 m_polygonFillThreshold
get threshold at which polygon is drawn filled or only outline
a2dPathList & GetFontPathList()
Path for Fonts.
static void SetAberArcToPoly(double aber)
conversion from arc into lines in database units
double m_number
non multiplied number
double wxRadToDeg(double rad)
conversion from radians to degrees
static bool GetMultiplierFromString(const wxString &mul, double &multi)
calculate how to get to meters from a multiplier string e.g. um => 1e-6
static void SetPrimitiveThreshold(wxUint16 pixels, bool asrect=true)
set drawing threshold to the given number of pixels
double GetValue() const
get value in meters
static double GetRoundFactor()
a2dPathList & GetImagePathList()
Path for Images.
static double GetDisplayAberration()
double wxSqr(double x)
good replacement for pow(x,2)
general modules header files all together.
double GetMultiplier() const
get the number 1.1 um -> 1e-6
void Aberration(double aber, double angle, double radius, double &dphi, unsigned int &segments)
calculate number of segments in an arc such that a certain accuracy is maintained ...
a2dDoMu & operator=(const a2dDoMu &)
copy
double m_multi
multiplier e.g. "um" will be 1e-6
static wxUint16 m_drawingthreshold
object smaller than this value will not be rendered
wxString GetMultiplierString() const
get the number 1.1 um -> "um"
static bool GetThresholdDrawRectangle()
underneath the threshold draw rectangles instead of the real object.
static double GetAberArcToPoly()
conversion from arc into lines in database units
wxString GetNumberString() const
get the number 1.1 um -> "1.1"
const double wxPI
defines PI
static double m_arc2polyaber
conversion from arc into lines in database units
class for storing paths and settings, which are used within the artbase module.
Used internal for scanned ( gradient etc. ) polygon filling.
static double GetAberPolyToArc()
conversion from polygon/polyline into arc in database units