### 9.5.5. Source Code

The source code listed in the following sections is for reference only and is superseded by the files included with the installation.

This source code is protected by a license agreement.

Source code is listed for the following header files:

- Source Code: bgUserIO.h
- Source Code: BgArr.h
- Source Code: BgMLDat.h
- Source Code: BgModel.h
- Source Code: BgBlade.h
- Source Code: BgFilingData.h
- Source Code: BgSpanDef.h
- Source Code: xMsg.h

#### 9.5.5.1. Source Code: bgUserIO.h

    // bgUserIO.h

    #include "BgModel.h"

    //=================================================================================================
    // UserIO Interface Routines

    enum FileType {
    		NoFile,						// no interface available
    		SingleFile,		// pszUserPath will include the filename and extension.
    		FixedFiles,		// pszUserPath will specify the directory only.
    		MultiFile,				// pszUserPath will include the filename and extension,
    										//    but more than one file will be saved.

    };

    // User must create these data items
    extern const int						g_iOrder;				// Controls location in menu.  Group by 10, 20, ... Index by 1, 2, ...
    extern const FileType				g_eImport;
    extern const FileType				g_eExport;
    extern const char						g_szFileDesc[64];		// ex: "My File"
    extern const char						g_szFileType[16];		// ex: "myf", no period
    extern const int						g_nErrorMsg;
    extern const char		**				g_ppszErrorMsg;

    // User must define these functions.  Return -1 if not implemented.
    // int UserImport( const char *pszUserPath, BgModel &Model );
    // int UserExport( const char *pszUserPath, const char *pszBladeGenFileName, BgModel &Model );

#### 9.5.5.2. Source Code: BgArr.h

Declared Classes:

BgArr

Source

    // BgArr.h  -  JMC  -  1/7/96

    #ifndef BgArr_h
    #define BgArr_h

    #include "xMsg.h"

    #include <string.h>
    #include <stdlib.h>
    #include <iostream.h>

    #define MAXINT 32767

    /**# :[Description = "This template class acts as a resizeable array.  All objects in the array are stored as pointers to objects.  It is a simplified version of the basic BladeGen array."] */

    template<class T>
    class BgArr
    {
    public:
    		typedef T*		PT;

    protected:
    		bool		m_bOwnsObjs;
    		int		m_nObj;
    		int		m_nGrowBy;
    		int		m_nObjMax;
    		PT				*m_ppObj;

    private:
    		bool		m_bDirty;

    public:
    		/**# :[Description = "Basic Constructor."] */
    		BgArr( int nMax=16, bool bOwns=true ) {
    				m_bOwnsObjs		= bOwns;
    				m_nObj				= 0;
    				m_nGrowBy		= nMax;
    				m_nObjMax		= nMax;
    				m_ppObj				= NULL;
    				Flush();
    				SetDirty( true );
    		}
    		/**# :[Description = "Constructor from another BgArr<T> object. WARNING: Does not copy data, only settings."] */

    BgArr( const BgArr& O ) {
    				m_bOwnsObjs		= O.m_bOwnsObjs;
    				m_nObj				= 0;
    				m_nGrowBy		= O.m_nGrowBy;
    				m_nObjMax		= O.m_nObjMax;
    				m_ppObj				= NULL;
    				Flush();
    				SetDirty( true );
    		}

    		/**# :[Description = "Assignment operator from another BgArr<T> object. WARNING: Does not copy data, only settings."] */
    		BgArr &operator=( const BgArr& O ) {
    				Flush();
    				m_bOwnsObjs		=		O.m_bOwnsObjs;
    				m_nGrowBy		=		O.m_nGrowBy;
    				m_nObjMax		=		O.m_nObjMax;
    				SetDirty( true );
    				return *this;
    		}
    		/**# :[Description = "Virtual Destructor."] */
    		virtual ~BgArr();

    		/**# :[Description = "Function prepends the specified values to this array."] */
    		virtual BgArr &Prepend( BgArr &A );
    		/**# :[Description = "Function appends the specified values to this array."] */
    		virtual BgArr &Append( BgArr &A );

    		/**# :[Description = "Operator returns a reference to the value at the specified index."] */

    T* operator[]( int n ) {
    				if ( n<m_nObj ) return m_ppObj[n];
    				return NULL;
    		}
    		/**# :[Description = "Operator returns a constant reference to the value at the specified index."] */
    		const T* operator[]( int n ) const {
    				if ( n<m_nObj ) return m_ppObj[n];
    				return NULL;
    		}

    		/**# :[Description = "Function returns a reference to the first value of the array."] */
    		T* First() const {
    				if ( !m_nObj ) return NULL;

    return m_ppObj[0];
    		}
    		/**# :[Description = "Function returns a reference to the last value of the array."] */
    		T* Last() const {
    				if ( !m_nObj ) return NULL;
    				return m_ppObj[m_nObj-1];
    		}

    		/**# :[Description = "Function returns the status of the dirty value.  This value is set whenever the array is modified (added or removing objects)."] */
    		bool Dirty() const {
    				return m_bDirty;
    		}
    		/**# :[Description = "Function sets the status of the dirty value.  This value is set whenever the array is modified (added or removing objects)."] */

    virtual void SetDirty( bool bVal = true ) {
    				m_bDirty = bVal;
    		}

    		/**# :[Description = "Function returns the status of the owns object value.  This value is indicates if the objects are destroyed when the array is destroyed."] */
    		bool OwnsObjs() const {
    				return m_bOwnsObjs;
    		}
    		/**# :[Description = "Function sets the status of the owns object value.  This value is indicates if the objects are destroyed when the array is destroyed."] */

    void SetOwnsObjs( bool bOwns ) {
    				m_bOwnsObjs = bOwns;
    		}

    		/**# :[Description = "Function returns the number of objects contained in the array."] */
    		int Count() const {
    				return m_nObj;
    		}
    		/**# :[Description = "Function returns the number of objects that the array will grow by when objects are added."] */
    		int GrowBy() const {
    				return m_nGrowBy;
    		}

    		/**# :[Description = "Function returns a reference to the value at the specified index."] */

    T* ItemAt( int n ) {
    				if ( n<m_nObj ) return m_ppObj[n];
    				return NULL;
    		}
    		/**# :[Description = "Function returns a reference to the value at the specified index."] */
    		T* ItemAt( int n ) const {
    				if ( n<m_nObj ) return m_ppObj[n];
    				return NULL;
    		}

    		/**# :[Description = "Function returns true of the array contains the object (by memory address)."] */
    		virtual bool Has( const T *pObj ) const {
    				return ( Find( pObj )!=MAXINT );

    }
    		/**# :[Description = "Function returns index to the specified object (by memory address).  Returns MAXINT if object was not found."] */
    		virtual int Find( const T *pObj ) const;

    		/**# :[Description = "Function adds the object to the array."] */
    		virtual bool Add( T *pObj );
    		/**# :[Description = "Function adds the object to the array at the position specified."] */
    		virtual bool AddAt( int n, T *pObj );

    		/**# :[Description = "Function removed the object at the specified index from the array."] */

    virtual bool Detach( int n );
    		/**# :[Description = "Function removed the object from the array."] */
    		virtual bool Detach( T *pObj ) {
    				return Detach( Find( pObj ) );
    		}

    		/**# :[Description = "Function removed the object at the specified index from the array and destroys it."] */
    		virtual bool Destroy( int n ) {
    				if ( n>=m_nObj ) return false;
    				T *pObj = m_ppObj[n];
    				Detach( n );
    				delete pObj;

    				SetDirty( true );

    return true;
    		}
    		/**# :[Description = "Function removed the object from the array and destroys it."] */
    		virtual bool Destroy( T *pObj ) {
    				return Destroy( Find( pObj ) );
    		}

    		/**# :[Description = "Function removes all object from the array.  If the bOwnsObjs flag is set, the objects are destroyed as well."] */
    		void Flush();

    		/**# :[Description = "Function reverses the order of the objects in the array."] */
    		void ReverseOrder();

    };

    /**# implementation BgArr:: id(C_1022270469) */

    template<class T>
    BgArr<T>::~BgArr()
    {
    		if ( m_bOwnsObjs ) {
    				while ( m_nObj ) {
    						delete m_ppObj[ --m_nObj ];
    				}
    		}
    		delete [] m_ppObj;
    }

    template<class T>
    BgArr<T> &BgArr<T>::Prepend( BgArr &A )
    {
    		m_nObjMax = ((m_nObj+A.m_nObj)/m_nGrowBy+1)*m_nGrowBy;
    		PT *ppNew = new PT[m_nObjMax];
    		int i, j;
    		for ( i=0; i<A.m_nObj; i++ ) {
    				ppNew[i] = A.m_ppObj[i];

    }
    		for ( i=A.m_nObj, j=0; j<m_nObj; i++, j++ ) {
    				ppNew[i] = m_ppObj[j];
    		}
    		delete [] m_ppObj;
    		m_ppObj = ppNew;
    		m_nObj += A.m_nObj;

    		delete [] A.m_ppObj;
    		A.m_ppObj = new PT[A.m_nGrowBy];
    		A.m_nObj = 0;
    		A.m_nObjMax = A.m_nGrowBy;

    		SetDirty( true );

    		return *this;
    }

    template<class T>
    BgArr<T> &BgArr<T>::Append( BgArr &A )
    {
    		m_nObjMax = ((m_nObj+A.m_nObj)/m_nGrowBy+1)*m_nGrowBy;
    		PT *ppNew = new PT[m_nObjMax];

    int i, j;
    		for ( i=0; i<m_nObj; i++ ) {
    				ppNew[i] = m_ppObj[i];
    		}
    		for ( i=m_nObj, j=0; j<A.m_nObj; i++, j++ ) {
    				ppNew[i] = A.m_ppObj[j];
    		}
    		delete [] m_ppObj;
    		m_ppObj = ppNew;
    		m_nObj += A.m_nObj;

    		delete [] A.m_ppObj;
    		A.m_ppObj = new PT[A.m_nGrowBy];
    		A.m_nObj = 0;
    		A.m_nObjMax = A.m_nGrowBy;

    		SetDirty( true );

    		return *this;
    }

    template<class T>
    void BgArr<T>::ReverseOrder()
    {
    		PT *ppNew = new PT[m_nObjMax];

    for ( int i=0, j=m_nObj-1; i<m_nObj; i++, j-- ) {
    				ppNew[i] = m_ppObj[j];
    		}
    		delete [] m_ppObj;
    		m_ppObj = ppNew;

    		SetDirty( true );
    }

    template<class T>
    bool BgArr<T>::Add( T *pObj )
    {
    		if ( m_nObj>=m_nObjMax ) {
    				PT *ppOld = m_ppObj;
    				m_nObjMax += m_nGrowBy;
    				m_ppObj = new PT[m_nObjMax];
    				for ( int i=0; i<m_nObj; i++ ) {
    						m_ppObj[i] = ppOld[i];
    				}
    				delete [] ppOld;
    		}

    // add pObj into array
    		m_ppObj[m_nObj++] = pObj;

    		SetDirty( true );

    		return true;
    }

    template<class T>
    bool BgArr<T>::AddAt( int n, T *pObj )
    {
    		if ( m_nObj>=m_nObjMax ) {
    				PT *ppOld = m_ppObj;
    				m_nObjMax += m_nGrowBy;
    				m_ppObj = new PT[m_nObjMax];
    				for ( int i=0; i<m_nObj; i++ ) {
    						m_ppObj[i] = ppOld[i];
    				}
    				delete [] ppOld;
    		}
    		if ( n<m_nObj ) {
    				// make space for object

    PT		*pD = &(m_ppObj[m_nObj]);
    				PT		*pS = &(m_ppObj[m_nObj-1]);
    				PT		*pE = &(m_ppObj[n]);
    				while ( pS>pE ) {
    						*(pD--) = *(pS--);
    				}
    				if ( pS==pE ) {
    						*pD = *pS;
    				}
    		}
    		// add pObj into array
    		m_ppObj[n] = pObj;
    		m_nObj++;

    		SetDirty( true );

    		return true;
    }

    template<class T>
    bool BgArr<T>::Detach( int n )
    {
    		if ( n>=m_nObj ) return false;
    		PT		*pD = &(m_ppObj[n]);

    PT		*pS = &(m_ppObj[n+1]);
    		PT		*pE = &(m_ppObj[m_nObj]);
    		while ( pS<pE ) {
    				*(pD++) = *(pS++);
    		}
    		m_nObj--;

    		SetDirty( true );

    		return true;
    }

    template<class T>
    int BgArr<T>::Find( const T *pObj ) const
    {
    		if ( !pObj ) return MAXINT;
    		for ( int i=0; i<m_nObj; i++ ) {
    				if ( pObj==m_ppObj[i] ) return i;
    		}
    		return MAXINT;
    }

    template<class T>
    void BgArr<T>::Flush()
    {
    		if ( m_bOwnsObjs ) {

    while ( m_nObj ) {
    						delete m_ppObj[--m_nObj];
    				}
    		}
    		delete [] m_ppObj;
    		m_nObj = 0;
    		m_nObjMax = m_nGrowBy;
    		m_ppObj = new PT[m_nObjMax];
    		for ( int n=0; n<m_nObjMax; n++ ) {
    				m_ppObj[n] = NULL;
    		}

    		SetDirty( true );
    }

    #endif		//		BgArr_h

