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

[all] Use drawtool everywhere #704

Merged
merged 24 commits into from
Aug 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
4aacbfb
UPDATE: Use DrawTools...
fredroy Jun 20, 2018
12de07b
UPDATE: Use DrawTools...
fredroy Jun 20, 2018
c014d3e
Update drawTools for PlaneForceField, RayTraceDetection, RemovePrimit…
hugtalbot Jun 21, 2018
a6d6fe4
UPDATE: Use DrawTools...
fredroy Jun 21, 2018
4b0a72e
Update drawTools in SofaUserInteraction SofaMiscMapping SofaMiscForce…
hugtalbot Jun 21, 2018
998a44e
UPDATE: Use DrawTools...
fredroy Jun 21, 2018
153e41a
UPDATE: Use DrawTools...
fredroy Jun 21, 2018
a938a92
UPDATE: Use DrawTools...
fredroy Jun 21, 2018
7ce2120
UPDATE: Use DrawTools...
fredroy Jun 21, 2018
294becc
Implementation of new classes in drawTool
hugtalbot Jun 21, 2018
91e54a7
Update with drawTools in SofaGeneralObjectInteraction, SofaGeneralRig…
hugtalbot Jun 21, 2018
84607bb
UPDATE: Use DrawTools...
fredroy Jun 21, 2018
d425fa1
UPDATE: Use DrawTools...
fredroy Jun 22, 2018
8e2ae17
UPDATE: Use DrawTools...
fredroy Jun 22, 2018
7e7f55b
UPDATE: Use DrawTools...
fredroy Jun 22, 2018
09abc82
UPDATE: Use DrawTools...
fredroy Jun 22, 2018
fcf55ab
DrawTool: use only std::vector for draw3dText (instead of helper:::ve…
fredroy Jun 22, 2018
b030405
FIX compilation and update drawTools in SPHFluid
hugtalbot Jun 28, 2018
5b7966c
merge with master
hugtalbot Jun 28, 2018
ae0c2a6
Minor changes further to review
hugtalbot Jul 13, 2018
7067e4b
Merge remote-tracking branch 'sofa-framework/master' into use_drawtoo…
guparan Jul 19, 2018
d2fd7d9
Merge remote-tracking branch 'upstream' into use_drawtool_everywhere
hugtalbot Jul 31, 2018
c6b2fef
Fix test failing PlaneForceField due to removed data
hugtalbot Jul 31, 2018
2686575
FIX test due to change of name color into planeColor
hugtalbot Aug 1, 2018
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
9 changes: 5 additions & 4 deletions SofaKernel/framework/sofa/core/visual/DrawTool.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ class SOFA_CORE_API DrawTool
const std::vector< Vec3i > &index,
const std::vector<Vector3> &normal,
const Vec4f& colour) = 0 ;
virtual void drawTriangles(const std::vector<Vector3> &points,
const std::vector< Vec4f > &colour) = 0 ;
virtual void drawTriangles(const std::vector<Vector3> &points,
const std::vector<Vector3> &normal,
const std::vector< Vec4f > &colour) = 0 ;

virtual void drawTriangleStrip(const std::vector<Vector3> &points,
const std::vector<Vector3> &normal,
const Vec4f& colour) = 0 ;

virtual void drawTriangleFan(const std::vector<Vector3> &points,
const std::vector<Vector3> &normal,
const Vec4f& colour) = 0 ;
Expand Down Expand Up @@ -144,6 +144,7 @@ class SOFA_CORE_API DrawTool
const Vector3 &normal1, const Vector3 &normal2, const Vector3 &normal3, const Vector3 &normal4,
const Vec4f &c1, const Vec4f &c2, const Vec4f &c3, const Vec4f &c4) = 0 ;
virtual void drawQuads(const std::vector<Vector3> &points, const Vec4f& colour) = 0 ;
virtual void drawQuads(const std::vector<Vector3> &points, const std::vector<Vec4f>& colours) = 0 ;

virtual void drawTetrahedron(const Vector3 &p0, const Vector3 &p1, const Vector3 &p2, const Vector3 &p3, const Vec4f &colour) = 0 ;
virtual void drawTetrahedra(const std::vector<Vector3> &points, const Vec4f& colour) = 0;
Expand All @@ -159,10 +160,10 @@ class SOFA_CORE_API DrawTool
virtual void drawSphere( const Vector3 &p, float radius) = 0 ;
virtual void drawEllipsoid(const Vector3 &p, const Vector3 &radii) = 0;

virtual void drawBoundingBox( const Vector3 &min, const Vector3 &max ) = 0;
virtual void drawBoundingBox( const Vector3 &min, const Vector3 &max, float size = 1.0 ) = 0;

