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 */
|
2008-04-30 15:41:54 +00:00
|
|
|
|
2012-12-28 20:21:05 +00:00
|
|
|
#pragma once
|
2008-04-30 15:41:54 +00:00
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
|
* \ingroup freestyle
|
|
|
|
|
* \brief Set the type of the module
|
2012-12-28 20:21:05 +00:00
|
|
|
*/
|
2008-04-30 15:41:54 +00:00
|
|
|
|
2012-12-28 20:21:05 +00:00
|
|
|
#include "Canvas.h"
|
|
|
|
|
#include "StyleModule.h"
|
2008-04-30 15:41:54 +00:00
|
|
|
|
2024-11-13 13:39:49 +01:00
|
|
|
#include "MEM_guardedalloc.h"
|
2013-05-13 22:58:27 +00:00
|
|
|
|
2013-04-09 00:46:49 +00:00
|
|
|
namespace Freestyle {
|
|
|
|
|
|
2008-04-30 15:41:54 +00:00
|
|
|
class Module {
|
|
|
|
|
public:
|
2012-12-28 20:21:05 +00:00
|
|
|
static void setAlwaysRefresh(bool b = true)
|
|
|
|
|
{
|
|
|
|
|
getCurrentStyleModule()->setAlwaysRefresh(b);
|
|
|
|
|
}
|
2008-04-30 15:41:54 +00:00
|
|
|
|
2012-12-28 20:21:05 +00:00
|
|
|
static void setCausal(bool b = true)
|
|
|
|
|
{
|
|
|
|
|
getCurrentStyleModule()->setCausal(b);
|
|
|
|
|
}
|
2008-04-30 15:41:54 +00:00
|
|
|
|
2012-12-28 20:21:05 +00:00
|
|
|
static void setDrawable(bool b = true)
|
|
|
|
|
{
|
|
|
|
|
getCurrentStyleModule()->setDrawable(b);
|
|
|
|
|
}
|
2008-04-30 15:41:54 +00:00
|
|
|
|
2012-12-28 20:21:05 +00:00
|
|
|
static bool getAlwaysRefresh()
|
|
|
|
|
{
|
|
|
|
|
return getCurrentStyleModule()->getAlwaysRefresh();
|
|
|
|
|
}
|
2008-04-30 15:41:54 +00:00
|
|
|
|
2012-12-28 20:21:05 +00:00
|
|
|
static bool getCausal()
|
|
|
|
|
{
|
|
|
|
|
return getCurrentStyleModule()->getCausal();
|
|
|
|
|
}
|
2008-04-30 15:41:54 +00:00
|
|
|
|
2012-12-28 20:21:05 +00:00
|
|
|
static bool getDrawable()
|
|
|
|
|
{
|
|
|
|
|
return getCurrentStyleModule()->getDrawable();
|
|
|
|
|
}
|
2008-04-30 15:41:54 +00:00
|
|
|
|
|
|
|
|
private:
|
2013-03-11 06:56:51 +00:00
|
|
|
static StyleModule *getCurrentStyleModule()
|
2012-12-28 20:21:05 +00:00
|
|
|
{
|
|
|
|
|
Canvas *canvas = Canvas::getInstance();
|
|
|
|
|
return canvas->getCurrentStyleModule();
|
|
|
|
|
}
|
2013-05-13 22:58:27 +00:00
|
|
|
|
|
|
|
|
MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:Module")
|
2008-04-30 15:41:54 +00:00
|
|
|
};
|
|
|
|
|
|
2013-04-09 00:46:49 +00:00
|
|
|
} /* namespace Freestyle */
|