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

Task 1. #84

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

Task 1. #84

wants to merge 6 commits into from

Conversation

Nvoid09
Copy link
Collaborator

@Nvoid09 Nvoid09 commented May 21, 2021

Features: Key c - change cube color, Key B - change background color


find_package(Qt5 COMPONENTS Widgets REQUIRED)

add_executable(EXE ${SRC})
Copy link
Owner

Choose a reason for hiding this comment

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

Давайте дадим осмысленное название исполняемому файлу EXE -> VoitovTask1


void setColor(QVector3D rgb);

QVector4D getColor();
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
QVector4D getColor();
[[nodiscard]] QVector4D getColor() const noexcept;

и ниже


void setColor(QVector3D rgb);

QVector4D getColor();
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
QVector4D getColor();
[[nodiscard]] QVector4D getColor() const noexcept;

и ниже

class figure
{
public:
virtual ~figure() = default;
Copy link
Owner

Choose a reason for hiding this comment

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

Зачем виртуальный деструктор?

return this->gIndexes;
}

void geometry::figure::setColor(QVector3D rgb){
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
void geometry::figure::setColor(QVector3D rgb){
void geometry::figure::setColor(const QVector3D rgb){

#include "figure.hpp"

namespace geometry{
//figure::figure(){}
Copy link
Owner

Choose a reason for hiding this comment

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

лишний код


namespace geometry{

class Cube final: public figure {
Copy link
Owner

Choose a reason for hiding this comment

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

Само наличие структуры cube бесмысленно. Либо делайте figure интерфейсом, либо мержите оба этих класса

Narick09 added 3 commits May 26, 2021 14:13
	изменено:      src/Voitov/Task1/CMakeLists.txt
	изменено:      src/Voitov/Task1/cube.hpp
	удалено:       src/Voitov/Task1/figure.cpp
	изменено:      src/Voitov/Task1/figure.hpp
	новый файл:    src/Voitov/Task1/figureinformation.cpp
	новый файл:    src/Voitov/Task1/figureinformation.h
	изменено:      src/Voitov/Task1/main.cpp
	изменено:      src/Voitov/Task1/uiwindow.cpp
	изменено:      src/Voitov/Task1/uiwindow.h

изменен исполняемый файл EXE -> VoitovTask1
Добавлены [[nodiscard]] и const noexcept в нужных методах
Удален лишний код
класс figure переделан в интерфейс, а также добавлен базовый класс FigureInformation
@Nvoid09 Nvoid09 force-pushed the feature-voitov-task-1 branch from 3bb138c to acdbcea Compare May 26, 2021 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants