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


C++ Space::name方法代码示例

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


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

示例1: translateZoneList

OptionalModelObject ReverseTranslator::translateZoneList( const WorkspaceObject & workspaceObject )
{
   if( workspaceObject.iddObject().type() != IddObjectType::Zone ){
    LOG(Error, "WorkspaceObject is not IddObjectType: Zone");
    return boost::none;
  }

  openstudio::model::SpaceType spaceType( m_model );

  OptionalString s = workspaceObject.name();
  if(s){
    spaceType.setName(*s);
  }

  for (const IdfExtensibleGroup& idfGroup : workspaceObject.extensibleGroups()){
    WorkspaceExtensibleGroup workspaceGroup = idfGroup.cast<WorkspaceExtensibleGroup>();
    
    OptionalWorkspaceObject target = workspaceGroup.getTarget(0);
    if (target){
      OptionalModelObject modelObject = translateAndMapWorkspaceObject(*target);
      if (modelObject){
        if (modelObject->optionalCast<Space>()){
          Space space = modelObject->cast<Space>();

          if (space.spaceType()){
            LOG(Warn, "Overriding previously assigned SpaceType for Space '" << space.name().get() << "'");
          }

          space.setSpaceType(spaceType);

        }
      }
    }
  }

  return spaceType;
}
开发者ID:jtanaa,项目名称:OpenStudio,代码行数:37,代码来源:ReverseTranslateZoneList.cpp

示例2: CreateDesertSpace

