Пример #1
0
/*!
  Returns the value of the primary key of this tuple.

*/
const QString QmvTuple::primarykeyValue()
{
    if (parentClass()->primaryKey())
        return(attributeValue(parentClass()->primaryKey()));
    else
        return 0;
}
Пример #2
0
/*!
  Returns the value of the user key of this tuple.

*/
const QString QmvTuple::userkeyValue()
{
    if (parentClass()->userKey())
        return(attributeValue(parentClass()->userKey()));
    else
        return 0;
}
Пример #3
0
// ----------------------------------------------------------------------
// ----------------------------------------------------------------------
const QString QmvTuple::htmlLabel()
{
    QString label;
    QTextOStream x_out(&label);

        // remove plurals
    QString title = parentClass()->relationTitle() ;
    title.replace( QRegExp("s$"), "" );
    
    x_out << "<table width=100% cellpadding=0 cellspacing=0>";
    x_out << QString("<tr><th bgcolor=yellow align=left colspan=2>%1 Details</th></tr>")
        .arg( title);

    QmvAttList attlist = parent_class->sortedAttlist( "mtat_view_order",
                                                      QmvClass::NoBlank|QmvClass::NoSystem|QmvClass::NoZero );

    for (QmvAttribute * at_ptr = attlist.first(); at_ptr != 0; at_ptr = attlist.next())
    {
        QString value = attributeValue(at_ptr->attributeName());
        switch ( at_ptr->inputMethod() )
        {
            case QmvAttribute::Colour:
                    // strip the alpha value (expecting form .. #AARRGGBB
                value.replace(1, 2, "");
                x_out << QString("<tr><td>%1:</td><td bgcolor=%2></td></tr>")
                    .arg(at_ptr->attributeTitle())
                    .arg(value);

                break;

            default:
                x_out << QString("<tr><td>%1:</td><td><strong>%2</strong></td></tr>")
                    .arg(at_ptr->attributeTitle())
                    .arg(value);
                break;
        }
    }
    
    x_out << "</table>";
    
    return label;
}
Пример #4
0
MStatus kgLocator::initialize()

{
	

	MFnUnitAttribute  unitFn;
	MStatus stat;
	
	//Let us inherit the attributes,
	//in case we need it
	MString parentClass("MPxLocatorNode");
	stat = inheritAttributesFrom( parentClass );
	
	//Create the height attribute
	height = unitFn.create( "height", "h", MFnUnitAttribute::kDistance );
	unitFn.setDefault( MDistance( 2.0,  MDistance::uiUnit() ) );
	unitFn.setMin( MDistance( 0.0,  MDistance::uiUnit() ) );	
	stat = addAttribute( height );
	if (!stat )
	{
		stat.perror( "Unable to add \"height\" attribute");
		return stat;
		
	}


	//generates points for drwing the locator
	getPoints( pts );
	
	
	// Notify Maya that there is an associated manipulator for this particular type of node
	MPxManipContainer::addToManipConnectTable( const_cast<MTypeId &>( id ) );
	
	return MS::kSuccess;
	
}