• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ AddAttribute函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中AddAttribute函数的典型用法代码示例。如果您正苦于以下问题:C++ AddAttribute函数的具体用法?C++ AddAttribute怎么用?C++ AddAttribute使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: nuiMakeDelegate

void nuiFrame::InitAttributes()
{
  nuiAttribute<const nuiRect&>* AttributeRect = new nuiAttribute<const nuiRect&>
   (nglString(_T("ClientRect")), nuiUnitNone,
    nuiAttribute<const nuiRect&>::GetterDelegate(this, &nuiFrame::GetSourceClientRect),
    nuiAttribute<const nuiRect&>::SetterDelegate(this, &nuiFrame::SetSourceClientRect));
  
  nuiAttribute<const nuiColor&>* AttributeColor = new nuiAttribute<const nuiColor&>
   (nglString(_T("Color")), nuiUnitNone,
    nuiAttribute<const nuiColor&>::GetterDelegate(this, &nuiFrame::GetColor), 
    nuiAttribute<const nuiColor&>::SetterDelegate(this, &nuiFrame::SetColor));

  nuiAttribute<bool>* AttributeFrameColor = new nuiAttribute<bool>
  (nglString(_T("UseWidgetFrameColor")), nuiUnitBoolean,
   nuiAttribute<bool>::GetterDelegate(this, &nuiFrame::IsWidgetFrameColorUsed),
   nuiAttribute<bool>::SetterDelegate(this, &nuiFrame::UseWidgetFrameColor));
  
  nuiAttribute<const nglPath&>* AttributeTexture = new nuiAttribute<const nglPath&>
   (nglString(_T("Texture")), nuiUnitNone,
    nuiMakeDelegate(this, &nuiFrame::GetTexturePath), 
    nuiMakeDelegate(this, &nuiFrame::SetTexturePath));

  nuiAttribute<bool>* AttributeInterpolation = new nuiAttribute<bool>
   (nglString(_T("Interpolation")), nuiUnitBoolean,
    nuiAttribute<bool>::GetterDelegate(this, &nuiFrame::IsInterpolated),
    nuiAttribute<bool>::SetterDelegate(this, &nuiFrame::SetInterpolated));
  

	AddAttribute(_T("ClientRect"), AttributeRect);
	AddAttribute(_T("Color"), AttributeColor);
  AddAttribute(_T("UseWidgetFrameColor"), AttributeFrameColor);
	AddAttribute(_T("Texture"), AttributeTexture);
	AddAttribute(_T("Interpolation"), AttributeInterpolation);
}
开发者ID:jpastuszek,项目名称:nui3,代码行数:34,代码来源:nuiFrame.cpp


示例2: AddChild