#### 9.5.5.3. Source Code: BgMLDat.h

Declared Classes:

BgEnum

Bg3dPnt

BgMLDat

BgMLDatArr

BgMLDatArrArr

BgMLDatArrArrArr

Source

    // BgMLDat.h: interface for the BgMLDat class.
    //
    //////////////////////////////////////////////////////////////////////

    #if !defined(AFX_BGMLDAT_H__92F34EE5_264E_4C9F_AD69_C0452C30F4E3__INCLUDED_)
    #define AFX_BGMLDAT_H__92F34EE5_264E_4C9F_AD69_C0452C30F4E3__INCLUDED_

    #if _MSC_VER > 1000
    #pragma once
    #endif // _MSC_VER > 1000

    //#include "BladeData.h"
    #include "BgArr.h"

    #include <math.h>

    typedef unsigned int uint;

    #define M_2_PI		6.28318530717959647692

    #define M_PI		3.14159265358979323846
    #define M_PI_2		1.57079632679489661923
    #define M_PI_4		0.78539816339744830962

    /**# :[Description = "This class contains the common enumerators and static variables for the UserIO classes."] */

    class BgEnum
    {
    public:
    		enum AngDatType { Side1Ang=-1, MeanLineAng=0, Side2Ang=1 };
    		enum ThkDatType { TangMeanThk, NormMeanThk, NormCambThk };
    		enum DataSetType { AngData=0x01, ThkData=0x02, AllData=0x03 };

    		enum LeTeEndType { SquareEnd, CutOffEnd, EllipseEnd };

    enum HubShrEndType { PlainEnd, GapEnd, FilletEnd };
    };

    /**# :[Description = "This class describes a 3 Dimensional Cartisian point.  Basic operators are provided to allow addition, subtraction, and scaling.  Basic functions are provided."] */

    class Bg3dPnt
    {
    public:
    		double		dX;
    		double		dY;
    		double		dZ;
    public:
    		Bg3dPnt( const double &x=0.0, const double &y=0.0, const double &z=0.0 ) {
    				dX = x;		dY = y;		dZ = z;
    		}

    		/**# :[Description = "Adds two Bg3dPnt objects together."] */

    Bg3dPnt operator+ ( const Bg3dPnt& P ) const {
    				return Bg3dPnt( dX+P.dX, dY+P.dY, dZ+P.dZ );
    		}
    		/**# :[Description = "Subtracts a Bg3dPnt object from another."] */
    		Bg3dPnt operator- ( const Bg3dPnt& P ) const {
    				return Bg3dPnt( dX-P.dX, dY-P.dY, dZ-P.dZ );
    		}
    		/**# :[Description = "Multiplies a Bg3dPnt object by a factor."] */
    		Bg3dPnt operator* ( const double& dFac ) const {
    				return Bg3dPnt( dX*dFac, dY*dFac, dZ*dFac );

    }
    		/**# :[Description = "Divides a Bg3dPnt object by a factor."] */
    		Bg3dPnt operator/ ( const double& dFac ) const {
    				if ( dFac ) {
    						return Bg3dPnt( dX/dFac, dY/dFac, dZ/dFac );
    				} else {
    						return Bg3dPnt();
    				}
    		}

    		/**# :[Description = "Multiplies a Bg3dPnt object by a factor."] */
    		friend Bg3dPnt operator* ( const double &dFac, const Bg3dPnt &V ) {
    				return V*dFac;
    		}
    		/**# :[Description = "Divides a Bg3dPnt object by a factor."] */

    friend Bg3dPnt operator/ ( const double &dFac, const Bg3dPnt &V ) {
    				return V/dFac;
    		}

    		/**# :[Description = "Adds a Bg3dPnt object to this object."] */
    		Bg3dPnt &operator+= ( const Bg3dPnt& P ) {
    				dX+=P.dX;  dY+=P.dY;  dZ+=P.dZ;
    				return *this;
    		}
    		/**# :[Description = "Subtracts a Bg3dPnt object from this object."] */
    		Bg3dPnt &operator-= ( const Bg3dPnt& P ) {
    				dX-=P.dX;  dY-=P.dY;  dZ-=P.dZ;
    				return *this;

    }
    		/**# :[Description = "Multiplies this object by a factor."] */
    		Bg3dPnt &operator*= ( const double& dFac ) {
    				dX*=dFac; dY*=dFac; dZ*=dFac;
    				return *this;
    		}
    		/**# :[Description = "Divides this object by a factor."] */
    		Bg3dPnt &operator/= ( const double& dFac ) {
    				if ( dFac==0.0 ) {
    						dX = dY = dZ = 1.0;
    				} else {
    						dX/=dFac; dY/=dFac; dZ/=dFac;
    				}
    				return *this;
    		}

    		/**# :[Description = "Urary negative, returns the negative of this object."] */

    Bg3dPnt operator-() const {
    				return Bg3dPnt( -dX, -dY, -dZ );
    		}

    		/**# :[Description = "Function to return the length of a line from the origin to this point."] */
    		double Magnitude() const {
    				return sqrt( dX*dX + dY*dY + dZ*dZ );
    		}
    		/**# :[Description = "Friend function to return the length of a line from the origin to this point."] */
    		friend double Magnitude( const Bg3dPnt& V ) {
    				return sqrt( V.dX*V.dX + V.dY*V.dY + V.dZ*V.dZ );

    }
    		/**# :[Description = "Friend function to return the square of the length of a line from the origin to this point."] */
    		friend double Magnitude2( const Bg3dPnt& V ) {
    				return ( V.dX*V.dX + V.dY*V.dY + V.dZ*V.dZ );
    		}
    		/**# :[Description = "Friend function to return the length of a line between two Bg3dPnt objects."] */
    		friend double Dist( const Bg3dPnt& V1, const Bg3dPnt& V2 ) {
    				return ::Magnitude( V2-V1 );
    		}

    		/**# :[Description = "Function to scale the object to a unit vector."] */

    Bg3dPnt &Normalized() {
    				double dLen = sqrt( dX*dX + dY*dY + dZ*dZ );
    				if ( dLen>0.0 ) {
    						dX /= dLen;
    						dY /= dLen;
    						dZ /= dLen;
    				}
    				return *this;
    		}
    		/**# :[Description = "Friend function to return a unit vector of the supplied object."] */
    		friend Bg3dPnt UnitVector( const Bg3dPnt& V ) {
    				double dLen = sqrt( V.dX*V.dX + V.dY*V.dY + V.dZ*V.dZ );
    				return ( dLen>1.0e-30 ? V/dLen : V );

    }

    		/**# :[Description = "Friend function to return the angle between two vectors, supplied as Bg3dPnt objects."] */
    		friend double AngleBetween( const Bg3dPnt &V1, const Bg3dPnt &V2 ) {
    				double dM = V1.Magnitude()*V2.Magnitude();
    				if ( dM==0.0 )		return 0.0;
    				return acos( min( (double)max( DotProduct(V1,V2)/dM, -1.0), 1.0) );
    		}
    		/**# :[Description = "Friend function to return the dot product of two vectors, supplied as Bg3dPnt objects."] */

    friend double DotProduct( const Bg3dPnt& v1, const Bg3dPnt& v2 ) {
    				return( v1.dX*v2.dX + v1.dY*v2.dY + v1.dZ*v2.dZ );
    		}
    		/**# :[Description = "Friend function to return the cross product of two vectors, supplied as Bg3dPnt objects."] */
    		friend Bg3dPnt CrossProduct( const Bg3dPnt& v1, const Bg3dPnt& v2 ) {
    				return Bg3dPnt( v1.dY*v2.dZ - v1.dZ*v2.dY,
    														 v2.dX*v1.dZ - v1.dX*v2.dZ,
    														 v1.dX*v2.dY - v1.dY*v2.dX );

    }

    		/**# :[Description = "Function to return the result of rotating this object about the X axis by the specified angle (radians)."] */
    		Bg3dPnt RotatedAboutX( const double &dAng ) const {
    				return Bg3dPnt( dX, dY*cos(dAng)-dZ*sin(dAng), dY*sin(dAng)+dZ*cos(dAng) );
    		}
    		/**# :[Description = "Function to return the result of rotating this object about the Y axis by the specified angle (radians)."] */
    		Bg3dPnt RotatedAboutY( const double &dAng ) const {

    return Bg3dPnt( dX*cos(dAng)+dZ*sin(dAng), dY, dZ*cos(dAng)-dX*sin(dAng) );
    		}
    		/**# :[Description = "Function to return the result of rotating this object about the Z axis by the specified angle (radians)."] */
    		Bg3dPnt RotatedAboutZ( const double &dAng ) const {
    				return Bg3dPnt( dX*cos(dAng)-dY*sin(dAng), dX*sin(dAng)+dY*cos(dAng), dZ );
    		}
    };

    /**# :[Description = "This class describes a mean line data point.  The location is stored in Cylindrical coordinates and meridional coordinates are also provided."] */

    class AFX_EXT_CLASS BgMLDat
    {
    public:
    		enum { nVer=1 };

    		// Import Variables
    		double		dR;
    		double		dTheta;
    		double		dZ;
    		double		dNrmThk;
    		bool				bSharp;

    		// Export Variables
    		double		dBeta;
    		double		dS;
    		double		dM;
    		double		dMp;
    		double		dC;
    		double		dSec;

    public:
    		/**# :[Description = "Basic constructor for BgMLDat object from individual values."] */
    		BgMLDat( const double &dZi=0.0, const double &dRi=0.0, const double &dThetai=0.0,

    const double &dNrmThki=0.0, const double &dBetai=0.0,
    				const double &dSi=0.0, const double &dMi=0.0, const double &dMpi=0.0, const double &dCi=0.0,
    				const double &dSeci=0.0, bool bSharpi=false );
    		/**# :[Description = "Basic constructor for BgMLDat object another object."] */
    		BgMLDat( const BgMLDat &mlDat );

    		/**# :[Description = "Assignment operator."] */
    		BgMLDat &operator=( const BgMLDat &mlDat );

    		/**# :[Description = "Conversion operator returns a Bg3dPnt from a BgMLDat."] */

    operator Bg3dPnt() {
    				return Bg3dPnt( dR*cos(dTheta), dR*sin(dTheta), dZ );
    		}

    		/**# :[Description = "Function returns R*Theta."] */
    		double RT() const {
    				return dR*dTheta;
    		}
    		/**# :[Description = "Function returns R*(Theta-ThetaRef)."] */
    		double RT( const double &dThetaRef ) const {
    				return dR*(dTheta-dThetaRef);
    		}

    		/**# :[Description = "Friend function returns the Blade-to-Blade (M-Prime vs. Theta or M vs R*Theta) distance between to BgMLDat objects."] */

    friend double B2BDist( const BgMLDat &mlD1, const BgMLDat &mlD2, bool bTrueB2B = false ) {
    				double dX = ( bTrueB2B ? mlD1.dMp - mlD2.dMp : mlD1.dM - mlD2.dM );
    				double dTa = ( mlD1.dTheta + mlD2.dTheta )/2.0;
    				double dY = ( bTrueB2B ? mlD1.dTheta - mlD2.dTheta : mlD1.RT( dTa ) - mlD2.RT( dTa ) );
    				return sqrt( dX*dX + dY*dY );
    		}
    		/**# :[Description = "Friend function returns the Meridional distance between to BgMLDat objects."] */

    friend double MerDist( const BgMLDat &dD1, const BgMLDat &dD2 ) {
    				BgMLDat D = dD2 - dD1;
    				return sqrt( D.dR*D.dR + D.dZ*D.dZ );
    		}

    		/**# :[Description = "Adds two BgMLDat objects together."] */
    		BgMLDat operator+( const BgMLDat &D ) const {
    				BgMLDat R;
    				R.dZ						= dZ + D.dZ;
    				R.dR						= dR + D.dR;
    				R.dTheta				= dTheta + D.dTheta;
    				R.dNrmThk		= dNrmThk+D.dNrmThk;
    				R.dBeta				= dBeta+D.dBeta;

    R.dS						= dS + D.dS;
    				R.dM						= dM + D.dM;
    				R.dMp						= dMp+ D.dMp;
    				R.dC						= dC + D.dC;
    				return R;
    		}
    		/**# :[Description = "Subtracts a BgMLDat object from another."] */
    		BgMLDat operator-( const BgMLDat &D ) const {
    				BgMLDat R;
    				R.dZ						= dZ - D.dZ;
    				R.dR						= dR - D.dR;
    				R.dTheta				= dTheta - D.dTheta;
    				R.dNrmThk		= dNrmThk-D.dNrmThk;

    R.dBeta				= dBeta-D.dBeta;
    				R.dS						= dS - D.dS;
    				R.dM						= dM - D.dM;
    				R.dMp						= dMp- D.dMp;
    				R.dC						= dC - D.dC;
    				return R;
    		}
    		/**# :[Description = "Multiplies a BgMLDat object by a factor."] */
    		BgMLDat operator*( const double &dFac ) const {
    				BgMLDat R;
    				R.dZ						= dZ*dFac;
    				R.dR						= dR*dFac;
    				R.dTheta				= dTheta*dFac;

    R.dNrmThk		= dNrmThk*dFac;
    				R.dBeta				= dBeta*dFac;
    				R.dS						= dS*dFac;
    				R.dM						= dM*dFac;
    				R.dMp						= dMp*dFac;
    				R.dC						= dC*dFac;
    				return R;
    		}

    		/**# :[Description = "Friend function to return the S value."] */
    		friend const double &Sf( const BgMLDat &Dat ) {
    				return Dat.dS;
    		}
    		/**# :[Description = "Friend function to return the M value."] */

    friend const double &Mf( const BgMLDat &Dat ) {
    				return Dat.dM;
    		}
    		/**# :[Description = "Friend function to return the M-Prime value."] */
    		friend const double &Mpf( const BgMLDat &Dat ) {
    				return Dat.dMp;
    		}
    		/**# :[Description = "Friend function to return the C value."] */
    		friend const double &Cf( const BgMLDat &Dat ) {
    				return Dat.dC;
    		}

    		// Interpolation Interface
    		/**# :[Description = "Function returns the number of variables available for interpolation."] */

    static int NumVar() {
    				return 4;
    		}
    		/**# :[Description = "Function sets a variables identified by the index to the specified value."] */
    		void SetVar( int iVar, const double &dVal ) {
    				switch ( iVar ) {
    						default:
    								break;
    						case 0:
    								dS = dVal;
    								break;
    						case 1:
    								dM = dVal;
    								break;
    						case 2:
    								dMp = dVal;

    break;
    						case 3:
    								dC = dVal;
    								break;
    				}
    		}
    		/**# :[Description = "Function returns a variables identified by the index."] */
    		const double &Var( int iVar ) const {
    				switch ( iVar ) {
    						default:
    						case 0:
    								return dS;
    						case 1:
    								return dM;
    						case 2:
    								return dMp;
    						case 3:
    								return dC;

    }
    		}

    		/**# :[Description = "Function reads a BgMLDat object from the input stream."] */
    		virtual void Read( istream &is );
    		/**# :[Description = "Function saves a BgMLDat object to the output stream."] */
    		virtual void Save( ostream &os ) const;
    };

    /**# :[Description = "This class describes a layer of mean line data points."] */

    class AFX_EXT_CLASS BgMLDatArr : public BgArr<BgMLDat>, public BgEnum
    {
    public:
    		typedef const double &(*ValueFunc)( const BgMLDat & );

    enum SideType { Side1=-1, Mean=0, Side2=1 };

    		enum { nVer=1 };

    protected:
    		ThkDatType		m_eThkDat;
    		uint						m_uiFlags;

    public:
    		/**# :[Description = "Basic Constructor."] */
    		BgMLDatArr( ThkDatType eThkDat=NormMeanThk, uint uiFlag=AllData );
    		/**# :[Description = "Constructor from another object, copies the entire array."] */
    		BgMLDatArr( const BgMLDatArr &Arr );
    		/**# :[Description = "Destructor."] */
    		virtual ~BgMLDatArr();

    /**# :[Description = "Assignment operator, copies entire array."] */
    		BgMLDatArr &operator=( const BgMLDatArr &Arr );

    		/**# :[Description = "Function uses the Ref curve and generates this mean line curve the Side1 and Side2 curves, using the specified number of points."] */
    		void CreateMeanLineFrom( const BgMLDatArr &Ref, const BgMLDatArr &Side1, const BgMLDatArr &Side2, int nPnt=30 );

    		/**# :[Description = "Function returns the flag value."] */

    uint Flags() const {
    				return m_uiFlags;
    		}
    		/**# :[Description = "Function sets the flag value."] */
    		void SetFlags( uint uiVal ) {
    				m_uiFlags = uiVal;
    		}

    		/**# :[Description = "Function returns interpolates to the nearest point to the specified point, in the Meridional (Z,R) coordinate system."] */
    		BgMLDat DatNearestMer( const BgMLDat &mlDat );
    		/**# :[Description = "Function returns interpolates to the nearest point to the specified point, in the Blade-To-Blade (Mp,Theta) coordinate system."] */

    BgMLDat DatNearestB2B( const BgMLDat &mlDat );

    		/**# :[Description = "Function interpolates to the value specified using the BgMLDat value functions (Sf, Mf, Mpf, Cf)."] */
    		BgMLDat InterpUsing( ValueFunc Value, const double &dVal );

    		/**# :[Description = "Function returns the value at the specified S position, at the SideType location."] */
    		BgMLDat DatAt( const double &dS, SideType eSide );
    		/**# :[Description = "Function returns the value at the index, at the SideType location."] */

    BgMLDat DatAt( int i, SideType eSide );

    		/**# :[Description = "Function converts mean line data to the specified SideType location."] */
    		BgMLDat ML2Cyl( const BgMLDat &mlDat, SideType eSide );

    		virtual void Read( istream &is );
    		virtual void Save( ostream &os ) const;
    };

    /**# :[Description = "This class describes an array of mean line data arrays (layers), which can represent a blade."] */

    class AFX_EXT_CLASS BgMLDatArrArr : public BgArr<BgMLDatArr>, public BgEnum

    {
    public:

    protected:
    		/**# :[Description = "Specifies the angular value type that the arrays are describing (See BgEnum)."] */
    		AngDatType		m_eAngDat;
    		/**# :[Description = "Specifies the thickness value type that the arrays are describing (See BgEnum)."] */
    		ThkDatType		m_eThkDat;

    public:
    		/**# :[Description = "Basic Constructor."] */
    		BgMLDatArrArr( AngDatType eAngDat=MeanLineAng, ThkDatType eThkDat=NormMeanThk );
    		/**# :[Description = "Constructor from another object, copies the entire array."] */

    BgMLDatArrArr( const BgMLDatArrArr &Arr );
    		/**# :[Description = "Destructor."] */
    		virtual ~BgMLDatArrArr();

    		/**# :[Description = "Assignment operator, copies entire array."] */
    		BgMLDatArrArr &operator=( const BgMLDatArrArr &Arr );

    		/**# :[Description = "Function returns the AngDatType value."] */
    		AngDatType AngDat() const {
    				return m_eAngDat;
    		}
    		/**# :[Description = "Function sets the AngDatType value."] */
    		void SetAngDat( AngDatType eType ) {

    m_eAngDat = eType;
    		}

    		/**# :[Description = "Function returns the ThkDatType value."] */
    		ThkDatType ThkDat() const {
    				return m_eThkDat;
    		}
    		/**# :[Description = "Function sets the ThkDatType value."] */
    		void SetThkDat( ThkDatType eType ) {
    				m_eThkDat = eType;
    		}

    		/**# :[Description = "Function sets the AngDatType and ThkDatType values."] */
    		void SetDatType( AngDatType eAngDat, ThkDatType eThkDat ) {
    				m_eAngDat = eAngDat;

    m_eThkDat = eThkDat;
    		}
    };

    /**# :[Description = "This class describes an array of layer arrays (blades), which can represent a blade system."] */

    class BgMLDatArrArrArr : public BgArr<BgMLDatArrArr>
    {
    public:
    		/**# :[Description = "Basic Constructor."] */
    		BgMLDatArrArrArr( int nGrow=4, bool bOwns=true ) : BgArr<BgMLDatArrArr>( nGrow, bOwns ) {}
    		/**# :[Description = "Virtual Destructor."] */
    		virtual ~BgMLDatArrArrArr() {}
    };

    #endif // !defined(AFX_BGMLDAT_H__92F34EE5_264E_4C9F_AD69_C0452C30F4E3__INCLUDED_)

