Exemplo n.º 1
0
//-----------------------------------------------------------------------------
void MySample::Create()
{
    CreateResources();

	ImGui_ImplDX11_Init(GetHWnd(), GetDevice(), GetContext());
	CPUTWindowWin::SetWinProcOverride(MySample_WndProcCallback);
	
    
	int windowWidth, windowHeight;
	mpWindow->GetClientDimensions(&windowWidth, &windowHeight);

	SampleUtil_Init();
	MenuGlob_Init();
	MenuGlob_SetScreenDim(windowWidth, windowHeight);
	MenuController_Init();
	
	std::string userDir = GetUserDataDirectory();
	

#ifndef DISABLE_RSSDK
	MenuController_PushMenu(gMenu_Scan);

	// go directly to the face mapping menu
	//std::string debugFace;
	//CPUTFileSystem::CombinePath(userDir, "joe.obj", &debugFace);
	//gMenu_FaceMapping->LoadFace(debugFace);
	//MenuController_PushMenu(gMenu_FaceMapping);

	// Go directly to the face scan preview menu
	//gMenu_FaceScanPreview->LoadFaceObj("", true);
	//gMenu_FaceScanPreview->SetFaceScanMode( FaceScanPreviewMode_ApproveScan );
	//MenuController_PushMenu(gMenu_FaceScanPreview);
	
#else
	std::string debugFace;
	CPUTFileSystem::CombinePath(userDir, "joe_sr300_1.obj", &debugFace);
	gMenu_FaceMapping->LoadFace( debugFace );
	MenuController_PushMenu(gMenu_FaceMapping);

	// go directly to the face preview menu
	//gMenu_FaceScanPreview->LoadFaceObj("", true);
	//MenuController_PushMenu(gMenu_FaceScanPreview);
	
	// go to the edit landmark menu
	//static CFaceModel faceModel;
	//faceModel.LoadObjFilename(debugFace);
	//gMenu_LandmarkEdit->SetInput(&faceModel.Landmarks, &faceModel.Landmarks, NULL, &faceModel);
	//MenuController_PushMenu(gMenu_LandmarkEdit);

#endif

	MenuGlob_GUI()->SetActivePanel(MENU_CPUT_PANEL_ID);

}
Exemplo n.º 2
0
QString GetSettingsDirectory() {
  QString ret;

#ifdef Q_OS_WIN32
  ret = GetUserDataDirectory() + "/" + QCoreApplication::applicationName() + "/spotify-settings";
#else
  ret = QFileInfo(QSettings().fileName()).absolutePath() + "/spotify-settings";
#endif // Q_OS_WIN32

  // Create the directory
  QDir dir;
  dir.mkpath(ret);

  return ret;
}
Exemplo n.º 3
0
nsresult
nsXREDirProvider::GetUserProfilesLocalDir(nsIFile** aResult,
                                          const nsACString* aProfileName,
                                          const nsACString* aAppName,
                                          const nsACString* aVendorName)
{
  nsCOMPtr<nsIFile> file;
  nsresult rv = GetUserDataDirectory(getter_AddRefs(file),
                                     true,
                                     aProfileName, aAppName, aVendorName);

  if (NS_SUCCEEDED(rv)) {
#if !defined(XP_UNIX) || defined(XP_MACOSX)
    rv = file->AppendNative(NS_LITERAL_CSTRING("Profiles"));
#endif
    // We must create the profile directory here if it does not exist.
    nsresult tmp = EnsureDirectoryExists(file);
    if (NS_FAILED(tmp)) {
      rv = tmp;
    }
  }
  file.swap(*aResult);
  return NS_OK;
}
Exemplo n.º 4
0
QString GetCacheDirectory() {
  QString user_cache = GetUserDataDirectory();
  return user_cache + "/" + QCoreApplication::applicationName() +
         "/spotify-cache";
}
Exemplo n.º 5
0
void Menu_FaceMapping::HandleCPUTEvent(int eventID, int controlID, CPUTControl *control)
{
	switch (controlID)
	{
	case FaceMappingMenuId_LoadScan:
	{
		OPENFILENAMEA ofn;
		char filename[512];
		memset(&ofn, 0, sizeof(OPENFILENAMEA));
		filename[0] = 0;
		ofn.lStructSize = sizeof(ofn);
		ofn.hwndOwner = MySample::Instance->GetHWnd();
		ofn.lpstrDefExt = ".obj";
		ofn.lpstrFilter = "Obj Files(*.obj)\0*.obj\0\0";
		std::string cwd = GetUserDataDirectory();
		ofn.lpstrInitialDir = cwd.c_str();
		ofn.lpstrTitle = "Select An DDS File";
		ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST | OFN_NOCHANGEDIR;
		ofn.lpstrFile = filename;
		ofn.nMaxFile = sizeof(filename) / sizeof(filename[0]);
		if (GetOpenFileNameA(&ofn))
		{
			LoadFace(std::string(ofn.lpstrFile));
		}
		
	} break;
	case FaceMappingMenuId_ScanNewFace:
	{
		MenuController_PopTo(&gMenu_Scan, true);
	} break;
	case FaceMappingMenuId_SaveSculptedObj:
	{
        mSaveSculptedObj = true;

	} break;
	case FaceMappingMenuId_ShowRSMesh:
	{
		if (IsFaceLoaded())
		{
			gMenu_FaceScanPreview.LoadFaceObj(mObjFilename, true);
			gMenu_FaceScanPreview.SetFaceScanMode(FaceScanPReviewMode_ViewScan);
			MenuController_PushMenu(&gMenu_FaceScanPreview);
		}
	} break;
	case FaceMappingMenuId_SliderPitch:
	case FaceMappingMenuId_SliderYaw:
	case FaceMappingMenuId_SliderScale:
	case FaceMappingMenuId_SliderRoll:
	case FaceMappingMenuId_SliderPhysicalDisplaceOffset:
	{
		UpdateTweaksFromGUI();
		UpdateGUIFromTweaks();
	} break;
	case FaceMappingMenuId_BaseColor:
	case FaceMappingMenuId_BaseColor2:
	{
		byte *colors = (controlID == FaceMappingMenuId_BaseColor) ? &mTweaks.BlendColorRGB[0] : &mTweaks.BlendColor2RGB[0];
		CHOOSECOLOR cc = {};
		COLORREF customColors[16];
		cc.lStructSize = sizeof(CHOOSECOLOR);
		cc.hwndOwner = MySample::Instance->GetHWnd();
		cc.rgbResult = RGB(colors[0], colors[1], colors[2]);
		customColors[0] = RGB(228, 194, 171);
		customColors[1] = RGB(205, 50, 50);
		cc.lpCustColors = customColors;
		cc.Flags = CC_RGBINIT | CC_FULLOPEN;
		if (ChooseColor(&cc))
		{
			colors[0] = (byte)(cc.rgbResult & 0x000000ff);
			colors[1] = (byte)((cc.rgbResult & 0x0000ff00) >> 8);
			colors[2] = (byte)((cc.rgbResult & 0x00ff0000) >> 16);
		}
	} break;
	case FaceMappingMenuId_ResetTweaks:
	{
		SetDefaultTweaks(&mTweaks);
		UpdateGUIFromTweaks();
	} break;
	}