Skip to content
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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Kostornoj-Dmitrij
Copy link

No description provided.

{
public class CircularCloudLayouter : ICloudLayouter
{
private readonly Point Center;

This comment was marked as resolved.

public class CircularCloudLayouter : ICloudLayouter
{
private readonly Point Center;
private List<Rectangle> rectangles;

This comment was marked as resolved.

if (!Directory.Exists(directory))
throw new DirectoryNotFoundException("The directory does not exist.");

int width = 1200;

This comment was marked as resolved.


namespace TagsCloudVisualization.CloudLayouter
{
public class CircularCloudLayouter : ICloudLayouter

This comment was marked as resolved.

private double angle;
private const double SpiralStep = 0.1;
public List<Rectangle> Rectangles => rectangles;
public double Angle => angle;

This comment was marked as resolved.


public CircularCloudLayouter(Point center)
{
if (center.X < 0 || center.Y < 0)

This comment was marked as resolved.

{
if (center.X < 0 || center.Y < 0)
throw new ArgumentException("Center point coordinates cannot be negative.", nameof(center));

This comment was marked as resolved.

return new Point(x, y);
}

private bool IsIntersects(Rectangle rectangle)

This comment was marked as resolved.

using TagsCloudVisualization.Interfaces;

namespace TagsCloudVisualization.CloudLayouter
{

This comment was marked as resolved.

@@ -0,0 +1,88 @@
using System.Drawing;

This comment was marked as resolved.

throw new DirectoryNotFoundException("The directory does not exist.");

int width = 1200;
int height = 900;

This comment was marked as resolved.

graphics.Clear(Color.White);
foreach (var rectangle in Rectangles)
{

This comment was marked as resolved.


}

/* Тест для проверки 3 части задания

This comment was marked as resolved.

[Test]
public void SaveVisualization_ShouldThrowDirectoryNotFoundException_WhenInvalidPath()
{
var ivalidPath = @"M:\NonExistingDirectory\test_visualisation.png";

This comment was marked as resolved.

namespace TagsCloudVisualization.Tests
{
[TestFixture]
public class CircularCloudLayouter_should

This comment was marked as resolved.

@@ -0,0 +1,209 @@
using NUnit.Framework;

This comment was marked as resolved.


namespace TagsCloudVisualization.CloudLayouter;

public class SpiralPointGenerator
Copy link

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.

return newRectangle;
}

private void ShiftRectanglesTowardsCenter()

This comment was marked as resolved.

{
private readonly PointF center;
private readonly SpiralPointGenerator spiral;
public List<RectangleF> Rectangles { get; }

This comment was marked as resolved.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Подумал, что плавающая точка в координатах может улучшить точность

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants