本文整理汇总了C++中INodeTab::Count方法的典型用法代码示例。如果您正苦于以下问题:C++ INodeTab::Count方法的具体用法?C++ INodeTab::Count怎么用?C++ INodeTab::Count使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类INodeTab
的用法示例。
在下文中一共展示了INodeTab::Count方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: plSharedComponents
int plSharedComponents(INodeTab& nodes, INodeTab& components)
{
components.ZeroCount();
if (nodes.Count() == 0)
return 0;
plMaxNodeBase *firstNode = (plMaxNodeBase*)nodes[0];
int num = firstNode->NumAttachedComponents();
// Resize the list to it's max size to be more efficient
components.SetCount(num);
int i;
// Put all the components on the first node into a list
for (i = 0; i < num; i++)
components[i] = firstNode->GetAttachedComponent(i)->GetINode();
// Delete any components that aren't on all the other nodes
for (i = 1; i < nodes.Count(); i++)
{
plMaxNodeBase *node = (plMaxNodeBase*)nodes[i];
uint32_t count = node->NumAttachedComponents();
for (int j = components.Count()-1; j >= 0; j--)
{
if (!INodeHasComponent(node, (plMaxNodeBase*)components[j]))
components.Delete(j, 1);
}
}
return components.Count();
}
示例2: proc
void DumpHitDialog::proc(INodeTab &nodeTab)
{
int nodeCount = nodeTab.Count();
if (nodeCount == 0) return;
theHold.Begin();
for (int i=0;i<nodeTab.Count();i++)
{
eo->pblock2->Append(pb_nodelist,1,&nodeTab[i]);
macroRecorder->FunctionCall(_T("$.blobMeshOps.AddBlob"), 1, 0,
mr_reftarg,nodeTab[i]);
}
theHold.Accept(GetString(IDS_ADD));
eo->NotifyDependents(FOREVER, PART_GEOM, REFMSG_CHANGE);
eo->ip->RedrawViews(eo->ip->GetTime());
}
示例3: proc
void PFOperatorForceSpaceWarp::proc(INodeTab &nodeTab)
{
if (nodeTab.Count() == 0) return;
theHold.Begin();
pblock()->Append(kForceSpaceWarp_ForceNodeList, nodeTab.Count(), nodeTab.Addr(0));
theHold.Accept(GetString(IDS_PARAMETERCHANGE));
}
示例4: ImportSkeleton
void GR2ImportImpl::OrderBones(INodeTab& bones)
{
if (info.Skeletons.size() == 1)
{
NameNodeMap nodes;
INodeTab rv = ImportSkeleton(*info.Skeletons[0]);
// Strip out auto-generated bones. Place in order found in ini file
for (size_t i = 0, n = rv.Count(); i<n; ++i)
{
INode *node = rv[i];
bool found = false;
for (stringlist::const_iterator itr=boneMatch.begin(), end=boneMatch.end(); itr != end; ++itr)
{
if (wildmatch(*itr, node->GetName())) {
nodes[*itr].Append(1, &node);
found = true;
}
}
if (!found)
{
node->SetUserPropInt("MDBBoneIndex", int(bones.Count()));
bones.Append(1, &node);
}
}
for (stringlist::const_iterator itr=boneMatch.begin(), end=boneMatch.end(); itr != end; ++itr)
{
INodeTab& map = nodes[*itr];
for (size_t i = 0, n = map.Count(); i<n; ++i)
{
INode *node = map[i];
node->SetUserPropInt("MDBBoneIndex", int(bones.Count()));
bones.Append(1, &node);
}
}
// When in face mode, swap the Face Bones for the first N bones in the skeleton.
// Some of the later bones like Head, Neck, Ribcage are still used so we cannot
// discard the whole skeleton.
if (enableFaceMode)
{
size_t curIdx = 0;
for (size_t i = 0, n = bones.Count(); i<n; ++i)
{
INode *node = bones[i];
for (stringlist::const_iterator itr=faceBoneMatch.begin(), end=faceBoneMatch.end(); itr != end; ++itr)
{
if (wildmatch(*itr, node->GetName())) {
bones[i] = bones[curIdx];
bones[curIdx] = node;
node->SetUserPropInt("MDBBoneIndex", int(curIdx));
++curIdx;
break;
}
}
}
}
}
}
示例5: AreNodesOrParentsInTMUpdate
//we need to not only check the expose node and reference node to see if there flags are set, but
//we also need to check their parents since a call on node->GetNodeTM may call node->parent->UpdateTM
//node->parent->parent->UpdateTM.. etc... So all of the parents need to get checked to.
BOOL BaseExposeControl::AreNodesOrParentsInTMUpdate()
{
//collect expose node parents.
if(exposeTransform)
{
INode *exposeNode = exposeTransform->GetExposeNode();
if(exposeNode)
{
INodeTab nodes;
nodes.Append(1,&exposeNode);
CollectParents(nodes,exposeNode);
//simple check to see if referenceNode isn't exposeNodeParent.. if not.. collect them too
INode *refNode = exposeTransform->GetReferenceNode();
if(refNode&&refNode!=exposeNode->GetParentNode())
{
nodes.Append(1,&refNode);
CollectParents(nodes,refNode);
}
for(int i=0;i<nodes.Count();++i)
{
if(nodes[i]->TestAFlag(A_INODE_IN_UPDATE_TM)==TRUE)
return TRUE;
}
}
}
return FALSE;
}
示例6: SelectSources
void TestSplitBySourceDlgProc::SelectSources( HWND hWnd, IParamBlock2* pblock )
{
if (pblock == NULL) return;
if (selectionUpdateInProgress) return;
int allCount = GetPFSystemPool()->NumPFSystems();
HWND hWndSystem = GetDlgItem(hWnd, IDC_SOURCELIST);
int listCount = SendMessage(hWndSystem, LB_GETCOUNT, 0, 0);
if (listCount == LB_ERR) return; // dialog error
if (allCount != listCount) return; // async
selectionUpdateInProgress = true;
INodeTab selNodes;
for(int i=0; i<listCount; i++) {
int selected = SendMessage(hWndSystem, LB_GETSEL, i, 0);
if (selected > 0) {
INode* selNode = GetPFSystemPool()->GetPFSystem(i);
if (selNode != NULL)
selNodes.Append(1, &selNode);
}
}
bool resetSelected = ( selNodes.Count() != pblock->Count(kSplitBySource_sources) );
if (!resetSelected) {
for(int i=0; i<selNodes.Count(); i++)
if (!SBSIsSelectedSource(selNodes[i], pblock))
{ resetSelected = true; break; }
}
if (resetSelected) {
macroRec->Disable();
theHold.Begin();
pblock->ZeroCount(kSplitBySource_sources);
if (selNodes.Count() > 0) {
for(int i=0; i<selNodes.Count(); i++) {
int nodeHandle = (int)selNodes[i]->GetHandle();
pblock->Append(kSplitBySource_sources, 1, &nodeHandle);
}
}
theHold.Accept(GetString(IDS_PARAMETERCHANGE));
macroRec->Enable();
pblock->NotifyDependents( FOREVER, 0, kSplitBySource_RefMsg_MacrorecSources );
}
selectionUpdateInProgress = false;
}
示例7: ResetSel
static void ResetSel()
{
INodeTab selNodes;
GetCOREInterface7()->GetSelNodeTab(selNodes);
if (selNodes.Count() > 0) {
ResetXForm::ResetNodes(selNodes);
}
}
示例8: proc
void DumpHitDialog::proc(INodeTab &nodeTab)
{
int nodeCount = nodeTab.Count();
if (nodeCount == 0) return;
TimeValue t = GetCOREInterface()->GetTime();
for (int i=0;i<nodeTab.Count();i++)
{
macroRecorder->FunctionCall(_T("$.modifiers[#Skin_Morph].skinMorphOps.addBone"), 1, 0,mr_reftarg,nodeTab[i]);
eo->AddBone(nodeTab[i]);
}
eo->BuildTreeList();
}
示例9: GetNode
INode* MaterialUIHandler::GetNode (EPolyMod *pMod){
if (!pMod || !pMod->EpModGetIP()) return NULL;
ModContextList mcList;
INodeTab nodes;
pMod->EpModGetIP()->GetModContexts (mcList, nodes);
INode* objnode = nodes.Count() == 1 ? nodes[0]->GetActualINode(): NULL;
nodes.DisposeTemporary();
return objnode;
}
示例10: proc
void proc(INodeTab &nodeTab)
{
int i;
Tab<int> freeC;
freeC.ZeroCount();
// find available channels
for(i=0;i<100;i++)
{
int tI = i;
if(!mp->chanBank[i].mModded) freeC.Append(1,&tI,0);
}
// If there are less channels than incoming targets, tell the user and quit out
if(nodeTab.Count()>freeC.Count())
{
TSTR buf1(GetString(IDS_NOFREE));
TSTR buf2(GetString(IDS_CANNOT));
MessageBox(mp->hwChannelList,buf1,buf2,MB_ICONSTOP | MB_OK);
goto leapOut;
}
// Do the assignment of nodes
for(i=0;i<nodeTab.Count();i++)
{
UI_MAKEBUSY
if (theHold.Holding())
theHold.Put(new Restore_FullChannel(mp, i ));
mp->ReplaceReference(101+freeC[i],nodeTab[i]);
mp->chanBank[freeC[i]].buildFromNode(nodeTab[i]);
mp->chanBank[freeC[i]].ReNormalize();
UI_MAKEFREE
}
leapOut:
i=0;
}
示例11: PickWhom
void FormationBhvr::PickWhom()
{
int i;
// first set the nodetab to equal the existing nodes to flee
// so that they are selected in the dialog
if (pblock->Count(follower) > 0)
{
INode *node;
SelMaxNodes.Resize(pblock->Count(follower));
SelMaxNodes.SetCount(0);
for (i=0; i<pblock->Count(follower); i++)
{
pblock->GetValue(follower,0,node,FOREVER,i);
SelMaxNodes.Append(1,&node);
}
}
else SelMaxNodes.ZeroCount();
// let the user pick
DoHitObjInMAX.SetSingleSelect(FALSE); // allow multiple selection
if (!GetCOREInterface()->DoHitByNameDialog(&DoHitObjInMAX)) return;
// Set follower to the returned nodes
theHold.Begin();
pblock->Resize(follower,SelMaxNodes.Count());
pblock->SetCount(follower,0);
for (i=0; i<SelMaxNodes.Count(); i++)
pblock->Append(follower,1,&SelMaxNodes[i]);
//zero out the formation matrix that's used for saving it out.
pblock->ZeroCount(follower_matrix1);
pblock->ZeroCount(follower_matrix2);
pblock->ZeroCount(follower_matrix3);
pblock->ZeroCount(follower_matrix4);
theHold.Accept(GetString(IDS_UN_WHOM));
}
示例12: Pick
BOOL PickControlNode::Pick(IObjParam *ip,ViewExp *vpt)
{
if ( ! vpt || ! vpt->IsAlive() )
{
// why are we here
DbgAssert(!_T("Invalid viewport!"));
return FALSE;
}
INode *node = vpt->GetClosestHit();
if (node) {
// RB 3/1/99: This should use the node tm not the object TM. See ModifyObject() imp.
Matrix3 ourTM,ntm = node->GetNodeTM(GetCOREInterface()->GetTime()); //node->GetObjectTM(ip->GetTime());
ModContextList mcList;
INodeTab nodes;
ip->GetModContexts(mcList,nodes);
if (nodes.Count())
{
ourTM = nodes[0]->GetObjectTM(GetCOREInterface()->GetTime());
ourTM = Inverse(ourTM);
Box3 bounds;
bounds.Init();
ObjectState os = node->EvalWorldState(GetCOREInterface()->GetTime());
ViewExp& vp = GetCOREInterface()->GetActiveViewExp();
if ( ! vp.IsAlive() )
{
// why are we here
DbgAssert(!_T("Invalid viewport!"));
return FALSE;
}
os.obj->GetWorldBoundBox(GetCOREInterface()->GetTime(), node, vp.ToPointer(), bounds );
Point3 min = bounds.pmin * ourTM;
Point3 max = bounds.pmax * ourTM;
theHold.Begin();
mod->pblock2->SetValue(particlemesher_customboundsa,0,min);
mod->pblock2->SetValue(particlemesher_customboundsb,0,max);
theHold.Accept(GetString(IDS_BOUNDS));
mod->NotifyDependents(FOREVER,0,REFMSG_CHANGE);
mod->UpdateUI();
}
nodes.DisposeTemporary();
}
return TRUE;
}
示例13: strdup
AnimExportParams::AnimExportParams(const char* _skeletonfilepath, INodeTab& _tabbones, int _startframe, int _endframe, int _frameoffset, int _framerate)
{
int i = 0;
m_skeletonfilepath = strdup(_skeletonfilepath);
m_startframe = _startframe;
m_endframe = _endframe;
m_frameoffset = _frameoffset;
m_framerate = _framerate;
//Copy thr array of nodes
m_tabbones.ZeroCount();
const int num = _tabbones.Count();
for (i=0;i<num;i++)
{
INode* node = _tabbones[i];
m_tabbones.Append(1,&node);
}
}
示例14: TurnVCOn
void VertexPaint::TurnVCOn(BOOL shaded)
{
ModContextList list;
INodeTab NodeTab;
// Only the selected nodes will be affected
ip->GetModContexts(list,NodeTab);
for( int i = 0 ; i < NodeTab.Count() ; i++)
{
if(shaded)
NodeTab[i]->SetShadeCVerts(!NodeTab[i]->GetShadeCVerts());
else
NodeTab[i]->SetCVertMode(!NodeTab[i]->GetCVertMode());
}
NotifyDependents(FOREVER, PART_VERTCOLOR, REFMSG_CHANGE);
ip->RedrawViews(ip->GetTime());
}
示例15: DisplayColors
void FaceDataToColorMod::DisplayColors () {
if (!mpInterface) return;
int channel = 0;
if (mpParams) mpParams->GetValue (pb_channel, TimeValue(0), channel, FOREVER);
ModContextList mcList;
INodeTab nodes;
mpInterface->GetModContexts(mcList,nodes);
for (int nd = 0; nd<nodes.Count(); nd++) {
nodes[nd]->SetCVertMode (true);
nodes[nd]->SetShadeCVerts (true);
if (channel) nodes[nd]->SetVertexColorType (nvct_illumination);
else nodes[nd]->SetVertexColorType (nvct_color);
//nodes[nd]->NotifyDependents (FOREVER, PART_DISPLAY, REFMSG_CHANGE);
}
// KLUGE: above notify dependents call only seems to set a limited refresh region. Result looks bad.
// So we do this instead:
NotifyDependents (FOREVER, PART_DISPLAY, REFMSG_CHANGE);
mpInterface->RedrawViews (mpInterface->GetTime());
}