[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15470] branches/fluidcontrol: WIP commit to introduce channels
Daniel Genrich
daniel.genrich at gmx.net
Mon Jul 7 16:36:40 CEST 2008
Revision: 15470
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15470
Author: genscher
Date: 2008-07-07 16:36:33 +0200 (Mon, 07 Jul 2008)
Log Message:
-----------
WIP commit to introduce channels
Modified Paths:
--------------
branches/fluidcontrol/intern/elbeem/extern/elbeem.h
branches/fluidcontrol/intern/elbeem/intern/elbeem.cpp
branches/fluidcontrol/intern/elbeem/intern/ntl_geometryobject.cpp
branches/fluidcontrol/intern/elbeem/intern/ntl_geometryobject.h
branches/fluidcontrol/intern/elbeem/intern/solver_control.cpp
branches/fluidcontrol/intern/elbeem/intern/solver_init.cpp
branches/fluidcontrol/source/blender/blenkernel/intern/ipo.c
branches/fluidcontrol/source/blender/makesdna/DNA_ipo_types.h
branches/fluidcontrol/source/blender/src/editipo.c
branches/fluidcontrol/source/blender/src/editipo_lib.c
branches/fluidcontrol/source/blender/src/fluidsim.c
Modified: branches/fluidcontrol/intern/elbeem/extern/elbeem.h
===================================================================
--- branches/fluidcontrol/intern/elbeem/extern/elbeem.h 2008-07-07 13:57:29 UTC (rev 15469)
+++ branches/fluidcontrol/intern/elbeem/extern/elbeem.h 2008-07-07 14:36:33 UTC (rev 15470)
@@ -163,11 +163,14 @@
float cpsTimeStart;
float cpsTimeEnd;
- // TODO dg: change to channels
- float attractforceStrength;
- float attractforceRadius;
- float velocityforceStrength;
- float velocityforceRadius;
+ int channelSizeAttractforceStrength;
+ float *channelAttractforceStrength;
+ int channelSizeAttractforceRadius;
+ float *channelAttractforceRadius;
+ int channelSizeVelocityforceStrength;
+ float *channelVelocityforceStrength;
+ int channelSizeVelocityforceRadius;
+ float *channelVelocityforceRadius;
} elbeemMesh;
// API functions
Modified: branches/fluidcontrol/intern/elbeem/intern/elbeem.cpp
===================================================================
--- branches/fluidcontrol/intern/elbeem/intern/elbeem.cpp 2008-07-07 13:57:29 UTC (rev 15469)
+++ branches/fluidcontrol/intern/elbeem/intern/elbeem.cpp 2008-07-07 14:36:33 UTC (rev 15470)
@@ -164,10 +164,14 @@
mesh->cpsTimeStart = 0;
mesh->cpsTimeEnd = 0;
- mesh->attractforceStrength = 0;
- mesh->attractforceRadius = 0;
- mesh->velocityforceStrength = 0;
- mesh->velocityforceRadius = 0;
+ mesh->channelSizeAttractforceStrength = 0;
+ mesh->channelAttractforceStrength = NULL;
+ mesh->channelSizeAttractforceRadius = 0;
+ mesh->channelAttractforceRadius = NULL;
+ mesh->channelSizeVelocityforceStrength = 0;
+ mesh->channelVelocityforceStrength = NULL;
+ mesh->channelSizeVelocityforceRadius = 0;
+ mesh->channelVelocityforceRadius = NULL;
}
int globalMeshCounter = 1;
@@ -211,10 +215,6 @@
/* fluid control features */
obj->setCpsTimeStart(mesh->cpsTimeStart);
obj->setCpsTimeEnd(mesh->cpsTimeEnd);
- obj->setAttractForceStrength(mesh->attractforceStrength);
- obj->setAttractForceRadius(mesh->attractforceRadius);
- obj->setVelocityForceStrength(mesh->velocityforceStrength);
- obj->setVelocityForceRadius(mesh->velocityforceRadius);
if((mesh->volumeInitType<VOLUMEINIT_VOLUME)||(mesh->volumeInitType>VOLUMEINIT_BOTH)) mesh->volumeInitType = VOLUMEINIT_VOLUME;
obj->setVolumeInit(mesh->volumeInitType);
@@ -224,7 +224,11 @@
mesh->channelSizeRotation, mesh->channelRotation,
mesh->channelSizeScale, mesh->channelScale,
mesh->channelSizeActive, mesh->channelActive,
- mesh->channelSizeInitialVel, mesh->channelInitialVel
+ mesh->channelSizeInitialVel, mesh->channelInitialVel,
+ mesh->channelSizeAttractforceStrength, mesh->channelAttractforceStrength,
+ mesh->channelSizeAttractforceRadius, mesh->channelAttractforceRadius,
+ mesh->channelSizeVelocityforceStrength, mesh->channelVelocityforceStrength,
+ mesh->channelSizeVelocityforceRadius, mesh->channelVelocityforceRadius
);
obj->setLocalCoordInivel( mesh->localInivelCoords );
Modified: branches/fluidcontrol/intern/elbeem/intern/ntl_geometryobject.cpp
===================================================================
--- branches/fluidcontrol/intern/elbeem/intern/ntl_geometryobject.cpp 2008-07-07 13:57:29 UTC (rev 15469)
+++ branches/fluidcontrol/intern/elbeem/intern/ntl_geometryobject.cpp 2008-07-07 14:36:33 UTC (rev 15470)
@@ -41,7 +41,8 @@
mCachedMovPoints(), mCachedMovNormals(),
mTriangleDivs1(), mTriangleDivs2(), mTriangleDivs3(),
mMovPntsInited(-100.0), mMaxMovPnt(-1),
- mcGeoActive(1.)
+ mcGeoActive(1.),
+ mcAttrFStr(0.),mcAttrFRad(0.), mcVelFStr(0.), mcVelFRad(0.)
{
};
@@ -331,7 +332,11 @@
void ntlGeometryObject::initChannels(
int nTrans, float *trans, int nRot, float *rot, int nScale, float *scale,
- int nAct, float *act, int nIvel, float *ivel
+ int nAct, float *act, int nIvel, float *ivel,
+ int nAttrFStr, float *attrFStr,
+ int nAttrFRad, float *attrFRad,
+ int nVelFStr, float *velFStr,
+ int nVelFRad, float *velFRad
) {
const bool debugInitc=true;
if(debugInitc) { debMsgStd("ntlGeometryObject::initChannels",DM_MSG,"nt:"<<nTrans<<" nr:"<<nRot<<" ns:"<<nScale, 10);
@@ -344,6 +349,12 @@
if((scale)&&(nScale>0)) { ADD_CHANNEL_VEC(mcScale, nScale, scale); }
if((act)&&(nAct>0)) { ADD_CHANNEL_FLOAT(mcGeoActive, nAct, act); }
if((ivel)&&(nIvel>0)) { ADD_CHANNEL_VEC(mcInitialVelocity, nIvel, ivel); }
+
+ /* fluid control channels */
+ if((attrFStr)&&(nAttrFStr>0)) { printf("added!\n"); ADD_CHANNEL_FLOAT(mcAttrFStr, nAttrFStr, attrFStr); }
+ if((attrFRad)&&(nAttrFRad>0)) { ADD_CHANNEL_FLOAT(mcAttrFRad, nAttrFRad, attrFRad); }
+ if((velFStr)&&(nVelFStr>0)) { ADD_CHANNEL_FLOAT(mcVelFStr, nAct, velFStr); }
+ if((velFRad)&&(nVelFRad>0)) { ADD_CHANNEL_FLOAT(mcVelFRad, nVelFRad, velFRad); }
checkIsAnimated();
@@ -567,7 +578,7 @@
}
}
- if( (this-getMeshAnimated())
+ if( (this->getMeshAnimated())
|| (mcTrans.accessValues().size()>1) // VALIDATE
|| (mcRot.accessValues().size()>1)
|| (mcScale.accessValues().size()>1)
Modified: branches/fluidcontrol/intern/elbeem/intern/ntl_geometryobject.h
===================================================================
--- branches/fluidcontrol/intern/elbeem/intern/ntl_geometryobject.h 2008-07-07 13:57:29 UTC (rev 15469)
+++ branches/fluidcontrol/intern/elbeem/intern/ntl_geometryobject.h 2008-07-07 14:36:33 UTC (rev 15470)
@@ -109,28 +109,21 @@
inline float getCpsTimeEnd() const { return mCpsTimeEnd; }
inline void setCpsTimeEnd(float set) { mCpsTimeEnd=set; }
- /*! Set/get the particle control set attract force strength */
- inline float getAttractForceStrength() const { return mAttractforceStrength; }
- inline void setAttractForceStrength(float set) { mAttractforceStrength=set; }
+ inline AnimChannel<float> getCpsAttrFStr() const { return mcAttrFStr; }
+ inline AnimChannel<float> getCpsAttrFRad() const { return mcAttrFRad; }
+ inline AnimChannel<float> getCpsVelFStr() const { return mcVelFStr; }
+ inline AnimChannel<float> getCpsVelFRad() const { return mcVelFRad; }
- /*! Set/get the particle control set attract force radius */
- inline float getAttractForceRadius() const { return mAttractforceRadius; }
- inline void setAttractForceRadius(float set) { mAttractforceRadius=set; }
-
- /*! Set/get the particle control set velocity force strength */
- inline float getVelocityForceStrength() const { return mVelocityforceStrength; }
- inline void setVelocityForceStrength(float set) { mVelocityforceStrength=set; }
-
- /*! Set/get the particle control set velocity force radius */
- inline float getVelocityForceRadius() const { return mVelocityforceRadius; }
- inline void setVelocityForceRadius(float set) { mVelocityforceRadius=set; }
-
/****************************************/
/*! Init channels from float arrays (for elbeem API) */
void initChannels(
int nTrans, float *trans, int nRot, float *rot, int nScale, float *scale,
- int nAct, float *act, int nIvel, float *ivel
+ int nAct, float *act, int nIvel, float *ivel,
+ int nAttrFStr, float *attrFStr,
+ int nAttrFRad, float *attrFRad,
+ int nVelFStr, float *velFStr,
+ int nVelFRad, float *velFRad
);
/*! is the object animated? */
@@ -234,13 +227,8 @@
/* fluid control settings */
float mCpsTimeStart;
- float mCpsTimeEnd
- ;
- // TODO dg: change to channels
- float mAttractforceStrength;
- float mAttractforceRadius;
- float mVelocityforceStrength;
- float mVelocityforceRadius;
+ float mCpsTimeEnd;
+ AnimChannel<float> mcAttrFStr, mcAttrFRad, mcVelFStr, mcVelFRad;
public:
Modified: branches/fluidcontrol/intern/elbeem/intern/solver_control.cpp
===================================================================
--- branches/fluidcontrol/intern/elbeem/intern/solver_control.cpp 2008-07-07 13:57:29 UTC (rev 15469)
+++ branches/fluidcontrol/intern/elbeem/intern/solver_control.cpp 2008-07-07 14:36:33 UTC (rev 15470)
@@ -234,10 +234,10 @@
cset->mContrPartFile = string("");
// TODO dg: switch to channels later
- cset->mcForceAtt = AnimChannel<float>(obj->getAttractForceStrength());
- cset->mcRadiusAtt = AnimChannel<float>(obj->getAttractForceRadius());
- cset->mcForceVel = AnimChannel<float>(obj->getVelocityForceStrength());
- cset->mcRadiusVel = AnimChannel<float>(obj->getVelocityForceRadius());
+ cset->mcForceAtt = obj->getCpsAttrFStr();
+ cset->mcRadiusAtt = obj->getCpsAttrFRad();
+ cset->mcForceVel = obj->getCpsVelFStr();
+ cset->mcRadiusVel = obj->getCpsVelFRad();
cset->mCparts->setCPSTimeStart(obj->getCpsTimeStart());
cset->mCparts->setCPSTimeEnd(obj->getCpsTimeEnd());
Modified: branches/fluidcontrol/intern/elbeem/intern/solver_init.cpp
===================================================================
--- branches/fluidcontrol/intern/elbeem/intern/solver_init.cpp 2008-07-07 13:57:29 UTC (rev 15469)
+++ branches/fluidcontrol/intern/elbeem/intern/solver_init.cpp 2008-07-07 14:36:33 UTC (rev 15470)
@@ -696,16 +696,16 @@
// restrict max. chunk of 1 mem block to 1GB for windos
bool memBlockAllocProblem = false;
- double maxWinMemChunk = 1100.*1024.*1024.;
- double maxMacMemChunk = 1200.*1024.*1024.;
double maxDefaultMemChunk = 2.*1024.*1024.*1024.;
//std::cerr<<" memEstFine "<< memEstFine <<" maxWin:" <<maxWinMemChunk <<" maxMac:" <<maxMacMemChunk ; // DEBUG
#ifdef WIN32
+ double maxWinMemChunk = 1100.*1024.*1024.;
if(memEstFine> maxWinMemChunk) {
memBlockAllocProblem = true;
}
#endif // WIN32
#ifdef __APPLE__
+ double maxMacMemChunk = 1200.*1024.*1024.;
if(memEstFine> maxMacMemChunk) {
memBlockAllocProblem = true;
}
Modified: branches/fluidcontrol/source/blender/blenkernel/intern/ipo.c
===================================================================
--- branches/fluidcontrol/source/blender/blenkernel/intern/ipo.c 2008-07-07 13:57:29 UTC (rev 15469)
+++ branches/fluidcontrol/source/blender/blenkernel/intern/ipo.c 2008-07-07 14:36:33 UTC (rev 15470)
@@ -175,7 +175,9 @@
FLUIDSIM_VISC, FLUIDSIM_TIME,
FLUIDSIM_GRAV_X , FLUIDSIM_GRAV_Y , FLUIDSIM_GRAV_Z ,
FLUIDSIM_VEL_X , FLUIDSIM_VEL_Y , FLUIDSIM_VEL_Z ,
- FLUIDSIM_ACTIVE
+ FLUIDSIM_ACTIVE,
+ FLUIDSIM_ATTR_FORCE_STR, FLUIDSIM_ATTR_FORCE_RADIUS,
+ FLUIDSIM_VEL_FORCE_STR, FLUIDSIM_VEL_FORCE_RADIUS,
};
int part_ar[PART_TOTIPO]= {
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list