Salome HOME
bos #20256: [CEA 18523] Porting SMESH to int 64 bits
[modules/smesh.git] / src / SMDS / SMDS_BallElement.cxx
1 // Copyright (C) 2010-2021  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 //  SMESH SMDS : implementation of Salome mesh data structure
21 //  Module     : SMESH
22 //  File       : SMDS_BallElement.cxx
23 //  Author     : Edward AGAPOV (eap)
24
25 #include "SMDS_BallElement.hxx"
26
27 #include "SMDS_Mesh.hxx"
28 #include "SMDS_MeshNode.hxx"
29
30 void SMDS_BallElement::init(const SMDS_MeshNode * node, double diameter )
31 {
32   vtkIdType nodeVtkID = node->GetVtkID();
33   vtkIdType vtkID = getGrid()->InsertNextLinkedCell( toVtkType( SMDSEntity_Ball ), 1, &nodeVtkID );
34   setVtkID( vtkID );
35   getGrid()->SetBallDiameter( GetVtkID(), diameter );
36 }
37
38 double SMDS_BallElement::GetDiameter() const
39 {
40   return getGrid()->GetBallDiameter( GetVtkID() );
41 }
42
43 void SMDS_BallElement::SetDiameter(double diameter)
44 {
45   getGrid()->SetBallDiameter( GetVtkID(), diameter );
46   GetMesh()->setMyModified();
47 }