VizualizerWPF
VizualizerWPF.MainWindow Class Reference
Inheritance diagram for VizualizerWPF.MainWindow:

Public Member Functions

 MainWindow ()
 
VertexFindVertexSave (Point center)
 
void ellipse_MouseDown (object sender, RoutedEventArgs e)
 Function to either select vertices. After two are selected then line between them is created. Or to delete vertex and all edges neighbouring with it. More...
 
void line_MouseDown (object sender, RoutedEventArgs e)
 Function to remove line if clicked on If remove button activated then the edge is removed If Invariant button is activated then invariant edges are counted for this edge More...
 

Data Fields

GraphCoordinates graphCoordinates = new GraphCoordinates()
 
double scale
 
double sizeOfVertex
 
Dictionary< StateCalculation, bool > statesCalculation = new Dictionary<StateCalculation, bool>()
 

Protected Member Functions

override void OnMouseLeftButtonDown (MouseButtonEventArgs e)
 

Properties

int Smoothing [get]
 Smoothing constant determining the number of iterations of force-directed algorithm More...
 

Private Member Functions

void NumberValidationTextBox (object sender, TextCompositionEventArgs e)
 
void SmoothingChecker (object sender, TextCompositionEventArgs e)
 
void MinMaxValueEdgeChecker (object sender, TextCompositionEventArgs e)
 
void MinMaxValueVertexChecker (object sender, TextCompositionEventArgs e)
 
void InitializeRightValuesOfKedges ()
 Function to initialize wanted values More...
 
void Canvas_Loaded (object sender, RoutedEventArgs e)
 Function to set width and height of canvas due to dynamic setting (at the beggining, it is 0) More...
 
void MakeAllLinesNotSharp ()
 Shortening all edges to redraw uselessly long edges after force-directed algorithm More...
 
void CreateVerticesFromPoints (GraphCoordinates graphCoordinates)
 Update the vertices to contains only the points after shortening More...
 
void MakeSmootherAndDraw ()
 Subdivide edges, apply force-directed algorithm Smoothing-times, shorten the edges and then draw on canvas More...
 
int optimalCrossingNumber ()
 Get the value of Z(n) More...
 
void dispatcherTimer_Tick (object sender, EventArgs e)
 
void RedrawGraph (GraphCoordinates graphCoordinates)
 Function to redraw the drawing (when canvas resize) More...
 
void ResizeWindowEvent (object sender, EventArgs e)
 Function to hangle minimazing and maximazing window More...
 
void AutoButton_Click (object sender, RoutedEventArgs e)
 Function to change the state of Automoving Button More...
 
void Adding_Click (object sender, RoutedEventArgs e)
 Function to change the state of Adding Button More...
 
void Removing_Click (object sender, RoutedEventArgs e)
 Function to change the state of Removing Button More...
 
void AddingPolyline_Click (object sender, RoutedEventArgs e)
 Function to change the state of AddingPolyline Button More...
 
void Invariant_Click (object sender, RoutedEventArgs e)
 Function to change the state of Invariant Button More...
 
void MakeAllVerticesBlue ()
 
void RefferenceFace_Click (object sender, RoutedEventArgs e)
 Function to change the state of Face button More...
 
void Intersections_Click (object sender, RoutedEventArgs e)
 Function to change if intersection are visible or not, intersection can be recognized by green color More...
 
void SaveDrawing_Click (object sender, RoutedEventArgs e)
 Function to save the current drawing when we click on Save Button More...
 
void FlushFromBackUpToNormal ()
 Function to flush the data when we change to custom file working More...
 
void NextDrawing_Click (object sender, RoutedEventArgs e)
 Function to generate new drawing of clique from data If value of vertices textbox has changed then new data file is loaded More...
 
void PreviousDrawing_Click (object sender, RoutedEventArgs e)
 Function to generate previous drawing of clique from data More...
 
Vertex FindEdgeEnds (Edge edge)
 
void AddIntersectionsWithLines (List< Line > lines)
 
Edge FindEdge (Line line)
 Function to find edge containg line More...
 
void RemoveIntersections (Line line)
 Function to remove all intersection with line from canvas and coordinates More...
 
void RemoveIntersectionsAndMiddleOnes (Edge edge)
 
void RecalculateKEdgesAndUpdateButtonTexts (List< Vertex > withouts=null, Edge withoutEdge=null)
 
void UpdateButtonTexts (List< Vertex > withouts, Edge withoutEdge, int[] kEdgesValues, int[] invariantKEdges)
 Function to update buttons values by kEdgesValues and invariantKEdges values depending on invariant state More...
 
