wxArt2D
curvegroup.cpp
Go to the documentation of this file.
1 /*! \file curves/src/curvegroup.cpp
2  \author Klaas Holwerda
3 
4  Copyright: 2000-2004 (c) Klaas Holwerda
5 
6  Licence: wxWidgets Licence
7 
8  RCS-ID: $Id: curvegroup.cpp,v 1.42 2008/08/19 23:17:11 titato Exp $
9 */
10 
11 #pragma warning(disable:4786)
12 
13 #include "a2dprec.h"
14 
15 #ifdef __BORLANDC__
16 #pragma hdrstop
17 #endif
18 
19 #ifndef WX_PRECOMP
20 #include "wx/wx.h"
21 #endif
22 
23 #include <wx/wfstream.h>
24 #include <math.h>
25 
26 #include "wx/canvas/eval.h"
27 
28 #include "wx/curves/meta.h"
29 
30 #include "wx/canvas/canglob.h"
31 #include "wx/canvas/canobj.h"
32 #include "wx/canvas/drawer.h"
33 #include "wx/canvas/canvas.h"
34 
35 #if wxART2D_USE_EDITOR
36 #include "wx/canvas/edit.h"
37 #endif //wxART2D_USE_EDITOR
38 
39 //----------------------------------------------------------------------------
40 // globals
41 //----------------------------------------------------------------------------
42 
43 IMPLEMENT_DYNAMIC_CLASS( a2dCurvesArea, a2dPolygonLClipper )
44 IMPLEMENT_DYNAMIC_CLASS( a2dCurvesAreaList, a2dObject )
45 IMPLEMENT_DYNAMIC_CLASS( a2dCanvasXYDisplayGroupAreas, a2dCanvasObject )
46 IMPLEMENT_DYNAMIC_CLASS( a2dCanvasXYDisplayGroup, a2dCanvasXYDisplayGroupAreas )
47 
48 
49 #ifdef wxUSE_INTPOINT
50 #define wxMAX_COORDINATE INT_MAX
51 #define wxMIN_COORDINATE INT_MIN
52 #else
53 #define wxMAX_COORDINATE 100e99
54 #define wxMIN_COORDINATE 100e-99
55 #endif
56 
57 a2dBboxHash::a2dBboxHash( void )
58  : a2dObject()
59 {
60 }
61 a2dBboxHash::a2dBboxHash( const a2dBboxHash& other, CloneOptions options, a2dRefMap* refs )
62  : a2dObject( other, options, refs )
63 {
64 }
65 
66 a2dObject* a2dBboxHash::DoClone( CloneOptions options, a2dRefMap* refs ) const
67 {
68  return new a2dBboxHash( *this, options, refs );
69 }
70 
71 
72 a2dPropertyIdCanvasObject* a2dCurvesArea::PROPID_curvesarea = NULL;
73 a2dPropertyIdString* a2dCurvesArea::PROPID_text = NULL;
74 
75 
76 INITIALIZE_PROPERTIES( a2dCurvesArea, a2dPolygonLClipper )
77 {
78  A2D_PROPID_D( a2dPropertyIdCanvasObject, curvesarea, 0 );
79  A2D_PROPID_D( a2dPropertyIdString, text, wxT( "" ) );
80  return true;
81 }
82 
83 a2dCurvesArea::a2dCurvesArea( const wxString curveAreaName )
84  : a2dPolygonLClipper(), m_group( NULL )
85 {
86  m_showyaxis = true;
87  SetName( curveAreaName );
88 
89  a2dBoundingBox extbox( 0, 0, 1, 1 );
90  SetInternalBoundaries( extbox, 0, 0, 1, 1 );
91 
92  m_axisY = new a2dCurveAxisLin( 0, true );
93  m_axisY->SetCurvesArea( this );
94  m_colour = wxNullColour;
95 
96 #if defined(_DEBUG) && defined (SMART_POINTER_DEBUG)
97  //klion: it is because the CurrentSmartPointerOwner can change in other.m_axesarea->Clone()
98  CurrentSmartPointerOwner = this;
99 #endif
100 }
101 
103  : a2dPolygonLClipper( other, options, refs ), m_group( NULL )
104 {
105  m_showyaxis = other.m_showyaxis;
106 
107  if( options & clone_members )
108  m_axisY = ( a2dCurveAxis* ) other.m_axisY->Clone( CloneOptions( options & ~ clone_seteditcopy ) );
109  else
110  m_axisY = other.m_axisY;
111  m_axisY->SetCurvesArea( this );
112 
113  m_intrect = other.m_intrect;
114  m_colour = other.m_colour;
115 
116  a2dCanvasObjectList::iterator iter = GetChildObjectList()->begin();
117  while( iter != GetChildObjectList()->end() )
118  {
119  a2dCurveObject* item = wxDynamicCast( ( *iter ).Get(), a2dCurveObject );
120  if ( item )
121  item->SetCurvesArea( this );
122  ++iter;
123  }
124 
125 #if defined(_DEBUG) && defined (SMART_POINTER_DEBUG)
126  //klion: it is because the CurrentSmartPointerOwner can change in other.m_axesarea->Clone()
127  CurrentSmartPointerOwner = this;
128 #endif
129 }
130 
131 a2dCurvesArea::~a2dCurvesArea()
132 {
133  if( m_markerShow2 != ( a2dMarkerShow* )NULL )
134  {
135  m_markerShow2->SetRelease( true );
136  }
137  if( m_markerShow != ( a2dMarkerShow* )NULL )
138  {
139  m_markerShow->SetRelease( true );
140  }
142 }
143 
145 {
146  return new a2dCurvesArea( *this, options, refs );
147 }
148 
150 {
151  //first search if a reserved property exists
152  const a2dNamedProperty* p = PROPID_text->GetPropertyListOnly( this );
153  if ( p )
154  return p->StringValueRepresentation();
155  return GetName();
156 }
157 
158 bool a2dCurvesArea::SetAxisText( const wxString& name )
159 {
160  PROPID_text->SetPropertyToObject( this, name );
161  return true;
162 }
163 
164 void a2dCurvesArea::World2Curve( double xw, double yw, double& xcurve, double& ycurve )
165 {
167  mat.Invert();
168  mat.TransformPoint( xw, yw, xcurve, ycurve );
169 }
170 
171 void a2dCurvesArea::Curve2World( double xcurve, double ycurve, double& xw, double& yw )
172 {
173  m_iworld.TransformPoint( xcurve, ycurve, xw, yw );
174 }
175 
177 {
178  a2dBoundingBox box( extbox.GetMinX() , extbox.GetMinY(), extbox.GetMaxX() , extbox.GetMaxY() );
179  SetClippingFromBox( box );
180 }
181 
183 {
184  m_iworld.Identity();
185  m_iworld.Translate( m_intrect.GetMinX() - extbox.GetMinX(), m_intrect.GetMinY() - extbox.GetMinY() );
186 
187  wxASSERT_MSG( extbox.GetWidth() != 0, wxT( "pixel size can not be zero" ) );
188  wxASSERT_MSG( extbox.GetHeight() != 0, wxT( "pixel size can not be zero" ) );
189 
190  m_iworld.Scale( m_intrect.GetWidth() / extbox.GetWidth(), m_intrect.GetHeight() / extbox.GetHeight(),
191  m_intrect.GetMinX(), m_intrect.GetMinY() );
192  //the curves are directly transformed to world coordinates by setting the
193  //inverse to the axisarea.
194  m_iworld.Invert();
195  if( m_axisY )
196  m_axisY->SetPending( true );
197  SetPending( true );
198 }
199 
200 void a2dCurvesArea::AddCurve( a2dCurve* curve, const wxString curvename )
201 {
202  if ( !curvename.IsEmpty() )
203  curve->SetName( curvename );
204  Append( curve );
205  curve->SetCurvesArea( this );
206 }
207 
209 {
210  Append( marker );
211  marker->SetCurvesArea( this );
212 }
213 
215 {
216  ReleaseChild( marker );
217 }
218 
219 void a2dCurvesArea::InsertCurve( size_t before, a2dCurve* curve, const wxString curvename )
220 {
221  if ( !curvename.IsEmpty() )
222  curve->SetName( curvename );
223 
224  Insert( before, curve );
225 }
226 
227 a2dCurve* a2dCurvesArea::GetCurve( const wxString curvename )
228 {
230  {
231  a2dCanvasObject* obj = *iter;
232  if( obj->GetName() == curvename )
233  return ( a2dCurve* )obj;
234  }
235  return NULL;
236 }
237 
239 {
240  a2dBoundingBox curvebox;
241 
243  {
244  a2dCurve* curve = wxDynamicCast( ( a2dCanvasObject* ) * iter, a2dCurve );
245  if ( curve )
246  curvebox.Expand( curve->GetCurveBoundaries() );
247  }
248 
249  if ( !curvebox.GetValid() ) //no child or empty child secure
250  {
251  //no objects, therefore make the bounding box the x,y of this object
252  curvebox.Expand( 0, 0 );
253  }
254 
255  return curvebox;
256 }
257 
259 {
261  m_axisY->ProcessCanvasObjectEvent( ic, hitEvent );
262  return hitEvent.m_processed;
263 }
264 
265 void a2dCurvesArea::DoWalker( wxObject* parent, a2dWalkerIOHandler& handler )
266 {
267  handler.WalkTask( parent, this, a2dWalker_a2dDerivedCanvasObjectStart );
268  a2dPolygonLClipper::DoWalker( parent, handler );
269 
270  if ( m_axisY )
271  m_axisY->Walker( this, handler );
272 
273  handler.WalkTask( parent, this, a2dWalker_a2dDerivedCanvasObjectEnd );
274 }
275 
276 a2dCanvasObject* a2dCurvesArea::IsHitCurvesWorld ( a2dIterC& ic, a2dHitEvent& hitEvent )
277 {
278  return ChildIsHitWorld( ic, hitEvent );
279 }
280 
281 
282 a2dBoundingBox& a2dCurvesArea::Expand( a2dBoundingBox& bbox )
283 {
284  bbox.Expand( m_axisY->GetBbox() );
285  return bbox;
286 }
287 
289 {
291  m_axisY->AddPending( ic );
292 }
293 
295 {
296  /*
297  a2dCanvasObjectList::iterator iter = GetChildObjectList()->begin();
298  while( iter != GetChildObjectList()->end() )
299  {
300  a2dCurveObject* item = wxDynamicCast( (*iter).Get(), a2dCurveObject );
301  if ( item )
302  item->SetCurvesArea( this );
303  ++iter;
304  }
305 
306  iter = m_axisY->GetChildObjectList()->begin();
307  while( iter != m_axisY->GetChildObjectList()->end() )
308  {
309  a2dCurveObject* item = wxDynamicCast( (*iter).Get(), a2dCurveObject );
310  if ( item )
311  item->SetCurvesArea( this );
312  ++iter;
313  }
314  */
315 
316  m_axisY->DependencyPending( handler );
317  if( m_axisY->GetPending() && !GetPending() )
318  SetPending( true );
320  if( GetPending() && m_group && !m_group->GetPending() )
321  m_group->SetPending( true );
322 }
323 
324 /*
325 bool a2dCurvesArea::GetPending(void)
326 {
327  bool retCode = false;
328  retCode = retCode || a2dPolygonLClipper::GetPending( );
329  retCode = retCode || m_axisY->GetPending( );
330  return retCode;
331 }
332 */
333 
335 {
338 }
339 
340 
342 {
343  /*
344  a2dCanvasObjectList::iterator iter = GetChildObjectList()->begin();
345  while( iter != GetChildObjectList()->end() )
346  {
347  a2dCurveObject* item = wxDynamicCast( (*iter).Get(), a2dCurveObject );
348  if ( item )
349  item->SetCurvesArea( this );
350  ++iter;
351  }
352  iter = m_axisY->GetChildObjectList()->begin();
353  while( iter != m_axisY->GetChildObjectList()->end() )
354  {
355  a2dCurveObject* item = wxDynamicCast( (*iter).Get(), a2dCurveObject );
356  if ( item )
357  item->SetCurvesArea( this );
358  ++iter;
359  }
360  */
361  bool retCode = a2dPolygonLClipper::Update( mode );
362  retCode = m_axisY->Update( mode ) || retCode;
363  return retCode;
364 }
365 
366 
367 bool a2dCurvesArea::DoUpdate( UpdateMode mode, const a2dBoundingBox& childbox, const a2dBoundingBox& clipbox, const a2dBoundingBox& propbox )
368 {
369  /*
370  a2dCanvasObjectList::iterator iter = GetChildObjectList()->begin();
371  while( iter != GetChildObjectList()->end() )
372  {
373  a2dCurveObject* item = wxDynamicCast( (*iter).Get(), a2dCurveObject );
374  if ( item )
375  item->SetCurvesArea( this );
376  ++iter;
377  }
378  iter = m_axisY->GetChildObjectList()->begin();
379  while( iter != m_axisY->GetChildObjectList()->end() )
380  {
381  a2dCurveObject* item = wxDynamicCast( (*iter).Get(), a2dCurveObject );
382  if ( item )
383  item->SetCurvesArea( this );
384  ++iter;
385  }
386  */
387 // bool retCode = m_axisY->Update(mode);
388  bool retCode = false;
389 
390  //curren state of those flags are known after m_axesarea->Update() etc are called.
393 
396  return retCode;
397 }
398 
399 void a2dCurvesArea::SetAxes( const a2dBoundingBox& extbox, double x, double y, double& zerox, double& zeroy, double& ixmin, double& ixmax )
400 {
401  GetCurveAreaTransform().TransformPoint( x, y, zerox, zeroy );
402  ixmin = m_intrect.GetMinX();
403  ixmax = m_intrect.GetMaxX();
404 
405  if ( zerox < extbox.GetMinX() )
406  zerox = extbox.GetMinX();
407  else if ( zerox > extbox.GetMaxX() )
408  zerox = extbox.GetMaxX();
409 
410  m_axisY->SetPosXY( zerox, extbox.GetMinY() );
411  m_axisY->SetLength( extbox.GetHeight() );
412 
413  m_axisY->SetBoundaries( m_intrect.GetMinY(), m_intrect.GetMaxY() );
415  if( m_group && !m_group->GetPending() )
416  m_group->SetPending( true );
417 }
418 
420 {
421  const a2dCanvasObjectList* curvesList = GetCurves();
422  const_forEachIn( a2dCanvasObjectList, curvesList )
423  {
424  a2dCurve* curve = wxDynamicCast( ( a2dCanvasObject* ) * iter, a2dCurve );
425  if ( curve && curve->IsHighlighted() )
426  return true;
427  }
428  return false;
429 }
430 
431 void a2dCurvesArea::SetMarkerShow( a2dMarkerShow* showm )
432 {
433  m_markerShow = showm;
434 }
435 
436 
437 void a2dCurvesArea::SetMarkerShow2( a2dMarkerShow* showm )
438 {
439  m_markerShow2 = showm;
440 }
441 
443 {
445  {
446  a2dMarker* marker = wxDynamicCast( ( a2dCanvasObject* ) * iter, a2dMarker );
447  if ( marker )
448  return marker;
449  }
450  return NULL;
451 }
452 
453 void a2dCurvesArea::SetGroup( a2dCanvasXYDisplayGroupAreas* aGroup )
454 {
455  m_group = aGroup;
456  if( m_group )
457  {
459  if( m_group->GetRoot() )
460  {
461  SetRoot( m_group->GetRoot() );
462  if( m_axisY )
464  }
465  }
466 }
467 
468 void a2dCurvesArea::SetShowYaxis( bool showyaxis )
469 {
470  m_showyaxis = showyaxis;
471  if( m_axisY ) m_axisY->SetPending( true );
472  SetPending( true );
473 // if(m_group) m_group->SetPending(true);
474 }
475 
476 
477 #if wxART2D_USE_CVGIO
478 void a2dCurvesArea::DoSave( wxObject* parent, a2dIOHandlerXmlSerOut& out, a2dXmlSer_flag xmlparts, a2dObjectList* towrite )
479 {
480  a2dPolygonLClipper::DoSave( parent, out, xmlparts, towrite );
481  //TODO: make serializing for m_colour, m_markerShow and m_markerShow2
482  if ( xmlparts == a2dXmlSer_attrib )
483  {
484  out.WriteAttribute( wxT( "showyaxis" ) , m_showyaxis );
485  out.WriteNewLine();
486 
487  out.WriteAttribute( wxT( "ixmin" ) , m_intrect.GetMinX() );
488  out.WriteAttribute( wxT( "iymin" ) , m_intrect.GetMinY() );
489  out.WriteAttribute( wxT( "ixmax" ) , m_intrect.GetMaxX() );
490  out.WriteAttribute( wxT( "iymax" ) , m_intrect.GetMaxY() );
491  out.WriteNewLine();
492  }
493  else
494  {
495  out.WriteStartElement( wxT( "derived" ) );
496  m_axisY->Save( this, out, towrite );
497  out.WriteEndElement();
498  }
499 }
500 
501 void a2dCurvesArea::DoLoad( wxObject* parent, a2dIOHandlerXmlSerIn& parser, a2dXmlSer_flag xmlparts )
502 {
503  a2dPolygonLClipper::DoLoad( parent, parser, xmlparts );
504  //TODO: make serializing for m_colour, m_markerShow and m_markerShow2
505  if ( xmlparts == a2dXmlSer_attrib )
506  {
507  m_showyaxis = parser.RequireAttributeValueBool( wxT( "showyaxis" ) );
508 
509  m_intrect.SetMin( parser.RequireAttributeValueDouble( wxT( "ixmin" ) ),
510  parser.RequireAttributeValueDouble( wxT( "iymin" ) ) );
511  m_intrect.SetMax( parser.RequireAttributeValueDouble( wxT( "ixmax" ) ),
512  parser.RequireAttributeValueDouble( wxT( "iymax" ) ) );
513 
514 // TODO call SetInternalBoundaries() with extbox from a2dCanvasXYDisplayGroupAreas
515 // SetInternalBoundaries( m_ixmin, m_iymin, m_ixmax, m_iymax);
516  }
517  else
518  {
519  parser.Require( START_TAG, wxT( "derived" ) );
520  parser.Next();
521 
522  m_axisY->Load( parent, parser );
524 
525  parser.Require( END_TAG, wxT( "derived" ) );
526  parser.Next();
527  }
528 }
529 #endif
530 
531 #include <wx/arrimpl.cpp>
532 WX_DEFINE_OBJARRAY( a2dCurvesAreaListBase );
533 
534 a2dCurvesAreaList::a2dCurvesAreaList()
535  : m_group( NULL )
536 {
537  m_autoshowyaxes = false;
538  a2dBoundingBox extbox( 0, 0, 1, 1 );
539  a2dSmrtPtr<a2dCurvesArea> curvesarea = new a2dCurvesArea();
540  curvesarea->SetInternalBoundaries( extbox, 0, 0, 1, 1 );
541  Add( curvesarea );
542  curvesarea->SetGroup( m_group );
543  m_leftAxisY = curvesarea;
544 }
545 
546 a2dCurvesAreaList::a2dCurvesAreaList( const a2dCurvesAreaList& other, CloneOptions options, a2dRefMap* refs )
547  : m_group( NULL )
548 {
549  m_autoshowyaxes = other.m_autoshowyaxes;
550  for( size_t i = 0; i < other.GetCount(); i++ )
551  {
552  a2dSmrtPtr<a2dCurvesArea> area = ( a2dCurvesArea* )( other.Item( i ).Get()->Clone( a2dObject::CloneOptions( options & ~ a2dObject::clone_seteditcopy ) ) );
553  Add( area );
554  area->SetGroup( m_group );
555  if( other[i].Get() == other.m_leftAxisY )
556  m_leftAxisY = area;
557  if( other[i].Get() == other.m_rightAxisY )
558  m_rightAxisY = area;
559  }
560 }
561 
562 a2dCurvesAreaList::~a2dCurvesAreaList()
563 {
564  Clear();
565 }
566 
567 a2dObject* a2dCurvesAreaList::DoClone( CloneOptions options, a2dRefMap* refs ) const
568 {
569  a2dCurvesAreaList* cloneArea = new a2dCurvesAreaList( *this, options, refs );
570  return cloneArea;
571 }
572 
573 a2dCurvesArea* a2dCurvesAreaList::GetCurvesArea( const wxString& curvesAreaName )
574 {
575  a2dCurvesArea* emptyArea = NULL;
576  for( size_t i = 0; i < GetCount(); i++ )
577  {
578  a2dCurvesArea* area = Item( i );
579  if( area->GetName().IsEmpty() )
580  emptyArea = area;
581  else if( area->GetName() == curvesAreaName )
582  return area;
583  }
584  if( emptyArea != NULL && !curvesAreaName.IsEmpty() )
585  emptyArea->SetName( curvesAreaName );
586  return emptyArea;
587 }
588 
589 a2dCurvesArea* a2dCurvesAreaList::GetCurvesArea( const wxString& curvesAreaName ) const
590 {
591  a2dCurvesArea* emptyArea = NULL;
592  for( size_t i = 0; i < GetCount(); i++ )
593  {
594  a2dCurvesArea* area = Item( i );
595  if( area->GetName() == curvesAreaName )
596  return area;
597  }
598  return emptyArea;
599 }
600 
602 {
603  for( size_t i = 0; i < GetCount(); i++ )
604  {
605  a2dCurvesArea* area = Item( i );
606  area->SetBoundaries( extbox );
607  }
608 }
609 
610 bool a2dCurvesAreaList::ProcessCanvasObjectEvent( a2dIterC& ic, a2dHitEvent& hitEvent )
611 {
612  for( size_t i = 0; i < GetCount(); i++ )
613  {
614  a2dCurvesArea* area = Item( i );
615  area->ProcessCanvasObjectEvent( ic, hitEvent );
616  }
617  return hitEvent.m_processed;
618 }
619 
620 void a2dCurvesAreaList::DoWalker( wxObject* parent, a2dWalkerIOHandler& handler )
621 {
622  handler.WalkTask( parent, this, a2dWalker_a2dDerivedCanvasObjectStart );
623  a2dObject::DoWalker( parent, handler );
624 
625  for( size_t i = 0; i < GetCount(); i++ )
626  {
627  a2dCurvesArea* area = Item( i );
628  if ( area )
629  area->Walker( this, handler );
630 
631  }
632  handler.WalkTask( parent, this, a2dWalker_a2dDerivedCanvasObjectEnd );
633 }
634 
635 a2dCanvasObject* a2dCurvesAreaList::IsHitCurvesWorld ( a2dCurvesArea* &area, a2dIterC& ic, a2dHitEvent& hitEvent )
636 {
637  for( size_t i = 0; i < GetCount(); i++ )
638  {
639  area = Item( i );
640  a2dCanvasObject* curve = area->IsHitCurvesWorld ( ic, hitEvent );
641  if( curve )
642  return curve;
643  }
644  return NULL;
645 }
646 
648 {
649  for( size_t i = 0; i < GetCount(); i++ )
650  {
651  a2dCurvesArea* area = Item( i );
652  const a2dBoundingBox& aRect = area->GetInternalBoundaries();
653  ( *irectHash )[area->GetName()] = aRect;
654  }
655  return GetCount();
656 }
657 
659 {
660  for( size_t i = 0; i < GetCount(); i++ )
661  {
662  a2dCurvesArea* area = Item( i );
663  a2dBoundingBox abox = area->GetCurvesBoundaries();
664  a2dBoundingBox aRect( abox );
665  ( *irectHash )[area->GetName()] = aRect;
666  }
667  return GetCount();
668 }
669 
670 a2dBoundingBox& a2dCurvesAreaList::Expand( a2dBoundingBox& bbox ) const
671 {
672  /*
673  for(size_t i=0; i < GetCount(); i++)
674  {
675  a2dCurvesArea* area = Item(i);
676  area->Expand(bbox);
677  }
678  */
679  if( m_leftAxisY )
680  m_leftAxisY->Expand( bbox );
681  if( m_rightAxisY )
682  m_rightAxisY->Expand( bbox );
683  return bbox;
684 }
685 
686 void a2dCurvesAreaList::AddPending( a2dIterC& ic )
687 {
688  for( size_t i = 0; i < GetCount(); i++ )
689  {
690  a2dCurvesArea* area = Item( i );
691  area->AddPending( ic );
692  }
693 }
694 
695 bool a2dCurvesAreaList::Update( a2dCanvasObject::UpdateMode mode )
696 {
697  bool retCode = false;
698  a2dCurvesArea* leftAxisY = NULL;
699  a2dCurvesArea* rightAxisY = NULL;
700  bool leftOK = m_leftAxisY != ( a2dCurvesArea* )NULL ? m_leftAxisY->IsCurvesHighlighted() : false;
701  bool rightOK = m_rightAxisY != ( a2dCurvesArea* )NULL ? m_rightAxisY->IsCurvesHighlighted() : false;
702  for( size_t i = 0; i < GetCount(); i++ )
703  {
704  a2dCurvesArea* area = Item( i );
705 // area->SetGroup(m_group);
706  if( m_autoshowyaxes )
707  area->SetShowYaxis( false );
708  // area->GetAxisY()->SetInvertTic(false);
709  retCode = area->Update( mode ) || retCode;
710  if( m_autoshowyaxes )
711  {
712  if( !leftOK || !rightOK )
713  {
714  if( area->IsCurvesHighlighted() )
715  {
716  if( !leftAxisY )
717  leftAxisY = area;
718  else if( !rightAxisY )
719  rightAxisY = area;
720  }
721  }
722  }
723  }
724 
725  if( m_autoshowyaxes )
726  {
727  if( !leftOK )
728  {
729  if( leftAxisY )
730  {
731  if( leftAxisY != m_rightAxisY )
732  {
733  m_leftAxisY = leftAxisY;
734  leftOK = true;
735  }
736  }
737  if( !leftOK && rightAxisY )
738  {
739  if( rightAxisY != m_rightAxisY )
740  {
741  m_leftAxisY = rightAxisY;
742  leftOK = true;
743  }
744  }
745  }
746  if( !rightOK )
747  {
748  if( rightAxisY )
749  {
750  if( rightAxisY != m_leftAxisY )
751  {
752  m_rightAxisY = rightAxisY;
753  rightOK = true;
754  }
755  }
756  if( !rightOK && leftAxisY )
757  {
758  if( leftAxisY != m_leftAxisY )
759  {
760  m_rightAxisY = leftAxisY;
761  rightOK = true;
762  }
763  }
764  }
765  }
766  if( m_leftAxisY != ( a2dCurvesArea* )NULL )
767  {
768  if( m_autoshowyaxes )
769  {
770  m_leftAxisY->SetShowYaxis( true );
771  m_leftAxisY->GetAxisY()->SetInvertTic( false );
772  retCode = m_leftAxisY->Update( mode ) || retCode;
773  }
774  }
775  if( m_rightAxisY != ( a2dCurvesArea* )NULL )
776  {
777  if( m_autoshowyaxes )
778  {
779  m_rightAxisY->SetShowYaxis( true );
780  m_rightAxisY->GetAxisY()->SetInvertTic( true );
781  retCode = m_rightAxisY->Update( mode ) || retCode;
782  }
783  }
784  return retCode;
785 }
786 
787 void a2dCurvesAreaList::SetAxes( const a2dBoundingBox& extbox, double x, double y, double& zerox, double& zeroy, double& ixmin, double& ixmax )
788 {
789  // klion TODO remake
790  double tzerox, tzeroy, tixmin, tixmax;
791  for( size_t i = 0; i < GetCount(); i++ )
792  {
793  a2dCurvesArea* area = Item( i );
794  if( area != m_leftAxisY && area != m_rightAxisY )
795  area->SetAxes( extbox, area->GetAxisY()->GetPosition(), y, tzerox, tzeroy, tixmin, tixmax );
796  }
797 
798  if( m_leftAxisY != ( a2dCurvesArea* )NULL )
799  {
800  if( m_autoshowyaxes )
801  m_leftAxisY->SetAxes( extbox, m_leftAxisY->m_intrect.GetMinX(), m_leftAxisY->m_intrect.GetMinY(), zerox, zeroy, ixmin, ixmax );
802  else
803  m_leftAxisY->SetAxes( extbox, m_leftAxisY->GetAxisY()->GetPosition(), y, zerox, zeroy, ixmin, ixmax );
804 
805  }
806  if( m_rightAxisY != ( a2dCurvesArea* )NULL )
807  {
808  if( m_autoshowyaxes )
809  m_rightAxisY->SetAxes( extbox, m_rightAxisY->m_intrect.GetMaxX(), m_rightAxisY->m_intrect.GetMinY(), tzerox, tzeroy, tixmin, tixmax );
810  else
811  m_rightAxisY->SetAxes( extbox, m_rightAxisY->GetAxisY()->GetPosition(), y, tzerox, tzeroy, tixmin, tixmax );
812  }
813 }
814 
816 {
817  if( m_leftAxisY != ( a2dCurvesArea* )NULL )
818  {
819  if( m_leftAxisY->m_showyaxis )
820  m_leftAxisY->m_axisY->Render( ic, clipparent );
821  }
822  if( m_rightAxisY != ( a2dCurvesArea* )NULL )
823  {
825  m_rightAxisY->m_axisY->Render( ic, clipparent );
826  }
827 }
828 
829 void a2dCurvesAreaList::Render ( a2dIterC& ic, OVERLAP clipparent )
830 {
831  for( size_t i = 0; i < GetCount(); i++ )
832  {
833  a2dCurvesArea* area = Item( i );
836  area->Render( ic, clipparent );
837  }
838 }
839 
840 void a2dCurvesAreaList::SetShowLeftYaxis( const wxString& curveAreaName, bool showyaxis )
841 {
842  //disable the previous a2dCurveArea which was set as m_leftAxisY
843  //And set the new one
844  for( size_t i = 0; i < GetCount(); i++ )
845  {
846  a2dCurvesArea* area = Item( i );
847  if( area->GetName() == curveAreaName )
848  {
849  if( area != m_leftAxisY )
850  {
851  if( m_leftAxisY != ( a2dCurvesArea* ) NULL )
852  m_leftAxisY->SetShowYaxis( false );
853  m_leftAxisY = area;
854  }
855  m_leftAxisY->SetShowYaxis( showyaxis );
856  if( m_autoshowyaxes )
857  m_leftAxisY->GetAxisY()->SetInvertTic( false );
858  break;
859  }
860  }
861 }
862 
863 void a2dCurvesAreaList::SetShowRightYaxis( const wxString& curveAreaName, bool showyaxis )
864 {
865  //disable the previous a2dCurveArea which was set as m_rightAxisY
866  //And set the new one
867  for( size_t i = 0; i < GetCount(); i++ )
868  {
869  a2dCurvesArea* area = Item( i );
870  if( area->GetName() == curveAreaName )
871  {
872  if( area != m_rightAxisY )
873  {
874  if( m_rightAxisY != ( a2dCurvesArea* ) NULL )
875  {
876  if( m_autoshowyaxes )
877  m_rightAxisY->GetAxisY()->SetInvertTic( false );
878  m_rightAxisY->SetShowYaxis( false );
879  }
880  m_rightAxisY = area;
881  }
882  m_rightAxisY->SetShowYaxis( showyaxis );
883  if( m_autoshowyaxes )
884  m_rightAxisY->GetAxisY()->SetInvertTic( true );
885  break;
886  }
887  }
888 }
889 
890 /*
891 double a2dBoundsRound(double val, double inc)
892 {
893  double expon = log10(fabs(val)); ///10.));
894  int toInt = int(expon+(expon<0. ? -0.5 : 0.5));
895  return double((int(val*pow(10.,-toInt)+inc))*pow(10.,toInt));
896 }
897 */
898 
899 inline double a2dInternal_BoundsRound( double val, bool tics )
900 {
901  double abs_val = fabs( val );
902  if( abs_val < 1E-10 )
903  return 0.;
904  double expon = log10( abs_val ); ///10.));
905  int toInt = int( expon < 0 ? expon - 1 : expon );
906  double standardized = val * pow( 10., -toInt );
907  if( tics )
908  {
909  int sign = val < 0. ? -1 : 1;
910  double abs_standardized = fabs( standardized );
911  if( abs_standardized <= 1.0001 )
912  return pow( 10., toInt ) * sign;
913  else if( abs_standardized <= 1.2501 )
914  return 1.25 * pow( 10., toInt ) * sign;
915  else if( abs_standardized <= 2.0001 )
916  return 2.*pow( 10., toInt ) * sign;
917  else if( abs_standardized <= 2.5001 )
918  return 2.5 * pow( 10., toInt ) * sign;
919  else if( abs_standardized <= 5.0001 )
920  return 5.*pow( 10., toInt ) * sign;
921  return 10.*pow( 10., toInt ) * sign;
922  }
923 // double expand = val < 0. ? -0.999999 : 0.999999;
924  double expand = val < 0. ? -0.5 : 0.5;
925  return double( ( int( standardized + expand ) ) * pow( 10., toInt ) );
926 }
927 
928 double a2dBoundsRound( double val )
929 {
930  return a2dInternal_BoundsRound( val, false );
931 }
932 
933 double a2dTicsRound( double val )
934 {
935  return a2dInternal_BoundsRound( val, true );
936 }
937 
938 void a2dCurvesAreaList::SetTicY( int numLines )
939 {
940  if( numLines < 2 )
941  numLines = 2;
942 // wxASSERT(numLines);
943  double numLines2 = numLines / 2;
944  int precision = 0;
945  for( size_t i = 0; i < GetCount(); i++ )
946  {
947  a2dCurvesArea* area = Item( i );
948  a2dBoundingBox newRect = area->m_intrect;
949  // klion TODO: for negative scale values
950 // wxMax(fabs(curMaxY),fabs(curMinY);
951 // ???????????
952  double curHeight = newRect.GetHeight();
953  double meanY = newRect.GetMinY() + curHeight / 2.;
954  double newHeight = a2dTicsRound( curHeight / ( double )numLines ) * numLines;
955  double aTic = newHeight / ( double )numLines;
956  wxASSERT( aTic > 1E-12 );
957  double newMeanY = int( ( meanY / aTic ) + ( meanY < 0. ? -0.5 : 0.5 ) ) * aTic;
958  double newMinY = newMeanY - newHeight / 2.;
959  if( newRect.GetMinY() == 0. && newMinY < 0. )
960  newMinY = 0.;
961 // double newMinY = a2d Bounds Round((newRect.m_miny-(newHeight - curHeight)/2.)/aTic*2.)*aTic/2.;
962  newRect.SetMinY( newMinY );
963  double newMaxY = newMinY + newHeight;
964  newRect.SetMaxY( newMaxY );
965  area->SetInternalBoundaries( m_group->GetPlotAreaRect(), newRect );
966  a2dCurveAxis* axisY = area->GetAxisY();
967  axisY->SetTic( aTic );
968  precision = m_group->SetAxisTicPrecision( axisY, newMinY, newMaxY );
969  }
970  if( precision )
971  m_group->SetCommonTicPrecision( precision );
972 }
973 
974 /*
975 a2dBoundingBox a2dCurvesAreaList::SetMarkersPos(const a2dBoundingBox& bbox)
976 {
977  a2dBoundingBox tbox(bbox.GetMinX(), bbox.GetMaxY(), bbox.GetMinX(), bbox.GetMaxY());
978 
979  for(int i=GetCount()-1; i >= 0 ; i--)
980  {
981  a2dCurvesArea* area = Item(i);
982  a2dMarkerShow* marker2 = wxDynamicCast( (a2dMarkerShow*)area->m_markerShow2, a2dMarkerShow );
983  if(marker2)
984  {
985  marker2->SetPosXY(bbox.GetMinX(), tbox.GetMaxY());
986 // marker2->SetLineWidth(bbox.GetWidth());
987  marker2->Update( a2dCanvasObject::updatemask_normal );
988  tbox.Expand(marker2->GetBbox());
989  }
990  a2dMarkerShow* marker = wxDynamicCast( (a2dMarkerShow*)area->m_markerShow, a2dMarkerShow );
991  if(marker)
992  {
993  marker->SetPosXY(bbox.GetMinX(), tbox.GetMaxY());
994 // marker->SetLineWidth(bbox.GetWidth());
995  marker->Update( a2dCanvasObject::updatemask_normal );
996  tbox.Expand(marker->GetBbox());
997  }
998  }
999  return tbox;
1000 }
1001 */
1002 
1003 /*
1004 void a2dCurvesAreaList::ChangeCursorPos(double shift)
1005 {
1006  if(m_leftAxisY)
1007  {
1008  a2dMarker* marker = m_leftAxisY->GetCursorMarker();
1009  if(marker)
1010  {
1011  a2dBoundingBox ibox = m_leftAxisY->GetInternalBoundaries();
1012  double curX = marker->GetPosX() + shift;
1013  if(curX < ibox.GetMinX())
1014  curX = ibox.GetMinX();
1015  if(curX > ibox.GetMaxX())
1016  curX = ibox.GetMaxX();
1017  for(size_t i=0; i < GetCount() ; i++)
1018  {
1019  a2dCurvesArea* area = Item(i);
1020  a2dMarker* curMarker = area->GetCursorMarker();
1021  if(curMarker)
1022  {
1023  a2dPoint2D point;
1024  if(curMarker->GetCurve()->GetXyAtSweep(curX,point))
1025  curMarker->SetPosXY(curX,point.m_y);
1026  }
1027  }
1028  }
1029 
1030  }
1031 }
1032 */
1033 
1034 void a2dCurvesAreaList::DependencyPending( a2dWalkerIOHandler* handler )
1035 {
1036  for( size_t i = 0; i < GetCount(); i++ )
1037  {
1038  a2dCurvesArea* area = Item( i );
1039 // area->SetGroup(m_group);
1040  area->DependencyPending( handler );
1041  }
1042 }
1043 
1044 bool a2dCurvesAreaList::GetPending( void )
1045 {
1046  bool retCode = false;
1047  for( size_t i = 0; i < GetCount(); i++ )
1048  {
1049  a2dCurvesArea* area = Item( i );
1050  retCode = retCode || area->GetPending();
1051  }
1052  return retCode;
1053 }
1054 
1055 void a2dCurvesAreaList::UpdateViewDependentObjects( a2dIterC& ic )
1056 {
1057  for( size_t i = 0; i < GetCount(); i++ )
1058  {
1059  a2dCurvesArea* area = Item( i );
1060  area->UpdateViewDependentObjects( ic );
1061  }
1062 }
1063 
1064 void a2dCurvesAreaList::SetCursor( a2dCursor* cursor )
1065 {
1066  cursor->RemoveMarkers();
1067  for( size_t i = 0; i < GetCount(); i++ )
1068  {
1069  a2dCurvesArea* area = Item( i );
1070  a2dMarker* marker = area->GetCursorMarker();
1071  if( marker )
1072  cursor->AddMarker( marker );
1073  }
1074 }
1075 
1077 {
1078  bool retCode = false;
1079  for( size_t i = 0; i < GetCount() && !retCode; i++ )
1080  {
1081  a2dCurvesArea* area = Item( i );
1082  retCode = retCode || area->GetHasSelectedObjectsBelow();
1083  }
1084  return retCode;
1085 }
1086 
1087 bool a2dCurvesAreaList::GetHasToolObjectsBelow()
1088 {
1089  bool retCode = false;
1090  for( size_t i = 0; i < GetCount() && !retCode; i++ )
1091  {
1092  a2dCurvesArea* area = Item( i );
1093  retCode = retCode || area->GetHasToolObjectsBelow();
1094  }
1095  return retCode;
1096 }
1097 
1098 void a2dCurvesAreaList::SetClippingFromBox( a2dBoundingBox& bbox )
1099 {
1100  for( size_t i = 0; i < GetCount(); i++ )
1101  {
1102  a2dCurvesArea* area = Item( i );
1103  area->SetClippingFromBox( bbox );
1104  }
1105 }
1106 
1107 void a2dCurvesAreaList::SetGroup( a2dCanvasXYDisplayGroupAreas* aGroup )
1108 {
1109  m_group = aGroup;
1110  for( size_t i = 0; i < GetCount(); i++ )
1111  {
1112  a2dCurvesArea* area = Item( i );
1113  area->SetGroup( aGroup );
1114  }
1115 }
1116 
1117 #if wxART2D_USE_CVGIO
1118 void a2dCurvesAreaList::DoSave( wxObject* parent, a2dIOHandlerXmlSerOut& out, a2dXmlSer_flag xmlparts, a2dObjectList* towrite )
1119 {
1120  a2dObject::DoSave( parent, out, xmlparts, towrite );
1121  //TODO: make serializing for m_leftAxisY
1122  //TODO: make serializing for m_rightAxisY
1123  if ( xmlparts == a2dXmlSer_attrib )
1124  {
1125  }
1126  else
1127  {
1128  out.WriteStartElement( wxT( "derived" ) );
1129 
1130  for( size_t i = 0; i < GetCount(); i++ )
1131  {
1132  a2dCurvesArea* area = Item( i );
1133  area->Save( this, out, towrite );
1134  }
1135 
1136  out.WriteEndElement();
1137  }
1138 }
1139 
1140 void a2dCurvesAreaList::DoLoad( wxObject* parent, a2dIOHandlerXmlSerIn& parser, a2dXmlSer_flag xmlparts )
1141 {
1142  a2dObject::DoLoad( parent, parser, xmlparts );
1143  //TODO: make serializing for m_leftAxisY
1144  //TODO: make serializing for m_rightAxisY
1145  if ( xmlparts == a2dXmlSer_attrib )
1146  {
1147  }
1148  else
1149  {
1150  parser.Require( START_TAG, wxT( "derived" ) );
1151  parser.Next();
1152 
1153  // TODO: loading
1154  wxASSERT( 0 );
1155 
1156  parser.Require( END_TAG, wxT( "derived" ) );
1157  parser.Next();
1158  }
1159 }
1160 #endif
1161 
1162 //----------------------------------------------------------------------------
1163 // a2dCanvasXYDisplayGroupAreas
1164 //----------------------------------------------------------------------------
1165 const a2dPropertyIdRefObject a2dCanvasXYDisplayGroupAreas::PROPID_strokegrid( wxT( "strokegrid" ), a2dPropertyId::flag_none, 0 );
1166 const a2dPropertyIdRefObject a2dCanvasXYDisplayGroupAreas::PROPID_fillAxisArea( wxT( "fillAxisArea" ), a2dPropertyId::flag_none, 0 );
1167 //const a2dPropertyIdCanvasObject a2dCanvasXYDisplayGroupAreas::PROPID_axesarea( wxT("axesarea"), a2dPropertyId::flag_none, 0 );
1168 
1169 BEGIN_EVENT_TABLE( a2dCanvasXYDisplayGroupAreas, a2dCanvasObject )
1170  EVT_CANVASOBJECT_MOUSE_EVENT( a2dCanvasXYDisplayGroupAreas::OnCanvasObjectMouseEvent )
1171  EVT_CHAR( a2dCanvasXYDisplayGroupAreas::OnChar )
1172 END_EVENT_TABLE()
1173 
1174 void a2dCanvasXYDisplayGroupAreas::DoWalker( wxObject* parent, a2dWalkerIOHandler& handler )
1175 {
1176  handler.WalkTask( parent, this, a2dWalker_a2dDerivedCanvasObjectStart );
1177  a2dCanvasObject::DoWalker( parent, handler );
1178 
1179  if ( m_axesarealist )
1180  m_axesarealist->Walker( this, handler );
1181 
1182  if( m_axisX )
1183  m_axisX->Walker( this, handler );
1184 // if( m_axisY )
1185 // m_axisY->Walker( this, handler );
1186  if( m_cursor )
1187  m_cursor->Walker( this, handler );
1188 
1189  handler.WalkTask( parent, this, a2dWalker_a2dDerivedCanvasObjectEnd );
1190 }
1191 
1193 {
1195 
1196  m_axisX->AddPending( ic );
1197  if( m_cursor )
1198  m_cursor->AddPending( ic );
1199  m_axesarealist->AddPending( ic );
1200 }
1201 
1202 bool a2dCanvasXYDisplayGroupAreas::DoStartEdit( wxUint16 editmode, wxEditStyle editstyle )
1203 {
1204  if ( m_flags.m_editable )
1205  {
1206  PROPID_IncludeChildren->SetPropertyToObject( this, false );
1207  PROPID_Allowrotation->SetPropertyToObject( this, false );
1208  PROPID_Allowskew->SetPropertyToObject( this, false );
1209 
1210  return a2dCanvasObject::DoStartEdit( editmode, editstyle );
1211  }
1212 
1213  return false;
1214 }
1215 
1217 {
1218  if ( ic.GetDrawingPart()->GetCaptured() == this )
1219  {
1221  return hitEvent.m_processed;
1222  }
1223 
1224  hitEvent.m_isHit = false;
1225 
1226  // prepare relative to object coordinates for derived objects
1227  ic.GetInverseTransform().TransformPoint( hitEvent.m_x, hitEvent.m_y, hitEvent.m_relx, hitEvent.m_rely );
1228  if ( GetBbox().PointInBox( hitEvent.m_relx, hitEvent.m_rely, m_worldExtend + ic.GetHitMarginWorld() + ic.ExtendDeviceToWorld( m_pixelExtend ) ) )
1229  {
1230  a2dIterCU cu( ic, this );
1231 
1232  m_axesarealist->ProcessCanvasObjectEvent( ic, hitEvent );
1233  m_axisX->ProcessCanvasObjectEvent( ic, hitEvent );
1234  }
1235 
1237 
1238  return hitEvent.m_processed;
1239 }
1240 
1241 
1242 void a2dCanvasXYDisplayGroupAreas::OnChar( wxKeyEvent& event )
1243 {
1244  if ( m_flags.m_editingCopy )
1245  {
1246  switch( event.GetKeyCode() )
1247  {
1248  case WXK_LEFT:
1249  {
1250  ChangeCursorPos( -1 );
1251  }
1252  break;
1253  case WXK_PAGEDOWN:
1254  {
1255  ChangeCursorPos( -10 );
1256  }
1257  break;
1258  case WXK_HOME:
1259  {
1260  ChangeCursorPos( -1024 );
1261  }
1262  break;
1263  case WXK_RIGHT:
1264  {
1265  ChangeCursorPos( 1 );
1266  }
1267  break;
1268  case WXK_PAGEUP:
1269  {
1270  ChangeCursorPos( 10 );
1271  }
1272  break;
1273  case WXK_END:
1274  {
1275  ChangeCursorPos( 1024 );
1276  }
1277  break;
1278  default:
1279  event.Skip();
1280  break;
1281  }
1282  /*
1283  switch(event.GetKeyCode())
1284  {
1285 
1286  case 'Z':
1287  case 'z':
1288  {
1289  a2dZoomTool* zoom = new a2dZoomTool(this);
1290  PushTool(zoom);
1291  }
1292  break;
1293  case WXK_SPACE:
1294  {
1295  StopTool();
1296  }
1297  break;
1298  case WXK_ESCAPE:
1299  {
1300  StopTool();
1301  }
1302  break;
1303 
1304  default:
1305  event.Skip();
1306  }
1307  */
1308  }
1309  else
1310  event.Skip();
1311 }
1312 
1313 void a2dCanvasXYDisplayGroupAreas::OnCanvasObjectMouseEvent( a2dCanvasObjectMouseEvent& event )
1314 {
1315  a2dIterC* ic = event.GetIterC();
1316 
1317  if ( m_flags.m_editingCopy )
1318  {
1319  //to world group coordinates to do hit test in world group coordinates
1320  double xw, yw;
1321  xw = event.GetX();
1322  yw = event.GetY();
1323 
1324  a2dAffineMatrix atWorld = ic->GetTransform();
1325 
1326  if ( event.GetMouseEvent().LeftDown() )
1327  {
1328  if ( event.GetMouseEvent().m_shiftDown )
1329  {
1330 #if wxART2D_USE_EDITOR
1331  a2dCanvasXYDisplayGroupAreas* original = wxStaticCast( PROPID_Original->GetPropertyValue( this ).Get(), a2dCanvasXYDisplayGroupAreas );
1332  a2dIterCU cu( *ic, original );
1333 //klion a2dIterCU cu2( *ic, original->m_axesarea );
1334  ic->SetCorridorPath( true, NULL );
1335 
1336  a2dStToolContr* controller = wxStaticCast( PROPID_Controller->GetPropertyValue( this ).Get(), a2dStToolContr );
1337  a2dDrawRectangleTool* drawrec = new a2dDrawRectangleTool( controller );
1338  controller->PushTool( drawrec );
1339  drawrec->SetEditAtEnd( true );
1340 #else //wxART2D_USE_EDITOR
1341  wxMessageBox( wxT( "Need editor module enabled for this" ) );
1342 #endif //wxART2D_USE_EDITOR
1343 
1344  SetPending( true );
1345  ic->GetDrawingPart()->SetCursor( a2dCanvasGlobals->GetCursor( a2dCURSOR_CROSS ) );
1346  }
1347  else if ( event.GetMouseEvent().m_controlDown )
1348  {
1349 #if wxART2D_USE_EDITOR
1350  a2dCanvasXYDisplayGroupAreas* original = wxStaticCast( PROPID_Original->GetPropertyValue( this ).Get(), a2dCanvasXYDisplayGroupAreas );
1351  a2dIterCU cu( *ic, original );
1352 //klion a2dIterCU cu2( *ic, original->m_axesarea );
1353  ic->SetCorridorPath( true, NULL );
1354 
1355  a2dStToolContr* controller = wxStaticCast( PROPID_Controller->GetPropertyValue( this ).Get(), a2dStToolContr );
1356  a2dDrawPolygonLTool* draw = new a2dDrawPolygonLTool( controller );
1357  controller->PushTool( draw );
1358  draw->SetEditAtEnd( true );
1359 #else //wxART2D_USE_EDITOR
1360  wxMessageBox( wxT( "Need editor module enabled for this" ) );
1361 #endif //wxART2D_USE_EDITOR
1362 
1363  SetPending( true );
1364  ic->GetDrawingPart()->SetCursor( a2dCanvasGlobals->GetCursor( a2dCURSOR_CROSS ) );
1365  }
1366  else
1367  {
1368  a2dHitEvent hitevent = a2dHitEvent( xw, yw, false );
1369  if ( IsHitWorld( *ic, hitevent ) )
1370  {
1371 // a2dAffineMatrix areaworld = m_axesarea->GetTransformMatrix();
1372 
1373  a2dCanvasXYDisplayGroupAreas* original = wxStaticCast( PROPID_Original->GetPropertyValue( this ).Get(), a2dCanvasXYDisplayGroupAreas );
1374 
1375  a2dHitEvent hitinfo( xw, yw, false, a2dCANOBJHITOPTION_LAYERS );
1376  hitinfo.m_xyRelToChildren = true;
1377  a2dCanvasObject* marker = original->ChildIsHitWorld( *ic, hitinfo );
1378  if ( marker && marker->GetEditable() )
1379  {
1380 #if wxART2D_USE_EDITOR
1381  a2dIterCU cu( *ic, original );
1382  a2dStToolContr* controller = wxStaticCast( PROPID_Controller->GetPropertyValue( this ).Get(), a2dStToolContr );
1383 
1384  ic->SetCorridorPath( true, NULL );
1385  controller->StartEditingObject( marker, *ic );
1386 
1387 #else //wxART2D_USE_EDITOR
1388  wxMessageBox( wxT( "Need editor module enabled for this" ) );
1389 #endif //wxART2D_USE_EDITOR
1390 
1391  SetPending( true );
1392  ic->GetDrawingPart()->SetCursor( a2dCanvasGlobals->GetCursor( a2dCURSOR_CROSS ) );
1393  event.Skip(); //first event for new tool
1394  return;
1395  }
1396 
1397  a2dIterCU cu( *ic, original );
1398 // a2dCanvasObject* curve = original->m_axesarea->IsHitWorld( *ic, xw, yw, wxLAYER_ALL, a2dCANOBJHITOPTION_NOROOT );
1399  a2dCurvesArea* curvesarea;
1400  a2dHitEvent hitinfocurve( xw, yw, false, a2dCANOBJHITOPTION_LAYERS );
1401  hitinfocurve.m_xyRelToChildren = true;
1402  a2dCanvasObject* curve = original->m_axesarealist->IsHitCurvesWorld( curvesarea, *ic, hitinfocurve );
1403  if ( curve && curve->GetEditable() )
1404  {
1405 #if wxART2D_USE_EDITOR
1406 // a2dIterCU cu2( *ic, original->m_axesarea );
1407  a2dStToolContr* controller = wxStaticCast( PROPID_Controller->GetPropertyValue( this ).Get(), a2dStToolContr );
1408 
1409  ic->SetCorridorPath( true, NULL );
1410  controller->StartEditingObject( curve, *ic );
1411 
1412 #else //wxART2D_USE_EDITOR
1413  wxMessageBox( wxT( "Need editor module enabled for this" ) );
1414 #endif //wxART2D_USE_EDITOR
1415 
1416  SetPending( true );
1417  ic->GetDrawingPart()->SetCursor( a2dCanvasGlobals->GetCursor( a2dCURSOR_CROSS ) );
1418  event.Skip(); //first event for new tool
1419  return;
1420  }
1421 
1422  /*
1423  a2dHitEvent hitinfomarkerY( xw, yw, false, a2dCANOBJHITOPTION_LAYERS );
1424  hitinfomarkerY.m_xyRelToChildren = true;
1425  a2dCanvasObject* axisMarker = original->m_axisY->ChildIsHitWorld( *ic, hitinfomarkerY );
1426  if ( axisMarker )
1427  {
1428  #if wxART2D_USE_EDITOR
1429  a2dIterCU cu2( *ic, original->m_axisY );
1430  ic->SetCorridorPath( true, NULL );
1431  a2dStToolContr* controller = wxStaticCast( PROPID_controller->GetPropertyValue( this ).Get(), a2dStToolContr );
1432 
1433  ic->SetCorridorPath( true, NULL );
1434  controller->StartEditingObject( curve, *ic );
1435 
1436  #else //wxART2D_USE_EDITOR
1437  wxMessageBox( wxT("Need editor module enabled for this") );
1438  #endif //wxART2D_USE_EDITOR
1439 
1440  SetPending( true );
1441  ic->GetDrawingPart()->SetCursor( a2dCanvasGlobals->GetCursor( a2dCURSOR_CROSS ) );
1442  event.Skip(); //first event for new tool
1443  return;
1444  }
1445  */
1446 
1447  a2dHitEvent hitinfomarker( xw, yw, false, a2dCANOBJHITOPTION_LAYERS );
1448  hitinfomarker.m_xyRelToChildren = true;
1449  a2dCanvasObject* axisMarker = original->m_axisX->ChildIsHitWorld( *ic, hitinfomarker );
1450  if ( axisMarker && axisMarker->GetEditable() )
1451  {
1452 #if wxART2D_USE_EDITOR
1453  a2dIterCU cu2( *ic, original->m_axisX );
1454 
1455  a2dStToolContr* controller = wxStaticCast( PROPID_Controller->GetPropertyValue( this ).Get(), a2dStToolContr );
1456 
1457  ic->SetCorridorPath( true, NULL );
1458  controller->StartEditingObject( axisMarker, *ic );
1459 
1460 #else //wxART2D_USE_EDITOR
1461  wxMessageBox( wxT( "Need editor module enabled for this" ) );
1462 #endif //wxART2D_USE_EDITOR
1463 
1464  SetPending( true );
1465  ic->GetDrawingPart()->SetCursor( a2dCanvasGlobals->GetCursor( a2dCURSOR_CROSS ) );
1466  event.Skip(); //first event for new tool
1467  return;
1468  }
1469 
1470  else
1471  event.Skip();
1472  }
1473  else
1474  EndEdit();
1475  }
1476  }
1477  else if ( event.GetMouseEvent().LeftDClick() )
1478  {
1479  EndEdit();
1480  }
1481  else if ( event.GetMouseEvent().Moving() )
1482  {
1483  /*
1484  a2dAffineMatrix cworld;
1485  a2dHit how;
1486  a2dAffineMatrix areaworld = m_axesarea->GetTransformMatrix();
1487  a2dAffineMatrix tworld;
1488  tworld *= m_lworld;
1489  tworld *= areaworld;
1490 
1491  a2dCanvasObject* curve = m_axesarea->WhichIsHitWorld( &tworld, xw, yw, NULL, how );
1492  if ( curve )
1493  {
1494  event.Skip();
1495  }
1496  else
1497  {
1498  event.Skip();
1499  }
1500  */
1501  event.Skip();
1502  }
1503  else
1504  event.Skip();
1505  }
1506  else
1507  event.Skip();
1508 }
1509 
1511  : a2dCanvasObject(), m_plotrect( 0, 0, 1, 1 )
1512 {
1513  m_lworld.Translate( x, y );
1514 
1516  m_cursorOnlyByCurves = true;
1517 
1518  m_showgrid = true;
1519  m_showxaxis = true;
1520  m_autoTicYPrecision = true;
1521 
1522  m_strokegrid = a2dStroke( wxColour( 10, 17, 25 ), 16, a2dSTROKE_LONG_DASH );
1523  m_fillAxisArea = *a2dTRANSPARENT_FILL;
1524  m_strokeAxisArea = *a2dTRANSPARENT_STROKE;
1525 
1526  m_axesarealist = new a2dCurvesAreaList();
1527  m_axesarealist->SetGroup( this );
1528 
1529  m_axisX = new a2dCurveAxisLin();
1530 }
1531 
1533 {
1534 // m_axisY->ReleaseChildObjects();
1536  if( m_cursor )
1537  {
1538  m_cursor->RemoveMarkers();
1539  m_cursor = NULL;
1540  }
1541  /*
1542  Dump();
1543  DumpOwners();
1544  m_axisX->Dump();
1545  m_axisX->DumpOwners();
1546  m_axisY->Dump();
1547  m_axisY->DumpOwners();
1548  */
1549 }
1550 
1551 a2dCanvasXYDisplayGroupAreas::a2dCanvasXYDisplayGroupAreas( const a2dCanvasXYDisplayGroupAreas& other, CloneOptions options, a2dRefMap* refs )
1552  : a2dCanvasObject( other, options, refs )
1553 {
1554  m_cursorOnlyByCurves = other.m_cursorOnlyByCurves;
1555  m_showgrid = other.m_showgrid;
1556  m_showxaxis = other.m_showxaxis;
1557  m_autoTicYPrecision = other.m_autoTicYPrecision;
1558 
1559  if( options & clone_members )
1560  {
1561  m_axisX = ( a2dCurveAxis* ) other.m_axisX->Clone( CloneOptions( options & ~ clone_seteditcopy ) );
1562  if( other.m_cursor )
1563  m_cursor = ( a2dCursor* ) other.m_cursor->Clone( CloneOptions( options & ~ clone_seteditcopy ) );
1564  m_strokegrid = other.m_strokegrid;
1565  m_fillAxisArea = other.m_fillAxisArea;
1566  m_strokeAxisArea = other.m_strokeAxisArea;
1567  }
1568  else
1569  {
1570  m_axisX = other.m_axisX;
1571  m_cursor = other.m_cursor;
1572  m_strokegrid = other.m_strokegrid;
1573  m_fillAxisArea = other.m_fillAxisArea;
1574  m_strokeAxisArea = other.m_strokeAxisArea;
1575  }
1576 
1577  m_plotrect = other.m_plotrect;
1578 
1579  if( options & clone_members )
1580  m_axesarealist = ( a2dCurvesAreaList* ) other.m_axesarealist->Clone( CloneOptions( options & ~ clone_seteditcopy ) );
1581  else
1583  m_axesarealist->SetGroup( this );
1584  if( m_axisX && GetRoot() )
1585  m_axisX->SetRoot( GetRoot() );
1586 
1587 #if defined(_DEBUG) && defined (SMART_POINTER_DEBUG)
1588  //klion: it is because the CurrentSmartPointerOwner can change in other.m_axesarea->Clone()
1589  CurrentSmartPointerOwner = this;
1590 #endif
1591 }
1592 
1594 {
1595  return new a2dCanvasXYDisplayGroupAreas( *this, options, refs );
1596 }
1597 
1599 {
1600  a2dSmrtPtr<a2dCurvesArea> curvesarea = m_axesarealist->GetCurvesArea( curveAreaName );
1601  if( curvesarea == ( a2dCurvesArea* )NULL )
1602  {
1603  curvesarea = new a2dCurvesArea( curveAreaName );
1604  wxASSERT_MSG( curvesarea != ( a2dCurvesArea* )NULL, wxString::Format( wxT( "can't create curves area with name '%s' " ), curveAreaName.c_str() ) );
1605  // curvesarea->SetCanvasDocument(GetCanvasDocument());
1606  curvesarea->SetBoundaries( m_plotrect );
1607  m_axesarealist->Add( curvesarea );
1608  curvesarea->SetGroup( this );
1609 
1610  if( m_axesarealist->m_leftAxisY == ( a2dCurvesArea* )NULL )
1611  m_axesarealist->m_leftAxisY = curvesarea;
1612  else if( m_axesarealist->m_rightAxisY == ( a2dCurvesArea* )NULL )
1613  {
1614  m_axesarealist->m_rightAxisY = curvesarea;
1615  if( m_axesarealist->GetAutoShowYAxes() )
1616  m_axesarealist->m_rightAxisY->GetAxisY()->SetInvertTic( true );
1617  }
1618  else
1619  {
1621  // m_axesarealist->m_rightAxisY->GetAxisY()->SetInvertTic(false);
1622  m_axesarealist->m_rightAxisY = curvesarea;
1623  if( m_axesarealist->GetAutoShowYAxes() )
1624  m_axesarealist->m_rightAxisY->GetAxisY()->SetInvertTic( true );
1625  }
1626  SetPending( true );
1627  }
1628  return curvesarea;
1629 }
1630 
1631 void a2dCanvasXYDisplayGroupAreas::AddCurveToArea( const wxString& curveAreaName, a2dCurve* curve, const wxString curvename )
1632 {
1633  a2dSmrtPtr<a2dCurvesArea> curvesarea = AddCurvesArea( curveAreaName );
1634  if( curvesarea )
1635  {
1636  curvesarea->AddCurve( curve, curvename );
1637  SetPending( true );
1638  }
1639 }
1640 
1641 void a2dCanvasXYDisplayGroupAreas::InsertCurveToArea( const wxString& curveAreaName, size_t before, a2dCurve* curve, const wxString curvename )
1642 {
1643  a2dSmrtPtr<a2dCurvesArea> curvesarea = AddCurvesArea( curveAreaName );
1644  if( curvesarea )
1645  {
1646  curvesarea->InsertCurve( before, curve, curvename );
1647  SetPending( true );
1648  }
1649 }
1650 
1651 void a2dCanvasXYDisplayGroupAreas::AddMarkerToArea( const wxString& curveAreaName, a2dMarker* marker )
1652 {
1653  a2dCurvesArea* curvesarea = m_axesarealist->GetCurvesArea( curveAreaName );
1654  wxASSERT_MSG( curvesarea != NULL, wxString::Format( wxT( "not found curves area by name '%s' " ), curveAreaName.c_str() ) );
1655  if( curvesarea )
1656  {
1657  curvesarea->AddMarker( marker );
1658  SetPending( true );
1659  }
1660  if( m_cursor )
1661  m_cursor->AddMarker( marker );
1662 }
1663 
1664 void a2dCanvasXYDisplayGroupAreas::RemoveMarkerFromArea( const wxString& curveAreaName, a2dMarker* marker )
1665 {
1666  a2dCurvesArea* curvesarea = m_axesarealist->GetCurvesArea( curveAreaName );
1667  wxASSERT_MSG( curvesarea != NULL, wxString::Format( wxT( "not found curves area by name '%s' " ), curveAreaName.c_str() ) );
1668  if( curvesarea )
1669  {
1670  curvesarea->RemoveMarker( marker );
1671  SetPending( true );
1672  }
1673  if( m_cursor )
1674  m_cursor->RemoveMarker( marker );
1675 }
1676 
1677 void a2dCanvasXYDisplayGroupAreas::SetCursor( a2dCursor* cursor )
1678 {
1679  a2dCursor* oldcursor = m_cursor;
1680  m_cursor = NULL;
1681  if( oldcursor )
1683  m_cursor = cursor;
1684 
1685  if( m_cursor )
1686  m_axesarealist->SetCursor( m_cursor );
1687 
1688  SetPending( true );
1689 }
1690 
1691 void a2dCanvasXYDisplayGroupAreas::ChangeCursorPos( double step )
1692 {
1693  if( !m_cursor )
1694  return;
1696  double newposx, tempposy;
1697  a2dAffineMatrix mat = baseArea->GetCurveAreaTransform();
1698  a2dBoundingBox ibox = baseArea->GetInternalBoundaries();
1699  mat.Invert();
1700  mat.TransformPoint( m_cursor->GetPosX(), ibox.GetMinY(), newposx, tempposy );
1701 
1702  double currentPosition = newposx;
1703  double smallStep = step / ( fabs( step ) );
1704  newposx += step;
1705  if( newposx < ibox.GetMinX() )
1706  {
1707  newposx = ibox.GetMinX();
1708  smallStep = 1;
1709  }
1710  if( newposx > ibox.GetMaxX() )
1711  {
1712  newposx = ibox.GetMaxX();
1713  smallStep = -1;
1714  }
1715  if( m_cursorOnlyByCurves )
1716  {
1717  bool currentPositionOK = m_cursor->CheckPosition( currentPosition );
1718  double newposition = newposx;
1719  while( !m_cursor->CheckPosition( newposx ) )
1720  {
1721  newposx += smallStep;
1722  if( newposx < ibox.GetMinX() || newposx > ibox.GetMaxX() )
1723  {
1724  newposx = newposition;
1725  while( !m_cursor->CheckPosition( newposx ) )
1726  {
1727  newposx -= smallStep;
1728  if( newposx < ibox.GetMinX() || newposx > ibox.GetMaxX() )
1729  {
1730  if( currentPositionOK )
1731  return;
1732  newposx = newposition;
1733  m_cursor->SetPosition( newposx, tempposy, baseArea->GetCurveAreaTransform() );
1734  return;
1735  }
1736  }
1737  }
1738  }
1739  }
1740  m_cursor->SetPosition( newposx, tempposy, baseArea->GetCurveAreaTransform() );
1741 }
1742 
1743 a2dCurve* a2dCanvasXYDisplayGroupAreas::GetCurveFromArea( const wxString& curveAreaName, const wxString curvename )
1744 {
1745  a2dCurvesArea* curvesarea = m_axesarealist->GetCurvesArea( curveAreaName );
1746  wxASSERT_MSG( curvesarea != NULL, wxString::Format( wxT( "not found curve by name '%s' " ), curveAreaName.c_str() ) );
1747  if( curvesarea )
1748  return curvesarea->GetCurve( curvename );
1749  return NULL;
1750 }
1751 
1753 {
1754  a2dCurvesArea* curvesarea = m_axesarealist->GetCurvesArea( curveAreaName );
1755  wxASSERT_MSG( curvesarea != NULL, wxString::Format( wxT( "not found curves area by name '%s' " ), curveAreaName.c_str() ) );
1756  if( curvesarea )
1757  return curvesarea->GetCurves();
1758  return NULL;
1759 }
1760 
1762 {
1763  a2dCurvesArea* curvesarea = m_axesarealist->GetCurvesArea( curveAreaName );
1764  wxASSERT_MSG( curvesarea != NULL, wxString::Format( wxT( "not found curves area by name '%s' " ), curveAreaName.c_str() ) );
1765  if( curvesarea )
1766  {
1767  return curvesarea->GetCurvesBoundaries();
1768  }
1769  a2dBoundingBox ibbox;
1770  return ibbox;
1771 }
1772 
1773 a2dCurveAxis* a2dCanvasXYDisplayGroupAreas::GetAreaAxisY( const wxString& curveAreaName ) const
1774 {
1775  a2dCurvesArea* curvesarea = m_axesarealist->GetCurvesArea( curveAreaName );
1776  wxASSERT_MSG( curvesarea != NULL, wxString::Format( wxT( "not found curves area by name '%s' " ), curveAreaName.c_str() ) );
1777  return curvesarea->GetAxisY();
1778 }
1779 
1780 void a2dCanvasXYDisplayGroupAreas::SetAreaAxisY( const wxString& curveAreaName, a2dCurveAxis* axisY )
1781 {
1782  a2dCurvesArea* curvesarea = m_axesarealist->GetCurvesArea( curveAreaName );
1783  wxASSERT_MSG( curvesarea != NULL, wxString::Format( wxT( "not found curves area by name '%s' " ), curveAreaName.c_str() ) );
1784  curvesarea->SetAxisY( axisY );
1785  SetPending( true );
1786 }
1787 
1788 void a2dCanvasXYDisplayGroupAreas::SetShowLeftYaxis( const wxString& curveAreaName, bool showyaxis )
1789 {
1790  m_axesarealist->SetShowLeftYaxis( curveAreaName, showyaxis );
1791  SetPending( true );
1792 }
1793 
1794 void a2dCanvasXYDisplayGroupAreas::SetShowRightYaxis( const wxString& curveAreaName, bool showyaxis )
1795 {
1796  m_axesarealist->SetShowRightYaxis( curveAreaName, showyaxis );
1797  SetPending( true );
1798 }
1799 
1801 {
1802  m_strokegrid = stroke;
1803  SetPending( true );
1804 }
1805 
1807 {
1808  m_fillAxisArea = fill;
1809  SetPending( true );
1810 }
1811 
1813 {
1814  m_strokeAxisArea = stroke;
1815  SetPending( true );
1816 }
1817 
1819 {
1820  SetPending( true );
1821  m_plotrect = extbox;
1822 
1823  m_axesarealist->SetBoundaries( extbox );
1824 }
1825 
1826 void a2dCanvasXYDisplayGroupAreas::SetInternalBoundaries( double ximin, double yimin, double ximax, double yimax, const wxString& curveAreaName )
1827 {
1828  a2dCurvesArea* curvesarea = AddCurvesArea( curveAreaName );
1829  wxASSERT_MSG( curvesarea != NULL, wxString::Format( wxT( "not found curve area by name '%s' " ), curveAreaName.c_str() ) );
1830  if( curvesarea )
1831  {
1832  curvesarea->SetInternalBoundaries( m_plotrect, ximin, yimin, ximax, yimax );
1833  }
1834  SetPending( true );
1835 }
1836 
1838 {
1839  for( size_t i = 0; i < m_axesarealist->GetCount(); i++ )
1840  {
1841  a2dCurvesArea* area = m_axesarealist->Item( i );
1842  a2dBoundingBox newRect = area->GetInternalBoundaries();
1843  newRect.SetMinX( ximin );
1844  newRect.SetMaxX( ximax );
1845  area->SetInternalBoundaries( m_plotrect, newRect );
1846  }
1847 }
1848 
1850 {
1851  a2dCurvesArea* curvesarea = m_axesarealist->GetCurvesArea( curveAreaName );
1852  wxASSERT_MSG( curvesarea != NULL, wxString::Format( wxT( "not found curves area by name '%s' " ), curveAreaName.c_str() ) );
1853  if( curvesarea )
1854  {
1855  return curvesarea->GetInternalBoundaries();
1856  }
1857  a2dBoundingBox ibbox;
1858  return ibbox;
1859 }
1860 
1862 {
1863  return m_axesarealist->AppendInternalBoundaries( irectHash );
1864 }
1865 
1867 {
1868  return m_axesarealist->AppendCurvesBoundaries( irectHash );
1869 }
1870 
1871 a2dAffineMatrix a2dCanvasXYDisplayGroupAreas::GetCurvesAreaTransform( const wxString& curveAreaName )
1872 {
1873  a2dCurvesArea* curvesarea = m_axesarealist->GetCurvesArea( curveAreaName );
1874  wxASSERT_MSG( curvesarea != NULL, wxString::Format( wxT( "not found curves area by name '%s' " ), curveAreaName.c_str() ) );
1875  if( curvesarea )
1876  {
1877  return curvesarea->GetCurveAreaTransform();
1878  }
1879  a2dAffineMatrix amatrix;
1880  return amatrix;
1881 }
1882 
1884 {
1885  /*
1886  m_axesarealist->SetGroup(this);
1887  a2dCurvesArea* curvesarea = m_axesarealist->GetBaseCurvesArea();
1888  if(curvesarea)
1889  {
1890  a2dCanvasObjectList::iterator iter = m_axisX->GetChildObjectList()->begin();
1891  while( iter != m_axisX->GetChildObjectList()->end() )
1892  {
1893  a2dCurveObject* item = wxDynamicCast( (*iter).Get(), a2dCurveObject );
1894  if ( item )
1895  item->SetCurvesArea( curvesarea );
1896  ++iter;
1897  }
1898  }
1899  */
1900  if ( m_flags.m_HighLight )
1901  {
1902  bool pendingchild = false;
1903  pendingchild = pendingchild || m_axesarealist->GetPending();
1904  pendingchild = pendingchild || m_axisX->GetPending();
1905  if( m_cursor )
1906  pendingchild = pendingchild || m_cursor->GetPending();
1907 
1908  if ( !m_flags.m_pending )
1909  SetPending( pendingchild );
1910  }
1912 }
1913 
1915 {
1917  m_axesarealist->UpdateViewDependentObjects( ic );
1919  if( m_cursor )
1921 }
1922 
1924 {
1925  return m_plotrect;
1926 }
1927 
1929 {
1931 
1932  bbox.Expand( m_axisX->GetBbox() );
1933  m_axesarealist->Expand( bbox );
1934 // if(m_cursor)
1935 // bbox.Expand( m_cursor->GetBbox());
1936 
1937  return bbox;
1938 }
1939 
1940 bool a2dCanvasXYDisplayGroupAreas::DoUpdate( UpdateMode mode, const a2dBoundingBox& childbox, const a2dBoundingBox& clipbox, const a2dBoundingBox& propbox )
1941 {
1942  bool calc = false;
1943 
1944  calc = m_axesarealist->Update( mode );
1945  calc = m_axisX->Update( mode ) || calc;
1946  if( m_cursor )
1947  calc = m_cursor->Update( mode ) || calc;
1948 
1949  //current state of those flags are known after m_axesarea->Update() etc are called.
1951  || m_axesarealist->GetHasToolObjectsBelow()
1953  //|| m_axisY->GetHasToolObjectsBelow();
1954 
1958  //|| m_axisY->GetHasSelectedObjectsBelow();
1959 
1960  if ( !m_bbox.GetValid() || calc )
1961  {
1963  {
1965  bbox.Enlarge( bbox.GetWidth() / 10 );
1966  m_axesarealist->SetClippingFromBox( bbox );
1967  }
1968  else
1969  {
1971  m_axesarealist->SetClippingFromBox( bbox );
1972  }
1973 
1974  //where is the origin in plot coordinates
1975  double zerox, zeroy;
1976  double ixmin, ixmax;
1977  m_axesarealist->SetAxes( m_plotrect, 0, m_axisX->GetPosition(), zerox, zeroy, ixmin, ixmax );
1978 
1979  if ( zerox < m_plotrect.GetMinX() )
1980  zerox = m_plotrect.GetMinX();
1981  else if ( zerox > m_plotrect.GetMaxX() )
1982  zerox = m_plotrect.GetMaxX();
1983 
1984  if ( zeroy < m_plotrect.GetMinY() )
1985  zeroy = m_plotrect.GetMinY();
1986  else if ( zeroy > m_plotrect.GetMaxY() )
1987  zeroy = m_plotrect.GetMaxY();
1988 
1989  if( m_cursor )
1990  {
1992  a2dBoundingBox ibox = baseArea->GetInternalBoundaries();
1993  a2dAffineMatrix mat = baseArea->GetCurveAreaTransform();
1994  m_cursor->SetHSize( m_plotrect.GetHeight() );
1995  m_cursor->SetWSize( m_plotrect.GetWidth() );
1996 //klion200602 m_cursor->UpdatePosition(m_plotrect.GetMinX(),zeroy, mat);
1997  m_cursor->UpdatePosition( m_plotrect.GetMinX(), m_plotrect.GetMinY(), mat );
1999  }
2000 
2001  m_axisX->SetPosXY( m_plotrect.GetMinX(), zeroy );
2003  m_axisX->SetBoundaries( ixmin, ixmax );
2004 
2006  m_bbox.MapBbox( m_lworld );
2007 
2008  return true;
2009  }
2010 
2011  return false;
2012 }
2013 
2015 {
2016  //the text objects like all children are rendered after this
2018  ic.GetDrawer2D()->DrawRoundedRectangle( bbox.GetMinX(), bbox.GetMinY(), bbox.GetWidth(), bbox.GetHeight() , 0 );
2019 
2020  //rectangle for the background of the axisarea
2021  //The fill and outline set for this object will be used for it.
2022  ic.GetDrawer2D()->SetDrawerFill( m_fillAxisArea );
2023  ic.GetDrawer2D()->SetDrawerStroke( m_strokeAxisArea );
2025 
2026  if ( m_showgrid )
2027  DrawGrid( ic );
2028 
2029  if( m_cursor )
2030  m_cursor->Render( ic, clipparent );
2031 
2032  if ( m_showxaxis )
2033  m_axisX->Render( ic, clipparent );
2034  m_axesarealist->RenderAxesY( ic, clipparent );
2035  //curves are rendered last
2036  m_axesarealist->Render( ic, clipparent );
2037 }
2038 
2039 void a2dCanvasXYDisplayGroupAreas::DrawGrid( a2dIterC& ic )
2040 {
2041  double ticx = m_axisX->GetTic();
2042  double ticy = m_axesarealist->GetTicY();
2043 
2044  double x;
2045  double y;
2046 
2047  double ticstartx;
2048  double ticstarty;
2049 
2051  a2dBoundingBox intrect = baseArea->GetInternalBoundaries();
2052 
2054  ic.GetDrawer2D()->SetDrawerStroke( m_strokegrid );
2055 
2057 
2058  ticstartx = floor( intrect.GetMinX() / ticx + 0.5 ) * ticx;
2059  if ( ( ticx > 0. && ticstartx <= intrect.GetMinX() ) || ( ticx < 0. && ticstartx >= intrect.GetMinX() ) )
2060  ticstartx += ticx;
2061  ticstarty = floor( intrect.GetMinY() / ticy + 0.5 ) * ticy;
2062  if ( ( ticy > 0. && ticstarty <= intrect.GetMinY() ) || ( ticy < 0. && ticstarty >= intrect.GetMinY() ) )
2063  ticstarty += ticy;
2064 
2065  //draw gridlines
2066  for ( x = ticstartx; ( ticx > 0. && x < intrect.GetMaxX() ) || ( ticx < 0. && x > intrect.GetMaxX() ) ; x = x + ticx )
2067  {
2068  double xw, yw;
2069  //where is the x in world coordinates
2070  mat.TransformPoint( x, 0, xw, yw );
2071  ic.GetDrawer2D()->DrawLine( xw, m_plotrect.GetMinY(), xw, m_plotrect.GetMaxY() );
2072  }
2073 
2074  for ( y = ticstarty; ( ticy > 0. && y < intrect.GetMaxY() ) || ( ticy < 0. && y > intrect.GetMaxY() ) ; y = y + ticy )
2075  {
2076  double xw, yw;
2077  //where is the y in world coordinates
2078  mat.TransformPoint( 0, y, xw, yw );
2079  ic.GetDrawer2D()->DrawLine( m_plotrect.GetMinX(), yw, m_plotrect.GetMaxX(), yw );
2080  }
2081 }
2082 
2084 {
2085  hitEvent.m_how = a2dHit::stock_fill;
2086  return true;
2087 }
2088 
2090 {
2091  return m_axesarealist->m_leftAxisY != ( a2dCurvesArea* )NULL
2092  ? m_axesarealist->m_leftAxisY->GetAxisText() : wxT( "" );
2093 }
2094 
2096 {
2097  return m_axesarealist->m_rightAxisY != ( a2dCurvesArea* )NULL
2098  ? m_axesarealist->m_rightAxisY->GetAxisText() : wxT( "" );
2099 }
2100 
2101 void a2dCanvasXYDisplayGroupAreas::SetAxisText( const wxString& curveAreaName, const wxString& text, const wxColour& color )
2102 {
2103  a2dCurvesArea* curvesarea = m_axesarealist->GetCurvesArea( curveAreaName );
2104  wxASSERT_MSG( curvesarea != NULL, wxString::Format( wxT( "not found curve by name '%s' " ), curveAreaName.c_str() ) );
2105  curvesarea->SetAxisText( text );
2106  curvesarea->SetColor( color );
2107 }
2108 
2109 void a2dCanvasXYDisplayGroupAreas::ClearCurvesAreas()
2110 {
2113  if( m_cursor )
2114  m_cursor->RemoveMarkers();
2115  m_axesarealist->Empty();
2116 }
2117 
2118 void a2dCanvasXYDisplayGroupAreas::SetAreaMarkerShow( const wxString& curveAreaName, a2dMarkerShow* showm )
2119 {
2120  a2dCurvesArea* curvesarea = m_axesarealist->GetCurvesArea( curveAreaName );
2121  wxASSERT_MSG( curvesarea != NULL, wxString::Format( wxT( "not found curves area by name '%s' " ), curveAreaName.c_str() ) );
2122  curvesarea->SetMarkerShow( showm );
2123  SetPending( true );
2124 }
2125 
2126 void a2dCanvasXYDisplayGroupAreas::SetAreaMarkerShow2( const wxString& curveAreaName, a2dMarkerShow* showm )
2127 {
2128  a2dCurvesArea* curvesarea = m_axesarealist->GetCurvesArea( curveAreaName );
2129  wxASSERT_MSG( curvesarea != NULL, wxString::Format( wxT( "not found curves area by name '%s' " ), curveAreaName.c_str() ) );
2130  curvesarea->SetMarkerShow2( showm );
2131  SetPending( true );
2132 }
2133 
2134 a2dMarkerShow* a2dCanvasXYDisplayGroupAreas::GetAreaMarkerShow( const wxString& curveAreaName ) const
2135 {
2136  a2dCurvesArea* curvesarea = m_axesarealist->GetCurvesArea( curveAreaName );
2137  wxASSERT_MSG( curvesarea != NULL, wxString::Format( wxT( "not found curves area by name '%s' " ), curveAreaName.c_str() ) );
2138  return curvesarea->GetMarkerShow();
2139 }
2140 
2141 a2dMarkerShow* a2dCanvasXYDisplayGroupAreas::GetAreaMarkerShow2( const wxString& curveAreaName ) const
2142 {
2143  a2dCurvesArea* curvesarea = m_axesarealist->GetCurvesArea( curveAreaName );
2144  wxASSERT_MSG( curvesarea != NULL, wxString::Format( wxT( "not found curves area by name '%s' " ), curveAreaName.c_str() ) );
2145  return curvesarea->GetMarkerShow2();
2146 }
2147 
2148 void a2dCanvasXYDisplayGroupAreas::SetTicY( int numLines )
2149 {
2150  m_axesarealist->SetTicY( numLines );
2151 }
2152 
2153 int a2dCanvasXYDisplayGroupAreas::SetAxisTicPrecision( a2dCurveAxis* axisY, double newMinY, double newMaxY )
2154 {
2155  if( m_autoTicYPrecision )
2156  {
2157  double aTic = axisY->GetTic();
2158  double abs_tic = fabs( aTic );
2159  int precision = 1;
2160  double maxVal = wxMax( fabs( newMinY ), fabs( newMaxY ) );
2161  if( maxVal > 999999. )
2162  {
2163  axisY->SetTicFormat( wxT( "%.6e" ) );
2164  precision = 5;
2165  }
2166  else if( abs_tic <= 1E-6 )
2167  {
2168  axisY->SetTicFormat( wxT( "%.6e" ) );
2169  if( precision != 5 )
2170  precision = 4;
2171  }
2172  else if( abs_tic <= 1E-4 )
2173  {
2174  axisY->SetTicFormat( wxT( "%.4e" ) );
2175  if( precision != 4 && precision != 5 )
2176  precision = 3;
2177  }
2178  else if( abs_tic <= 0.026 )
2179  {
2180  axisY->SetTicFormat( wxT( "%.3f" ) );
2181  if( precision != 1 )
2182  precision = 2;
2183  }
2184  else if( abs_tic >= 1. )
2185  {
2186  if( int( abs_tic ) * 10 == int( abs_tic * 10. ) )
2187  axisY->SetTicFormat( wxT( "%.0f" ) );
2188  else if( int( abs_tic * 10 ) * 10 == int( abs_tic * 100. ) )
2189  axisY->SetTicFormat( wxT( "%.1f" ) );
2190  else
2191  axisY->SetTicFormat( wxT( "%.2f" ) );
2192  }
2193  else
2194  axisY->SetTicFormat( wxT( "%.2f" ) );
2195  return precision;
2196  }
2197  return 0;
2198 }
2199 
2200 void a2dCanvasXYDisplayGroupAreas::SetCommonTicPrecision( int precision )
2201 {
2202  if( m_autoTicYPrecision )
2203  {
2204  wxString commonTicFormat;
2205  switch( precision )
2206  {
2207  default:
2208  case 1: commonTicFormat = wxT( "%f2.2" ); break;
2209  case 2: commonTicFormat = wxT( "%f2.3" ); break;
2210  case 3: commonTicFormat = wxT( "%f4.2" ); break;
2211  case 4: case 5: commonTicFormat = wxT( "%g" ); break;
2212  }
2213  for( size_t i = 0; i < m_axesarealist->GetCount(); i++ )
2214  {
2215  a2dCurvesArea* area = m_axesarealist->Item( i );
2216  area->GetAxisY()->SetCommonTicFormat( commonTicFormat );
2217  }
2218  }
2219 }
2220 
2221 #if wxART2D_USE_CVGIO
2222 void a2dCanvasXYDisplayGroupAreas::DoSave( wxObject* parent, a2dIOHandlerXmlSerOut& out, a2dXmlSer_flag xmlparts , a2dObjectList* towrite )
2223 {
2224  a2dCanvasObject::DoSave( parent, out, xmlparts, towrite );
2225  if ( xmlparts == a2dXmlSer_attrib )
2226  {
2227  out.WriteAttribute( wxT( "cursorOnlyByCurves" ) , m_cursorOnlyByCurves );
2228  out.WriteAttribute( wxT( "showgrid" ) , m_showgrid );
2229  out.WriteAttribute( wxT( "showxaxis" ) , m_showxaxis );
2230  out.WriteAttribute( wxT( "autoTicYPrecision" ) , m_autoTicYPrecision );
2231  out.WriteNewLine();
2232 
2233  out.WriteAttribute( _T( "xmin" ) , m_plotrect.GetMinX() );
2234  out.WriteAttribute( wxT( "ymin" ) , m_plotrect.GetMinY() );
2235  out.WriteAttribute( _T( "xmax" ) , m_plotrect.GetMaxX() );
2236  out.WriteAttribute( wxT( "ymax" ) , m_plotrect.GetMaxY() );
2237  out.WriteNewLine();
2238  }
2239  else
2240  {
2241  out.WriteStartElement( wxT( "derived" ) );
2242 
2243  m_strokegrid.Save( this, out, towrite );
2244  m_fillAxisArea.Save( this, out, towrite );
2245  m_strokeAxisArea.Save( this, out, towrite );
2246 
2247  m_axesarealist->Save( this, out, towrite );
2248 
2249  m_axisX->Save( this, out, towrite );
2250 // m_axisY->Save( this, out, towrite);
2251 
2252  if( m_cursor )
2253  m_cursor->Save( this, out, towrite );
2254 
2255  out.WriteEndElement();
2256  }
2257 }
2258 
2259 void a2dCanvasXYDisplayGroupAreas::DoLoad( wxObject* parent, a2dIOHandlerXmlSerIn& parser, a2dXmlSer_flag xmlparts )
2260 {
2261  a2dCanvasObject::DoLoad( parent, parser, xmlparts );
2262  if ( xmlparts == a2dXmlSer_attrib )
2263  {
2264  m_cursorOnlyByCurves = parser.RequireAttributeValueBool( wxT( "cursorOnlyByCurves" ) );
2265  m_showgrid = parser.RequireAttributeValueBool( wxT( "showgrid" ) );
2266  m_showxaxis = parser.RequireAttributeValueBool( wxT( "showxaxis" ) );
2267  m_autoTicYPrecision = parser.RequireAttributeValueBool( wxT( "autoTicYPrecision" ) );
2268 
2269  m_plotrect.SetMin( parser.RequireAttributeValueDouble( wxT( "xmin" ) ),
2270  parser.RequireAttributeValueDouble( wxT( "ymin" ) ) );
2271  m_plotrect.SetMax( parser.RequireAttributeValueDouble( wxT( "xmax" ) ),
2272  parser.RequireAttributeValueDouble( wxT( "ymax" ) ) );
2273  }
2274  else
2275  {
2276  parser.Require( START_TAG, wxT( "derived" ) );
2277  parser.Next();
2278 
2279  // new strokes, since the current ones might be shared by other objects too.
2280  m_strokegrid = m_strokegrid;
2281  m_fillAxisArea = m_fillAxisArea;
2282  m_strokeAxisArea = m_strokeAxisArea;
2283 
2284  m_strokegrid.Load( parent, parser );
2285  parser.ResolveOrAdd( ( a2dSmrtPtr<class a2dObject>* ) &m_strokegrid );
2286  m_fillAxisArea.Load( parent, parser );
2287  parser.ResolveOrAdd( ( a2dSmrtPtr<class a2dObject>* ) &m_fillAxisArea );
2288  m_strokeAxisArea.Load( parent, parser );
2289  parser.ResolveOrAdd( ( a2dSmrtPtr<class a2dObject>* ) &m_strokeAxisArea );
2290 
2291  m_axesarealist->Load( parent, parser );
2293 
2294  m_axisX->Load( parent, parser );
2296 
2297  if ( parser.HasAttribute( wxT( "cursor" ) ) )
2298  {
2299  parser.ResolveOrAdd( ( a2dSmrtPtr<class a2dObject>* ) &m_cursor, parser.GetAttributeValue( wxT( "cursor" ) ) );
2300  }
2301 
2302  parser.Require( END_TAG, wxT( "derived" ) );
2303  parser.Next();
2304  }
2305 }
2306 
2308  : a2dCanvasXYDisplayGroupAreas( x, y )
2309 {
2310 #if defined(_DEBUG) && defined (SMART_POINTER_DEBUG)
2311  //klion: it is because the CurrentSmartPointerOwner can change in other.m_axesarea->Clone()
2312  CurrentSmartPointerOwner = this;
2313 #endif
2314 }
2315 
2317 {
2318 }
2319 
2320 a2dCanvasXYDisplayGroup::a2dCanvasXYDisplayGroup( const a2dCanvasXYDisplayGroup& other, CloneOptions options, a2dRefMap* refs )
2321  : a2dCanvasXYDisplayGroupAreas( other, options, refs )
2322 {
2323 
2324 #if defined(_DEBUG) && defined (SMART_POINTER_DEBUG)
2325  //klion: it is because the CurrentSmartPointerOwner can change in other.m_axesarea->Clone()
2326  CurrentSmartPointerOwner = this;
2327 #endif
2328 }
2329 
2331 {
2332  return new a2dCanvasXYDisplayGroup( *this, options, refs );
2333 }
2334 
2335 
2336 #endif //wxART2D_USE_CVGIO
2337 
a2dHit m_how
return in which way the object was hit (stroke, fill, ...)
Definition: canobj.h:301
bool m_processed
set if event was processed sofar
Definition: canobj.h:311
void SetClippingFromBox(a2dBoundingBox &bbox=wxNonValidBbox)
set the clipping polygon according to the given box
Definition: polygon.cpp:3233
wxString GetLeftAxisText() const
if left axis a2dCurveArea is set, the label text will be set to this
cursor on curve plot as a vertical line with markers
Definition: marker.h:512
virtual bool ProcessCanvasObjectEvent(a2dIterC &ic, a2dHitEvent &hitEvent)
Hit objects will receive the event.
Definition: canobj.cpp:3964
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 GetPosition() const
get position of axis ( zero is default )
Definition: axis.h:172
void SetAxisAreaFill(const a2dFill &fill)
Set a fill for axis area.
virtual void Render(a2dIterC &ic, OVERLAP clipparent)
Render this object to the active a2dDrawingPart.
Definition: canobj.cpp:4712
(In) Visible property that can be added to Docview Objects.
Definition: gen.h:1785
#define wxDynamicCast(obj, className)
Define wxDynamicCast so that it will give a compiler error for unrelated types.
Definition: gen.h:75
Base class for all types of strokes, understood by a2dDrawer2D classes.
Definition: stylebase.h:378
void SetRoot(a2dDrawing *root, bool recurse=true)
Sets this object to a a2dCanvasDocument.
Definition: canobj.cpp:5933
void AddMarker(a2dMarker *marker)
add a marker
Definition: curvegroup.cpp:208
classes for plotting curve and pie data, and editing them.
void SetShowRightYaxis(const wxString &curveAreaName, bool showyaxis)
the a2dCurveArea with the given name is set as holding the rigth Yaxis
Definition: curvegroup.cpp:863
bool HasAttribute(const wxString &attrib)
Does the current tag have this attribute?
Definition: genxmlpars.cpp:560
bool PushTool(a2dBaseTool *tool)
specialize to keep first tool on the stack active
Definition: sttool.cpp:451
void AddPending(a2dIterC &ic)
search objects ( if nested recursive ) that have the pending flag Set
Definition: canobj.cpp:4521
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 SetMaxY(double maxy)
set the bounding box its maximum Y, does not validate the box
Definition: bbox.h:175
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
void SetRelease(bool value)
set release flag
Definition: gen.h:1346
a2dCanvasObjectList * GetCurvesFromArea(const wxString &curveAreaName)
returns the list where the curves are stored in.
XMLeventType Next()
Walks to next element and returns event type.
Definition: genxmlpars.cpp:422
bool RequireAttributeValueBool(const wxString &attrib)
Forces an attribute and returns its boolean value.
Definition: genxmlpars.cpp:551
For Markers on a Curve.
Definition: marker.h:248
void SetCommonTicFormat(const wxString &format)
Set how common tic text is formated/displayed for all (Y-axes).
Definition: axis.h:203
bool ResolveOrAdd(a2dSmrtPtr< a2dObject > *storedHere, const wxString &id=wxT(""))
try to resolve the object that is in storedHere when it is a reference.
Definition: gen.cpp:4760
class to map references to objects stored in XML, in order to make the connection later on...
Definition: gen.h:3462
void SetCurvesArea(a2dCurvesArea *curvesArea)
used for conversion of curve data to curvegroup area
Definition: curve.h:59
void DoAddPending(a2dIterC &ic)
called by addPending
double a2dInternal_BoundsRound(double val, bool tics)
Definition: curvegroup.cpp:899
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
const a2dAffineMatrix & GetInverseTransform() const
Inverse of GetTransform()
Definition: canobj.cpp:699
a2dSmrtPtr< a2dCurvesArea > m_leftAxisY
the curve area to display the left Y axis
Definition: curvegroup.h:361
bool GetHasSelectedObjectsBelow()
selected object itself or one of its recursive children
a2dMarker * GetCursorMarker() const
search a marker ( placed to show a position on a curve )
Definition: curvegroup.cpp:442
virtual void DoWalker(wxObject *parent, a2dWalkerIOHandler &handler)
iterate over this object and its children
Definition: gen.cpp:1488
Ref Counted base object.
Definition: gen.h:1045
bool GetPending() const
is this object pending for update?
Definition: canobj.h:1162
void SetAxisY(a2dCurveAxis *axisY)
set Y axis of this curve area
Definition: curvegroup.h:173
void SetAxisText(const wxString &curveAreaName, const wxString &text, const wxColour &color)
set axis text for given curve area
a2dDrawing * GetRoot() const
get a2dCanvasDocument of the object.
Definition: canobj.h:952
void Enlarge(const double Marge)
enlarge with the given amount
Definition: bbox.cpp:162
proptype * GetPropertyListOnly(const a2dObject *obj) const
Get the property from the list in obj ( no members, not cloned )
Definition: id.inl:318
a2dSmrtPtr< a2dCurvesArea > GetBaseCurvesArea() const
the a2dCurveArea which has bin set to be the m_leftAxisY
Definition: curvegroup.h:317
a2dCanvasObject * GetCaptured() const
are events redirected to a captured corridor? if so return the captured object in it...
Definition: drawer.h:641
a2dObject * Clone(CloneOptions options, a2dRefMap *refs=NULL) const
create an exact copy of this property
Definition: gen.cpp:1199
bool m_pending
set when a2dCanvasObject needs an update (redraw).
Definition: candefs.h:277
a2dSmrtPtr< a2dCurveAxis > m_axisY
y axis object
Definition: curvegroup.h:231
void SetMaxX(double maxx)
set the bounding box its maximum X, does not validate the box
Definition: bbox.h:173
virtual bool Update(UpdateMode mode)
Update the state of the object according to its current position etc.
Definition: canobj.cpp:5149
virtual void DependencyPending(a2dWalkerIOHandler *handler)
called by to check if this object becomes pending as a result of other objects
Definition: canobj.cpp:4680
void DoWalker(wxObject *parent, a2dWalkerIOHandler &handler)
iterate over this object and its children
Definition: curvegroup.cpp:265
void SetDrawerStroke(const a2dStroke &stroke)
Used to set the current stroke.
Definition: drawer2d.cpp:565
Input and output handler for the XmlSer format.
Definition: genxmlpars.h:819
UpdateMode
Various mode flags for Update.
Definition: canobj.h:1091
a2dBoundingBox GetCurveBoundaries()
get boundary box of plot boundary in curve coordinates
Definition: curve.cpp:542
void World2Curve(double xw, double yw, double &xcurve, double &ycurve)
used by a2dCurve to transform its own curve coordinates to the curve plotting area ...
Definition: curvegroup.cpp:164
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
double GetTic() const
get distance of tic lines in X/Y (curve coords)
Definition: axis.h:181
void DoWalker(wxObject *parent, a2dWalkerIOHandler &handler)
iterate over this object and its children
Definition: curvegroup.cpp:620
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
Clone this object and return a pointer to the new object.
void DependencyPending(a2dWalkerIOHandler *handler)
called by to check if this object becomes pending as a result of other objects
void SetInternalBoundaries(double ximin, double yimin, double ximax, double yimax, const wxString &curveAreaName=wxEmptyString)
set the minimum and maximum values to be displayed in the axisarea
The base class for all drawable objects in a a2dCanvasDocument.
For Showing Marker position of Markers on a Curve.
Definition: marker.h:408
const a2dCanvasObjectList * GetCurves() const
returns the list where the curves are stored in.
Definition: curvegroup.h:147
void InsertCurve(size_t before, a2dCurve *curve, const wxString curvename=_T(""))
add a curve to the end of the existing curves.
Definition: curvegroup.cpp:219
wxUint16 m_layer
layer of object, default wxLAYER_DEFAULT
Definition: canobj.h:2556
base class for axis in a2dCanvasXYDisplayGroup
Definition: axis.h:102
virtual void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
Definition: canobj.cpp:5728
a2dCanvasObject is the base class for Canvas Objects.
Definition: canobj.h:371
wxString GetAxisText() const
get text to display for axis label
Definition: curvegroup.cpp:149
void AddCurve(a2dCurve *curve, const wxString curvename=_T(""))
add a curve to the end of the exisiting curves.
Definition: curvegroup.cpp:200
no special flags set
Definition: id.h:161
void SetTic(double d)
distance of tic lines in X/Y (curve coords)
Definition: axis.h:178
virtual ~a2dCanvasXYDisplayGroup()
destructor
A2DGENERALDLLEXP a2dWalkEvent a2dWalker_a2dDerivedCanvasObjectStart
id for a2dWalkEvent issued from within a2dWalkerIOHandler
Interactive drawing of a Rectangle.
Definition: sttool.h:807
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.
void TransformPoint(double x, double y, double &tx, double &ty) const
Transform a point.
Definition: afmatrix.cpp:559
virtual void EndEdit()
cleanup an editcopy object
Definition: canobj.cpp:1828
a2dSmrtPtr< a2dCurvesAreaList > m_axesarealist
internal object used to display the curves in internal coordinates
Definition: curvegroup.h:672
simple curve group with just one a2dCurvesArea in use
Definition: curvegroup.h:697
virtual void SetName(const wxString &name)
Creates the a2dStringProperty PROPID_Name.
Definition: gen.cpp:1305
void WriteEndElement(bool newLine=true)
Writes correspondending end tag for the current start tag.
Definition: genxmlpars.cpp:862
bool ProcessCanvasObjectEvent(a2dIterC &ic, a2dHitEvent &hitEvent)
Hit objects will receive the event.
void Curve2World(double xcurve, double ycurve, double &xw, double &yw)
used by a2dCurve to transform its own curve coordinates to the curve plotting area ...
Definition: curvegroup.cpp:171
void AddCurveToArea(const wxString &curveAreaName, a2dCurve *curve, const wxString curvename=_T(""))
add a curve to the end of the existing curves in a given a2dCurveArea
void RenderAxesY(a2dIterC &ic, OVERLAP clipparent)
render all Yaxis objects ( of Left and Right a2dCurveArea )
Definition: curvegroup.cpp:815
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
float m_worldExtend
world extend in world coordinates.
Definition: canobj.h:2545
a2dAffineMatrix m_lworld
used for positioning the object (x,y,ang,scale etc.)
Definition: canobj.h:2559
void SetBoundaries(const a2dBoundingBox &extbox)
sets for all curve areas in the list the same boundaries
Definition: curvegroup.cpp:601
void SetDrawerFill(const a2dFill &fill)
Used to set the current fill.
Definition: drawer2d.cpp:621
a2dBoundingBox GetInternalBoundaries(const wxString &curveAreaName=wxEmptyString) const
return curve coordinate boundaries of a given curve area
Io handler to iterate through a a2dDocument.
Definition: gen.h:3911
void WriteNewLine()
Writes a new line and takes care of indentation.
Definition: genxmlpars.cpp:890
void RemoveMarkerFromArea(const wxString &curveAreaName, a2dMarker *marker)
remove a marker
list for a2dCurvesArea objects
Definition: curvegroup.h:264
double ExtendDeviceToWorld(int extend)
Transform a pixel extend from device to world units.
Definition: canobj.cpp:611
bool ProcessCanvasObjectEvent(a2dIterC &ic, a2dHitEvent &hitEvent)
Hit objects will receive the event.
Definition: curvegroup.cpp:258
bool m_isOnCorridorPath
This object is on the corridor path to a captured object or to a corridored object.
Definition: candefs.h:320
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
double GetMinX() const
get minimum X of the boundingbox
Definition: bbox.cpp:304
virtual void DrawRoundedRectangle(double x, double y, double width, double height, double radius, bool pixelsize=false)
Draw RoundedRectangle in world coordinates.
Definition: drawer2d.cpp:2048
int AppendInternalBoundaries(a2dBboxHash *irectHash)
fills a2dBboxHash with rectangles representing the plotting area of a curve
Definition: curvegroup.cpp:647
void AddMarkerToArea(const wxString &curveAreaName, a2dMarker *marker)
add a marker
#define forEachIn(listtype, list)
easy iteration for a2dlist
Definition: a2dlist.h:111
clips all children to a polygon
Definition: polygon.h:617
const a2dBoundingBox & GetPlotAreaRect() const
get the boundingbox in relative world coordinates of the plot area
Definition: curvegroup.h:533
virtual void DoUpdateViewDependentObjects(a2dIterC &ic)
update derived objects
Definition: canobj.cpp:4657
void DoAddPending(a2dIterC &ic)
called by addPending
Definition: curvegroup.cpp:288
The a2dStToolContr is a Tool Controller specialized for working with a2dCanvasView.
Definition: sttool.h:485
void SetPropertyToObject(a2dObject *obj, const basetype &value, SetFlags setflags=set_none) const
Set the property in obj to value.
Definition: id.inl:238
void Walker(wxObject *parent, a2dWalkerIOHandler &handler)
This is used to recursively walk through an object tree.
Definition: gen.cpp:1473
double GetPosX() const
get x position from affine matrix
Definition: canobj.h:527
const a2dAffineMatrix & GetCurveAreaTransform()
Definition: curvegroup.h:111
a2dCurveAxis * GetAxisY()
get Y axis of this curve area
Definition: curvegroup.h:170
a2dCurve * GetCurve(const wxString curvename)
return curve named curvename, if not available returns NULL
Definition: curvegroup.cpp:227
base class for axis in a2dCanvasXYDisplayGroup
Definition: axis.h:340
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
bool m_editable
object can be edited
Definition: candefs.h:295
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
Save settings.
Definition: gen.cpp:1657
#define EVT_CANVASOBJECT_MOUSE_EVENT(func)
static event table macro for a2dCanvasObject mouse event
Definition: canglob.h:312
int AppendInternalBoundaries(a2dBboxHash *irectHash)
fills a2dBboxHash with rectangles representing the plotting area of a curve
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
Definition: canobj.cpp:5569
void SetLength(double length)
set length in world coordinates ( not axis coordinates )
Definition: axis.cpp:278
bool m_isHit
in the end if there was a hit (even if not processed event)
Definition: canobj.h:315
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
wxString GetRightAxisText() const
if right a2dCurveArea is set, the label text will be set to this
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
int AppendCurvesBoundaries(a2dBboxHash *irectHash)
fills a2dBboxHash with rectangles representing the plotting area of a curve
virtual void DrawLine(double x1, double y1, double x2, double y2)
Draw line in world coordinates.
Definition: drawer2d.cpp:2167
void SetMinY(double miny)
set the bounding box its minimum Y, does not validate the box
Definition: bbox.h:171
Input and output handler for the XmlSer format.
Definition: genxmlpars.h:862
if set, respect layer order, hit testing is done per layer from the top.
Definition: canobj.h:82
void SetAreaAxisY(const wxString &curveAreaName, a2dCurveAxis *axisY)
set Y axis object for given curve area
void DoUpdateViewDependentObjects(a2dIterC &ic)
update derived objects
Definition: curvegroup.cpp:334
a2dCurve * GetCurveFromArea(const wxString &curveAreaName, const wxString curvename)
return curve named curvename, if not available returns NULL
void DoUpdateViewDependentObjects(a2dIterC &ic)
update derived objects
void SetAxes(const a2dBoundingBox &extbox, double x, double y, double &zerox, double &zeroy, double &ixmin, double &ixmax)
sets m_axisY values
Definition: curvegroup.cpp:399
bool Identity(void)
Make into identity matrix.
Definition: afmatrix.cpp:256
void UpdateInternalBoundaries(const a2dBoundingBox &extbox)
update conversion matrix to/from curve to world coordinates
Definition: curvegroup.cpp:182
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
clone it
Definition: curvegroup.cpp:144
a2dBoundingBox m_plotrect
placement in world coordinates
Definition: curvegroup.h:669
a2dCanvasObject * ChildIsHitWorld(a2dIterC &ic, a2dHitEvent &hitEvent, bool filterSelectableLayers=false)
Do hittest on children.
Definition: canobj.cpp:3289
virtual bool DoStartEdit(wxUint16 editmode, wxEditStyle editstyle)
only used for editable objects and under control of a editing tool.
Definition: canobj.cpp:1739
virtual a2dObject * DoClone(CloneOptions options, a2dRefMap *refs) const
Clone this object and return a pointer to the new object.
A 2x3 affine matrix class for 2D transformations.
Definition: afmatrix.h:53
wxMouseEvent & GetMouseEvent()
return the original mouse event that was redirected to the a2dCanvasObject
Definition: canglob.h:243
bool SetAxisText(const wxString &name)
set text to display for axis label
Definition: curvegroup.cpp:158
virtual void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
Save settings.
Definition: curvegroup.cpp:478
Base class for curves.
Definition: curve.h:107
void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
wxUint16 m_pixelExtend
Pixel extend.
Definition: canobj.h:2553
bool Update(UpdateMode mode)
Update the state of the object according to its current position etc.
Definition: curvegroup.cpp:341
double GetMaxX() const
get maximum X of the boundingbox
Definition: bbox.cpp:316
void Render(a2dIterC &ic, OVERLAP clipparent)
render by first setting clipping box and next start rendering children and itself.
Definition: polygon.cpp:3255
void SetGridStroke(const a2dStroke &stroke)
Set a stroke for grid.
if set, set in the clone the PROPID_editcopy property to the original object
Definition: gen.h:1215
void SetShowYaxis(bool showyaxis)
set show yaxis
Definition: curvegroup.cpp:468
void SetShowLeftYaxis(const wxString &curveAreaName, bool showyaxis)
the a2dCurveArea with the given name is set as holding the left Yaxis
Definition: curvegroup.cpp:840
void SetMax(double px, double py)
set the bounding box its minimum
Definition: bbox.cpp:352
virtual void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
Load settings.
Definition: gen.cpp:1699
void SetAxisAreaStroke(const a2dStroke &fill)
Set a stroke around axis area.
a2dCanvasXYDisplayGroupAreas * m_group
the group of which the area is a part
Definition: curvegroup.h:245
void InsertCurveToArea(const wxString &curveAreaName, size_t before, a2dCurve *curve, const wxString curvename=_T(""))
add a curve to the end of the exisiting curves.
while iterating a a2dCanvasDocument, this holds the context.
Definition: canobj.h:3212
void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
load object specific CVG data
Definition: polygon.cpp:1700
double GetTicY() const
tic distance in Y for the m_leftAxisY area
Definition: curvegroup.h:306
void UpdateViewDependentObjects(a2dIterC &ic)
update the transform matrix for objects with property &#39;PROPID_viewDependent&#39;
Definition: canobj.cpp:4605
void SetGroup(a2dCanvasXYDisplayGroupAreas *aGroup)
the group of which the area is a part
Definition: curvegroup.cpp:453
a2dBoundingBox GetCurvesBoundaries()
get the boundingbox in internal curve coordinates of all the curves
Definition: curvegroup.cpp:238
double m_x
(world coordinates) hit point x as in a2dDrawingPart or any other top level
Definition: canobj.h:293
void MapBbox(const a2dAffineMatrix &matrix)
Definition: bbox.cpp:445
bool ReleaseChildObjects(a2dCanvasObjectFlagsMask mask=a2dCanvasOFlags::ALL)
removes and release only from the childobjects the objects with the given mask
Definition: canobj.cpp:6296
a2dCurvesArea * GetCurvesArea(const wxString &curvesAreaName)
get a2dCurvesArea with the given name
Definition: curvegroup.cpp:573
virtual ~a2dCanvasXYDisplayGroupAreas()
destructor
bool DoIsHitWorld(a2dIterC &ic, a2dHitEvent &hitEvent)
Does hit test on the object (exclusif child objects)
virtual void Load(wxObject *parent, a2dIOHandlerXmlSerIn &parser)
load object from CVG file
Definition: gen.cpp:1396
wxString GetAttributeValue(const wxString &attrib, const wxString &defaultv=wxT(""))
Returns the value of an attribute.
Definition: genxmlpars.cpp:450
Interactive drawing of a polygon.
Definition: sttool.h:1715
void SetBoundaries(double min, double max)
define which part is displayed on this axis
Definition: axis.cpp:225
void SetShowRightYaxis(const wxString &curveAreaName, bool showyaxis)
show yaxis
editing tool for a2dCanvasObject&#39;s
bool m_HasSelectedObjectsBelow
selected objects detected below
Definition: candefs.h:354
a2dBoundingBox GetPlotAreaBbox() const
return plotting rectangle in world coordinates
double GetHitMarginWorld()
Get HitMargin in World units.
Definition: canobj.cpp:606
void DoSave(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dXmlSer_flag xmlparts, a2dObjectList *towrite)
write object specific CVGL data
Definition: polygon.cpp:1662
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
void Require(const XMLeventType &type, wxString name)
Forces a special tag.
Definition: genxmlpars.cpp:390
void SetColor(const wxColour &color)
set color of axis text
Definition: curvegroup.h:192
a2dCanvasXYDisplayGroupAreas(double x=0, double y=0)
construct a new a2dCanvasXYDisplayGroup at given position
bool IsCurvesHighlighted() const
if a curve in this area is set, true returned
Definition: curvegroup.cpp:419
void SetPosXY(double x, double y, bool restrict=false)
set position to x,y
Definition: canobj.cpp:1624
bool Scale(double scale)
Scale by scale (isotropic scaling i.e. the same in x and y):
Definition: afmatrix.cpp:270
bool m_HasToolObjectsBelow
special tool object detected below
Definition: candefs.h:348
bool Translate(double x, double y)
Translate by dx, dy:
Definition: afmatrix.cpp:420
bool GetHasSelectedObjectsBelow() const
selected object itself or one of its recursive children
Definition: canobj.h:1761
void DependencyPending(a2dWalkerIOHandler *handler)
called by to check if this object becomes pending as a result of other objects
Definition: curvegroup.cpp:294
const a2dStroke * a2dTRANSPARENT_STROKE
global a2dStroke stock object for TRANSPARENT stroking
bool m_editingCopy
true if the object needs to be rendered in edit mode.
Definition: candefs.h:304
virtual void DoAddPending(a2dIterC &ic)
called by addPending
Definition: canobj.cpp:4601
if set, clone members (e.g. line end styles), otherwise ref-copy them
Definition: gen.h:1203
virtual wxString StringValueRepresentation() const
Definition: gen.h:1905
a2dCurvesArea * AddCurvesArea(const wxString &curveAreaName)
add a2dCurveArea with this name, if not already available
void SetBoundaries(const a2dBoundingBox &extbox)
size of object in world coordinates, as displayed in the drawing.
Definition: curvegroup.cpp:176
a2dCurveAxis * GetAreaAxisY(const wxString &curveAreaName) const
get Y axis object for given curve area
const a2dBoundingBox & GetInternalBoundaries() const
get the plotting rectangle in curve coordinates
Definition: curvegroup.h:107
a2dCanvasObject * IsHitWorld(a2dIterC &ic, a2dHitEvent &hitEvent)
If the position (x,y) is within the object return this.
Definition: canobj.cpp:3415
void DoRender(a2dIterC &ic, OVERLAP clipparent)
render derived object
The a2dBoundingBox class stores one a2dBoundingBox of a a2dCanvasObject.
Definition: bbox.h:39
bool Invert(void)
Invert matrix.
Definition: afmatrix.cpp:197
void SetInternalXBoundaries(double ximin, double ximax)
set the minimum and maximum values for axis X for all axisareas to be displayed
bool GetHasToolObjectsBelow() const
tool object itself or one of its recursive children
Definition: canobj.h:1767
static a2dHit stock_fill
Stock object for a fill hit.
Definition: polyver.h:137
a2dCurvesArea(const wxString curvesAreaName=wxT(""))
constructor
Definition: curvegroup.cpp:83
bool DoUpdate(UpdateMode mode, const a2dBoundingBox &childbox, const a2dBoundingBox &clipbox, const a2dBoundingBox &propbox)
Update derived Object specific things ( mainly boundingbox)
Definition: curvegroup.cpp:367
virtual void DoLoad(wxObject *parent, a2dIOHandlerXmlSerIn &parser, a2dXmlSer_flag xmlparts)
Load settings.
Definition: curvegroup.cpp:501
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
a2dAffineMatrix m_iworld
internal coordinates used for curve plotting expressed as matrix
Definition: curvegroup.h:236
bool m_showyaxis
if true show the Y axis object
Definition: curvegroup.h:228
#define const_forEachIn(listtype, list)
easy const iteration for a2dlist
Definition: a2dlist.h:118
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.
wxColour m_colour
color of axis text
Definition: curvegroup.h:242
a2dCanvasXYDisplayGroup(double x=0, double y=0)
construct a new a2dCanvasXYDisplayGroup at given position
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
a2dCanvasGlobal * a2dCanvasGlobals
global a2dCanvasGlobal to have easy access to global settings
Definition: canglob.cpp:1234
virtual void Save(wxObject *parent, a2dIOHandlerXmlSerOut &out, a2dObjectList *towrite)
write all needed to an XML type of file called the CVG format
Definition: gen.cpp:1343
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
This template class is for property ids with a known data type.
Definition: id.h:477
void SetTicFormat(const wxString &format)
Set how tic text is formated/displayed.
Definition: axis.h:200
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
void Insert(size_t before, a2dCanvasObject *obj, bool ignoreReleased=true)
insert a a2dCanvasObject to the childobjects
Definition: canobj.cpp:6246
void SetAxes(const a2dBoundingBox &extbox, double x, double y, double &zerox, double &zeroy, double &ixmin, double &ixmax)
sets m_axisY values
Definition: curvegroup.cpp:787
void Append(a2dCanvasObject *obj)
append a a2dCanvasObject to the childobjects
Definition: canobj.cpp:6224
void SetMinX(double minx)
set the bounding box its minimum X, does not validate the box
Definition: bbox.h:169
const a2dAffineMatrix & GetTransform() const
Get the accumulated transform up to and including m_lworld of the current object. ...
Definition: canobj.cpp:663
a2dSmrtPtr< a2dCursor > m_cursor
cursor object
Definition: curvegroup.h:678
void SetInternalBoundaries(const a2dBoundingBox &extbox, const a2dBoundingBox &intbox)
set the internal curve boundaries, and update conversion to world matrix
Definition: curvegroup.h:94
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
A pointer class, that automatically calls SmrtPtrOwn/SmrtPtrRelease.
Definition: a2dlist.h:20
virtual bool Update(UpdateMode mode)
Update the state of the object according to its current position etc.
Definition: polygon.cpp:3272
double m_y
(world coordinates) hit point y as in a2dDrawingPart or any other top level
Definition: canobj.h:295
void SetBoundaries(const a2dBoundingBox &extbox)
set the minimum and maximum values
CloneOptions
options for cloning
Definition: gen.h:1200
a2dSmrtPtr< a2dCurveAxis > m_axisX
x axis object
Definition: curvegroup.h:675
bool DoStartEdit(wxUint16 editmode, wxEditStyle editstyle)
only used for editable objects and under control of a editing tool.
void RemoveMarker(a2dMarker *marker)
remove a marker
Definition: curvegroup.cpp:214
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
a2dBoundingBox & GetBbox()
get boundingbox in world coordinates exclusive stroke width relative to its parent ...
Definition: canobj.cpp:3175
structure to give as parameter to member functions of a2dCanvasObject
Definition: canobj.h:252
a2dBoundingBox GetCurvesBoundariesFromArea(const wxString &curveAreaName)
get the boundingbox in internal curve coordinates of all the curves in a given area ...
int AppendCurvesBoundaries(a2dBboxHash *irectHash)
fills a2dBboxHash with rectangles representing the plotting area of a curve
Definition: curvegroup.cpp:658
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
general canvas module declarations and classes
void WriteStartElement(const wxString &name, bool newLine=true)
Writes start tag which has no attributes.
Definition: genxmlpars.cpp:738
wxEditStyle
Definition: canobj.h:109
void SetShowLeftYaxis(const wxString &curveAreaName, bool showyaxis)
show yaxis
curvegroup.cpp Source File -- Sun Oct 12 2014 17:04:15 -- Sun Oct 12 2014 -- 1.8.5 -- wxArt2D -- . -- Main Page Reference Documentation