Commit: 9a6f22462d8ddef25e53f91b3b81609da125b2dd
Author: Sebastián Barschkis
Date:   Fri Oct 9 18:27:27 2015 +0200
Branches: fluid-mantaflow
https://developer.blender.org/rB9a6f22462d8ddef25e53f91b3b81609da125b2dd

fixed manta density inflow grid and removed unneeded manta pp gui files

===================================================================

M       intern/smoke/intern/scenarios/smoke.h
M       intern/smoke/intern/smoke_API.cpp
M       source/blender/blenkernel/intern/smoke.c
D       source/blender/python/manta_pp/gui/customctrl.cpp
D       source/blender/python/manta_pp/gui/customctrl.h
D       source/blender/python/manta_pp/gui/customctrl.h.reg
D       source/blender/python/manta_pp/gui/customctrl.h.reg.cpp
D       source/blender/python/manta_pp/gui/glwidget.cpp
D       source/blender/python/manta_pp/gui/glwidget.h
D       source/blender/python/manta_pp/gui/glwidget.h.reg
D       source/blender/python/manta_pp/gui/glwidget.h.reg.cpp
D       source/blender/python/manta_pp/gui/mainwindow.cpp
D       source/blender/python/manta_pp/gui/mainwindow.h
D       source/blender/python/manta_pp/gui/mainwindow.h.reg
D       source/blender/python/manta_pp/gui/mainwindow.h.reg.cpp
D       source/blender/python/manta_pp/gui/meshpainter.cpp
D       source/blender/python/manta_pp/gui/meshpainter.h
D       source/blender/python/manta_pp/gui/meshpainter.h.reg
D       source/blender/python/manta_pp/gui/meshpainter.h.reg.cpp
D       source/blender/python/manta_pp/gui/moc_customctrl.cpp
D       source/blender/python/manta_pp/gui/moc_customctrl.cpp_parameters
D       source/blender/python/manta_pp/gui/moc_customctrl.cxx
D       source/blender/python/manta_pp/gui/moc_customctrl.cxx_parameters
D       source/blender/python/manta_pp/gui/moc_glwidget.cpp
D       source/blender/python/manta_pp/gui/moc_glwidget.cpp_parameters
D       source/blender/python/manta_pp/gui/moc_glwidget.cxx
D       source/blender/python/manta_pp/gui/moc_glwidget.cxx_parameters
D       source/blender/python/manta_pp/gui/moc_mainwindow.cpp
D       source/blender/python/manta_pp/gui/moc_mainwindow.cpp_parameters
D       source/blender/python/manta_pp/gui/moc_mainwindow.cxx
D       source/blender/python/manta_pp/gui/moc_mainwindow.cxx_parameters
D       source/blender/python/manta_pp/gui/moc_meshpainter.cpp
D       source/blender/python/manta_pp/gui/moc_meshpainter.cpp_parameters
D       source/blender/python/manta_pp/gui/moc_meshpainter.cxx
D       source/blender/python/manta_pp/gui/moc_meshpainter.cxx_parameters
D       source/blender/python/manta_pp/gui/moc_painter.cpp
D       source/blender/python/manta_pp/gui/moc_painter.cpp_parameters
D       source/blender/python/manta_pp/gui/moc_painter.cxx
D       source/blender/python/manta_pp/gui/moc_painter.cxx_parameters
D       source/blender/python/manta_pp/gui/moc_particlepainter.cpp
D       source/blender/python/manta_pp/gui/moc_particlepainter.cpp_parameters
D       source/blender/python/manta_pp/gui/moc_particlepainter.cxx
D       source/blender/python/manta_pp/gui/moc_particlepainter.cxx_parameters
D       source/blender/python/manta_pp/gui/moc_qtmain.cpp
D       source/blender/python/manta_pp/gui/moc_qtmain.cpp_parameters
D       source/blender/python/manta_pp/gui/moc_qtmain.cxx
D       source/blender/python/manta_pp/gui/moc_qtmain.cxx_parameters
D       source/blender/python/manta_pp/gui/painter.cpp
D       source/blender/python/manta_pp/gui/painter.h
D       source/blender/python/manta_pp/gui/painter.h.reg
D       source/blender/python/manta_pp/gui/painter.h.reg.cpp
D       source/blender/python/manta_pp/gui/particlepainter.cpp
D       source/blender/python/manta_pp/gui/particlepainter.h
D       source/blender/python/manta_pp/gui/particlepainter.h.reg
D       source/blender/python/manta_pp/gui/particlepainter.h.reg.cpp
D       source/blender/python/manta_pp/gui/qtmain.cpp
D       source/blender/python/manta_pp/gui/qtmain.h
D       source/blender/python/manta_pp/gui/qtmain.h.reg
D       source/blender/python/manta_pp/gui/qtmain.h.reg.cpp

