This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void pictureBox2_MouseClick(object sender, MouseEventArgs e) | |
{ | |
Bitmap bmp = new Bitmap(this.pictureBox2.Image); | |
Color color = bmp.GetPixel(e.X, e.Y); | |
Bitmap message = new Bitmap(400, 30); | |
Graphics gr = Graphics.FromImage(message); | |
gr.Clear(Color.Black); | |
if (!(color.B == 0 && color.G == 0 && color.R == 0)) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void AddGrid() | |
{ | |
this.Picture = new Bitmap(this.pictureBox2.Image); | |
double scaleX = 1.0; | |
double scaleY = 1.0; | |
if (this.OrginalSizeX > this.OrginalSizeY) | |
{ | |
scaleY = this.OrginalSizeY / this.OrginalSizeX; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void CreateModel() | |
{ | |
if (mesh != null) | |
{ | |
NormalizeMesh(); | |
this.model = GL.glGenLists(1); | |
GL.glNewList(this.model, GL.GL_COMPILE_AND_EXECUTE); | |
for (int i = 0; i < mesh.Length - 1; i++) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void NormalizeMesh() | |
{ | |
double scaleX = 1.0; | |
double scaleY = 1.0; | |
if (this.sizeX > this.sizeY) | |
{ | |
scaleY = this.sizeY / this.sizeX; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private double NormalizedValue(double value, double max, double min) | |
{ | |
return (value - min) / (max - min); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected override void InitGLContext() | |
{ | |
GL.CSGLInit(); | |
GL.glEnable(GL.GL_TEXTURE_2D); // Enable Texture Mapping | |
GL.glShadeModel(GL.GL_SMOOTH); // Enable Smooth Shading | |
GL.glClearColor(0.0f, 0.0f, 0.0f, 0.5f); // Black Background | |
GL.glClearDepth(1.0f); // Depth Buffer Setup | |
GL.glEnable(GL.GL_DEPTH_TEST); // Enables Depth Testing | |
GL.glDepthFunc(GL.GL_LEQUAL); // The Type Of Depth Testing To Do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Postprocesor.Chart chart = new Postprocesor.Chart(); | |
chart.Mesh = points; | |
chart.SizeX = input.Width; | |
chart.SizeY = input.Height; | |
chart.ShowDialog(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
StreamReader reader = new StreamReader("input.xml", Encoding.UTF8); | |
string content = reader.ReadToEnd().Remove(0, 1); | |
reader.Close(); | |
InputData input = Serializer.Deserialize<InputData>(content); | |
Area area = new Area(input.Width, input.Height, input.DivX, input.DivY, input.K); | |
double[][] globalMatrixH = area.GlobalMatrixH; | |
double[][] h = GaussElimination.ExtendMatrix(globalMatrixH); | |
double[][] secondConditionAdded = h; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static double[][] SecondKindBoundry(double[][] matrixH, Side side, Area area, double q) | |
{ | |
List<CustomPoint> points = new List<CustomPoint>(); | |
switch (side) | |
{ | |
case Side.Dó³: | |
points = area.FirstRow; | |
break; | |
case Side.Lewa: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static List<CustomPoint> GetPointsBySide(Side side, Area area) | |
{ | |
List<CustomPoint> points = new List<CustomPoint>(); | |
switch (side) | |
{ | |
default: | |
case Side.Dó³: | |
points = area.FirstRow; | |
break; |