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

Add spline support to vector graphic libraries #72

Open
2 of 4 tasks
shchuko opened this issue Apr 30, 2020 · 0 comments · May be fixed by #73
Open
2 of 4 tasks

Add spline support to vector graphic libraries #72

shchuko opened this issue Apr 30, 2020 · 0 comments · May be fixed by #73
Assignees
Labels
enhancement New feature or request

Comments

@shchuko
Copy link
Owner

shchuko commented Apr 30, 2020

  • Add == operator for CPoint2D
  • Add new class "File2DProcessingTools::CPath"
  • Add CSmoothedLine support to CVectorGraphicsData
  • Add CSmoothedLine support to IVectorGraphicsDataWriter

Почекать идеи интерполяции кривой можно:

class CPath {
public:
    CPath(); // Default width 1px, default color BLACK, smoth=false
    CPath(unsigned int width_px, CColor color, bool smooth) noexcept;
    void setColor(const CColor& color)  noexcept; // цвет
    CColor getColor() const noexcept;
    void setWidth(unsigned int width_px) noexcept; // толщина в пикселях
    unsigned int getWidth() const noexcept; 
    void setSmooth(bool flag) noexcept; // сглаживание, атрибут для обработки в дальнейшем
    bool isSmooth() const noexcept;

    // Добавляет следующую точку к линии
    // Если линия имеет одну из координат NaN - разрыв в линии, распознается методом toSeparatedPaths()
    void appendPoint(const CPoint2D& point) noexcept;
    const std::vector<CPoint2D>& getPoints() const noexcept;

    // Разбивает линию на несколько линий, разрыв определяется точкой с NaN-координатой или циклом
    std::vector<CPath> toSeparatedPaths();

   // Проверяет, зациклена ли кривая. Если да - отмечает, что есть цикл, чтоб не дублировать точку начала/конца при записи в файл 
    void updateCycled() noexcept;
    bool isCycled() const noexcept;
    
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
ScratchedHologramFrom3D
  
Awaiting triage
Development

Successfully merging a pull request may close this issue.

3 participants