Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drawable base class #5

Closed
11 of 12 tasks
martinjrobins opened this issue Jun 2, 2018 · 3 comments
Closed
11 of 12 tasks

Drawable base class #5

martinjrobins opened this issue Jun 2, 2018 · 3 comments
Labels
enhancement New feature or request

Comments

@martinjrobins
Copy link
Collaborator

martinjrobins commented Jun 2, 2018

  • base class for Axis, Plot1D etc

member variables:

  • std::vector<Drawable *> m_children
  • m_area: area as ratio of parent
  • m_pixels: current area as raw pixels
  • m_time_span: maximum time for animation
  • m_times: frame times for animation
  • m_time: current time for animation

member functions:

  • void resize(const std::array<float, 4> &parent_pixels): resize itself and its children
  • template <typename Backend> void draw(Backend &backend): draw itself and its children
  • add_frame(time): add a new animation frame
  • float get_frame_index(): get frame index associated with current time (as a float, could be in-between frames)
  • set_time(time): set current animation time
  • 'std::string to_svg()`: create a string to represent the object in the SVG format serialization to svg #16
This was referenced Jun 2, 2018
martinjrobins added a commit that referenced this issue Jun 6, 2018
…have badly. All domains for Drawable defined using raw pixels, so line widths and text font size are independent of resizing
martinjrobins added a commit that referenced this issue Jun 7, 2018
…ated on Backend (i.e. they can exist separate from a Backend).
@martinjrobins
Copy link
Collaborator Author

made Drawables no longer templated on Backend. The particular Backend class is only needed for the draw function

@martinjrobins
Copy link
Collaborator Author

got a basic class, closing this for now

@martinjrobins
Copy link
Collaborator Author

re-opening to add features

@martinjrobins martinjrobins reopened this Jun 8, 2018
@martinjrobins martinjrobins added the enhancement New feature or request label Jun 9, 2018
martinjrobins added a commit to martinjrobins/trase that referenced this issue Jun 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant