Blender  V3.3
Chain.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #pragma once
4 
10 #include "Curve.h"
11 
12 #include "../view_map/ViewMap.h"
13 
14 namespace Freestyle {
15 
19 class Chain : public Curve {
20  protected:
21  // tmp
23  FEdge *
24  _fedgeB; // the last FEdge of the ViewEdge passed to the last call for push_viewedge_back().
25 
26  public:
28  Chain() : Curve()
29  {
30  _splittingId = 0;
31  _fedgeB = 0;
32  }
33 
35  Chain(const Id &id) : Curve(id)
36  {
37  _splittingId = 0;
38  _fedgeB = 0;
39  }
40 
42  Chain(const Chain &iBrother) : Curve(iBrother)
43  {
44  _splittingId = iBrother._splittingId;
45  _fedgeB = iBrother._fedgeB;
46  }
47 
49  virtual ~Chain()
50  {
51  // only the last splitted deletes this id
52  if (_splittingId) {
53  if (*_splittingId == _Id) {
54  delete _splittingId;
55  }
56  }
57  }
58 
60  virtual string getExactTypeName() const
61  {
62  return "Chain";
63  }
64 
71  void push_viewedge_back(ViewEdge *iViewEdge, bool orientation);
72 
79  void push_viewedge_front(ViewEdge *iViewEdge, bool orientation);
80 
81  inline void setSplittingId(Id *sid)
82  {
83  _splittingId = sid;
84  }
85 
86  inline Id *getSplittingId()
87  {
88  return _splittingId;
89  }
90 
91 #ifdef WITH_CXX_GUARDEDALLOC
92  MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:Chain")
93 #endif
94 };
95 
96 } /* namespace Freestyle */
Class to define a container for curves.
Id * getSplittingId()
Definition: Chain.h:86
void push_viewedge_front(ViewEdge *iViewEdge, bool orientation)
Definition: Chain.cpp:78
Chain(const Chain &iBrother)
Definition: Chain.h:42
void push_viewedge_back(ViewEdge *iViewEdge, bool orientation)
Definition: Chain.cpp:15
Chain(const Id &id)
Definition: Chain.h:35
virtual string getExactTypeName() const
Definition: Chain.h:60
Id * _splittingId
Definition: Chain.h:22
FEdge * _fedgeB
Definition: Chain.h:24
virtual ~Chain()
Definition: Chain.h:49
void setSplittingId(Id *sid)
Definition: Chain.h:81
inherits from class Rep
Definition: AppCanvas.cpp:18