xmlNode* FArchiveXML::WriteGeometryMesh(FCDObject* object, xmlNode* parentNode)
{
    FCDGeometryMesh* geometryMesh = (FCDGeometryMesh*)object;

    xmlNode* meshNode = NULL;

    if (geometryMesh->IsConvex() && !geometryMesh->GetConvexHullOf().empty())
    {
        meshNode = AddChild(parentNode, DAE_CONVEX_MESH_ELEMENT);
        FUSStringBuilder convexHullOfName(geometryMesh->GetConvexHullOf());
        AddAttribute(meshNode, DAE_CONVEX_HULL_OF_ATTRIBUTE, convexHullOfName);
    }
    else
    {
        meshNode = AddChild(parentNode, DAE_MESH_ELEMENT);

        // Write out the sources
        for (size_t i = 0; i < geometryMesh->GetSourceCount(); ++i)
        {
            FArchiveXML::LetWriteObject(geometryMesh->GetSource(i), meshNode);
        }

        // Write out the <vertices> element
        xmlNode* verticesNode = AddChild(meshNode, DAE_VERTICES_ELEMENT);
        xmlNode* verticesInputExtraNode = NULL,* verticesInputExtraTechniqueNode = NULL;
        for (size_t i = 0; i < geometryMesh->GetVertexSourceCount(); ++i)
        {
            FCDGeometrySource* source = geometryMesh->GetVertexSource(i);
            const char* semantic = FUDaeGeometryInput::ToString(source->GetType());
            AddInput(verticesNode, source->GetDaeId(), semantic);
            if (geometryMesh->GetPolygonsCount() > 0)
            {
                FCDGeometryPolygons* firstPolys = geometryMesh->GetPolygons(0);
                FCDGeometryPolygonsInput* input = firstPolys->FindInput(source);
                FUAssert(input != NULL, continue);
                if (input->GetSet() != -1)
                {
                    // We are interested in the set information, so if it is available, export it as an extra.
                    if (verticesInputExtraNode == NULL)
                    {
                        verticesInputExtraNode = FUXmlWriter::CreateNode(DAE_EXTRA_ELEMENT);
                        verticesInputExtraTechniqueNode = FUXmlWriter::AddChild(verticesInputExtraNode, DAE_TECHNIQUE_ELEMENT);
                        FUXmlWriter::AddAttribute(verticesInputExtraTechniqueNode, DAE_PROFILE_ATTRIBUTE, DAE_FCOLLADA_PROFILE);
                    }
                    AddInput(verticesInputExtraTechniqueNode, source->GetDaeId(), semantic, -1, input->GetSet());
                }
            }
        }
        if (verticesInputExtraNode != NULL) AddChild(verticesNode, verticesInputExtraNode);

        FUSStringBuilder verticesNodeId(geometryMesh->GetDaeId());
        verticesNodeId.append("-vertices");
        AddAttribute(verticesNode, DAE_ID_ATTRIBUTE, verticesNodeId);

        // Write out the polygons
        for (size_t i = 0; i < geometryMesh->GetPolygonsCount(); ++i)
        {
            FArchiveXML::LetWriteObject(geometryMesh->GetPolygons(i), meshNode);
        }
    }
开发者ID:jpalves,项目名称:androido3d,代码行数:60,代码来源:FAXGeometryExport.cpp


示例3: AddAttribute

wxGLAttributes& wxGLAttributes::MinAcumRGBA(int mRed, int mGreen, int mBlue, int mAlpha)
{
    int acumBits = 0;
    if ( mRed >= 0)
    {
        AddAttribute(WGL_ACCUM_RED_BITS_ARB);
        AddAttribute(mRed);
        acumBits += mRed;
    }
    if ( mGreen >= 0)
    {
        AddAttribute(WGL_ACCUM_GREEN_BITS_ARB);
        AddAttribute(mGreen);
        acumBits += mGreen;
    }
    if ( mBlue >= 0)
    {
        AddAttribute(WGL_ACCUM_BLUE_BITS_ARB);
        AddAttribute(mBlue);
        acumBits += mBlue;
    }
    if ( mAlpha >= 0)
    {
        AddAttribute(WGL_ACCUM_ALPHA_BITS_ARB);
        AddAttribute(mAlpha);
        acumBits += mAlpha;
    }
    if ( acumBits )
    {
        AddAttribute(WGL_ACCUM_BITS_ARB);
        AddAttribute(acumBits);
    }
    return *this;
}
开发者ID:jfiguinha,项目名称:Regards,代码行数:34,代码来源:glcanvas.cpp


示例4: AddShader

//-------------------------------------------------------------------------------------------------
WorldShader::WorldShader( const char *name ) {
	AddShader( "glsl\\worldshader.v.glsl", GL_VERTEX_SHADER );
	AddShader( "glsl\\worldshader.f.glsl", GL_FRAGMENT_SHADER );
	Link();
	
	AddUniform( u_pattern_sampler, "sampler_patterns" );
	AddUniform( u_noise_sampler, "sampler_noise" );
	AddUniform( u_global_translation, "global_translation" );
	AddUniform( u_camera, "camera" );
	AddUniform( u_skylight_color, "skylight_color" );
	AddUniform( u_skylight_intensity, "skylight_intensity" );
	AddUniform( u_fog_distance, "fog_distance" );
	AddUniform( u_fog_length, "fog_length" );
	
	AddAttribute( a_instance_translation, "instance_translation", 1 );
	AddAttribute( a_instance_form, "instance_form", 1 );
	AddAttribute( a_instance_texture, "instance_texture", 1 );
	AddAttribute( a_instance_color, "instance_color", 1, 4 );
	//AddAttribute( attribInstanceColor2, "instance_color_2", 1 );
	//AddAttribute( attribInstanceColor3, "instance_color_3", 1 );
	//AddAttribute( attribInstanceColor4, "instance_color_4", 1 );

	AddUniform( u_texture_sampler, "sampler_texture" );
	AddUniform( u_texture_translation, "texture_translation" );
	AddUniform( u_opacity, "opacity" );
	AddUniform( u_fog_color, "fog_color" );

	AddUniform( u_light_brightness, "light_brightness" );
	AddUniform( u_light_colors, "light_colors" );
	AddUniform( u_light_positions, "light_positions" );

	Register( name );
}
开发者ID:mukunda-,项目名称:The-Unbound-Project,代码行数:34,代码来源:WorldShader.cpp


示例5: attr

void nuiLayout::SetProperty(const nglString& rName, const nglString& rValue)
{
  nuiAttribBase attr(GetAttribute(rName));
  if (attr.IsValid())
  {
    attr.FromString(rValue);
    return;
  }

  if (rName.CompareLeft("VAnchors_", true) == 0 || rName.CompareLeft("HAnchors_", true) == 0)
  {
    // Create an attribute for this anchor, unless it exists already
    AddAttribute(new LayoutAnchorValue(rName, this));
    {
      nuiAttribBase attr(GetAttribute(rName));
      NGL_ASSERT(attr.IsValid());
      attr.FromString(rValue);
    }
  }
  else if (rName.CompareLeft("VAnchorsType_", true) == 0 || rName.CompareLeft("HAnchorsType_", true) == 0)
  {
    // Create an attribute for this anchor, unless it exists already
    AddAttribute(new nuiAttribute<nuiAnchorType>(rName, this));
    {
      nuiAttribBase attr(GetAttribute(rName));
      NGL_ASSERT(attr.IsValid());
      attr.FromString(rValue);
    }
  }
  else
  {
    nuiObject::SetProperty(rName, rValue);
  }

}
开发者ID:JamesLinus,项目名称:nui3,代码行数:35,代码来源:nuiLayout.cpp


示例6: AddAttribute

void nuiColorDecoration::InitAttributes()
{
  AddAttribute(new nuiAttribute<const nuiRect&>
   (nglString(_T("ClientRect")), nuiUnitNone,
    nuiAttribute<const nuiRect&>::GetterDelegate(this, &nuiColorDecoration::GetSourceClientRect),
    nuiAttribute<const nuiRect&>::SetterDelegate(this, &nuiColorDecoration::SetSourceClientRect)));

  AddAttribute(new nuiAttribute<float>
  (nglString(_T("StrokeSize")), nuiUnitPixels,
   nuiMakeDelegate(this, &nuiColorDecoration::GetStrokeSize),
   nuiMakeDelegate(this, &nuiColorDecoration::SetStrokeSize)));
  
  AddAttribute(new nuiAttribute<const nuiColor&>
  (nglString(_T("FillColor")), nuiUnitColor,
   nuiMakeDelegate(this, &nuiColorDecoration::GetFillColor), 
   nuiMakeDelegate(this, &nuiColorDecoration::SetFillColor)));

  AddAttribute(new nuiAttribute<const nuiColor&>
  (nglString(_T("StrokeColor")), nuiUnitColor,
   nuiMakeDelegate(this, &nuiColorDecoration::GetStrokeColor), 
   nuiMakeDelegate(this, &nuiColorDecoration::SetStrokeColor)));

  AddAttribute(new nuiAttribute<nuiShapeMode>
  (nglString(_T("ShapeMode")), nuiUnitNone,
   nuiMakeDelegate(this, &nuiColorDecoration::GetShapeMode), 
   nuiMakeDelegate(this, &nuiColorDecoration::SetShapeMode)));

  
}
开发者ID:hamedmohammadi,项目名称:nui3,代码行数:29,代码来源:nuiColorDecoration.cpp


示例7: AddAttribute

void nuiButton::InitAttributes()
{
  AddAttribute(new nuiAttribute<bool>
               (nglString(_T("Pressed")), nuiUnitBoolean,
                nuiMakeDelegate(this, &nuiButton::IsPressed),
                nuiMakeDelegate(this, &nuiButton::SetPressed)));

  AddAttribute(new nuiAttribute<bool>
               (nglString(_T("AutoRepeat")), nuiUnitBoolean,
                nuiMakeDelegate(this, &nuiButton::GetAutoRepeat),
                nuiMakeDelegate(this, &nuiButton::EnableAutoRepeat)));

  AddAttribute(new nuiAttribute<float>
               (nglString(_T("AutoRepeatDelay")), nuiUnitSeconds,
                nuiMakeDelegate(this, &nuiButton::GetAutoRepeatDelay),
                nuiMakeDelegate(this, &nuiButton::SetAutoRepeatDelay)));
  AddAttribute(new nuiAttribute<float>
               (nglString(_T("AutoRepeatMinDelay")), nuiUnitSeconds,
                nuiMakeDelegate(this, &nuiButton::GetAutoRepeatMinDelay),
                nuiMakeDelegate(this, &nuiButton::SetAutoRepeatMinDelay)));
  
  AddAttribute(new nuiAttribute<nuiSize>
               (nglString(_T("ActivationOffset")), nuiUnitPixels,
                nuiMakeDelegate(this, &nuiButton::GetActivationOffset),
                nuiMakeDelegate(this, &nuiButton::SetActivationOffset)));
}
开发者ID:hamedmohammadi,项目名称:nui3,代码行数:26,代码来源:nuiButton.cpp


示例8: CStunMessage

CStunSharedSecretResponseMessage::CStunSharedSecretResponseMessage(const char* pszUsername,
																   const char* pszPassword):
	CStunMessage (SHARED_SECRET_RESPONSE)
{
	AddAttribute (new CStunUsernameAttribute (pszUsername));
	AddAttribute (new CStunPasswordAttribute (pszPassword));
}
开发者ID:husman,项目名称:Development-Side-Projects,代码行数:7,代码来源:StunSharedSecretResponseMessage.cpp


示例9: AddAttribute

void XMLTree::AddAttribute(const string& name, const bool& value )
{
	if(value == true )
		AddAttribute(name, string("true"));
	else
		AddAttribute(name, string("false"));
}
开发者ID:hillwah,项目名称:darkeden,代码行数:7,代码来源:SXml.cpp


示例10: AddAttribute

const char *XMLProcedureCall::MergeXSL(const char *szXSLTemplate)
{
	AddAttribute( "MergeXSL", "yes" );
	AddAttribute( "Template", szXSLTemplate );
	m_bRunObjectFactory = 0;
	return Execute();
}
开发者ID:BrianAberle,项目名称:XMLFoundation,代码行数:7,代码来源:ProcedureCall.cpp


示例11: AddArray

	xmlNode* AddArray(xmlNode* parent, const char* id, const char* arrayType, const char* content, size_t count)
	{
		xmlNode* arrayNode = AddChild(parent, arrayType);
		AddContentUnprocessed(arrayNode, content);
		AddAttribute(arrayNode, DAE_ID_ATTRIBUTE, id);
		AddAttribute(arrayNode, DAE_COUNT_ATTRIBUTE, count);
		return arrayNode;
	}
开发者ID:tweakoz,项目名称:orkid,代码行数:8,代码来源:FUDaeWriter.cpp


示例12: AddParameter

	xmlNode* AddParameter(xmlNode* parent, const char* name, const char* type)
	{
		xmlNode* parameterNode = AddChild(parent, DAE_PARAMETER_ELEMENT);
		if (name != NULL && *name != 0) AddAttribute(parameterNode, DAE_NAME_ATTRIBUTE, name);
		if (type == NULL) type = DAE_FLOAT_TYPE;
		AddAttribute(parameterNode, DAE_TYPE_ATTRIBUTE, type);
		return parameterNode;
	}
开发者ID:tweakoz,项目名称:orkid,代码行数:8,代码来源:FUDaeWriter.cpp


示例13: AddInput

	xmlNode* AddInput(xmlNode* parent, const char* sourceId, const char* semantic, int32 offset, int32 set)
	{
		if (sourceId == NULL || *sourceId == 0 || semantic == NULL || *semantic == 0) return NULL;
		xmlNode* inputNode = AddChild(parent, DAE_INPUT_ELEMENT);
		AddAttribute(inputNode, DAE_SEMANTIC_ATTRIBUTE, semantic);
		AddAttribute(inputNode, DAE_SOURCE_ATTRIBUTE, fm::string("#") + sourceId);
		if (offset >= 0) AddAttribute(inputNode, DAE_OFFSET_ATTRIBUTE, offset);
		if (set >= 0) AddAttribute(inputNode, DAE_SET_ATTRIBUTE, set);
		return inputNode;
	}
开发者ID:tweakoz,项目名称:orkid,代码行数:10,代码来源:FUDaeWriter.cpp


示例14: switch

void PointSet::Initialize ( int mode, int total )
{
	switch (mode) {
	case BPOINT: {
		FreeBuffers ();
		AddBuffer ( BPOINT, sizeof ( Point ), total );
		AddAttribute ( 0, "pos", sizeof ( Vector3DF ), false );
		AddAttribute ( 0, "color", sizeof ( DWORD ), false );
		AddAttribute ( 0, "type", sizeof ( unsigned short), false );
		Reset ();
		} break;
	
	case BPARTICLE: {
		FreeBuffers ();
		AddBuffer ( BPARTICLE, sizeof ( Particle ), total );
		AddAttribute ( 0, "pos", sizeof ( Vector3DF ), false );	
		AddAttribute ( 0, "color", sizeof ( DWORD ), false );
		AddAttribute ( 0, "vel", sizeof ( Vector3DF ), false );
		AddAttribute ( 0, "ndx", sizeof ( unsigned short ), false );
		AddAttribute ( 0, "age", sizeof ( unsigned short ), false );
		AddAttribute ( 0, "type", sizeof ( unsigned short), false );
		Reset ();
		} break;
	}


}
开发者ID:lakshmiboorgu,项目名称:SPH_Simulation,代码行数:27,代码来源:point_set.cpp


示例15: AddDevice

static void AddDevice(IXMLDOMDocument* pDoc,IXMLDOMElement* pParent,const DEVICE& d)
{
	HRESULT hr;
	IXMLDOMElementPtr bdatopology, topology, pintopology;

	AddAttribute(pDoc,L"device_path",d.device_path.c_str(),pParent);
	AddAttribute(pDoc,L"DeviceDesc",d.DeviceDesc.c_str(),pParent);
	AddAttribute(pDoc,L"Service",d.Service.c_str(),pParent);
	AddAttribute(pDoc,L"Class",d.Class.c_str(),pParent);
	AddAttribute(pDoc,L"ClassGUID",d.ClassGUID.c_str(),pParent);
	AddAttribute(pDoc,L"Driver",d.Driver.c_str(),pParent);
	AddAttribute(pDoc,L"PhysicalDeviceObjectName",d.PhysicalDeviceObjectName.c_str(),pParent);
	AddAttribute(pDoc,L"Enumerator_Name",d.Enumerator_Name.c_str(),pParent);
	AddAttribute(pDoc,L"device_instance_id",d.device_instance_id.c_str(),pParent);

	CreateElement(pDoc,L"bdatopology",&bdatopology);
	CreateElement(pDoc,L"topology",&topology);
	CreateElement(pDoc,L"pintopology",&pintopology);

	AddBDATopology(pDoc,bdatopology,d.bdatopology);
	AddTopology(pDoc,topology,d.topology);
	AddPinTopology(pDoc,pintopology,d.pintopology);

	AppendChild(bdatopology,pParent);
	AppendChild(topology,pParent);
	AppendChild(pintopology,pParent);
}
开发者ID:jensvaaben,项目名称:mfcbdainf,代码行数:27,代码来源:xmldoc.cpp


示例16: AddAttribute

//------------------------------------------------------------------------
void CItemParamsNode::SetAttribute(const char *name, const char *attr)
{
	//m_attributes.insert(TAttributeMap::value_type(name, string(attr)));
	if (!strcmpi(name, "name"))
	{
		m_nameAttribute = attr;
		AddAttribute( name,TItemParamValue(m_nameAttribute) );
	}
	else
		AddAttribute( name,TItemParamValue(string(attr)) );
}
开发者ID:aronarts,项目名称:FireNET,代码行数:12,代码来源:ItemParams.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ AddBattlegroundScripts函数代码示例发布时间:2022-05-30
下一篇:
C++ AddAnchor函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap