Beispiel #1
0
 public void save_picture(Figure_representation representation)
 {
     System.IO.File.WriteAllText(
         $"{out_path}Figure_{representation.id}.dot",
         get_dot_format(representation)
         );
 }
Beispiel #2
0
        public IFigure_representation create_representation()
        {
            Figure_representation representation = representation_prefab.provide_new <Figure_representation>();

            representations.Add(representation);
            representation.transform.SetParent(representations_folder, false);
            return(representation);
        }
Beispiel #3
0
 public void on_create_empty_figure()
 {
     built_figure = figure_provider.provide_figure("f") as Figure;
     on_start_editing_figure(built_figure, true);
     built_repr = built_figure.create_representation() as Figure_representation;
     figure_header.mode_selector = mode_selector;
     figure_observer.observe(built_figure);
 }
Beispiel #4
0
 public void on_save_into_file()
 {
     foreach (
         IFigure figure in Selector.instance.figures
         )
     {
         Figure_representation representation = ((Figure)figure).representations.First() as Figure_representation;
         save_picture(representation);
     }
 }
Beispiel #5
0
        private String get_nodes_connections(Figure_representation representation)
        {
            StringBuilder result = new StringBuilder();

            foreach (Subfigure subfigure in representation.get_subfigures())
            {
                write_next_nodes_for(subfigure, result);
            }
            return(result.ToString());
        }
Beispiel #6
0
        public String get_dot_format(Figure_representation representation)
        {
            String node_connections
                = get_nodes_connections(representation);

            return(String.Format(
                       dot_file_template,
                       "Figure",
                       node_connections
                       ));
        }
Beispiel #7
0
 public void on_start_editing_figure(
     Figure figure, bool change_connections = false
     )
 {
     this.change_connections = change_connections;
     activate();
     built_figure  = figure;
     built_repr    = figure.get_representations().FirstOrDefault() as Figure_representation;
     figure_header = built_figure.header;
     figure_header.start_building();
     figure_observer.observe(built_figure);
     if (built_repr)
     {
         connect_subfigures_to_builder(built_figure);
     }
 }