KiCad PCB EDA Suite
mpBitmapLayer Class Reference

This virtual class represents objects that can be moved to an arbitrary 2D location+rotation. More...

#include <mathplot.h>

Inheritance diagram for mpBitmapLayer:
mpLayer

Public Member Functions

 mpBitmapLayer ()
 Default constructor. More...
 
virtual ~mpBitmapLayer ()
 
void GetBitmapCopy (wxImage &outBmp) const
 Returns a copy of the current bitmap assigned to the layer. More...
 
void SetBitmap (const wxImage &inBmp, double x, double y, double lx, double ly)
 Change the bitmap associated with the layer (to update the screen, refresh the mpWindow). More...
 
virtual bool HasBBox () override
 Check whether this layer has a bounding box. More...
 
virtual double GetMinX () override
 Get inclusive left border of bounding box. More...
 
virtual double GetMaxX () override
 Get inclusive right border of bounding box. More...
 
virtual double GetMinY () override
 Get inclusive bottom border of bounding box. More...
 
virtual double GetMaxY () override
 Get inclusive top border of bounding box. More...
 
virtual void Plot (wxDC &dc, mpWindow &w) override
 Plot given view of layer to the given device context. More...
 
void SetAlign (int align)
 Set label axis alignment. More...
 
virtual bool IsInfo ()
 Check whether the layer is an info box. More...
 
const wxString & GetName () const
 Get layer name. More...
 
const wxFont & GetFont () const
 Get font set for this layer. More...
 
const wxPen & GetPen () const
 Get pen set for this layer. More...
 
void SetContinuity (bool continuity)
 Set the 'continuity' property of the layer (true:draws a continuous line, false:draws separate points). More...
 
bool GetContinuity () const
 Gets the 'continuity' property of the layer. More...
 
void ShowName (bool show)
 Shows or hides the text label with the name of the layer (default is visible). More...
 
void SetName (wxString name)
 Set layer name. More...
 
void SetFont (wxFont &font)
 Set layer font. More...
 
void SetPen (wxPen pen)
 Set layer pen. More...
 
void SetDrawOutsideMargins (bool drawModeOutside)
 Set Draw mode: inside or outside margins. More...
 
bool GetDrawOutsideMargins ()
 Get Draw mode: inside or outside margins. More...
 
wxBitmap GetColourSquare (int side=16)
 Get a small square bitmap filled with the colour of the pen used in the layer. More...
 
mpLayerType GetLayerType ()
 Get layer type: a Layer can be of different types: plot lines, axis, info boxes, etc, this method returns the right value. More...
 
bool IsVisible ()
 Checks whether the layer is visible or not. More...
 
void SetVisible (bool show)
 Sets layer visibility. More...
 
const wxBrush & GetBrush () const
 Get brush set for this layer. More...
 
void SetBrush (wxBrush brush)
 Set layer brush. More...
 

Protected Attributes

int m_flags
 
wxImage m_bitmap
 The internal copy of the Bitmap: More...
 
wxBitmap m_scaledBitmap
 
wxCoord m_scaledBitmap_offset_x
 
wxCoord m_scaledBitmap_offset_y
 
bool m_validImg
 
double m_min_x
 The shape of the bitmap: More...
 
double m_max_x
 
double m_min_y
 
double m_max_y
 
wxFont m_font
 
wxPen m_pen
 
wxBrush m_brush
 
wxString m_name
 
bool m_continuous
 
bool m_showName
 
bool m_drawOutsideMargins
 
mpLayerType m_type
 
bool m_visible
 

Detailed Description

This virtual class represents objects that can be moved to an arbitrary 2D location+rotation.

The current transformation is set through SetCoordinateBase. To ease the implementation of descendent classes, mpMovableObject will be in charge of Bounding Box computation and layer render, assuming that the object updates its shape in m_shape_xs & m_shape_ys.

Definition at line 1947 of file mathplot.h.

