File: saildef.cpp

package info (click to toggle)
sailcut 1.2.4-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 3,580 kB
  • ctags: 875
  • sloc: cpp: 10,139; sh: 8,767; makefile: 176
file content (137 lines) | stat: -rw-r--r-- 3,990 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
/*
 * Copyright (C) 1993-2006 Robert & Jeremy Laine
 * See AUTHORS file for a full list of contributors.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

#include "saildef.h"


/**************************************************************************
 
                       construction / destruction
 
**************************************************************************/

/** Constructs a CSailDef object.
 */
CSailDef::CSailDef()
{
    // default values for member variables are set here
    sailType = MAINSAIL;
    sailCut = CROSS;
    sailID = "Test sail 1";

    LOA    = 7000;  // length of hull in millimetre
    foreJ  = 2000;    // base of fore triangle
    foreI  = 5500;    // height of fore triangle

    tackX  = 2100;  // longitudinal distance of main sail tack from stem in millimetre
    tackY  = 400;    // height of sail tack above stem in millimetre
    luffL  = 6250;    // in millimetre
    rake   = 200;     // in millimetre
    gaffDeg= 45;     // in degree
    gaffL  = 2500;   // in millimetre
    leechL = 8220;  // in millimetre
    footL  = 4100;   // in millimetre

    luffR  = 10;       // in millimetre // NOTE: Positive value for mast bend Negative for headstay sag
    luffRP = 45;      // in percent of luff length
    gaffR  = 150;    // in millimetre
    gaffRP = 50;     // in percent
    leechR = -120;  // in millimetre // NOTE: Negative value for hollow leech
    leechRP= 55;    // in percent
    footR  = 150;   // in millimetre // NOTE: Positive value for foot roach
    footRP = 50;    // in percent

    clothW = 900;        // in millimetre
    seamW = 13;         // in millimetre
    leechHemW = 40;  // in millimetre
    hemsW = 20;        // in millimetre

    twistDeg = 18;      // in degree
    sheetDeg = 0;

    dihedralDeg = 168;     // in degree

    nbSections = 5;      // radial sections
    nbGores = 5;         // radial gores
    nbLuffGores = 2;   // luff gores

}



/**************************************************************************
 
                               operators
 
**************************************************************************/


/** assignment operator
 * @param copy the sail definition to copy from
 * @return CSailDef&
 */
CSailDef & CSailDef::operator=( const CSailDef &copy )
{
    if (&copy == this)
    {
        CException e("CSailDef::operator= : self-assignment!");
        throw(e);
    }
    sailID = copy.sailID;
    sailCut = copy.sailCut;
    sailType = copy.sailType;

    footL = copy.footL;
    footR = copy.footR;
    footRP = copy.footRP;
    foreI = copy.foreI;
    foreJ = copy.foreJ;
    gaffDeg = copy.gaffDeg;
    gaffL = copy.gaffL;
    gaffR = copy.gaffR;
    gaffRP = copy.gaffRP;
    leechL = copy.leechL;
    leechR = copy.leechR;
    leechRP = copy.leechRP;
    LOA = copy.LOA;
    luffL = copy.luffL;
    luffR = copy.luffR;
    luffRP = copy.luffRP;
    mould = copy.mould;
    rake = copy.rake;

    clothW = copy.clothW;
    seamW = copy.seamW;
    leechHemW = copy.leechHemW;
    hemsW = copy.hemsW;
    tackX = copy.tackX;
    tackY = copy.tackY;

    twistDeg = copy.twistDeg;
    sheetDeg = copy.sheetDeg;

    dihedralDeg = copy.dihedralDeg;

    nbSections = copy.nbSections;
    nbGores = copy.nbGores;
    nbLuffGores = copy.nbLuffGores;

    return *this;
}