⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 troidal.h

📁 曲面加工程序源码,用C++编写的加工曲线曲面的程序
💻 H
字号:
#if !defined(__troidal_h)
#define __troidal_h

//Difinition of troidal class

#include "vector.h"
#include "face.h"

class troidal:public face {
 private:
	//-------------Difinition of paraloid-------------
	//The axis is parallel to z-axis.
	//The vertex  is (0,0,0)
	//The focal point is (0,0,p)
	//
	//Equation of troidal is 
        //  x =   ( R +r cos[q] ) cos[p]
        //  y =     r sin[q]
        //  z =   ( R +r cos[q] ) sin[p]
        //
        // nx =    cos[q] cos[p]      tan[p] = nz/nx;
        // ny =    sin[q]         =>  tan[q] = -y / sqrt( x^2+z^2 )
        // nz =    cos[q] sin[p]

	//-------------------------------------------------
	double LargeRadius;
        double SmallRadius;
	double SurfaceLargeRadius;
        double SurfaceSmallRadius;
        
        bool isConcave ;

        bool isHorizontal;//981027
 public:
	// Constractor and destractor
	troidal();
	troidal( double lr,double sr);
	virtual ~troidal();

	//accessor
	//void SetParameters(void);
	void SetLargeRadius(double r );
	double GetLargeRadius();
	void SetSmallRadius(double r );
	double GetSmallRadius() ;

	double GetZ( double x, double y);
	vector GetPosition( double x, double y);

	double gradX(double x, double y);
	double gradY(double x, double y);
	double gradXX(double x, double y);
	double gradYY(double x, double y);

	// This is the normal vector of surface on the point(x,y).
	// This is toward the inside of troidal.
	// This.length is 1.
	vector NormalVector ( double x, double y);
	vector NormalVector ( vector position);

	////GradientVector////////////////////////////////////////////
	// This is one of tangential vactors on the tangential plane.
	// This is toward direction which has the largest gradient.
	// This length is 1.
	vector GradientVector(double x, double y);
	vector GradientVector( vector position);

	////NoGradientVector///////////////////////////////////////////
	// This is one of tangential vactors on the tangential plane.
	// This is toward direction which has no gradient.
	//// This length will be 1,
	//// and this Z-coordinate will be Zero.
	vector NoGradientVector(double x,double y);
	vector NoGradientVector(vector position);

		//朄慄丗a normal line
		//徟揰丗a focal point
		//捀揰丗a vertex
		//徟揰嫍棧丗a focal distance

	int WriteFaceName(ofstream&);
	int WriteParameters(ofstream&);

        //980519
        void SetParameter(TStringList *str);
        void GetParameter(TStringList *str);

};	//end of troidal class
#endif




⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -