本文整理汇总了C++中ProgressBar::PutStep方法的典型用法代码示例。如果您正苦于以下问题:C++ ProgressBar::PutStep方法的具体用法?C++ ProgressBar::PutStep怎么用?C++ ProgressBar::PutStep使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProgressBar
的用法示例。
在下文中一共展示了ProgressBar::PutStep方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ctxt
XSIPLUGINCALLBACK CStatus Coat3DExport_Execute( CRef& in_ctxt )
{
// Unpack the command argument values
Context ctxt( in_ctxt );
CValueArray args = ctxt.GetAttribute(L"Arguments");
CString string;
// A 3d object with a mesh geometry must be selected
Selection selection(app.GetSelection());
bool isPolymesh = true;
for(int i =0; i< selection.GetCount(); i++)
{
X3DObject obj(selection[i]);
//app.LogMessage(L"obj.IsA(siPolygonMeshID): " + CString(obj.GetType()));
if(obj.GetType() != L"polymsh" )
{
isPolymesh = false;
break;
}
}
if (selection.GetCount() > 0 && isPolymesh)
{
gV = 0; gVn = 0; gVt = 0;
gVprev = 0; gVnPrev = 0; gVtPrev = 0;
// prepare the output text file
CString strOut = Get3DCoatParam( L"tempLocation" ).GetValue();
std::ofstream mfw;
mfw.open(strOut.GetAsciiString(), std::ios_base::out | std::ios_base::trunc);
if (mfw.is_open())
{
bar.PutMaximum( selection.GetCount() );
bar.PutStep( 1 );
bar.PutVisible( true );
OutputHeader( mfw);
// output the data
for (int i=0; i < selection.GetCount(); i++)
{
gObjCnt = i;
gVprev = gV;
gVtPrev = gVt;
gVnPrev = gVn;
X3DObject xobj(selection.GetItem(i));
bar.PutValue(i);
bar.PutCaption( L"Exporting " + xobj.GetName());
mfw << "\n";
mfw << "# Hierarchy (from self to top father)\n";
string = L"g " + xobj.GetName() + L"\n";
mfw << string.GetAsciiString();
mfw << "\n";
// Get a geometry accessor from the selected object
Primitive prim = xobj.GetActivePrimitive();
PolygonMesh mesh = prim.GetGeometry();
if (!mesh.IsValid()) return CStatus::False;
CGeometryAccessor ga = mesh.GetGeometryAccessor();
OutputVertices( mfw, ga, xobj );
if (bar.IsCancelPressed()) return CStatus::False;
OutputPolygonComponents( mfw, ga );
if (bar.IsCancelPressed()) return CStatus::False;
//bar.Increment();
}
}
mfw.close();
if(Get3DCoatParam(L"bExpMat").GetValue())
{
OutputMaterials(selection );
}
bar.PutStatusText( L"import.txt" );
OutputImportTxt();
bar.PutVisible(false);
app.LogMessage(L"Export done!");
}
else
{
app.LogMessage(L"Please, select objects!", siWarningMsg);
return CStatus::False;
}
return CStatus::OK;
}