Constructor & Destructor Documentation

◆ mpBitmapLayer()

mpBitmapLayer::mpBitmapLayer ( )
inline

Default constructor.

Definition at line 1952 of file mathplot.h.

1953  {
1954  m_min_x = m_max_x =
1955  m_min_y = m_max_y = 0;
1956  m_validImg = false;
1958  }
double m_max_y
Definition: mathplot.h:2013
double m_min_y
Definition: mathplot.h:2013
double m_max_x
Definition: mathplot.h:2013
bool m_validImg
Definition: mathplot.h:2009
mpLayerType m_type
Definition: mathplot.h:322
double m_min_x
The shape of the bitmap:
Definition: mathplot.h:2013

References mpLAYER_BITMAP.

◆ ~mpBitmapLayer()

virtual mpBitmapLayer::~mpBitmapLayer ( )
inlinevirtual

Definition at line 1960 of file mathplot.h.

1960 {};

Member Function Documentation

◆ GetBitmapCopy()

void mpBitmapLayer::GetBitmapCopy ( wxImage &  outBmp) const

Returns a copy of the current bitmap assigned to the layer.

Definition at line 3914 of file mathplot.cpp.

3915 {
3916  if( m_validImg )
3917  outBmp = m_bitmap;
3918 }
bool m_validImg
Definition: mathplot.h:2009
wxImage m_bitmap
The internal copy of the Bitmap:
Definition: mathplot.h:2005

References m_bitmap, and m_validImg.

◆ GetBrush()

const wxBrush& mpLayer::GetBrush ( ) const
inlineinherited

Get brush set for this layer.

Returns
brush.

Definition at line 307 of file mathplot.h.

307 { return m_brush; };
wxBrush m_brush
Definition: mathplot.h:317

◆ GetColourSquare()

wxBitmap mpLayer::GetColourSquare ( int  side = 16)
inherited

Get a small square bitmap filled with the colour of the pen used in the layer.

Useful to create legends or similar reference to the layers.

Parameters
sideside length in pixels
Returns
a wxBitmap filled with layer's colour

Definition at line 83 of file mathplot.cpp.

84 {
85  wxBitmap square( side, side, -1 );
86  wxColour filler = m_pen.GetColour();
87  wxBrush brush( filler, wxBRUSHSTYLE_SOLID );
88  wxMemoryDC dc;
89 
90  dc.SelectObject( square );
91  dc.SetBackground( brush );
92  dc.Clear();
93  dc.SelectObject( wxNullBitmap );
94  return square;
95 }
double square(double x)
wxPen m_pen
Definition: mathplot.h:316

References mpLayer::m_pen, and square().

◆ GetContinuity()

bool mpLayer::GetContinuity ( ) const
inlineinherited

Gets the 'continuity' property of the layer.

See also
SetContinuity

Definition at line 259 of file mathplot.h.

259 { return m_continuous; }
bool m_continuous
Definition: mathplot.h:319

◆ GetDrawOutsideMargins()

bool mpLayer::GetDrawOutsideMargins ( )
inlineinherited

Get Draw mode: inside or outside margins.

Returns
The draw mode

Definition at line 286 of file mathplot.h.

286 { return m_drawOutsideMargins; };
bool m_drawOutsideMargins
Definition: mathplot.h:321

◆ GetFont()

const wxFont& mpLayer::GetFont ( ) const
inlineinherited

Get font set for this layer.

Returns
Font

Definition at line 244 of file mathplot.h.

244 { return m_font; }
wxFont m_font
Definition: mathplot.h:311

◆ GetLayerType()

mpLayerType mpLayer::GetLayerType ( )
inlineinherited

Get layer type: a Layer can be of different types: plot lines, axis, info boxes, etc, this method returns the right value.

Returns
An integer indicating layer type

Definition at line 295 of file mathplot.h.

