/*
* Copyright (c) 2002, wzq
* All rights reserved.
*
* 文件名称:myjig.cpp
*文件标识:
*摘 要:只是一个AcEdJig派生类的模版
*
* 当前版本:1.1
* 作 者:noname jjiiee@hotmail.com
* 完成日期:[10/28/2002]
* 欢迎相互交流:)
*/
#include "stdafx.h"
#include "myjig.h"
MyJig::MyJig ()
{
}
/*
* 创建一个简单实体,并调用drag()函数
*/
void MyJig::doIt ()
{
AcEdJig::DragStatus stat = kNoChange;
// 创建一个新实体
// 提示用户操作
setDispPrompt ("");
stat = drag ();
//将实体加入图形数据库
append ();
}
/*
* 成员函数sampler(), 被drag()函数调用以进行实时取样
*
* 函数返回值:
* typedef enum DragStatus {
* kNoChange = -6,
* kCancel = -4,
* kOther = -3,
* kNull = -1,
* kNormal = 0,
* kKW1,
* kKW2,
* kKW3,
* kKW4,
* kKW5,
* kKW6,
* kKW7,
* kKW8,
* kKW9
* };
* 在函数sampler()中,需要设置一些参数:关键字列表、
* 给用户的提示信息、光标类型和用户输入控制
* 1、关键字列表
* setKeywordList()来指定关键字列表:
* 2、给用户提示的信息
* 用setDispPrompt()
* 3、光标类型
* setSpecialCursorType (AcEdJig::CursorType curType)
* typedef enum CursorType {
* kNoSpecialCursor = -1, // No Special Cursor Specified
* kCrosshair = 0, // Full Screen Cross Hair.
* kRectCursor, // Rectangular cursor.
* kRubberBand, // Rubber band line.
* kNotRotated, // NotRotated Type.
* kTargetBox, // Target Box Type.
* kRotatedCrosshair, // Rotated Crosshair w/ rubber band.
* kCrosshairNoRotate, // Crosshairs forced non-rotated.
* kInvisible, // Invisible cursor.
* kEntitySelect, // Entity selection target cursor.
* kParallelogram, // Parallelogram cursor.
* kEntitySelectNoPersp, // Pickbox, suppressed in persp.
* kPkfirstOrGrips // Auto-select cursor.
* };
* 4、用户控制输入
* setUserInputControls (AcEdJig::UserInputControls uic);
* typedef enum UserInputControls {
* kGovernedByOrthoMode = 0x0001, // Non-operational. Will be
* // removed in future release
* kNullResponseAccepted = 0x0002,
* kDontEchoCancelForCtrlC = 0x0004,
* kDontUpdateLastPoint = 0x0008,
* kNoDwgLimitsChecking = 0x0010,
* kNoZeroResponseAccepted = 0x0020,
* kNoNegativeResponseAccepted = 0x0040,
* kAccept3dCoordinates = 0x0080,
* kAcceptMouseUpAsPoint = 0x0100,
* kAnyBlankTerminatesInput = 0x0200,
* kInitialBlankTerminatesInput = 0x0400,
* kAcceptOtherInputString = 0x0800
* };
* 5、对用户的输入取样
* acquirePoint(AcGePoint3d &point);
* DragStatus acquireString(char *str);
* DragStatus acquireAngle(double &ang);
* DragStatus acquireAngle(double &ang, const AcGePoint3d& basePnt);
* DragStatus acquireDist(double &dist);
* DragStatus acquireDist(double &dist, const AcGePoint3d& basePnt);
* DragStatus acquirePoint(AcGePoint3d&);
* DragStatus acquirePoint(AcGePoint3d&, const AcGePoint3d&basePnt);
*/
AcEdJig::DragStatus
MyJig::sampler ()
{
DragStatus stat = kNoChange;
// 设置用户输入控制
setUserInputControls ((UserInputControls) (AcEdJig::kNoZeroResponseAccepted));
return stat;
}
/*
* 成员函数update(), 被函数drag()调用以根据取样值更新实体信息
*/
Adesk::Boolean
MyJig::update ()
{
return Adesk::kTrue;
}
/*
* 成员函数entity(),被函数drag()调用,以返回根据取样值更新后的实体
*/
AcDbEntity *
MyJig::entity () const
{
return m_pEnt;
}
评论0