src/linetypes/conditionaledge.h

Tue, 13 Feb 2018 14:56:08 +0200

author
Santeri Piippo
date
Tue, 13 Feb 2018 14:56:08 +0200
changeset 1242
725cb1084044
parent 1141
7dc2c981937e
child 1251
e75cc5bff076
permissions
-rw-r--r--

Removed LDConditionalEdge::becomeEdgeLine

1141
7dc2c981937e Split LDConditionalEdge and LDEdgeLine into new source pairs
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
1 /*
7dc2c981937e Split LDConditionalEdge and LDEdgeLine into new source pairs
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
2 * LDForge: LDraw parts authoring CAD
7dc2c981937e Split LDConditionalEdge and LDEdgeLine into new source pairs
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
3 * Copyright (C) 2013 - 2017 Teemu Piippo
7dc2c981937e Split LDConditionalEdge and LDEdgeLine into new source pairs
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
4 *
7dc2c981937e Split LDConditionalEdge and LDEdgeLine into new source pairs
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
5 * This program is free software: you can redistribute it and/or modify
7dc2c981937e Split LDConditionalEdge and LDEdgeLine into new source pairs
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
6 * it under the terms of the GNU General Public License as published by
7dc2c981937e Split LDConditionalEdge and LDEdgeLine into new source pairs
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
7 * the Free Software Foundation, either version 3 of the License, or
7dc2c981937e Split LDConditionalEdge and LDEdgeLine into new source pairs
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
8 * (at your option) any later version.
7dc2c981937e Split LDConditionalEdge and LDEdgeLine into new source pairs
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
9 *
7dc2c981937e Split LDConditionalEdge and LDEdgeLine into new source pairs
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
10 * This program is distributed in the hope that it will be useful,
7dc2c981937e Split LDConditionalEdge and LDEdgeLine into new source pairs
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
7dc2c981937e Split LDConditionalEdge and LDEdgeLine into new source pairs
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7dc2c981937e Split LDConditionalEdge and LDEdgeLine into new source pairs
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
13 * GNU General Public License for more details.
7dc2c981937e Split LDConditionalEdge and LDEdgeLine into new source pairs
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
14 *
7dc2c981937e Split LDConditionalEdge and LDEdgeLine into new source pairs
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License
7dc2c981937e Split LDConditionalEdge and LDEdgeLine into new source pairs
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
7dc2c981937e Split LDConditionalEdge and LDEdgeLine into new source pairs
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
17 */
7dc2c981937e Split LDConditionalEdge and LDEdgeLine into new source pairs
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
18
7dc2c981937e Split LDConditionalEdge and LDEdgeLine into new source pairs
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
19 #pragma once
7dc2c981937e Split LDConditionalEdge and LDEdgeLine into new source pairs
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
20 #include "edgeline.h"
7dc2c981937e Split LDConditionalEdge and LDEdgeLine into new source pairs
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
21
7dc2c981937e Split LDConditionalEdge and LDEdgeLine into new source pairs
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
22 /*
7dc2c981937e Split LDConditionalEdge and LDEdgeLine into new source pairs
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
23 * Represents a single code-5 conditional line.
7dc2c981937e Split LDConditionalEdge and LDEdgeLine into new source pairs
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
24 */
7dc2c981937e Split LDConditionalEdge and LDEdgeLine into new source pairs
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
25 class LDConditionalEdge : public LDEdgeLine
7dc2c981937e Split LDConditionalEdge and LDEdgeLine into new source pairs
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
26 {
7dc2c981937e Split LDConditionalEdge and LDEdgeLine into new source pairs
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
27 public:
7dc2c981937e Split LDConditionalEdge and LDEdgeLine into new source pairs
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
28 static constexpr LDObjectType SubclassType = LDObjectType::ConditionalEdge;
7dc2c981937e Split LDConditionalEdge and LDEdgeLine into new source pairs
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
29
7dc2c981937e Split LDConditionalEdge and LDEdgeLine into new source pairs
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
30 virtual LDObjectType type() const override
7dc2c981937e Split LDConditionalEdge and LDEdgeLine into new source pairs
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
31 {
7dc2c981937e Split LDConditionalEdge and LDEdgeLine into new source pairs
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
32 return SubclassType;
7dc2c981937e Split LDConditionalEdge and LDEdgeLine into new source pairs
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
33 }
7dc2c981937e Split LDConditionalEdge and LDEdgeLine into new source pairs
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
34
7dc2c981937e Split LDConditionalEdge and LDEdgeLine into new source pairs
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
35 virtual QString asText() const override;
7dc2c981937e Split LDConditionalEdge and LDEdgeLine into new source pairs
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
36 virtual void invert() override;
7dc2c981937e Split LDConditionalEdge and LDEdgeLine into new source pairs
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
37 int numVertices() const override { return 4; }
7dc2c981937e Split LDConditionalEdge and LDEdgeLine into new source pairs
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
38 LDColor defaultColor() const override { return EdgeColor; }
7dc2c981937e Split LDConditionalEdge and LDEdgeLine into new source pairs
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
39 QString typeName() const override { return "condline"; }
7dc2c981937e Split LDConditionalEdge and LDEdgeLine into new source pairs
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
40
7dc2c981937e Split LDConditionalEdge and LDEdgeLine into new source pairs
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
41 protected:
7dc2c981937e Split LDConditionalEdge and LDEdgeLine into new source pairs
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
42 friend class Model;
7dc2c981937e Split LDConditionalEdge and LDEdgeLine into new source pairs
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
43 LDConditionalEdge (Model* model);
7dc2c981937e Split LDConditionalEdge and LDEdgeLine into new source pairs
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
44 LDConditionalEdge (const Vertex& v0, const Vertex& v1, const Vertex& v2, const Vertex& v3, Model* model = nullptr);
7dc2c981937e Split LDConditionalEdge and LDEdgeLine into new source pairs
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
45 };

mercurial