当前位置: 首页>>代码示例>>C++>>正文


C++ INodeTab::Append方法代码示例

本文整理汇总了C++中INodeTab::Append方法的典型用法代码示例。如果您正苦于以下问题:C++ INodeTab::Append方法的具体用法?C++ INodeTab::Append怎么用?C++ INodeTab::Append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在INodeTab的用法示例。


在下文中一共展示了INodeTab::Append方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: 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;
}
开发者ID:artemeliy,项目名称:inf4715,代码行数:33,代码来源:ExposeControllers.cpp

示例2: 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;
               }
            }
         }
      }
   }
}
开发者ID:fantasydr,项目名称:nwn2dev,代码行数:58,代码来源:GR2Import.cpp

示例3: CollectNonDrawables

void plClickDragComponent::CollectNonDrawables(INodeTab& nonDrawables)
{
    INode* boundsNode = fCompPB->GetINode(kClickDragProxy);
    if(boundsNode && fCompPB->GetInt(kClickDragUseProxy))
        nonDrawables.Append(1, &boundsNode);

    boundsNode = fCompPB->GetINode(kClickDragProxyRegion);
    if(boundsNode )
        nonDrawables.Append(1, &boundsNode);

}
开发者ID:Asteral,项目名称:Plasma,代码行数:11,代码来源:plClickDragComponent.cpp

示例4: AddTargetsToList

void plComponentBase::AddTargetsToList(INodeTab& list)
{
    int i;
    for( i = 0; i < NumTargets(); i++ )
    {
        INode* targ = GetTarget(i);
        if( targ )
            list.Append(1, &targ);
    }
}
开发者ID:Drakesinger,项目名称:Plasma,代码行数:10,代码来源:plComponentBase.cpp

示例5: CollectNonDrawables

void plVolumeGadgetComponent::CollectNonDrawables(INodeTab& nonDrawables) 
{ 
    if(fCompPB->GetInt(kUseVolumeNode))
    {
        INode* boundsNode = fCompPB->GetINode(kVolumeNode);
        if( boundsNode )
            nonDrawables.Append(1, &boundsNode);
    }

    AddTargetsToList(nonDrawables); 
}
开发者ID:cwalther,项目名称:Plasma-nobink-test,代码行数:11,代码来源:plVolumeGadgetComponent.cpp

示例6: CollectParents

//recursive function to put parents in tab.
static void CollectParents(INodeTab &tab,INode *node)
{
	if(node)
	{
		INode *pNode = node->GetParentNode();
		if(pNode&&pNode!=GetCOREInterface()->GetRootNode())
		{
			tab.Append(1,&pNode);
			CollectParents(tab,pNode);
		}
	}
}
开发者ID:artemeliy,项目名称:inf4715,代码行数:13,代码来源:ExposeControllers.cpp

示例7: proc

// Note: don't return DEP_ENUM_SKIP when we hit a node. From review comments:
// It wants to gather all the dependant particle groups which are base nodes and have a particle group interface.
// This could skip groups that are not direct descendants to the head Particle Flow Object.
// So if you had a Particle Flow object that had a test that referenced another particle group, then that 
// second group had test that referenced another group.  That second particle group would get skipped.  
int MyEnumProc::proc(ReferenceMaker *rmaker) 
{ 
	if ((rmaker != nullptr) && (rmaker->SuperClassID()==BASENODE_CLASS_ID))
	{
		INode* inode = dynamic_cast<INode*>(rmaker);
		if (!Nodes.Contains(inode))
		{
			Nodes.Append(1, (INode **)&rmaker);  
		}
	}
	return DEP_ENUM_CONTINUE;
}
开发者ID:innovatelogic,项目名称:ilogic-vm,代码行数:17,代码来源:particlemesher.cpp

示例8: ExportCalSkel_cf