virtual void draw3DText(const Vector3 &p, float scale, const Vec4f &color, const char* text) = 0;
virtual void draw3DText_Indices(const helper::vector<Vector3> &positions, float scale, const Vec4f &color) = 0;
virtual void draw3DText_Indices(const std::vector<Vector3> &positions, float scale, const Vec4f &color) = 0;
/// @}

/// @name Transformation methods.
Expand Down
42 changes: 40 additions & 2 deletions SofaKernel/framework/sofa/core/visual/DrawToolGL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,13 @@ void DrawToolGL::drawTriangles(const std::vector<Vector3> &points, const Vec<4,f
resetMaterial(colour);
}

void DrawToolGL::drawTriangles(const std::vector<Vector3> &points, const std::vector< Vec4f > &colour)
{
std::vector<Vector3> normal;
normal.clear();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This means that if the normal is empty it does nothing ?
Maybe add some comment to explain the logic the declaration of drawTriangles()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, actually if you look closer, this function creates a vector of normals and then calls another function (l. 277) that computes normals if the vector has a null size

this->drawTriangles(points,normal,colour);
}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

void DrawToolGL::drawTriangles(const std::vector<Vector3> &points, const Vector3& normal, const Vec<4,float>& colour)
Expand Down Expand Up @@ -859,6 +866,35 @@ void DrawToolGL::drawQuads(const std::vector<Vector3> &points, const Vec4f& colo
resetMaterial(colour);
}

void DrawToolGL::drawQuads(const std::vector<Vector3> &points, const std::vector<Vec4f>& colours)
{
glBegin(GL_QUADS);
{
for (unsigned int i=0; i<points.size()/4; ++i)
{
const Vector3& a = points[ 4*i+0 ];
const Vector3& b = points[ 4*i+1 ];
const Vector3& c = points[ 4*i+2 ];
const Vector3& d = points[ 4*i+3 ];

const Vec4f& col_a = colours[ 4*i+0 ];
const Vec4f& col_b = colours[ 4*i+1 ];
const Vec4f& col_c = colours[ 4*i+2 ];
const Vec4f& col_d = colours[ 4*i+3 ];

Vec4f average_colour;
for(int i=0; i<4; i++)
{
average_colour[i] = (col_a[i]+col_b[i]+col_c[i]+col_d[i])*0.25;
}

Vector3 n = cross((b-a),(c-a));
n.normalize();
internalDrawQuad(a,b,c,d,n,average_colour);
}
} glEnd();
}

