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


C++ Appearance类代码示例

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


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

示例1: mAppearanceGroupSet

// Constructor
AppearanceGroup::AppearanceGroup(AppearanceGroupSet* appearanceGroupSet,
                       const char* user) :
//   mResource(resource),
   mAppearanceGroupSet(appearanceGroupSet),
   mSharedUser(user)
{
   Os::Logger::instance().log(FAC_SAA, PRI_DEBUG,
                 "AppearanceGroup:: this = %p, mSharedUser = '%s'",
                 this, mSharedUser.data());

   // Publish initial content (presumably empty)
   SipDialogEvent* lFullContent = new SipDialogEvent("full", mSharedUser.data());
   UtlHashMapIterator appitor(mAppearances);
   UtlString* handle;
   while ( (handle = dynamic_cast <UtlString*> (appitor())))
   {
      Appearance* inst = dynamic_cast <Appearance*> (appitor.value());
      inst->getDialogs(lFullContent);
   }
   lFullContent->buildBody();

  // Publish the content for this shared user to the Subscribe Server.
  // Make a copy, because mpSipPublishContentMgr will own it.
  HttpBody* pHttpBody = new HttpBody(*(HttpBody*)lFullContent);
  delete lFullContent;
  getAppearanceAgent()->getEventPublisher().publish(
        mSharedUser.data(),
        DIALOG_SLA_EVENT_TYPE, //eventTypeKey
        DIALOG_EVENT_TYPE,     //eventType
        1, &pHttpBody,
        TRUE, TRUE);

   startSubscription();
}
开发者ID:ClydeFroq,项目名称:sipxecs,代码行数:35,代码来源:AppearanceGroup.cpp

示例2: glBegin

void
LinearGeometry::renderFaces(float alpha, Appearance& appearance)
{
  glBegin(GL_TRIANGLES);
  _register = appearance.getFaceColor();
  glColor4f(_register[0], _register[1], _register[2],
            _register[3] * alpha * appearance.getModifierAlpha());
  int number = getNumberTriangles();
  float*** triangles = getTriangles();
  for (int i = 0; i < number; i++) {
    _register = triangles[i][0];
    glVertex3f(_register[0], _register[1], _register[2]);
    _register = triangles[i][1];
    glVertex3f(_register[0], _register[1], _register[2]);
    _register = triangles[i][2];
    glVertex3f(_register[0], _register[1], _register[2]);
  }
  glEnd();

  glBegin(GL_QUADS);
  number = getNumberQuads();
  float*** quads = getQuads();
  for (int i = 0; i < number; i++) {
    _register = quads[i][0];
    glVertex3f(_register[0], _register[1], _register[2]);
    _register = quads[i][1];
    glVertex3f(_register[0], _register[1], _register[2]);
    _register = quads[i][2];
    glVertex3f(_register[0], _register[1], _register[2]);
    _register = quads[i][3];
    glVertex3f(_register[0], _register[1], _register[2]);
  }
  glEnd();

}
开发者ID:williamwaterson,项目名称:protolayer,代码行数:35,代码来源:LinearGeometry.cpp

示例3: if

void InventoryDomain::processVisibilityForMovedEntity(const LocatedEntity& moved_entity, const Location& old_loc, OpVector & res)
{
    if (m_entity.m_contains) {

        std::vector<LocatedEntity*> visibleEntities;

        std::unordered_set<int> outfitted;
        LocatedEntity* rightHandWieldedEntity = nullptr;
        const OutfitProperty* outfitProperty = m_entity.getPropertyClass<OutfitProperty>("outfit");

        if (outfitProperty) {
            for (auto& entry : outfitProperty->data()) {
                outfitted.insert(entry.second->getIntId());
            }
        }
        const EntityProperty* rightHandWieldProperty = m_entity.getPropertyClass<EntityProperty>("right_hand_wield");
        if (rightHandWieldProperty) {
            rightHandWieldedEntity = rightHandWieldProperty->data().get();
        }

        for (auto childEntity : *m_entity.m_contains) {
            if (childEntity == rightHandWieldedEntity) {
                visibleEntities.push_back(childEntity);
            } else if (outfitted.find(childEntity->getIntId()) != outfitted.end()) {
                visibleEntities.push_back(childEntity);
            }
        }

        std::set<std::string> newVisibleEntities;
        for (auto visibleEntity : visibleEntities) {
            if (m_lastVisibleEntities.find(visibleEntity->getId()) == m_lastVisibleEntities.end()) {
                Anonymous ent;
                ent->setId(visibleEntity->getId());
                ent->setStamp(visibleEntity->getSeq());

                Appearance d;
                d->setArgs1(ent);
                res.push_back(d);
            } else {
                m_lastVisibleEntities.erase(visibleEntity->getId());
            }
            newVisibleEntities.insert(visibleEntity->getId());
        }
        for (auto entityId : m_lastVisibleEntities) {
            Anonymous ent;
            ent->setId(entityId);

            Disappearance d;
            d->setArgs1(ent);
            res.push_back(d);

        }

        m_lastVisibleEntities = std::move(newVisibleEntities);
    }
}
开发者ID:,项目名称:,代码行数:56,代码来源:

