本文整理汇总了C++中TSTR类的典型用法代码示例。如果您正苦于以下问题:C++ TSTR类的具体用法?C++ TSTR怎么用?C++ TSTR使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TSTR类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
}
开发者ID:,项目名称:,代码行数:28,代码来源:
示例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);
}
}
开发者ID:roman-dzieciol,项目名称:Unreal3DExport,代码行数:25,代码来源:Unreal3DExport.cpp
示例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!
}
开发者ID:AltimorTASDK,项目名称:TribesRebirth,代码行数:31,代码来源:ObList.cpp
示例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));
}
}
}
}
}
}
开发者ID:ElliotWood,项目名称:max_nif_plugin,代码行数:34,代码来源:Mesh.cpp
示例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;
}
开发者ID:artemeliy,项目名称:inf4715,代码行数:29,代码来源:triobj.cpp
示例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));
}
开发者ID:2asoft,项目名称:xray,代码行数:34,代码来源:coneanglemanip.cpp
示例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;
}
}
}
}
}
}
开发者ID:whztt07,项目名称:OgreGameProject,代码行数:31,代码来源:DxStdMtl2.cpp
示例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;
}
开发者ID:artemeliy,项目名称:inf4715,代码行数:33,代码来源:composite_material.cpp
示例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;
}
开发者ID:artemeliy,项目名称:inf4715,代码行数:7,代码来源:composite_material.cpp
示例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()));
}
开发者ID:grasmanek94,项目名称:darkreign2,代码行数:7,代码来源:export.cpp
示例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;
}
开发者ID:Anchoys1,项目名称:max_nif_plugin,代码行数:30,代码来源:Util.cpp
示例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;
}
开发者ID:artemeliy,项目名称:inf4715,代码行数:32,代码来源:Actions.cpp
示例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;
}
开发者ID:artemeliy,项目名称:inf4715,代码行数:27,代码来源:Actions.cpp
示例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); // 바인드포즈
}
开发者ID:bingeun,项目名称:BG_DX,代码行数:26,代码来源:bgExpBG3D.cpp
示例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();
}
}
开发者ID:artemeliy,项目名称:inf4715,代码行数:33,代码来源:ExposeControllers.cpp
示例16: BeginPaint
void WeightTableWindow::PaintNameListLabel()
{
HDC hdc;
PAINTSTRUCT ps;
BeginPaint(hNameListLabel,&ps);
EndPaint(hNameListLabel,&ps);
iNameListLabelBuf->Erase();
hdc = iNameListLabelBuf->GetDC();
HFONT hOldFont = (HFONT)SelectObject(hdc, hFixedFont);
SelectObject(hdc,pTextPen);
int x = 0;
int y = 0;
x = 0;
y = 0;
TSTR vertName;
if (GetFlipFlopUI())
{
vertName.printf("%s",GetString(IDS_PW_BONEID));
PaintCellName(hdc,x,y,buttonWidth,FALSE,TEXT_LEFT_JUSTIFIED,vertName);
}
else
{
vertName.printf("%s",GetString(IDS_PW_VERTEXID));
PaintCellName(hdc,x,y,vertNameWidth,FALSE,TEXT_LEFT_JUSTIFIED,vertName);
}
SelectObject(hdc,GetStockObject(BLACK_PEN));
SelectObject(hdc, hOldFont);
iNameListLabelBuf->Blit();
}
开发者ID:2asoft,项目名称:xray,代码行数:34,代码来源:weightTablePaints.cpp
示例17: OnInitDialog
BOOL CMorphAnimationTimePage::OnInitDialog()
{
CPropertyPage::OnInitDialog();
// set step and description text
m_stepStatic.SetWindowText(m_strStep);
CString str;
str.LoadString(m_nDescriptionID);
m_descriptionStatic.SetWindowText(str);
// set the time values
TSTR strValue;
strValue.printf(_T("%d"), m_startFrame);
m_startFrameEdit.SetWindowText(strValue);
strValue.printf(_T("%d"), m_endFrame);
m_endFrameEdit.SetWindowText(strValue);
strValue.printf(_T("%d"), m_displacement);
m_displacementEdit.SetWindowText(strValue);
strValue.printf(_T("%d"), m_fps);
m_fpsEdit.SetWindowText(strValue);
return TRUE;
}
开发者ID:bsmr-opengl,项目名称:cal3d,代码行数:27,代码来源:MorphAnimationTimePage.cpp
示例18: IFindTreeItem
HTREEITEM plComponentDlg::IAddComponent(HWND hTree, plMaxNode *node)
{
plComponentBase *comp = node->ConvertToComponent();
// Try and find the component category in the tree
const char *category = comp->GetCategory();
HTREEITEM hCat = IFindTreeItem(hTree, category, TVI_ROOT);
// If it isn't there yet, add it
if (!hCat)
hCat = IAddLeaf(hTree, TVI_ROOT, category, 0);
// Try and find the component type in the tree
int idx = plComponentMgr::Inst().FindClassID(comp->ClassID());
HTREEITEM hType = ISearchTree(hTree, idx+1, hCat);
if (!hType)
{
// If it isn't there yet, add it
TSTR type;
comp->GetClassName(type);
if (IIsHidden(comp->ClassID()))
type.Append(" (Hidden)");
hType = IAddLeaf(hTree, hCat, type, idx+1);
}
// Add the name of this component to this type
return IAddLeaf(hTree, hType, node->GetName(), (LPARAM)node);
}
开发者ID:,项目名称:,代码行数:29,代码来源:
示例19: DebugPrint
bool BakeRadiosity::CreateNewMesh (INode *orgNode,
Mesh *orgMesh,
Matrix3 orgMtx)
{
if((orgNode == NULL)||(orgMesh == NULL)){
DebugPrint(_T("Mesh error\n"));
return false;
}
// Creates an instance of a registered class.
Object *newObj = (Object*)(ip->CreateInstance(
GEOMOBJECT_CLASS_ID,
Class_ID(TRIOBJ_CLASS_ID, 0)));
if(newObj == NULL){
DebugPrint(_T("CreateInstance error\n"));
return false;
}
// Creates a new node in the scene with the given object.
INode *newNode = ip->CreateObjectNode(newObj);
if(newNode == NULL){
DebugPrint(_T("CreateObjectNode error\n"));
return false;
}
// Sets the name of the node.
if(keepOrgFlag != true){
newNode->SetName(orgNode->GetName());
} else {
TSTR newName;
newName.printf(_T("%s_BAKED"), orgNode->GetName());
newNode->SetName(newName);
}
// Sets the renderer material used by the node.
newNode->SetMtl(orgNode->GetMtl());
// Returns a reference to the mesh data member of new TriObject.
TriObject *newTriObj = (TriObject *)newObj;
Mesh &newMesh = newTriObj->GetMesh();
// Returns the number of vertices from original mesh.
int nbVert = orgMesh->getNumVerts();
// Sets the number of geometric vertices in the new mesh.
newMesh.setNumVerts(nbVert);
// The loop will continue until handling all vertices...
for(int i=0; i<nbVert; i++) {
newMesh.verts[i] = orgMtx * orgMesh->verts[i];//Set new vertices
}
// Returns the number of faces in the original mesh.
int nbFace = orgMesh->getNumFaces();
// Sets the number of faces in the new mesh
// and previous faces are discarded.
newMesh.setNumFaces(nbFace, FALSE);
// The loop will continue until handling all faces...
for(int i=0; i<nbFace; i++){ // Set new faces and Material id
newMesh.faces[i] = orgMesh->faces[i];
newMesh.faces[i].setMatID(orgMesh->faces[i].getMatID());
}
// Makes a complete copy of the specified channels
// of the original Mesh object into new Mesh.
newMesh.DeepCopy(orgMesh, CNVERT_CHANNELS);
return true;
}
开发者ID:ADN-DevTech,项目名称:3dsMax-Bake-Radiosity,代码行数:59,代码来源:BakeRadiosity.cpp
示例20: Init
void ColorClip::Init(HWND hWnd)
{
for (int i=0; i<NUM_COLORS; i++) {
TSTR name;
name.printf(GetString(IDS_RB_COLORNUM),i);
cs[i] = GetIColorSwatch(GetDlgItem(hWnd,csIDs[i]),colors[i],name);
cs[i]->SetUseAlpha(TRUE);
cs[i]->SetAColor(colors[i]);
}
}
开发者ID:artemeliy,项目名称:inf4715,代码行数:10,代码来源:colclip.cpp
注:本文中的TSTR类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论