VTK/Charts/API

From KitwarePublic
< VTK‎ | Charts
Revision as of 18:40, 19 October 2009 by Marcus.hanwell (talk | contribs) (Some initial thoughts about API.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

There has been a lot of talk about API. Do we want a declarative UI? This would make constructs such as,

vtkChart *chart = vtkChart::New();
chart->SetWidth(200)
  ->SetHeight(200);

chart->AddPlot(vtkChart::BAR)
  ->SetData(table, 1, 2)
  ->SetWidth(20)
  ->SetLabel("My Data");

This would require setter functions that returned a pointer to the object, i.e.

vtkChart * vtkChart::SetWidth(int width);
vtkPlot * vtkChart::AddPlot(enum);
vtkPlot * vtkPlot::SetLabel(const char *label);