void ZeroInvariantEdgesValues ()
 Function to restore values of invariant textblock to zeroes and redraw all lines to non-dashed More...
 
void PrintAMKEdges (int size, int[,] AMKEdgesArray)
 Function to Print values of AMKEdgesArray to respective textblocks Checking also the 3AMK theorem (a messagebox shows up when something wrong) More...
 
void UpdateStats ()
 Function to coun intersections and to update all other stats regading $k$-edges More...
 
void canvas_MouseDown (object sender, RoutedEventArgs e)
 Function to add vertex when the place is empty and to detect a change of a reference face More...
 
double FindClipingSizes (HashSet< Point > points)
 
List< Line > CreateLinesFromPoints (List< Point > points)
 Function to connect consecutive points and get the line segments More...
 
List< Point > SubDivideLine (Line line, GraphCoordinates graphCoordinates)
 
void SubDivideEdge (Edge edge, GraphCoordinates graphCoordinates)
 Function to subdivide all lines contained in the edge More...
 
void SubDivideEdges (GraphCoordinates graphCoordinates)
 Function to subdivide all the edges in graphCoordinates More...
 
void CloseButton_Click (object sender, RoutedEventArgs e)
 
void RestoreButton_Click (object sender, RoutedEventArgs e)
 
void MinimizeButton_Click (object sender, RoutedEventArgs e)
 
void UpdateCanvasWidthWhenClose ()
 
void UpdateCanvasWidthWhenOpen ()
 
void ButtonOpenMenu_Click (object sender, RoutedEventArgs e)
 
void ButtonCloseMenu_Click (object sender, RoutedEventArgs e)
 
void DrawGraph (GraphCoordinates graphCoordinates, double scale)
 Function to draw a graph even when the canvas is not loaded yet The main difference to ReDraw the graph that here we first create ellipses, lines and so on, because graphCoordinates consists only of Vertices and Edges only containing points after generating More...
 

Private Attributes

double actualHeight = 500
 Actual Height and Actual Width of canvas due to initialization set manually More...
 
double actualWidth = 1000
 
Brush[] colors
 
double cx = 81.25
 Shift from 0,0 origin Shift from 0,0 origin More...
 
double cy = 219.75
 
readonly DispatcherTimer dispatcherTimer = new DispatcherTimer()
 
readonly int divisionConst = 50
 
GraphGenerator graphGenerator
 It is class for generating all drawings More...
 
List< VertexinvariantWithRescpectTo = new List<Vertex>()
 Set of vertices for which we count invariant edges More...
 
readonly double lambda = 1.1
 Resizing paramater to get a drawing little bit from borders More...
 
bool savedGraphs
 Default point determining outer face More...
 
readonly List< VertexselectedCanvasPlaces = new List<Vertex>()
 
readonly List< VertexselectedVertices = new List<Vertex>()
 List of vertices forming new edge More...
 
StateAutoMoving stateAutoMoving = StateAutoMoving.None
 
StateChanging stateChanging = StateChanging.None
 
 Vertex
 Function to find ends of edge More...
 
 double
 Function to find appropriate shift and rescaling so all the points fit into the canvas More...
 
 List< Line >
 Function to subdivide line depending on the divisionConstant (line is divided so that every line segment is now shorter than that divisionConstant) More...
 

Constructor & Destructor Documentation

◆ MainWindow()

VizualizerWPF.MainWindow.MainWindow ( )

Member Function Documentation

◆ Adding_Click()

void VizualizerWPF.MainWindow.Adding_Click ( object  sender,
RoutedEventArgs  e 
)
private

Function to change the state of Adding Button

Parameters
sender
e

◆ AddingPolyline_Click()

void VizualizerWPF.MainWindow.AddingPolyline_Click ( object  sender,
RoutedEventArgs  e 
)
private

Function to change the state of AddingPolyline Button

Parameters
sender
e

◆ AddIntersectionsWithLines()

void VizualizerWPF.MainWindow.AddIntersectionsWithLines ( List< Line >  lines)
private

◆ AutoButton_Click()

void VizualizerWPF.MainWindow.AutoButton_Click ( object  sender,
RoutedEventArgs  e 
)
private

Function to change the state of Automoving Button

Parameters
sender
e

◆ ButtonCloseMenu_Click()

void VizualizerWPF.MainWindow.ButtonCloseMenu_Click ( object  sender,
RoutedEventArgs  e 
)
private

◆ ButtonOpenMenu_Click()

