wxArt2D
plotbox.cpp
Go to the documentation of this file.
1 /*! \file curves/src/plotbox.cpp
2  \author Probably Klaas Holwerda
3 
4  Copyright: 2001-2004 (C) Probably Klaas Holwerda
5 
6  Licence: wxWidgets Licence
7 
8  RCS-ID: $Id: plotbox.cpp,v 1.86 2008/07/30 21:54:02 titato Exp $
9 */
10 
11 // plotbox.cpp: implementation of the plotbox class.
12 //
13 //////////////////////////////////////////////////////////////////////
14 
15 #include "a2dprec.h"
16 
17 #ifdef __BORLANDC__
18 #pragma hdrstop
19 #endif
20 
21 #ifndef WX_PRECOMP
22 #include "wx/wx.h"
23 #endif
24 
25 #include "wx/curves/plotbox.h"
26 #include "wx/canvas/drawer.h"
27 #include "wx/canvas/canvas.h"
28 #include "wx/canvas/sttool.h"
29 #include "wx/canvas/edit.h"
30 
31 IMPLEMENT_DYNAMIC_CLASS( a2dPlot, a2dCanvasXYDisplayGroup )
32 IMPLEMENT_DYNAMIC_CLASS( a2dCurveGroupLegend, a2dCanvasObject )
33 
34 //////////////////////////////////////////////////////////////////////
35 // Construction/Destruction
36 //////////////////////////////////////////////////////////////////////
37 #define text_HEIGHT_FACTOR (1.0/40)
38 #define padding_FACTOR (1.0/100)
39 
40 BEGIN_EVENT_TABLE( a2dPlot, a2dCanvasXYDisplayGroup )
41  EVT_CANVASOBJECT_MOUSE_EVENT( a2dPlot::OnCanvasObjectMouseEvent )
42 END_EVENT_TABLE()
43 
44 a2dPlot::a2dPlot( double x, double y )
45  : a2dCanvasXYDisplayGroup( x, y )
46 {
47  m_topPadding = 0;
48  m_bottomPadding = 0;
49  m_leftPadding = 0;
50  m_rightPadding = 0;
51  m_autoPlace = true;
52  m_autoYNames = false;
53 }
54 
55 a2dPlot::~a2dPlot()
56 {
57 }
58 
59 a2dPlot::a2dPlot( const a2dPlot& other, CloneOptions options, a2dRefMap* refs )
60  : a2dCanvasXYDisplayGroup( other, options, refs )
61 {
62  m_topPadding = other.m_topPadding;
63  m_bottomPadding = other.m_bottomPadding;
64  m_leftPadding = other.m_leftPadding;
65  m_rightPadding = other.m_rightPadding;
66  m_autoPlace = other.m_autoPlace;
67  m_autoYNames = other.m_autoYNames;
68 }
69 
71 {
72  return new a2dPlot( *this, options, refs );
73 }
74 
75 void a2dPlot::SetPadding( double leftPadding, double rightPadding, double topPadding, double bottomPadding )
76 {
77  m_topPadding = topPadding;
78  m_bottomPadding = bottomPadding;
79  m_leftPadding = leftPadding;
80  m_rightPadding = rightPadding;
81 }
82 
83 void a2dPlot::SetTitle( const wxString& title )
84 {
85  a2dText* textobj = ( a2dText* ) Find( _T( "__TITLE__" ) );
86  if ( title.IsEmpty() )
87  ReleaseChild( textobj );
88  else
89  {
90  if ( !textobj )
91  {
92  textobj = new a2dText( title, 0, 0, a2dFont( 10, wxSWISS ), 0 );
93  textobj->SetSpecificFlags( !m_autoPlace, a2dCanvasOFlags::DRAGGABLE );
95 
96  Append( textobj );
97  textobj->SetName( _T( "__TITLE__" ) );
98  }
99  else
100  textobj->SetText( title );
101  }
102 }
103 
104 void a2dPlot::SetXLabel( const wxString& xlabel, const wxColour& color )
105 {
106  a2dText* textobj = ( a2dText* ) Find( _T( "__XLABEL__" ) );
107  if ( xlabel.IsEmpty() )
108  ReleaseChild( textobj );
109  else
110  {
111  if ( !textobj )
112  {
113  textobj = new a2dText( xlabel, 0, 0, a2dFont( 10, wxSWISS ), 0 );
114  textobj->SetSpecificFlags( !m_autoPlace, a2dCanvasOFlags::DRAGGABLE );
116  Append( textobj );
117  textobj->SetName( _T( "__XLABEL__" ) );
118  }
119  else
120  textobj->SetText( xlabel );
121  if( color != wxNullColour )
122  textobj->SetStroke( color );
123  }
124 }
125 
126 void a2dPlot::SetY1Label( const wxString& ylabel, const wxColour& color )
127 {
128  a2dText* textobj = ( a2dText* ) Find( _T( "__Y1LABEL__" ) );
129  if ( ylabel.IsEmpty() )
130  ReleaseChild( textobj );
131  else
132  {
133  if ( !textobj )
134  {
135  textobj = new a2dText( ylabel, 0, 0, a2dFont( 10, wxSWISS ), 0 );
136  textobj->SetSpecificFlags( !m_autoPlace, a2dCanvasOFlags::DRAGGABLE );
138  Append( textobj );
139  textobj->SetName( _T( "__Y1LABEL__" ) );
140  }
141  else
142  textobj->SetText( ylabel );
143  if( color != wxNullColour )
144  textobj->SetStroke( color );
145  }
146 }
147 
148 void a2dPlot::SetY2Label( const wxString& ylabel, const wxColour& color )
149 {
150  a2dText* textobj = ( a2dText* ) Find( _T( "__Y2LABEL__" ) );
151  if ( ylabel.IsEmpty() )
152  ReleaseChild( textobj );
153  else
154  {
155  if ( !textobj )
156  {
157  textobj = new a2dText( ylabel, 0, 0, a2dFont( 10, wxSWISS ), 0 );
158  textobj->SetSpecificFlags( !m_autoPlace, a2dCanvasOFlags::DRAGGABLE );
160  Append( textobj );
161  textobj->SetName( _T( "__Y2LABEL__" ) );
162  }
163  else
164  textobj->SetText( ylabel );
165  if( color != wxNullColour )
166  textobj->SetStroke( color );
167  }
168 }
169 
171 {
172  if ( title )
173  {
174  title->SetName( _T( "__TITLE__" ) );
175  title->SetSpecificFlags( !m_autoPlace, a2dCanvasOFlags::DRAGGABLE );
177  if ( !SwitchChildNamed( _T( "__TITLE__" ) , title ) )
178  Append( title );
179  }
180  else
181  {
182  a2dText* textobj = ( a2dText* ) Find( _T( "__TITLE__" ) );
183  ReleaseChild( textobj );
184  }
185 }
186 
188 {
189  if ( showm )
190  {
191  showm->SetName( _T( "__SHOWM__" ) );
192  showm->SetSpecificFlags( !m_autoPlace, a2dCanvasOFlags::DRAGGABLE );
193  if ( !SwitchChildNamed( _T( "__SHOWM__" ) , showm ) )
194  Append( showm );
195  }
196  else
197  {
198  a2dMarkerShow* showobj = ( a2dMarkerShow* ) Find( _T( "__SHOWM__" ) );
199  ReleaseChild( showobj );
200  }
201 }
202 
203 void a2dPlot::SetXLabelTextDc( a2dText* xLabelTextDc )
204 {
205  if ( xLabelTextDc )
206  {
207  xLabelTextDc->SetName( _T( "__XLABEL__" ) );
208  xLabelTextDc->SetSpecificFlags( !m_autoPlace, a2dCanvasOFlags::DRAGGABLE );
209  xLabelTextDc->SetSpecificFlags( false, a2dCanvasOFlags::PRERENDERASCHILD );
210  if ( !SwitchChildNamed( _T( "__XLABEL__" ), xLabelTextDc ) )
211  Append( xLabelTextDc );
212  }
213  else
214  {
215  a2dText* textobj = ( a2dText* ) Find( _T( "__XLABEL__" ) );
216  ReleaseChild( textobj );
217  }
218 }
219 
220 void a2dPlot::SetY1LabelTextDc( a2dText* yLabelTextDc )
221 {
222  if ( yLabelTextDc )
223  {
224  yLabelTextDc->SetName( _T( "__Y1LABEL__" ) );
225  yLabelTextDc->SetSpecificFlags( !m_autoPlace, a2dCanvasOFlags::DRAGGABLE );
226  yLabelTextDc->SetSpecificFlags( false, a2dCanvasOFlags::PRERENDERASCHILD );
227  if ( !SwitchChildNamed( _T( "__Y1LABEL__" ), yLabelTextDc ) )
228  Append( yLabelTextDc );
229  }
230  else
231  {
232  a2dText* textobj = ( a2dText* ) Find( _T( "__Y1LABEL__" ) );
233  ReleaseChild( textobj );
234  }
235 }
236 
237 void a2dPlot::SetY2LabelTextDc( a2dText* yLabelTextDc )
238 {
239  if ( yLabelTextDc )
240  {
241  yLabelTextDc->SetName( _T( "__Y2LABEL__" ) );
242  yLabelTextDc->SetSpecificFlags( !m_autoPlace, a2dCanvasOFlags::DRAGGABLE );
243  yLabelTextDc->SetSpecificFlags( false, a2dCanvasOFlags::PRERENDERASCHILD );
244  if ( !SwitchChildNamed( _T( "__Y2LABEL__" ), yLabelTextDc ) )
245  Append( yLabelTextDc );
246  }
247  else
248  {
249  a2dText* textobj = ( a2dText* ) Find( _T( "__Y2LABEL__" ) );
250  ReleaseChild( textobj );
251  }
252 }
253 
254 void a2dPlot::DoRender( a2dIterC& ic, OVERLAP clipparent )
255 {
256  a2dCanvasXYDisplayGroup::DoRender( ic, clipparent );
257 }
258 
260 {
261  a2dBoundingBox bbox;
262 
263  //the next is fast, it does not recalculate curves etc.
265 
266  if ( m_autoPlace )
267  {
268  a2dText* titleTextDc = ( a2dText* ) Find( _T( "__TITLE__" ) );
269  a2dText* xLabelTextDc = ( a2dText* ) Find( _T( "__XLABEL__" ) );
270  a2dText* y1LabelTextDc = ( a2dText* ) Find( _T( "__Y1LABEL__" ) );
271  a2dText* y2LabelTextDc = ( a2dText* ) Find( _T( "__Y2LABEL__" ) );
272  a2dMarkerShow* markerShow = ( a2dMarkerShow* ) Find( _T( "__SHOWM__" ) );
273 
274  if ( titleTextDc )
275  {
276  a2dBoundingBox tbox = titleTextDc->GetBbox();
278  bbox.Expand( tbox );
279  }
280 
281  if ( xLabelTextDc )
282  {
283  a2dBoundingBox tbox = xLabelTextDc->GetBbox();
285  bbox.Expand( tbox );
286  }
287 
288  if ( y1LabelTextDc )
289  {
290  a2dBoundingBox tbox = y1LabelTextDc->GetBbox();
292  bbox.Expand( tbox );
293  }
294 
295  if ( y2LabelTextDc )
296  {
297  a2dBoundingBox tbox = y2LabelTextDc->GetBbox();
299  bbox.Expand( tbox );
300  }
301 
302  if ( markerShow )
303  {
304  a2dBoundingBox tbox = markerShow->GetBbox();
306  bbox.Expand( tbox );
307  }
308  }
309 
310  return bbox;
311 }
312 
313 bool a2dPlot::DoUpdate( UpdateMode mode, const a2dBoundingBox& childbox, const a2dBoundingBox& clipbox, const a2dBoundingBox& propbox )
314 {
315  bool calc = false;
316  //call base class ( so the m_axisarea & its curves will be updated )
317  calc = a2dCanvasXYDisplayGroup::DoUpdate( mode, childbox, clipbox, propbox );
318 
319  if ( !m_bbox.GetValid() || calc )
320  {
321  // auto Ynames is taking the a2dCurveArea that is used to display the Yaxis at the moment
322  if( m_autoYNames )
323  {
324  if( m_axesarealist->m_leftAxisY != ( a2dCurvesArea* ) NULL )
325  {
326  wxString axisName = m_axesarealist->m_leftAxisY->GetAxisText();
327  wxColour areacolor = m_axesarealist->m_leftAxisY->GetColor();
328  if( !axisName.IsEmpty() )
329  SetY1Label( axisName, areacolor );
330  else
331  SetY1Label( wxT( "-" ), *wxBLACK );
332  }
333  if( m_axesarealist->m_rightAxisY != ( a2dCurvesArea* ) NULL )
334  {
335  wxString axisName = m_axesarealist->m_rightAxisY->GetAxisText();
336  wxColour areacolor = m_axesarealist->m_rightAxisY->GetColor();
337  if( !axisName.IsEmpty() )
338  SetY2Label( axisName, areacolor );
339  else
340  SetY2Label( wxT( "-" ), *wxBLACK );
341  }
342  }
343 
344  // get the untransformed bounding box of the base a2dCanvasXYDisplayGroup
345  m_bbox.SetValid( false );
347 
348  // first get the bounding box corner points of the axesRect in plotbox world coordinates.
349  double minx, miny;
350  double maxx, maxy;
351 
352  minx = m_bbox.GetMinX();
353  maxx = m_bbox.GetMaxX();
354  miny = m_bbox.GetMinY();
355  maxy = m_bbox.GetMaxY();
356 
357  double width = m_bbox.GetWidth();
358  double height = m_bbox.GetHeight();
359 
360  a2dText* titleTextDc = ( a2dText* ) Find( _T( "__TITLE__" ) );
361  a2dText* xLabelTextDc = ( a2dText* ) Find( _T( "__XLABEL__" ) );
362  a2dText* y1LabelTextDc = ( a2dText* ) Find( _T( "__Y1LABEL__" ) );
363  a2dText* y2LabelTextDc = ( a2dText* ) Find( _T( "__Y2LABEL__" ) );
364  a2dMarkerShow* markerShow = ( a2dMarkerShow* ) Find( _T( "__SHOWM__" ) );
365 
366  // set appropriate top padding if not specified
367  if( m_topPadding == 0 )
368  m_topPadding = height * padding_FACTOR;
369 
370  // set appropriate bottom padding if not specified
371  if( m_bottomPadding == 0 )
372  m_bottomPadding = height * padding_FACTOR;
373 
374  // set appropriate left padding if not specified
375  if( m_leftPadding == 0 )
376  m_leftPadding = width * padding_FACTOR;
377 
378  // set appropriate left padding if not specified
379  if( m_rightPadding == 0 )
380  m_rightPadding = width * padding_FACTOR;
381 
382  if ( m_autoPlace )
383  {
384  if ( titleTextDc )
385  {
386  // titleTextDc->SetSpecificFlags( false, a2dCanvasOFlags::PRERENDERASCHILD );
387  // set the appropriate title text height
388  // if(titleTextDc->GetTextHeight() == 1)
389  // titleTextDc->SetTextHeight( height*text_HEIGHT_FACTOR );
390 
391  // position title in centered on the top
392  titleTextDc->SetAlignment( wxMIDX | wxMINY );
393  // Get y-offset for multiline heading
394  //! \bug display bug: solve editing of multiple lines
395  double dy = 0; //( titleTextDc->GetLines() - 1 ) * ( titleTextDc->GetLineHeight() + titleTextDc->GetLineSpacing() );
396  titleTextDc->SetPosXY( minx + width / 2.0, maxy + m_topPadding + dy );
397  titleTextDc->Update( updatemask_normal );
398  a2dDrawingPart* view = wxStaticCastNull( PROPID_ViewDependent->GetPropertyValue( titleTextDc ).Get(), a2dDrawingPart );
399  // it is for viewDependent objects in the title of the plot
400  if( view && titleTextDc->GetBbox().GetWidth() > m_bbox.GetWidth() )
401  {
402  titleTextDc->GetBbox().SetMin( minx, titleTextDc->GetBbox().GetMinY() );
403  titleTextDc->GetBbox().SetMax( maxx, titleTextDc->GetBbox().GetMaxY() );
404  }
405  a2dBoundingBox tbox = titleTextDc->GetBbox();
406  // if ( !prop || !prop->GetRefObject())
407  // {
408  // double lineHeight = titleTextDc->GetTextHeight();
409  // tbox.Enlarge( lineHeight / 2 );
410  // }
412  m_bbox.Expand( tbox );
413  }
414 
415  if ( xLabelTextDc )
416  {
417  // xLabelTextDc->SetSpecificFlags( false, a2dCanvasOFlags::PRERENDERASCHILD );
418  // set the appropriate x label text height
419  // if(xLabelTextDc->GetTextHeight() == 1)
420  // xLabelTextDc->SetTextHeight( height*text_HEIGHT_FACTOR );
421 
422  // position xlabel at the bottom - rotation not handled
423  xLabelTextDc->SetAlignment( wxMIDX | wxMAXY );
424  xLabelTextDc->SetPosXY( minx + width / 2,
425  miny - m_bottomPadding - xLabelTextDc->GetTextHeight() );
426  xLabelTextDc->Update( updatemask_normal );
427  a2dDrawingPart* view = wxStaticCastNull( PROPID_ViewDependent->GetPropertyValue( xLabelTextDc ).Get(), a2dDrawingPart );
428  // it is for viewDependent objects in the XLABEL of the plot
429  if( view && xLabelTextDc->GetBbox().GetWidth() > m_bbox.GetWidth() )
430  {
431  xLabelTextDc->GetBbox().SetMin( minx, xLabelTextDc->GetBbox().GetMinY() );
432  xLabelTextDc->GetBbox().SetMax( maxx, xLabelTextDc->GetBbox().GetMaxY() );
433  }
434  a2dBoundingBox tbox = xLabelTextDc->GetBbox();
435  // if ( !prop || !prop->GetRefObject())
436  // {
437  // double lineHeight = xLabelTextDc->GetTextHeight();
438  // tbox.Enlarge( lineHeight / 4 );
439  // }
441  m_bbox.Expand( tbox );
442  }
443 
444  if ( y1LabelTextDc )
445  {
446  SetPosYLabel( y1LabelTextDc, minx - m_leftPadding, miny + height / 2, height, true );
447  a2dDrawingPart* view = wxStaticCastNull( PROPID_ViewDependent->GetPropertyValue( y1LabelTextDc ).Get(), a2dDrawingPart );
448  // it is for viewDependent objects in the XLABEL of the plot
449  if( view && y1LabelTextDc->GetBbox().GetHeight() > m_bbox.GetHeight() )
450  {
451  y1LabelTextDc->GetBbox().SetMin( y1LabelTextDc->GetBbox().GetMinX(), miny );
452  y1LabelTextDc->GetBbox().SetMax( y1LabelTextDc->GetBbox().GetMaxX(), maxy );
453  }
454  a2dBoundingBox tbox = y1LabelTextDc->GetBbox();
455  // if ( !prop || !prop->GetRefObject())
456  // {
457  // double lineHeight = y1LabelTextDc->GetTextHeight();
458  // tbox.Enlarge( lineHeight / 4 );
459  // }
461  m_bbox.Expand( tbox );
462  }
463 
464  if ( y2LabelTextDc )
465  {
466  SetPosYLabel( y2LabelTextDc, maxx + m_rightPadding, miny + height / 2, height, false );
467  a2dDrawingPart* view = wxStaticCastNull( PROPID_ViewDependent->GetPropertyValue( y2LabelTextDc ).Get(), a2dDrawingPart );
468  // it is for viewDependent objects in the XLABEL of the plot
469  if( view && y2LabelTextDc->GetBbox().GetHeight() > m_bbox.GetHeight() )
470  {
471  y2LabelTextDc->GetBbox().SetMin( y2LabelTextDc->GetBbox().GetMinX(), minx );
472  y2LabelTextDc->GetBbox().SetMax( y2LabelTextDc->GetBbox().GetMaxX(), maxy );
473  }
474  a2dBoundingBox tbox = y2LabelTextDc->GetBbox();
475  // if ( !prop || !prop->GetRefObject())
476  // {
477  // double lineHeight = y2LabelTextDc->GetTextHeight();
478  // tbox.Enlarge( lineHeight / 4 );
479  // }
481  m_bbox.Expand( tbox );
482  }
483 
484  if ( markerShow )
485  {
487  // // set the appropriate title text height
488  // if(markerShow->GetTextHeight() == 1)
489  // markerShow->SetTextHeight( height*text_HEIGHT_FACTOR );
490 
491  markerShow->SetPosXY( minx + width / 2.0, miny );
492  markerShow->Update( updatemask_normal );
493  a2dBoundingBox tbox = markerShow->GetBbox();
495  m_bbox.Expand( tbox );
496  }
497  }
499  return true;
500  }
501 
502  return false;
503 }
504 
505 void a2dPlot::SetPosYLabel( a2dText* yLabelTextDc, double x, double y, double tHeight, bool left )
506 {
507  double yangle = yLabelTextDc->GetTransformMatrix().GetRotation();
508  // position ylabel centered on the right - rotation by ±90 degrees handled
509  int alignment = wxMIDX;
510  if ( yangle == 0 )
511  alignment |= left ? wxMAXX : wxMINX;
512  else if ( yangle == -90 )
513  alignment |= left ? wxMAXY : wxMINY;
514  else
515  alignment |= left ? wxMINY : wxMAXY;
516 
517  yLabelTextDc->SetAlignment( alignment );
518 
519  yLabelTextDc->SetPosXY( x, y );
520  yLabelTextDc->Update( updatemask_normal );
521 }
522 
523 void a2dPlot::OnCanvasObjectMouseEvent( a2dCanvasObjectMouseEvent& event )
524 {
525  a2dIterC* ic = event.GetIterC();
526  if ( m_flags.m_editingCopy )
527  {
528  //to world group coordinates to do hit test in world group coordinates
529  double xw, yw;
530  xw = event.GetX();
531  yw = event.GetY();
532 
533  if ( event.GetMouseEvent().LeftDown() )
534  {
535  a2dHitEvent hitevent = a2dHitEvent( xw, yw, false );
536  if ( IsHitWorld( *ic, hitevent ) )
537  {
538  a2dPlot* original = wxStaticCast( PROPID_Original->GetPropertyValue( this ).Get(), a2dPlot );
539 
540  a2dIterC iclocal( ic->GetDrawingPart() );
541  iclocal.SetLayer( m_layer );
542  a2dIterCU cu( iclocal, m_lworld );
543 
544  a2dText* titleTextDc = ( a2dText* ) original->Find( _T( "__TITLE__" ) );
545  a2dText* xLabelTextDc = ( a2dText* ) original->Find( _T( "__XLABEL__" ) );
546  a2dText* y1LabelTextDc = ( a2dText* ) original->Find( _T( "__Y1LABEL__" ) );
547  a2dText* y2LabelTextDc = ( a2dText* ) original->Find( _T( "__Y2LABEL__" ) );
548  a2dMarkerShow* markerShow = ( a2dMarkerShow* ) Find( _T( "__SHOWM__" ) );
549 
550  a2dCanvasObject* hittext = NULL;
551  a2dHitEvent hitevent = a2dHitEvent( xw, yw, false );
552  if ( titleTextDc )
553  hittext = titleTextDc->IsHitWorld( iclocal, hitevent );
554 
555  if ( !hittext && xLabelTextDc )
556  hittext = xLabelTextDc->IsHitWorld( iclocal, hitevent );
557 
558  if ( !hittext && y1LabelTextDc )
559  hittext = y1LabelTextDc->IsHitWorld( iclocal, hitevent );
560 
561  if ( !hittext && y2LabelTextDc )
562  hittext = y2LabelTextDc->IsHitWorld( iclocal, hitevent );
563 
564  if( !hittext && markerShow )
565  hittext = markerShow->IsHitWorld( iclocal, hitevent );
566 
567  if ( hittext && hittext->GetEditable() )
568  {
569 #if wxART2D_USE_EDITOR
570  //a2dIterCU cuw( *ic, m_lworld );
571  a2dIterCU cuw( *ic, original );
572 
573  a2dStToolContr* controller = wxStaticCast( PROPID_Controller->GetPropertyValue( this ).Get(), a2dStToolContr );
574  ic->SetCorridorPath( true, NULL );
575  controller->StartEditingObject( hittext, *ic );
576 #else //wxART2D_USE_EDITOR
577  wxMessageBox( wxT( "Need editor module enabled for this" ) );
578 #endif //wxART2D_USE_EDITOR
579  }
580  else
581  event.Skip();
582  }
583  else
584  event.Skip();
585  }
586  else
587  event.Skip();
588  }
589  else
590  event.Skip();
591 }
592 
593 #if wxART2D_USE_CVGIO
594 void a2dPlot::DoSave( wxObject* parent, a2dIOHandlerXmlSerOut& out, a2dXmlSer_flag xmlparts , a2dObjectList* towrite )
595 {
596  a2dCanvasXYDisplayGroup::DoSave( parent, out, xmlparts, towrite );
597  if ( xmlparts == a2dXmlSer_attrib )
598  {
599  out.WriteAttribute( _T( "autoPlace" ) , m_autoPlace );
600  out.WriteAttribute( _T( "topPadding" ) , m_topPadding );
601  out.WriteAttribute( _T( "bottomPadding" ) , m_bottomPadding );
602  out.WriteAttribute( _T( "leftPadding" ) , m_leftPadding );
603  out.WriteAttribute( _T( "rightPadding" ) , m_rightPadding );
604  out.WriteNewLine();
605  }
606  else
607  {
608  }
609 }
610 
611 void a2dPlot::DoLoad( wxObject* parent, a2dIOHandlerXmlSerIn& parser, a2dXmlSer_flag xmlparts )
612 {
613  a2dCanvasXYDisplayGroup::DoLoad( parent, parser, xmlparts );
614  if ( xmlparts == a2dXmlSer_attrib )
615  {
616  m_autoPlace = parser.RequireAttributeValueBool( _T( "autoPlace" ) );
617  m_topPadding = parser.RequireAttributeValueDouble( _T( "topPadding" ) );
618  m_bottomPadding = parser.RequireAttributeValueDouble( _T( "bottomPadding" ) );
619  m_leftPadding = parser.RequireAttributeValueDouble( _T( "leftPadding" ) );
620  m_rightPadding = parser.RequireAttributeValueDouble( _T( "rightPadding" ) );
621  }
622  else
623  {
624  }
625 }
626 #endif //wxART2D_USE_CVGIO
627 
628 
629 
630 //----------------------------------------------------------------------------
631 // a2dCurveGroupLegend
632 //----------------------------------------------------------------------------
633 
634 void a2dCurveGroupLegend::DoWalker( wxObject* parent, a2dWalkerIOHandler& handler )
635 {
636  handler.WalkTask( parent, this, a2dWalker_a2dDerivedCanvasObjectStart );
637  a2dCanvasObject::DoWalker( parent, handler );
638  if ( m_curveGroup )
639  m_curveGroup->Walker( this, handler );
640 
641  handler.WalkTask( parent, this, a2dWalker_a2dDerivedCanvasObjectEnd );
642 }
643 
644 BEGIN_EVENT_TABLE( a2dCurveGroupLegend, a2dCanvasObject )
645  EVT_CANVASOBJECT_MOUSE_EVENT( a2dCurveGroupLegend::OnCanvasObjectMouseEvent )
646  EVT_CHAR( a2dCurveGroupLegend::OnChar )
647 END_EVENT_TABLE()
648 
649 void a2dCurveGroupLegend::OnCanvasObjectMouseEvent( a2dCanvasObjectMouseEvent& event )
650 {
651  //a2dIterC* ic = event.GetIterC();
652 
653  event.Skip();
654 }
655 
656 void a2dCurveGroupLegend::OnChar( wxKeyEvent& event )
657 {
658 }
659 
660 a2dCurveGroupLegend::a2dCurveGroupLegend( const wxString& format, a2dCanvasXYDisplayGroupAreas* curveGroup, const a2dFont& font )
661  : a2dCanvasObject()
662 {
663  m_curveGroup = curveGroup;
664  m_format = format;
665  m_font = font;
666  m_linespace = font.GetSize() / 10.0;
667 }
668 
669 a2dCurveGroupLegend::~a2dCurveGroupLegend()
670 {
671 }
672 
673 a2dCurveGroupLegend::a2dCurveGroupLegend( const a2dCurveGroupLegend& other, CloneOptions options, a2dRefMap* refs )
674  : a2dCanvasObject( other, options, refs )
675 {
676  m_curveGroup = other.m_curveGroup;
677  m_font = other.m_font;
678  m_format = other.m_format;
679  m_linespace = other.m_linespace;
680 }
681 
683 {
684  return new a2dCurveGroupLegend( *this, options, refs );
685 };
686 
688 {
689 }
690 
692 {
693  if ( !m_flags.m_pending && m_curveGroup->GetPending() )
694  {
695  SetPending( true );
696  }
697 }
698 
700 {
701  a2dBoundingBox bbox;
702 
703  double height = 0;
704 
705  if ( !m_format.IsEmpty() && m_font.GetSize() )
706  {
707  const a2dCurvesAreaList& areaList = m_curveGroup->GetCurvesAreaList();
708  for( size_t i = 0; i < areaList.GetCount(); i++ )
709  {
710  const a2dCurvesArea* area = areaList.Item( i );
711  a2dCanvasObjectList::const_iterator iter = area->GetChildObjectList()->begin();
712  while( iter != area->GetChildObjectList()->end() )
713  {
714  const a2dCurveObject* item = wxDynamicCast( ( *iter ).Get(), a2dCurve );
715  if ( item )
716  {
717  wxString form;
718  form.Printf( m_format, item->GetName().c_str() );
719 
720  a2dBoundingBox linebbox = m_font.GetTextExtent( form, a2dDEFAULT_ALIGNMENT );
721  linebbox.Translate( 0.0, height );
722  bbox.Expand( linebbox );
723  height = height - ( GetLineHeight() + m_linespace );
724  }
725  ++iter;
726  }
727  }
728  }
729  return bbox;
730 }
731 
732 bool a2dCurveGroupLegend::DoUpdate( UpdateMode mode, const a2dBoundingBox& childbox, const a2dBoundingBox& clipbox, const a2dBoundingBox& propbox )
733 {
734  if ( m_curveGroup && !m_bbox.GetValid() )
735  {
738  return true;
739  }
740  return false;
741 }
742 
743 #if wxART2D_USE_CVGIO
744 
745 void a2dCurveGroupLegend::DoSave( wxObject* parent, a2dIOHandlerXmlSerOut& out, a2dXmlSer_flag xmlparts , a2dObjectList* towrite )
746 {
747  a2dCanvasObject::DoSave( parent, out, xmlparts, towrite );
748  if ( xmlparts == a2dXmlSer_attrib )
749  {
750  out.WriteAttribute( wxT( "curvegroupname" ) , m_curveGroup->GetName() );
751  }
752  else
753  {
754  }
755 }
756 
757 void a2dCurveGroupLegend::DoLoad( wxObject* parent, a2dIOHandlerXmlSerIn& parser, a2dXmlSer_flag xmlparts )
758 {
759  a2dCanvasObject::DoLoad( parent, parser, xmlparts );
760  if ( xmlparts == a2dXmlSer_attrib )
761  {
762  }
763  else
764  {
765  }
766 
767  //m_curve = ;
768 }
769 #endif //wxART2D_USE_CVGIO
770 
771 void a2dCurveGroupLegend::DoRender( a2dIterC& ic, OVERLAP WXUNUSED( clipparent ) )
772 {
773  if( !m_format.IsEmpty() )
774  {
775 
776  ic.GetDrawer2D()->SetFont( m_font );
778 
779  double height = 0;
780 
781  const a2dCurvesAreaList& areaList = m_curveGroup->GetCurvesAreaList();
782  for( size_t i = 0; i < areaList.GetCount(); i++ )
783  {
784  const a2dCurvesArea* area = areaList.Item( i );
785  a2dCanvasObjectList::const_iterator iter = area->GetChildObjectList()->begin();
786  while( iter != area->GetChildObjectList()->end() )
787  {
788  const a2dCurveObject* item = wxDynamicCast( ( *iter ).Get(), a2dCurve );
789  if ( item )
790  {
791  wxString form;
792  form.Printf( m_format, item->GetName().c_str() );
793 
794  ic.GetDrawer2D()->DrawText( form, 0, height, a2dDEFAULT_ALIGNMENT );
795  height = height - ( GetLineHeight() + m_linespace );
796  }
797  ++iter;
798  }
799  }
800  ic.GetDrawer2D()->SetFont( *a2dNullFONT );
801  }
802 }
803 
805 {
806  a2dPoint2D P = a2dPoint2D( hitEvent.m_relx, hitEvent.m_rely );
807  //double pw = ic.GetWorldStrokeExtend();
808  //double margin = ic.GetTransformedHitMargin();
809 
810  hitEvent.m_how.m_hit = a2dHit::hit_fill;
811  return true;
812 }
813 
a2dHit m_how
return in which way the object was hit (stroke, fill, ...)
Definition: canobj.h:301
Display Part of a a2dDrawing, in which a2dCanvasObjects are shown.
Definition: drawer.h:470
wxPoint2DDouble a2dPoint2D
this to define if coordinate numbers are integer or doubles
Definition: artglob.h:47
a2dBoundingBox DoGetUnTransformedBbox(a2dBboxFlags flags=a2dCANOBJ_BBOX_NON) const
In derived object this should be overriden to calculate the boundingbox of the object without its chi...
Definition: plotbox.cpp:699
double m_relx
(world coordinates) hit point x relative to the canvas object its parent object(s) ...
Definition: canobj.h:289
double GetHeight() const
returns height of the boundingbox
Definition: bbox.cpp:334
double GetSize() const
Get the font size.
Definition: stylebase.cpp:2917
Higher level of data plotting, adding title and legends.
#define wxDynamicCast(obj, className)
Define wxDynamicCast so that it will give a compiler error for unrelated types.
Definition: gen.h:75
void DoRender(a2dIterC &ic, OVERLAP clipparent)
render derived object
Definition: plotbox.cpp:254
void SetXLabelTextDc(a2dText *xLabelTextDc)
set X label on axis as text object, NULL removes it
Definition: plotbox.cpp:203
bool GetEditable() const
get if the object may be edited
Definition: canobj.h:1584
mouse event sent from a2dCanvasObject to itself
Definition: canglob.h:223
void SetY1Label(const wxString &ylabel, const wxColour &color=wxNullColour)
set Y label on axis, empty string removes it
Definition: plotbox.cpp:126
void SetAlignment(int alignment)
Set the position of the anchor point w.r.t the text.
Definition: cantext.h:294
a2dBoundingBox DoGetUnTransformedBbox(a2dBboxFlags flags=a2dCANOBJ_BBOX_NON) const
In derived object this should be overriden to calculate the boundingbox of the object without its chi...
virtual wxString GetName() const
Returns the name of this object, if no name is given the internal id will be returned.
Definition: gen.cpp:1310
const a2dAffineMatrix & GetTransformMatrix() const
get the matrix used to position the object
Definition: canobj.h:500
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
Definition: plotbox.cpp:594
bool RequireAttributeValueBool(const wxString &attrib)
Forces an attribute and returns its boolean value.
Definition: genxmlpars.cpp:551
class to map references to objects stored in XML, in order to make the connection later on...
Definition: gen.h:3462
a2dCanvasOFlags m_flags
holds flags for objects
Definition: canobj.h:2528
a2dSmrtPtr< a2dCurvesArea > m_rightAxisY
the curve area to display the right Y axis
Definition: curvegroup.h:363
void SetValid(bool)
Definition: bbox.cpp:364
a2dSmrtPtr< a2dCurvesArea > m_leftAxisY
the curve area to display the left Y axis
Definition: curvegroup.h:361
Ref Counted base object.
Definition: gen.h:1045
bool GetPending() const
is this object pending for update?
Definition: canobj.h:1162
bool SwitchChildNamed(const wxString &objectname, a2dCanvasObject *newobject)
the object with the given name is released and switched in place to newobject
Definition: canobj.cpp:4487
bool m_pending
set when a2dCanvasObject needs an update (redraw).
Definition: candefs.h:277
virtual bool Update(UpdateMode mode)
Update the state of the object according to its current position etc.
Definition: canobj.cpp:5149
void SetY1LabelTextDc(a2dText *yLabelTextDc)
set Y label on axis as text object, NULL removes it
Definition: plotbox.cpp:220
Defines a font to be set to a2dDrawer2D or stored in a2dCanvsObject etc.
Definition: stylebase.h:779
Input and output handler for the XmlSer format.
Definition: genxmlpars.h:819
UpdateMode
Various mode flags for Update.
Definition: canobj.h:1091
virtual void SetPending(bool pending)
set this object pending for update
Definition: canobj.cpp:2585
OVERLAP
Result of a a2dBoundingBox intersection or hittest.
Definition: bbox.h:24
void SetY2LabelTextDc(a2dText *yLabelTextDc)
set Y label on axis as text object, NULL removes it
Definition: plotbox.cpp:237
double m_linespace
space between the lines
Definition: plotbox.h:214
For Showing Marker position of Markers on a Curve.
Definition: marker.h:408
void SetFont(const a2dFont &font)
set font to use for drawing text
Definition: drawer2d.cpp:722
wxUint16 m_layer
layer of object, default wxLAYER_DEFAULT
Definition: canobj.h:2556
virtual void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
Definition: canobj.cpp:5728
plot a group of curves on a given area in world coordinates.
Definition: plotbox.h:30
a2dCanvasObject is the base class for Canvas Objects.
Definition: canobj.h:371
a2dFont m_font
legend font
Definition: plotbox.h:211
void SetTitle(const wxString &title)
set title above plot, empty string removes it
Definition: plotbox.cpp:83
wxString GetAxisText() const
get text to display for axis label
Definition: curvegroup.cpp:149
A2DGENERALDLLEXP a2dWalkEvent a2dWalker_a2dDerivedCanvasObjectStart
id for a2dWalkEvent issued from within a2dWalkerIOHandler
void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
Definition: plotbox.cpp:757
a2dCanvasObjectList * GetChildObjectList()
get the list where the child objects are stored in.
Definition: canobj.cpp:2551
a2dCanvas uses a2dCanvasView for displaying a view on a a2dCanvasDocument.
double GetRotation() const
return rotation
Definition: afmatrix.cpp:799
a2dSmrtPtr< a2dCurvesAreaList > m_axesarealist
internal object used to display the curves in internal coordinates
Definition: curvegroup.h:672
a2dBoundingBox GetTextExtent(const wxString &string, int alignment=wxMINX|wxMINY, double *w=NULL, double *h=NULL, double *descent=NULL, double *externalLeading=NULL) const
Get the dimensions in world coordinates of the string.
Definition: stylebase.cpp:3044
simple curve group with just one a2dCurvesArea in use
Definition: curvegroup.h:697
void DoRender(a2dIterC &ic, OVERLAP clipparent)
render derived object
Definition: plotbox.cpp:771
void SetPadding(double leftPadding, double rightPadding, double topPadding, double bottomPadding)
extra distance around plot
Definition: plotbox.cpp:75
virtual void SetName(const wxString &name)
Creates the a2dStringProperty PROPID_Name.
Definition: gen.cpp:1305
bool DoUpdate(UpdateMode mode, const a2dBoundingBox &childbox, const a2dBoundingBox &clipbox, const a2dBoundingBox &propbox)
Update derived Object specific things ( mainly boundingbox)
Definition: plotbox.cpp:313
a2dCurveObject for objects needing to know its parent a2dCurvesArea.
Definition: curve.h:42
int ReleaseChild(a2dCanvasObject *obj, bool backwards=false, bool all=false, bool now=false, bool undoCommands=false)
remove the given object from the childobjects
Definition: canobj.cpp:6260
a2dAffineMatrix m_lworld
used for positioning the object (x,y,ang,scale etc.)
Definition: canobj.h:2559
void SetDrawerFill(const a2dFill &fill)
Used to set the current fill.
Definition: drawer2d.cpp:621
Io handler to iterate through a a2dDocument.
Definition: gen.h:3911
double GetLineHeight() const
Height in world coordinates of one line.
Definition: plotbox.h:168
double m_bottomPadding
padding.
Definition: plotbox.h:121
void WriteNewLine()
Writes a new line and takes care of indentation.
Definition: genxmlpars.cpp:890
list for a2dCurvesArea objects
Definition: curvegroup.h:264
void SetXLabel(const wxString &xlabel, const wxColour &color=wxNullColour)
set X label on axis, empty string removes it
Definition: plotbox.cpp:104
a2dText is an abstract base class.
Definition: cantext.h:93
bool GetValid() const
returns true if boundingbox is calculated properly and therefore its valid flag is set...
Definition: bbox.cpp:299
void Expand(const a2dPoint2D &, const a2dPoint2D &)
expand boundingbox width two points
Definition: bbox.cpp:155
const a2dBoundingBox & Translate(a2dPoint2D &)
translate with given vector
Definition: bbox.cpp:370
double GetMinX() const
get minimum X of the boundingbox
Definition: bbox.cpp:304
const a2dFont * a2dNullFONT
global a2dFont stock object for NO font
The a2dStToolContr is a Tool Controller specialized for working with a2dCanvasView.
Definition: sttool.h:485
void Walker(wxObject *parent, a2dWalkerIOHandler &handler)
This is used to recursively walk through an object tree.
Definition: gen.cpp:1473
The point is in the fill area.
Definition: polyver.h:56
a2dDrawer2D * GetDrawer2D() const
get current a2dDrawer2D
Definition: canobj.cpp:636
#define wxStaticCast(obj, className)
The wxWindows 2.4.2 wxStaticCast is buggy. It evaluates its argument twice.
Definition: gen.h:123
const wxColour & GetColor() const
get color of axis text
Definition: curvegroup.h:194
void DoAddPending(a2dIterC &ic)
called by addPending
Definition: plotbox.cpp:687
void SetSpecificFlags(bool setOrClear, a2dCanvasObjectFlagsMask which)
set all bit flags in object that or true in mask to true or false
Definition: canobj.cpp:2645
double m_topPadding
padding.
Definition: plotbox.h:123
#define EVT_CANVASOBJECT_MOUSE_EVENT(func)
static event table macro for a2dCanvasObject mouse event
Definition: canglob.h:312
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
Definition: canobj.cpp:5569
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
Special object group to plot a2dCurve Objects but also any other a2dCanvasObject. ...
Definition: curvegroup.h:394
void SetMin(double px, double py)
set the bounding box its maximum
Definition: bbox.cpp:340
Input and output handler for the XmlSer format.
Definition: genxmlpars.h:862
double GetTextHeight() const
get text height in world coordinates
Definition: cantext.h:176
void SetTitleTextDc(a2dText *title)
set title above plot using a text object, NULL removes it
Definition: plotbox.cpp:170
virtual void DrawText(const wxString &text, double x, double y, int alignment=wxMINX|wxMINY, bool Background=true)
Draw text in user coordinates.
Definition: drawer2d.cpp:2329
wxMouseEvent & GetMouseEvent()
return the original mouse event that was redirected to the a2dCanvasObject
Definition: canglob.h:243
Base class for curves.
Definition: curve.h:107
void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
double GetMaxX() const
get maximum X of the boundingbox
Definition: bbox.cpp:316
static const a2dCanvasObjectFlagsMask DRAGGABLE
Definition: candefs.h:187
void SetMax(double px, double py)
set the bounding box its minimum
Definition: bbox.cpp:352
bool DoUpdate(UpdateMode mode, const a2dBoundingBox &childbox, const a2dBoundingBox &clipbox, const a2dBoundingBox &propbox)
Update derived Object specific things ( mainly boundingbox)
Definition: plotbox.cpp:732
while iterating a a2dCanvasDocument, this holds the context.
Definition: canobj.h:3212
const a2dCurvesAreaList & GetCurvesAreaList() const
return reference to list of all a2dCurveArea objects used
Definition: curvegroup.h:409
void MapBbox(const a2dAffineMatrix &matrix)
Definition: bbox.cpp:445
legend for a group of curves.
Definition: plotbox.h:144
void SetStroke(const wxColour &strokecolor, double width=0, a2dStrokeStyle style=a2dSTROKE_SOLID)
Set a stroke for the object which will be used instead of the layer stroke.
Definition: canobj.cpp:2924
void SetText(const wxString &text)
set the text for the object &#39; &#39; in string means new line
Definition: cantext.h:165
a2dBoundingBox DoGetUnTransformedBbox(a2dBboxFlags flags=a2dCANOBJ_BBOX_NON) const
In derived object this should be overriden to calculate the boundingbox of the object without its chi...
Definition: plotbox.cpp:259
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
Clone this object and return a pointer to the new object.
Definition: plotbox.cpp:70
editing tool for a2dCanvasObject&#39;s
double GetMaxY() const
get maximum Y of the boundingbox
Definition: bbox.cpp:322
double GetWidth() const
returns width of the boundingbox
Definition: bbox.cpp:328
An object of this class will update a a2dIterC with the required information.
Definition: canobj.h:3123
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
Definition: plotbox.cpp:745
void DependencyPending(a2dWalkerIOHandler *handler)
called by to check if this object becomes pending as a result of other objects
Definition: plotbox.cpp:691
void DoWalker(wxObject *parent, a2dWalkerIOHandler &handler)
iterate over this object and its children
Definition: plotbox.cpp:634
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
Clone this object and return a pointer to the new object.
Definition: plotbox.cpp:682
void SetLayer(wxUint16 layer)
set the layer that is to be rendered
Definition: canobj.h:3288
void SetPosXY(double x, double y, bool restrict=false)
set position to x,y
Definition: canobj.cpp:1624
void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
Definition: plotbox.cpp:611
bool m_editingCopy
true if the object needs to be rendered in edit mode.
Definition: candefs.h:304
double m_leftPadding
padding.
Definition: plotbox.h:119
a2dCanvasObject * IsHitWorld(a2dIterC &ic, a2dHitEvent &hitEvent)
If the position (x,y) is within the object return this.
Definition: canobj.cpp:3415
bool DoIsHitWorld(a2dIterC &ic, a2dHitEvent &hitEvent)
Does hit test on the object (exclusif child objects)
Definition: plotbox.cpp:804
void DoRender(a2dIterC &ic, OVERLAP clipparent)
render derived object
The a2dBoundingBox class stores one a2dBoundingBox of a a2dCanvasObject.
Definition: bbox.h:39
void EnlargeXY(const double MargeX, const double MargeY)
enlarge with the given amount
Definition: bbox.cpp:182
virtual bool WalkTask(wxObject *parent, wxObject *object, a2dWalkEvent event)
called from within a2dObject&#39;s and derived classes
Definition: gen.cpp:5265
double GetMinY() const
get minimum Y of the boundingbox
Definition: bbox.cpp:310
the a2dDrawingPart is a a2dView specially designed for displaying parts of a a2dDrawing. It uses a a2dDrawer2D to actually redraw things from the document, by giving that a2dDrawer2D as drawing context to the document, and telling the document to redraw a certain rectangular area. At that last is what this class is for. It optimizes the areas to be redrawn after object in the document were changed. To do that it combines redraw areas to a minimal set of redrawing areas. All the administration for this and the way things will be redrawn is from this view.
basetype GetPropertyValue(const a2dObject *obj) const
Get the property value in obj.
Definition: id.inl:325
A2DGENERALDLLEXP a2dWalkEvent a2dWalker_a2dDerivedCanvasObjectEnd
id for a2dWalkEvent issued from within a2dWalkerIOHandler
double m_rightPadding
padding.
Definition: plotbox.h:125
bool DoUpdate(UpdateMode mode, const a2dBoundingBox &childbox, const a2dBoundingBox &clipbox, const a2dBoundingBox &propbox)
Update derived Object specific things ( mainly boundingbox)
virtual bool StartEditingObject(a2dCanvasObject *objectToEdit)
start editing this object
Definition: sttool.cpp:926
a2dDrawingPart * GetDrawingPart() const
get current a2dDrawingPart
Definition: canobj.cpp:631
a2dBoundingBox m_bbox
boundingbox in world coordinates
Definition: canobj.h:2539
double RequireAttributeValueDouble(const wxString &attrib)
Forces an attribute and returns its double value.
Definition: genxmlpars.cpp:487
a2dCanvasObject * Find(const wxString &objectname, const wxString &classname=wxT(""), a2dCanvasObjectFlagsMask mask=a2dCanvasOFlags::ALL, const a2dPropertyId *propid=NULL, const wxString &valueAsString=wxT(""), wxUint32 id=0) const
return the object which fits the filter.
Definition: canobj.cpp:4505
void Append(a2dCanvasObject *obj)
append a a2dCanvasObject to the childobjects
Definition: canobj.cpp:6224
stack based tools controller and tools for drawing and editing.
list of a2dObject&#39;s
Definition: gen.h:3157
double m_rely
(world coordinates) hit point y relative to the canvas object its parent object(s) ...
Definition: canobj.h:291
CloneOptions
options for cloning
Definition: gen.h:1200
void SetY2Label(const wxString &ylabel, const wxColour &color=wxNullColour)
set Y label on axis, empty string removes it
Definition: plotbox.cpp:148
void SetCorridorPath(bool OnOff, a2dCanvasObject *captureObject=NULL)
to set corridor path ( also to captured object), its a2dCanvasOFlags::IsOnCorridorPath flag is set on...
Definition: canobj.cpp:739
static a2dPropertyIdRefObject * PROPID_ViewDependent
used for objects that depend on &#39;aView&#39; view when it comes to size.
Definition: canobj.h:2703
structure to give as parameter to member functions of a2dCanvasObject
Definition: canobj.h:252
a2dBoundingBox & GetBbox()
get boundingbox in world coordinates exclusive stroke width relative to its parent ...
Definition: canobj.cpp:3175
void SetMarkerShow(a2dMarkerShow *showm)
set markerShow under plot using a a2dMarkerShow object, NULL removes it
Definition: plotbox.cpp:187
virtual void DoWalker(wxObject *parent, a2dWalkerIOHandler &handler)
iterate over this object and its children
Definition: canobj.cpp:5504
const a2dFill * a2dTRANSPARENT_FILL
global a2dFill stock object for TRANSPARENT filling
base class for curve area in a a2dCurvesAreaList, like used in a2dCanvasXYDisplayGroups ...
Definition: curvegroup.h:56
static const a2dCanvasObjectFlagsMask PRERENDERASCHILD
Definition: candefs.h:198
plotbox.cpp Source File -- Sun Oct 12 2014 17:04:23 -- Sun Oct 12 2014 -- 1.8.5 -- wxArt2D -- . -- Main Page Reference Documentation