void DrawToolGL::drawTetrahedron(const Vector3 &p0, const Vector3 &p1, const Vector3 &p2, const Vector3 &p3, const Vec4f &colour)
{
setMaterial(colour);
Expand Down Expand Up @@ -1027,8 +1063,9 @@ void DrawToolGL::drawEllipsoid(const Vector3 &p, const Vector3 &radii)

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

void DrawToolGL::drawBoundingBox( const Vector3 &min, const Vector3 &max )
void DrawToolGL::drawBoundingBox( const Vector3 &min, const Vector3 &max, float size)
{
glLineWidth(size);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will break code that have set the drawLine before.
cannot push/pop the attrib otherwise ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually no since @fredroy set a default value for "size" to one, for functions calling it without specifying the value

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The normal convention is to save the attributes before changing them and restoring them to their old value when you are done. In your case you restore it to 1.0 regardless of its initial value this means that calling the function has a side effect on all future opengl drawing operation. It is way better to have side effect free functions so that the one that call them does not have to care about what the function is doing.

glBegin( GL_LINES );

// 0-1
Expand Down Expand Up @@ -1069,6 +1106,7 @@ void DrawToolGL::drawBoundingBox( const Vector3 &min, const Vector3 &max )
glVertex3f( (float)min[0], (float)max[1], (float)max[2] );

glEnd();
glLineWidth(1.0);
}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -1267,7 +1305,7 @@ void DrawToolGL::draw3DText(const Vector3 &p, float scale, const Vec4f &color, c
sofa::helper::gl::GlText::draw(text, p, (double)scale);
}

void DrawToolGL::draw3DText_Indices(const helper::vector<Vector3> &positions, float scale, const Vec4f &color)
void DrawToolGL::draw3DText_Indices(const std::vector<Vector3> &positions, float scale, const Vec4f &color)
{
glColor4f(color[0], color[1], color[2], color[3]);

Expand Down
7 changes: 5 additions & 2 deletions SofaKernel/framework/sofa/core/visual/DrawToolGL.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ class SOFA_CORE_API DrawToolGL : public DrawTool
const Vector3 &normal1, const Vector3 &normal2, const Vector3 &normal3,
const Vec4f &c1, const Vec4f &c2, const Vec4f &c3);
virtual void drawTriangles(const std::vector<Vector3> &points, const Vec4f& colour);
virtual void drawTriangles(const std::vector<Vector3> &points,
const std::vector< Vec4f > &colour);
virtual void drawTriangles(const std::vector<Vector3> &points, const Vector3& normal, const Vec4f& colour);
virtual void drawTriangles(const std::vector<Vector3> &points,
const std::vector< Vec3i > &index,
Expand Down Expand Up @@ -128,6 +130,7 @@ class SOFA_CORE_API DrawToolGL : public DrawTool
const Vector3 &normal1, const Vector3 &normal2, const Vector3 &normal3, const Vector3 &normal4,
const Vec4f &c1, const Vec4f &c2, const Vec4f &c3, const Vec4f &c4);
virtual void drawQuads(const std::vector<Vector3> &points, const Vec4f& colour) ;
virtual void drawQuads(const std::vector<Vector3> &points, const std::vector<Vec4f>& colours);


virtual void drawTetrahedron(const Vector3 &p0, const Vector3 &p1, const Vector3 &p2, const Vector3 &p3, const Vec4f &colour);
Expand All @@ -142,11 +145,11 @@ class SOFA_CORE_API DrawToolGL : public DrawTool
virtual void drawSphere( const Vector3 &p, float radius);
virtual void drawEllipsoid(const Vector3 &p, const Vector3 &radii);

virtual void drawBoundingBox( const Vector3 &min, const Vector3 &max );
virtual void drawBoundingBox( const Vector3 &min, const Vector3 &max, float size = 1.0);

virtual void draw3DText(const Vector3 &p, float scale, const Vec4f &color, const char* text);

virtual void draw3DText_Indices(const helper::vector<Vector3> &positions, float scale, const Vec4f &color);
virtual void draw3DText_Indices(const std::vector<Vector3> &positions, float scale, const Vec4f &color);

virtual void clear();

Expand Down
2 changes: 1 addition & 1 deletion SofaKernel/modules/SofaBaseMechanics/MechanicalObject.inl
Original file line number Diff line number Diff line change
Expand Up @@ -2725,7 +2725,7 @@ inline void MechanicalObject<DataTypes>::drawIndices(const core::visual::VisualP

float scale = (float)((vparams->sceneBBox().maxBBox() - vparams->sceneBBox().minBBox()).norm() * showIndicesScale.getValue());

helper::vector<defaulttype::Vector3> positions;
std::vector<defaulttype::Vector3> positions;
for (size_t i = 0; i <(size_t)d_size.getValue(); ++i)
positions.push_back(defaulttype::Vector3(getPX(i), getPY(i), getPZ(i)));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ void EdgeSetGeometryAlgorithms<DataTypes>::draw(const core::visual::VisualParams

const sofa::helper::vector <Edge>& edgeArray = this->m_topology->getEdges();

helper::vector<defaulttype::Vector3> positions;
std::vector<defaulttype::Vector3> positions;
for (unsigned int i = 0; i < edgeArray.size(); i++)
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,7 @@ void HexahedronSetGeometryAlgorithms<DataTypes>::draw(const core::visual::Visual

const sofa::helper::vector<Hexahedron> &hexaArray = this->m_topology->getHexahedra();

helper::vector<defaulttype::Vector3> positions;
std::vector<defaulttype::Vector3> positions;
for (unsigned int i =0; i<hexaArray.size(); i++)
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ void PointSetGeometryAlgorithms<DataTypes>::draw(const core::visual::VisualParam

float scale = getIndicesScale();

helper::vector<defaulttype::Vector3> positions;
std::vector<defaulttype::Vector3> positions;
for (unsigned int i =0; i<coords.size(); i++)
{
defaulttype::Vector3 center; center = DataTypes::getCPos(coords[i]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ void QuadSetGeometryAlgorithms<DataTypes>::draw(const core::visual::VisualParams

const sofa::helper::vector<Quad>& quadArray = this->m_topology->getQuads();

helper::vector<defaulttype::Vector3> positions;
std::vector<defaulttype::Vector3> positions;
for (unsigned int i =0; i<quadArray.size(); i++)
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,7 @@ void TetrahedronSetGeometryAlgorithms<DataTypes>::draw(const core::visual::Visua

const sofa::helper::vector<Tetrahedron> &tetraArray = this->m_topology->getTetrahedra();

helper::vector<defaulttype::Vector3> positions;
std::vector<defaulttype::Vector3> positions;
for (unsigned int i =0; i<tetraArray.size(); i++)
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2401,7 +2401,7 @@ void TriangleSetGeometryAlgorithms<DataTypes>::draw(const core::visual::VisualPa

const sofa::helper::vector<Triangle> &triangleArray = this->m_topology->getTriangles();

helper::vector<defaulttype::Vector3> positions;
std::vector<defaulttype::Vector3> positions;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we use helper::vector as much as possible ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could but @fredroy told me that he wanted to make it as independent from SOFA as possible (in this optic, we should also remove the defaulttype calls).
But in general you're right, for the rest of SOFA, we should use helper::vector as much as possible

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fear so much inconsistancies :)

for (unsigned int i =0; i<triangleArray.size(); i++)
{

Expand Down
137 changes: 66 additions & 71 deletions applications/plugins/SofaMiscCollision/TetrahedronModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include <SofaMiscCollision/TetrahedronModel.h>
#include <sofa/core/visual/VisualParams.h>
#include <SofaBaseCollision/CubeModel.h>
#include <sofa/helper/gl/template.h>
#include <sofa/simulation/Node.h>
#include <SofaBaseTopology/RegularGridTopology.h>
#include <sofa/core/CollisionElement.h>
Expand Down Expand Up @@ -94,98 +93,94 @@ void TetrahedronModel::handleTopologyChange()
resize(_topology->getNbTetrahedra());
}

void TetrahedronModel::draw(const core::visual::VisualParams* vparams,int index)
void TetrahedronModel::addTetraToDraw(const Tetrahedron& t, std::vector<sofa::defaulttype::Vector3>& tetraVertices, std::vector<sofa::defaulttype::Vector3>& normalVertices)
{
#ifndef SOFA_NO_OPENGL
Tetrahedron t(this,index);
glBegin(GL_TRIANGLES);
Coord p1 = t.p1();
Coord p2 = t.p2();
Coord p3 = t.p3();
Coord p4 = t.p4();
Coord c = (p1+p2+p3+p4)*0.25f;
p1 += (c-p1)*0.1f;
p2 += (c-p2)*0.1f;
p3 += (c-p3)*0.1f;
p4 += (c-p4)*0.1f;
Coord n1,n2,n3,n4;
n1 = cross(p3-p1,p2-p1); n1.normalize();
helper::gl::glNormalT(n1);
helper::gl::glVertexT(p1);
helper::gl::glVertexT(p3);
helper::gl::glVertexT(p2);

n2 = cross(p4-p1,p3-p1); n2.normalize();
helper::gl::glNormalT(n2);
helper::gl::glVertexT(p1);
helper::gl::glVertexT(p4);
helper::gl::glVertexT(p3);

n3 = cross(p2-p1,p4-p1); n3.normalize();
helper::gl::glNormalT(n3);
helper::gl::glVertexT(p1);
helper::gl::glVertexT(p2);
helper::gl::glVertexT(p4);

n4 = cross(p3-p2,p4-p2); n4.normalize();
helper::gl::glNormalT(n4);
helper::gl::glVertexT(p2);
helper::gl::glVertexT(p3);
helper::gl::glVertexT(p4);
glEnd();
if (vparams->displayFlags().getShowNormals())
{
Coord p;
glBegin(GL_LINES);
p = (p1+p2+p3)*(1.0/3.0);
helper::gl::glVertexT(p);
helper::gl::glVertexT(p+n1*0.1);
p = (p1+p3+p4)*(1.0/3.0);
helper::gl::glVertexT(p);
helper::gl::glVertexT(p+n2*0.1);
p = (p1+p4+p2)*(1.0/3.0);
helper::gl::glVertexT(p);
helper::gl::glVertexT(p+n3*0.1);
p = (p2+p3+p4)*(1.0/3.0);
helper::gl::glVertexT(p);
helper::gl::glVertexT(p+n4*0.1);
glEnd();
}
#endif /* SOFA_NO_OPENGL */
Coord c = (p1 + p2 + p3 + p4)*0.25f;
auto computeP = [](Coord center, Coord pos) {pos += (center - pos)*0.1f; };
computeP(c, p1);
computeP(c, p2);
computeP(c, p3);
computeP(c, p4);

Coord n1, n2, n3, n4;
auto computeN = [](Coord normal, Coord pos1, Coord pos2, Coord pos3) {normal = cross(pos3 - pos1, pos2 - pos1); normal.normalize(); };
computeN(n1,p1,p2,p3);
computeN(n1,p1,p3,p4);
computeN(n1,p1,p4,p2);
computeN(n1,p2,p4,p3);

tetraVertices.push_back(p1);
tetraVertices.push_back(p2);
tetraVertices.push_back(p3);
tetraVertices.push_back(p4);

Coord p;
auto updateP = [](Coord pPos, Coord pos1, Coord pos2, Coord pos3) {pPos = (pos1 + pos2 + pos3)*(1.0 / 3.0); };
updateP(p,p1,p2,p3);
normalVertices.push_back(p);
normalVertices.push_back(p + n1*0.1);
updateP(p,p1,p3,p4);
normalVertices.push_back(p);
normalVertices.push_back(p + n2*0.1);
updateP(p,p1,p4,p2);
normalVertices.push_back(p);
normalVertices.push_back(p + n3*0.1);
updateP(p,p2,p3,p4);
normalVertices.push_back(p);
normalVertices.push_back(p + n4*0.1);
}

void TetrahedronModel::draw(const core::visual::VisualParams* vparams,int index)
{
vparams->drawTool()->saveLastState();

std::vector<sofa::defaulttype::Vector3> tetraVertices;
std::vector<sofa::defaulttype::Vector3> normalVertices;

Tetrahedron t(this, index);
this->addTetraToDraw(t, tetraVertices, normalVertices);

vparams->drawTool()->drawTetrahedra(tetraVertices, defaulttype::Vec<4, float>(getColor4f()));

vparams->drawTool()->restoreLastState();
}

void TetrahedronModel::draw(const core::visual::VisualParams* vparams)
{
#ifndef SOFA_NO_OPENGL
vparams->drawTool()->saveLastState();
if (mstate && _topology && vparams->displayFlags().getShowCollisionModels())
{
if (vparams->displayFlags().getShowWireFrame())
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
vparams->drawTool()->setPolygonMode(0, true);

glEnable(GL_LIGHTING);
//Enable<GL_BLEND> blending;
//glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);
vparams->drawTool()->enableLighting();
vparams->drawTool()->setMaterial(defaulttype::Vec<4, float>(getColor4f()));

glMaterialfv (GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, getColor4f());
static const float emissive[4] = { 0.0f, 0.0f, 0.0f, 0.0f};
static const float specular[4] = { 1.0f, 1.0f, 1.0f, 1.0f};
glMaterialfv (GL_FRONT_AND_BACK, GL_EMISSION, emissive);
glMaterialfv (GL_FRONT_AND_BACK, GL_SPECULAR, specular);
glMaterialf (GL_FRONT_AND_BACK, GL_SHININESS, 20);
std::vector<sofa::defaulttype::Vector3> tetraVertices;
std::vector<sofa::defaulttype::Vector3> normalVertices;
for (int i = 0; i<size; i++)
{
Tetrahedron t(this, i);
this->addTetraToDraw(t, tetraVertices, normalVertices);
}

for (int i=0; i<size; i++)
vparams->drawTool()->drawTetrahedra(tetraVertices, defaulttype::Vec<4, float>(getColor4f()));
if (vparams->displayFlags().getShowNormals())
{
draw(vparams,i);
vparams->drawTool()->drawLines(normalVertices, 1.0, defaulttype::Vec<4, float>(getColor4f()));
}

glColor3f(1.0f, 1.0f, 1.0f);
glDisable(GL_LIGHTING);
if (vparams->displayFlags().getShowWireFrame())
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
vparams->drawTool()->setPolygonMode(0, false);
}
if (getPrevious()!=NULL && vparams->displayFlags().getShowBoundingCollisionModels())
getPrevious()->draw(vparams);
#endif /* SOFA_NO_OPENGL */

vparams->drawTool()->restoreLastState();
}

void TetrahedronModel::computeBoundingTree(int maxDepth)
Expand Down
1 change: 1 addition & 0 deletions applications/plugins/SofaMiscCollision/TetrahedronModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ class SOFA_MISC_COLLISION_API TetrahedronModel : public core::CollisionModel
protected:

TetrahedronModel();
void addTetraToDraw(const Tetrahedron& t, std::vector<sofa::defaulttype::Vector3>& tetraVertices, std::vector<sofa::defaulttype::Vector3>& normalVertices);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren't the other parameters const ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope, by looking into this function, its purpose is actually to build a vector and set new values in it

public:
virtual void init() override;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include <sofa/core/CollisionElement.h>
#include <sofa/core/ObjectFactory.h>
#include <vector>
#include <sofa/helper/gl/template.h>
#include <iostream>

#include <sofa/core/topology/TopologyChange.h>
Expand Down
Loading