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

📄 amiutilities.h

📁 能在MDT5/6环境下对已经存在地曲面进行全部和局部区域展开
💻 H
字号:
#ifdef AMI_H

#ifndef AMI_UTILITIES_H
#define AMI_UTILITIES_H

//////////////////////////////////////////////////////////////////////////
//
// 与Mcad API 相关的函数
//
// Note:
//		
//////////////////////////////////////////////////////////////////////////

#include "TypeDef.h"

#ifdef _DBXEXP_
#define DLLIMPEXP __declspec(dllexport)
#else
#define DLLIMPEXP 
#endif


/*
 *	Purpose:
 *		从屏幕上选择一个实体,并返回其AmiGeomKey值.
 *		使用完后有必要释放key的空间,使用release().
 *	Argument:
 *		prompt		[in], 提示文字.
 *		keyType		[in], 生成的key类型.
 *		pGeomKey	[out], 生成的几何实体key.
 *	Return:
 *		Ami::eUserEscape if user escape. Ami::eOk if success.
 */
extern DLLIMPEXP AmiStatus 
getGeomKeyFromPick(const char* prompt,
				   AmiKeyType keyType,
				   AmiGeomKey*& pGeomKey);


/*
 *	Purpose:
 *		从屏幕上选择多个实体,并返回其AmiGeomKey值,
 *		不允许实体重复选择. 有必要释放key的空间,使用release().
 *	Argument:
 *		prompt		[in], 提示文字.
 *		keyType		[in], 生成的key类型.
 *		Keys		[out], 生成的几何实体keys.
 *	Return:
 *		Ami::eUserEscape if user escape. Ami::eOk if success.
 */
extern DLLIMPEXP AmiStatus 
getGeomKeysFromPick(const char* prompt, AmiKeyType keyType, AmiGeomKeyArray& keys);




/*
 *	Purpose:
 *		get the AcDbObjectId from geomkey.
 *	Argument:
 *		pkey	[in], object key.
 *		id		[out], object Id.
 *	Return:
 *		Returns eOk if success.
 */
extern DLLIMPEXP AmiStatus 
getDbIdFromGeomKey(AmiGeomKey *pkey,AcDbObjectId& id);


/*
 *	Purpose:
 *		get the AcDbObjectId array from geomkeys.
 *	Argument:
 *		keys	[in], object keys
 *		ids		[out], object Id Array.
 *	Return:
 *		Returns eOk if success.
 */
extern DLLIMPEXP AmiStatus 
getDbIdsFromGeomKeys(AmiGeomKeyArray keys,AcDbObjectIdArray& ids);


/*
 *	Purpose:
 *		get the geomkeys from AcDbObjectId array.
 *	Argument:
 *		ids		[in], object Id Array.
 *		type	[in], object key type
 *		keys	[out], object keys
 *	Return:
 *		Returns eOk if success.
 */
extern DLLIMPEXP AmiStatus 
getGeomKeysFromDbIds(const AcDbObjectIdArray& ids,
					 AmiKeyType type,AmiGeomKeyArray& keys);


/*
 *	Purpose:
 *		从曲线对象key得到曲线实体AcBrEdge指针, 有义务释放内存空间
 *	Argument:
 *		pKey	[in], object key.
 *		pBrEdge	[out], object AcBrEdge pointer.
 *	Return:
 *		如果key不是curveKey,则返回Ami::eTypeMapFailure
 *		pBrEdge置为NULL, 否则返回Ami::eOk.
 */
extern DLLIMPEXP AmiStatus 
getBrEdgeFromGeomKey(AmiCurveKey *pKey,AcBrEdge*& pBrEdge);


/*
 *	Purpose:
 *		从对象key得到实体AcBrFace指针, 有义务释放内存空间
 *	Argument:
 *		pKey	[in], object key.
 *		pBrFace	[out], object AcBrFace pointer.
 *	Return:
 *		如果key不是surfKey,则返回Ami::eTypeMapFailure
 *		pBrFace置为NULL, 否则返回Ami::eOk.
 */
extern DLLIMPEXP AmiStatus 
getBrFaceFromGeomKey(AmiGeomKey *pKey,AcBrFace*& pBrFace);


/*
 *	Purpose:
 *		从曲面GeomKey得到曲面基面和轮廓
 *	Argument:
 *		pSurfKey	[in], 曲面GeomKey.
 *		baseSurf	[out], 曲面基面.
 *		loops		[out], 曲面轮廓.
 *	Return:
 *		true几何曲面方向与实际曲面方向相同,false相反
 */
extern DLLIMPEXP bool 
getBaseSurfaceAndLoops(AmiGeomKey *pSurfKey,
					   AcGeNurbSurface& baseSurf, 
					   ChGeLoop3dArray& loops);

/*
 *	Purpose:
 *		从曲面GeomKey得到曲面基面
 *	Argument:
 *		pSurfKey	[in], 曲面GeomKey.
 *		baseSurf	[out], 曲面基面.
 *	Return:
 *		true几何曲面方向与实际曲面方向相同,false相反
 */
extern DLLIMPEXP bool 
getBaseSurface(AmiGeomKey *pSurfKey,AcGeNurbSurface& baseSurf);



/*
 *	Purpose:
 *		从曲面Handle得到曲面基面和轮廓
 *	Argument:
 *		hSurf		[in], 曲面Handle.
 *		baseSurf	[out], 曲面基面.
 *		loops		[out], 曲面轮廓.
 *	Return:
 *		true几何曲面方向与实际曲面方向相同,false相反
 */
extern DLLIMPEXP bool 
getBaseSurfaceAndLoops(const AcDbHandle& hSurf,AcGeNurbSurface& baseSurf, ChGeLoop3dArray& loops);


/*
 *	Purpose:
 *		从曲面Handle得到曲面基面
 *	Argument:
 *		hSurf		[in], 曲面Handle.
 *		baseSurf	[out], 曲面基面.
 *	Return:
 *		true几何曲面方向与实际曲面方向相同,false相反
 */
extern DLLIMPEXP bool 
getBaseSurface(const AcDbHandle& hSurf,AcGeNurbSurface& baseSurf);


#endif // AMI_UTILITIES_H

#endif // AMI_H

⌨️ 快捷键说明

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