www.pudn.com > cad3d.zip > SurfButterfly.h


/*************************************************************************** 
			SurfButterfly.h: interface for the CSurfButterfly class. 
                             ------------------- 
    begin                : 2001 
    copyright            : (C) 2001 by Martin Marinov 
    email                : martin_marinov@hotmail.com 
 ***************************************************************************/ 
 
/*************************************************************************** 
 *                                                                         * 
 *   This program is free software; you can redistribute it and/or modify  * 
 *   it under the terms of the GNU General Public License as published by  * 
 *   the Free Software Foundation; either version 2 of the License, or     * 
 *   (at your option) any later version.                                   * 
 *                                                                         * 
 ***************************************************************************/ 

#ifndef __SurfButterfly_h__
#define __SurfButterfly_h__

#include "Surfaces/BaseSurf.h"
 
class CButtVertex; 
template  class CButtTri; 

class SURFACES_API CSurfButterfly :	public CBaseSurf
{ 
public: 
	typedef CButtVertex					NativeVertex; 
	typedef CButtTri		NativeFace; 
	typedef	std::vector	NvArray; 
	typedef	std::vector		NfArray; 
 
protected:
	int						m_nMaxLevel;
	int						m_nTris;
	int						m_nVerts;
							
protected:					
	void					InitProperties(); 
	void					ConvertToNative(NvArray& rVerts, NfArray& rTris); 
	
public:
	CSurfButterfly(int nMaxLevel = 2);
	virtual ~CSurfButterfly();

	//IPrimitive implementation
	static	const char*		GetTypeNameSt();
	virtual const char*		GetTypeName() const;
	virtual uint			GetTypeId() const;

	//IControled implementation
	virtual void			Calculate();

	//CControlMesh overrides
	virtual bool			IsValencySupported(top_int nVertsCount) const;
	virtual top_int			GetMaxValency() const;		
	virtual top_int			GetMinValency() const;		
};

#endif // __SurfButterfly_h__