Newer
Older
/*
* Copyright (c) 2015 Tricoire Sebastien 3dsman@free.fr
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*
*/
#include "OE_pattern.h"
OE_pattern::OE_pattern(std::vector<vector_2d> _pts, bool _endPoints, std::string _name)
void OE_pattern::persist(Pakal::Archive* archive)
{
archive->value("pts", pts);
archive->value("endPoints", endPoints);
archive->value("name", name);
}
std::list<OE_pattern*> OE_pattern::createStandardPatterns()
{
std::list<OE_pattern*> standardPattern;
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
standardPattern.push_back(new OE_pattern({vector_2d(0, 0)}, false, "straight"));
standardPattern.push_back(new OE_pattern({vector_2d(0, 0),
vector_2d(1, 0),
vector_2d(0, 0)}, false, "triple straight"));
standardPattern.push_back(new OE_pattern({vector_2d(0, 0.5),
vector_2d(0.5, -0.5)}, false, "satin"));
standardPattern.push_back(new OE_pattern({vector_2d(0, -0.5),
vector_2d(0, 0.5)}, false, "stretch"));
standardPattern.push_back(new OE_pattern({vector_2d(0, -0.5),
vector_2d(0.3, 0.5),
vector_2d(0.6, -0.5)}, false, "overcast"));
standardPattern.push_back(new OE_pattern({vector_2d(0, -0.5),
vector_2d(0, 0.5),
vector_2d(0, -0.5)}, false, "applique"));
standardPattern.push_back(new OE_pattern({vector_2d(1, 0.5),
vector_2d(0.5, 0),
vector_2d(0, 0.5),
vector_2d(1, -0.5)}, false, "cross"));
standardPattern.push_back(new OE_pattern({vector_2d(0, -0.5),
vector_2d(0.5, -0.5),
vector_2d(0.5, 0.1),
vector_2d(0.3, 0.3),
vector_2d(0.5, 0.5),
vector_2d(0.7, 0.3),
vector_2d(0.5, 0.1),
vector_2d(0.5, -0.5)}, false, "applique circle"));
standardPattern.push_back(new OE_pattern({vector_2d(0.5, 0),
vector_2d(0.8, 0),
vector_2d(0.2, 0),
vector_2d(0.5, 0),
vector_2d(0.5, -0.3),
vector_2d(0.5, 0.3),
vector_2d(0.5, 0),
vector_2d(0.3, -0.2),
vector_2d(0.7, 0.2),
vector_2d(0.5, 0),
vector_2d(0.7, -0.2),
vector_2d(0.3, 0.2),
vector_2d(0.5, 0)}, false, "flower"));