295 { return m_type; };
mpLayerType m_type
Definition: mathplot.h:322

Referenced by mpInfoLegend::Plot().

◆ GetMaxX()

virtual double mpBitmapLayer::GetMaxX ( )
inlineoverridevirtual

Get inclusive right border of bounding box.

Reimplemented from mpLayer.

Definition at line 1983 of file mathplot.h.

1983 { return m_max_x; }
double m_max_x
Definition: mathplot.h:2013

◆ GetMaxY()

virtual double mpBitmapLayer::GetMaxY ( )
inlineoverridevirtual

Get inclusive top border of bounding box.

Reimplemented from mpLayer.

Definition at line 1991 of file mathplot.h.

1991 { return m_max_y; }
double m_max_y
Definition: mathplot.h:2013

◆ GetMinX()

virtual double mpBitmapLayer::GetMinX ( )
inlineoverridevirtual

Get inclusive left border of bounding box.

Reimplemented from mpLayer.

Definition at line 1979 of file mathplot.h.

1979 { return m_min_x; }
double m_min_x
The shape of the bitmap:
Definition: mathplot.h:2013

◆ GetMinY()

virtual double mpBitmapLayer::GetMinY ( )
inlineoverridevirtual

Get inclusive bottom border of bounding box.

Reimplemented from mpLayer.

Definition at line 1987 of file mathplot.h.

1987 { return m_min_y; }
double m_min_y
Definition: mathplot.h:2013

◆ GetName()

const wxString& mpLayer::GetName ( void  ) const
inlineinherited

Get layer name.

Returns
Name

Definition at line 239 of file mathplot.h.

239 { return m_name; }
wxString m_name
Definition: mathplot.h:318

Referenced by SIM_PLOT_PANEL::GetLabelX(), SIM_PLOT_PANEL::GetLabelY1(), SIM_PLOT_PANEL::GetLabelY2(), mpInfoLegend::Plot(), and mpText::Plot().

◆ GetPen()

const wxPen& mpLayer::GetPen ( ) const
inlineinherited

Get pen set for this layer.

Returns
Pen

Definition at line 249 of file mathplot.h.

249 { return m_pen; }
wxPen m_pen
Definition: mathplot.h:316

Referenced by mpInfoLegend::Plot().

◆ HasBBox()

virtual bool mpBitmapLayer::HasBBox ( )
inlineoverridevirtual

Check whether this layer has a bounding box.

The default implementation returns TRUE. Override and return FALSE if your mpLayer implementation should be ignored by the calculation of the global bounding box for all layers in a mpWindow.

Return values
TRUEHas bounding box
FALSEHas not bounding box

Reimplemented from mpLayer.

Definition at line 1975 of file mathplot.h.

1975 { return true; }

Referenced by Plot().

◆ IsInfo()

virtual bool mpLayer::IsInfo ( )
inlinevirtualinherited

Check whether the layer is an info box.

The default implementation returns FALSE. It is overrided to TRUE for mpInfoLayer class and its derivative. It is necessary to define mouse actions behaviour over info boxes.

Returns
whether the layer is an info boxes
See also
mpInfoLayer::IsInfo

Reimplemented in mpInfoLayer.

Definition at line 171 of file mathplot.h.

171 { return false; };

◆ IsVisible()

bool mpLayer::IsVisible ( )
inlineinherited

Checks whether the layer is visible or not.

Returns
true if visible

Definition at line 299 of file mathplot.h.

299 { return m_visible; };
bool m_visible
Definition: mathplot.h:323

Referenced by mpWindow::IsLayerVisible(), SIM_PLOT_PANEL::IsLegendShown(), and mpInfoLegend::Plot().

◆ Plot()

void mpBitmapLayer::Plot ( wxDC &  dc,
mpWindow w 
)
overridevirtual

Plot given view of layer to the given device context.