示例4: drawPrims

void DisplayList::drawPrims(string appearance) {
	vector<MyPrimitive *>::const_iterator it;

	for (it = prims.begin(); it != prims.end(); it++) {
		Appearance *app = Scene::getInstance()->getAppearance(appearance);
		app->apply();
		(*it)->setAppearance(appearance);
		(*it)->draw();
		(*it)->clearAppearance();
	}
}
开发者ID:diogojapinto,项目名称:laig_proj1,代码行数:11,代码来源:DisplayList.cpp

示例5: while

		void TextureProjectorNode::removeAllScopes()
		{
			while (!m_oldTexUnitMap.empty())
			{
				MeshNode* meshNode = m_oldTexUnitMap.begin()->first;
				Appearance* appearance = meshNode->getAppearance();
				TextureUnitState* texUnit = m_oldTexUnitMap.begin()->second;
				appearance->setTextureUnitState(0,texUnit);
				m_oldTexUnitMap.erase(m_oldTexUnitMap.begin());
			}
		}
开发者ID:spidersharma03,项目名称:spider3d,代码行数:11,代码来源:TextureProjectorNode.cpp

示例6: itor

void AppearanceGroup::publish(bool bSendFullContent, bool bSendPartialContent, SipDialogEvent* lContent)
{
   Os::Logger::instance().log(FAC_SAA, PRI_DEBUG,
         "AppearanceGroup::publish sending NOTIFY for: '%s'", mSharedUser.data());
   if (bSendFullContent)
   {
      // Both the Full and the Partial dialog-infos are sent to the SIP Subscribe Server.
      // The Partial will then be sent out right away and the Full
      // will be stored in the Subscribe Server to be sent on any initial
      // SUBSCRIBEs and re-SUBSCRIBEs.
      // Note that the full-state publish() must be done before the partial-state
      // publish() to avoid race conditions with regard to starting a new
      // subscription.
      // The Full content is constructed from all dialogs being managed by all appearances.
      UtlHashMapIterator itor(mAppearances);
      SipDialogEvent* lFullContent = new SipDialogEvent("full", mSharedUser.data());
      UtlHashMapIterator appitor(mAppearances);
      UtlString* handle;
      while ( (handle = dynamic_cast <UtlString*> (appitor())))
      {
         Appearance* inst = dynamic_cast <Appearance*> (appitor.value());
         inst->getDialogs(lFullContent);
      }
      lFullContent->buildBody();

      // Publish the content to the subscribe server.
      // Make a copy, because SipPublishContentMgr will own it.
      HttpBody* pHttpBody = new HttpBody(*(HttpBody*)lFullContent);

      getAppearanceAgent()->getEventPublisher().publish(
            mSharedUser.data(),
            DIALOG_SLA_EVENT_TYPE, //eventTypeKey
            DIALOG_EVENT_TYPE,     //eventType
            1, &pHttpBody,
            TRUE, TRUE);
      delete lFullContent;
   }

   if ( bSendPartialContent )
   {
      // The Partial content is the incoming message, with unique dialog ids.
      lContent->setState(STATE_PARTIAL);
      lContent->buildBody();
      HttpBody* pPartialBody = new HttpBody(*(HttpBody*)lContent);
      getAppearanceAgent()->getEventPublisher().publish(
            mSharedUser.data(),
            DIALOG_SLA_EVENT_TYPE, //eventTypeKey
            DIALOG_EVENT_TYPE,     //eventType
            1, &pPartialBody,
            FALSE, FALSE);
   }

}
开发者ID:ClydeFroq,项目名称:sipxecs,代码行数:53,代码来源:AppearanceGroup.cpp

示例7: removeScope

		void TextureProjectorNode::removeScope( MeshNode* meshNode )
		{
			// While removing the Meshnode from the scope list, we need to restore the original TextureUnit. 
			if ( m_oldTexUnitMap.find(meshNode) != m_oldTexUnitMap.end() )
			{
				Appearance* appearance = 0;
				appearance = meshNode->getAppearance();
				if ( appearance )
				{
				  appearance->setTextureUnitState(0,m_oldTexUnitMap.find(meshNode)->second);
				}
				m_oldTexUnitMap.erase(meshNode);
			}
		}
开发者ID:spidersharma03,项目名称:spider3d,代码行数:14,代码来源:TextureProjectorNode.cpp

示例8: while

