本文整理汇总了C++中UT_String::fileName方法的典型用法代码示例。如果您正苦于以下问题:C++ UT_String::fileName方法的具体用法?C++ UT_String::fileName怎么用?C++ UT_String::fileName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UT_String
的用法示例。
在下文中一共展示了UT_String::fileName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cookMySop
// the bit that does all the work
OP_ERROR SOP_rmanPtc::cookMySop(OP_Context &context)
{
// get some useful bits & bobs
UT_Interrupt *boss;
float now = context.myTime;
UT_String ptcFile = getPtcFile(now);
int loadPercentage = getLoadPercentage(now);
int displayPercentage = getDisplayPercentage(now);
float pointSize = getPointSize(now);
int useDisk = getUseDisk(now);
int boundOnLoad = getBoundOnLoad(now);
int displayChannel = getDisplayChannel(now);
int onlyOutputDisplayChannel = getOnlyOutputDisplayChannel(now);
/*
float nearDensity = getNearDensity(now);
float farDensity = getFarDensity(now);
UT_String cullCamera = getCullCamera(now);
*/
// lock out inputs
if ( lockInputs(context) >= UT_ERROR_ABORT)
error();
// Check to see that there hasn't been a critical error in cooking the SOP.
if (error() < UT_ERROR_ABORT)
{
boss = UTgetInterrupt();
// here we make sure our detail is an instance of rmanPtcDetail
rmanPtcDetail *ptc_gdp = dynamic_cast<rmanPtcSop::rmanPtcDetail *>(gdp);
if ( !ptc_gdp )
ptc_gdp = allocateNewDetail();
// clear our gdp
ptc_gdp->clearAndDestroy();
// start our work
boss->opStart("Loading point cloud");
// get our bbox
bool has_bbox = false;
const GU_Detail *input_geo = inputGeo( 0, context );
updateBBox( input_geo );
// pass information to our detail
ptc_gdp->point_size = pointSize;
ptc_gdp->use_disk = useDisk;
ptc_gdp->cull_bbox = mBBox;
ptc_gdp->use_cull_bbox = (mHasBBox&&(!mBoundOnLoad))?true:false;
ptc_gdp->display_probability = displayPercentage/100.f;
ptc_gdp->display_channel = displayChannel;
if ( onlyOutputDisplayChannel )
ptc_gdp->display_channel = 0;
// here we load our ptc
if ( mReload )
{
// clear everything
mChannelNames.clear();
cachePoints.clear();
cacheNormals.clear();
cacheRadius.clear();
cacheData.clear();
mRedraw = true;
// open the point cloud
PtcPointCloud ptc = PtcSafeOpenPointCloudFile(
const_cast<char*>(ptcFile.buffer()) );
if ( !ptc )
{
UT_String msg( "Unable to open input file: " );
msg += ptcFile;
addError( SOP_MESSAGE, msg);
boss->opEnd();
return error();
}
// get some information from the ptc
ptc_gdp->path = std::string(ptcFile.fileName());
char **vartypes, **varnames;
PtcGetPointCloudInfo( ptc, const_cast<char*>("npoints"),
&ptc_gdp->nPoints );
PtcGetPointCloudInfo( ptc, const_cast<char*>("npointvars"),
&ptc_gdp->nChannels );
PtcGetPointCloudInfo( ptc, const_cast<char*>("pointvartypes"),
&vartypes );
PtcGetPointCloudInfo( ptc, const_cast<char*>("pointvarnames"),
&varnames );
PtcGetPointCloudInfo( ptc, const_cast<char*>("datasize"),
&ptc_gdp->datasize );
PtcGetPointCloudInfo( ptc, const_cast<char*>("bbox"),
ptc_gdp->bbox );
// process our channel names
ptc_gdp->types.clear();
ptc_gdp->names.clear();
for ( unsigned int i=0; i<ptc_gdp->nChannels; ++i )
{
ptc_gdp->types.push_back( std::string(vartypes[i]) );
//.........这里部分代码省略.........