www.pudn.com > stlreader.rar > 3DModel.h
// 3DModel.h: interface for the C3DModel class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_3DMODEL_H__0AC0E1F9_220B_46DC_899A_5D048A12F101__INCLUDED_)
#define AFX_3DMODEL_H__0AC0E1F9_220B_46DC_899A_5D048A12F101__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
//#include "cdib.h"
//#define DIST_EPSILON (1e-9)
//#define EPSILON 0.0001
//
////const int nCharBuffer=255;
////一些材质的参数
// const float red[]={ 1.0,0.0,0.0,1.0};
//const float blue[]={ 0.0,0.0,1.0,1.0};
//const float white[]={ 1.0,1.0,1.0,1.0};
////网格的一些设置参数
//#define SIZE 30.0f
//#define STEP 3.0f
////选择器的大小的参数
//#define BUFSIZE 1024
#include "Vector.h"
#include "afxtempl.h"
class C3DModel : public CObject
{
public:
CArray VertexArray;//存放stl中的数据
void ReadStlFile(CString stlfile);
void DrawNurbs(int Showtype);
void InitModel();
void ScaleFoot(float ZScale[100],float YScale[100],float xscale);
int findindex(float length,float step,float xvalue);
void ComputeScale();
void readdata();
void Normal(float * array,int num);
void Draw3DModel(int Showtype);
float m_d[3];
int m_npointnum;
float m_ntrany;
float m_ntranx;
float m_nscale;
float m_nNormal[3];
void NormalListData1(float pointa[3], float pointb[3], float pointc[3]);
void NormalListData();
double m_nVertextList[10010][3];
float m_nTrueList[10010][3]; //存放真实的三维数据,以mm为单位,坐标原点在脚尖
float m_orightTrueList[10010][3];//存放没有变换之前的数据
//float m_mianpian[5000][3][3];
/////////把脚切成20片,下面四个数组存储脚在切片里的y和z的最大最小坐标
float m_maxy[100];
float m_miny[100];
float m_maxz[100];
float m_minz[100];
//////////////////////////////////////////////
float m_xScale; //x方向缩放因子
float m_yScale[100];
float m_zScale[100];
C3DModel();
virtual ~C3DModel();
};
#endif // !defined(AFX_3DMODEL_H__0AC0E1F9_220B_46DC_899A_5D048A12F101__INCLUDED_)