FreeCAD

Форк
0
/
Edge.cpp 
97 строк · 3.0 Кб
1
/***************************************************************************
2
 *   Copyright (c) 2021 Werner Mayer <wmayer[at]users.sourceforge.net>     *
3
 *                                                                         *
4
 *   This file is part of the FreeCAD CAx development system.              *
5
 *                                                                         *
6
 *   This library is free software; you can redistribute it and/or         *
7
 *   modify it under the terms of the GNU Library General Public           *
8
 *   License as published by the Free Software Foundation; either          *
9
 *   version 2 of the License, or (at your option) any later version.      *
10
 *                                                                         *
11
 *   This library  is distributed in the hope that it will be useful,      *
12
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
13
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
14
 *   GNU Library General Public License for more details.                  *
15
 *                                                                         *
16
 *   You should have received a copy of the GNU Library General Public     *
17
 *   License along with this library; see the file COPYING.LIB. If not,    *
18
 *   write to the Free Software Foundation, Inc., 51 Franklin Street,      *
19
 *   Fifth Floor, Boston, MA  02110-1301, USA                              *
20
 *                                                                         *
21
 ***************************************************************************/
22

23
#include "PreCompiled.h"
24
#ifndef _PreComp_
25
#include <sstream>
26
#endif
27

28
#include "Edge.h"
29
#include "Mesh.h"
30

31

32
using namespace Mesh;
33

34
Edge::Edge()  // NOLINT
35
    : Mesh(nullptr)
36
{
37
    for (int i = 0; i < 2; i++) {
38
        PIndex[i] = MeshCore::POINT_INDEX_MAX;
39
        NIndex[i] = MeshCore::FACET_INDEX_MAX;
40
    }
41
}
42

43
Edge::Edge(const Edge& e)  // NOLINT
44
    : MeshCore::MeshGeomEdge(e)
45
    , Index(e.Index)
46
    , Mesh(e.Mesh)
47
{
48
    for (int i = 0; i < 2; i++) {
49
        PIndex[i] = e.PIndex[i];
50
        NIndex[i] = e.NIndex[i];
51
    }
52
}
53

54
Edge::Edge(Edge&& e)  // NOLINT
55
    : MeshCore::MeshGeomEdge(e)
56
    , Index(e.Index)
57
    , Mesh(e.Mesh)
58
{
59
    for (int i = 0; i < 2; i++) {
60
        PIndex[i] = e.PIndex[i];
61
        NIndex[i] = e.NIndex[i];
62
    }
63
}
64

65
Edge::~Edge() = default;
66

67
Edge& Edge::operator=(const Edge& e)
68
{
69
    MeshCore::MeshGeomEdge::operator=(e);
70
    Mesh = e.Mesh;
71
    Index = e.Index;
72
    for (int i = 0; i < 2; i++) {
73
        PIndex[i] = e.PIndex[i];
74
        NIndex[i] = e.NIndex[i];
75
    }
76

77
    return *this;
78
}
79

80
Edge& Edge::operator=(Edge&& e)
81
{
82
    MeshCore::MeshGeomEdge::operator=(e);
83
    Mesh = e.Mesh;
84
    Index = e.Index;
85
    for (int i = 0; i < 2; i++) {
86
        PIndex[i] = e.PIndex[i];
87
        NIndex[i] = e.NIndex[i];
88
    }
89

90
    return *this;
91
}
92

93
void Edge::unbound()
94
{
95
    Index = -1;
96
    Mesh = nullptr;
97
}
98

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.