Commit: f2206deadd237c8181db54bb8dd5ceb158282b46
Author: Sebastián Barschkis
Date:   Fri Mar 18 09:06:56 2016 +0100
Branches: fluid-mantaflow
https://developer.blender.org/rBf2206deadd237c8181db54bb8dd5ceb158282b46

fixing script export and small cleanups

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

M       intern/mantaflow/intern/MANTA.cpp
D       intern/mantaflow/intern/VEC3.h

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

diff --git a/intern/mantaflow/intern/MANTA.cpp 
b/intern/mantaflow/intern/MANTA.cpp
index 0815393..d0d1011 100644
--- a/intern/mantaflow/intern/MANTA.cpp
+++ b/intern/mantaflow/intern/MANTA.cpp
@@ -299,7 +299,7 @@ void MANTA::startMantaflow()
        // Initialize extension classes and wrappers
        srand(0);
        PyGILState_STATE gilstate = PyGILState_Ensure();
-       Pb::setup(filename, fill);
+       Pb::setup(filename, fill);  // Namespace from Mantaflow (registry)
        PyGILState_Release(gilstate);
        mantaInitialized = true;
 }
@@ -498,18 +498,21 @@ void MANTA::exportScript(SmokeModifierData *smd)
        // Inflow High
        // TODO
        
-       // Step low
+       // Step low functions
        manta_script += smoke_step_low;
        
-       // Step high
+       // Step high functions
        if (smd->domain->flags & MOD_SMOKE_HIGHRES) {
                manta_script += smoke_step_high;
        }
        
+       // Step wrapper function
+       manta_script += manta_step;
+       
        // Fill in missing variables in script
        std::string final_script = MANTA::parseScript(manta_script, smd);
        
-       // Add standalone mode (for-loop, gui, ...)
+       // Add standalone mode (loop, gui, ...)
        final_script += standalone;
        
        // Write script