===================================================================

diff --git a/intern/smoke/intern/scenarios/smoke.h 
b/intern/smoke/intern/scenarios/smoke.h
index 9cb61ae..05c882d 100644
--- a/intern/smoke/intern/scenarios/smoke.h
+++ b/intern/smoke/intern/scenarios/smoke.h
@@ -55,7 +55,6 @@ manta_using_colors = $USING_COLORS$\n\
 manta_using_heat = $USING_HEAT$\n\
 manta_using_fire = $USING_FIRE$\n\
 low_flags_updated = False\n\
-\n\
 ";
 
 const string smoke_setup_high = "\
@@ -161,7 +160,7 @@ if (GUI):\n\
 \n\
 import_grids()\n\
 \n\
-for step in range(500):\n\
+for step in range(1000):\n\
   apply_inflow()\n\
 \n\
   print('Step '+ str(step))\n\
@@ -313,7 +312,6 @@ const string smoke_export_high = "\n\
 import os\n\
 xl_density.save(os.path.join('$MANTA_EXPORT_PATH$','xl_density.uni'))\n\
 xl_flags.save(os.path.join('$MANTA_EXPORT_PATH$','xl_flags.uni'))\n\
-vel.save(os.path.join('$MANTA_EXPORT_PATH$','vel.uni'))\n\
 if manta_using_colors:\n\
   color_r_high.save(os.path.join('$MANTA_EXPORT_PATH$','color_r_high.uni'))\n\
   color_g_high.save(os.path.join('$MANTA_EXPORT_PATH$','color_g_high.uni'))\n\
@@ -345,7 +343,7 @@ def import_grids():\n\
 \n\
 def apply_inflow():\n\
   print('Applying inflow')\n\
-  inflow_grid.multConst(0.1)\n\
+  #inflow_grid.multConst(0.1)\n\
   density.add(inflow_grid)\n\
 ";
 
diff --git a/intern/smoke/intern/smoke_API.cpp 
b/intern/smoke/intern/smoke_API.cpp
index eb7e249..82879f9 100644
--- a/intern/smoke/intern/smoke_API.cpp
+++ b/intern/smoke/intern/smoke_API.cpp
@@ -310,11 +310,6 @@ extern "C" float *smoke_get_density(FLUID_3D *fluid)
        return fluid->_density;
 }
 
-extern "C" float *smoke_get_inflow_grid(FLUID_3D *fluid)
-{
-       return fluid->_manta_inflow;
-}
-
 extern "C" float *smoke_get_fuel(FLUID_3D *fluid)
 {
        return fluid->_fuel;
@@ -681,3 +676,8 @@ extern "C" int cell_index_3D(int index_2d, int sizex,int 
sizey, int sizez)
        (index_2d % (sizex)) + 
        int(index_2d/(sizex)) * sizex * sizey;
 }
