-
Notifications
You must be signed in to change notification settings - Fork 307
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
Косторной Дмитрий #246
base: master
Are you sure you want to change the base?
Косторной Дмитрий #246
Conversation
{ | ||
public class CircularCloudLayouter : ICloudLayouter | ||
{ | ||
private readonly Point Center; |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
public class CircularCloudLayouter : ICloudLayouter | ||
{ | ||
private readonly Point Center; | ||
private List<Rectangle> rectangles; |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
if (!Directory.Exists(directory)) | ||
throw new DirectoryNotFoundException("The directory does not exist."); | ||
|
||
int width = 1200; |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
|
||
namespace TagsCloudVisualization.CloudLayouter | ||
{ | ||
public class CircularCloudLayouter : ICloudLayouter |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
private double angle; | ||
private const double SpiralStep = 0.1; | ||
public List<Rectangle> Rectangles => rectangles; | ||
public double Angle => angle; |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
|
||
public CircularCloudLayouter(Point center) | ||
{ | ||
if (center.X < 0 || center.Y < 0) |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
{ | ||
if (center.X < 0 || center.Y < 0) | ||
throw new ArgumentException("Center point coordinates cannot be negative.", nameof(center)); | ||
|
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
return new Point(x, y); | ||
} | ||
|
||
private bool IsIntersects(Rectangle rectangle) |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
using TagsCloudVisualization.Interfaces; | ||
|
||
namespace TagsCloudVisualization.CloudLayouter | ||
{ |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
@@ -0,0 +1,88 @@ | |||
using System.Drawing; |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
throw new DirectoryNotFoundException("The directory does not exist."); | ||
|
||
int width = 1200; | ||
int height = 900; |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
graphics.Clear(Color.White); | ||
foreach (var rectangle in Rectangles) | ||
{ | ||
|
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
|
||
} | ||
|
||
/* Тест для проверки 3 части задания |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
[Test] | ||
public void SaveVisualization_ShouldThrowDirectoryNotFoundException_WhenInvalidPath() | ||
{ | ||
var ivalidPath = @"M:\NonExistingDirectory\test_visualisation.png"; |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
namespace TagsCloudVisualization.Tests | ||
{ | ||
[TestFixture] | ||
public class CircularCloudLayouter_should |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
@@ -0,0 +1,209 @@ | |||
using NUnit.Framework; |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
|
||
namespace TagsCloudVisualization.CloudLayouter; | ||
|
||
public class SpiralPointGenerator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Слишком абстрактное название, стоит отразить что это спираль Архимеда
private const double SpiralStep = 0.1; | ||
private double angle; | ||
|
||
public SpiralPointGenerator(PointF center) |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
return newRectangle; | ||
} | ||
|
||
private void ShiftRectanglesTowardsCenter() |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
{ | ||
private readonly PointF center; | ||
private readonly SpiralPointGenerator spiral; | ||
public List<RectangleF> Rectangles { get; } |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Подумал, что плавающая точка в координатах может улучшить точность
No description provided.