diff --git a/intern/mantaflow/intern/VEC3.h b/intern/mantaflow/intern/VEC3.h
deleted file mode 100644
index dafe5e5..0000000
--- a/intern/mantaflow/intern/VEC3.h
+++ /dev/null
@@ -1,989 +0,0 @@
-/** \file smoke/intern/VEC3.h
- *  \ingroup smoke
- */
-/******************************************************************************
- * Copyright 2007 Nils Thuerey
- * Basic vector class 
- *****************************************************************************/
-#ifndef BASICVECTOR_H
-#define BASICVECTOR_H
-
-#include <math.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <iostream>
-#include <sstream>
-
-// use which fp-precision? 1=float, 2=double
-#ifndef FLOATINGPOINT_PRECISION
-#if DDF_DEBUG==1
-#define FLOATINGPOINT_PRECISION 2
-#else // DDF_DEBUG==1
-#define FLOATINGPOINT_PRECISION 1
-#endif // DDF_DEBUG==1
-#endif
-
-// VECTOR_EPSILON is the minimal vector length
-// In order to be able to discriminate floating point values near zero, and
-// to be sure not to fail a comparison because of roundoff errors, use this
-// value as a threshold.  
-
-#if FLOATINGPOINT_PRECISION==1
-typedef float Real;
-#define FP_REAL_MAX __FLT_MAX__
-#define VECTOR_EPSILON (1e-5f)
-#else
-typedef double Real;
-#define FP_REAL_MAX __DBL_MAX__
-#define VECTOR_EPSILON (1e-10)
-#endif
-
-
-// hardcoded limits for now...
-// for e.g. MSVC compiler...
-// some of these defines can be needed
-// for linux systems as well (e.g. FLT_MAX)
-#ifndef __FLT_MAX__
-#      ifdef FLT_MAX  // try to use it instead
-#              define __FLT_MAX__ FLT_MAX
-#      else // FLT_MAX
-#              define __FLT_MAX__ 3.402823466e+38f
-#      endif // FLT_MAX
-#endif // __FLT_MAX__
-#ifndef __DBL_MAX__
-#      ifdef DBL_MAX // try to use it instead
-#              define __DBL_MAX__ DBL_MAX
-#      else // DBL_MAX
-#              define __DBL_MAX__ 1.7976931348623158e+308
-#      endif // DBL_MAX
-#endif // __DBL_MAX__
-
-#ifndef FLT_MAX
-#define FLT_MAX __FLT_MAX__
-#endif
-
-#ifndef DBL_MAX
-#define DBL_MAX __DBL_MAX__
-#endif
-
-#ifndef M_PI
-#      define M_PI 3.1415926536
-#      define M_E  2.7182818284
-#endif
-
-
-
-namespace BasicVector {
-
-
-// basic inlined vector class
-template<class Scalar>
-class Vector3Dim
-{
-public:
-  // Constructor
-  inline Vector3Dim();
-  // Copy-Constructor
-  inline Vector3Dim(const Vector3Dim<Scalar> &v );
-  inline Vector3Dim(const float *);
-  inline Vector3Dim(const double *);
-  // construct a vector from one Scalar
-  inline Vector3Dim(Scalar);
-  // construct a vector from three Scalars
-  inline Vector3Dim(Scalar, Scalar, Scalar);
-
-       // get address of array for OpenGL
-       Scalar *getAddress() { return value; }
-
-  // Assignment operator
-  inline const Vector3Dim<Scalar>& operator=  (const Vector3Dim<Scalar>& v);
-  // Assignment operator
-  inline const Vector3Dim<Scalar>& operator=  (Scalar s);
-  // Assign and add operator
-  inline const Vector3Dim<Scalar>& operator+= (const Vector3Dim<Scalar>& v);
-  // Assign and add operator
-  inline const Vector3Dim<Scalar>& operator+= (Scalar s);
-  // Assign and sub operator
-  inline const Vector3Dim<Scalar>& operator-= (const Vector3Dim<Scalar>& v);
-  // Assign and sub operator
-  inline const Vector3Dim<Scalar>& operator-= (Scalar s);
-  // Assign and mult operator
-  inline const Vector3Dim<Scalar>& operator*= (const Vector3Dim<Scalar>& v);
-  // Assign and mult operator
-  inline const Vector3Dim<Scalar>& operator*= (Scalar s);
-  // Assign and div operator
-  inline const Vector3Dim<Scalar>& operator/= (const Vector3Dim<Scalar>& v);
-  // Assign and div operator
-  inline const Vector3Dim<Scalar>& operator/= (Scalar s);
-
-
-  // unary operator
-  inline Vector3Dim<Scalar> operator- () const;
-
-  // binary operator add
-  inline Vector3Dim<Scalar> operator+ (const Vector3Dim<Scalar>&) const;
-  // binary operator add
-  inline Vector3Dim<Scalar> operator+ (Scalar) const;
-  // binary operator sub
-  inline Vector3Dim<Scalar> operator- (const Vector3Dim<Scalar>&) const;
-  // binary operator sub
-  inline Vector3Dim<Scalar> operator- (Scalar) const;
-  // binary operator mult
-  inline Vector3Dim<Scalar> operator* (const Vector3Dim<Scalar>&) const;
-  // binary operator mult
-  inline Vector3Dim<Scalar> operator* (Scalar) const;
-  // binary operator div
-  inline Vector3Dim<Scalar> operator/ (const Vector3Dim<Scalar>&) const;
-  // binary operator div
-  inline Vector3Dim<Scalar> operator/ (Scalar) const;
-
-  // Projection normal to a vector
-  inline Vector3Dim<Scalar>      getOrthogonalntlVector3Dim() const;
-  // Project into a plane
-  inline const Vector3Dim<Scalar>& projectNormalTo(const Vector3Dim<Scalar> 
&v);
-  
-  // minimize
-  inline const Vector3Dim<Scalar> &minimize(const Vector3Dim<Scalar> &);
-  // maximize
-  inline const Vector3Dim<Scalar> &maximize(const Vector3Dim<Scalar> &);
-  
-  // access operator
-  inline Scalar& operator[](unsigned int i);
-  // access operator
-  inline const Scalar& operator[](unsigned int i) const;
-
-       //! actual values
-       union {
-               struct {
-               Scalar value[3];  
-               };
-               struct {
-               Scalar x;
-               Scalar y;
-               Scalar z;
-               };
-               struct {
-               Scalar X;
-               Scalar Y;
-               Scalar Z;
-               };
-       };
-protected:
-  
-};
-
-
-
-
-
-//------------------------------------------------------------------------------
-// VECTOR inline FUNCTIONS
-//------------------------------------------------------------------------------
-
-
-
-/*************************************************************************
-  Constructor.
-  */
-template<class Scalar>
-inline Vector3Dim<Scalar>::Vector3Dim( void )
-{
-  value[0] = value[1] = value[2] = 0;
-}
-
-
-
-/*************************************************************************
-  Copy-Constructor.
-  */
-template<class Scalar>
-inline Vector3Dim<Scalar>::Vector3Dim( const Vector3Dim<Scalar> &v )
-{
-  value[0] = v.value[0];
-  value[1] = v.value[1];
-  value[2] = v.value[2];
-}
-template<class Scalar>
-inline Vector3Dim<Scalar>::Vector3Dim( const float *fvalue)
-{
-  value[0] = (Scalar)fvalue[0];
-  value[1] = (Scalar)fvalue[1];
-  value[2] = (Scalar)fvalue[2];
-}
-template<class Scalar>
-inline Vector3Dim<Scalar>::Vector3Dim( const double *fvalue)
-{
-  value[0] = (Scalar)fvalue[0];
-  value[1] = (Scalar)fvalue[1];
-  value[2] = (Scalar)fvalue[2];
-}
-
-
-
-/*************************************************************************
-  Constructor for a vector from a single Scalar. All components of
-  the vector get the same value.
-  \param s The value to set
-  \return The new vector
-  */
-template<class Scalar>
-inline Vector3Dim<Scalar>::Vector3Dim(Scalar s )
-{
-  value[0]= s;
-  value[1]= s;
-  value[2]= s;
-}
-
-
-/*************************************************************************
-  Constructor for a vector from three Scalars.
-  \param s1 The value for the first vector component
-  \param s2 The value for the second vector component
-  \param s3 The value for the third vector component
-  \return The new vector
-  */
-template<class Scalar>
-inline Vector3Dim<Scalar>::Vector3Dim(Scalar s1, Scalar s2, Scalar s3)
-{
-  value[0]= s1;
-  value[1]= s2;
-  value[2]= s3;
-}
-
-
-
-/*************************************************************************
-  Copy a Vector3Dim componentwise.
-  \param v vector with values to be copied
-  \return Reference to self
-  */
-template<class Scalar>
-inline const Vector3Dim<Scalar>&
-Vector3Dim<Scalar>::operator=( const Vector3Dim<Scalar> &v )
-{
-  value[0] = v.value[0];
-  value[1] = v.value[1];
-  value[2] = v.value[2];  
-  return *this;
-}
-
-
-/*************************************************************************
-  Copy a Scalar to each component.
-  \param s The value to copy
-  \return Reference to self
-  */
-template<class Scalar>
-inline const Vector3Dim<Scalar>&
-Vector3Dim<Scalar>::operator=(Scalar s)
-{
-  value[0] = s;
-  value[1] = s;
-  value[2] = s;  
-  return *this;
-}
-
-
-/*************************************************************************
-  Add another Vector3Dim componentwise.
-  \param v vector with values to be added
-  \return Reference to self
-  */
-template<class Scalar>
-inline const Vector3Dim<Scalar>&
-Vector3Dim<Scalar>::operator+=( const Vector3Dim<Scalar> &v )
-{
-  value[0] += v.value[0];
-  value[1] += v.value[1];
-  value[2] += v.value[2];  
-  return *this;
-}
-
-
-/*************************************************************************
-  Add a Scalar value to each component.
-  \param s Value to add
-  \return Reference to self
-  */
-template<class Scalar>
-inline const Vector3Dim<Scalar>&
-Vector3Dim<Scalar>::operator+=(Scalar s)
-{
-  value[0] += s;
-  value[1] += s;
-  value[2] += s;  
-  return *this;
-}
-
-
-/*************************************************************************
-  Subtract another vector componentwise.
-  \param v vector of values to subtract
-  \return Reference to self
-  */
-template<class Scalar>
-inline const Vector3Dim<Scalar>&
-Vector3Dim<Scalar>::operator-=( const Vector3Dim<Scalar> &v )
-{
-  value[0] -= v.value[0];
-  value[1] -= v.value[1];
-  value[2] -= v.value[2];  
-  return *this;
-}
-
-
-/*******************************

@@ 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