Skip to content

Commit 4009661

Browse files
committed
cache drawTool
1 parent 8c7464a commit 4009661

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Sofa/Component/Visual/src/sofa/component/visual/CylinderVisualModel.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,21 @@ void CylinderVisualModel::doDrawVisual(const core::visual::VisualParams* vparams
5353
{
5454
const VecCoord& pos = this->read( core::vec_id::read_access::position )->getValue();
5555

56-
vparams->drawTool()->setLightingEnabled(true);
57-
const float _radius = radius.getValue();
56+
auto* drawTool = vparams->drawTool();
57+
58+
drawTool->setLightingEnabled(true);
5859

60+
const float _radius = radius.getValue();
5961
const sofa::type::RGBAColor& col = color.getValue();
6062

6163
const SeqEdges& edges = d_edges.getValue();
6264

63-
for(auto edge : edges)
65+
for(const auto& edge : edges)
6466
{
6567
const Coord& p1 = pos[edge[0]];
6668
const Coord& p2 = pos[edge[1]];
6769

68-
vparams->drawTool()->drawCylinder(p1,p2,_radius,col);
70+
drawTool->drawCylinder(p1, p2, _radius, col);
6971
}
7072
}
7173

0 commit comments

Comments
 (0)