Value* ExportCalSkel_cf(Value** arg_list, int count)
{	
	int			i;
	INodeTab	tabnode;
	std::tstring fullpathfilename;
	int			ArraySize		;
	bool		bShowUI			;

	check_arg_count(ExportCalSkel, 3, count);
	type_check(arg_list[0], String, _T("[The first argument of ExportCalSkel should be a string that is a full path name of the file to export]"));
	type_check(arg_list[1], Array , _T("[The 2nd argument of ExportCalSkel should be an array of nodes]"));
	type_check(arg_list[2], Boolean,_T("[The 3rd argument of ExportCalSkel should be a boolean that tells if you want to use the UI or not to select nodes of skeleton]"));
	
	try
	{
		fullpathfilename	= arg_list[0]->to_string();

		//Get Array
		Array* BonesArray	= static_cast<Array*>(arg_list[1]);
		ArraySize			= BonesArray->size;	

		bShowUI				= !!(arg_list[2]->to_bool());

		if (fullpathfilename.length() == 0) return new Integer (1);
		if (! ArraySize)		return new Integer (2);
 
		for (i=0;i<ArraySize;i++)
		{
			if (BonesArray->data[i]->is_kind_of(class_tag(MAXNode)) )
			{
				INode* _node	= 	BonesArray->data[i]->to_node();
				if (! _node)return new Integer (3);

				tabnode.Append(1,&_node);
			}
		}

		//Call the exporter from Maxscript
		if (CMaxSkeletonExport::ExportSkeletonFromMaxscriptCall(fullpathfilename.c_str(), tabnode, bShowUI) )
			return new Integer (0);

		return new Integer (-1);
	}
	catch(...)
	{	
		//MessageBox(NULL,"Exception catched in ExportCalSkel C++ function","Error",MB_OK);
		return new Integer (-2);
	}
}
开发者ID:imvu,项目名称:cal3d,代码行数:49,代码来源:MaxSkeletonExportDesc.cpp

示例9: 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;
}
开发者ID:artemeliy,项目名称:inf4715,代码行数:47,代码来源:PFTestSplitBySource_ParamBlock.cpp

示例10: 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));
}
开发者ID:innovatelogic,项目名称:ilogic-vm,代码行数:39,代码来源:formation.cpp

示例11: ImportPackedNiTriStripsShape

bool CollisionImport::ImportPackedNiTriStripsShape(INode *rbody, bhkRigidBodyRef body, bhkPackedNiTriStripsShapeRef shape, INode *parent, Matrix3& tm)
{
	if (hkPackedNiTriStripsDataRef data = shape->GetData())
	{
		Matrix3 ltm(true);
		vector<Vector3> verts = data->GetVertices();
		vector<Triangle> tris = data->GetTriangles();
		vector<Vector3> norms = data->GetNormals();

		vector<Niflib::OblivionSubShape> subshapes = (ni.IsFallout3() || ni.IsSkyrim()) ? shape->GetSubShapes() : data->GetSubShapes();
		if (subshapes.size() == 0)
		{
			// Is this possible?
			INode *inode = ImportCollisionMesh(verts, tris, norms, tm, parent);
			CreatebhkCollisionModifier(inode, bv_type_packed, HavokMaterial(NP_DEFAULT_HVK_MATERIAL), OL_UNIDENTIFIED, 0);
			ImportBase(body, shape, parent, inode, ltm);
			AddShape(rbody, inode);
		}
		else
		{
			unsigned int voff = 0;
			unsigned int toff = 0;

			INodeTab nodes;
			for (int i = 0, n = subshapes.size(); i<n; ++i) {
				Niflib::OblivionSubShape& s = subshapes[i];
				
				vector<Vector3> subverts;
				vector<Triangle> subtris;
				vector<Vector3> subnorms;
				
				subverts.reserve(s.numVertices);
				for (unsigned int v=voff; v < (voff + s.numVertices); ++v) {
					subverts.push_back( verts[v] );
				}
				unsigned int vend = (voff + s.numVertices );

				// TODO: Fix algorithm.  I do not know how to split the triangles here
				//       Basically, greedily take all triangles until next subshape
				//       This is not correct but seems to work with most meshes tested.
				subtris.reserve( s.numVertices / 2 );
				subnorms.reserve( s.numVertices / 2 );
				while ( toff < tris.size() ){
					Triangle t = tris[toff];
					if ( t.v1 >= vend || t.v2 >= vend || t.v3 >= vend )
						break;
					// remove offset for mesh
					t.v1 -= voff; t.v2 -= voff; t.v3 -= voff;
					subtris.push_back( t );	
					subnorms.push_back( norms[toff] );	
					++toff;
				}
				voff += s.numVertices;

				INode *inode = ImportCollisionMesh(subverts, subtris, subnorms, tm, parent);

				CreatebhkCollisionModifier(inode, bv_type_packed, HavokMaterial(s.material), s.layer, s.colFilter);
				ImportBase(body, shape, parent, inode, ltm);

				if (n > 1)
					inode->SetName( FormatText("%s:%d", "OblivionSubShape", i).data() );

				nodes.Append(1, &inode);
			}
			// TODO: Group nodes on import
			if (  nodes.Count() > 1 )
			{
				TSTR shapeName = "bhkPackedNiTriStripsShape";
				INode *group = ni.gi->GroupNodes(&nodes, &shapeName, 0);			
				AddShape(rbody, group);
			}
			else if (  nodes.Count() == 1 )
			{
				AddShape(rbody, nodes[0]);
			}
		}
		return true;
	}

	return false;
}
开发者ID:ElliotWood,项目名称:max_nif_plugin,代码行数:81,代码来源:ImportCollision.cpp

