本文整理汇总了C++中AcDbIntArray::append方法的典型用法代码示例。如果您正苦于以下问题:C++ AcDbIntArray::append方法的具体用法?C++ AcDbIntArray::append怎么用?C++ AcDbIntArray::append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AcDbIntArray
的用法示例。
在下文中一共展示了AcDbIntArray::append方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AppendNewGoafPolygon
static void AppendNewGoafPolygon( const AcGePoint3dArray& polygons,
const AcDbIntArray& polygon_counts,
const AcDbIntArray& colinearEdges,
const AcDbIntArray& parTypes,
const AcGePoint3dArray& ex_spts,
const AcGePoint3dArray& ex_epts,
const AcGeDoubleArray& ex_dirs,
const AcDbIntArray& linePos,
int k,
AcGePoint3dArray& spts,
AcGePoint3dArray& epts,
AcGeDoubleArray& dirs,
AcDbIntArray& gas_types,
AcDbIntArray& gas_linePos )
{
int s = 0;
for( int i = 0; i < k; i++ )
{
s += polygon_counts[i];
}
int t = s + polygon_counts[k];
for( int i = s; i < t; i++ )
{
if( colinearEdges[i] == 0 )
{
spts.append( ex_spts[i] );
epts.append( ex_epts[i] );
dirs.append( ex_dirs );
gas_types.append( parTypes[i] );
gas_linePos.append( linePos[i] );
}
}
}
示例2: ASSERT
void
ArxDbgUtils::collectVertices(const AcDb2dPolyline* pline, AcGePoint3dArray& pts,
AcDbIntArray& types, AcGeDoubleArray& bulges,
AcGeDoubleArray& startWidths,
AcGeDoubleArray& endWidths, bool& hasWidth)
{
ASSERT(pline != NULL);
ASSERT(pts.isEmpty() && bulges.isEmpty());
hasWidth = false;
AcDbObjectIterator* vertexIter = pline->vertexIterator();
ASSERT(vertexIter != NULL);
if (vertexIter == NULL)
return;
AcDb2dVertex* vertex;
for (; !vertexIter->done(); vertexIter->step()) {
if (acdbOpenObject(vertex, vertexIter->objectId(), AcDb::kForRead) == Acad::eOk) {
if (vertex->vertexType() != AcDb::k2dSplineCtlVertex) {
pts.append(pline->vertexPosition(*vertex)); // returns WCS
bulges.append(vertex->bulge());
startWidths.append(vertex->startWidth());
endWidths.append(vertex->endWidth());
if (vertex->startWidth() || vertex->endWidth())
hasWidth = true;
types.append(vertex->vertexType());
}
vertex->close();
}
}
delete vertexIter;
ASSERT(pts.isEmpty() == false);
if (pline->isClosed()) {
AcGePoint3d tmpPt = pts[0]; // used to be a bug in dynamic arrays (not sure if its still there??)
pts.append(tmpPt);
bulges.append(0.0);
int tmpType = types[0];
types.append(tmpType);
double tmpWidth = startWidths[0];
startWidths.append(tmpWidth);
tmpWidth = endWidths[0];
endWidths.append(tmpWidth);
}
}
示例3: GetIntStrList
bool IntStrListHelper::GetIntStrList( const CString& name, AcDbIntArray& intList, AcStringArray& strList )
{
AcStringArray entries;
if( !ArxDictHelper::GetAllEntries( INT_LIST_DICT, name, entries ) ) return false;
int len = entries.length();
bool ret = ( len > 0 && len % 2 == 0 );
if( ret ) // 长度必须为偶数
{
intList.removeAll();
strList.removeAll();
for( int i = 0; i < len; i++ )
{
if( i % 2 == 0 ) // 偶数位置的元素为整数
{
intList.append( _ttoi( entries[i].kACharPtr() ) );
}
else // 奇数位置的元素为字符串
{
strList.append( entries[i] );
}
}
}
return ret;
}
示例4: FindPolygonLinePos
static void FindPolygonLinePos( const AcDbVoidPtrArray& lines,
const AcGePoint3dArray& polygons,
const AcDbIntArray& polygon_counts,
int k,
AcDbIntArray& linePos )
{
int s = 0;
for( int i = 0; i < k; i++ )
{
s += polygon_counts[i];
}
int t = s + polygon_counts[k];
AcGePoint3dArray polygon;
for( int i = s; i < t; i++ )
{
polygon.append( polygons[i] );
}
int n = polygon.length();
for( int i = 0; i < n; i++ )
{
linePos.append( FindLineByPoints( lines, polygon[i], polygon[( i + 1 ) % n] ) );
}
}
示例5: if
void
ArxDbgDbAdeskLogo::getCloneReferences(AcDb::DeepCloneType type,
AcDbObjectIdArray& refIds,
AcDbIntArray& refTypes) const
{
// these types should have been filtered out. NOTE that kDcObjects
// is usually ambiguous and has been mapped to kDcBlock or kDcCopy.
ASSERT((type != AcDb::kDcExplode) &&
(type != AcDb::kDcInsert) &&
(type != AcDb::kDcInsertCopy) &&
(type != AcDb::kDcSymTableMerge) &&
(type != AcDb::kDcXrefBind) &&
(type != AcDb::kDcXrefInsert) &&
(type != AcDb::kDcObjects));
if (type == AcDb::kDcCopy) {
refIds.append(m_arbitraryRefEnt);
refTypes.append(kClone); // you could set this to kNoClone and both would point to the same one.
}
else if (type == AcDb::kDcBlock) {
refIds.append(m_arbitraryRefEnt);
refTypes.append(kClone);
// LongTransactions (RefEdit) will not allow our object to be checked
// out from a block definition unless its accompanying style def is
// also in the check out set (which it won't be by default). So, we
// have to tell ::deepClone() to fake like it cloned the style definition
// so it will pass LongTransaction's checkOut validation.
refIds.append(m_logoStyleId);
refTypes.append(kFakeClone);
}
else if (type == AcDb::kDcWblock) {
refIds.append(m_arbitraryRefEnt);
refTypes.append(kClone);
}
else if (type == AcDb::kDcWblkObjects) {
refIds.append(m_arbitraryRefEnt);
refTypes.append(kClone);
}
else {
ASSERT(0); // which context did we not account for?
}
}
示例6: BuildGoafPolygonArray
void BuildGoafPolygonArray( const AcDbObjectIdArray& objIds, AcGePoint3dArray& polygons, AcDbIntArray& polygon_counts )
{
for( int i = 0; i < objIds.length(); i++ )
{
// 获取采空区的多边形
AcGePoint3dArray polygon;
GetGoafPolygon( objIds[i], polygon );
polygons.append( polygon );
polygon_counts.append( polygon.length() );
}
}
示例7: FindGoafPolygonLinePos
static void FindGoafPolygonLinePos( const AcDbVoidPtrArray& lines,
const AcGePoint3dArray& polygons,
const AcDbIntArray& polygon_counts,
AcDbIntArray& linePos )
{
int n = polygon_counts.length();
for( int i = 0; i < n; i++ )
{
AcDbIntArray ex_linePos;
FindPolygonLinePos( lines, polygons, polygon_counts, i, ex_linePos );
linePos.append( ex_linePos );
}
}
示例8: PartitionGoafPolygons
static void PartitionGoafPolygons( const AcDbVoidPtrArray& ws_lines,
AcGePoint3dArray& polygons,
AcDbIntArray& polygon_counts,
AcDbIntArray& parTypes )
{
for( int i = 0; i < polygon_counts.length(); i++ )
{
AcDbIntArray goaf_parTypes;
PartitionGoafPolygon( ws_lines, polygons, polygon_counts, i, goaf_parTypes );
parTypes.append( goaf_parTypes );
}
}
示例9: AddIntStrPair
bool IntStrListHelper::AddIntStrPair( const CString& name, int intValue, const CString& strValue )
{
if( ( name.GetLength() == 0 ) || strValue.GetLength() == 0 ) return false;
AcStringArray strList;
AcDbIntArray intList;
GetIntStrList( name, intList, strList );
if( intList.contains( intValue ) || strList.contains( strValue ) ) return false;
intList.append( intValue );
strList.append( strValue );
RemoveIntStrList( name );
return AddIntStrList( name, intList, strList );
}
示例10: PartitionGoafPolygon
static bool PartitionGoafPolygon( const AcDbVoidPtrArray& ws_lines,
const AcGePoint3dArray& polygon,
AcDbIntArray& parTypes )
{
AcDbIntArray ws_lines_pos;
int n = polygon.length();
for( int i = 0; i < n; i++ )
{
parTypes.append( 0 ); // 初始化为0(表示错误状态)
if( FindLineByPoints( ws_lines, polygon[i], polygon[( i + 1 ) % n] ) != -1 )
{
ws_lines_pos.append( i );
}
}
acutPrintf( _T( "\n采空区上工作面个数:%d" ), ws_lines_pos.length() );
if( ws_lines_pos.isEmpty() ) return false;
// 假设采空区的工作面不能超过2个
if( ws_lines_pos.length() > 2 ) return false;
// 2个工作面的位置:
// 1) 工作面相邻
// 2) 工作面互为对面
// 3) 其它情况
// 初始化划分类型parTypes;
// 1 -- 两帮
// 2 -- 工作面
// 3 -- 开切眼
for( int i = 0; i < n; i++ )
{
parTypes[i] = 1; // 默认为两帮
}
for( int i = 0; i < ws_lines_pos.length(); i++ )
{
parTypes[ws_lines_pos[i]] = 2;
}
// 这个数只是一个近似估计值
// 黄金比例0.382/0.618,而其衍生比例0.236/0.764,0.146/0.854,0.5/0.5
// http://blog.eastmoney.com/junjun1997/blog_130654962.html
const double c = 0.854;
// 查找公共的开切眼
// 使用数组cut_counts标记分支被视为开切眼的次数
AcDbIntArray cut_counts;
for( int i = 0; i < n; i++ )
{
cut_counts.append( 0 );
}
for( int i = 0; i < ws_lines_pos.length(); i++ )
{
AcDbIntArray cuts;
PartitionPolygon( polygon, ws_lines_pos[i], cuts, c );
for( int j = 0; j < cuts.length(); j++ )
{
cut_counts[cuts[j]]++;
}
}
for( int i = 0; i < cut_counts.length(); i++ )
{
// 如果被视为开切眼的次数等于工作面的个数
// 则该分支视为公共的开切眼
if( cut_counts[i] == ws_lines_pos.length() )
{
parTypes[i] = 3;
}
}
return true;
}