本文整理汇总了C++中SWIFT_Array::Copy_Length方法的典型用法代码示例。如果您正苦于以下问题:C++ SWIFT_Array::Copy_Length方法的具体用法?C++ SWIFT_Array::Copy_Length怎么用?C++ SWIFT_Array::Copy_Length使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SWIFT_Array
的用法示例。
在下文中一共展示了SWIFT_Array::Copy_Length方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Decompose_DFS
//.........这里部分代码省略.........
sfs[top]->Edge3().Twin()->Prev()->Origin() )
) {
cvs_idx.Add( m->Vertex_Id(
sfs[top]->Edge3().Twin()->Prev()->Origin() ) );
sfs[top+1] = sfs[top]->Edge3().Twin()->Adj_Face();
top++;
// Mark all the faces that were added to the chull
for( j = l; j < addedfs.Length(); j++ ) {
fallowed[addedfs[j]] = false;
if( m->Faces()[addedfs[j]].Unmarked() ) {
m->Faces()[addedfs[j]].Mark();
piece_ids[addedfs[j]] = id;
temp_mfs_1d.Add( addedfs[j] );
}
}
l = addedfs.Length();
continue;
} else {
mark_failed.Add( sfs[top]->Edge3().Twin()->Adj_Face() );
sfs[top]->Edge3().Twin()->Adj_Face()->Mark();
fallowed[m->Face_Id(sfs[top]->Edge3().Twin()->Adj_Face())]
= false;
}
}
top--;
}
// Unmark all the failed faces.
for( j = 0; j < mark_failed.Length(); j++ ) {
mark_failed[j]->Unmark();
fallowed[m->Face_Id( mark_failed[j] )] = true;
}
// Copy the virtual faces for this piece
for( j = 0, k = 0; j < chull.Length(); j++ ) {
if( chull[j].Unmarked() && cfs[j] == NULL ) {
k++;
}
}
created_faces += k;
vfs[id].Create( k );
for( j = 0, k = 0; j < chull.Length(); j++ ) {
if( chull[j].Unmarked() && cfs[j] == NULL ) {
vfs[id][k].Set_Normal_N( chull[j].Normal() );
vfs[id][k].Set_Distance( chull[j].Distance() );
vfs[id][k].Edge1().Set_Direction_N(
chull[j].Edge1().Direction() );
vfs[id][k].Edge2().Set_Direction_N(
chull[j].Edge2().Direction() );
vfs[id][k].Edge3().Set_Direction_N(
chull[j].Edge3().Direction() );
vfs[id][k].Edge1().Set_Length( chull[j].Edge1().Length() );
vfs[id][k].Edge2().Set_Length( chull[j].Edge2().Length() );
vfs[id][k].Edge3().Set_Length( chull[j].Edge3().Length() );
vfs[id][k].Edge1().Set_Origin( chull[j].Edge1().Origin() );
vfs[id][k].Edge2().Set_Origin( chull[j].Edge2().Origin() );
vfs[id][k].Edge3().Set_Origin( chull[j].Edge3().Origin() );
vfs[id][k].Edge1().Set_Twin( chull[j].Edge1().Twin() );
vfs[id][k].Edge2().Set_Twin( chull[j].Edge2().Twin() );
vfs[id][k].Edge3().Set_Twin( chull[j].Edge3().Twin() );
chull[j].Edge1().Twin()->Set_Twin( vfs[id][k].Edge1P() );
chull[j].Edge2().Twin()->Set_Twin( vfs[id][k].Edge2P() );
chull[j].Edge3().Twin()->Set_Twin( vfs[id][k].Edge3P() );
k++;
}
}
// Copy the model faces for this piece
temp_mfs_2d[id].Copy_Length( temp_mfs_1d );
id++;
if( !random ) {
p++;
}
}
temp_mfs_2d.Set_Length( id );
vfs.Set_Length( id );
// Unmark all the faces and edges
for( i = 0; i < m->Num_Faces(); i++ ) {
m->Faces()[i].Unmark();
m->Faces()[i].Edge1().Unmark();
m->Faces()[i].Edge2().Unmark();
m->Faces()[i].Edge3().Unmark();
}
// Copy the mfs
mfs.Copy_Length( temp_mfs_2d );
for( i = 0; i < temp_mfs_2d.Length(); i++ ) {
temp_mfs_2d[i].Nullify();
}
cerr << "Created " << id << " pieces" << endl;
cerr << "Original faces = " << m->Num_Faces() << endl;
cerr << "Created virtual faces = " << created_faces << endl << endl;
return id;
}
示例2: Decompose_Cresting_BFS
//.........这里部分代码省略.........
qmap[j] = -1;
} else {
qmap[j] = qfs.Length();
qmap_idx.Add( j );
}
qfs.Add( m->Faces()(j) );
m->Faces()(j)->Mark();
qfs_parents.Add( qfs[front] );
}
if( qfs[front]->Edge3().Marked() &&
qfs[front]->Edge3().Twin()->Adj_Face()->Unmarked()
) {
j = m->Face_Id( qfs[front]->Edge3().Twin()->Adj_Face() );
if( qmap[j] == -2 ) {
qmap[j] = -1;
} else {
qmap[j] = qfs.Length();
qmap_idx.Add( j );
}
qfs.Add( m->Faces()(j) );
m->Faces()(j)->Mark();
qfs_parents.Add( qfs[front] );
}
} else {
mark_failed.Add( qfs[front] );
}
front++;
}
// Unmark all the failed faces.
for( j = 0; j < mark_failed.Length(); j++ ) {
mark_failed[j]->Unmark();
}
// Copy the virtual faces for this piece
for( j = 0, k = 0; j < chull.Length(); j++ ) {
if( chull[j].Unmarked() && cfs[j] == NULL ) {
k++;
}
}
created_faces += k;
vfs[id].Create( k );
for( j = 0, k = 0; j < chull.Length(); j++ ) {
if( chull[j].Unmarked() && cfs[j] == NULL ) {
vfs[id][k].Set_Normal_N( chull[j].Normal() );
vfs[id][k].Set_Distance( chull[j].Distance() );
vfs[id][k].Edge1().Set_Direction_N(
chull[j].Edge1().Direction() );
vfs[id][k].Edge2().Set_Direction_N(
chull[j].Edge2().Direction() );
vfs[id][k].Edge3().Set_Direction_N(
chull[j].Edge3().Direction() );
vfs[id][k].Edge1().Set_Length( chull[j].Edge1().Length() );
vfs[id][k].Edge2().Set_Length( chull[j].Edge2().Length() );
vfs[id][k].Edge3().Set_Length( chull[j].Edge3().Length() );
vfs[id][k].Edge1().Set_Origin( chull[j].Edge1().Origin() );
vfs[id][k].Edge2().Set_Origin( chull[j].Edge2().Origin() );
vfs[id][k].Edge3().Set_Origin( chull[j].Edge3().Origin() );
vfs[id][k].Edge1().Set_Twin( chull[j].Edge1().Twin() );
vfs[id][k].Edge2().Set_Twin( chull[j].Edge2().Twin() );
vfs[id][k].Edge3().Set_Twin( chull[j].Edge3().Twin() );
chull[j].Edge1().Twin()->Set_Twin( vfs[id][k].Edge1P() );
chull[j].Edge2().Twin()->Set_Twin( vfs[id][k].Edge2P() );
chull[j].Edge3().Twin()->Set_Twin( vfs[id][k].Edge3P() );
k++;
}
}
// Copy the model faces for this piece
temp_mfs_2d[id].Copy_Length( temp_mfs_1d );
id++;
// Remove this face from the priority queue
Delete_From_Heap( lengths, bmap, fmap, fmap[i] );
}
temp_mfs_2d.Set_Length( id );
vfs.Set_Length( id );
// Unmark all the faces and edges
for( i = 0; i < m->Num_Faces(); i++ ) {
m->Faces()[i].Unmark();
m->Faces()[i].Edge1().Unmark();
m->Faces()[i].Edge2().Unmark();
m->Faces()[i].Edge3().Unmark();
}
// Copy the mfs
mfs.Copy_Length( temp_mfs_2d );
for( i = 0; i < temp_mfs_2d.Length(); i++ ) {
temp_mfs_2d[i].Nullify();
}
cerr << "Created " << id << " pieces" << endl;
cerr << "Original faces = " << m->Num_Faces() << endl;
cerr << "Created virtual faces = " << created_faces << endl << endl;
return id;
}