bool CreateDesertSpace(Space &sp, Element &e, UdmDesertMap &des_map, DesertUdmMap &inv_des_map, UdmElementSet &elements, bool root)
{
	static long parent;			//id of the parent element
	long old_parent;			//save old parent
	static long space;			//id of the space
	short decomposition;		//0:leaf, 1: and, 2: or
	//element.decomposition():	
	//			has no children: leaf
	//			has children and decomposition is false:	or node
	//			has children and decomposition is true:		and node

	set<Element> ev_set;

	//static and non-static variables
	//for progress indication 
	//(this is weird in case of a recursive function)
	//CDesertStatusDlg * st_dlg = GetStatusDlg(NULL);
	static short percent_done;
	static short percent_to_do;
	short percent_to_do_save;
	if (root) 
	{
		percent_done = 0;
		percent_to_do = 100;
	}

	
	if (root)
	{
		
		//compute decomposition value
		//mapping from boolean decomposition value
		//to desert style short decomposition
		set<Element> e_children = sp.Element_kind_children();
		set<Element>::iterator i;
		
		if (e_children.empty()) decomposition = 0;
		else
		{
			if (sp.decomposition()) decomposition  = 1;
			else decomposition = 2;
		}

		//debug trace
		TRACE ("CreateDesertSpace invoked: parent: %d, Space: %s , decomposition: %d\n", parent, ((string)sp.name()).c_str(), decomposition);

		//
		//create the space & the root element in the space
		//
		space =  CreateSpace(utf82cstring((string)sp.name()));
		//space =  CreateSpace(((string)sp.name()).c_str(), sp.id(), sp.externalID());
		
/*
		parent = CreateElement(
			((string)sp.name()).c_str(), 
			space, 
			decomposition, 
			-1, 
			sp.id(),
			sp.externalID());
*/
				
		parent = CreateElement(
			utf82cstring((string)sp.name()),
			space, 
			decomposition, 
			-1, 
			sp.externalID());

		//map the UDM, desert object pairs
		
		DoMap(sp, des_map, inv_des_map, parent);

		
		//recursion here
		
		//update progress bar
		if (e_children.empty())
		{
			//leaf node
			percent_done += percent_to_do;
			//st_dlg->StepInState(percent_done);
		}//eo if (e_children.empty())

		else
		{

			//recursive hack for overall performance
			//percent to done is always smaller
			int no_of_children = e_children.size();
			percent_to_do_save = percent_to_do;
			percent_to_do = (short)((float)percent_to_do / (float)no_of_children);
				

			//recursive step
			for (i = e_children.begin(); i != e_children.end(); i++)
			{
				Element new_e = *i;
				CreateDesertSpace(sp, new_e, des_map, inv_des_map, elements, false);
			};//eo for (i...)
//.........这里部分代码省略.........
开发者ID:neemask,项目名称:meta-core,代码行数:101,代码来源:DesMap.cpp

示例3: InitInstance

BOOL CDesertToolApp::InitInstance()
{
	// Standard initialization
	// If you are not using these features and wish to reduce the size
	//  of your final executable, you should remove from the following
	//  the specific initialization routines you do not need.

#ifdef _AFXDLL
	Enable3dControls();			// Call this when using MFC in a shared DLL
#else
	Enable3dControlsStatic();	// Call this when linking to MFC statically
#endif


	//this hack is offered gratiously by our very talented grad. student, Tihamer Levendovszky)

	SetRegistryKey(_T("ISIS"));
	CString str(m_pszHelpFilePath);
	WriteProfileString(_T("Data"),_T("Path"), str.Left(str.GetLength()-3) +CString(_T("exe")));

	//end of the hack offered by our very gifted, talented, and I could continue... grad student

	//check for command line
	//if an argument is received, and actually ends up with stg. like
	// "xml", "mga", or "mem", we will use that one.
	bool command_arg_ok = false;
	bool cancel_input = false;
	bool cancel_output = false;
	bool isSilent= false;
	bool multiRun = false;
	CString consList;
	TCHAR** consGroupNames = NULL;
	TCHAR** consGroups = NULL;
	int numConsGroups = 0;
	TCHAR input_file[_MAX_PATH];
	TCHAR output_file[_MAX_PATH];
	tstring desert_config_info_file = _T("");
	FILE* fdDcif = 0;
	
	static TCHAR szFilterUDM[] = _T("XML Backend Files (*.xml)|*.xml|MEM Backend Files (*.mem)|*.mem|MGA Backend Files (*.mga)|*.mga|All Files (*.*)|*.*||");
	
	bool hasInputFile = false;
	bool hasOutputFile = false;
	
	if (m_lpCmdLine)
	{
		if (_tcslen(m_lpCmdLine))
		{
			if (_tcsstr(m_lpCmdLine, _T("/?")) || _tcsstr(m_lpCmdLine, _T("/help")) || _tcsstr(m_lpCmdLine, _T("--help")) || _tcsstr(m_lpCmdLine, _T("/h")))
			{
				CString usage(_T("Usage: deserttool.exe [<DesertInput xml>] [/o <Output Filename>] [/c \"constraint1:constraint2\"] [/m \"__CG__GroupA:constraint1:constraint2:__CG__GroupB:constraint1:constraint3\"\r\n\r\nArgument details:\r\n"));
				usage.Append(_T("DesertInput xml: input desert xml file\r\n"));
				usage.Append(_T("/c \"constraint1 : constraint2\": apply the constraint list directly without GUI shown up\r\n"));
				usage.Append(_T("/c \"applyAll\": apply all constraints directly without GUI shown up\r\n"));
				usage.Append(_T("/c \"none\": does not apply any constraint and computes total no. of configurations, without GUI shown up\r\n"));
				usage.Append(_T("/m : when used calls desert process for \"none\", \"applyAll\", and all given constraint groups (with names using '__CG__' prefix) one by one, without GUI shown up\r\n"));
				std::cout << usage;
				AfxMessageBox(usage,MB_ICONINFORMATION);
				return TRUE;
			}
			if (_tcsstr(m_lpCmdLine, _T(".xml")) || _tcsstr(m_lpCmdLine, _T(".mem")) || _tcsstr(m_lpCmdLine, _T(".mga"))  
				|| _tcsstr(m_lpCmdLine, _T(".XML")) || _tcsstr(m_lpCmdLine, _T(".MEM")) || _tcsstr(m_lpCmdLine, _T(".MGA")))
			{
				CWzdCommandLineInfo cmdInfo;
				ParseCommandLine(cmdInfo);

				//seems to be a valid file name
				command_arg_ok = true;
				_tcscpy(input_file, cmdInfo.desert_file);				
				hasInputFile = !(cmdInfo.desert_file).IsEmpty();

				_tcscpy(output_file, cmdInfo.desert_output_file);
				hasOutputFile = !(cmdInfo.desert_output_file).IsEmpty();
				
				isSilent = cmdInfo.silent;
				if (cmdInfo.applyCons)
					consList = cmdInfo.consList;

				if(cmdInfo.multiRun) {
					int ncgs = cmdInfo.consGroupNames.GetCount();
					numConsGroups = ncgs;
					if(ncgs > 0) {
						consGroupNames = new TCHAR* [ncgs];
						consGroups = new TCHAR* [ncgs];
					}
					POSITION p1 = cmdInfo.consGroupNames.GetHeadPosition();
					int cIdx = 0;
					while (p1 != NULL) {
						CString s = cmdInfo.consGroupNames.GetNext(p1);
						consGroupNames[cIdx++] = _tcsdup(s);
					}

					POSITION p2 = cmdInfo.consGroups.GetHeadPosition();
					cIdx = 0;
					while (p2 != NULL) {
						CString s = cmdInfo.consGroups.GetNext(p2);
						consGroups[cIdx++] = _tcsdup(s);
					}

					multiRun = true;
//.........这里部分代码省略.........
开发者ID:dyao-vu,项目名称:meta-core,代码行数:101,代码来源:DesertTool.cpp


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