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


C++ String::Content方法代码示例

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


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

示例1: CreateElementBegin

/*********************************************************************\
	Function name    : CDialogCustomElement::CreateElementBegin
	Description      :
	Created at       : 27.03.02, @ 11:22:38
	Created by       : Thomas Kunert
	Modified by      :
\*********************************************************************/
void CDialogCustomElement::CreateElementBegin(Int32 lID, GeDialog *pDlg)
{
    if (!m_pbcGUI) return;

    if (g_pCustomElements && m_lElement >= 0 && m_lElement < g_pCustomElements->Entries())
    {
        CCustomElements* pElement = g_pCustomElements->GetItem(m_lElement);

        if (pElement)
        {
            BaseContainer bc = m_pbcGUI[m_lElement];
            for (Int32 i = 0; pElement->m_pProp && pElement->m_pProp[i].type != CUSTOMTYPE_END; i++)
            {
                if (pElement->m_pProp[i].type == CUSTOMTYPE_STRING)
                {
                    String str = m_pbcGUI[m_lElement].GetString(pElement->m_pProp[i].id);
                    if (str.Content())
                    {
                        Bool b;
                        String str1 = m_pDocument->GetString(str, b);
                        if (!b) str1 = "[" + str + "]";
                        bc.SetString(pElement->m_pProp[i].id, str1);
                    }
                }
            }
            pDlg->AddCustomGui(lID, pElement->m_lID, m_strName, m_lFlags, CONVERT_WIDTH(m_lInitW), CONVERT_HEIGHT(m_lInitH), bc);
            //BaseCustomGuiLib* pGUI = (BaseCustomGuiLib*)pDlg->FindCustomGui(lID, pElement->m_lID);
            //if (pGUI) pGUI->SetDefaultForResEdit();
        }
    }
}
开发者ID:nr-plugins,项目名称:resedit,代码行数:38,代码来源:DialogCustomElement.cpp

示例2: RegisterSampleMatrix

//----------------------------------------------------------------------------------------
// Register filter
// Function result:		true/false
//----------------------------------------------------------------------------------------
Bool RegisterSampleMatrix(void)
{
	String name = GeLoadString(IDS_MATRIX);
	if (!name.Content())
		return true;

	// be sure to use a unique ID obtained from www.plugincafe.com
	return GeRegisterPlugin(PLUGINTYPE_BITMAPFILTER, 1000690, name, &smpl_matrix_filter, sizeof(smpl_matrix_filter));
}
开发者ID:archimy,项目名称:cinema4d_cpp_sdk,代码行数:13,代码来源:filtermatrix.cpp

示例3: RegisterPaintBrushSculpt

Bool RegisterPaintBrushSculpt()
{
	SculptBrushParams *pParams = SculptBrushParams::Alloc();
	if (!pParams) return false;

	pParams->EnableInvertCheckbox(true);
	pParams->EnableBrushAccess(true);
	pParams->SetUndoType(SCULPTBRUSHDATATYPE_POINT);
	pParams->SetMovePointFunc(&SculptMovePointsFunc);

	String name = GeLoadString(IDS_PAINT_BRUSH_SCULPT); if (!name.Content()) return true;
	return RegisterToolPlugin(ID_PAINT_BRUSH_SCULPT, name, PLUGINFLAG_TOOL_SCULPTBRUSH|PLUGINFLAG_TOOL_NO_OBJECTOUTLINE, nullptr, GeLoadString(IDS_PAINT_BRUSH_SCULPT_HELP), NewObjClear(PaintBrushSculpt, pParams));
}
开发者ID:archimy,项目名称:cinema4d_cpp_sdk,代码行数:13,代码来源:paintbrushsculpt.cpp

示例4: UpdateGadgets

  void UpdateGadgets(Bool relevants=false)
  {
    Int32 mode;
    Bool add_dynamics;
    GetBool(CHK_ADDDYNAMICS, add_dynamics);
    GetInt32(CMB_MODE, mode);

    BaseDocument* doc = GetActiveDocument();
    BaseObject* op = doc ? doc->GetActiveObject() : nullptr;

    Enable(EDT_MAXCONN, mode != CMB_MODE_CHAIN);
    Enable(EDT_RADIUS, mode != CMB_MODE_CHAIN);
    Enable(CHK_CLOSED, mode == CMB_MODE_CHAIN);
    Enable(CHK_COMPOUND, add_dynamics);

    // Need at least two child objects on the active object.
    Bool execEnabled = op != nullptr && op->GetDown() != nullptr
        && op->GetDown()->GetNext() != nullptr;
    Enable(BTN_EXECUTE, execEnabled);

    if (relevants)
    {
      FreeChildren(CMB_TYPE);

      Int32 pluginid;
      GetInt32(CMB_FORCE, pluginid);

      do {
        BaseObject* op = BaseObject::Alloc(pluginid);
        if (!op) break;
        AutoFree<BaseObject> free(op);

        AutoAlloc<Description> desc;
        if (!op->GetDescription(desc, DESCFLAGS_DESC_0)) break;

        BaseContainer temp;
        AutoAlloc<AtomArray> arr;
        const BaseContainer* param = desc->GetParameter(FORCE_TYPE, temp, arr);
        if (!param) break;

        const BaseContainer* cycle = param->GetContainerInstance(DESC_CYCLE);
        if (!cycle) break;

        const BaseContainer* icons = param->GetContainerInstance(DESC_CYCLEICONS);

        Int32 i = 0;
        Int32 last_id = -1;
        while (true) {
          Int32 id = cycle->GetIndexId(i++);
          if (id == NOTOK) break;

          Int32 icon = icons ? icons->GetInt32(id) : -1;

          String name = cycle->GetString(id);
          if (name.Content()) {
            if (icon > 0) name += "&i" + String::IntToString(icon);
            if (last_id < 0) last_id = id;
            AddChild(CMB_TYPE, id, name);
          }
        }

        SetInt32(CMB_TYPE, last_id);
      } while (0);

      LayoutChanged(CMB_TYPE);
    }
  }