void XMLScene::processAppearances(TiXmlElement* appearancesElement)
{
	TiXmlElement* element= appearancesElement->FirstChildElement("appearance");
	float ambient[4],diffuse[4],specular[4],emissive[4],shininess,sWrap,tWrap;
	string textureRef,id;
	Appearance* appearance;
	while(element!=NULL)
	{
		id=element->Attribute("id"); 
		read1Float("shininess",element,shininess);
		if(element->Attribute("textureref")!=NULL)
			textureRef=element->Attribute("textureref");
		else textureRef="";

		TiXmlElement* component = element ->FirstChildElement();

		while(component != NULL){
			if(component->Attribute("type")=="ambient"){
				read4Float("value", element, ambient[0], ambient[1], ambient[2],
					ambient[3]);}

			if(component->Attribute("type")=="diffuse"){
				read4Float("value", element, diffuse[0], diffuse[1], diffuse[2],
					diffuse[3]);}

			if(component->Attribute("type")=="specular"){
				read4Float("value", element, specular[0], specular[1], specular[2],
					specular[3]);
			}
			component=component->NextSiblingElement();
		}

		if(textureRef!=""){

			Texture* temp = Textures[textureRef];
			appearance = new Appearance(ambient,diffuse,specular,emissive,shininess,temp->getSWrap(),temp->getTWrap(),textureRef);

			appearance->setTextureWrap(appearance->getSWrap(),appearance->getTWrap());
			appearance->setTexture(sceneTextures[textureRef]);

		}
		else
			appearance = new Appearance(ambient,diffuse,specular,emissive,shininess,1,1,textureRef);

		appearances[id]=appearance;

		element=element->NextSiblingElement("appearance");
	}
}
开发者ID:PMRocha,项目名称:Laig,代码行数:49,代码来源:XMLScene.cpp

示例9: printf

void ProjectScene::processDisplayLists(Node* n, Node* graphRoot){
	
	
	if (n->getAppearance() != NULL)
		n->getAppearance()->apply();
	int numFilhos = n->getDescendentes().size();
	for (int i = 0; i < numFilhos; i++){
		this->processDisplayLists(n->getDescendenteIndex(i), graphRoot);
	}


	if (n->getDisplayList()){
		//printf("nome do no: %s\n", n->getId().c_str());
		
		printf("---------------------------\nfazer lista:\n");

		Appearance*  temp = new Appearance();
		if (n->getAppearance() == NULL){
			//printf("vai procurar aparencia aos ascendentes\n");
			temp = getClosestParentAppearance(graphRoot, n);
		}
		else temp = n->getAppearance();
		
		if (temp != NULL) temp->apply();

		n->setAparencia(temp);
		printf("	nome aparencia: %s\n",temp->getId());




		if (n->getDisplayListID() == -1){
			int id = glGenLists(1);
			n->setDisplayListID(id);

			n->setDisplayList(false); //serve para forçar o drawAux a desenhar 
									  //este nó como um nó "normal" (sem lista)

			glNewList(n->getDisplayListID(), GL_COMPILE);
				this->drawAux(n);
			glEndList();

			n->setDisplayList(true); //restaura a "true" após o processamento do nó

			printf("fim lista:\n---------------------------\n");
		}
	
	}
}
开发者ID:Filfmira,项目名称:LAIG-Project,代码行数:49,代码来源:ProjectScene.cpp

示例10: Appearance

void SysPref::onAppearance()
{
	Appearance *frm;
	if (nextWidget != NULL && nextWidget->moduleName == "Appearance") {
		frm = (Appearance *) nextWidget;
	} else {
		frm = new Appearance();
	}
	stack->addWidget(frm);
	frm->show();
	stack->setCurrentIndex(1);
	discardPrevious();
	nextWidget = NULL;
	setWindowTitle(frm->moduleName);	
}
开发者ID:admiral0,项目名称:Antico-Deluxe,代码行数:15,代码来源:sysprefwindow.cpp

示例11: itor3

// Dump the object's internal state.
void AppearanceGroup::dumpState()
{
   // indented 4
   Os::Logger::instance().log(FAC_SAA, PRI_INFO,
                 "\t    AppearanceGroup %p mSharedUser = '%s', mSubscriptionEarlyDialogHandle = '%s'",
                 this, mSharedUser.data(), mSubscriptionEarlyDialogHandle.data());

   UtlHashMapIterator itor3(mAppearances);
   UtlString* handle;
   while ((handle = dynamic_cast <UtlString*> (itor3())))
   {
      Appearance* ss = dynamic_cast <Appearance*> (itor3.value());
      ss->dumpState();
   }
}
开发者ID:ClydeFroq,项目名称:sipxecs,代码行数:16,代码来源:AppearanceGroup.cpp

