本文整理汇总了C++中Tab::Append方法的典型用法代码示例。如果您正苦于以下问题:C++ Tab::Append方法的具体用法?C++ Tab::Append怎么用?C++ Tab::Append使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tab
的用法示例。
在下文中一共展示了Tab::Append方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Validate
BOOL PFOperatorInstanceShapeMXSValidator::Validate(PB2Value& v)
{
INode* iNode = (INode*)v.r;
if (iNode == NULL) return NULL;
TimeValue t = GetCOREInterface()->GetTime();
Tab<INode*> stack;
stack.Append(1, &iNode, 10);
while (stack.Count())
{
INode *node = stack[stack.Count()-1];
stack.Delete(stack.Count()-1, 1);
Object *obj = node->EvalWorldState(t).obj;
if (obj->CanConvertToType(Class_ID(TRIOBJ_CLASS_ID, 0)))
return TRUE;
// add children to the stack
for (int i = 0; i < node->NumberOfChildren(); i++) {
INode *childNode = node->GetChildNode(i);
if (childNode) stack.Append(1, &childNode, 10);
}
}
return FALSE;
}
示例2: HitTestCrossSection
BOOL SplineData::HitTestCrossSection(GraphicsWindow *gw, HitRegion hr, SplineMapProjectionTypes projType, Tab<int> &hitSplines, Tab<int> &hitCrossSections)
{
hitSplines.SetCount(0);
hitCrossSections.SetCount(0);
DWORD limit = gw->getRndLimits();
gw->setRndLimits(( limit | GW_PICK) & ~GW_ILLUM);
gw->setHitRegion(&hr);
//loop through splines
for (int splineIndex = 0; splineIndex < mSplineElementData.Count();splineIndex++)
{
if (mSplineElementData[splineIndex]->IsSelected())
{
for (int crossSectionIndex = 0; crossSectionIndex < NumberOfCrossSections(splineIndex); crossSectionIndex++)
{
SplineCrossSection section = mSplineElementData[splineIndex]->GetCrossSection(crossSectionIndex);
Matrix3 crossSectionTM = section.mTM;
gw->setTransform(crossSectionTM);
gw->clearHitCode();
mSplineElementData[splineIndex]->DisplayCrossSections(gw, crossSectionIndex,projType );
if (gw->checkHitCode())
{
hitSplines.Append(1,&splineIndex,10);
hitCrossSections.Append(1,&crossSectionIndex,10);
}
}
}
}
return hitSplines.Count();
}
示例3: GetCollapseTypes
void PrismObject::GetCollapseTypes(Tab<Class_ID> &clist,Tab<TSTR*> &nlist)
{
Object::GetCollapseTypes(clist, nlist);
Class_ID id = EDITABLE_SURF_CLASS_ID;
TSTR *name = new TSTR(GetString(IDS_SM_NURBS_SURFACE));
clist.Append(1,&id);
nlist.Append(1,&name);
}
示例4: GetPaintHosts
void EditPolyMod::GetPaintHosts( Tab<MeshPaintHost*>& hosts, Tab<INode*>& paintNodes ) {
ModContextList mcList;
INodeTab nodes;
ip->GetModContexts(mcList,nodes);
EditPolyData* modData = NULL;
for (int i=0; i<mcList.Count(); i++ ) {
if( (modData=(EditPolyData*)mcList[i]->localData)== NULL) continue;
MeshPaintHost* host = modData;
hosts.Append( 1, &(host) );
INode *pNode = nodes[i]->GetActualINode();
paintNodes.Append( 1, &pNode );
}
nodes.DisposeTemporary();
}
示例5: DebugPrint
void Unreal3DExport::ExportNode( IGameNode * child )
{
DebugPrint( _T("ExportNode: %s\n"), child->GetName() );
CheckCancel();
ProgressMsg.printf(GetString(IDS_INFO_ENUM_OBJ),NodeIdx,NodeCount,TSTR(child->GetName()));
pInt->ProgressUpdate(Progress+((float)NodeIdx/NodeCount*U3D_PROGRESS_ENUM), FALSE, ProgressMsg.data());
++NodeIdx;
if( child->IsGroupOwner() )
{
// do nothing
}
else
{
IGameObject * obj = child->GetIGameObject();
switch(obj->GetIGameType())
{
case IGameObject::IGAME_MESH:
{
if( !bIgnoreHidden || !child->IsNodeHidden() )
{
Nodes.Append(1,&child);
}
break;
}
case IGameObject::IGAME_HELPER:
{
if( !bIgnoreHidden || !child->IsNodeHidden() )
{
TrackedNodes.Append(1,&child);
}
}
break;
}
child->ReleaseIGameObject();
}
for( int i=0; i<child->GetChildCount(); ++i )
{
IGameNode * n = child->GetNodeChild(i);
ExportNode(n);
}
}
示例6: Proc
bool UnflaggedNodeNamer::Proc(INode * pNode)
{
if (!m_namelist) return false;
// otherwise, grab the list of node names and stick them in namelist
if (! pNode->TestAFlag(A_WORK1)) {
TSTR * pName = new TSTR(pNode->GetName()); // consumer must delete
m_namelist->Append(1, &pName, 5);
}
return true;
}
示例7:
void SplineData::GetSelectedCrossSections(Tab<int> &selSplines, Tab<int> &selCrossSections)
{
selSplines.SetCount(0);
for (int i = 0; i < mSplineElementData.Count(); i++)
{
if (mSplineElementData[i]->IsSelected())
{
for (int j = 0; j < NumberOfCrossSections(i); j++)
{
if (CrossSectionIsSelected(i,j))
{
selCrossSections.Append(1,&j,10);
selSplines.Append(1,&i,10);
}
}
}
}
}
示例8: IFindFaceSet
void plDistributor::IFindFaceSet(const Box3& box, Tab<int32_t>& faces) const
{
Tab<int32_t> distNodes;
fMeshTree.HarvestBox(box, distNodes);
int i;
for( i = 0; i < distNodes.Count(); i++ )
{
int32_t iFace = int32_t(fMeshTree.GetBox(distNodes[i]).fIData);
faces.Append(1, &iFace);
}
}
示例9: CollectMeshFaces
void CModelExporter::CollectMeshFaces( Tab<FaceEx*>& faceList, IGameMesh* pMesh, size_t uMatID, BOOL bMultiMat )
{
if(!bMultiMat)
{
for(int x = 0; x < pMesh->GetNumberOfFaces(); x++)
{
FaceEx* pTemp = pMesh->GetFace(x);
faceList.Append(1, &pTemp);
}
}
else
faceList = pMesh->GetFacesFromMatID(uMatID);
}
示例10: GetCurrentTM
//From SpringSysClient
//*************************************************
Tab<Matrix3> Jiggle::GetForceMatrices(TimeValue t)
{
Tab<Matrix3> tms;
INode* node;
Matrix3 parentTM;
parentTM = GetCurrentTM(t);
tms.Append(1, &parentTM);
for (int x=1;x<dyn_pb->Count(jig_control_node); x++)
{
Interval for_ever = FOREVER;
dyn_pb->GetValue(jig_control_node, 0, node, for_ever, x);
if (node)
{
Matrix3 mat = node->GetNodeTM(t);
tms.Append(1, &mat);
}
}
return tms;
}
示例11: ConvertSelectedToXrefScene
void Xrefutil::ConvertSelectedToXrefScene(HWND hWnd)
{
// *** ConvertSelectedToXrefScene ***
//
// Relatively simple -- take the selected nodes, save them out
// to a new .MAX file, delete the selected nodes from the
// current scene, and then do a RootNode->AddNewXRefFile
// with the just-saved MAX file.
INode * pNode = NULL;
TSTR filename = _T("");
int i;
INode * pRootNode = m_pInterface->GetRootNode();
if (!pRootNode) {
// well, this is actually _really_ bad, but we just exit
return;
}
if (m_pInterface->GetSelNodeCount() == 0) {
::MessageBox(hWnd, GetString(IDS_ERR3), ERROR_TITLE, MB_ICONSTOP | MB_OK);
return;
}
Tab<INode *> nodetab;
nodetab.ZeroCount();
nodetab.Shrink();
for (i = 0; i < m_pInterface->GetSelNodeCount(); i++) {
pNode = m_pInterface->GetSelNode(i);
nodetab.Append(1, &pNode, 5);
}
if (!DoOpenSaveDialog(filename)) {
// either cancel or fail, just return
return;
}
m_pInterface->FileSaveSelected(filename);
// delete selected nodes, don't refresh yet
for (i = 0; i < nodetab.Count(); i++) {
nodetab[i]->Delete(0,TRUE);
}
AssetUser asset = IAssetManager::GetInstance()->GetAsset(filename,kXRefAsset);
// add in the nodes we saved out as an xref'd scene
pRootNode->AddNewXRefFile(asset, TRUE);
m_pInterface->RedrawViews(m_pInterface->GetTime());
}
示例12:
Tab<float> FP_Basic::myFunction3(Tab<float>& listRect)
{
mprintf(L"xin chao mytestfunction3\n");
mflush();
for (int i = 0; i < listRect.Count(); ++i) {
listRect[i]++;
mprintf(L"listRect[%d] = %f\n", i, listRect[i]);
};
float a = 20;
listRect.Append(1, &a);
mflush();
//MessageBox(NULL, _T("Xin chao myFunction3!!!"), _T("Function Publishing Demonstration"), MB_OK);
return Tab<float>();
}
示例13:
void
UniformGrid::InRadius(Point3 p, Tab<int> &indexList)
{
float radius = largestRadius;
xHitList.ClearAll();
yHitList.ClearAll();
zHitList.ClearAll();
hitList.SetCount(0);
//find the cell in the XGrid
TagCells(p,radius, 0);
//find the cell in the YGrid
TagCells(p,radius, 1);
//find the cell in the ZGrid
TagCells(p,radius, 2);
BitArray usedList;
usedList.SetSize(pointBase.Count());
usedList.ClearAll();
int closest = -1;
float d = 0.0f;
Box3 localBounds;
localBounds.Init();
localBounds += p;
localBounds.EnlargeBy(radius);
for (int i = 0; i < hitList.Count(); i++)
{
int index = hitList[i];
if (!usedList[index]) //check to see if we have processed this one or not
{
if (xHitList[index] && yHitList[index] && zHitList[index])
{
usedList.Set(index);
Point3 source = pointBase[index];
if (localBounds.Contains(source))
{
indexList.Append(1,&index,1000);
}
}
}
}
}
示例14: MAXException
void Unreal3DExport::Init()
{
// Init
CheckCancel();
pScene = GetIGameInterface();
GetConversionManager()->SetUserCoordSystem(UnrealCoords);
if( bExportSelected )
{
Tab<INode*> selnodes;;
for( int i=0; i<pInt->GetSelNodeCount(); ++i )
{
INode* n = pInt->GetSelNode(i);
selnodes.Append(1,&n);
}
if( !pScene->InitialiseIGame(selnodes,false) )
throw MAXException(GetString(IDS_ERR_IGAME));
}
else
{
if( !pScene->InitialiseIGame() )
throw MAXException(GetString(IDS_ERR_IGAME));
}
// Enumerate scene
NodeCount = pScene->GetTotalNodeCount();
for( int i=0; i<pScene->GetTopLevelNodeCount(); ++i )
{
IGameNode * n = pScene->GetTopLevelNode(i);
ExportNode(n);
}
Progress += U3D_PROGRESS_ENUM;
// Get animation info
FrameStart = pScene->GetSceneStartTime() / pScene->GetSceneTicks();
FrameEnd = pScene->GetSceneEndTime() / pScene->GetSceneTicks();
FrameCount = FrameEnd - FrameStart+1;
if( FrameCount <= 0 || FrameEnd < FrameStart )
{
ProgressMsg.printf(GetString(IDS_ERR_FRAMERANGE),FrameStart,FrameEnd);
throw MAXException(ProgressMsg.data());
}
pScene->SetStaticFrame(FrameStart);
}
示例15: SetupFront
//////////////////////////////////////////////////////////////////////////
// MNMeshLoopAdvancerEdge
// TODO
int MNMeshLoopAdvancerEdge::SetupFront(int startid, Tab<MNMeshLoopFront> &fronts)
{
// first previous is root
// set initial connectors
MNEdge *edge = m_mesh->E(startid);
fronts.SetCount(0);
int outcount = 0;
for (int o = 0; o < 4; o++){
if (m_disableFlag & 1<<o) continue;
int connector = -1;
int contype;
int nextid;
if (o < 2){
// loop
contype = 0;
connector = o ? edge->v1 : edge->v2;
nextid = MNMeshLoop_nextEdgeLoop(m_mesh,startid,connector);
}
else{
// ring
contype = 1;
connector = o%2 ? edge->f1 : edge->f2;
nextid = connector >= 0 ? MNMeshLoop_nextEdgeRing(m_mesh,startid,connector) : -1;
}
if (nextid >= 0){
MNMeshLoopFront advance;
advance.previndex = 0;
advance.nextid = nextid;
advance.connector = connector;
advance.contype = contype;
advance.crossed = FALSE;
outcount++;
fronts.Append(1,&advance);
}
}
return outcount;
}