#### 9.5.5.4. Source Code: BgModel.h

Declared Classes:

BgModel

    // BgModel.h: interface for the BgModel class.
    //
    //////////////////////////////////////////////////////////////////////

    #if !defined(AFX_BGMODEL_H__B6C8BEFB_CBD0_4B16_AB9C_337AADB648F8__INCLUDED_)
    #define AFX_BGMODEL_H__B6C8BEFB_CBD0_4B16_AB9C_337AADB648F8__INCLUDED_

    #if _MSC_VER > 1000
    #pragma once
    #endif // _MSC_VER > 1000

    #include "BgMLDat.h"
    #include "BgBlade.h"

    #include <iostream.h>

    class CBladeGeom;
    class CldModel;

    /**# :[Description = "This class describes a model and acts as the container of all model data.  Access for imput and output is provided through the member functions of this class."] */

    class AFX_EXT_CLASS BgModel : public BgEnum
    {
    public:
    		enum AddType { LeaveSquare=0x00, AddExtension=0x01, AddFiling=0x02, AddEnd=0x04,
    														AddTreatments=AddFiling|AddEnd };
    		enum EndType { UnknownEnd=-1, SquareEnd, CutOffEnd, EllipseEnd };

    		enum { nVer=1 };

    private:
    		/**# :[Description = "Pointer to BladeGen object."] */
    		CBladeGeom		*m_pGeom;
    		/**# :[Description = "Pointer to Layer Model object, created for periodic output only."] */

    CldModel				*m_pModel;

    public:
    		/**# :[Description = "Basic Constructor."] */
    		BgModel();
    		/**# :[Description = "Virtual Destructor."] */
    		virtual ~BgModel();

    		/**# :[Description = "Clears all data from the model."] */
    		void Clear();

    //==============================================================================================
    		// Data Import Routines
    		/**# :[Description = "Creates a Design Meridional Profile.  Returns true if successful, false if uncessessful."] */

    bool CreateDsgnMerDef( int nBladeSets, const BgBladeArr &BladeArr, bool bSafeCurveTypes=true, bool bBezierExtensions=false );
    		/**# :[Description = "Creates a Design Meridional Profile.  Returns true if successful, false if uncessessful."] */
    		bool CreateDsgnMerDef( int nBladeSets, const BgMLDatArrArrArr &MeanArrArrArr, bool bSafeCurveTypes=true, bool bBezierExtensions=false );
    		/**# :[Description = "Creates a Design Meridional Profile.  Returns true if successful, false if uncessessful."] */

    bool CreateDsgnMerDef( int nBladeSets, const BgMLDatArrArr &MeanArrArr, bool bSafeCurveTypes=true, bool bBezierExtensions=false );

    		/**# :[Description = "Creates a Design Meridional Control Curve.  Returns true if successful, false if uncessessful."] */
    		bool CreateDsgnCtrlCrv( const BgMLDatArr &Ctrl, const double &dEstS );

    		/**# :[Description = "Creates a set of blades from an array.  Returns true if successful, false if uncessessful."] */
    		bool CreateBlades( const BgBladeArr &BladeArr );

    /**# :[Description = "Creates a blade.  The first is the main blade, second is a splitter...  Returns true if successful, false if uncessessful."] */
    		bool CreateBlade( const BgBlade &Blade );

    		/**# :[Description = "Creates a Trim Meridional Definition.  Design Definition must already exist.  Returns true if successful, false if uncessessful."] */
    		bool CreateTrimMerDef( int nLayers, BgMLDatArr *pHub=NULL, BgMLDatArr *pShr=NULL );

    		/**# :[Description = "Creates a Trim Meridional Control Curve.  Returns true if successful, false if uncessessful."] */

    bool CreateTrimCtrlCrv( const BgMLDatArr &Ctrl, const double &dEstS );

    //==============================================================================================
    		// Data Export Routines

    		/**# :[Description = "Exports the blades (1 or more) for the model.  Returns true if successful, false if uncessessful."]  */
    		bool ExportBlades( BgBladeArr &BladeArr );

    		/**# :[Description = "Returns the number of blade sets (1 or more).  Equal to the number of "Main" blades."] */

    int NumBladeSets();
    		/**# :[Description = "Returns the number of blades (1 or more).  Equal to one plus the number of splitters."] */
    		int NumBlades();
    		/**# :[Description = "Returns the number of layers (2 or more).  Equal to one plus the number of splitters."] */
    		int NumLayers();

    //==============================================================================================
    		// Meanline Data Export Routines

    		// Periodic Surface Data

    /**# :[Description = "Creates a mean line data array for the periodic surface at the specified layer."] */
    		bool PeriodicLayerData( int nLayer, BgMLDatArr &DatArr );

    		// Blade Surface Data
    		/**# :[Description = "Creates a mean line data array for the specified blade at the specified layer."] */
    		bool BladeLayerData( int nBlade, int nLayer, uint uiFlags, BgMLDatArr &DatArr );

    		// Extended Blade Surface Data (from inlet to outlet)
    		/**# :[Description = "Creates a extended mean line data array for the specified blade at the specified layer.  Data extends from inlet to outlet, extensions have a thickness value of zero."] */

    bool ExBladeLayerData( int nBlade, int nLayer, uint uiFlags, BgMLDatArr &DatArr );

    		// Layer Information Routine
    		/**# :[Description = "Returns the mid length span fraction for the specified layer."] */
    		double MidLenSpanFraction( int nLayer ) const;

    		// Blade Information Routines
    		/**# :[Description = "Defines the centroid and airfoil area of the specified blade at the specified layer.  Returns true if successful, false if uncessessful."] */

    bool AreaProps( int nBlade, int nLayer, BgMLDat &mldCentroid, double &dArea );
    		/**# :[Description = "Returns the pitch fraction for the specified blade."] */
    		double PitchFraction( int nBlade ) const;

    		/**# :[Description = "Returns the type of end on the leading edge of the specified blade."] */
    		EndType BladeLeEndType( int nBlade ) const;
    		/**# :[Description = "Returns the type of end on the trailing edge of the specified blade."] */
    		EndType BladeTeEndType( int nBlade ) const;

    /**# :[Description = "Returns the number of points in the leading edge of the specified blade.  If bExtended is set to true, the number reflects the effect of the extension (if it exists)."] */
    		int NumLePoints( int nBlade, bool bExtended=false ) const;
    		/**# :[Description = "Returns the number of points in the trailing edge of the specified blade.  If bExtended is set to true, the number reflects the effect of the extension (if it exists)."] */
    		int NumTePoints( int nBlade, bool bExtended=false ) const;

    // Meridional Coordinate Export
    		/**# :[Description = "Determines the meridional coordinate (Z,R) for the meridional position (U,V).  Returns true if successful, false if uncessessful."] [Inputs = "const double &dZ, const double &dR"] [Output = "double &dU, double &dV"] */
    		bool PntAt( const double &dU, const double &dV, double &dZ, double &dR );
    		/**# :[Description = "Determines the meridional position (U,V) for the meridional coordinate (Z,R).  Returns true if successful, false if uncessessful."] [Inputs = "const double &dZ, const double &dR"] [Output = "double &dU, double &dV"] */

    bool CoordAt( const double &dZ, const double &dR, double &dU, double &dV );

    //==============================================================================================
    		// Data IO Routines
    		bool SaveBGI( const char *pszFileName );
    		bool ReadBGI( const char *pszFileName, ostream *pos=NULL, int nArg=0, char *pszArg[]=NULL );

    		bool SaveBGD( const char *pszFileName );
    		bool ReadBGD( const char *pszFileName );

    //		virtual void Read( istream &is );

    //		virtual void Save( ostream &os ) const;
    };

    #endif // !defined(AFX_BGMODEL_H__B6C8BEFB_CBD0_4B16_AB9C_337AADB648F8__INCLUDED_)

