Logo Search packages:      
Sourcecode: sailcut version File versions  Download package

sailmould.h

/*
 * Copyright (C) 1993-2005 Robert & Jeremy Lainé
 * See AUTHORS file for a full list of contributors.
 * 
 * $Id: sailmould.h,v 1.22 2005/09/03 14:28:58 jeremy_laine Exp $
 * 
 * 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
 */

#ifndef SAILMOULD_H
#define SAILMOULD_H

#include "geocpp/core.h"
#include <vector>

using namespace std;

/** Class used to work on sail profiles.
 *
 * @see CSailMould
 */
00034 class CProfile
{
public:
    CProfile( real rDepth=0.05, real rLeech=0.02, real rLuff=1 );
    ~CProfile()
    {}
    ;

    CProfile& operator=( const CProfile & );
    real z( real dX );

    /** Accessor for the depth */
00046     real getDepth() const
    {
        return depth;
    }
    /** Accessor for the leech */
00051     real getLeech() const
    {
        return kleech;
    }
    /** Accessor for the luff */
00056     real getLuff() const
    {
        return kluff;
    }
    /** Set the depth */
00061     void setDepth( real ndepth )
    {
        *this=CProfile(ndepth,kleech,kluff);
    }
    /** Set the leech */
00066     void setLeech( real nkleech )
    {
        *this=CProfile(depth,nkleech,kluff);
    }
    /** Set the luff */
00071     void setLuff( real nkluff )
    {
        *this=CProfile(depth,kleech,nkluff);
    }

protected:
    void calcMax();

    // member variables
    /** depth */
00081     real depth;
    /** leech coefficient */
00083     real kleech;
    /** luff coefficient */
00085     real kluff;
    /** x location of maximum z */
00087     real xmax;
    /** maximum z */
00089     real zmax;
};


/** Class used to store the profile for a sail.
 *
 * see CFormMould, CProfile
 */
00097 class CSailMould
{
public:
    CSailMould();
    ~CSailMould()
    {}
    ;

    CSailMould & operator=( const CSailMould & );
    CProfile interpol( const real h ) const;

    /** the mould's profiles (top, middle, bottom) */
    //  CProfile profile[3];
00110     vector<CProfile> profile;
    /** vertical position of profile[1] in percent */
00112     int vertpos;
};

#endif

Generated by  Doxygen 1.6.0   Back to index