An implementation of this function has to transform layer coordinates to wxDC coordinates based on the view parameters retrievable from the mpWindow passed in w. Note that the public methods of mpWindow: x2p,y2p and p2x,p2y are already provided which transform layer coordinates to DC pixel coordinates, and user code should rely on them for portability and future changes to be applied transparently, instead of implementing the following formulas manually.

The passed device context dc has its coordinate origin set to the top-left corner of the visible area (the default). The coordinate orientation is as shown in the following picture:

(wxDC origin 0,0)
x-------------> ascending X ----------------+
|                                           |
|                                           |
|  V ascending Y                            |
|                                           |
|                                           |
|                                           |
|+------------------------------------------+  <-- right-bottom corner of the mpWindow visible area.

Note that Y ascends in downward direction, whereas the usual vertical orientation for mathematical plots is vice versa. Thus Y-orientation will be swapped usually, when transforming between wxDC and mpLayer coordinates. This change of coordinates is taken into account in the methods p2x,p2y,x2p,y2p.

Rules for transformation between mpLayer and wxDC coordinates

dc_X = (layer_X - mpWindow::GetPosX()) * mpWindow::GetScaleX()
dc_Y = (mpWindow::GetPosY() - layer_Y) * mpWindow::GetScaleY() // swapping Y-orientation
layer_X = (dc_X / mpWindow::GetScaleX()) + mpWindow::GetPosX() // scale guaranteed to be not 0
layer_Y = mpWindow::GetPosY() - (dc_Y / mpWindow::GetScaleY()) // swapping Y-orientation
Parameters
dcDevice context to plot to.
wView to plot. The visible area can be retrieved from this object.
See also
mpWindow::p2x,mpWindow::p2y,mpWindow::x2p,mpWindow::y2p

Implements mpLayer.

Definition at line 3939 of file mathplot.cpp.