开发者ID:nr-plugins,项目名称:auto-connect,代码行数:67,代码来源:main.cpp

示例5: ConnectObjects

Bool ConnectObjects(
    String prefix, const maxon::BaseArray<BaseObject*>& objects,
    ConnectOptions& options)
{

  // Check if the object can successfully be allocatd for the
  // specified plugin id.
  BaseObject* test = BaseObject::Alloc(options.forcePluginId);
  if (!test)
  {
    GeDebugOut("Can not allocate plugin object " + String::IntToString(options.forcePluginId));
    return false;
  }

  // Get the name of the object so we can use it later.
  options.forceName = test->GetName();
  BaseObject::Free(test);
  if (!prefix.Content())
    prefix = options.forceName + ": ";

  // Final result of the function.
  Bool success = true;

  // Create the ConnectionList for the objects.
  ConnectionList list;
  switch (options.connectMode)
  {
    case CMB_MODE_ALL:
    {
      const auto end = objects.End();
      for (auto it=objects.Begin(); it != end; ++it)
      {
        for (auto jt=objects.Begin(); jt != end; ++jt)
        {
          if (*it == *jt) continue;
          if (list.HasConnection(*it, *jt)) continue;
          list.Append(Connection(*it, *jt));
        }
      }
      break;
    }
    case CMB_MODE_NEIGHBOR:
    {
      const auto end = objects.End();
      for (auto it=objects.Begin(); it != end; ++it)
      {

        // Find the nearest object.
        BaseObject* nearest = nullptr;
        Float delta;
        for (auto jt=objects.Begin(); jt != end; ++jt)
        {
          if (*it == *jt) continue;
          if (list.HasConnection(*it, *jt)) continue;

          Connection conn(*it, *jt);
          if (!nearest || conn.delta < delta)
          {
            nearest = *jt;
            delta = conn.delta;
          }
        }

        if (nearest)
          list.Append(Connection(*it, nearest));
      }
      break;
    }
    case CMB_MODE_CHAIN:
    {
      options.radius = 0;
      options.maxConnections = 0;
      const auto first = objects.Begin();
      for (auto it=objects.Begin(); it != objects.End(); ++it)
      {
        Bool isLast = (it + 1) == objects.End();
        if (isLast && (options.closedChain && *it != *first))
        {
          Connection conn(*it, *first);
          list.Append(conn);
        }
        else if (!isLast)
        {
          Connection conn(*it, *(it + 1));
          list.Append(conn);
        }
      }
      break;
    }
    default:
      GeDebugOut(String(__FUNCTION__) + ": Invalid connectMode");
      return false;
  }

  // Sort the list by distance.
  list.SortByDelta();

  // This map contains the number of connections each
  // object already has to make sure no object exceeds the
  // maximum number if connections.
//.........这里部分代码省略.........
开发者ID:nr-plugins,项目名称:auto-connect,代码行数:101,代码来源:main.cpp

示例6: Execute


//.........这里部分代码省略.........
			{
				StatusSetText("Export object " + ob->GetName());
				ExportObject mObject;

				GePrint("Name " + ob->GetName());
				//GePrint("Type " + LongToString(ob->GetType()));

				if(expMat)
				{
					mObject.pmatidxArray.ReSize(ob->GetPolygonCount());
					mObject.tempMats.ReSize(1);
					mObject.pmatidxArray.Fill(0);
					Bool haveMats = false;
	//////////////////////////////////////////
					for(BaseTag* tag = ob->GetFirstTag(); tag != NULL; tag = tag->GetNext())
					{
						LONG typ = tag->GetType();
						if(typ == Ttexture)
						{
							if (!getParameterLink(*tag, TEXTURETAG_MATERIAL, Mbase)) continue;
						
							haveMats = true;
							TextureTag* txttag = (TextureTag*)tag;
							BaseMaterial* material = txttag->GetMaterial();

							if(material == NULL)
							{
								GePrint("Material not found on " + ob->GetName() + "object.");
								return false;
							}
							//GePrint("Mat Name: " + material->GetName());						

							String restrict = getParameterString(*tag, TEXTURETAG_RESTRICTION);
							if (restrict.Content())
							{
								mObject.tempMats.Push(material);
								//GePrint("Selection: " + restrict);
								for(BaseTag* seltag = ob->GetFirstTag(); seltag != NULL; seltag = seltag->GetNext())
								{
									LONG seltyp = seltag->GetType();
									if(seltyp == Tpolygonselection && seltag->GetName() == restrict)
									{
										SelectionTag* selecttag = (SelectionTag*)seltag;
										BaseSelect* sel = selecttag->GetBaseSelect();
										//GePrint("sel data count: " + LongToString(sel->GetCount()));

										LONG seg = 0, a, b, p;
										while (sel->GetRange(seg++, &a, &b))
										{
											for (p = a; p <= b; ++p)
											{
												//GePrint("seltpolygon: " + LongToString(p));
												mObject.pmatidxArray[p] = mObject.tempMats.GetCount()-1;
											}
										}
									}
								}
							}
							else
							{
								mObject.tempMats[0] = material;
								mObject.pmatidxArray.Fill(0);
							}
						}
					}
开发者ID:oyaGG,项目名称:3DCoat_Applinks,代码行数:66,代码来源:ApplinkExporter.cpp


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