本文整理汇总了C++中AcDbIntArray::length方法的典型用法代码示例。如果您正苦于以下问题:C++ AcDbIntArray::length方法的具体用法?C++ AcDbIntArray::length怎么用?C++ AcDbIntArray::length使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AcDbIntArray
的用法示例。
在下文中一共展示了AcDbIntArray::length方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FindGasBoundary
// 查找采空区的其它边
void FindGasBoundary( const AcDbObjectIdArray& objIds,
const AcDbVoidPtrArray& lines,
AcGePoint3dArray& spts,
AcGePoint3dArray& epts,
AcGeDoubleArray& dirs,
AcDbIntArray& gas_types,
AcDbObjectIdArray& gas_objIds )
{
// 查找所有的采空区
AcDbObjectIdArray goaf_objIds;
FindAllGoafs( goaf_objIds );
// 将采空区多边形转换成一个1维数组
AcGePoint3dArray polygons;
AcDbIntArray polygon_counts;
BuildGoafPolygonArray( goaf_objIds, polygons, polygon_counts );
// 标记采空区分支是否与其它采空区有共线边
AcDbIntArray colinearEdges;
FindPolygonColinearEdges( polygons, polygon_counts, colinearEdges );
// 查找所有的工作面
AcDbVoidPtrArray ws_lines;
FilterLines( lines, ws_lines, true );
// 划分采空区多边形(工作面、两帮、开切眼)
AcDbIntArray parTypes;
PartitionGoafPolygons( ws_lines, polygons, polygon_counts, parTypes );
assert( parTypes.length() == polygons.length() );
// 工作面需要特殊处理
AcDbIntArray gas_linePos;
AdjustGoafPolygon(
lines, polygons, polygon_counts,
colinearEdges, parTypes,
spts, epts, dirs,
gas_types, gas_linePos );
assert( gas_types.length() == gas_linePos.length() );
for( int i = 0; i < gas_linePos.length(); i++ )
{
int pos = gas_linePos[i];
if( pos != -1 )
{
gas_objIds.append( objIds[pos] );
}
else
{
gas_objIds.append( AcDbObjectId::kNull );
}
}
}
示例2: doRegEval
bool EvalService::doRegEval( const CString& regulation, const AcDbIntArray& clauses )
{
// 规程评价没有实现或者尚未注册
EvalMethod* pEvalMethod = m_pEvalMethodManager->getEvalMethodByName( regulation );
if( pEvalMethod == 0 ) return false;
EvalResultGenerator* pEvalResultGenerator = CreateEvalResultGenerator( pEvalMethod );
// 创建数据库操作对象
CDaoDatabase* pDB = createDB( m_evalResultDataBasePath, false ); // 每次评价都重建数据库(删除已存在的数据库)
TableCreator* pTableCreator = new TableCreator( pDB );
DataWriter* pDataWriter = new DataWriter( pDB );
int len = clauses.length();
for( int i = 0; i < len; i++ )
{
pEvalResultGenerator->startEval();
pEvalResultGenerator->setClauseNum( clauses[i] );
pEvalResultGenerator->initEvalData();
pEvalResultGenerator->createTable( pTableCreator );
pEvalResultGenerator->initEvalObject();
pEvalResultGenerator->writeToTable( pDataWriter );
pEvalResultGenerator->endEval();
}
delete pTableCreator;
delete pDataWriter;
pDB->Close();
delete pDB;
delete pEvalResultGenerator;
return true;
}
示例3: subMoveGripPointsAt
Acad::ErrorStatus TailraceGEDraw::subMoveGripPointsAt( const AcDbIntArray& indices, const AcGeVector3d& offset )
{
assertWriteEnabled () ;
for( int i = 0; i < indices.length(); i++ )
{
int idx = indices.at( i );
if ( idx == 0 )
{
m_insertPt += offset; // 插入点偏移
caculPts();
}
// if(idx == 1)
// {
// // 1) 计算x轴的端点坐标
// AcGeVector3d v(AcGeVector3d::kXAxis);
// v.rotateBy(m_angle,AcGeVector3d::kZAxis);
// v.rotateBy(3.1415926/2,AcGeVector3d::kZAxis);
// AcGePoint3d pt = m_insertPt + v*m_lenth;
//
// // 2) 进行坐标偏移计算
// pt += offset;
//
// // 坐标相减,得到一个向量,然后得到向量长度
// m_lenth = (pt - m_insertPt).length();
// caculPts();
// }
}
return Acad::eOk;
}
示例4: WriteGoafTBGasDataFile
void WriteGoafTBGasDataFile( const CString& filepath,
const AcGePoint3dArray& vertices, const AcDbIntArray& edges,
const AcDbIntArray& faces, const AcDbIntArray& faces_info,
const AcDbIntArray& goafs,
const GasParam& gp )
{
CStdioFile outfile;
outfile.Open( filepath, CFile::modeCreate | CFile::modeWrite );
// 写入采空区个数
CString str;
str.Format( _T( "%d\n" ), goafs.length() );
outfile.WriteString( str );
// 写入采空区总面积
double area = CaclTotalGoafArea( vertices, edges, faces, faces_info, goafs );
str.Format( _T( "%.4f\n" ), area );
outfile.WriteString( str );
// 写入(采空区+顶底板)瓦斯涌出量之和
double q = gp.f1 + gp.f4 + gp.f5;
str.Format( _T( "%.4f\n" ), q );
outfile.WriteString( str );
outfile.Close();
}
示例5: AdjustGoafPolygon
static void AdjustGoafPolygon( const AcDbVoidPtrArray& lines,
const AcGePoint3dArray& polygons,
const AcDbIntArray& polygon_counts,
const AcDbIntArray& colinearEdges,
const AcDbIntArray& parTypes,
AcGePoint3dArray& spts,
AcGePoint3dArray& epts,
AcGeDoubleArray& dirs,
AcDbIntArray& gas_types,
AcDbIntArray& gas_linePos )
{
// 查找所有采空区边对应的直线
AcDbIntArray goaf_linePos;
FindGoafPolygonLinePos( lines, polygons, polygon_counts, goaf_linePos );
// 分解所有的分支
AcGePoint3dArray ex_spts, ex_epts;
AcGeDoubleArray ex_dirs;
AdjustAndExplodeGoafPolygons( lines, polygons, polygon_counts, ex_spts, ex_epts, ex_dirs );
assert( ex_spts.length() == polygons.length() );
for( int i = 0; i < polygon_counts.length(); i++ )
{
AppendNewGoafPolygon(
polygons, polygon_counts,
colinearEdges, parTypes,
ex_spts, ex_epts, ex_dirs,
goaf_linePos,
i,
spts, epts, dirs,
gas_types,
gas_linePos );
}
}
示例6: subMoveGripPointsAt
Acad::ErrorStatus DoubleArcTunnelDraw::subMoveGripPointsAt( const AcDbIntArray& indices, const AcGeVector3d& offset )
{
assertWriteEnabled () ;
for( int i = 0; i < indices.length(); i++ )
{
int idx = indices.at( i );
if ( idx == 0 )
{
m_startPt += offset;
}
if ( idx == 1 )
{
m_endPt += offset;
}
// 弧的中点
if ( idx == 2 )
{
m_thirdPt += offset;
}
}
return Acad::eOk;
}
示例7: WriteWallFacility
static void WriteWallFacility( CStdioFile& outfile,
const AcDbIntArray& split_faces,
const AcDbIntArray& split_faces_info,
const AcDbIntArray split_face_edges )
{
CString str;
str.Format( _T( "%d\n" ), split_face_edges.length() );
outfile.WriteString( str );
}
示例8: FormatIntListMsg
static void FormatIntListMsg( const AcDbIntArray& intList, const AcStringArray& strList, const CString& name, CString& msg )
{
msg.Format( _T( "【%s】数据列表:\n" ), name );
int len = intList.length();
for( int i = 0; i < len; i++ )
{
msg.AppendFormat( _T( "%d\t%s\n" ), intList[i], strList[i].kACharPtr() );
}
}
示例9: CaclTotalGoafArea
static double CaclTotalGoafArea( const AcGePoint3dArray& vertices, const AcDbIntArray& edges,
const AcDbIntArray& faces, const AcDbIntArray& faces_info,
const AcDbIntArray& goafs )
{
double S = 0;
for( int i = 0; i < goafs.length(); i++ )
{
S += FacePolygonArea( vertices, edges, faces, faces_info, goafs[i] );
}
return S;
}
示例10: WriteGasBoundaryData
static void WriteGasBoundaryData( CStdioFile& outfile,
const AcGePoint3dArray& gas_spts,
const AcGePoint3dArray& gas_epts,
const AcGeDoubleArray& gas_dirs,
const AcDbIntArray& gas_types,
const GasParam& gp,
const GasBoundaryDataArray& gas_datas )
{
// 两帮平均瓦斯涌出
double q1 = AverageGas( gas_spts, gas_epts, gas_types, gp, 1 );
// 工作面平均瓦斯涌出
//double q2 = AverageGas(gas_spts, gas_epts, gas_types, gp, 2);
// 开切眼平均瓦斯涌出
double q3 = AverageGas( gas_spts, gas_epts, gas_types, gp, 3 );
// 瓦斯边界个数
CString str;
str.Format( _T( "%d\n" ), gas_types.length() );
outfile.WriteString( str );
// 瓦斯边界数据
for( int i = 0; i < gas_types.length(); i++ )
{
switch( gas_types[i] )
{
case 1:
str.Format( _T( "%.4f\n" ), q1 );
break;
case 2:
//str.Format(_T("%.4f\n"), q2);
str.Format( _T( "%.4f\n" ), CaclWSGas( gas_datas[i].q, gas_spts[i], gas_epts[i] ) );
break;
case 3:
str.Format( _T( "%.4f\n" ), q3 );
break;
}
outfile.WriteString( str );
}
}
示例11: subMoveGripPointsAt
Acad::ErrorStatus SimpleChimneyDraw::subMoveGripPointsAt ( const AcDbIntArray& indices, const AcGeVector3d& offset )
{
assertWriteEnabled () ;
for( int i = 0; i < indices.length(); i++ )
{
int idx = indices.at( i );
m_pts[idx] += offset;
}
return Acad::eOk;
}
示例12: AddIntStrList
bool IntStrListHelper::AddIntStrList( const CString& name, const AcDbIntArray& intList, const AcStringArray& strList )
{
if( ( name.GetLength() == 0 ) || strList.isEmpty() || intList.isEmpty() ) return false;
if( intList.length() != strList.length() ) return false;
ArxDictTool* pDictTool = ArxDictTool::GetDictTool( INT_LIST_DICT );
bool ret = pDictTool->findKey( name );
if( !ret )
{
int len = intList.length();
for( int i = 0; i < len; i++ )
{
CString intValue;
intValue.Format( _T( "%d" ), intList[i] );
pDictTool->addEntry( name, intValue ); // 偶数位置的元素为整数
pDictTool->addEntry( name, strList[i].kACharPtr() ); // 奇数位置的元素为字符串
}
}
delete pDictTool;
return !ret;
}
示例13: subMoveGripPointsAt
Acad::ErrorStatus SimpleWindLibraryDraw::subMoveGripPointsAt ( const AcDbIntArray& indices, const AcGeVector3d& offset )
{
assertWriteEnabled () ;
for( int i = 0; i < indices.length(); i++ )
{
int idx = indices.at( i );
// 始节点
if ( idx == 0 ) m_insertPt += offset;
}
return Acad::eOk;
}
示例14: 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 );
}
}
示例15: IsPointInGoafPolygon
static bool IsPointInGoafPolygon( const AcGePoint3dArray& polygons, const AcDbIntArray& polygon_counts, const AcGePoint3d& pt )
{
bool ret = false;
for( int i = 0; i < polygon_counts.length(); i++ )
{
if( IsPointInGoafPolygon( polygons, polygon_counts, i, pt ) )
{
ret = true;
break;
}
}
return ret;
}