// (C) Copyright 2002-2005 by Autodesk, Inc.
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted,
// provided that the above copyright notice appears in all copies and
// that both that copyright notice and the limited warranty and
// restricted rights notice below appear in all supporting
// documentation.
//
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
// UNINTERRUPTED OR ERROR FREE.
//
// Use, duplication, or disclosure by the U.S. Government is subject to
// restrictions set forth in FAR 52.227-19 (Commercial Computer
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
// (Rights in Technical Data and Computer Software), as applicable.
//
//-----------------------------------------------------------------------------
//----- AsdkEntity.cpp : Implementation of AsdkEntity
//-----------------------------------------------------------------------------
#include "StdAfx.h"
#include "AsdkEntity.h"
//-----------------------------------------------------------------------------
Adesk::UInt32 AsdkEntity::kCurrentVersionNumber =1 ;
//-----------------------------------------------------------------------------
ACRX_DXF_DEFINE_MEMBERS (
AsdkEntity, AcDbEntity,
AcDb::kDHL_CURRENT, AcDb::kMReleaseCurrent,
AcDbProxyEntity::kNoOperation, ASDKENTITY,
"ASDKMYENTITYAPP"
"|Product Desc: A description for your object"
"|Company: Your company name"
"|WEB Address: Your company WEB site address"
)
//-----------------------------------------------------------------------------
AsdkEntity::AsdkEntity () : AcDbEntity () {
}
AsdkEntity::~AsdkEntity () {
}
//-----------------------------------------------------------------------------
//----- AcDbObject protocols
//- Dwg Filing protocol
Acad::ErrorStatus AsdkEntity::dwgOutFields (AcDbDwgFiler *pFiler) const {
assertReadEnabled () ;
//----- Save parent class information first.
Acad::ErrorStatus es =AcDbEntity::dwgOutFields (pFiler) ;
if ( es != Acad::eOk )
return (es) ;
//----- Object version number needs to be saved first
if ( (es =pFiler->writeUInt32 (AsdkEntity::kCurrentVersionNumber)) != Acad::eOk )
return (es) ;
//----- Output params
//.....
pFiler->writeItem (m_PtA) ;
pFiler->writeItem (m_PtB) ;
pFiler->writeItem (m_PtC) ;
return (pFiler->filerStatus ()) ;
}
Acad::ErrorStatus AsdkEntity::dwgInFields (AcDbDwgFiler *pFiler) {
assertWriteEnabled () ;
//----- Read parent class information first.
Acad::ErrorStatus es =AcDbEntity::dwgInFields (pFiler) ;
if ( es != Acad::eOk )
return (es) ;
//----- Object version number needs to be read first
Adesk::UInt32 version =0 ;
if ( (es =pFiler->readUInt32 (&version)) != Acad::eOk )
return (es) ;
if ( version > AsdkEntity::kCurrentVersionNumber )
return (Acad::eMakeMeProxy) ;
//- Uncomment the 2 following lines if your current object implementation cannot
//- support previous version of that object.
//if ( version < AsdkEntity::kCurrentVersionNumber )
// return (Acad::eMakeMeProxy) ;
//----- Read params
//.....
if ( version >= NaN /*&& version <= endVersion*/ ) pFiler->readItem (&m_PtA) ;
if ( version >= NaN /*&& version <= endVersion*/ ) pFiler->readItem (&m_PtB) ;
if ( version >= NaN /*&& version <= endVersion*/ ) pFiler->readItem (&m_PtC) ;
return (pFiler->filerStatus ()) ;
}
//-----------------------------------------------------------------------------
//----- AcDbEntity protocols
Adesk::Boolean AsdkEntity::worldDraw (AcGiWorldDraw *mode) {
assertReadEnabled () ;
return (AcDbEntity::worldDraw (mode)) ;
}
//- Osnap points protocol
Acad::ErrorStatus AsdkEntity::getOsnapPoints (
AcDb::OsnapMode osnapMode,
int gsSelectionMark,
const AcGePoint3d &pickPoint,
const AcGePoint3d &lastPoint,
const AcGeMatrix3d &viewXform,
AcGePoint3dArray &snapPoints,
AcDbIntArray &geomIds) const
{
assertReadEnabled () ;
return (AcDbEntity::getOsnapPoints (osnapMode, gsSelectionMark, pickPoint, lastPoint, viewXform, snapPoints, geomIds)) ;
}
Acad::ErrorStatus AsdkEntity::getOsnapPoints (
AcDb::OsnapMode osnapMode,
int gsSelectionMark,
const AcGePoint3d &pickPoint,
const AcGePoint3d &lastPoint,
const AcGeFastTransform &viewXform,
AcGePoint3dArray &snapPoints,
AcDbIntArray &geomIds) const
{
assertReadEnabled () ;
return (AcDbEntity::getOsnapPoints (osnapMode, gsSelectionMark, pickPoint, lastPoint, viewXform, snapPoints, geomIds)) ;
}
Acad::ErrorStatus AsdkEntity::getOsnapPoints (
AcDb::OsnapMode osnapMode,
int gsSelectionMark,
const AcGePoint3d &pickPoint,
const AcGePoint3d &lastPoint,
const AcGeMatrix3d &viewXform,
AcGePoint3dArray &snapPoints,
AcDbIntArray &geomIds,
const AcGeMatrix3d &insertionMat) const
{
assertReadEnabled () ;
return (AcDbEntity::getOsnapPoints (osnapMode, gsSelectionMark, pickPoint, lastPoint, viewXform, snapPoints, geomIds, insertionMat)) ;
}
Acad::ErrorStatus AsdkEntity::getOsnapPoints (
AcDb::OsnapMode osnapMode,
int gsSelectionMark,
const AcGePoint3d & pickPoint,
const AcGePoint3d & lastPoint,
const AcGeFastTransform & viewXform,
AcGePoint3dArray &snapPoints,
AcDbIntArray &geomIds,
const AcGeMatrix3d &insertionMat) const
{
assertReadEnabled () ;
return (AcDbEntity::getOsnapPoints (osnapMode, gsSelectionMark, pickPoint, lastPoint, viewXform, snapPoints, geomIds, insertionMat)) ;
}
//- Grip points protocol
Acad::ErrorStatus AsdkEntity::getGripPoints (
AcGePoint3dArray &gripPoints, AcDbIntArray &osnapModes, AcDbIntArray &geomIds
) const {
assertReadEnabled () ;
//----- This method is never called unless you return eNotImplemented
//----- from the new getGripPoints() method below (which is the default implementation)
return (AcDbEntity::getGripPoints (gripPoints, osnapModes, geomIds)) ;
}
Acad::ErrorStatus AsdkEntity::moveGripPointsAt (const AcDbIntArray &indices, const AcGeVector3d &offset) {
assertWriteEnabled () ;
//----- This method is never called unless you return eNotImplemented
//----- from the new moveGripPointsAt() method below (which is the default implementation)
return (AcDbEntity::moveGripPointsAt (indices, offset)) ;
}
Acad::ErrorStatus AsdkEntity::getGripPoints (
AcDbGripDataPtrArray &grips, const double curViewUnitSize, const int gripSize,
const AcGeVector3d &curViewDir, const int bitflags
) const {
assertReadEnabled () ;
//----- If you return eNotImplemented here, that will force AutoCAD to call
//----- the older getGripPoints() implementation. The call below may return
//----- eNotImplemented depending of your base class.
return (AcDbEntity::getGripPoints (grips, curViewUnitSize, gripSize, curViewDir, bitflags)) ;
}
Acad::ErrorStatus AsdkEntity::moveGripPointsAt (
const AcDbVoidPtrArray &gripAppData, const AcGeVector3d &offset,
const int bitflags
) {
assertWriteEnabled () ;
//----- If you return eNotImplemented here, that will force AutoCAD to call
//----- the older getGripPoints() implementation. The call below may return
//----- eNotImplemented depending of your base class.
return (AcDbEntity::moveGripPointsAt (gripAppData, offset, bitflags)) ;
}
AcGePoint3d AsdkEntity::get_m_PtA(void) const
{
assertReadEnabled () ;
return (m_PtA) ;
}
Acad::ErrorStatus AsdkEntity::put_m_PtA(AcGePoint3d newVal)
{
assertWriteEnabled () ;
m_PtA =newVal ;
return (Acad::eOk) ;
}
AcGePoint3d AsdkEntity::get_m_PtB(void) const
{
assertReadEnabled () ;
return (m_PtB) ;
}
Acad::ErrorStatus AsdkEntity::put_m_PtB(AcGePoint3d newVal)
{
assertWriteEnabled () ;
m_PtB =newVal ;
return (Acad::eOk) ;
}
AcGePo
cad二次开发,自定义实体
需积分: 46 138 浏览量
2018-09-28
09:07:38
上传
评论
收藏 6.78MB RAR 举报
evergreenxq
- 粉丝: 7
- 资源: 8
最新资源
- AIS2024 valid
- 最入门的爬虫代码 python.docx
- 爬虫零基础入门-爬取天气预报.pdf
- 最通俗易懂的 MongoDB 非结构化文档存储数据库教程.zip
- 以mongodb为数据库的订单物流小项目.zip
- 腾讯云-mongodb数据库, 项目部署.zip
- 腾讯 APIJSON 的 MongoDB 数据库插件.zip
- 理解非关系型数据库和关系型数据库的区别.zip
- 操作简单的Mongodb网页web管理工具,基于Spring Boot2.0支持mongodb集群.zip
- tms-mongodb-web,提供访问mongodb数据的REST API和可灵活扩展的mongodb web 客户端.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