Example #1
0
//_________________________________________________________________________________________________
void Normalize(AliMergeableCollection& hc)
{
  TObjArray* a = hc.SortAllIdentifiers();
  TIter nextId(a);
  TObjString* sid;
  
  while ( ( sid = static_cast<TObjString*>(nextId()) ) )
  {
    std::cout << sid->String() << std::endl;
    
    if ( !sid->String().Contains("HITS") ) continue;
    
    TObjArray* parts = sid->String().Tokenize("/");
    TString npadsId("/");
    
    npadsId += static_cast<TObjString*>(parts->At(0))->String();
    npadsId += "/NPADS";
    
    delete parts;
    
    std::cout << npadsId << std::endl;
    
    TList* list = hc.CreateListOfObjectNames(sid->String().Data());
    TIter nextObject(list);
    TObjString* sobject;
    while ( ( sobject = static_cast<TObjString*>(nextObject())) )
    {
      std::cout << "     " << sobject->String() << std::endl;
    }
    
    delete list;
  }
  
  delete a;
}
// This is the callback method for the viewer object currently being
// worked on.
// NOT static, virtual!
void LLFloaterBulkPermission::inventoryChanged(LLViewerObject* viewer_object,
											  LLInventoryObject::object_list_t* inv,
											 S32,
											 void* q_id)
{
	//llinfos << "changed object: " << viewer_object->getID() << llendl;

	//Remove this listener from the object since its
	//listener callback is now being executed.
	
	//We remove the listener here because the function
	//removeVOInventoryListener removes the listener from a ViewerObject
	//which it internally stores.
	
	//If we call this further down in the function, calls to handleInventory
	//and nextObject may update the interally stored viewer object causing
	//the removal of the incorrect listener from an incorrect object.
	
	//Fixes SL-6119:Recompile scripts fails to complete
	removeVOInventoryListener();

	if (viewer_object && inv && (viewer_object->getID() == mCurrentObjectID) )
	{
		handleInventory(viewer_object, inv);
	}
	else
	{
		// something went wrong...
		// note that we're not working on this one, and move onto the
		// next object in the list.
		llwarns << "No inventory for " << mCurrentObjectID << llendl;
		nextObject();
	}
}
Example #3
0
BOOL LLFloaterScriptQueue::start()
{
	//llinfos << "LLFloaterCompileQueue::start()" << llendl;
	std::string buffer;

	LLSelectMgr *mgr = LLSelectMgr::getInstance();
	LLObjectSelectionHandle selectHandle = mgr->getSelection();
	U32 n_objects = 0;
	if (gSavedSettings.getBOOL("EditLinkedParts"))
	{
		n_objects = selectHandle->getObjectCount();
	}
	else
	{
		n_objects = selectHandle->getRootObjectCount();
	}

	LLStringUtil::format_map_t args;
	args["[START]"] = mStartString;
	args["[COUNT]"] = llformat ("%d", mObjectIDs.count());
	buffer = getString ("Starting", args);
	
	getChild<LLScrollListCtrl>("queue output")->setCommentText(buffer);

	return nextObject();
}
Example #4
0
void LLFloaterCompileQueue::handleInventory(LLViewerObject *viewer_object,
											InventoryObjectList* inv)
{
	// find all of the lsl, leaving off duplicates. We'll remove
	// all matching asset uuids on compilation success.

	typedef std::multimap<LLUUID, LLPointer<LLInventoryItem> > uuid_item_map;
	uuid_item_map asset_item_map;

	InventoryObjectList::const_iterator it = inv->begin();
	InventoryObjectList::const_iterator end = inv->end();
	for ( ; it != end; ++it)
	{
		if((*it)->getType() == LLAssetType::AT_LSL_TEXT)
		{
			LLInventoryItem* item = (LLInventoryItem*)((LLInventoryObject*)(*it));
			// Check permissions before allowing the user to retrieve data.
			if (item->getPermissions().allowModifyBy(gAgent.getID(), gAgent.getGroupID())  &&
				item->getPermissions().allowCopyBy(gAgent.getID(), gAgent.getGroupID()) )
			{
				LLPointer<LLViewerInventoryItem> script = new LLViewerInventoryItem(item);
				mCurrentScripts.put(script);
				asset_item_map.insert(std::make_pair(item->getAssetUUID(), item));
			}
		}
	}

	if (asset_item_map.empty())
	{
		// There are no scripts in this object.  move on.
		nextObject();
	}
	else
	{
		// request all of the assets.
		uuid_item_map::iterator iter;
		for(iter = asset_item_map.begin(); iter != asset_item_map.end(); iter++)
		{
			LLInventoryItem *itemp = iter->second;
			LLScriptQueueData* datap = new LLScriptQueueData(getID(),
												 itemp->getName(),
												 viewer_object->getID(),
												 itemp->getUUID());

			//llinfos << "ITEM NAME 2: " << names.get(i) << llendl;
			gAssetStorage->getInvItemAsset(viewer_object->getRegion()->getHost(),
				gAgent.getID(),
				gAgent.getSessionID(),
				itemp->getPermissions().getOwner(),
				viewer_object->getID(),
				itemp->getUUID(),
				itemp->getAssetUUID(),
				itemp->getType(),
				LLFloaterCompileQueue::scriptArrived,
				(void*)datap);
		}
	}
}
Example #5
0
BOOL LLFloaterBulkPermission::start()
{
	llinfos << "LLFloaterBulkPermission::start()" << llendl;
	char buffer[MAX_STRING]; 				/*Flawfinder: ignore*/
	snprintf(buffer, sizeof(buffer), "Starting %s of %d items.", mStartString, mObjectIDs.count()); 		/* Flawfinder: ignore */

	LLScrollListCtrl* list = getChild<LLScrollListCtrl>("queue output");
	list->addCommentText(buffer);

	return nextObject();
}
Example #6
0
BOOL LLFloaterScriptQueue::start()
{
	//llinfos << "LLFloaterCompileQueue::start()" << llendl;
	std::string buffer;
	buffer = llformat("Starting %s of %d items.", mStartString.c_str(), mObjectIDs.count()); // *TODO: Translate
	
	LLScrollListCtrl* list = getChild<LLScrollListCtrl>("queue output");
	list->addCommentText(buffer);

	return nextObject();
}
Example #7
0
/**
Returns a pointer the first object.
*/
QObject* GCF::ObjectIterator::firstObject() const
{
    // Start with the first component.
    bool success = firstComponent();
    if(!success)
        return 0;

    // Keeping looking until an object is found.
    while(d->componentIndex < d->components.count() && !d->current.object)
        nextObject();

    return d->current.object;
}
Example #8
0
BOOL LLFloaterScriptQueue::start()
{
	//LL_INFOS() << "LLFloaterCompileQueue::start()" << LL_ENDL;
	std::string buffer;

	LLStringUtil::format_map_t args;
	args["[START]"] = mStartString;
	args["[COUNT]"] = llformat ("%d", mObjectIDs.count());
	buffer = getString ("Starting", args);

	getChild<LLScrollListCtrl>("queue output")->addSimpleElement(buffer, ADD_BOTTOM);

	return nextObject();
}
Example #9
0
void LLFloaterCompileQueue::removeItemByItemID(const LLUUID& asset_id)
{
	llinfos << "LLFloaterCompileQueue::removeItemByAssetID()" << llendl;
	for(S32 i = 0; i < mCurrentScripts.count(); )
	{
		if(asset_id == mCurrentScripts.get(i)->getUUID())
		{
			mCurrentScripts.remove(i);
		}
		else
		{
			++i;
		}
	}
	if(mCurrentScripts.count() == 0)
	{
		nextObject();
	}
}
Example #10
0
rapidjson::Value* rapidJsonWrap::selectObject(const SStringArrayType &vecObjectPath)
{
	m_pVal = NULL;
	m_iValCurIndex = -1;
	m_pArrayVal = NULL;
	assert(vecObjectPath.size() > 0);
	if(vecObjectPath.size() == 0) return NULL;
	rapidjson::Value *pval = NULL;
	rapidjson::Document::MemberIterator iter = m_doc.FindMember(vecObjectPath[0].c_str());
	if(iter == m_doc.MemberEnd()) return NULL;
	pval = &iter->value;

	for (std::size_t idx = 1; idx < vecObjectPath.size() && pval; ++idx)
	{
		pval = nextObject(pval, vecObjectPath[idx]);
	}

	m_pVal = pval;
	return m_pVal;
}
Example #11
0
inline bool G1CMBitMapRO::iterate(BitMapClosure* cl, MemRegion mr) {
  HeapWord* start_addr = MAX2(startWord(), mr.start());
  HeapWord* end_addr = MIN2(endWord(), mr.end());

  if (end_addr > start_addr) {
    // Right-open interval [start-offset, end-offset).
    BitMap::idx_t start_offset = heapWordToOffset(start_addr);
    BitMap::idx_t end_offset = heapWordToOffset(end_addr);

    start_offset = _bm.get_next_one_offset(start_offset, end_offset);
    while (start_offset < end_offset) {
      if (!cl->do_bit(start_offset)) {
        return false;
      }
      HeapWord* next_addr = MIN2(nextObject(offsetToHeapWord(start_offset)), end_addr);
      BitMap::idx_t next_offset = heapWordToOffset(next_addr);
      start_offset = _bm.get_next_one_offset(next_offset, end_offset);
    }
  }
  return true;
}
Example #12
0
void CEditToolbox::setupKeyActions() {
	addAction(m_prevObjAction = new QAction("Previous Object", this));
	m_prevObjAction->setShortcut(Qt::Key_Minus);

	addAction(m_nextObjAction = new QAction("Next Object", this));
	QList<QKeySequence> nextObjKeys;
	nextObjKeys.append(Qt::Key_Equal);
	nextObjKeys.append(Qt::Key_Plus);
	m_nextObjAction->setShortcuts(nextObjKeys);

	addAction(m_prev8ObjAction = new QAction("Previous 8 Objects", this));
	m_prev8ObjAction->setShortcut(Qt::Key_Comma);

	addAction(m_next8ObjAction = new QAction("Next 8 Objects", this));
	m_next8ObjAction->setShortcut(Qt::Key_Period);

	connect(m_prevObjAction, SIGNAL(triggered()), m_objectPicker, SLOT(prevObject()));
	connect(m_nextObjAction, SIGNAL(triggered()), m_objectPicker, SLOT(nextObject()));
	connect(m_prev8ObjAction, SIGNAL(triggered()), m_objectPicker, SLOT(prev8Objects()));
	connect(m_next8ObjAction, SIGNAL(triggered()), m_objectPicker, SLOT(next8Objects()));
}
Example #13
0
void LLFloaterNotRunQueue::handleInventory(LLViewerObject* viewer_obj,
										  InventoryObjectList* inv)
{
	// find all of the lsl, leaving off duplicates. We'll remove
	// all matching asset uuids on compilation success.
	LLDynamicArray<const char*> names;
	
	InventoryObjectList::const_iterator it = inv->begin();
	InventoryObjectList::const_iterator end = inv->end();
	for ( ; it != end; ++it)
	{
		if((*it)->getType() == LLAssetType::AT_LSL_TEXT)
		{
			LLViewerObject* object = gObjectList.findObject(viewer_obj->getID());

			if (object)
			{
				LLInventoryItem* item = (LLInventoryItem*)((LLInventoryObject*)(*it));
				LLScrollListCtrl* list = getChild<LLScrollListCtrl>("queue output");
				std::string buffer;
				buffer = std::string("Not running: ") +item->getName(); // *TODO: Translate
				list->addCommentText(buffer);
	
				LLMessageSystem* msg = gMessageSystem;
				msg->newMessageFast(_PREHASH_SetScriptRunning);
				msg->nextBlockFast(_PREHASH_AgentData);
				msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
				msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
				msg->nextBlockFast(_PREHASH_Script);
				msg->addUUIDFast(_PREHASH_ObjectID, viewer_obj->getID());
				msg->addUUIDFast(_PREHASH_ItemID, (*it)->getUUID());
				msg->addBOOLFast(_PREHASH_Running, FALSE);
				msg->sendReliable(object->getRegion()->getHost());
			}
		}
	}

	nextObject();	
}
Example #14
0
BOOL LLFloaterScriptQueue::start()
{
	//llinfos << "LLFloaterCompileQueue::start()" << llendl;
	std::string buffer;

	LLSelectMgr *mgr = LLSelectMgr::getInstance();
	LLObjectSelectionHandle selectHandle = mgr->getSelection();
	U32 n_objects = 0;
	if (gSavedSettings.getBOOL("EditLinkedParts"))
	{
		n_objects = selectHandle->getObjectCount();
	}
	else
	{
		n_objects = selectHandle->getRootObjectCount();
	}

	buffer = llformat("Starting %s of %d items.", mStartString.c_str(), n_objects); // *TODO: Translate
	
	LLScrollListCtrl* list = getChild<LLScrollListCtrl>("queue output");
	list->addCommentText(buffer);

	return nextObject();
}
void LLFloaterBulkPermission::handleInventory(LLViewerObject* viewer_obj,  LLInventoryObject::object_list_t* inv)
{
	LLScrollListCtrl* list = getChild<LLScrollListCtrl>("queue output");

	LLInventoryObject::object_list_t::const_iterator it = inv->begin();
	LLInventoryObject::object_list_t::const_iterator end = inv->end();
	for ( ; it != end; ++it)
	{
		LLAssetType::EType asstype = (*it)->getType();
		if(
			( asstype == LLAssetType::AT_ANIMATION && gSavedSettings.getBOOL("BulkChangeIncludeAnimations")) ||
			( asstype == LLAssetType::AT_BODYPART  && gSavedSettings.getBOOL("BulkChangeIncludeBodyParts" )) ||
			( asstype == LLAssetType::AT_CLOTHING  && gSavedSettings.getBOOL("BulkChangeIncludeClothing"  )) ||
			( asstype == LLAssetType::AT_GESTURE   && gSavedSettings.getBOOL("BulkChangeIncludeGestures"  )) ||
			( asstype == LLAssetType::AT_LANDMARK  && gSavedSettings.getBOOL("BulkChangeIncludeLandmarks" )) ||
			( asstype == LLAssetType::AT_NOTECARD  && gSavedSettings.getBOOL("BulkChangeIncludeNotecards" )) ||
			( asstype == LLAssetType::AT_OBJECT    && gSavedSettings.getBOOL("BulkChangeIncludeObjects"   )) ||
			( asstype == LLAssetType::AT_LSL_TEXT  && gSavedSettings.getBOOL("BulkChangeIncludeScripts"   )) ||
			( asstype == LLAssetType::AT_SOUND     && gSavedSettings.getBOOL("BulkChangeIncludeSounds"    )) ||
			( asstype == LLAssetType::AT_TEXTURE   && gSavedSettings.getBOOL("BulkChangeIncludeTextures"  )))
		{
			LLViewerObject* object = gObjectList.findObject(viewer_obj->getID());

			if (object)
			{
				LLInventoryItem* item = (LLInventoryItem*)((LLInventoryObject*)(*it));
				LLViewerInventoryItem* new_item = (LLViewerInventoryItem*)item;
				LLPermissions perm(new_item->getPermissions());
				U32 flags = new_item->getFlags();

				U32 desired_next_owner_perms = LLFloaterPerms::getNextOwnerPerms("BulkChange");
				U32 desired_everyone_perms = LLFloaterPerms::getEveryonePerms("BulkChange");
				U32 desired_group_perms = LLFloaterPerms::getGroupPerms("BulkChange");

				// If next owner permissions have changed (and this is an object)
				// then set the slam permissions flag so that they are applied on rez.
				if((perm.getMaskNextOwner() != desired_next_owner_perms)
				   && (new_item->getType() == LLAssetType::AT_OBJECT))
				{
					flags |= LLInventoryItemFlags::II_FLAGS_OBJECT_SLAM_PERM;
				}
				// If everyone permissions have changed (and this is an object)
				// then set the overwrite everyone permissions flag so they
				// are applied on rez.
				if ((perm.getMaskEveryone() != desired_everyone_perms)
				    && (new_item->getType() == LLAssetType::AT_OBJECT))
				{
					flags |= LLInventoryItemFlags::II_FLAGS_OBJECT_PERM_OVERWRITE_EVERYONE;
				}
				// If group permissions have changed (and this is an object)
				// then set the overwrite group permissions flag so they
				// are applied on rez.
				if ((perm.getMaskGroup() != desired_group_perms)
				    && (new_item->getType() == LLAssetType::AT_OBJECT))
				{
					flags |= LLInventoryItemFlags::II_FLAGS_OBJECT_PERM_OVERWRITE_GROUP;
				}

				// chomp the inventory name so it fits in the scroll window nicely
				// and the user can see the [OK]
				std::string invname;
				invname=item->getName().substr(0,item->getName().size() < 30 ? item->getName().size() : 30 );
				
				LLUIString status_text = getString("status_text");
				status_text.setArg("[NAME]", invname.c_str());
				// Check whether we appear to have the appropriate permissions to change permission on this item.
				// Although the server will disallow any forbidden changes, it is a good idea to guess correctly
				// so that we can warn the user. The risk of getting this check wrong is therefore the possibility
				// of incorrectly choosing to not attempt to make a valid change.
				//
				// Trouble is this is extremely difficult to do and even when we know the results
				// it is difficult to design the best messaging. Therefore in this initial implementation
				// we'll always try to set the requested permissions and consider all cases successful
				// and perhaps later try to implement a smarter, friendlier solution. -MG
				if(true
					//gAgent.allowOperation(PERM_MODIFY, perm, GP_OBJECT_MANIPULATE) // for group and everyone masks
					//|| something else // for next owner perms
					)
				{
					perm.setMaskNext(desired_next_owner_perms);
					perm.setMaskEveryone(desired_everyone_perms);
					perm.setMaskGroup(desired_group_perms);
					new_item->setPermissions(perm); // here's the beef
					new_item->setFlags(flags); // and the tofu
					updateInventory(object,new_item,TASK_INVENTORY_ITEM_KEY,FALSE);
					//status_text.setArg("[STATUS]", getString("status_ok_text"));
					status_text.setArg("[STATUS]", "");
				}
				else
				{
					//status_text.setArg("[STATUS]", getString("status_bad_text"));
					status_text.setArg("[STATUS]", "");
				}
				
				list->addSimpleElement(status_text.getString());

				//TODO if we are an object inside an object we should check a recuse flag and if set
				//open the inventory of the object and recurse - Michelle2 Zenovka

				//	if(recurse &&  ( (*it)->getType() == LLAssetType::AT_OBJECT && processObject))
				//	{
				//		I think we need to get the UUID of the object inside the inventory
				//		call item->fetchFromServer();
				//		we need a call back to say item has arrived *sigh*
				//		we then need to do something like
				//		LLUUID* id = new LLUUID(mID);
				//		registerVOInventoryListener(obj,id);
				//		requestVOInventory();
				//	}
			}
		}
	}

	nextObject();
}
BOOL LLFloaterBulkPermission::start()
{
	// note: number of top-level objects to modify is mObjectIDs.count().
	getChild<LLScrollListCtrl>("queue output")->addSimpleElement(getString("start_text"));
	return nextObject();
}
Example #17
0
rapidjson::Value* rapidJsonWrap::findValue(const std::string &strKey)
{
	if(strKey.empty()) JSON_EXCEPT(BEJsonCodeInvalidArgument);
	rapidjson::Document::MemberIterator iter;
	wchar_t pbuf[40] = {0};
	rapidjson::Value *pVal = NULL;

	if (!m_pVal)
	{
		if (strKey.find(':') == std::string::npos)
		{
			iter = m_doc.FindMember(strKey.c_str());
			if(iter == m_doc.MemberEnd())
			{
				std::swprintf(pbuf, _countof(pbuf), L"名为“%s”的对象不存在!", gtc::stringUtil::toWChar(strKey.c_str()).c_str());
				JSON_EXCEPT2(BEJsonCodeKeyNotFound, pbuf);
			}
			else
				return &iter->value;
		}
		else
		{
			SStringArrayType vec = stringUtil::split(strKey, ":");
			iter = m_doc.FindMember(vec[0].c_str());
			if(iter == m_doc.MemberEnd())
			{
				std::swprintf(pbuf, _countof(pbuf), L"名为“%s”的对象不存在!", gtc::stringUtil::toWChar(vec[0].c_str()).c_str() );
				JSON_EXCEPT2(BEJsonCodeKeyNotFound, pbuf);
			}
			else
				pVal = &iter->value;
			for (std::size_t idx = 1; idx < vec.size(); ++idx)
			{
				pVal = nextObject(pVal, vec[idx]);
				if (!pVal)
				{
					std::swprintf(pbuf, _countof(pbuf), L"名为“%s”的对象不存在!", gtc::stringUtil::toWChar(vec[idx].c_str()).c_str());
					JSON_EXCEPT2(BEJsonCodeKeyNotFound, pbuf);
				}
			}

		}
		return pVal;
	}
	if (strKey.find(':') == std::string::npos)
	{
		iter = m_pVal->FindMember(strKey.c_str());
		if(iter == m_pVal->MemberEnd())
		{
			std::swprintf(pbuf, _countof(pbuf), L"名为“%s”的对象不存在!", gtc::stringUtil::toWChar(strKey.c_str()).c_str());
			JSON_EXCEPT2(BEJsonCodeKeyNotFound, pbuf);
		}
		else
			pVal = &iter->value;
	}
	else
	{
		SStringArrayType vec = stringUtil::split(strKey, ":");
		iter = m_pVal->FindMember(vec[0].c_str());
		if(iter == m_pVal->MemberEnd())
		{
			std::swprintf(pbuf, _countof(pbuf), L"名为“%s”的对象不存在!", gtc::stringUtil::toWChar(vec[0].c_str()).c_str() );
			JSON_EXCEPT2(BEJsonCodeKeyNotFound, pbuf);
		}
		else
			pVal = &iter->value;
		for (std::size_t idx = 1; idx < vec.size(); ++idx)
		{
			pVal = nextObject(pVal, vec[idx]);
			if (!pVal)
			{
				std::swprintf(pbuf, _countof(pbuf), L"名为“%s”的对象不存在!", gtc::stringUtil::toWChar(vec[idx].c_str()).c_str());
				JSON_EXCEPT2(BEJsonCodeKeyNotFound, pbuf);
			}
		}

	}
	return pVal;
}
void recupThePlots(){
//	TDirectory *theDr = (TDirectory*) myFile->Get("eleIDdir");///denom_pt/fit_eff_plots");
	//theDr->ls();
	cout << "coucou" << theOutFileName << endl;
	
	TFile *myOutFile = new TFile(theOutFileName,"RECREATE");
	
	TSystemDirectory dir(thePath, thePath);
	TSystemFile *file;
	TString fname;
	TIter next(dir.GetListOfFiles());
	while (((file=(TSystemFile*)next()))) {
		fname = file->GetName();
		if ((fname.BeginsWith("TnP"))&&fname.Contains("data")) {
                        cout <<  "--------------------"<< "\n";
                        cout << fname << "\n";
			TFile *myFile = new TFile(fname);
			TIter nextkey(myFile->GetListOfKeys());                   
			TKey *key;
			while ((key = (TKey*)nextkey())) {
                                // cout << key << "\n";
				TString theTypeClasse = key->GetClassName();
				TString theNomClasse = key->GetTitle();
                                   cout << "theTypeClasse:  "<< theTypeClasse << " ,  " << theNomClasse << "\n";
				if ( theTypeClasse == "TDirectoryFile" ){
                                        //    cout << "we are here 1" << "\n";
					TDirectory *theDr = (TDirectory*) myFile->Get(theNomClasse);
					TIter nextkey2(theDr->GetListOfKeys());
					TKey *key2;
					while ((key2 = (TKey*)nextkey2())) {
						TString theTypeClasse2 = key2->GetClassName();
						TString theNomClasse2 = key2->GetTitle();	
						if ( theTypeClasse == "TDirectoryFile" || theTypeClasse == "TGraphAsymmErrors" ){
							TDirectory *theDr2 = (TDirectory*) myFile->Get(theNomClasse+"/"+theNomClasse2+"/fit_eff_plots");
							TIter nextkey3(theDr2->GetListOfKeys());
							TKey *key3;
							while ((key3 = (TKey*)nextkey3())) {
								TString theTypeClasse3 = key3->GetClassName();
								TString theNomClasse3 = key3->GetName();	
				 				cout << "type = " << theTypeClasse3 << " nom = " << theNomClasse3 << endl;
						
								TCanvas *theCanvas = (TCanvas*) myFile->Get(theNomClasse+"/"+theNomClasse2+"/fit_eff_plots/"+theNomClasse3);
								TIter nextObject(theCanvas->GetListOfPrimitives());
								TObject *obj;
								while ((obj = (TObject*)nextObject())) {
									if (obj->InheritsFrom("TGraphAsymmErrors")) {
					        				cout << "histo: " << obj->GetName() << endl;
										myOutFile->cd();
										obj->Write(theNomClasse2+"_"+theNomClasse3);
										myFile->cd();
									}
									if (obj->InheritsFrom("TH2F")) {
										cout << "the TH2F = " << obj->GetName() << endl;
										myOutFile->cd();
										obj->Write(theNomClasse2+"_"+theNomClasse3);
										myFile->cd();
									}
								}
							}
						}

					}
			
				}
			}
			delete myFile;
		}
	
	}
	myOutFile->Close();

}
Example #19
0
void LLFloaterBulkPermission::handleInventory(LLViewerObject* viewer_obj, InventoryObjectList* inv)
{
	// find all of the lsl, leaving off duplicates. We'll remove
	// all matching asset uuids on compilation success.

	llinfos<<"handleInventory"<<llendl;

	char buffer[MAX_STRING];		 /*Flawfinder: ignore*/
	LLScrollListCtrl* list = getChild<LLScrollListCtrl>("queue output");

	InventoryObjectList::const_iterator it = inv->begin();
	InventoryObjectList::const_iterator end = inv->end();
	for ( ; it != end; ++it)
	{
		llinfos<<"Doing iterator of inventory"<<llendl;

		if(  ( (*it)->getType() == LLAssetType::AT_LSL_TEXT && processScript) ||
  		     ( (*it)->getType() == LLAssetType::AT_TEXTURE && processTexture) ||
	             ( (*it)->getType() == LLAssetType::AT_SOUND && processSound) ||
	             ( (*it)->getType() == LLAssetType::AT_LANDMARK && processLandmark) ||
    		     ( (*it)->getType() == LLAssetType::AT_CLOTHING && processClothing) ||
    		     ( (*it)->getType() == LLAssetType::AT_OBJECT && processObject) ||
   		     ( (*it)->getType() == LLAssetType::AT_NOTECARD && processNotecard) ||
   		     ( (*it)->getType() == LLAssetType::AT_BODYPART && processBodypart) ||
   		     ( (*it)->getType() == LLAssetType::AT_ANIMATION && processAnimation) ||
   		     ( (*it)->getType() == LLAssetType::AT_GESTURE && processGesture))
		{

			LLViewerObject* object = gObjectList.findObject(viewer_obj->getID());

			if (object)
			{
				LLInventoryItem* item = (LLInventoryItem*)((LLInventoryObject*)(*it));
				LLViewerInventoryItem* new_item = (LLViewerInventoryItem*)item;
				LLPermissions perm(new_item->getPermissions());

				// chomp the inventory name so it fits in the scroll window nicely
				// and the user can see the [OK]
				std::string invname;
				invname=item->getName().substr(0,item->getName().size() < 30 ? item->getName().size() : 30 );
				
				// My attempt at checking valid permissions, CHECK ME
				// note its not actually bad to try to set permissions that are not allowed as the
				// server will protect against this, but it will piss the user off if its wrong
				if(
				(perm.getCreator()==gAgentID) ||
				(perm.getMaskOwner() & PERM_TRANSFER) && (perm.getMaskOwner() & PERM_MODIFY) || 
				(gAgent.getGroupID()==perm.getGroup() && (perm.getMaskGroup() & PERM_TRANSFER) && (perm.getMaskGroup() & PERM_MODIFY))
				){	
					llinfos<<"Setting perms"<<llendl;
					perm.setMaskNext(req_perm_mask);
					new_item->setPermissions(perm);
					updateInventory(object,new_item,TASK_INVENTORY_ITEM_KEY,FALSE);				
					snprintf(buffer, sizeof(buffer), "Setting perms on '%s' [OK]", invname.c_str());		 	/* Flawfinder: ignore */
				}
				else
				{
					llinfos<<"NOT setting perms"<<llendl;
					snprintf(buffer, sizeof(buffer), "Setting perms on '%s' [FAILED]", invname.c_str());		 	/* Flawfinder: ignore */

				}
				
				list->addCommentText(buffer);

				if(recurse &&  ( (*it)->getType() == LLAssetType::AT_OBJECT && processObject))
				{
					//Add this object back to the queue to be processed as it has inventory
					snprintf(buffer, sizeof(buffer), "Queueing object '%s' for open", invname.c_str());
					llwarns << "Queueing object "<<	invname.c_str() << " ID "<< (*it)->getUUID()<<llendl;
					mObjectIDs.put((*it)->getUUID());
					// This will not YET work. as this is not a viewer object the unpack will fail			
				}

			}
		}
	}

	nextObject();	
}