Beispiel #1
0
	void Material::ParseExp(MaterialExpression* inputexp,JsonObject& obj)
	{
		JsonObject::MemberIterator first_mem = obj.MemberBegin();
		s32 input_index = 0;
		while(first_mem!=obj.MemberEnd())
		{
			if (first_mem->value.IsObject())
			{
				MaterialExpMap::iterator it = exp_map_.find(first_mem->name.GetString());
				if (it!=exp_map_.end())
				{
					MaterialExpression* exp =(*it).second;
					MaterialInput* input = inputexp->GetInput(input_index);
					if (input)
					{
						input->input_mask_ = ParseMask(first_mem->value);
						input->link_= exp;
					}
					
					input_index++;
					ParseExp(exp,first_mem->value);
				}
			}
			
			first_mem++;
		}	
	}
static Bool
ParseDmask(const char *option,         // IN:  option string along with value
           HgfsMountInfo *mountInfo,   // OUT: mount data
           int *flags)                 // OUT: mount flags
{
   ASSERT(option);
   ASSERT(mountInfo);

   if (ParseMask(option, &mountInfo->dmask)) {
      LOG("Setting mount dmask to %o\n", mountInfo->dmask);
      return TRUE;
   }

   return FALSE;
}
Beispiel #3
0
/** Set up an atom mask containing selected atom numbers given a char
  * array of size natom with T for selected atoms and F for unselected
  * atoms. The actual mask parser is called from Topology. 
  * maskChar_ is used to determine whether atoms denoted by 'T' or 'F' will
  * be selected (the latter is the case e.g. with stripped atoms). 
  */
int AtomMask::SetupMask(AtomArrayT const& atoms, ResArrayT const& residues, const double* XYZ)
{
  // Set up an integer list of the selected atoms. 
  // NOTE: For large selections this will use 4x the memory of the char atom
  //       mask. Could check to see which will be bigger.
  Natom_ = (int)atoms.size();
  Selected_.clear();
  char* charmask = ParseMask(atoms, residues, XYZ);
  if (charmask == 0) return 1;
  for (int atom = 0; atom != Natom_; atom++) {
    if (charmask[atom] == maskChar_)
      Selected_.push_back( atom );
  }
  delete[] charmask;
  return 0;
}
Beispiel #4
0
	void Material::ParseExp(MaterialInput& input,JsonObject& obj,const string& key)
	{
		if (obj.HasMember(key.c_str()))
		{
			JsonObject::MemberIterator first_mem = obj[key.c_str()].MemberBegin();
			if(first_mem!=obj.MemberEnd())
			{
				MaterialExpMap::iterator it = exp_map_.find(first_mem->name.GetString());
				if (it!=exp_map_.end())
				{
					MaterialExpression* exp =(*it).second;
					input.input_mask_ = ParseMask(first_mem->value);
					ParseExp(exp,first_mem->value);
					input.link_ = exp;
				}
				first_mem++;
			}
		}

	}