示例12: assignNode

	void AppearanceManager::assignNode( const std::string& nodeid )
	{ 
        _lastId = nodeid;

        if ( !getAppearance< Appearance * >( nodeid ) )
            _appearancesMap[ nodeid ] = std::vector< Appearance* >(0);

		Appearance* currentAppearance = _appearances[ _appearances.size() - 1 ];
		ForSide side = currentAppearance->getIsFront() ? FS_FRONT : FS_BACK;
		if ( dynamic_cast< Texture* >( currentAppearance ) && !getAppearance< Texture* >( nodeid, side ) ||
			 dynamic_cast< Material* >( currentAppearance ) && !getAppearance< Material* >( nodeid, side ) )
		{
            _appearancesMap[ nodeid ].push_back( currentAppearance );
			if ( _lastCoords ) { assignTexCoords( _lastCoords ); _lastId = ""; }
		}
	}
开发者ID:jpouderoux,项目名称:libcitygml-jklimke,代码行数:16,代码来源:citymodel.cpp

示例13: setTransform_w

void Appearance::setOwner(Object* owner)
{
	//-- keep track of owner object.
	m_owner = owner;

	// DBE - This was added to mimic the behavior of when the appearance-to-world 
	// transform was stored in Object instead of Appearance.
	if (owner)
	{
		Appearance *ownerAppearance = owner->getAppearance();
		if (!ownerAppearance)
		{
			setTransform_w(owner->getTransform_o2w());
		}
		else if (ownerAppearance!=this)
		{
			setTransform_w(ownerAppearance->getTransform_w());
		}
	}

	//-- retrieve customization data for new owner
	CustomizationData *customizationData = 0;

	if (owner)
	{
		// get the property
		CustomizationDataProperty *const property = safe_cast<CustomizationDataProperty*>(owner->getProperty(CustomizationDataProperty::getClassPropertyId()));
		if (property)
		{
			// retrieve the customization data from the property
			customizationData = property->fetchCustomizationData();
		}
	}

	//-- set the CustomizationData
	setCustomizationData(customizationData);

	//-- release local reference
	if (customizationData)
		customizationData->release();

	//-- clear the rendered frame number
	m_renderedFrameNumber = 0;
}
开发者ID:Mesagoppinmypants,项目名称:NGELinux,代码行数:44,代码来源:Appearance.cpp

示例14: addScope

		void TextureProjectorNode::addScope( MeshNode* meshNode )
		{
			// Save TextureUnit of this meshNode, so that it can be recovered while removing this meshnode from the Scope.
			if( meshNode )
			{
				Appearance* appearance = 0;
				appearance = meshNode->getAppearance();
				TextureUnitState *texUnit = 0;
				if ( appearance )
				{
					// Save the old texture unit
					texUnit = appearance->getTextureUnitState(0);
					// Set the projector Texture Unit
					appearance->setTextureUnitState(0,projectorTexUnitState);
				}
				//if(texUnit)
				m_oldTexUnitMap[meshNode] = texUnit;
			}
		}
开发者ID:spidersharma03,项目名称:spider3d,代码行数:19,代码来源:TextureProjectorNode.cpp

示例15: while

void YafFile::processAppearances(TiXmlElement* appearancesElement)
{
	TiXmlElement* element= appearancesElement->FirstChildElement("appearance");
	float ambient[4],diffuse[4],specular[4],emissive[4],shininess,sWrap,tWrap;
	string textureRef,id;
	while(element!=NULL)
	{
		id=element->Attribute("id"); 
		read4Float("ambient", element, ambient[0], ambient[1], ambient[2],
			ambient[3]);
		read4Float("emissive", element, emissive[0], emissive[1], emissive[2],
			emissive[3]);
		read4Float("diffuse", element, diffuse[0], diffuse[1], diffuse[2],
			diffuse[3]);
		read4Float("specular", element, specular[0], specular[1], specular[2],
			specular[3]);
		element->QueryFloatAttribute("shininess",&shininess);
		if(element->Attribute("texlength_t")!=NULL)
			element->QueryFloatAttribute("texlength_t",&tWrap);
		else tWrap=0;
		if(element->Attribute("texlength_s")!=NULL)
			element->QueryFloatAttribute("texlength_s",&sWrap);
		else sWrap=0;
		if(element->Attribute("textureref")!=NULL)
			textureRef=element->Attribute("textureref");
		else textureRef="";
		Appearance* appearance = new Appearance(ambient,diffuse,specular,emissive,shininess,sWrap,tWrap,textureRef);

		if(textureRef!="")
		{
			appearance->setTextureWrap(tWrap,sWrap);
			appearance->setTexture(sceneTextures[textureRef]);
		}
		appearances[id]=appearance;
		element=element->NextSiblingElement("appearance");
	}
}
开发者ID:jnadal,项目名称:LAIG-Projeto,代码行数:37,代码来源:YafFile.cpp


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