2023-08-16 00:20:26 +10:00
|
|
|
/* SPDX-FileCopyrightText: 2023 Blender Authors
|
2023-05-31 16:19:06 +02:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
2012-12-18 00:51:25 +00:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
|
* \ingroup freestyle
|
|
|
|
|
* \brief Configuration file
|
2012-12-18 00:51:25 +00:00
|
|
|
*/
|
|
|
|
|
|
2013-11-29 14:50:59 -05:00
|
|
|
#include <algorithm>
|
2020-04-21 12:39:12 +02:00
|
|
|
#include <string>
|
|
|
|
|
|
2012-12-18 00:51:25 +00:00
|
|
|
#include "../system/Precision.h"
|
|
|
|
|
|
2013-05-13 22:58:27 +00:00
|
|
|
#ifdef WITH_CXX_GUARDEDALLOC
|
|
|
|
|
# include "MEM_guardedalloc.h"
|
|
|
|
|
#endif
|
|
|
|
|
|
2012-12-18 00:51:25 +00:00
|
|
|
using namespace std;
|
|
|
|
|
|
2013-04-09 00:46:49 +00:00
|
|
|
namespace Freestyle {
|
|
|
|
|
|
2012-12-18 00:51:25 +00:00
|
|
|
namespace Config {
|
|
|
|
|
|
2013-03-07 23:17:23 +00:00
|
|
|
class Path {
|
2012-12-18 00:51:25 +00:00
|
|
|
protected:
|
2018-10-11 08:49:28 +11:00
|
|
|
static Path *_pInstance;
|
2012-12-18 00:51:25 +00:00
|
|
|
string _ProjectDir;
|
|
|
|
|
string _ModelsPath;
|
|
|
|
|
string _PatternsPath;
|
|
|
|
|
string _BrushesPath;
|
|
|
|
|
string _EnvMapDir;
|
|
|
|
|
string _MapsDir;
|
|
|
|
|
string _HomeDir;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-12-18 00:51:25 +00:00
|
|
|
public:
|
|
|
|
|
Path();
|
|
|
|
|
virtual ~Path();
|
2013-03-07 23:17:23 +00:00
|
|
|
static Path *getInstance();
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-12-18 00:51:25 +00:00
|
|
|
void setRootDir(const string &iRootDir);
|
|
|
|
|
void setHomeDir(const string &iHomeDir);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-12-18 00:51:25 +00:00
|
|
|
const string &getProjectDir() const
|
|
|
|
|
{
|
|
|
|
|
return _ProjectDir;
|
|
|
|
|
}
|
|
|
|
|
const string &getModelsPath() const
|
|
|
|
|
{
|
|
|
|
|
return _ModelsPath;
|
|
|
|
|
}
|
|
|
|
|
const string &getPatternsPath() const
|
|
|
|
|
{
|
|
|
|
|
return _PatternsPath;
|
|
|
|
|
}
|
|
|
|
|
const string &getBrushesPath() const
|
|
|
|
|
{
|
|
|
|
|
return _BrushesPath;
|
|
|
|
|
}
|
|
|
|
|
const string &getEnvMapDir() const
|
|
|
|
|
{
|
|
|
|
|
return _EnvMapDir;
|
|
|
|
|
}
|
|
|
|
|
const string &getMapsDir() const
|
|
|
|
|
{
|
|
|
|
|
return _MapsDir;
|
|
|
|
|
}
|
|
|
|
|
const string &getHomeDir() const
|
|
|
|
|
{
|
|
|
|
|
return _HomeDir;
|
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-12-18 00:51:25 +00:00
|
|
|
static string getEnvVar(const string &iEnvVarName);
|
2013-05-13 22:58:27 +00:00
|
|
|
|
|
|
|
|
#ifdef WITH_CXX_GUARDEDALLOC
|
|
|
|
|
MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:Config:Path")
|
|
|
|
|
#endif
|
2012-12-18 00:51:25 +00:00
|
|
|
};
|
|
|
|
|
|
2008-05-19 05:34:31 +00:00
|
|
|
//
|
2012-12-18 00:51:25 +00:00
|
|
|
// Configuration, default values
|
2008-05-19 05:34:31 +00:00
|
|
|
//
|
2012-12-18 00:51:25 +00:00
|
|
|
//////////////////////////////////////////////////////////////
|
2008-05-19 05:34:31 +00:00
|
|
|
|
2012-12-18 00:51:25 +00:00
|
|
|
// Application
|
|
|
|
|
static const string APPLICATION_NAME("APPNAME");
|
|
|
|
|
static const string APPLICATION_VERSION("APPVERSION");
|
2008-05-19 05:34:31 +00:00
|
|
|
|
2012-12-18 00:51:25 +00:00
|
|
|
// ViewMap
|
|
|
|
|
static const string VIEWMAP_EXTENSION("vm");
|
|
|
|
|
static const string VIEWMAP_MAGIC("ViewMap File");
|
|
|
|
|
static const string VIEWMAP_VERSION("1.9");
|
2008-05-19 05:34:31 +00:00
|
|
|
|
2012-12-18 00:51:25 +00:00
|
|
|
// Style modules
|
|
|
|
|
static const string STYLE_MODULE_EXTENSION("py");
|
|
|
|
|
static const string STYLE_MODULES_LIST_EXTENSION("sml");
|
2008-05-19 05:34:31 +00:00
|
|
|
|
2012-12-18 00:51:25 +00:00
|
|
|
// Options
|
|
|
|
|
static const string OPTIONS_DIR("." + APPLICATION_NAME);
|
|
|
|
|
static const string OPTIONS_FILE("options.xml");
|
|
|
|
|
static const string OPTIONS_CURRENT_DIRS_FILE("current_dirs.xml");
|
|
|
|
|
static const string OPTIONS_QGLVIEWER_FILE("qglviewer.xml");
|
2008-05-19 05:34:31 +00:00
|
|
|
|
|
|
|
|
} // namespace Config
|
|
|
|
|
|
2013-04-09 00:46:49 +00:00
|
|
|
} /* namespace Freestyle */
|