本文整理汇总了C++中Modifier类的典型用法代码示例。如果您正苦于以下问题:C++ Modifier类的具体用法?C++ Modifier怎么用?C++ Modifier使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Modifier类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
Modifier *CMaxMesh::FindSkinModifier(INode *pINode)
{
#if MAX_RELEASE >= 4000
// get the object reference of the node
Object *pObject;
pObject = pINode->GetObjectRef();
if(pObject == 0) return 0;
// loop through all derived objects
while(pObject->SuperClassID() == GEN_DERIVOB_CLASS_ID)
{
IDerivedObject *pDerivedObject;
pDerivedObject = static_cast<IDerivedObject *>(pObject);
// loop through all modifiers
int stackId;
for(stackId = 0; stackId < pDerivedObject->NumModifiers(); stackId++)
{
// get the modifier
Modifier *pModifier;
pModifier = pDerivedObject->GetModifier(stackId);
// check if we found the skin modifier
if(pModifier->ClassID() == SKIN_CLASSID) return pModifier;
}
// continue with next derived object
pObject = pDerivedObject->GetObjRef();
}
#endif
return 0;
}
示例2: load_ARGUMENT
// <ARGUMENT>
void SettingLoader::load_ARGUMENT(Modifier *o_arg)
{
Modifier modifier;
for (int i = Modifier::Type_begin; i != Modifier::Type_end; ++ i)
modifier.dontcare(static_cast<Modifier::Type>(i));
*o_arg = load_MODIFIER(Modifier::Type_ASSIGN, modifier);
}
示例3: getImmediate
bool ValueRef::getImmediate(ImmediateValue &imm) const
{
const ValueRef *src = this;
Modifier m;
DataType type = src->insn->sType;
while (src) {
if (src->mod) {
if (src->insn->sType != type)
break;
m *= src->mod;
}
if (src->getFile() == FILE_IMMEDIATE) {
imm = *(src->value->asImm());
// The immediate's type isn't required to match its use, it's
// more of a hint; applying a modifier makes use of that hint.
imm.reg.type = type;
m.applyTo(imm);
return true;
}
Instruction *insn = src->value->getUniqueInsn();
if (insn && insn->op == OP_MOV) {
src = &insn->src(0);
if (src->mod)
WARN("OP_MOV with modifier encountered !\n");
} else {
src = NULL;
}
}
return false;
}
示例4: while
ISkin* MaxExportPlugin::FindSkinModifier(INode* node)
{
Object* object = node->GetObjectRef();
if (!object)
return 0;
while (object->SuperClassID() == GEN_DERIVOB_CLASS_ID && object)
{
IDerivedObject* derivedObject = (IDerivedObject*)object;
int modStackId = 0;
while (modStackId < derivedObject->NumModifiers())
{
Modifier* mod = derivedObject->GetModifier(modStackId);
//file << "MODIFIER: " << std::to_wstring(mod->ClassID().PartA()) << " " << std::to_wstring(mod->ClassID().PartB()) << "\n";
if (mod->ClassID() == SKIN_CLASS_ID)
{
return (ISkin*)(mod->GetInterface(I_SKIN));
}
modStackId++;
}
object = derivedObject->GetObjRef();
}
return 0;
}
示例5: FindPhysiqueModifier
// ================================================== FindPhysiqueModifier()
// Find if a given node contains a Physique Modifier
// DerivedObjectPtr requires you include "modstack.h" from the MAX SDK
Modifier* FindPhysiqueModifier (INode* nodePtr)
{
// Get object from node. Abort if no object.
Object* ObjectPtr = nodePtr->GetObjectRef();
if ( NULL == ObjectPtr) return NULL;
// Is derived object ?
if (ObjectPtr->SuperClassID() == GEN_DERIVOB_CLASS_ID){
// Yes -> Cast.
IDerivedObject* DerivedObjectPtr = static_cast<IDerivedObject*>(ObjectPtr);
// Iterate over all entries of the modifier stack.
int ModStackIndex = 0;
while (ModStackIndex < DerivedObjectPtr->NumModifiers()){
// Get current modifier.
Modifier* ModifierPtr = DerivedObjectPtr->GetModifier(ModStackIndex);
Class_ID clsid = ModifierPtr->ClassID();
// Is this Physique ?
if (ModifierPtr->ClassID() == Class_ID(PHYSIQUE_CLASS_ID_A, PHYSIQUE_CLASS_ID_B))
{
// Yes -> Exit.
return ModifierPtr;
}
// Next modifier stack entry.
ModStackIndex++;
}
}
// Not found.
return NULL;
}
示例6: while
Modifier* PhyExportUtil::findPhysiqueModifier( INode* node )
{
// Get object from node. Abort if no object.
::Object* obj = node->GetObjectRef();
if ( !obj )
return 0;
// Is derived object ?
while ( obj->SuperClassID() == GEN_DERIVOB_CLASS_ID && obj )
{
// Yes -> Cast.
IDerivedObject* derivedObj = static_cast<IDerivedObject*>( obj );
// Iterate over all entries of the modifier stack.
for ( int modStackIndex = 0 ; modStackIndex < derivedObj->NumModifiers() ; ++modStackIndex )
{
// Get current modifier.
Modifier* modPtr = derivedObj->GetModifier( modStackIndex );
// Is this Physique ?
if ( modPtr->ClassID() == Class_ID(PHYSIQUE_CLASS_ID_A, PHYSIQUE_CLASS_ID_B) )
{
// Yes -> Exit.
return modPtr;
}
}
obj = derivedObj->GetObjRef();
}
// Not found.
return 0;
}
示例7: GetObjectRef
//// FindSkinModifier ///////////////////////////////////////////////////////
// Given an INode, gets the ISkin object of that node, or nil if there is
// none. Taken from the Max4 SDK, ISkin.h
ISkin* plMaxNodeBase::FindSkinModifier()
{
int modStackIndex;
// Get object from node. Abort if no object.
Object *pObj = GetObjectRef();
if( pObj == nil )
return nil;
// Is derived object ?
while( pObj->SuperClassID() == GEN_DERIVOB_CLASS_ID )
{
IDerivedObject *pDerObj = (IDerivedObject *)pObj;
// Iterate over all entries of the modifier stack.
for( modStackIndex = 0; modStackIndex < pDerObj->NumModifiers(); modStackIndex++ )
{
// Get current modifier.
Modifier *mod = pDerObj->GetModifier( modStackIndex );
// Is this Skin ?
if( mod->ClassID() == SKIN_CLASSID )
{
ISkin* skin = (ISkin*)mod->GetInterface(I_SKIN);
if( skin->GetNumBones() > 0 )
return skin;
}
}
pObj = pDerObj->GetObjRef();
}
// Not found.
return nil;
}
示例8: accept_modifier
void accept_modifier( Modifier const& m )
{
optionally_assign( m_value_handler, m, handler );
optionally_assign( m_value_interpreter, m, interpreter );
if( m.has( default_value ) ) {
BOOST_RT_PARAM_VALIDATE_LOGIC( !m_value_generator,
BOOST_RT_PARAM_LITERAL( "multiple value generators for parameter" ) );
T const& dv_ref = m[default_value];
m_value_generator = rt_cla_detail::const_generator<T>( dv_ref );
}
if( m.has( default_refer_to ) ) {
BOOST_RT_PARAM_VALIDATE_LOGIC( !m_value_generator,
BOOST_RT_PARAM_LITERAL( "multiple value generators for parameter" ) );
cstring ref_id = m[default_refer_to];
m_value_generator = rt_cla_detail::ref_generator<T>( ref_id );
}
if( m.has( assign_to ) ) {
BOOST_RT_PARAM_VALIDATE_LOGIC( !m_value_handler,
BOOST_RT_PARAM_LITERAL( "multiple value handlers for parameter" ) );
m_value_handler = rt_cla_detail::assigner<T>( m[assign_to] );
}
}
示例9: while
Modifier* SGP_MaxInterface::FindModifier(INode *pINode, Class_ID id)
{
// get the object reference of the node
Object *pObject;
pObject = pINode->GetObjectRef();
if(pObject == NULL)
return NULL;
// loop through all derived objects
while(pObject->SuperClassID() == GEN_DERIVOB_CLASS_ID)
{
IDerivedObject *pDerivedObject;
pDerivedObject = static_cast<IDerivedObject *>(pObject);
// loop through all modifiers
int stackId;
for(stackId = 0; stackId < pDerivedObject->NumModifiers(); stackId++)
{
// get the modifier
Modifier *pModifier;
pModifier = pDerivedObject->GetModifier(stackId);
// check if we found the modifier
if(pModifier->ClassID() == id)
return pModifier;
}
// continue with next derived object
pObject = pDerivedObject->GetObjRef();
}
return NULL;
}
示例10: GetModifier
/*
====================
GetModifier
====================
*/
static Modifier* GetModifier( INode* i_node, Class_ID cid )
{
// Get object from node. Abort if no object.
Object* object = i_node->GetObjectRef();
if(!object) return NULL;
// Is derived object ?
if( object->SuperClassID() == GEN_DERIVOB_CLASS_ID )
{
// Yes -> Cast.
IDerivedObject* derived_object = static_cast< IDerivedObject* >( object );
// Iterate over all entries of the modifier stack.
int modStackIndex = 0;
while( modStackIndex < derived_object->NumModifiers() )
{
// Get current modifier.
Modifier* modifier = derived_object->GetModifier( modStackIndex );
// Is this ?
if( modifier->ClassID() == cid )
{
// Yes -> Exit.
return modifier;
}
// Next modifier stack entry.
modStackIndex++;
}
}
// Not found.
return NULL;
}
示例11: load
void load( config_file_iterator cf_it, Modifier const& m )
{
cstring vm = m.has( value_marker ) ? m[value_marker] : BOOST_RT_PARAM_CSTRING_LITERAL( "\"" );
cstring vd = m.has( value_delimeter ) ? m[value_delimeter] : BOOST_RT_PARAM_CSTRING_LITERAL( "= \t\n\r" );
cstring nd = m.has( namespace_delimeter ) ? m[namespace_delimeter] : BOOST_RT_PARAM_CSTRING_LITERAL( "::" );
load_impl( cf_it, vm, vd, nd );
}
示例12: TEST_F
TEST_F(CuckooTestFilled, DoesNotReplace) {
std::unique_ptr<int> value(new int(8713));
crossbow::allocator alloc;
Modifier m = table->modifier();
for (auto e : entries) {
ASSERT_FALSE(m.insert(e, value.get(), false)) << "Replaced value for " << e;
}
}
示例13: operator
uint64_t operator()(const Modifier& modifier) const {
uint64_t h = static_cast<size_t>(modifier.getAttributeID());
h <<= 16;
h |= static_cast<size_t>(modifier.getModifier()->getAttributeID());
h <<= 4;
h |= static_cast<size_t>(modifier.getAssociation());
return h;
}
示例14: getModifier
//---------------------------------------------------------------
ISkinInterface* SkinController::getSkinInterface( INode *node )
{
Modifier *m = getModifier();
if (m->ClassID() == SKIN_CLASSID)
return new SkinInterface(m, node );
if (m->ClassID() == PHYSIQUE_CLASSID)
return new PhysiqueSkinInterface(m, node);
return 0;
}
示例15: addbend
void addbend()
{
try
{
float radius = 10, height = 10, angle = 10;
int segments = 20;
// Create a new object using CreateInstance()
Object *obj = (Object*)CreateInstance(GEOMOBJECT_CLASS_ID, Class_ID(CYLINDER_CLASS_ID, 0));
// Get ahold of the parameter block
IParamArray *iCylParams = obj->GetParamBlock();
// Get the current animation time
TimeValue time = GetCOREInterface()->GetTime();
// Set the value of radius, height and segments.
iCylParams->SetValue(obj->GetParamBlockIndex(CYLINDER_RADIUS), time, radius);
iCylParams->SetValue(obj->GetParamBlockIndex(CYLINDER_HEIGHT), time, height);
iCylParams->SetValue(obj->GetParamBlockIndex(CYLINDER_SEGMENTS), time, segments);
auto* ip = GetCOREInterface();
INode *node = ip->CreateObjectNode(obj);
//Create a new object using CreateInstance()
auto pINode = ip->GetSelNode(0);
log(L"New node name is {0} : \n", pINode->GetName());
// Get the current animation time
/*iCylParams->SetValue(obj->GetParamBlockIndex(CYLINDER_RADIUS), time, 10);
iCylParams->SetValue(obj->GetParamBlockIndex(CYLINDER_HEIGHT), time, 20);
iCylParams->SetValue(obj->GetParamBlockIndex(CYLINDER_SEGMENTS), time, 10);*/
// Create a bend modifier
Modifier *bend = (Modifier*)ip->CreateInstance(OSM_CLASS_ID, Class_ID(BENDOSM_CLASS_ID, 0));
log(L"{}",bend->GetName().data());
// Set the bend angle
IParamBlock2* ipBendBlock = ((Animatable*)bend)->GetParamBlock(0); //only one pblock2
//ipBendBlock->SetValue(BEND_ANGLE, time, 10);
ipBendBlock->SetValue(BEND_ANGLE, time, angle);
GetCOREInterface12()->AddModifier(*pINode, *bend);
GetCOREInterface12()->AddModifier(*node, *bend);
}
catch (const std::exception& e)
{
/*e.what();
log("Exception: " + std::string(e.what()));*/
}
}