當前位置: 首頁>>代碼示例>>C++>>正文


C++ AddAttribute函數代碼示例

本文整理匯總了C++中AddAttribute函數的典型用法代碼示例。如果您正苦於以下問題:C++ AddAttribute函數的具體用法?C++ AddAttribute怎麽用?C++ AddAttribute使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了AddAttribute函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


注:本文中的AddAttribute函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。