本文整理汇总了C++中LLPointer::isNull方法的典型用法代码示例。如果您正苦于以下问题:C++ LLPointer::isNull方法的具体用法?C++ LLPointer::isNull怎么用?C++ LLPointer::isNull使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLPointer
的用法示例。
在下文中一共展示了LLPointer::isNull方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: playCurrentMedia
// static
void LLToolPie::playCurrentMedia(const LLPickInfo& info)
{
//FIXME: how do we handle object in different parcel than us?
LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
if (!parcel) return;
LLPointer<LLViewerObject> objectp = info.getObject();
// Early out cases. Must clear media hover.
// did not hit an object or did not hit a valid face
if ( objectp.isNull() ||
info.mObjectFace < 0 ||
info.mObjectFace >= objectp->getNumTEs() )
{
return;
}
// Does this face have media?
const LLTextureEntry* tep = objectp->getTE(info.mObjectFace);
if (!tep)
return;
const LLMediaEntry* mep = tep->hasMedia() ? tep->getMediaData() : NULL;
if(!mep)
return;
//TODO: Can you Use it?
LLPluginClassMedia* media_plugin = NULL;
viewer_media_t media_impl = LLViewerMedia::getMediaImplFromTextureID(mep->getMediaID());
if(media_impl.notNull() && media_impl->hasMedia())
{
media_plugin = media_impl->getMediaPlugin();
if (media_plugin && media_plugin->pluginSupportsMediaTime())
{
if(media_impl->isMediaPlaying())
{
media_impl->pause();
}
else
{
media_impl->play();
}
}
}
}
示例2:
//
// LLParticipantList::SpeakerAddListener
//
bool LLParticipantList::SpeakerAddListener::handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata)
{
/**
* We need to filter speaking objects. These objects shouldn't appear in the list
* @see LLFloaterChat::addChat() in llviewermessage.cpp to get detailed call hierarchy
*/
const LLUUID& speaker_id = event->getValue().asUUID();
LLPointer<LLSpeaker> speaker = mParent.mSpeakerMgr->findSpeaker(speaker_id);
if(speaker.isNull() || speaker->mType == LLSpeaker::SPEAKER_OBJECT)
{
return false;
}
return mParent.onAddItemEvent(event, userdata);
}
示例3: handle_media_hover
static bool handle_media_hover(const LLPickInfo& pick)
{
//FIXME: how do we handle object in different parcel than us?
LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
if (!parcel) return false;
LLPointer<LLViewerObject> objectp = pick.getObject();
// Early out cases. Must clear mouse over media focus flag
// did not hit an object or did not hit a valid face
if ( objectp.isNull() ||
pick.mObjectFace < 0 ||
pick.mObjectFace >= objectp->getNumTEs() )
{
LLViewerMediaFocus::getInstance()->setMouseOverFlag(false);
return false;
}
// HACK: This is directly referencing an impl name. BAD!
// This can be removed when we have a truly generic media browser that only
// builds an impl based on the type of url it is passed.
// is media playing on this face?
const LLTextureEntry* tep = objectp->getTE(pick.mObjectFace);
viewer_media_t media_impl = LLViewerMedia::getMediaImplFromTextureID(tep->getID());
if (tep
&& media_impl.notNull()
&& media_impl->hasMedia()
&& gSavedSettings.getBOOL("MediaOnAPrimUI"))
{
if(LLViewerMediaFocus::getInstance()->getFocus())
{
media_impl->mouseMove(pick.mXYCoords.mX, pick.mXYCoords.mY);
}
// Set mouse over flag if unset
if (! LLViewerMediaFocus::getInstance()->getMouseOverFlag())
{
LLSelectMgr::getInstance()->setHoverObject(objectp, pick.mObjectFace);
LLViewerMediaFocus::getInstance()->setMouseOverFlag(true, media_impl);
LLViewerMediaFocus::getInstance()->setPickInfo(pick);
}
return true;
}
LLViewerMediaFocus::getInstance()->setMouseOverFlag(false);
return false;
}
示例4: getImageFromUrl
LLViewerImage* LLViewerImageList::getImageFromUrl(const std::string& url,
BOOL usemipmaps,
BOOL level_immediate,
LLGLint internal_format,
LLGLenum primary_format,
const LLUUID& force_id)
{
if (gNoRender)
{
// Never mind that this ignores image_set_id;
// getImage() will handle that later.
return getImage(IMG_DEFAULT, TRUE, TRUE);
}
// generate UUID based on hash of filename
LLUUID new_id;
if (force_id.notNull())
{
new_id = force_id;
}
else
{
new_id.generate(url);
}
LLPointer<LLViewerImage> imagep = hasImage(new_id);
if (imagep.isNull())
{
imagep = new LLViewerImage(url, new_id, usemipmaps);
if (internal_format && primary_format)
{
imagep->setExplicitFormat(internal_format, primary_format);
}
addImage(imagep);
if (level_immediate)
{
imagep->dontDiscard();
imagep->setBoostLevel(LLViewerImageBoostLevel::BOOST_UI);
}
}
imagep->setGLTextureCreated(true);
return imagep;
}
示例5: handle_media_click
static bool handle_media_click(const LLPickInfo& pick)
{
//FIXME: how do we handle object in different parcel than us?
LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
LLPointer<LLViewerObject> objectp = pick.getObject();
if (!parcel ||
objectp.isNull() ||
pick.mObjectFace < 0 ||
pick.mObjectFace >= objectp->getNumTEs())
{
LLSelectMgr::getInstance()->deselect();
LLViewerMediaFocus::getInstance()->clearFocus();
return false;
}
// HACK: This is directly referencing an impl name. BAD!
// This can be removed when we have a truly generic media browser that only
// builds an impl based on the type of url it is passed.
// is media playing on this face?
const LLTextureEntry* tep = objectp->getTE(pick.mObjectFace);
viewer_media_t media_impl = LLViewerMedia::getMediaImplFromTextureID(tep->getID());
if (tep
&& media_impl.notNull()
&& media_impl->hasMedia()
/*&& gSavedSettings.getBOOL("MediaOnAPrimUI")*/)
{
LLObjectSelectionHandle selection = LLViewerMediaFocus::getInstance()->getSelection();
if (! selection->contains(pick.getObject(), pick.mObjectFace))
{
LLViewerMediaFocus::getInstance()->setFocusFace(TRUE, pick.getObject(), pick.mObjectFace, media_impl);
}
media_impl->mouseDown(pick.mXYCoords.mX, pick.mXYCoords.mY);
media_impl->mouseCapture(); // the mouse-up will happen when capture is lost
return true;
}
LLSelectMgr::getInstance()->deselect();
LLViewerMediaFocus::getInstance()->clearFocus();
return false;
}
示例6: updateParticipantsVoiceState
void LLCallFloater::updateParticipantsVoiceState()
{
uuid_vec_t speakers_list;
// Get a list of participants from VoiceClient
uuid_vec_t speakers_uuids;
get_voice_participants_uuids(speakers_uuids);
// Updating the status for each participant already in list.
std::vector<LLPanel*> items;
mAvatarList->getItems(items);
std::vector<LLPanel*>::const_iterator
it = items.begin(),
it_end = items.end();
for(; it != it_end; ++it)
{
LLAvatarListItem *item = dynamic_cast<LLAvatarListItem*>(*it);
if (!item) continue;
const LLUUID participant_id = item->getAvatarId();
bool found = false;
uuid_vec_t::iterator speakers_iter = std::find(speakers_uuids.begin(), speakers_uuids.end(), participant_id);
LL_DEBUGS("Voice") << "processing speaker: " << item->getAvatarName() << ", " << item->getAvatarId() << LL_ENDL;
// If an avatarID assigned to a panel is found in a speakers list
// obtained from VoiceClient we assign the JOINED status to the owner
// of this avatarID.
if (speakers_iter != speakers_uuids.end())
{
setState(item, STATE_JOINED);
LLPointer<LLSpeaker> speaker = mSpeakerManager->findSpeaker(participant_id);
if (speaker.isNull())
continue;
speaker->mHasLeftCurrentCall = FALSE;
speakers_uuids.erase(speakers_iter);
found = true;
}
if (!found)
{
updateNotInVoiceParticipantState(item);
}
}
}
示例7: onSpeakerMuteEvent
bool LLParticipantList::onSpeakerMuteEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata)
{
LLPointer<LLSpeaker> speakerp = (LLSpeaker*)event->getSource();
if (speakerp.isNull()) return false;
// update UI on confirmation of moderator mutes
if (event->getValue().asString() == "voice")
{
childSetValue("moderator_allow_voice", !speakerp->mModeratorMutedVoice);
}
else if (event->getValue().asString() == "text")
{
childSetValue("moderator_allow_text", !speakerp->mModeratorMutedText);
}
return true;
}
示例8:
//
// LLPanelActiveSpeakers::SpeakerMuteListener
//
bool LLPanelActiveSpeakers::SpeakerMuteListener::handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
LLPointer<LLSpeaker> speakerp = (LLSpeaker*)event->getSource();
if (speakerp.isNull()) return false;
// update UI on confirmation of moderator mutes
if (event->getValue().asString() == "voice")
{
mPanel->childSetValue("moderator_allow_voice", !speakerp->mModeratorMutedVoice);
}
if (event->getValue().asString() == "text")
{
mPanel->childSetValue("moderator_allow_text", !speakerp->mModeratorMutedText);
}
return true;
}
示例9: getImage
LLViewerImage* LLViewerImageList::getImage(const LLUUID &image_id,
BOOL usemipmaps,
BOOL level_immediate,
LLGLint internal_format,
LLGLenum primary_format,
LLHost request_from_host)
{
// Return the image with ID image_id
// If the image is not found, creates new image and
// enqueues a request for transmission
if ((&image_id == NULL) || image_id.isNull())
{
return (getImage(IMG_DEFAULT, TRUE, TRUE));
}
LLPointer<LLViewerImage> imagep = hasImage(image_id);
if (imagep.isNull())
{
imagep = new LLViewerImage(image_id, request_from_host, usemipmaps);
if (internal_format && primary_format)
{
imagep->setExplicitFormat(internal_format, primary_format);
}
addImage(imagep);
if (level_immediate)
{
imagep->dontDiscard();
imagep->setBoostLevel(LLViewerImageBoostLevel::BOOST_UI);
}
else
{
//by default, the texure can not be removed from memory even if it is not used.
//here turn this off
//if this texture should be set to NO_DELETE, either pass level_immediate == TRUE here, or call setNoDelete() afterwards.
imagep->forceActive() ;
}
}
imagep->setGLTextureCreated(true);
return imagep;
}
示例10: updateRiggedFaceVertexBuffer
void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(LLVOAvatar* avatar, LLFace* face, const LLMeshSkinInfo* skin, LLVolume* volume, const LLVolumeFace& vol_face)
{
LLVector4a* weight = vol_face.mWeights;
if (!weight)
{
return;
}
LLPointer<LLVertexBuffer> buffer = face->getVertexBuffer();
LLDrawable* drawable = face->getDrawable();
U32 data_mask = face->getRiggedVertexBufferDataMask();
if (buffer.isNull() ||
buffer->getTypeMask() != data_mask ||
buffer->getNumVerts() != vol_face.mNumVertices ||
buffer->getNumIndices() != vol_face.mNumIndices ||
(drawable && drawable->isState(LLDrawable::REBUILD_ALL)))
{
if (drawable && drawable->isState(LLDrawable::REBUILD_ALL))
{ //rebuild EVERY face in the drawable, not just this one, to avoid missing drawable wide rebuild issues
for (S32 i = 0; i < drawable->getNumFaces(); ++i)
{
LLFace* facep = drawable->getFace(i);
U32 face_data_mask = facep->getRiggedVertexBufferDataMask();
if (face_data_mask)
{
LLPointer<LLVertexBuffer> cur_buffer = facep->getVertexBuffer();
const LLVolumeFace& cur_vol_face = volume->getVolumeFace(i);
getRiggedGeometry(facep, cur_buffer, face_data_mask, skin, volume, cur_vol_face);
}
}
drawable->clearState(LLDrawable::REBUILD_ALL);
buffer = face->getVertexBuffer();
}
else
{ //just rebuild this face
getRiggedGeometry(face, buffer, data_mask, skin, volume, vol_face);
}
}
if (sShaderLevel <= 0 && face->mLastSkinTime < avatar->getLastSkinTime())
{
avatar->updateSoftwareSkinnedVertices(skin, weight, vol_face, buffer);
}
}
示例11: catch
void worldmap_object_t::test<1>()
{
// Test 1 : reset()
try {
mWorld->reset();
} catch (...) {
fail("LLWorldMap::reset() at init test failed");
}
// Test 2 : clearImageRefs()
try {
mWorld->clearImageRefs();
} catch (...) {
fail("LLWorldMap::clearImageRefs() test failed");
}
// Test 3 : dropImagePriorities()
try {
mWorld->dropImagePriorities();
} catch (...) {
fail("LLWorldMap::dropImagePriorities() test failed");
}
// Test 4 : reloadItems()
try {
mWorld->reloadItems(true);
} catch (...) {
fail("LLWorldMap::reloadItems() test failed");
}
// Test 5 : updateRegions()
try {
mWorld->updateRegions(1000, 1000, 1004, 1004);
} catch (...) {
fail("LLWorldMap::updateRegions() test failed");
}
// Test 6 : equalizeBoostLevels()
try {
mWorld->equalizeBoostLevels();
} catch (...) {
fail("LLWorldMap::equalizeBoostLevels() test failed");
}
// Test 7 : getObjectsTile()
try {
LLPointer<LLViewerFetchedTexture> image = mWorld->getObjectsTile((U32)(X_WORLD_TEST/REGION_WIDTH_METERS), (U32)(Y_WORLD_TEST/REGION_WIDTH_METERS), 1);
ensure("LLWorldMap::getObjectsTile() failed", image.isNull());
} catch (...) {
fail("LLWorldMap::getObjectsTile() test failed with exception");
}
}
示例12: setIrcSpeakers
//lgg todo setIrcSpeakers setSpeaker
void LLIMSpeakerMgr::setIrcSpeakers(const LLSD& speakers)
{
for (speaker_map_t::iterator speaker_it = mSpeakers.begin(); speaker_it != mSpeakers.end(); ++speaker_it)
{
LLSpeaker* tempspeakerp = speaker_it->second;
tempspeakerp->mStatus = LLSpeaker::STATUS_NOT_IN_CHANNEL;
tempspeakerp->mDotColor = INACTIVE_COLOR;
tempspeakerp->mActivityTimer.resetWithExpiry(SPEAKER_TIMEOUT);
}
//mSpeakers.clear();
//mSpeakersSorted.clear();
for(int i = 0; i < speakers.size(); i++)
{
LLSD personData = speakers[i];
/*(llinfos << " adding a new person to the list " <<
personData["irc_agent_id"].asString().c_str() << "=id----" <<
personData["irc_agent_name"].asString().c_str() << "=name----" <<
personData["irc_agent_mod"].asString().c_str() << "=mod----" <<
personData["irc_channel"].asString().c_str() << "=chan----" <<
personData["irc_mode"].asString().c_str() << "=mode----" << llendl;
*/
LLUUID agent_id = LLUUID((const LLUUID&)personData["irc_agent_id"]);
LLPointer<LLSpeaker> speakerp = findSpeaker(agent_id);
if(speakerp.isNull())
{
speakerp = setSpeaker(
agent_id,
personData["irc_agent_name"].asString(),
LLSpeaker::STATUS_TEXT_ONLY,
LLSpeaker::SPEAKER_AGENT);
}
speakerp->mDotColor = ACTIVE_COLOR;
speakerp->mStatus = LLSpeaker::STATUS_TEXT_ONLY;
speakerp->mIsModerator = personData["irc_agent_mod"].asBoolean();
}
}
示例13: mute
void FSParticipantList::FSParticipantListMenu::toggleMute(const LLSD& userdata, U32 flags)
{
const LLUUID speaker_id = mUUIDs.front();
BOOL is_muted = LLMuteList::getInstance()->isMuted(speaker_id, flags);
std::string name;
//fill in name using voice client's copy of name cache
LLPointer<LLSpeaker> speakerp = mParent.mSpeakerMgr->findSpeaker(speaker_id);
if (speakerp.isNull())
{
LL_WARNS("Speakers") << "Speaker " << speaker_id << " not found" << LL_ENDL;
return;
}
LLAvatarListItem* item = dynamic_cast<LLAvatarListItem*>(mParent.mAvatarList->getItemByValue(speaker_id));
if (NULL == item) return;
name = item->getAvatarName();
LLMute::EType mute_type;
switch (speakerp->mType)
{
case LLSpeaker::SPEAKER_AGENT:
mute_type = LLMute::AGENT;
break;
case LLSpeaker::SPEAKER_OBJECT:
mute_type = LLMute::OBJECT;
break;
case LLSpeaker::SPEAKER_EXTERNAL:
default:
mute_type = LLMute::EXTERNAL;
break;
}
LLMute mute(speaker_id, name, mute_type);
if (!is_muted)
{
LLMuteList::getInstance()->add(mute, flags);
}
else
{
LLMuteList::getInstance()->remove(mute, flags);
}
}
示例14: toggleMute
void LLParticipantList::toggleMute(const LLSD& userdata, U32 flags)
{
const LLUUID speaker_id = userdata.asUUID(); //mUUIDs.front();
BOOL is_muted = LLMuteList::getInstance()->isMuted(speaker_id, flags);
std::string name;
//fill in name using voice client's copy of name cache
LLPointer<LLSpeaker> speakerp = mSpeakerMgr->findSpeaker(speaker_id);
if (speakerp.isNull())
{
LL_WARNS("Speakers") << "Speaker " << speaker_id << " not found" << LL_ENDL;
return;
}
name = speakerp->mDisplayName;
LLMute::EType mute_type;
switch (speakerp->mType)
{
case LLSpeaker::SPEAKER_AGENT:
mute_type = LLMute::AGENT;
break;
case LLSpeaker::SPEAKER_OBJECT:
mute_type = LLMute::OBJECT;
break;
case LLSpeaker::SPEAKER_EXTERNAL:
default:
mute_type = LLMute::EXTERNAL;
break;
}
LLMute mute(speaker_id, name, mute_type);
if (!is_muted)
{
LLMuteList::getInstance()->add(mute, flags);
}
else
{
LLMuteList::getInstance()->remove(mute, flags);
}
}
示例15: processForeignLandmark
static void processForeignLandmark(LLLandmark* landmark,
const LLUUID& object_id, const LLUUID& notecard_inventory_id,
LLPointer<LLInventoryItem> item_ptr)
{
LLVector3d global_pos;
landmark->getGlobalPos(global_pos);
LLViewerInventoryItem* agent_landmark =
LLLandmarkActions::findLandmarkForGlobalPos(global_pos);
if (agent_landmark)
{
showInfo(agent_landmark->getUUID());
}
// else
// [SL:KB] - Patch: UI-Notecards | Checked: 2010-09-05 (Catznip-2.1.2a) | Added: Catznip-2.1.2a
else if (gSavedSettings.getBOOL("EmbeddedLandmarkCopyToInventory"))
// [/SL:KB]
{
if (item_ptr.isNull())
{
// check to prevent a crash. See EXT-8459.
llwarns << "Passed handle contains a dead inventory item. Most likely notecard has been closed and embedded item was destroyed." << llendl;
}
else
{
LLInventoryItem* item = item_ptr.get();
LLPointer<LLEmbeddedLandmarkCopied> cb = new LLEmbeddedLandmarkCopied();
copy_inventory_from_notecard(get_folder_by_itemtype(item),
object_id,
notecard_inventory_id,
item,
gInventoryCallbacks.registerCB(cb));
}
}
// [SL:KB] - Patch: UI-Notecards | Checked: 2010-09-05 (Catznip-2.1.2a) | Added: Catznip-2.1.2a
else
{
showInfo(global_pos);
}
// [/SL:KB]
}