Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2012-07-17 03:29:12 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2012-07-17 03:29:12 +0400
commit5a581c1fd116c51df13e09c5c320feba48d069bb (patch)
tree91df14a7a43b19af4ecac736460cbbd8c1b1e291 /source/blender/freestyle/intern/system
parent9d2a957a0d440b07d1a5e9e0ee5fb613d93637d9 (diff)
Better handling of the ESC key during Freestyle rendering.
This commit is meant to improve the response of the ESC key for stopping Freestyle rendering throughout the rendering process. The rendering with Freestyle consists of several steps including: (1) mesh data loading, (2) winged edge construction, (3) silhouette edge detection, (4) view map construction, and (5) stroke drawing. All these steps have been extended to frequently check if the ESC key is pressed, so that users can abort time-consuming rendering at any point of time.
Diffstat (limited to 'source/blender/freestyle/intern/system')
-rw-r--r--source/blender/freestyle/intern/system/RenderMonitor.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/source/blender/freestyle/intern/system/RenderMonitor.h b/source/blender/freestyle/intern/system/RenderMonitor.h
new file mode 100644
index 00000000000..7d148e65c90
--- /dev/null
+++ b/source/blender/freestyle/intern/system/RenderMonitor.h
@@ -0,0 +1,47 @@
+//
+// Copyright (C) : Please refer to the COPYRIGHT file distributed
+// with this source distribution.
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#ifndef RENDERMONITOR_H
+#define RENDERMONITOR_H
+
+extern "C" {
+#include "render_types.h"
+}
+
+class RenderMonitor
+{
+public:
+
+ inline RenderMonitor(Render *re) {
+ _re = re;
+ }
+
+ virtual ~RenderMonitor() {}
+
+ inline bool testBreak() {
+ return _re && _re->test_break(_re->tbh);
+ }
+
+protected:
+
+ Render *_re;
+};
+
+#endif // RENDERMONITOR_H