Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ FixedProjectiveConstraint<DataTypes>::FixedProjectiveConstraint()
, d_drawSize( initData(&d_drawSize,(SReal)0.0,"drawSize","Size of the rendered particles (0 -> point based rendering, >0 -> radius of spheres)") )
, d_projectVelocity( initData(&d_projectVelocity,false,"activate_projectVelocity","if true, projects not only a constant but a zero velocity") )
, l_topology(initLink("topology", "link to the topology container"))
, data(std::unique_ptr<FixedProjectiveConstraintInternalData<DataTypes>>())
, data(std::make_unique<FixedProjectiveConstraintInternalData<DataTypes>>())
{
// default to indice 0
d_indices.beginEdit()->push_back(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace sofa::component::constraint::projective
template <class DataTypes>
LinearMovementProjectiveConstraint<DataTypes>::LinearMovementProjectiveConstraint()
: core::behavior::ProjectiveConstraintSet<DataTypes>(nullptr)
, data(std::unique_ptr<LinearMovementProjectiveConstraintInternalData<DataTypes>>())
, data(std::make_unique<LinearMovementProjectiveConstraintInternalData<DataTypes>>())
, d_indices(initData(&d_indices, "indices", "Indices of the constrained points") )
, d_keyTimes(initData(&d_keyTimes, "keyTimes", "key times for the movements") )
, d_keyMovements(initData(&d_keyMovements, "movements", "movements corresponding to the key times") )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace sofa::component::constraint::projective
template <class DataTypes>
PatchTestMovementProjectiveConstraint<DataTypes>::PatchTestMovementProjectiveConstraint()
: core::behavior::ProjectiveConstraintSet<DataTypes>(nullptr)
, data(std::unique_ptr<PatchTestMovementProjectiveConstraintInternalData<DataTypes>>())
, data(std::make_unique<PatchTestMovementProjectiveConstraintInternalData<DataTypes>>())
, d_meshIndices( initData(&d_meshIndices,"meshIndices","Indices of the mesh") )
, d_indices( initData(&d_indices,"indices","Indices of the constrained points") )
, d_beginConstraintTime( initData(&d_beginConstraintTime,"beginConstraintTime","Begin time of the bilinear constraint") )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ PlaneProjectiveConstraint<DataTypes>::PlaneProjectiveConstraint()
, d_normal( initData(&d_normal,CPos(),"normal","Normal vector to the plane"))
, d_drawSize( initData(&d_drawSize,(SReal)0.0,"drawSize","Size of the rendered particles (0 -> point based rendering, >0 -> radius of spheres)") )
, l_topology(initLink("topology", "link to the topology container"))
, data(std::unique_ptr<PlaneProjectiveConstraintInternalData<DataTypes>>())
, data(std::make_unique<PlaneProjectiveConstraintInternalData<DataTypes>>())
{
d_indices.beginEdit()->push_back(0);
d_indices.endEdit();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ PointProjectiveConstraint<DataTypes>::PointProjectiveConstraint()
, d_fixAll( initData(&d_fixAll,false,"fixAll","filter all the DOF to implement a fixed object") )
, d_drawSize( initData(&d_drawSize,(SReal)0.0,"drawSize","Size of the rendered particles (0 -> point based rendering, >0 -> radius of spheres)") )
, l_topology(initLink("topology", "link to the topology container"))
, data(std::unique_ptr<PointProjectiveConstraintInternalData<DataTypes>>())
, data(std::make_unique<PointProjectiveConstraintInternalData<DataTypes>>())
{
d_indices.beginEdit()->push_back(0);
d_indices.endEdit();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ using namespace gpu::cuda;
template<class TCoord, class TDeriv, class TReal>
void FixedProjectiveConstraintInternalData< gpu::cuda::CudaVectorTypes<TCoord,TDeriv,TReal> >::init(Main* m)
{
assert(m != nullptr);
assert(m->data != nullptr);

Data& data = *m->data;
data.minIndex = sofa::InvalidID;
data.maxIndex = sofa::InvalidID;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ void LinearMovementProjectiveConstraintInternalData< gpu::cuda::CudaVectorTypes<
template<class TCoord, class TDeriv, class TReal>
void LinearMovementProjectiveConstraintInternalData< gpu::cuda::CudaVectorTypes<TCoord,TDeriv,TReal> >::init(Main* m, VecCoord& x)
{
assert(m != nullptr);
assert(m->data != nullptr);

Data& data = *m->data;
const SetIndexArray & indices = m->m_indices.getValue();
// m->x0.resize( indices.size() );
Expand Down