void VizualizerWPF.MainWindow.ButtonOpenMenu_Click ( object  sender,
RoutedEventArgs  e 
)
private

◆ Canvas_Loaded()

void VizualizerWPF.MainWindow.Canvas_Loaded ( object  sender,
RoutedEventArgs  e 
)
private

Function to set width and height of canvas due to dynamic setting (at the beggining, it is 0)

Parameters
sender
e

◆ canvas_MouseDown()

void VizualizerWPF.MainWindow.canvas_MouseDown ( object  sender,
RoutedEventArgs  e 
)
private

Function to add vertex when the place is empty and to detect a change of a reference face

Parameters
sender
e

◆ CloseButton_Click()

void VizualizerWPF.MainWindow.CloseButton_Click ( object  sender,
RoutedEventArgs  e 
)
private

◆ CreateLinesFromPoints()

List<Line> VizualizerWPF.MainWindow.CreateLinesFromPoints ( List< Point >  points)
private

Function to connect consecutive points and get the line segments

Parameters
points
Returns

◆ CreateVerticesFromPoints()

void VizualizerWPF.MainWindow.CreateVerticesFromPoints ( GraphCoordinates  graphCoordinates)
private

Update the vertices to contains only the points after shortening

Parameters
graphCoordinates

◆ dispatcherTimer_Tick()

void VizualizerWPF.MainWindow.dispatcherTimer_Tick ( object  sender,
EventArgs  e 
)
private

◆ DrawGraph()

void VizualizerWPF.MainWindow.DrawGraph ( GraphCoordinates  graphCoordinates,
double  scale 
)
private

Function to draw a graph even when the canvas is not loaded yet The main difference to ReDraw the graph that here we first create ellipses, lines and so on, because graphCoordinates consists only of Vertices and Edges only containing points after generating

Parameters
graphCoordinatesClass to store graph
scale

◆ ellipse_MouseDown()

void VizualizerWPF.MainWindow.ellipse_MouseDown ( object  sender,
RoutedEventArgs  e 
)

Function to either select vertices. After two are selected then line between them is created. Or to delete vertex and all edges neighbouring with it.

Parameters
sender
e

◆ FindClipingSizes()

double VizualizerWPF.MainWindow.FindClipingSizes ( HashSet< Point >  points)
private

◆ FindEdge()

Edge VizualizerWPF.MainWindow.FindEdge ( Line  line)
private

Function to find edge containg line

Parameters
line
Returns

◆ FindEdgeEnds()

Vertex VizualizerWPF.MainWindow.FindEdgeEnds ( Edge  edge)
private

◆ FindVertexSave()

Vertex? VizualizerWPF.MainWindow.FindVertexSave ( Point  center)

◆ FlushFromBackUpToNormal()

void VizualizerWPF.MainWindow.FlushFromBackUpToNormal ( )
private

Function to flush the data when we change to custom file working

◆ InitializeRightValuesOfKedges()

void VizualizerWPF.MainWindow.InitializeRightValuesOfKedges ( )
private

Function to initialize wanted values

◆ Intersections_Click()

void VizualizerWPF.MainWindow.Intersections_Click ( object  sender,
RoutedEventArgs  e 
)
private

Function to change if intersection are visible or not, intersection can be recognized by green color

Parameters
sender
e

◆ Invariant_Click()

void VizualizerWPF.MainWindow.Invariant_Click ( object  sender,
RoutedEventArgs  e 
)
private

Function to change the state of Invariant Button

Parameters
sender
e

◆ line_MouseDown()

void VizualizerWPF.MainWindow.line_MouseDown ( object  sender,
RoutedEventArgs  e 
)

Function to remove line if clicked on If remove button activated then the edge is removed If Invariant button is activated then invariant edges are counted for this edge

Parameters
sender
e

◆ MakeAllLinesNotSharp()

void VizualizerWPF.MainWindow.MakeAllLinesNotSharp ( )
private

Shortening all edges to redraw uselessly long edges after force-directed algorithm

◆ MakeAllVerticesBlue()

void VizualizerWPF.MainWindow.MakeAllVerticesBlue ( )
private

◆ MakeSmootherAndDraw()

void VizualizerWPF.MainWindow.MakeSmootherAndDraw ( )
private

Subdivide edges, apply force-directed algorithm Smoothing-times, shorten the edges and then draw on canvas

◆ MinimizeButton_Click()

void VizualizerWPF.MainWindow.MinimizeButton_Click ( object  sender,
RoutedEventArgs  e 
)
private