+
+extern "C" float *smoke_get_inflow_grid(FLUID_3D *fluid)
+{
+       return fluid->_manta_inflow;
+}
diff --git a/source/blender/blenkernel/intern/smoke.c 
b/source/blender/blenkernel/intern/smoke.c
index cbba234..8a66313 100644
--- a/source/blender/blenkernel/intern/smoke.c
+++ b/source/blender/blenkernel/intern/smoke.c
@@ -2344,7 +2344,7 @@ static void update_flowsfluids(Scene *scene, Object *ob, 
SmokeDomainSettings *sd
                                                        }
                                                        else { // inflow
                                                                
apply_inflow_fields(sfs, emission_map[e_index], d_index, density, heat, fuel, 
react, color_r, color_g, color_b);
-                                                               if((sds->flags 
& MOD_SMOKE_USE_MANTA) && (sds->manta_solver_res == 3)) {
+                                                               if((sfs->flags 
& MOD_SMOKE_USE_MANTA) && (sds->manta_solver_res == 3)) {
                                                                        
apply_inflow_fields(sfs, emission_map[e_index], d_index, inflow_grid, heat, 
fuel, react, color_r, color_g, color_b);
                                                                }
                                                                                
                                                /* initial velocity */
diff --git a/source/blender/python/manta_pp/gui/customctrl.cpp 
b/source/blender/python/manta_pp/gui/customctrl.cpp
deleted file mode 100644
index dbb3a24..0000000
--- a/source/blender/python/manta_pp/gui/customctrl.cpp
+++ /dev/null
@@ -1,211 +0,0 @@
-
-
-
-
-
-// DO NOT EDIT !
-// This file is generated using the MantaFlow preprocessor (prep generate).
-
-
-
-
-#line 1 "/Users/user/Developer/Xcode 
Projects/blenderFireIntegration/mantaflowgit/source/gui/customctrl.cpp"
-/******************************************************************************
- *
- * MantaFlow fluid solver framework
- * Copyright 2011 Tobias Pfaff, Nils Thuerey 
- *
- * This program is free software, distributed under the terms of the
- * GNU General Public License (GPL) 
- * http://www.gnu.org/licenses
- *
- * GUI extension from python
- *
- 
******************************************************************************/
-
-#include "customctrl.h"
-#include "qtmain.h"
-#include "painter.h"
-
-using namespace std;
-
-namespace Manta {
-       
-// 
*****************************************************************************
-// Slider class
-
-CustomControl::CustomControl() : PbClass(0) {
-}
-
-CustomCheckbox::CustomCheckbox(string name, bool val) : mVal(val), 
mSName(name), mCheckbox(0) {
-}
-
-void CustomCheckbox::init(QBoxLayout* layout) {
-       mCheckbox = new TextCheckbox(mSName, mVal);
-       QObject::connect(mCheckbox, SIGNAL(stateChanged(int)), mCheckbox, 
SLOT(update(int)));
-       mCheckbox->attach(layout);
-}
-
-bool CustomCheckbox::get() {
-       if (!mCheckbox) throw Error("Slider is not attached yet!");
-       return mCheckbox->get();
-}
-void CustomCheckbox::set(bool v) {
-       if (!mCheckbox) throw Error("Slider is not attached yet!");
-       mCheckbox->set(v);
-}
-
-CustomSlider::CustomSlider(string name, float val, float min, float max) : 
-       mMin(min), mMax(max), mVal(val), mSName(name), mSlider(0)
-{
-}
-
-void CustomSlider::init(QBoxLayout* layout) {
-       mSlider = new TextSlider(mSName, mVal, mMin, mMax);
-       QObject::connect(mSlider, SIGNAL(valueChanged(int)), mSlider, 
SLOT(update(int)));
-       mSlider->attach(layout);
-}
-
-float CustomSlider::get() {
-       if (!mSlider) throw Error("Slider is not attached yet!");
-       return mSlider->get();
-}
-
-void CustomSlider::set(float v) {
-       if (!mSlider) throw Error("Slider is not attached yet!");
-       mSlider->set(v);
-}
-
-TextSlider::TextSlider(const string& name, float val, float vmin, float vmax) 
: 
-       QSlider(Qt::Horizontal), mMin(vmin), mMax(vmax), mSName(name.c_str())
-{
-       mLabel = new QLabel();
-       mScale = 1000;
-       setMinimum(0);
-       setMaximum(999);    
-       set(val);
-       update(0);
- }
-
-void TextSlider::attach(QBoxLayout* layout) {
-       layout->addWidget(mLabel);
-       layout->addWidget(this);    
-}
-
-void TextSlider::update(int val) {
-       float v = get();
-       QString num;
-       num.sprintf("%.2g", v);
-       mLabel->setText(mSName + ":  " + num);    
-}
-
-float TextSlider::get() {
-       float va = mMin + (mMax-mMin) / mScale * (float)value();
-       return clamp(va, mMin, mMax);
-}
-
-void TextSlider::set(float v) {
-       float va = clamp(v, mMin, mMax);
-       va = (va - mMin) / (mMax-mMin) * mScale;
-       setValue((int)(va+0.5));
-}
-
-TextCheckbox::TextCheckbox(const string& name, bool val) : 
-       QCheckBox(), mVal(val), mSName(name.c_str())
-{
-       mLabel = new QLabel();
-       set(val);
-       mLabel->setText(mSName);
- }
-
-void TextCheckbox::attach(QBoxLayout* layout) {
-       QLayout* lay = new QHBoxLayout;    
-       lay->setAlignment(Qt::AlignLeft);
-       lay->addWidget(this);
-       lay->addWidget(mLabel);
-       layout->addLayout(lay);
-}
-
-void TextCheckbox::update(int val) {
-}
-
-bool TextCheckbox::get() {
-       return isChecked();
-}
-
-void TextCheckbox::set(bool v) {
-       setChecked(v);
-}
-
-
-       
-// 
**************************************************************************************
-// GUI class
-
-extern MainThread* gMainThread;
-extern GuiThread* gGuiThread;
-
-Gui::Gui() : 
-       PbClass(NULL), mGuiPtr(gGuiThread), mMainPtr(gMainThread) {     
-}
-
-void Gui::setBackgroundMesh(Mesh* m) {
-       mGuiPtr->getWindow()->setBackground(m);
-}
-void Gui::show(bool twoD) {
-       if(twoD)
-               mMainPtr->send( (int)MainWnd::EventSet2DCam );
-       mMainPtr->sendAndWait( (int)MainWnd::EventGuiShow );
-}
-void Gui::update() { 
-       updateQtGui(true, -1,-1., "");
-}
-void Gui::pause() {
-       mMainPtr->sendAndWait((int)MainWnd::EventFullUpdate);         
-       mGuiPtr->getWindow()->pause();         
-}
-void Gui::screenshot(string filename) {
-       QString s(filename.c_str());
-       QMetaObject::invokeMethod(mGuiPtr->getWindow(), "screenshot", 
Q_ARG(QString, s));    
-}
-
-void Gui::nextRealGrid() { QMetaObject::invokeMethod(mGuiPtr->getWindow(), 
"nextRealGrid" ); }
-void Gui::nextVec3Grid() { QMetaObject::invokeMethod(mGuiPtr->getWindow(), 
"nextVec3Grid" ); }
-void Gui::nextParts()    { QMetaObject::invokeMethod(mGuiPtr->getWindow(), 
"nextParts" ); }
-void Gui::nextPdata()    { QMetaObject::invokeMethod(mGuiPtr->getWindow(), 
"nextPdata" ); }
-void Gui::nextMesh()     { QMetaObject::invokeMethod(mGuiPtr->getWindow(), 
"nextMesh" ); }
-
-void Gui::nextVec3Display() { QMetaObject::invokeMethod(mGuiPtr->getWindow(), 
"nextVec3Display" ); }
-void Gui::nextPartDisplay() { QMetaObject::invokeMethod(mGuiPtr->getWindow(), 
"nextPartDisplay" ); }
-void Gui::nextMeshDisplay() { QMetaObject::invokeMethod(mGuiPtr->getWindow(), 
"nextMeshDisplay" ); }
-
-void Gui::toggleHideGrids() { QMetaObject::invokeMethod(mGuiPtr->getWindow(), 
"toggleHideGrids" ); }
-
-void Gui::setCamPos(float x, float y, float z) {
-       QMetaObject::invokeMethod(mGuiPtr->getWindow(), "setCamPos", 
Q_ARG(float, x), Q_ARG(float, y), Q_ARG(float, z));    
-}
-void Gui::setCamRot(float x, float y, float z) {
-       QMetaObject::invokeMethod(mGuiPtr->getWindow(), "setCamRot", 
Q_ARG(float, x), Q_ARG(float, y), Q_ARG(float, z));    
-}
-void Gui::windowSize(int w, int h) {
-       QMetaObject::invokeMethod(mGuiPtr->getWindow(), "windowSize", 
Q_ARG(int, w), Q_ARG(int, h));    
-}
-
-PbClass* Gui::addControl(PbType t) {
-       _args.add("nocheck",true);
-       if (t.str() == "")
-               throw Error("Need to specify object type. Use e.g. 
gui.create(Slider, ...)");
-       
-       PbClass* obj = PbClass::createPyObject(t.str(), "", _args, this);
-       if (!obj || !obj->canConvertTo("CustomControl"))
-               throw Error("gui.create() can only create CustomControl-based 
objects");
-       
-       QMetaObject::invokeMethod(gGuiThread->getWindow(), "addControl", 
Q_ARG(void*, (void*)obj));    
-       
-       return obj;
-}
-
-
-} // namespace
-
-
diff --git a/source/blender/python/manta_pp/gui/customctrl.h 
b/source/blender/python/manta_pp/gui/customctrl.h
deleted file mode 100644
index c56d408..0000000
--- a/source/blender/python/manta_pp/gui/customctrl.h
+++ /dev/null
@@ -1,153 +0,0 @@
-
-
-
-
-
-// DO NOT EDIT !
-// This file is generated using the MantaFlow preprocessor (prep generate).
-
-
-
-
-#line 1 "/Users/user/Developer/Xcode 
Projects/blenderFireIntegration/mantaflowgit/source/gui/customctrl.h"
-/******************************************************************************
- *
- * MantaFlow fluid solver framework
- * Copyright 2011 Tobias Pfaff, Nils Thuerey 
- *
- * This program is free software, distributed under the terms of the
- * GNU General Public License (GPL) 
- * http://www.gnu.org/licenses
- *
- * GUI extension from python
- *
- 
******************************************************************************/
-
-#ifndef _CUSTOMCTRL_H__
-#define _CUSTOMCTRL_H__
-
-#include <QSlider>
-#include <QLabel>
-#include <QCheckB

@@ Diff output truncated at 10240 characters. @@

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to