3940 {
3941  if( m_visible && m_validImg )
3942  {
3943  /* 1st: We compute (x0,y0)-(x1,y1), the pixel coordinates of the real outer limits
3944  * of the image rectangle within the (screen) mpWindow. Note that these coordinates
3945  * might fall well far away from the real view limits when the user zoom in.
3946  *
3947  * 2nd: We compute (dx0,dy0)-(dx1,dy1), the pixel coordinates the rectangle that will
3948  * be actually drawn into the mpWindow, i.e. the clipped real rectangle that
3949  * avoids the non-visible parts. (offset_x,offset_y) are the pixel coordinates
3950  * that correspond to the window point (dx0,dy0) within the image "m_bitmap", and
3951  * (b_width,b_height) is the size of the bitmap patch that will be drawn.
3952  *
3953  * (x0,y0) ................. (x1,y0)
3954  * . .
3955  * . .
3956  * (x0,y1) ................ (x1,y1)
3957  * (In pixels!!)
3958  */
3959 
3960  // 1st step -------------------------------
3961  wxCoord x0 = w.x2p( m_min_x );
3962  wxCoord y0 = w.y2p( m_max_y );
3963  wxCoord x1 = w.x2p( m_max_x );
3964  wxCoord y1 = w.y2p( m_min_y );
3965 
3966  // 2nd step -------------------------------
3967  // Precompute the size of the actual bitmap pixel on the screen (e.g. will be >1 if zoomed in)
3968  double screenPixelX = ( x1 - x0 ) / (double) m_bitmap.GetWidth();
3969  double screenPixelY = ( y1 - y0 ) / (double) m_bitmap.GetHeight();
3970 
3971  // The minimum number of pixels that the streched image will overpass the actual mpWindow borders:
3972  wxCoord borderMarginX = (wxCoord) (screenPixelX + 1); // ceil
3973  wxCoord borderMarginY = (wxCoord) (screenPixelY + 1); // ceil
3974 
3975  // The actual drawn rectangle (dx0,dy0)-(dx1,dy1) is (x0,y0)-(x1,y1) clipped:
3976  wxCoord dx0 = x0, dx1 = x1, dy0 = y0, dy1 = y1;
3977 
3978  if( dx0<0 )
3979  dx0 = -borderMarginX;
3980 
3981  if( dy0<0 )
3982  dy0 = -borderMarginY;
3983 
3984  if( dx1>w.GetScrX() )
3985  dx1 = w.GetScrX() + borderMarginX;
3986 
3987  if( dy1>w.GetScrY() )
3988  dy1 = w.GetScrY() + borderMarginY;
3989 
3990  // For convenience, compute the width/height of the rectangle to be actually drawn:
3991  wxCoord d_width = dx1 - dx0 + 1;
3992  wxCoord d_height = dy1 - dy0 + 1;
3993 
3994  // Compute the pixel offsets in the internally stored bitmap:
3995  wxCoord offset_x = (wxCoord) ( (dx0 - x0) / screenPixelX );
3996  wxCoord offset_y = (wxCoord) ( (dy0 - y0) / screenPixelY );
3997 
3998  // and the size in pixel of the area to be actually drawn from the internally stored bitmap:
3999  wxCoord b_width = (wxCoord) ( (dx1 - dx0 + 1) / screenPixelX );
4000  wxCoord b_height = (wxCoord) ( (dy1 - dy0 + 1) / screenPixelY );
4001 
4002 #ifdef MATHPLOT_DO_LOGGING
4003  wxLogMessage( "[mpBitmapLayer::Plot] screenPixel: x=%f y=%f d_width=%ix%i",
4004  screenPixelX,
4005  screenPixelY,
4006  d_width,
4007  d_height );
4008  wxLogMessage( "[mpBitmapLayer::Plot] offset: x=%i y=%i bmpWidth=%ix%i",
4009  offset_x,
4010  offset_y,
4011  b_width,
4012  b_height );
4013 #endif
4014 
4015  // Is there any visible region?
4016  if( d_width>0 && d_height>0 )
4017  {
4018  // Build the scaled bitmap from the image, only if it has changed:
4019  if( m_scaledBitmap.GetWidth()!=d_width
4020  || m_scaledBitmap.GetHeight()!=d_height
4021  || m_scaledBitmap_offset_x != offset_x
4022  || m_scaledBitmap_offset_y != offset_y )
4023  {
4024  wxRect r( wxRect( offset_x, offset_y, b_width, b_height ) );
4025 
4026  // Just for the case....
4027  if( r.x<0 )
4028  r.x = 0;
4029 
4030  if( r.y<0 )
4031  r.y = 0;
4032 
4033  if( r.width>m_bitmap.GetWidth() )
4034  r.width = m_bitmap.GetWidth();
4035 
4036  if( r.height>m_bitmap.GetHeight() )
4037  r.height = m_bitmap.GetHeight();
4038 
4039  m_scaledBitmap = wxBitmap(
4040  wxBitmap( m_bitmap ).GetSubBitmap( r ).ConvertToImage()
4041  .Scale( d_width, d_height ) );
4042  m_scaledBitmap_offset_x = offset_x;
4043  m_scaledBitmap_offset_y = offset_y;
4044  }
4045 
4046  // Draw it:
4047  dc.DrawBitmap( m_scaledBitmap, dx0, dy0, true );
4048  }
4049  }
4050 
4051  // Draw the name label
4052  if( !m_name.IsEmpty() && m_showName )
4053  {
4054  dc.SetFont( m_font );
4055 
4056  wxCoord tx, ty;
4057  dc.GetTextExtent( m_name, &tx, &ty );
4058 
4059  if( HasBBox() )
4060  {
4061  wxCoord sx = (wxCoord) ( ( m_max_x - w.GetPosX() ) * w.GetScaleX() );
4062  wxCoord sy = (wxCoord) ( (w.GetPosY() - m_max_y ) * w.GetScaleY() );
4063 
4064  tx = sx - tx - 8;
4065  ty = sy - 8 - ty;
4066  }
4067  else
4068  {
4069  const int sx = w.GetScrX() >> 1;
4070  const int sy = w.GetScrY() >> 1;
4071 
4072  if( (m_flags & mpALIGNMASK) == mpALIGN_NE )
4073  {
4074  tx = sx - tx - 8;
4075  ty = -sy + 8;
4076  }
4077  else if( (m_flags & mpALIGNMASK) == mpALIGN_NW )
4078  {
4079  tx = -sx + 8;
4080  ty = -sy + 8;
4081  }
4082  else if( (m_flags & mpALIGNMASK) == mpALIGN_SW )
4083  {
4084  tx = -sx + 8;
4085  ty = sy - 8 - ty;
4086  }
4087  else
4088  {
4089  tx = sx - tx - 8;
4090  ty = sy - 8 - ty;
4091  }
4092  }
4093 
4094  dc.DrawText( m_name, tx, ty );
4095  }
4096 }
double m_max_y
Definition: mathplot.h:2013
#define mpALIGN_NW
Aligns label to north-west.
Definition: mathplot.h:508
wxBitmap m_scaledBitmap
Definition: mathplot.h:2006
double GetPosY(void) const
Definition: mathplot.h:1127
double GetScaleX(void) const
Definition: mathplot.h:1106
double GetScaleY(void) const
Definition: mathplot.h:1113
double m_min_y
Definition: mathplot.h:2013
double GetPosX(void) const
Definition: mathplot.h:1120
bool m_visible
Definition: mathplot.h:323
wxCoord m_scaledBitmap_offset_x
Definition: mathplot.h:2007
wxCoord y2p(double y)
Converts graph (floating point) coordinates into mpWindow (screen) pixel coordinates,...
Definition: mathplot.h:1204
double m_max_x
Definition: mathplot.h:2013
int GetScrX(void) const
Get current view's X dimension in device context units.
Definition: mathplot.h:1135
wxFont m_font
Definition: mathplot.h:311
#define mpALIGN_NE
Aligns label to north-east.
Definition: mathplot.h:506
#define mpALIGNMASK
Definition: mathplot.h:476
virtual bool HasBBox() override
Check whether this layer has a bounding box.
Definition: mathplot.h:1975
bool m_validImg
Definition: mathplot.h:2009
wxImage m_bitmap
The internal copy of the Bitmap:
Definition: mathplot.h:2005
bool m_showName
Definition: mathplot.h:320
wxCoord x2p(double x)
Converts graph (floating point) coordinates into mpWindow (screen) pixel coordinates,...
Definition: mathplot.h:1199
wxCoord m_scaledBitmap_offset_y
Definition: mathplot.h:2007
wxString m_name
Definition: mathplot.h:318
int GetScrY(void) const
Get current view's Y dimension in device context units.
Definition: mathplot.h:1144
double m_min_x
The shape of the bitmap:
Definition: mathplot.h:2013
#define mpALIGN_SW
Aligns label to south-west.
Definition: mathplot.h:510