◆ MinMaxValueEdgeChecker()

void VizualizerWPF.MainWindow.MinMaxValueEdgeChecker ( object  sender,
TextCompositionEventArgs  e 
)
private

◆ MinMaxValueVertexChecker()

void VizualizerWPF.MainWindow.MinMaxValueVertexChecker ( object  sender,
TextCompositionEventArgs  e 
)
private

◆ NextDrawing_Click()

void VizualizerWPF.MainWindow.NextDrawing_Click ( object  sender,
RoutedEventArgs  e 
)
private

Function to generate new drawing of clique from data If value of vertices textbox has changed then new data file is loaded

Parameters
sender
e

◆ NumberValidationTextBox()

void VizualizerWPF.MainWindow.NumberValidationTextBox ( object  sender,
TextCompositionEventArgs  e 
)
private

◆ OnMouseLeftButtonDown()

override void VizualizerWPF.MainWindow.OnMouseLeftButtonDown ( MouseButtonEventArgs  e)
protected

◆ optimalCrossingNumber()

int VizualizerWPF.MainWindow.optimalCrossingNumber ( )
private

Get the value of Z(n)

Returns

◆ PreviousDrawing_Click()

void VizualizerWPF.MainWindow.PreviousDrawing_Click ( object  sender,
RoutedEventArgs  e 
)
private

Function to generate previous drawing of clique from data

Parameters
sender
e

◆ PrintAMKEdges()

void VizualizerWPF.MainWindow.PrintAMKEdges ( int  size,
int  AMKEdgesArray[,] 
)
private

Function to Print values of AMKEdgesArray to respective textblocks Checking also the 3AMK theorem (a messagebox shows up when something wrong)

Parameters
size
AMKEdgesArray

◆ RecalculateKEdgesAndUpdateButtonTexts()

void VizualizerWPF.MainWindow.RecalculateKEdgesAndUpdateButtonTexts ( List< Vertex withouts = null,
Edge  withoutEdge = null 
)
private

◆ RedrawGraph()

void VizualizerWPF.MainWindow.RedrawGraph ( GraphCoordinates  graphCoordinates)
private

Function to redraw the drawing (when canvas resize)

Parameters
graphCoordinatesTo store graph topical
scaleTo know if it is maximized or minimized

◆ RefferenceFace_Click()

void VizualizerWPF.MainWindow.RefferenceFace_Click ( object  sender,
RoutedEventArgs  e 
)
private

Function to change the state of Face button

Parameters
sender
e

◆ RemoveIntersections()

void VizualizerWPF.MainWindow.RemoveIntersections ( Line  line)
private

Function to remove all intersection with line from canvas and coordinates

Parameters
line

◆ RemoveIntersectionsAndMiddleOnes()

void VizualizerWPF.MainWindow.RemoveIntersectionsAndMiddleOnes ( Edge  edge)
private

◆ Removing_Click()

void VizualizerWPF.MainWindow.Removing_Click ( object  sender,
RoutedEventArgs  e 
)
private

Function to change the state of Removing Button

Parameters
sender
e

◆ ResizeWindowEvent()

void VizualizerWPF.MainWindow.ResizeWindowEvent ( object  sender,
EventArgs  e 
)
private

Function to hangle minimazing and maximazing window

Parameters
sender
e

◆ RestoreButton_Click()

void VizualizerWPF.MainWindow.RestoreButton_Click ( object  sender,
RoutedEventArgs  e 
)
private

◆ SaveDrawing_Click()

void VizualizerWPF.MainWindow.SaveDrawing_Click ( object  sender,
RoutedEventArgs  e 
)
private

Function to save the current drawing when we click on Save Button

Parameters
sender
e

◆ SmoothingChecker()

void VizualizerWPF.MainWindow.SmoothingChecker ( object  sender,
TextCompositionEventArgs  e 
)
private

◆ SubDivideEdge()

void VizualizerWPF.MainWindow.SubDivideEdge ( Edge  edge,
GraphCoordinates  graphCoordinates 
)
private

Function to subdivide all lines contained in the edge

Parameters
edge
graphCoordinates

◆ SubDivideEdges()

void VizualizerWPF.MainWindow.SubDivideEdges ( GraphCoordinates  graphCoordinates)
private

Function to subdivide all the edges in graphCoordinates

Parameters
graphCoordinates

◆ SubDivideLine()

List<Point> VizualizerWPF.MainWindow.SubDivideLine ( Line  line,
GraphCoordinates  graphCoordinates 
)
private

◆ UpdateButtonTexts()