#### 9.5.5.5. Source Code: BgBlade.h

Declared Classes:

BgBlade

BgBladeArr

    // BgBlade.h: interface for the BgBlade class.
    //
    //////////////////////////////////////////////////////////////////////

    #if !defined(AFX_BGBLADE_H__A8572FBF_9999_40EC_ADA2_602C0035F2C5__INCLUDED_)
    #define AFX_BGBLADE_H__A8572FBF_9999_40EC_ADA2_602C0035F2C5__INCLUDED_

    #if _MSC_VER > 1000
    #pragma once
    #endif // _MSC_VER > 1000

    #include "BgMLDat.h"
    #include "BgSpanDef.h"
    #include "bgFilingData.h"

    /**# :[Description = "This class describes a blade through its variables and objects.  The default constructor creates a default BladeGen blade, but without data arrays."] */

    class AFX_EXT_CLASS BgBlade : public BgEnum
    {
    public:
    		enum { nVer=1 };

    protected:
    		// Blade Data
    		BgMLDatArrArr				m_Mean;
    		BgMLDatArrArr				m_Side1;
    		BgMLDatArrArr				m_Side2;

    		double								m_dPitchFrac;
    		bool										m_bSafeCurveTypes;

    		BgSpanDefAng				m_AngDef;
    		BgSpanDefThk				m_ThkDef;

    		// LE/TE End
    		LeTeEndType						m_eLeEnd;
    		double								m_dLeHubRatio;

    double								m_dLeShrRatio;

    		LeTeEndType						m_eTeEnd;
    		double								m_dTeHubRatio;
    		double								m_dTeShrRatio;

    		bool										m_bEllipseTang;

    		static const double		s_dEllipseLimit;

    		// Over/Under-Filing
    		BgFilingData				m_LeSide1Filing;
    		BgFilingData				m_LeSide2Filing;

    		BgFilingData				m_TeSide1Filing;
    		BgFilingData				m_TeSide2Filing;

    		// Hub/Shr End Data

    HubShrEndType				m_eHubType;
    		double								m_dHubLeRad;
    		double								m_dHubTeRad;

    		HubShrEndType				m_eShrType;
    		double								m_dShrLeRad;
    		double								m_dShrTeRad;

    public:
    		/**# :[Description = "Basic Constructor."] */
    		BgBlade( const double dPitchFrac=0.0, bool bSafeCurveTypes=true );
    		/**# :[Description = "Constructor from another BgBlade object."] */
    		BgBlade( const BgBlade &B );

    /**# :[Description = "Virtual Destructor."] */
    		virtual ~BgBlade();

    		/**# :[Description = "Assignment operator from another BgBlade object."] */
    		BgBlade &operator=( const BgBlade &B );

    		/**# :[Description = "Function returns the Mean Line Array."] */
    		BgMLDatArrArr &Mean();
    		/**# :[Description = "Function returns the Mean Line Array."] */
    		const BgMLDatArrArr &Mean() const;

    		/**# :[Description = "Function returns the Side1 Array (only used for Prs/Sct Mode)."] */

    BgMLDatArrArr &Side1();
    		/**# :[Description = "Function returns the Side1 Array (only used for Prs/Sct Mode)."] */
    		const BgMLDatArrArr &Side1() const;

    		/**# :[Description = "Function returns the Side2 Array (only used for Prs/Sct Mode)."] */
    		BgMLDatArrArr &Side2();
    		/**# :[Description = "Function returns the Side2 Array (only used for Prs/Sct Mode)."] */
    		const BgMLDatArrArr &Side2() const;

    		/**# :[Description = "Function returns the location of the Blade as pitch fraction."] */

    const double &PitchFrac() const;
    		/**# :[Description = "Function sets the location of the Blade as pitch fraction."] */
    		void SetPitchFrac( double &dVal );

    		/**# :[Description = "Function returns the SaveCurveTypes bool, used to control the curve types during BladeGen blade construction."] */
    		bool SafeCurveTypes() const;
    		/**# :[Description = "Function sets the SaveCurveTypes bool, used to control the curve types during BladeGen blade construction."] */

    void SetSafeCurveTypes( bool bSaveCurveTypes );

    		/**# :[Description = "Function returns a reference to the AngSpanDef object to allow modification."] */
    		BgSpanDefAng &AngSpanDef();
    		/**# :[Description = "Function returns a const reference to the AngSpanDef object to for interrogation."] */
    		const BgSpanDefAng &AngSpanDef() const;

    		/**# :[Description = "Function returns a reference to the ThkSpanDef object to allow modification."] */
    		BgSpanDefThk &ThkSpanDef();

    /**# :[Description = "Function returns a const reference to the ThkSpanDef object to for interrogation."] */
    		const BgSpanDefThk &ThkSpanDef() const;

    		/**# :[Description = "Function returns the leading edge EndType value."] */
    		LeTeEndType LeEnd() const;
    		/**# :[Description = "Function sets the leading edge EndType value."] */
    		void SetLeEnd( LeTeEndType eVal );

    		/**# :[Description = "Function returns the leading edge hub elliptical ratio, if applicable."] */

    double LeHubRatio() const;
    		/**# :[Description = "Function returns the leading edge shroud elliptical ratio, if applicable."] */
    		double LeShrRatio() const;
    		/**# :[Description = "Function sets the leading edge hub and shroud elliptical ratio."] */
    		void SetLeEllipseRatios( const double &dHub, const double &dShr );

    		/**# :[Description = "Function returns the trailing edge EndType value."] */
    		LeTeEndType TeEnd() const;
    		/**# :[Description = "Function sets the trailing edge EndType value."] */

    void SetTeEnd( LeTeEndType eVal );

    		/**# :[Description = "Function returns the trailing edge hub elliptical ratio, if applicable."] */
    		double TeHubRatio() const;
    		/**# :[Description = "Function returns the trailing edge shroud elliptical ratio, if applicable."] */
    		double TeShrRatio() const;
    		/**# :[Description = "Function sets the trailing edge hub and shroud elliptical ratio."] */
    		void SetTeEllipseRatios( const double &dHub, const double &dShr );

    /**# :[Description = "Function returns the bool flag for tangential ellipses."] */
    		bool EllipseTang() const;
    		/**# :[Description = "Function sets the bool flag for tangential ellipses."] */
    		void SetEllipseTang( bool bVal );

    		/**# :[Description = "Function sets the leading edge, side 1 over/under-filing data."] */
    		void SetLeSide1Filing( const BgFilingData &LeSide1Filing );
    		/**# :[Description = "Function returns the leading edge, side 1 over/under-filing data for modification."] */

    BgFilingData &LeSide1Filing();
    		/**# :[Description = "Function returns the leading edge, side 1 over/under-filing data for interrogation."] */
    		const BgFilingData &LeSide1Filing() const;

    		/**# :[Description = "Function sets the leading edge, side 2 over/under-filing data."] */
    		void SetLeSide2Filing( const BgFilingData &LeSide2Filing );
    		/**# :[Description = "Function returns the leading edge, side 2 over/under-filing data for modification."] */

    BgFilingData &LeSide2Filing();
    		/**# :[Description = "Function returns the leading edge, side 2 over/under-filing data for interrogation."] */
    		const BgFilingData &LeSide2Filing() const;

    		/**# :[Description = "Function sets the trailing edge, side 1 over/under-filing data."] */
    		void SetTeSide1Filing( const BgFilingData &TeSide1Filing );
    		/**# :[Description = "Function returns the trailing edge, side 1 over/under-filing data for modification."] */

    BgFilingData &TeSide1Filing();
    		/**# :[Description = "Function returns the trailing edge, side 1 over/under-filing data for interrogation."] */
    		const BgFilingData &TeSide1Filing() const;

    		/**# :[Description = "Function sets the trailing edge, side 2 over/under-filing data."] */
    		void SetTeSide2Filing( const BgFilingData &TeSide2Filing );
    		/**# :[Description = "Function returns the trailing edge, side 2 over/under-filing data for modification."] */

    BgFilingData &TeSide2Filing();
    		/**# :[Description = "Function returns the trailing edge, side 2 over/under-filing data for interrogation."] */
    		const BgFilingData &TeSide2Filing() const;

    		/**# :[Description = "Function sets the hub edge configuration."] */
    		void SetHubEndType( HubShrEndType eType, const double &dLeRad=0.0, const double &dTeRad=0.0 );
    		/**# :[Description = "Function returns the hub edge type."] */
    		HubShrEndType HubEndType() const;

    /**# :[Description = "Function returns the hub leading edge radius value."] */
    		const double &HubLeRad() const;
    		/**# :[Description = "Function returns the hub trailing edge radius value."] */
    		const double &HubTeRad() const;

    		/**# :[Description = "Function sets the shroud edge configuration."] */
    		void SetShrEndType( HubShrEndType eType, const double &dLeRad=0.0, const double &dTeRad=0.0 );
    		/**# :[Description = "Function returns the shroud edge type."] */

    HubShrEndType ShrEndType() const;
    		/**# :[Description = "Function returns the shroud leading edge radius value."] */
    		const double &ShrLeRad() const;
    		/**# :[Description = "Function returns the shroud trailing edge radius value."] */
    		const double &ShrTeRad() const;

    		virtual void Read( istream &is );
    		virtual void Save( ostream &os ) const;
    };

     /**# :[Description = "This array holds BgBlade objects."] */

    class BgBladeArr : public BgArr<BgBlade>

    {
    public:
    		/**# :[Description = "Basic Constructor."] */
    		BgBladeArr( int nGrow=4, bool bOwns=true ) : BgArr<BgBlade>( nGrow, bOwns ) {}
    		/**# :[Description = "Virtual Destructor."] */
    		virtual ~BgBladeArr() {}
    };

    #endif // !defined(AFX_BGBLADE_H__A8572FBF_9999_40EC_ADA2_602C0035F2C5__INCLUDED_)

    /**# implementation BgBladeArr:: id(C_1022391574) */

