Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SofaSphFluid] Clean, Fix, Update ParticleSink #1195

Merged
merged 11 commits into from
Oct 31, 2019
Prev Previous commit
Next Next commit
[SofaSphFluid] Clean define macro and extern template declaration of …
…ParticleSink
  • Loading branch information
epernod committed Oct 25, 2019
commit 4f5e12992fba0307ac6c69966640038e9462bddc
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
* *
* Contact information: contact@sofa-framework.org *
******************************************************************************/
#define SOFA_COMPONENT_MISC_PARTICLESINK_CPP
#include <SofaSphFluid/ParticleSink.inl>
#include <sofa/core/ObjectFactory.h>
#include <sofa/defaulttype/VecTypes.h>
#include "sofa/defaulttype/VecTypes.h"

namespace sofa
{
Expand All @@ -36,9 +36,13 @@ namespace misc
int ParticleSinkClass = core::RegisterObject("Parametrable particle generator")
.add< ParticleSink<defaulttype::Vec3Types> >()
.add< ParticleSink<defaulttype::Vec2Types> >()

;

template class SOFA_SPH_FLUID_API ParticleSink<defaulttype::Vec3Types>;
template class SOFA_SPH_FLUID_API ParticleSink<defaulttype::Vec2Types>;

}

}

}
21 changes: 8 additions & 13 deletions applications/plugins/SofaSphFluid/src/SofaSphFluid/ParticleSink.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,9 @@
* *
* Contact information: contact@sofa-framework.org *
******************************************************************************/
//
// C++ Interface: ParticleSink
//
// Description:
//
//
// Author: Jeremie Allard, (C) 2008
//
// Copyright: See COPYING file that comes with this distribution
//
//
#ifndef SOFA_COMPONENT_MISC_PARTICLESINK_H
#define SOFA_COMPONENT_MISC_PARTICLESINK_H

#include <SofaSphFluid/config.h>

#include <sofa/helper/system/config.h>
Expand Down Expand Up @@ -131,11 +121,16 @@ class ParticleSink : public core::behavior::ProjectiveConstraintSet<TDataTypes>
void draw(const core::visual::VisualParams* vparams) override;
};

}
#if !defined(SOFA_COMPONENT_MISC_PARTICLESINK_CPP)
extern template class SOFA_SPH_FLUID_API ParticleSink<sofa::defaulttype::Vec3Types>;
extern template class SOFA_SPH_FLUID_API ParticleSink<sofa::defaulttype::Vec2Types>;
#endif

} // namespace misc

} // namespace component

} // namespace sofa

#endif
#endif // SOFA_COMPONENT_MISC_PARTICLESINK_H

Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,11 @@ void ParticleSink<DataTypes>::draw(const core::visual::VisualParams* vparams)
vparams->drawTool()->restoreLastState();
}

}
} // namespace misc

} // namespace component

} // namespace sofa

#endif
#endif // SOFA_COMPONENT_MISC_PARTICLESINK_INL