]> Shamusworld >> Repos - architektonas/blob - src/base/rs_linetypepattern.h
Initial import
[architektonas] / src / base / rs_linetypepattern.h
1 /****************************************************************************
2 ** $Id: rs_linetypepattern.h 1676 2003-08-08 14:05:26Z andrew $
3 **
4 ** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
5 **
6 ** This file is part of the qcadlib Library project.
7 **
8 ** This file may be distributed and/or modified under the terms of the
9 ** GNU General Public License version 2 as published by the Free Software
10 ** Foundation and appearing in the file LICENSE.GPL included in the
11 ** packaging of this file.
12 **
13 ** Licensees holding valid qcadlib Professional Edition licenses may use 
14 ** this file in accordance with the qcadlib Commercial License
15 ** Agreement provided with the Software.
16 **
17 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
18 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
19 **
20 ** See http://www.ribbonsoft.com for further details.
21 **
22 ** Contact info@ribbonsoft.com if any conditions of this licensing are
23 ** not clear to you.
24 **
25 **********************************************************************/
26
27
28 #ifndef RS_LINETYPEPATTERN_H
29 #define RS_LINETYPEPATTERN_H
30
31 #include <stdarg.h>
32
33 /**
34  * Stores a line type pattern.
35  */
36 class RS_LineTypePattern {
37 public:
38     RS_LineTypePattern(int count ...) {
39         va_list ap;
40         int i=0;
41         num = count;
42
43         va_start(ap, count);
44         pattern = new double[num];
45         for (i=0; i<count; i++) {
46             pattern[i] = va_arg(ap, double);
47         }
48         va_end(ap);
49     }
50
51     ~RS_LineTypePattern() {
52         delete[] pattern;
53     }
54
55 public:
56     double* pattern;
57     int num;
58 };
59
60 // Create line patterns
61 static RS_LineTypePattern patternSolidLine(1, 10.0);
62
63 static RS_LineTypePattern patternDotLine(2, 0.1, -6.2);
64 static RS_LineTypePattern patternDotLine2(2, 0.1, -3.1);
65 static RS_LineTypePattern patternDotLineX2(2, 0.1, -12.4);
66
67 static RS_LineTypePattern patternDashLine(2, 12.0, -6.0);
68 static RS_LineTypePattern patternDashLine2(2, 6.0, -3.0);
69 static RS_LineTypePattern patternDashLineX2(2, 24.0, -12.0);
70
71 static RS_LineTypePattern patternDashDotLine(4, 12.0, -5.95, 0.1, -5.95);
72 static RS_LineTypePattern patternDashDotLine2(4, 6.0, -2.95, 0.1, -2.95);
73 static RS_LineTypePattern patternDashDotLineX2(4, 24.0, -11.95, 0.1, -11.95);
74
75 static RS_LineTypePattern patternDivideLine(
76     6, 12.0, -5.9, 0.15, -5.9, 0.15, -5.9);
77 static RS_LineTypePattern patternDivideLine2(
78     6, 6.0, -2.9, 0.15, -2.9, 0.15, -2.9);
79 static RS_LineTypePattern patternDivideLineX2(
80     6, 24.0, -11.9, 0.15, -11.9, 0.15, -11.9);
81         
82 static RS_LineTypePattern patternCenterLine(4, 32.0, -6.0, 6.0, -6.0);
83 static RS_LineTypePattern patternCenterLine2(4, 16.0, -3.0, 3.0, -3.0);
84 static RS_LineTypePattern patternCenterLineX2(4, 64.0, -12.0, 12.0, -12.0);
85
86 static RS_LineTypePattern patternBorderLine(
87         6, 12.0, -6.0, 12.0, -5.95, 0.1, -5.95);
88 static RS_LineTypePattern patternBorderLine2(
89         6, 6.0, -3.0, 6.0, -2.95, 0.1, -2.95);
90 static RS_LineTypePattern patternBorderLineX2(
91         6, 24.0, -12.0, 24.0, -11.95, 0.1, -11.95);
92
93 static RS_LineTypePattern patternBlockLine(2, 0.5, -0.5);
94 static RS_LineTypePattern patternSelected(2, 1.0, -3.0);
95
96 #endif