Triangle.h
上传用户:azhong891
上传日期:2013-06-04
资源大小:197k
文件大小:2k
- // Triangle.h: interface for the CTriangle class.
- //
- //////////////////////////////////////////////////////////////////////
- #if !defined(AFX_TRIANGLE_H__8BFDEC3D_B5F7_11D3_AB59_080039014899__INCLUDED_)
- #define AFX_TRIANGLE_H__8BFDEC3D_B5F7_11D3_AB59_080039014899__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- ////////////////////////////////////////////
- #include <math.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include "pointpos.h"
- enum POS//if a point belong a convexity
- {
- POS_IN=1,//a point belong a triangle or convexity
- POS_ON=2,//a point belong a circle or on the edge of convexity
- POS_OUT=0,//a point out of a circle or convexity
- POS_ERROR=-1,
- };
- typedef struct
- {
- double x;
- double y;
- double z;
- } POI;//point
- ////////////////////////////////////////////
- class CTriangle : public CObject
- {
- DECLARE_SERIAL(CTriangle)
- ////////////////////////////////////////////
- public:
- CTriangle(int p1,int p2,int p3);
- POS Where(CPointPos *pos);//判断一点是否在本Triangle 的园 or Triangle 内
- int m_p1,m_p2,m_p3;//Save triangle 三个顶点的坐标数组的下标
- double m_xc,m_yc;//外接圆心坐标
- double m_rad;//外接圆Radius
- double m_x;double m_y;//重心
- double n1,n2,n3;//每边中点处f的法向导数值
- //加上f1,f2,f3共19个控制点*****************8
- double b1,b2,b3,o;
- double c1,c2,c3;
- double e1,e2,e3;
- double d12,d13,d21,d23,d31,d32;
- //加上f1,f2,f3共19个控制点*****************8
- ////////////////////////////////////////////
- CTriangle();
- virtual ~CTriangle();
- virtual void Serialize(CArchive& ar);
- };
- #endif // !defined(AFX_TRIANGLE_H__8BFDEC3D_B5F7_11D3_AB59_080039014899__INCLUDED_)