//
// (C) Copyright 1998-2006 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.
//
//
#include "StdAfx.h"
#if defined(_DEBUG) && !defined(AC_FULL_DEBUG)
#error _DEBUG should not be defined except in internal Adesk debug builds
#endif
#include "ArxDbgSelSet.h"
#include "ArxDbgUtils.h"
#include "ArxDbgRbList.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/****************************************************************************
**
** ArxDbgSelSet::ArxDbgSelSet
**
** **jma
**
*************************************/
ArxDbgSelSet::ArxDbgSelSet()
: m_allowDuplicates(false),
m_allAtPickBox(false),
m_singleOnly(false),
m_kwordFuncPtr(NULL),
m_otherFuncPtr(NULL),
m_allowLast(true),
m_filterLockedLayers(false),
m_rejectNonCurrentSpace(false),
m_rejectPaperSpaceViewport(false)
{
m_ss[0] = 0L;
m_ss[1] = 0L;
m_lastStatus = kCanceled;
}
/****************************************************************************
**
** ArxDbgSelSet::~ArxDbgSelSet
**
** **jma
**
*************************************/
ArxDbgSelSet::~ArxDbgSelSet()
{
clear();
}
/****************************************************************************
**
** ArxDbgSelSet::isInitialized
**
** **jma
**
*************************************/
bool
ArxDbgSelSet::isInitialized() const
{
if ((m_ss[0] == 0L) && (m_ss[1] == 0L))
return false;
else
return true;
}
/****************************************************************************
**
** ArxDbgSelSet::clear
**
** **jma
**
*************************************/
void
ArxDbgSelSet::clear()
{
if (isInitialized()) {
acedSSFree(m_ss);
m_ss[0] = m_ss[1] = 0L;
}
}
/****************************************************************************
**
** ArxDbgSelSet::createEmptySet
**
** **jma
**
*************************************/
ArxDbgSelSet::SelSetStatus
ArxDbgSelSet::createEmptySet()
{
clear();
int result = acedSSAdd(NULL, NULL, m_ss);
ASSERT(result == RTNORM);
if (result == RTNORM)
m_lastStatus = ArxDbgSelSet::kSelected;
else
m_lastStatus = ArxDbgSelSet::kCanceled;
return m_lastStatus;
}
/****************************************************************************
**
** ArxDbgSelSet::handleResult
** private helper function to process common result code action.
**
** **jma
**
*************************************/
ArxDbgSelSet::SelSetStatus
ArxDbgSelSet::handleResult(int result)
{
if (result == RTNORM)
m_lastStatus = ArxDbgSelSet::kSelected;
else if (result == RTCAN)
m_lastStatus = ArxDbgSelSet::kCanceled;
else if (result == RTREJ) {
ASSERT(0);
m_lastStatus = ArxDbgSelSet::kRejected;
}
else { // doesn't return RTNONE
createEmptySet();
m_lastStatus = ArxDbgSelSet::kNone;
}
return m_lastStatus;
}
/****************************************************************************
**
** ArxDbgSelSet::userSelect
**
** **jma
**
*************************************/
ArxDbgSelSet::SelSetStatus
ArxDbgSelSet::userSelect(const resbuf* filter)
{
clear();
setFlags(false);
// if caller wants callback function for keywords
if (m_kwordFuncPtr)
acedSSSetKwordCallbackPtr(m_kwordFuncPtr);
// if caller wants callback function for garbage input
if (m_otherFuncPtr)
acedSSSetOtherCallbackPtr(m_otherFuncPtr);
int result;
if (m_kwordFuncPtr)
result = acedSSGet(m_flags, NULL, static_cast<LPCTSTR>(m_extraKwords), filter, m_ss);
else
result = acedSSGet(m_flags, NULL, NULL, filter, m_ss);
return handleResult(result);
}
/****************************************************************************
**
** ArxDbgSelSet::userSelect
**
** **jma
**
*************************************/
ArxDbgSelSet::SelSetStatus
ArxDbgSelSet::userSelect(LPCTSTR selectPrompt, LPCTSTR removePrompt, const resbuf* filter)
{
ASSERT(selectPrompt || removePrompt); // if they wanted both to be NULL they should have used other signature!
TCHAR* promptPtrs[2];
// allow for one of the prompts to be NULL. It is usually useful for the
// Remove prompt.
if ((selectPrompt == NULL) || (selectPrompt[0] == _T('\0')))
promptPtrs[0] = _T("\nSelect objects: ");
else
promptPtrs[0] = const_cast<LPTSTR>(selectPrompt);
if ((removePrompt == NULL) || (removePrompt[0] == _T('\0')))
promptPtrs[1] = _T("\nRemove objects: ");
else
promptPtrs[1] = const_cast<LPTSTR>(removePrompt);
// if caller wants callback function for keywords
if (m_kwordFuncPtr)
acedSSSetKwordCallbackPtr(m_kwordFuncPtr);
// if caller wants callback function for garbage input
if (m_otherFuncPtr)
acedSSSetOtherCallbackPtr(m_otherFuncPtr);
setFlags(true); // set current state of flags
int result;
if (m_kwordFuncPtr)
result = acedSSGet(m_flags, promptPtrs, static_cast<LPCTSTR>(m_extraKwords), filter, m_ss);
else
result = acedSSGet(m_flags, promptPtrs, NULL, filter, m_ss);
return handleResult(result);
}
/****************************************************************************
**
** ArxDbgSelSet::impliedSelect
**
** **jma
**
*************************************/
ArxDbgSelSet::SelSetStatus
ArxDbgSelSet::impliedSelect(const resbuf* filter)
{
clear();
// NOTE: flags not allowed on this type of selection
int result = acedSSGet(_T("_I"), NULL, NULL, filter, m_ss);
return handleResult(result);
}
/****************************************************************************
**
** ArxDbgSelSet::crossingSelect
**
** **jma
**
*************************************/
ArxDbgSelSet::SelSetStatus
ArxDbgSelSet::crossingSelect(const AcGePoint3d& pt1, const AcGePoint3d& pt2, const resbuf* filter)
{
clear();
// NOTE: flags not allowed on this type of selection
int result = acedSSGet(_T("_C"), asDblArray(pt1), asDblArray(pt2), filter, m_ss);
return handleResult(result);
}
/****************************************************************************
**
** ArxDbgSelSet::crossingPolygonSelect
**
** **jma
**
*************************************/
ArxDbgSelSet::SelSetStatus
ArxDbgSelSet::crossingPolygonSelect(const AcGePoint3dArray& ptArray, const resbuf* filter)
{
clear();
// NOTE: flags not allowed on this type of selection
resbuf* ptList = ptArrayToResbuf(ptArray);
if (ptList == NULL) {
m_lastStatus = ArxDbgSelSet::kCanceled;
return m_lastStatus;
}
int result = acedSSGet(_T("_CP"), ptList, NULL, filter, m_ss);
acutRelRb(ptList);
return handleResult(result);
}
/********************************************************
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
TransformToPolyline.rar (42个子文件)
TransformToPolyline
TransformToPolyline.suo 67KB
TransformToPolyline.sln 1KB
TransformToPolyline
TransformToPolyline.aps 18KB
StdAfx.cpp 1KB
acad.lsp 109KB
ArxDbgSelSet.h 5KB
MyPoint.cpp 64B
Drawing1.dwg 75KB
UserHelp.cpp 8KB
TransformToPolyline.vcproj 10KB
UserHelp.h 3KB
Win32
Debug
MyPoint.obj 8KB
acrxEntryPoint.obj 65KB
vc80.pdb 2.23MB
TransformToPolyline.obj 23KB
BuildLog.htm 6KB
TransformToPolyline.res 988B
UserHelp.obj 396KB
mt.dep 65B
StdAfx.obj 370KB
HPTransformToPolyline.arx.intermediate.manifest 615B
vc80.idb 2.38MB
HPTransformToPolyline.pch 28.75MB
HPTransformToPolyline.arx.embed.manifest.res 716B
DocData.obj 131KB
HPTransformToPolyline.arx.embed.manifest 650B
DocData.cpp 2KB
StdAfx.h 4KB
acrxEntryPoint.cpp 3KB
ArxDbgSelSet.cpp 20KB
Resource.h 442B
DocData.h 2KB
TransformToPolyline.cpp 2KB
TransformToPolyline.rc 2KB
TransformToPolyline.vcproj.zouxin-PC.zouxin.user 3KB
MyPoint.h 76B
TransformToPolyline.ncb 29.5MB
win32
debug
HPTransformToPolyline.arx 168KB
HPTransformToPolyline.ilk 829KB
TransformToPolyline.pdb 5.89MB
TransformToPolyline.lib 2KB
TransformToPolyline.exp 715B
共 42 条
- 1
程序员正茂
- 粉丝: 5460
- 资源: 53
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
- 5
- 6
前往页