Beispiel #1
0
//-----------------------------------------------------------------------------
// Purpose: walks a particular files config entry and removes an files not valid for this config
//-----------------------------------------------------------------------------
bool CVCProjConvert::IterateFileConfigurations( IXMLDOMElement *pFile, CUtlSymbol fileName )
{
#ifdef _WIN32
	CComPtr<IXMLDOMNodeList> pConfigs;
	pFile->getElementsByTagName( _bstr_t("FileConfiguration"), &pConfigs);
    if (pConfigs)
	{
		long len = 0;
		pConfigs->get_length(&len);
		for ( int i=0; i<len; i++ )
		{
			CComPtr<IXMLDOMNode> pNode;
			pConfigs->get_item( i, &pNode);
			if (pNode)
			{
				CComQIPtr<IXMLDOMElement> pElem( pNode );
				CUtlSymbol configName = GetXMLAttribValue( pElem, "Name");
				CUtlSymbol excluded = GetXMLAttribValue( pElem ,"ExcludedFromBuild");
				if ( configName.IsValid() && excluded.IsValid() )
				{
					int index = FindConfiguration( configName );
					if ( index > 0 && excluded == "TRUE" )
					{
						m_Configurations[index].RemoveFile( fileName );
					}
				}
			}

		}//for
	}//if
#elif _LINUX
	DOMNodeList *nodes = pFile->getElementsByTagName( _bstr_t("FileConfiguration"));
	if (nodes)
	{
		int len = nodes->getLength();
		for ( int i=0; i<len; i++ )
		{
			DOMNode *node = nodes->item(i);
			if (node)
			{
				CUtlSymbol configName = GetXMLAttribValue( node, "Name");
				CUtlSymbol excluded = GetXMLAttribValue( node ,"ExcludedFromBuild");
				if ( configName.IsValid() && excluded.IsValid() )
				{
					int index = FindConfiguration( configName );
					if ( index >= 0 && excluded == "TRUE" )
					{
						m_Configurations[index].RemoveFile( fileName );
					}
				}
			}

		}//for
	}//if
#endif

	return true;
}
Beispiel #2
0
const char* HSTool::GetUUID()
{
	 
	std::string uuid = "";
	
	long long time = HSTime::GetLocalityTime();
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
	return "1234567890";
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
	/**
	JniMethodInfo minfo;
	bool isOk = JniHelper::getStaticMethodInfo(minfo,"com/Zrong/HSBalloon/HSDeviceInfo","GetUUID","()Ljava/lang/String;");

	if (!isOk)
	{
		HSMessageBox("Get UUID Fail");
		return "";
	}
	jstring obj = (jstring)minfo.env->CallStaticObjectMethod(minfo.classID,minfo.methodID);
	uuid = JniHelper::jstring2string(obj);
	*/
	const char* s = CCString::createWithFormat("%s%s%s",HSTime::GetTime(),FindConfiguration("APPID").c_str(),FindConfiguration("ChannelID").c_str())->getCString();
	return s;
	//uuid = CCString::createWithFormat("%s%s%ld",FindConfiguration("APPID").c_str(),FindConfiguration("ChannelID").c_str(),HSTime::GetLocalityTimeAccurate());
#elif(CC_TARGET_PLATFORM ==CC_PLATFORM_IOS)
	//uuid = CCString::createWithFormat("%s%s%ld",FindConfiguration("APPID").c_str(),FindConfiguration("ChannelID").c_str(),HSTime::GetLocalityTimeAccurate());

	return "1234567890";
#endif
	CCLog("-HSAndroid- : UUID : %s",uuid.c_str());
	return uuid.c_str();
	
}
void BuildMatrix::SetSelectedConfigurationName(const wxString &name)
{
	//find the current selected configuration
	std::list<CSolitionConfigurationPtr>::iterator iter = m_configurationList.begin();
	for(; iter != m_configurationList.end(); iter++){
		if((*iter)->IsSelected()){
			(*iter)->SetSelected(false);
			break;
		}
	}
	//set the new one
	CSolitionConfigurationPtr c = FindConfiguration(name);
	if(c){
		c->SetSelected(true);
	}
}
   ############################################################################################################################ */

void keyboardDown(unsigned char key, int x, int y) 
{
/* **************************************************************************************************************************** */
	if (key>='A' && key<='Z')                   
		key+='a'-'A';
/* **************************************************************************************************************************** */
	switch (key) {                              
	case 13:                                  
		FindConfiguration();
		break;
	case 'f':
		glutFullScreen();                       
		break;
	case 'h':
		HelpMessage();                       
		break;
	case 'i':
		InnerIterate();
		break;
	case 'l':
		AngleLimits	 = !AngleLimits;
		if (AngleLimits)
			fprintf(stderr, "Angle Limits: ON\n");
		else
			fprintf(stderr, "Angle Limits: OFF\n");
		break;
	case 27:                                 
	case 'q':
	case 'x':
		exit(0);                               
		break;
	case 'r':
		ReLoad();
		break;
	case 'w':
		glutReshapeWindow(1024, 768);            
		glutPositionWindow(100, 100);
		break;
	default:
		break;
	}
CSolitionConfigurationPtr BuildMatrix::GetConfigurationByName(const wxString &name) const
{
	return FindConfiguration(name);
}
   ############################################################################################################################ */

void motion(int x, int y) 
{
/* **************************************************************************************************************************** */
	int			 TempRes;
	MDFloat		 t;
	GLint		 ViewPort[4];
	MDFloat		 Q[4];
	MDFloat		 P[4];
	MDFloat		 s[4];
	GLdouble	 MM[16];
	GLdouble	 PM[16];
/* **************************************************************************************************************************** */
    if (MouseState==1) {                           
        xnew=xold+x-xx1;                         
        ynew=yold+y-yy1;
        glutPostRedisplay();                    
    }
/* **************************************************************************************************************************** */
    if (MouseState==2) {                              
        znew=zold+y-zz1;                         
        glutPostRedisplay();                    
    }
/* **************************************************************************************************************************** */
    if ( (MouseState==3) || (MouseState==4) ) {

		SetGlobalView(WindowWidth, WindowHeight);
		MoveToOrigin();

		glGetDoublev(GL_MODELVIEW_MATRIX, MM);
		glGetDoublev(GL_PROJECTION_MATRIX, PM);
		glGetIntegerv (GL_VIEWPORT, ViewPort);

		/*
		 * Obtain 2 points on line going from cursor
		 */

		TempRes	 = gluUnProject( x, ViewPort[3]-y, -1/*z*/,
			MM, PM, ViewPort,
			&Q[0], &Q[1], &Q[2] );
		TempRes	 = gluUnProject( x, ViewPort[3]-y, 0/*z*/,
			MM, PM, ViewPort,
			&P[0], &P[1], &P[2] );

		/* Find directional vector of this line */
		VectSub(P, Q, s);

		/* Find intersection with plane in Selected node paralel with projection plane */
		t	 = (-a*Q[0] - b*Q[1] - c*Q[2] - d) / (a*s[0] + b*s[1] + c*s[2]);
		PNew[0]	 = Q[0] + t*s[0];
		PNew[1]	 = Q[1] + t*s[1];
		PNew[2]	 = Q[2] + t*s[2];

		if (MouseState==3) FindConfiguration();

		glutPostRedisplay();

    }
/* **************************************************************************************************************************** */
    if (MouseState==6) {   
        ONew[1]	 = xold+x-xx1; 
        if (ONew[1]>= 75)	ONew[1]	 =  74.99;
        if (ONew[1]<=-75)	ONew[1]	 = -74.99;
        glutPostRedisplay();
    }
    if (MouseState==7) {   
        ONew[2]	 = xold+x-xx1; 
        if (ONew[2]>= 180)	ONew[2]	 =  179.99;
        if (ONew[2]<=-80)	ONew[2]	 = -79.99;
        glutPostRedisplay();
    }