OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * ***** BEGIN GPL LICENSE BLOCK ***** |
| 3 * |
| 4 * This program is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU General Public License |
| 6 * as published by the Free Software Foundation; either version 2 |
| 7 * of the License, or (at your option) any later version. |
| 8 * |
| 9 * This program is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 * GNU General Public License for more details. |
| 13 * |
| 14 * You should have received a copy of the GNU General Public License |
| 15 * along with this program; if not, write to the Free Software Foundation, |
| 16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 17 * |
| 18 * The Original Code is Copyright (C) 2010 Blender Foundation. |
| 19 * All rights reserved. |
| 20 * |
| 21 * The Original Code is: all of this file. |
| 22 * |
| 23 * Contributor(s): none yet. |
| 24 * |
| 25 * ***** END GPL LICENSE BLOCK ***** |
| 26 */ |
| 27 |
| 28 #ifndef __FREESTYLE_NODE_DRAWING_STYLE_H__ |
| 29 #define __FREESTYLE_NODE_DRAWING_STYLE_H__ |
| 30 |
| 31 /** \file blender/freestyle/intern/scene_graph/NodeDrawingStyle.h |
| 32 * \ingroup freestyle |
| 33 * \brief Class to define a Drawing Style to be applied to the underlying child
ren. Inherits from NodeGroup. |
| 34 * \author Stephane Grabli |
| 35 * \date 06/02/2002 |
| 36 */ |
| 37 |
| 38 #include "DrawingStyle.h" |
| 39 #include "NodeGroup.h" |
| 40 |
| 41 #include "../system/FreestyleConfig.h" |
| 42 |
| 43 class LIB_SCENE_GRAPH_EXPORT NodeDrawingStyle : public NodeGroup |
| 44 { |
| 45 public: |
| 46 inline NodeDrawingStyle() : NodeGroup() {} |
| 47 virtual ~NodeDrawingStyle() {} |
| 48 |
| 49 inline const DrawingStyle& drawingStyle() const |
| 50 { |
| 51 return _DrawingStyle; |
| 52 } |
| 53 |
| 54 inline void setDrawingStyle(const DrawingStyle& iDrawingStyle) |
| 55 { |
| 56 _DrawingStyle = iDrawingStyle; |
| 57 } |
| 58 |
| 59 /*! Sets the style. Must be one of FILLED, LINES, POINTS, INVISIBLE. */ |
| 60 inline void setStyle(const DrawingStyle::STYLE iStyle) |
| 61 { |
| 62 _DrawingStyle.setStyle(iStyle); |
| 63 } |
| 64 |
| 65 /*! Sets the line width in the LINES style case */ |
| 66 inline void setLineWidth(const float iLineWidth) |
| 67 { |
| 68 _DrawingStyle.setLineWidth(iLineWidth); |
| 69 } |
| 70 |
| 71 /*! Sets the Point size in the POINTS style case */ |
| 72 inline void setPointSize(const float iPointSize) |
| 73 { |
| 74 _DrawingStyle.setPointSize(iPointSize); |
| 75 } |
| 76 |
| 77 /*! Enables or disables the lighting. TRUE = enable */ |
| 78 inline void setLightingEnabled(const bool iEnableLighting) |
| 79 { |
| 80 _DrawingStyle.setLightingEnabled(iEnableLighting); |
| 81 } |
| 82 |
| 83 /*! Accept the corresponding visitor */ |
| 84 virtual void accept(SceneVisitor& v); |
| 85 |
| 86 /*! accessors */ |
| 87 inline DrawingStyle::STYLE style() const |
| 88 { |
| 89 return _DrawingStyle.style(); |
| 90 } |
| 91 |
| 92 inline float lineWidth() const |
| 93 { |
| 94 return _DrawingStyle.lineWidth(); |
| 95 } |
| 96 |
| 97 inline float pointSize() const |
| 98 { |
| 99 return _DrawingStyle.pointSize(); |
| 100 } |
| 101 |
| 102 inline bool lightingEnabled() const |
| 103 { |
| 104 return _DrawingStyle.lightingEnabled(); |
| 105 } |
| 106 |
| 107 private: |
| 108 DrawingStyle _DrawingStyle; |
| 109 }; |
| 110 |
| 111 #endif // __FREESTYLE_NODE_DRAWING_STYLE_H__ |
OLD | NEW |