本文整理汇总了C++中TSTR类的典型用法代码示例。如果您正苦于以下问题:C++ TSTR类的具体用法?C++ TSTR怎么用?C++ TSTR使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TSTR类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateLayerDisplay
void plMultipassMtlDlg::UpdateLayerDisplay()
{
int numlayers = fPBlock->GetInt(kMultCount);
fNumTexSpin->SetValue(numlayers, FALSE);
int i;
for (i = 0; i < numlayers && i < NSUBMTLS; i++)
{
Mtl *m = fPBlock->GetMtl(kMultPasses, curTime, i);
TSTR nm;
if (m)
nm = m->GetName();
else
nm = "None";
fLayerBtns[i]->SetText(nm.data());
ShowWindow(GetDlgItem(fhRollup, kLayerID[i].layerID), SW_SHOW);
ShowWindow(GetDlgItem(fhRollup, kLayerID[i].activeID), SW_SHOW);
SetCheckBox(fhRollup, kLayerID[i].activeID, fPBlock->GetInt(kMultOn, curTime, i));
}
for (i = numlayers; i < NSUBMTLS; i++)
{
ShowWindow(GetDlgItem(fhRollup, kLayerID[i].layerID), SW_HIDE);
ShowWindow(GetDlgItem(fhRollup, kLayerID[i].activeID), SW_HIDE);
}
}
示例2: MaxMsgBox
void Unreal3DExport::ShowSummary()
{
// Progress
pInt->ProgressUpdate(Progress);
// Display Summary
if( bShowPrompts )
{
ProgressMsg.printf(GetString(IDS_INFO_SUMMARY)
, hAnim.NumFrames
, hData.NumPolys
, hData.NumVertices);
if( bMaxResolution )
{
TSTR buf;
buf.printf(GetString(IDS_INFO_DIDPRECISION)
, FileName);
ProgressMsg += buf;
}
MaxMsgBox(pInt->GetMAXHWnd(),ProgressMsg.data(),ShortDesc(),MB_OK|MB_ICONINFORMATION);
}
}
示例3: Append
void ObjNameList::MakeUnique(TSTR &n)
{
// First make it less than 10 chars.
if( n.Length() > 10 )
n.Resize(10);
if( Contains(n) < 0 )
{
Append(n);
return;
}
// Make it unique and keep it 10 chars or less
for(int i = 0; i < 100000; ++i)
{
char buf[12];
sprintf(buf,"%d",i);
TSTR num(buf);
TSTR work = n;
int totlen = num.Length() + work.Length();
if(totlen > 10)
work.Resize(10 - (totlen - 10));
work = work + num;
if(Contains(work) < 0)
{
Append(work);
n = work;
return;
}
}
// Forget it!
}
示例4: FillBoneController
static void FillBoneController(Exporter* exporter, NiBSBoneLODControllerRef boneCtrl, INode *node)
{
for (int i=0; i<node->NumberOfChildren(); i++)
{
INode * child = node->GetChildNode(i);
FillBoneController(exporter, boneCtrl, child);
TSTR upb;
child->GetUserPropBuffer(upb);
if (!upb.isNull())
{
// Check for bonelod and add bones to bone controller
stringlist tokens = TokenizeString(upb.data(), "\r\n", true);
for (stringlist::iterator itr = tokens.begin(); itr != tokens.end(); ++itr) {
string& line = (*itr);
if (wildmatch("*#", line)) { // ends with #
stringlist bonelod = TokenizeString(line.c_str(), "#", true);
for (stringlist::iterator token = bonelod.begin(); token != bonelod.end(); ++token) {
if ( wildmatch("??BoneLOD", (*token).c_str())) {
if (++token == bonelod.end())
break;
if (strmatch("Bone", (*token).c_str())) {
if (++token == bonelod.end())
break;
int group = 0;
std::stringstream str (*token);
str >> group;
boneCtrl->AddNodeToGroup(group, exporter->getNode(child));
}
}
}
}
}
}
示例5: MessageBox
BOOL TriObject::CheckObjectIntegrity()
{
for (int i=0; i<mesh.getNumFaces(); i++) {
for (int j=0; j<3; j++) {
if (mesh.faces[i].v[j] >= (DWORD)mesh.getNumVerts()) {
TSTR buf;
buf.printf(GetResString(IDS_DB_TRIOBJ_DESC),
i,j,mesh.faces[i].v[j],mesh.getNumVerts(), mesh.faces, mesh.getNumFaces());
MessageBox(NULL,buf,GetResString(IDS_DB_INVALID_FACE),MB_ICONEXCLAMATION|MB_TASKMODAL|MB_OK);
return FALSE;
}
}
}
if (mesh.tvFace) {
for (int i=0; i<mesh.getNumFaces(); i++) {
for (int j=0; j<3; j++) {
if (mesh.tvFace[i].t[j] >= (DWORD)mesh.numTVerts) {
TSTR buf;
buf.printf(GetResString(IDS_DB_TV_DESC), i,j,mesh.tvFace[i].t[j],mesh.numTVerts);
MessageBox(NULL,buf,GetResString(IDS_DB_INVALID_TV_FACE),MB_ICONEXCLAMATION|MB_TASKMODAL|MB_OK);
return FALSE;
}
}
}
}
return TRUE;
}
示例6: GetTargetPoint
void
SpotLightFalloffManipulator::UpdateShapes(TimeValue t, TSTR& toolTip)
{
GenLight* pLight = (GenLight*) mhTarget;
Matrix3 tm;
tm = mpINode->GetObjectTM(t);
Point3 pt;
float dist;
BOOL b = GetTargetPoint(t, pt);
if (!b) {
dist = pLight->GetTDist(t);
} else {
float den = FLength(tm.GetRow(2));
dist = (den!=0) ? FLength(tm.GetTrans()-pt) / den : 0.0f;
}
TSTR nodeName;
nodeName = mpINode->GetName();
toolTip.printf("%s [Falloff: %5.2f]", nodeName.data(),
(double) pLight->GetFallsize(t));
SetGizmoScale(dist / kRingScaleFactor);
ConeAngleManipulator::SetValues(Point3(0,0,0),
Point3(0,0,-1),
dist,
DegToRad(pLight->GetFallsize(t)),
pLight->GetSpotShape() == RECT_LIGHT,
pLight->GetAspect(t));
}
示例7: atoi
void DxStdMtl2::PatchInLightNodes()
{
for(int i = 0; i< sceneLights.Count(); i++)
{
int curLightIndex = -1;
for(int j=0; j<elementContainer.NumberofElementsByType(EffectElements::kEleLight);j++)
{
LightElement * le = static_cast<LightElement*>(elementContainer.GetElementByType(j, EffectElements::kEleLight));
TSTR paramName = le->GetParameterName();
int actualLength = paramName.first('_');
for(int k=0; k<actualLength;k++)
{
if(isdigit(paramName[k]))
{
TSTR numChar = paramName.Substr(k,actualLength-k);
int index = atoi(numChar.data());
if(index == i)
{
le->AddLight(sceneLights[i]->GetLightNode());
break;
}
}
}
}
}
}
示例8: switch
TSTR CompositeMatPBAccessor::GetLocalName(ReferenceMaker* owner, ParamID id, int tabIndex)
{
CompositeMat* p = (CompositeMat*)owner;
TSTR out;
switch (id)
{
case compmat_amount:
{
out.printf(_T("%s %d"),GetString(IDS_PW_AMOUNT),tabIndex+1);
break;
}
case compmat_mtls:
{
TSTR name;
Mtl *sm1 = NULL;
Interval iv;
if ((p) && (p->pblock2)) p->pblock2->GetValue(compmat_mtls,0,sm1,iv,tabIndex);
name = sm1->GetFullName();
if (tabIndex == 0)
{
out.printf(_T("%s: %s"),GetString(IDS_PW_BASE),name);
}
else
{
out.printf(_T("%s %d: %s"),GetString(IDS_RB_MATERIAL2),tabIndex,name);
}
break;
}
}
return out;
}
示例9: GetSubMtlSlotName
TSTR CompositeMat::GetSubMtlSlotName(int i) {
TSTR name;
if (i== 0)
name.printf(_T("%s"),GetString(IDS_PW_BASE));
else name.printf(_T("%s %d"),GetString(IDS_PW_MAT),i);
return name;
}
示例10: GetIndent
void XsiExp::ExportNodeHeader( INode * node, TCHAR * type, int indentLevel)
{
TSTR indent = GetIndent(indentLevel);
// node header: object type and name
fprintf(pStream,"%s%s frm-%s {\n\n", indent.data(), type, FixupName(node->GetName()));
}
示例11: exportUPB
bool Exporter::exportUPB(NiNodeRef &root, INode *node)
{
bool ok = false;
if (!mUserPropBuffer)
return ok;
// Write the actual UPB sans any np_ prefixed strings
TSTR upb;
node->GetUserPropBuffer(upb);
if (!upb.isNull())
{
string line;
istringstream istr(string(upb), ios_base::out);
ostringstream ostr;
while (!istr.eof()) {
std::getline(istr, line);
if (!line.empty() && 0 != line.compare(0, 3, "np_"))
ostr << line << endl;
}
if (!ostr.str().empty())
{
NiStringExtraDataRef strings = CreateNiObject<NiStringExtraData>();
strings->SetName("UPB");
strings->SetData(ostr.str());
root->AddExtraData(DynamicCast<NiExtraData>(strings));
ok = true;
}
}
return ok;
}
示例12: NumElements
BOOL UnwrapMod::AddDefaultActionToBar(ICustToolbar *toolBar, int id)
{
int numOps = NumElements(spActions)/3;
UnwrapAction *wtActions = NULL;
int ct = 0;
for (int i =0; i < numOps; i++)
{
int testid, ids1, ids2;
testid = spActions[ct++];
ids1 = spActions[ct++];
ids2 = spActions[ct++];
if (testid == id)
{
TSTR name;
name.printf(_T("%s"),GetString(ids2));
int l = name.Length();
toolBar->AddTool(ToolButtonItem(CTB_PUSHBUTTON,0, 0, 0, 0, 16, 15, l*8, 22, id));
ICustButton *but = toolBar->GetICustButton(id);
but->SetHighlightColor(GREEN_WASH);
but->SetTooltip(TRUE,GetString(ids1));
but->SetImage(NULL,0,0,0,0,0,0);
but->SetText(GetString(ids2));
ReleaseICustButton(but);
i = numOps;
return TRUE;
}
}
return FALSE;
}
示例13: GetString
ActionTable* UnwrapClassDesc::GetActions()
{
TSTR name = GetString(IDS_RB_UNWRAPMOD);
ActionTable* pTab;
pTab = new ActionTable(kUnwrapActions, kUnwrapContext, name);
int numOps = NumElements(spActions)/3;
UnwrapAction *wtActions = NULL;
int ct = 0;
for (int i =0; i < numOps; i++)
{
wtActions = new UnwrapAction();
int id, ids1, ids2;
id = spActions[ct++];
ids1 = spActions[ct++];
ids2 = spActions[ct++];
wtActions->Init(id,GetString(ids1),GetString(ids2),
GetString(IDS_RB_UNWRAPMOD), GetString(IDS_RB_UNWRAPMOD) );
pTab->AppendOperation(wtActions);
}
GetCOREInterface()->GetActionManager()->RegisterActionContext(kUnwrapContext, name.data());
return pTab;
}
示例14: time
void bgExporterMax::ExpScene()
{
struct tm *newtime;
time_t aclock;
time(&aclock);
newtime = localtime(&aclock);
TSTR today = _tasctime(newtime);
today.remove(today.length() - 1);
_ftprintf(m_pStream, _T("%s\t%s\n"),
_T("#BG3D_MODEL"),
FixupName(today)); // 날짜
_ftprintf(m_pStream, _T("%s\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\n"),
_T("#SCENE_INFO"),
m_Scene.iVersion, // 버전
m_Scene.iFirstFrame, // 시작 프레임
m_Scene.iLastFrame, // 마지막 프레임
m_Scene.iFrameSpeed, // 프레임 스피드
m_Scene.iTickPerFrame, // 프레임당 틱
m_Scene.iNumMesh, // 메시 갯수
m_Scene.iMaxWeight, // 가중치
m_Scene.iBindPose); // 바인드포즈
}
示例15: PopupErrorMessage
void BaseExposeControl::PopupErrorMessage()
{
if(exposeTransform) //should exist if not and this message is popping up then we're scewed.
{
INode *expNode = exposeTransform->GetExposeNode();
INode *node = exposeTransform->GetMyNode();
if(expNode&&node)
{
TSTR msg; msg.printf(GetString(IDS_ILLEGAL_SELF_REFERENCE),expNode->GetName(),node->GetName(),node->GetName());
if (GetCOREInterface()->GetQuietMode())
{
GetCOREInterface()->Log()->LogEntry(SYSLOG_WARN,NO_DIALOG,GetString(IDS_ILLEGAL_CYCLE),msg);
}
else
{
// beep or no??MessageBeep(MB_ICONEXCLAMATION);
MessageBox(GetCOREInterface()->GetMAXHWnd(),msg,GetString(IDS_ILLEGAL_CYCLE),
MB_ICONEXCLAMATION | MB_APPLMODAL | MB_OK);
}
}
//suspend the hold
BOOL resume =FALSE;
if(theHold.Holding())
{
theHold.Suspend();
resume =TRUE;
}
exposeTransform->SetExposeNode(NULL);
if(resume)
theHold.Resume();
}
}