IGraphics.cs 741 B

123456789101112131415161718192021222324252627282930313233
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. namespace CommonLang.Geometry.SceneGraph2D
  6. {
  7. public abstract class Factory
  8. {
  9. public static Factory Instance { get; private set; }
  10. protected Factory() { Instance = this; }
  11. public abstract ITransform CreateTransform();
  12. }
  13. public interface IGraphics
  14. {
  15. void PushTransform();
  16. void Transform(ITransform trans);
  17. void PopTransform();
  18. }
  19. public interface ITransform
  20. {
  21. Vector2 Translation { get; set; }
  22. float Rotation { get; set; }
  23. Vector2 Scale { get; set; }
  24. void LocalToParent(Vector2[] pts);
  25. void ParentToLocal(Vector2[] pts);
  26. }
  27. }