本文整理汇总了C++中DataBase::set方法的典型用法代码示例。如果您正苦于以下问题:C++ DataBase::set方法的具体用法?C++ DataBase::set怎么用?C++ DataBase::set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataBase
的用法示例。
在下文中一共展示了DataBase::set方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pit
void
PlotWidget::saveMarkers (DataBase &db)
{
// save plot markers
QHashIterator<QString, Plot *> pit(_plots);
while (pit.hasNext())
{
pit.next();
Plot *p = pit.value();
QHash<QString, Marker *> markers = p->markers();
QHashIterator<QString, Marker *> mit(markers);
while (mit.hasNext())
{
mit.next();
Marker *m = mit.value();
if (m->readOnly())
continue;
if (! m->modified())
continue;
Entity *e = m->settings();
e->setName(mit.key());
db.transaction();
db.set(e);
db.commit();
m->setModified(FALSE);
}
}
}
示例2: reader
// *****************************************************************************
MStatus GtoIO::reader( const MFileObject &file,
const MString &optionsString,
MPxFileTranslator::FileAccessMode mode )
{
MString filename = file.fullName();
bool readAsDifference = false;
int fs = 0;
int fe = 0;
MStringArray args;
optionsString.split( ';', args );
for( size_t i = 0; i < args.length(); ++i )
{
MStringArray thisArg;
args[i].split( '=', thisArg );
MString argName( thisArg[0] );
MString argValue( thisArg[1] );
if( argName == "readDiff" && argValue == "1" )
{
readAsDifference = true;
}
else if( argName == "fs" )
{
fs = argValue.asInt();
}
else if( argName == "fe" )
{
fe = argValue.asInt();
}
}
if( readAsDifference )
{
MGlobal::displayInfo( "PreMunge name: " + filename );
if( filename.index( '#' ) < 0 )
{
// By this point, Maya will have already appended a
// ".gto" to the filename if the user didn't include it,
// so we're guaranteed to find a '.' in the filename
filename = filename.substring( 0, filename.index( '.' ) )
+ "#.gto";
}
for( int f = fs; f <= fe; ++f )
{
MGlobal::viewFrame( MTime( double(f) ) );
MString fname = replaceFrameCookies( filename, f );
MGlobal::displayInfo( "Reading " + fname );
DataBase dataBase;
Set *set = dataBase.set( fname.asChar() );
if( set == NULL )
{
MGlobal::displayError( "Unable to open file for some "
"reason. Permissions?" );
return MS::kFailure;
}
set->computeLocalTransforms();
set->declareMayaDiff();
dataBase.destroyAll();
}
}
else
{
DataBase dataBase;
Set *set = dataBase.set( filename.asChar() );
if( set == NULL )
{
MGlobal::displayError( "Unable to open file for some "
"reason. Permissions?" );
return MS::kFailure;
}
set->computeLocalTransforms();
set->declareMaya();
set->reparentAll();
dataBase.destroyAll();
}
return MS::kSuccess;
}