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-28 20:21:05 +00:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
|
* \ingroup freestyle
|
2019-04-30 17:50:57 +10:00
|
|
|
* \brief Class to define a Drawing Style to be applied to the underlying children. Inherits from
|
|
|
|
|
* NodeGroup.
|
2012-12-28 20:21:05 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "DrawingStyle.h"
|
|
|
|
|
#include "NodeGroup.h"
|
|
|
|
|
|
|
|
|
|
#include "../system/FreestyleConfig.h"
|
2008-04-30 15:41:54 +00:00
|
|
|
|
2013-04-09 00:46:49 +00:00
|
|
|
namespace Freestyle {
|
|
|
|
|
|
2014-04-17 14:19:10 +09:00
|
|
|
class NodeDrawingStyle : public NodeGroup {
|
2008-04-30 15:41:54 +00:00
|
|
|
public:
|
2023-03-29 16:50:54 +02:00
|
|
|
inline NodeDrawingStyle() : NodeGroup() {}
|
|
|
|
|
virtual ~NodeDrawingStyle() {}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-12-28 20:21:05 +00:00
|
|
|
inline const DrawingStyle &drawingStyle() const
|
|
|
|
|
{
|
|
|
|
|
return _DrawingStyle;
|
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-12-28 20:21:05 +00:00
|
|
|
inline void setDrawingStyle(const DrawingStyle &iDrawingStyle)
|
|
|
|
|
{
|
|
|
|
|
_DrawingStyle = iDrawingStyle;
|
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2021-06-24 15:57:33 +10:00
|
|
|
/** Sets the style. Must be one of FILLED, LINES, POINTS, INVISIBLE. */
|
2012-12-28 20:21:05 +00:00
|
|
|
inline void setStyle(const DrawingStyle::STYLE iStyle)
|
|
|
|
|
{
|
|
|
|
|
_DrawingStyle.setStyle(iStyle);
|
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2021-06-24 15:57:33 +10:00
|
|
|
/** Sets the line width in the LINES style case */
|
2012-12-28 20:21:05 +00:00
|
|
|
inline void setLineWidth(const float iLineWidth)
|
|
|
|
|
{
|
|
|
|
|
_DrawingStyle.setLineWidth(iLineWidth);
|
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2021-06-24 15:57:33 +10:00
|
|
|
/** Sets the Point size in the POINTS style case */
|
2012-12-28 20:21:05 +00:00
|
|
|
inline void setPointSize(const float iPointSize)
|
|
|
|
|
{
|
|
|
|
|
_DrawingStyle.setPointSize(iPointSize);
|
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2021-06-24 15:57:33 +10:00
|
|
|
/** Enables or disables the lighting. true = enable */
|
2012-12-28 20:21:05 +00:00
|
|
|
inline void setLightingEnabled(const bool iEnableLighting)
|
|
|
|
|
{
|
|
|
|
|
_DrawingStyle.setLightingEnabled(iEnableLighting);
|
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2021-06-24 15:57:33 +10:00
|
|
|
/** Accept the corresponding visitor */
|
2012-12-28 20:21:05 +00:00
|
|
|
virtual void accept(SceneVisitor &v);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2021-06-24 15:57:33 +10:00
|
|
|
/** accessors */
|
2012-12-28 20:21:05 +00:00
|
|
|
inline DrawingStyle::STYLE style() const
|
|
|
|
|
{
|
|
|
|
|
return _DrawingStyle.style();
|
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-12-28 20:21:05 +00:00
|
|
|
inline float lineWidth() const
|
|
|
|
|
{
|
|
|
|
|
return _DrawingStyle.lineWidth();
|
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-12-28 20:21:05 +00:00
|
|
|
inline float pointSize() const
|
|
|
|
|
{
|
|
|
|
|
return _DrawingStyle.pointSize();
|
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-12-28 20:21:05 +00:00
|
|
|
inline bool lightingEnabled() const
|
|
|
|
|
{
|
|
|
|
|
return _DrawingStyle.lightingEnabled();
|
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2008-04-30 15:41:54 +00:00
|
|
|
private:
|
2012-12-28 20:21:05 +00:00
|
|
|
DrawingStyle _DrawingStyle;
|
2013-08-04 18:50:00 +00:00
|
|
|
|
|
|
|
|
MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:NodeDrawingStyle")
|
2008-04-30 15:41:54 +00:00
|
|
|
};
|
|
|
|
|
|
2013-04-09 00:46:49 +00:00
|
|
|
} /* namespace Freestyle */
|