Blender V4.3
Chain.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
12#include "Curve.h"
13
14#include "../view_map/ViewMap.h"
15
16namespace Freestyle {
17
21class Chain : public Curve {
22 protected:
23 // tmp
25 FEdge *
26 _fedgeB; // the last FEdge of the ViewEdge passed to the last call for push_viewedge_back().
27
28 public:
31 {
32 _splittingId = 0;
33 _fedgeB = 0;
34 }
35
37 Chain(const Id &id) : Curve(id)
38 {
39 _splittingId = 0;
40 _fedgeB = 0;
41 }
42
44 Chain(const Chain &iBrother) : Curve(iBrother)
45 {
46 _splittingId = iBrother._splittingId;
47 _fedgeB = iBrother._fedgeB;
48 }
49
51 virtual ~Chain()
52 {
53 // only the last splitted deletes this id
54 if (_splittingId) {
55 if (*_splittingId == _Id) {
56 delete _splittingId;
57 }
58 }
59 }
60
62 virtual string getExactTypeName() const
63 {
64 return "Chain";
65 }
66
73 void push_viewedge_back(ViewEdge *iViewEdge, bool orientation);
74
81 void push_viewedge_front(ViewEdge *iViewEdge, bool orientation);
82
83 inline void setSplittingId(Id *sid)
84 {
85 _splittingId = sid;
86 }
87
89 {
90 return _splittingId;
91 }
92
93#ifdef WITH_CXX_GUARDEDALLOC
94 MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:Chain")
95#endif
96};
97
98} /* namespace Freestyle */
Class to define a container for curves.
Classes to define a View Map (ViewVertex, ViewEdge, etc.)
void push_viewedge_front(ViewEdge *iViewEdge, bool orientation)
Definition Chain.cpp:80
Chain(const Chain &iBrother)
Definition Chain.h:44
void push_viewedge_back(ViewEdge *iViewEdge, bool orientation)
Definition Chain.cpp:17
Chain(const Id &id)
Definition Chain.h:37
virtual string getExactTypeName() const
Definition Chain.h:62
Id * _splittingId
Definition Chain.h:24
Id * getSplittingId()
Definition Chain.h:88
FEdge * _fedgeB
Definition Chain.h:26
virtual ~Chain()
Definition Chain.h:51
void setSplittingId(Id *sid)
Definition Chain.h:83
inherits from class Rep
Definition AppCanvas.cpp:20