References mpWindow::GetPosX(), mpWindow::GetPosY(), mpWindow::GetScaleX(), mpWindow::GetScaleY(), mpWindow::GetScrX(), mpWindow::GetScrY(), HasBBox(), m_bitmap, m_flags, mpLayer::m_font, m_max_x, m_max_y, m_min_x, m_min_y, mpLayer::m_name, m_scaledBitmap, m_scaledBitmap_offset_x, m_scaledBitmap_offset_y, mpLayer::m_showName, m_validImg, mpLayer::m_visible, mpALIGN_NE, mpALIGN_NW, mpALIGN_SW, mpALIGNMASK, mpWindow::x2p(), and mpWindow::y2p().

◆ SetAlign()

void mpBitmapLayer::SetAlign ( int  align)
inline

Set label axis alignment.

Parameters
alignalignment (choose between mpALIGN_NE, mpALIGN_NW, mpALIGN_SW, mpALIGN_SE

Definition at line 1998 of file mathplot.h.

1998 { m_flags = align; };

◆ SetBitmap()

void mpBitmapLayer::SetBitmap ( const wxImage &  inBmp,
double  x,
double  y,
double  lx,
double  ly 
)

Change the bitmap associated with the layer (to update the screen, refresh the mpWindow).

Parameters
inBmpThe bitmap to associate. A copy is made, thus it can be released after calling this.
xThe left corner X coordinate (in plot units).
yThe top corner Y coordinate (in plot units).
lxThe width in plot units.
lyThe height in plot units.

Definition at line 3921 of file mathplot.cpp.

3922 {
3923  if( !inBmp.Ok() )
3924  {
3925  wxLogError( wxT( "[mpBitmapLayer] Assigned bitmap is not Ok()!" ) );
3926  }
3927  else
3928  {
3929  m_bitmap = inBmp; // .GetSubBitmap( wxRect(0, 0, inBmp.GetWidth(), inBmp.GetHeight()));
3930  m_min_x = x;
3931  m_min_y = y;
3932  m_max_x = x + lx;
3933  m_max_y = y + ly;
3934  m_validImg = true;
3935  }
3936 }
double m_max_y
Definition: mathplot.h:2013
double m_min_y
Definition: mathplot.h:2013
double m_max_x
Definition: mathplot.h:2013
bool m_validImg
Definition: mathplot.h:2009
wxImage m_bitmap
The internal copy of the Bitmap:
Definition: mathplot.h:2005
double m_min_x
The shape of the bitmap:
Definition: mathplot.h:2013

References m_bitmap, m_max_x, m_max_y, m_min_x, m_min_y, and m_validImg.

◆ SetBrush()

void mpLayer::SetBrush ( wxBrush  brush)
inlineinherited

Set layer brush.

Parameters
brushbrush, will be copied to internal class member

Definition at line 311 of file mathplot.h.

311 { m_brush = brush; };
wxBrush m_brush
Definition: mathplot.h:317

◆ SetContinuity()

void mpLayer::SetContinuity ( bool  continuity)
inlineinherited

Set the 'continuity' property of the layer (true:draws a continuous line, false:draws separate points).

See also
GetContinuity

Definition at line 254 of file mathplot.h.

254 { m_continuous = continuity; }
bool m_continuous
Definition: mathplot.h:319

Referenced by TRACE::TRACE().

◆ SetDrawOutsideMargins()

void mpLayer::SetDrawOutsideMargins ( bool  drawModeOutside)
inlineinherited

Set Draw mode: inside or outside margins.

Default is outside, which allows the layer to draw up to the mpWindow border.

Parameters
drawModeOutsideThe draw mode to be set

Definition at line 282 of file mathplot.h.

282 { m_drawOutsideMargins = drawModeOutside; };
bool m_drawOutsideMargins
Definition: mathplot.h:321

Referenced by CURSOR::CURSOR(), and TRACE::TRACE().

◆ SetFont()

void mpLayer::SetFont ( wxFont &  font)
inlineinherited

Set layer font.

Parameters
fontFont, will be copied to internal class member

Definition at line 273 of file mathplot.h.

273 { m_font = font; }
wxFont m_font
Definition: mathplot.h:311

◆ SetName()

void mpLayer::SetName ( wxString  name)
inlineinherited

Set layer name.

Parameters
nameName, will be copied to internal class member

Definition at line 268 of file mathplot.h.

268 { m_name = name; }
const char * name
Definition: DXF_plotter.cpp:60
wxString m_name
Definition: mathplot.h:318

References name.

◆ SetPen()

void mpLayer::SetPen ( wxPen  pen)
inlineinherited

Set layer pen.

Parameters
penPen, will be copied to internal class member

Definition at line 278 of file mathplot.h.

278 { m_pen = pen; }
wxPen m_pen
Definition: mathplot.h:316

Referenced by SIM_PLOT_PANEL::UpdateTraceStyle().

◆ SetVisible()

void mpLayer::SetVisible ( bool  show)
inlineinherited

Sets layer visibility.

Parameters
showvisibility bool.

Definition at line 303 of file mathplot.h.

303 { m_visible = show; };
bool m_visible
Definition: mathplot.h:323

Referenced by mpWindow::SetLayerVisible(), SIM_PLOT_PANEL::ShowLegend(), and SIM_PLOT_PANEL::SIM_PLOT_PANEL().

◆ ShowName()

void mpLayer::ShowName ( bool  show)
inlineinherited

Shows or hides the text label with the name of the layer (default is visible).

Definition at line 263 of file mathplot.h.

263 { m_showName = show; };
bool m_showName
Definition: mathplot.h:320

Referenced by TRACE::TRACE().

Member Data Documentation

◆ m_bitmap

wxImage mpBitmapLayer::m_bitmap
protected

The internal copy of the Bitmap:

Definition at line 2005 of file mathplot.h.

Referenced by GetBitmapCopy(), Plot(), and SetBitmap().

◆ m_brush

wxBrush mpLayer::m_brush
protectedinherited

Definition at line 317 of file mathplot.h.

◆ m_continuous

bool mpLayer::m_continuous
protectedinherited

Definition at line 319 of file mathplot.h.

Referenced by CURSOR::Plot(), mpFXY::Plot(), and mpMovableObject::Plot().

◆ m_drawOutsideMargins

◆ m_flags

int mpBitmapLayer::m_flags
protected

Definition at line 1998 of file mathplot.h.

Referenced by Plot().

◆ m_font

◆ m_max_x

double mpBitmapLayer::m_max_x
protected

Definition at line 2013 of file mathplot.h.

Referenced by Plot(), and SetBitmap().

◆ m_max_y

double mpBitmapLayer::m_max_y
protected

Definition at line 2013 of file mathplot.h.

Referenced by Plot(), and SetBitmap().

◆ m_min_x

double mpBitmapLayer::m_min_x
protected

The shape of the bitmap:

Definition at line 2013 of file mathplot.h.

Referenced by Plot(), and SetBitmap().

◆ m_min_y

double mpBitmapLayer::m_min_y
protected

Definition at line 2013 of file mathplot.h.

Referenced by Plot(), and SetBitmap().

◆ m_name

wxString mpLayer::m_name
protectedinherited

◆ m_pen

◆ m_scaledBitmap

wxBitmap mpBitmapLayer::m_scaledBitmap
protected

Definition at line 2006 of file mathplot.h.

Referenced by Plot().

◆ m_scaledBitmap_offset_x

wxCoord mpBitmapLayer::m_scaledBitmap_offset_x
protected

Definition at line 2007 of file mathplot.h.

Referenced by Plot().

◆ m_scaledBitmap_offset_y

wxCoord mpBitmapLayer::m_scaledBitmap_offset_y
protected

Definition at line 2007 of file mathplot.h.

Referenced by Plot().

◆ m_showName

bool mpLayer::m_showName
protectedinherited

Definition at line 320 of file mathplot.h.

Referenced by mpFX::Plot(), mpFY::Plot(), mpFXY::Plot(), mpMovableObject::Plot(), and Plot().

◆ m_type

mpLayerType mpLayer::m_type
protectedinherited

Definition at line 322 of file mathplot.h.

Referenced by mpInfoLayer::mpInfoLayer().

◆ m_validImg

bool mpBitmapLayer::m_validImg
protected

Definition at line 2009 of file mathplot.h.

Referenced by GetBitmapCopy(), Plot(), and SetBitmap().

◆ m_visible


The documentation for this class was generated from the following files: