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

📄 plate.h

📁 finite element mesh 参数化有限元网格划分
💻 H
字号:
// plate.h

#ifndef PLATE_H
#define PLATE_H

#include "coord.h"

/** Defines a plate. The plate is defined by a list of coordinates on a plane and the width of the plate. */
class Plate {

private:
	Coord	*coords;
	int		numCoords;
	double	width;

public:
	
	/** Default constructor. Creates an empty plate. */
	Plate():coords(NULL),numCoords(0),width(DEFAULT_PLATE_WIDTH) {} 

	/** Constructor 
		\param coords An array of the plates' coordinates
		\param numCoords Number of coordinates of the plate
		\param width The width of the plate
	*/
	Plate(Coord *coords, int numCoords, double	width = DEFAULT_PLATE_WIDTH) {
		this->coords = new Coord[numCoords];
		for (int i=0; i<numCoords; i++)
			this->coords[i]=coords[i];
		this->numCoords = numCoords;
		this->width = width;
	}

	/** Set parameters 
		\param coords An array of the plates' coordinates
		\param numCoords Number of coordinates of the plate
		\param width The width of the plate
	*/
	void setParams(Coord *coords, int numCoords, double width = DEFAULT_PLATE_WIDTH) { 
		if (this->coords) delete[] this->coords;
		this->coords = new Coord[numCoords];
		for (int i=0; i<numCoords; i++)
			this->coords[i]=coords[i];
		this->numCoords = numCoords;
		this->width = width;
	}

	/** Get parameters 
		\param coords \out An address of an array of the plates' coordinates (the array will be allocated by the function)
		\param numCoords Number of coordinates of the plate
		\param width \out The width of the plate
	*/
	void getParams(Coord **coords, int &numCoords, double &width) const { 
		if (!coords) return;
		numCoords = this->numCoords;
		*coords = new Coord[this->numCoords];
		for (int i=0; i<this->numCoords; i++)
			(*coords)[i]=this->coords[i];
		width = this->width;
	}

};

#endif

⌨️ 快捷键说明

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