#### 9.5.5.6. Source Code: BgFilingData.h

Declared Classes:

BgFilingData

    // BgFilingData.h: interface for the BgFilingData class.
    //
    //////////////////////////////////////////////////////////////////////

    #if !defined(AFX_BGFILINGDATA_H__5FAF5595_CD5E_4474_AA80_6631B318BFC9__INCLUDED_)
    #define AFX_BGFILINGDATA_H__5FAF5595_CD5E_4474_AA80_6631B318BFC9__INCLUDED_

    #if _MSC_VER > 1000
    #pragma once
    #endif // _MSC_VER > 1000

    #include <iostream.h>

    /**# :[Description = "This class describes a Over\/Under-Filing, on one ’corner’ of the blade.  Four instances of this class are used to describe the full description."] */

    class BgFilingData
    {
    public:
    		enum { nVer=1 };

    protected:
    		double   m_dHubLen;
    		double   m_dShrLen;
    		bool				m_bSclLen;

    		double		m_dHubDep;
    		double		m_dShrDep;
    		bool				m_bSclDep;

    		double		m_dHubRad;
    		double		m_dShrRad;
    		bool				m_bSclRad;

    public:
    		/**# :[Description = "Basic Constructor."] */
    		BgFilingData();
    		/**# :[Description = "Constructor from another BgFilingData object."] */

    BgFilingData( const BgFilingData &D );
    		/**# :[Description = "Virtual Destructor."] */
    		virtual ~BgFilingData();

    		/**# :[Description = "Assignment operator from another BgFilingData object."] */
    		BgFilingData &operator=( const BgFilingData &D );

    		/**# :[Description = "Function removes the filing."] */
    		void Remove();
    		/**# :[Description = "Function removes the radius from the filing."] */
    		void RemoveRadius();

    		/**# :[Description = "Function returns the filing status."] */

    bool Filed() const;
    		/**# :[Description = "Function returns the filing radius status."] */
    		bool HasRadius() const;

    		/**# :[Description = "Function sets the filing values."] */
    		void SetValues( const double &dHubLen, const double &dShrLen, bool bSclLen,
    												 const double &dHubDep, const double &dShrDep, bool bSclDep,
    												 const double &dHubRad, const double &dShrRad, bool bSclRad );

    		/**# :[Description = "Function returns the filing hub length."] */

    const double &HubLen() const;
    		/**# :[Description = "Function returns the filing shroud length."] */
    		const double &ShrLen() const;
    		/**# :[Description = "Function returns the filing length scaling by thickness flag."] */
    		bool SclLen() const;

    		/**# :[Description = "Function returns the filing hub depth."] */
    		const double &HubDep() const;
    		/**# :[Description = "Function returns the filing shroud depth."] */
    		const double &ShrDep() const;

    /**# :[Description = "Function returns the filing depth scaling by thickness flag."] */
    		bool SclDep() const;

    		/**# :[Description = "Function returns the filing hub radius."] */
    		const double &HubRad() const;
    		/**# :[Description = "Function returns the filing shroud radius."] */
    		const double &ShrRad() const;
    		/**# :[Description = "Function returns the filing radius scaling by thickness flag."] */
    		bool SclRad() const;

    		void Read( istream &is );

    void Save( ostream &os ) const;
    };

    #endif // !defined(AFX_BGFILINGDATA_H__5FAF5595_CD5E_4474_AA80_6631B318BFC9__INCLUDED_)

#### 9.5.5.7. Source Code: BgSpanDef.h

Declared Classes:

BgSpanDef

BgSpanDefAng

BgSpanDefThk

    // BgSpanDef.h: interface for the BgSpanDef class.
    //
    //////////////////////////////////////////////////////////////////////

    #if !defined(AFX_BGSPANDEF_H__8A584DC5_21FF_410F_9608_5645ABA6911B__INCLUDED_)
    #define AFX_BGSPANDEF_H__8A584DC5_21FF_410F_9608_5645ABA6911B__INCLUDED_

    #if _MSC_VER > 1000
    #pragma once
    #endif // _MSC_VER > 1000

    #include <iostream.h>

    /**# :[Description = "The class describes the properties of a generic spanwise distribution."] */

    class AFX_EXT_CLASS BgSpanDef
    {
    public:
    		enum { nVer=1 };

    protected:
    		int				m_nSpan;
    		int				m_nStrm;
    		char				*m_pszEquations;
    		bool				m_bAutoFit;
    		double		m_dInitStep;
    		double		m_dFinalStep;

    public:
    		/**# :[Description = "Basic Constructor."] */
    		BgSpanDef( int nSpan=13, int nStrm=13, const char *pszEquations=NULL,
    										bool bAutoFit=true, const double &dInitStep=0.1, const double &dFinalStep=1.0e-6 );

    /**# :[Description = "Virtual Destructor."] */
    		virtual ~BgSpanDef();

    		/**# :[Description = "Function returns the number of span-wise points to use when fitting data (User-Defined Mode)."] */
    		int NumSpan() const;
    		/**# :[Description = "Function returns the number of stream-wise points to use when fitting data (User-Defined Mode)."] */
    		int NumStrm() const;
    		/**# :[Description = "Function sets the number of span-wise and stream-wise points to use when fitting data (User-Defined Mode)."] */

    void SetNum( int nSpan, int nStrm );

    		/**# :[Description = "Function returns the equation string (User-Defined Mode)."] */
    		const char *Equations() const;
    		/**# :[Description = "Function sets the equation string (User-Defined Mode)."] */
    		void SetEquations( const char *pszEquations );

    		/**# :[Description = "Function returns the flag to indicate if fitting is to be performed (User-Defined Mode)."] */
    		bool AutoFit() const;
    		/**# :[Description = "Function returns the initial step size to use if fitting is to be performed (User-Defined Mode)."] */

    const double &InitStep() const;
    		/**# :[Description = "Function returns the final step size to use if fitting is to be performed (User-Defined Mode)."] */
    		const double &FinalStep() const;
    		/**# :[Description = "Function sets the initial and final step sizes to use if fitting is to be performed (User-Defined Mode)."] */
    		void SetFitParm( bool bAutoFit=true, const double &dInitStep=0.1, const double &dFinalStep=1.0e-6 );

    		virtual void Read( istream &is );

    virtual void Save( ostream &os ) const;
    };

    /**# :[Description = "The class describes the properties of a angle definition spanwise distribution."] */

    class AFX_EXT_CLASS BgSpanDefAng : public BgSpanDef
    {
    public:
    		enum DefType { GenAngDef, AxialAngDef, RadialAngDef, UserAngDef, RuledAngDef };

    		enum { nVer=1 };

    protected:
    		DefType		m_eDefType;

    public:
    		/**# :[Description = "Basic Constructor."] */
    		BgSpanDefAng( DefType eDefType=GenAngDef, int nSpan=13, int nStrm=13, const char *pszEquations=NULL,

    bool bAutoFit=true, const double &dInitStep=0.1, const double &dFinalStep=1.0e-6 );

    		/**# :[Description = "Function returns the spanwise interpolation mode."] */
    		DefType SpanDef() const;
    		/**# :[Description = "Function sets the spanwise interpolation mode."] */
    		void SetSpanDef( DefType eDefType=GenAngDef );

    		virtual void Read( istream &is );
    		virtual void Save( ostream &os ) const;
    };

    /**# :[Description = "The class describes the properties of a thickness definition spanwise distribution."] */

    class AFX_EXT_CLASS BgSpanDefThk : public BgSpanDef
    {
    public:
    		enum DefType { GenThkDef, AxialThkDef, RadialThkDef, UserThkDef };

    		enum { nVer=1 };

    protected:
    		DefType		m_eDefType;

    public:
    		/**# :[Description = "Basic Constructor."] */
    		BgSpanDefThk( DefType eDefType=GenThkDef, int nSpan=13, int nStrm=13, const char *pszEquations=NULL,
    										bool bAutoFit=true, const double &dInitStep=0.1, const double &dFinalStep=1.0e-6 );

    /**# :[Description = "Function returns the spanwise interpolation mode."] */
    		DefType SpanDef() const;
    		/**# :[Description = "Function sets the spanwise interpolation mode."] */
    		void SetSpanDef( DefType eDefType=GenThkDef );

    		virtual void Read( istream &is );
    		virtual void Save( ostream &os ) const;
    };

    #endif // !defined(AFX_BGSPANDEF_H__8A584DC5_21FF_410F_9608_5645ABA6911B__INCLUDED_)