示例12: ExportCalSkel_cf

Value* ExportCalSkel_cf(Value** arg_list, int count)
{	
	int			i;
	INodeTab	tabnode;
	char*		fullpathfilename;
	int			ArraySize		;
	bool		bShowUI			;
  bool bUseAxisGL=false; 

  // Cedric Pinson, now we can export in gl coordinates
	check_arg_count_with_keys(ExportCalSkel, 3, count);
	Value* transform= key_arg_or_default(transform, &false_value);
	type_check(transform, Boolean, "[The axisGL argument of ExportCalSkel should be a boolean that is true if you want to export in openGL axis]");

	type_check(arg_list[0], String, "[The first argument of ExportCalSkel should be a string that is a full path name of the file to export]");
	type_check(arg_list[1], Array , "[The 2nd argument of ExportCalSkel should be an array of nodes]");
	type_check(arg_list[2], Boolean,"[The 3rd argument of ExportCalSkel should be a boolean that tells if you want to use the UI or not to select nodes of skeleton]");
	
	try
	{
		fullpathfilename	= arg_list[0]->to_string();
    bUseAxisGL       = (transform->to_bool() != 0);

		//Get Array
		Array* BonesArray	= static_cast<Array*>(arg_list[1]);
		ArraySize			= BonesArray->size;	

		bShowUI				= !!(arg_list[2]->to_bool());

		if (! strcmp(fullpathfilename,"")) return new Integer (1);
		if (! ArraySize)		return new Integer (2);
 
		for (i=0;i<ArraySize;i++)
		{
			if (BonesArray->data[i]->is_kind_of(class_tag(MAXNode)) )
			{
				INode* _node	= 	BonesArray->data[i]->to_node();
				if (! _node)return new Integer (3);

				tabnode.Append(1,&_node);
			}
		}

    theExporter.SetAxisGL(bUseAxisGL);


		//Call the exporter from Maxscript
    if (CMaxSkeletonExport::ExportSkeletonFromMaxscriptCall(fullpathfilename,tabnode, bShowUI) ) {
      // reset axis gl
      theExporter.SetAxisGL(false);
			return new Integer (0);
    }
    theExporter.SetAxisGL(false);
		return new Integer (-1);
	}
	catch(...)
	{	
    theExporter.SetAxisGL(false);

		//MessageBox(NULL,"Exception catched in ExportCalSkel C++ function","Error",MB_OK);
		return new Integer (-2);
	}
}
开发者ID:ingeyu,项目名称:airengine,代码行数:63,代码来源:MaxSkeletonExportDesc.cpp

示例13: ExportCalAnim_cf