void VizualizerWPF.MainWindow.UpdateButtonTexts ( List< Vertex withouts,
Edge  withoutEdge,
int[]  kEdgesValues,
int[]  invariantKEdges 
)
private

Function to update buttons values by kEdgesValues and invariantKEdges values depending on invariant state

Parameters
withouts
withoutEdge
kEdgesValues
invariantKEdges

◆ UpdateCanvasWidthWhenClose()

void VizualizerWPF.MainWindow.UpdateCanvasWidthWhenClose ( )
private

◆ UpdateCanvasWidthWhenOpen()

void VizualizerWPF.MainWindow.UpdateCanvasWidthWhenOpen ( )
private

◆ UpdateStats()

void VizualizerWPF.MainWindow.UpdateStats ( )
private

Function to coun intersections and to update all other stats regading $k$-edges

◆ ZeroInvariantEdgesValues()

void VizualizerWPF.MainWindow.ZeroInvariantEdgesValues ( )
private

Function to restore values of invariant textblock to zeroes and redraw all lines to non-dashed

Field Documentation

◆ actualHeight

double VizualizerWPF.MainWindow.actualHeight = 500
private

Actual Height and Actual Width of canvas due to initialization set manually

◆ actualWidth

double VizualizerWPF.MainWindow.actualWidth = 1000
private

◆ colors

Brush [] VizualizerWPF.MainWindow.colors
private
Initial value:
=
{
Brushes.Red, Brushes.Orange, Brushes.Yellow, Brushes.LightGreen, Brushes.ForestGreen,
Brushes.LightSkyBlue, Brushes.Blue, Brushes.DarkBlue, Brushes.Purple, Brushes.Pink
}

◆ cx

double VizualizerWPF.MainWindow.cx = 81.25
private

Shift from 0,0 origin Shift from 0,0 origin

◆ cy

double VizualizerWPF.MainWindow.cy = 219.75
private

◆ dispatcherTimer

readonly DispatcherTimer VizualizerWPF.MainWindow.dispatcherTimer = new DispatcherTimer()
private

◆ divisionConst

readonly int VizualizerWPF.MainWindow.divisionConst = 50
private

◆ double

VizualizerWPF.MainWindow.double
private

Function to find appropriate shift and rescaling so all the points fit into the canvas

Parameters
points
Returns

◆ graphCoordinates

GraphCoordinates VizualizerWPF.MainWindow.graphCoordinates = new GraphCoordinates()

◆ graphGenerator

GraphGenerator VizualizerWPF.MainWindow.graphGenerator
private

It is class for generating all drawings

◆ invariantWithRescpectTo

List<Vertex> VizualizerWPF.MainWindow.invariantWithRescpectTo = new List<Vertex>()
private

Set of vertices for which we count invariant edges

◆ lambda

readonly double VizualizerWPF.MainWindow.lambda = 1.1
private

Resizing paramater to get a drawing little bit from borders

◆ List< Line >

VizualizerWPF.MainWindow.List< Line >
private

Function to subdivide line depending on the divisionConstant (line is divided so that every line segment is now shorter than that divisionConstant)

Parameters
line
graphCoordinates
Returns

◆ savedGraphs

bool VizualizerWPF.MainWindow.savedGraphs
private

Default point determining outer face

Whether we use custom files at moment.

◆ scale

double VizualizerWPF.MainWindow.scale

◆ selectedCanvasPlaces

readonly List<Vertex> VizualizerWPF.MainWindow.selectedCanvasPlaces = new List<Vertex>()
private

◆ selectedVertices

readonly List<Vertex> VizualizerWPF.MainWindow.selectedVertices = new List<Vertex>()
private

List of vertices forming new edge

◆ sizeOfVertex

double VizualizerWPF.MainWindow.sizeOfVertex

◆ stateAutoMoving

StateAutoMoving VizualizerWPF.MainWindow.stateAutoMoving = StateAutoMoving.None
private

◆ stateChanging

StateChanging VizualizerWPF.MainWindow.stateChanging = StateChanging.None
private

◆ statesCalculation

Dictionary<StateCalculation, bool> VizualizerWPF.MainWindow.statesCalculation = new Dictionary<StateCalculation, bool>()

◆ Vertex

VizualizerWPF.MainWindow.Vertex
private

Function to find ends of edge

Parameters
edge
Returns

Property Documentation

◆ Smoothing

int VizualizerWPF.MainWindow.Smoothing
getprivate

Smoothing constant determining the number of iterations of force-directed algorithm


The documentation for this class was generated from the following file: