本文整理汇总了C++中Tab::Shrink方法的典型用法代码示例。如果您正苦于以下问题:C++ Tab::Shrink方法的具体用法?C++ Tab::Shrink怎么用?C++ Tab::Shrink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tab
的用法示例。
在下文中一共展示了Tab::Shrink方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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());
}
示例2: ConvertFaces
//.........这里部分代码省略.........
}
else
{
TmpVert.m_Normal = FNormals[i].m_Normal;
TmpVert.m_S = FNormals[i].m_S;
TmpVert.m_T = FNormals[i].m_T;
TmpVert.m_SxT = FNormals[i].m_SxT;
}
UVCount = 0;
TmpVert.m_Sg = Sg;
for(k=0;k<m_MapChannels.Count();k++)
{
int index = m_MapChannels[k];
if(Mesh->getNumMapVerts(index))
{
UVVert = Mesh->mapVerts(index);
UVFace = Mesh->mapFaces(index);
TmpVert.m_UV[k].x = UVVert[UVFace[i].t[gVIndex[j]]].x;
TmpVert.m_UV[k].y = UVVert[UVFace[i].t[gVIndex[j]]].y;
}
else
{
TmpVert.m_UV[k].x = 0.0f;
TmpVert.m_UV[k].y = 0.0f;
}
}
if(Written[VIndex])
{
if((Sg == 0) ||
(Verts[VIndex].m_Sg != TmpVert.m_Sg) ||
(!UVVertEqual(Verts[VIndex].m_UV[0],TmpVert.m_UV[0])))
{
TmpFace.m_Num[j] = Verts.Count();
Verts.Append(1,&TmpVert,10);
}
}
else
{
Verts[VIndex] = TmpVert;
Written.Set(VIndex);
}
}
if(!Mesh->faces[i].Hidden())
{
Index = Mesh->getFaceMtlIndex(i) + 1;
if(Index == MatIndex || MatIndex == 0)
{
Faces[Count++] = TmpFace;
}
}
}
}
else
{
for(i=0; i < Mesh->getNumFaces(); i++)
{
aFace = &Mesh->faces[i];
Faces[i].m_Num[0] = aFace->v[gVIndex[0]];
Faces[i].m_Num[1] = aFace->v[gVIndex[1]];
Faces[i].m_Num[2] = aFace->v[gVIndex[2]];
for(j=0; j < 3; j++)
{
VIndex = aFace->v[gVIndex[j]];
Verts[VIndex].m_Pos = Mesh->verts[VIndex];
Verts[VIndex].m_Normal = Normals[VIndex].GetNormal(aFace->smGroup,S,T,SxT);
Verts[VIndex].m_S = Point3(0.0f,0.0f,0.0f);
Verts[VIndex].m_T = Point3(0.0f,0.0f,0.0f);
Verts[VIndex].m_SxT = Point3(0.0f,0.0f,0.0f);
for(k=0; k < MAX_TMUS; k++)
{
Verts[VIndex].m_UV[k].x = 0.0f;
Verts[VIndex].m_UV[k].y = 0.0f;
}
}
}
}
Verts.Shrink();
}
示例3: xref_low_error
void xref_low_error(std::wstring project_path, std::wstring pname) {
//Tab<const MCHAR*> sourceFile_Files;
Tab<const MCHAR*>* pointer_sourceFile_Files = new Tab<const MCHAR*>();
std::wstring filename = (project_path + L"\\" + pname + L"_low0.max");
const wchar_t* file = filename.c_str();
sourceFile_Files.Append(1, &file);
sourceFile_Files.Shrink();
pointer_sourceFile_Files->Init();
pointer_sourceFile_Files->Append(1, &file);
Tab<MSTR*> tstr_tab;
MSTR str(filename.c_str());
MSTR* a = &str;
tstr_tab.Append(1, &a);
tstr_tab.Shrink();
Tab<MSTR*> tstr_tab_dynamic_allocate_items;
MSTR* str_dynamic_allocate_items = new MSTR(filename.c_str());
tstr_tab_dynamic_allocate_items.Append(1, &str_dynamic_allocate_items);
tstr_tab_dynamic_allocate_items.Shrink();
//FPValue param1;
//int i = 10;
////param1.LoadPtr(FILENAME_ADDXREFITEMSFROMFILE_IOBJXREFMGR_PARAM1_TYPE, filename.data());
//param1.type = FILENAME_ADDXREFITEMSFROMFILE_IOBJXREFMGR_PARAM1_TYPE;
//param1.s = filename.data();
//param1.LoadPtr(ParamType2::TYPE_INT_BP, &i);
//LOG("param1.s here= "); LOG(param1.s); LOG("\n");
// FPValue param1_FPValue;
// TCHAR* param1_TCHAR = _T("Test Track View");
// param1_FPValue.type = TYPE_STRING,
// param1_FPValue.s = param1_TCHAR;
// param1.type = (ParamType2)TYPE_FPVALUE;
// param1.fpv = ¶m1_FPValue;
try
{
{
//std::lock_guard<std::mutex> lock(mymutex);
//FPValue param3;
param3.type = ParamType2::TYPE_STRING_TAB;
//param3.s_tab = pointer_sourceFile_Files;
param3.s_tab = &sourceFile_Files;
//OBJNAMES_ADDXREFITEMSFROMFILE_IOBJXREFMGR_PARAM3_TYPE;
//param3.InitTab(ParamType2::TYPE_STRING_TAB, sourceFile_Files.Count());
//param3.LoadPtr(ParamType2::TYPE_STRING_TAB_BV, &sourceFile_Files);
//param3.Load(ParamType2::TYPE_STRING_TAB_BV,&sourceFile_Files);
//param3.LoadPtr(ParamType2::TYPE_STRING_TAB, &sourceFile_Files);
//param3.LoadPtr(ParamType2::TYPE_STRING_TAB_BV, tstr_tab);
//param3.LoadPtr(ParamType2::TYPE_STRING_TAB_BV, &tstr_tab_dynamic_allocate_items);
//SYSTEM_CALL(param3.LoadPtr(ParamType2::TYPE_STRING_TAB_BV, &sourceFile_Files);)
//param3.Load(ParamType2::TYPE_STRING_TAB, &sourceFile_Files);
mprintf((*param3.s_tab)[0]);
//LOG();
}
}
catch (const std::exception&)
{
//LOG("Why this is error, tell me pls");
};
// FPValue param4;
// param4.type = ParamType2::TYPE_FPVALUE_TAB_BV;
// Tab<FPValue*> param4_fpvalues;
// FPValue param4_fpvalue;
// FPValue* pointer_param4_fpvalue;
// param4_fpvalue.type = (ParamType2)1;
// param4_fpvalue.i = 10;
// param4_fpvalues.Append(1, &pointer_param4_fpvalue);
// param4.fpv_tab = ¶m4_fpvalues;
FPValue param4;
//param4.type = ParamType2::TYPE_INT_TAB;
//param4.type = ParamType2::TYPE_INT_TAB_BV;
//param4.type = ParamType2::TYPE_INT_TAB_BR;
Tab<int> xrefoptions;
xrefoptions.Resize(1);
int h = 1;
xrefoptions.Append(1, &h);
//param4.i_tab = &xrefoptions;
//LOG("type is {0}", param4.type);
//FPParams fnParams;
//FPValue result, param1;
//FPValue param1_FPValue;
//TCHAR* param1_TCHAR = _T("Test Track View");
//param1_FPValue.type = TYPE_STRING,
// param1_FPValue.s = param1_TCHAR;
//.........这里部分代码省略.........