/
polytech_kolomna
/
aipackaging
Обзор
Документация
Войти
/
polytech_kolomna
/
aipackaging
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
FigureGenerator
src/data_format/cell.cpp
69 строк
939 B
Olegh
Merge branch 'master' of https://gitverse.ru/polytech_kolomna/aipackaging into data_format
15 окт 2025, 00:21
15 окт 2025, 00:21
a226d21
Код
Авторство
О чём код?
#include <sstream> #include "cell.h" Cell::Cell() : id_(0) { } Cell::Cell(Point2D pos) : id_(0) { pos_ = pos; } Cell::Cell(int id) : id_(id) { } Cell::Cell(Point2D pos, int id) : pos_(pos), id_(id) { } void Cell::add_line(std::shared_ptr<BoundedCurve2D> l) { curves_.push_back(l); } Point2D Cell::get_pos() const { return pos_; } int Cell::get_id() const { return id_; } std::string Cell::to_aipon() const { std::stringstream out, array; out << '('; if (!curves_.empty()) { /* Формат: перечисление сериализованных линий, из которых состоит ячейка */ for (int i = 0; i < curves_.size(); ++i) { //out << curves_[i]->to_aipon(); Требуется изменение if (i + 1 < curves_.size()) out << ' '; } } out << ')'; return out.str(); } void Cell::set_pos(Point2D pos) { pos_ = pos; } void Cell::set_id(int id) { id_ = id; }