Value* ExportCalAnim_cf(Value** arg_list, int count)
{	
	int i								;
	char*	Filefullpathfilename		;
	char*	Skeletonfullpathfilename	;
	Array*	BonesArray					;
	int		StartFrame					;
	int		EndFrame					;
	int		FrameOffset					;
	int		FrameRate					;
  bool   bUseAxisGL=false;

  // Cedric Pinson, now we can export in gl coordinates
	check_arg_count_with_keys(ExportCalAnim, 7, count);
	Value* transform= key_arg_or_default(transform, &false_value);
	type_check(transform, Boolean, "[The axisGL argument of ExportCalAnim should be a boolean that is true if you want to export in openGL axis]");

	type_check(arg_list[0], String	, "[The first argument of ExportCalAnim should be a string that is a full path name of the file to export]");
	type_check(arg_list[1], String	, "[The 2nd argument of ExportCalAnim should be a string that is the fullpath name of the skeleton file]");
	type_check(arg_list[2], Array	, "[The 3rd argument of ExportCalAnim should be an array of nodes to get anim from]");
	type_check(arg_list[3], Integer	, "[The 4th argument of ExportCalAnim should be an integer that is the start frame number]");
	type_check(arg_list[4], Integer	, "[The 5th argument of ExportCalAnim should be an integer that is the end frame number]");
	type_check(arg_list[5], Integer , "[The 6th argument of ExportCalAnim should be an integer that is the frame offset]");
	type_check(arg_list[6], Integer , "[The 7th argument of ExportCalAnim should be an integer that is the framerate]");
	
	try
	{
  bool   bUseAxisGL=false;

  // Cedric Pinson, now we can export in gl coordinates
	check_arg_count_with_keys(ExportCalAnim, 7, count);
	Value* transform= key_arg_or_default(transform, &false_value);
	type_check(transform, Boolean, "[The axisGL argument of ExportCalAnim should be a boolean that is true if you want to export in openGL axis]");
		Filefullpathfilename		= arg_list[0]->to_string();
		Skeletonfullpathfilename	= arg_list[1]->to_string();
		BonesArray					= static_cast<Array*>(arg_list[2]);
		StartFrame					= arg_list[3]->to_int();
		EndFrame					= arg_list[4]->to_int();
		FrameOffset					= arg_list[5]->to_int();
		FrameRate					= arg_list[6]->to_int();

		if (! strcmp(Filefullpathfilename,""))return new Integer(1);

		if (! strcmp(Skeletonfullpathfilename,"")) return new Integer(2);

		//Does skeleton file exist ?
		FILE* _stream;
		_stream = fopen(Skeletonfullpathfilename,"r");
		if (! _stream)return new Integer(3); //Error code number 3
		fclose(_stream);

		//Get the elements of the bones array
		int ArraySize;
    bUseAxisGL       = (transform->to_bool() != 0);

		ArraySize = BonesArray->size;

		if (! ArraySize) return new Integer(4);
		
		if (StartFrame < 0)	return new Integer(5);

		if (EndFrame < 0)return new Integer(6);

		if (StartFrame > EndFrame ) return new Integer(7);

		if (FrameOffset < 0) return new Integer(8);

		if (FrameRate < 0) return new Integer(9);

		INodeTab	tabnode;
		for (i=0;i<ArraySize;i++)
		{
			if (BonesArray->data[i]->is_kind_of(class_tag(MAXNode)) )
			{
				INode* _node	= 	BonesArray->data[i]->to_node();
				if (! _node)return new Integer(10);
				tabnode.Append(1,&_node);
			}
		}		
		
		AnimExportParams param(Skeletonfullpathfilename, tabnode, StartFrame, EndFrame, FrameOffset, FrameRate);

    theExporter.SetAxisGL(bUseAxisGL); // set axis wanted
    if (CMaxAnimationExport::ExportAnimationFromMaxscriptCall(Filefullpathfilename, &param)) {
      //reset to default
      theExporter.SetAxisGL(false);
			return new Integer(0);
    }


    theExporter.SetAxisGL(false);
		return new Integer(-1);
	}


	catch(...)
	{	
    theExporter.SetAxisGL(false);
		//MessageBox(NULL,"Exception catched in ExportCalAnim C++ function","Error",MB_OK);
		return new Integer(-2);
//.........这里部分代码省略.........
开发者ID:ingeyu,项目名称:airengine,代码行数:101,代码来源:MaxAnimationExportDesc.cpp


注:本文中的INodeTab::Append方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。