#### 9.5.5.8. Source Code: xMsg.h

Declared Classes:

xMsg

    // xMsg.h  -  JMC  -  10/10/96

    #ifndef xMsg_h
    #define xMsg_h

    #include <string.h>

    #ifndef NOMFC

     /**# :[Description = "This class is used when an exception is thrown.  It contains a string that can be used to describe the reason for the exception."] */

    class xMsg : public CException
    #else
    class xMsg
    #endif
    {
    public:
    private:
    		char *m_pszMsg;
    public:
    		xMsg( const char *pszStr ) {
    				m_pszMsg = NULL;
    				SetMsg( pszStr );
    		}
    		~xMsg() {

    delete [] m_pszMsg;
    		}

    		xMsg( const xMsg &Msg ) {
    				m_pszMsg = NULL;
    				SetMsg( Msg.m_pszMsg );
    		}
    		xMsg& operator=( const xMsg &Msg ) {
    				SetMsg( Msg.m_pszMsg );
    				return *this;
    		}

    		void SetMsg( const char *pszStr ) {
    				delete [] m_pszMsg;
    				if ( pszStr && *pszStr ) {
    						m_pszMsg = new char[ ( (strlen(pszStr)+1)/4+1 )*4 ];
    						strcpy( m_pszMsg, pszStr );
    				} else {
    						m_pszMsg = new char[ 4 ];

    *m_pszMsg = ’\0’;
    				}
    		}

    		const char *Why() const {
    				return m_pszMsg;
    		}
    };

    #endif		// xMsg_h

    /**# implementation xMsg:: id(C_1022271081) */

Release 18.2 - © ANSYS, Inc. All rights reserved.