summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--RELEASE_NOTES5
-rw-r--r--src/MainWindow.h1
-rw-r--r--src/MainWindow.ui8
-rw-r--r--src/mainwin.cc19
4 files changed, 31 insertions, 2 deletions
diff --git a/RELEASE_NOTES b/RELEASE_NOTES
index 11ceb98..3ab6e49 100644
--- a/RELEASE_NOTES
+++ b/RELEASE_NOTES
@@ -1,8 +1,9 @@
OpenSCAD 2011.06
================
-Bugfix release:
+o Added "Export as Image" menu.
+Bugfixes:
o Cylinder tesselation broke existing models which are using cylinders
for e.g. captured nut slots and are dependent on the orientation not
changing.
@@ -10,6 +11,8 @@ o DXF output couldn't be imported into e.g. AutoCAD and Solidworks after updatin
to using the AutoCAD 2000 (AC1015) format. Reverted to the old entity-only output,
causing LWPOLYLINES to not exported allowed anmore.
+
+
OpenSCAD 2011.04
================
diff --git a/src/MainWindow.h b/src/MainWindow.h
index c0a9844..23daf44 100644
--- a/src/MainWindow.h
+++ b/src/MainWindow.h
@@ -109,6 +109,7 @@ private slots:
void actionExportSTL();
void actionExportOFF();
void actionExportDXF();
+ void actionExportImage();
void actionFlushCaches();
public:
diff --git a/src/MainWindow.ui b/src/MainWindow.ui
index f61d240..6548c8e 100644
--- a/src/MainWindow.ui
+++ b/src/MainWindow.ui
@@ -112,7 +112,7 @@
<x>0</x>
<y>0</y>
<width>681</width>
- <height>25</height>
+ <height>22</height>
</rect>
</property>
<widget class="QMenu" name="menu_File">
@@ -178,6 +178,7 @@
<addaction name="designActionExportSTL"/>
<addaction name="designActionExportOFF"/>
<addaction name="designActionExportDXF"/>
+ <addaction name="designActionExportImage"/>
<addaction name="designActionFlushCaches"/>
</widget>
<widget class="QMenu" name="menu_View">
@@ -651,6 +652,11 @@
<string>Automatic Reload and Compile</string>
</property>
</action>
+ <action name="designActionExportImage">
+ <property name="text">
+ <string>Export as Image...</string>
+ </property>
+ </action>
</widget>
<customwidgets>
<customwidget>
diff --git a/src/mainwin.cc b/src/mainwin.cc
index e217b1f..6ea98be 100644
--- a/src/mainwin.cc
+++ b/src/mainwin.cc
@@ -259,6 +259,7 @@ MainWindow::MainWindow(const QString &filename)
connect(this->designActionExportSTL, SIGNAL(triggered()), this, SLOT(actionExportSTL()));
connect(this->designActionExportOFF, SIGNAL(triggered()), this, SLOT(actionExportOFF()));
connect(this->designActionExportDXF, SIGNAL(triggered()), this, SLOT(actionExportDXF()));
+ connect(this->designActionExportImage, SIGNAL(triggered()), this, SLOT(actionExportImage()));
connect(this->designActionFlushCaches, SIGNAL(triggered()), this, SLOT(actionFlushCaches()));
// View menu
@@ -1342,6 +1343,24 @@ void MainWindow::actionExportDXF()
#endif /* ENABLE_CGAL */
}
+void MainWindow::actionExportImage()
+{
+ QImage img = screen->grabFrameBuffer();
+ setCurrentOutput();
+
+ QString img_filename = QFileDialog::getSaveFileName(this,
+ "Export Image", "", "PNG Files (*.png)");
+ if (img_filename.isEmpty()) {
+ PRINTF("No filename specified. Image export aborted.");
+ clearCurrentOutput();
+ return;
+ }
+
+ img.save(img_filename, "PNG");
+
+ clearCurrentOutput();
+}
+
void MainWindow::actionFlushCaches()
{
PolySet::ps_cache.clear();
contact: Jan Huwald // Impressum