SurgSim
Physics
Mass.h
Go to the documentation of this file.
1
// This file is a part of the OpenSurgSim project.
2
// Copyright 2013, SimQuest Solutions Inc.
3
//
4
// Licensed under the Apache License, Version 2.0 (the "License");
5
// you may not use this file except in compliance with the License.
6
// You may obtain a copy of the License at
7
//
8
// http://www.apache.org/licenses/LICENSE-2.0
9
//
10
// Unless required by applicable law or agreed to in writing, software
11
// distributed under the License is distributed on an "AS IS" BASIS,
12
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
// See the License for the specific language governing permissions and
14
// limitations under the License.
15
16
#ifndef SURGSIM_PHYSICS_MASS_H
17
#define SURGSIM_PHYSICS_MASS_H
18
19
namespace
SurgSim
20
{
21
22
namespace
Physics
23
{
24
25
// Class to handle a mass of a MassSpring node
26
class
Mass
27
{
28
public
:
31
explicit
Mass
(
double
mass = 0.0) :
m_mass
(mass)
32
{
33
}
34
37
void
setMass
(
double
mass)
38
{
39
m_mass
= mass;
40
}
41
44
double
getMass
()
const
45
{
46
return
m_mass
;
47
}
48
52
bool
operator ==
(
const
Mass
& m)
const
53
{
54
return
(
m_mass
== m.
m_mass
);
55
}
56
60
bool
operator !=
(
const
Mass
& m)
const
61
{
62
return
! ((*this) == m);
63
}
64
65
protected
:
67
double
m_mass
;
68
};
69
70
}
// namespace Physics
71
72
}
// namespace SurgSim
73
74
#endif // SURGSIM_PHYSICS_MASS_H
SurgSim::Physics::Mass::operator!=
bool operator!=(const Mass &m) const
Comparison operator (inequality)
Definition:
Mass.h:60
SurgSim::Physics::Mass::m_mass
double m_mass
Mass (in kg)
Definition:
Mass.h:67
SurgSim
Definition:
CompoundShapeToGraphics.cpp:29
SurgSim::Physics::Mass
Definition:
Mass.h:26
SurgSim::Physics::Mass::getMass
double getMass() const
Gets the mass.
Definition:
Mass.h:44
SurgSim::Physics::Mass::operator==
bool operator==(const Mass &m) const
Comparison operator (equality)
Definition:
Mass.h:52
SurgSim::Physics::Mass::Mass
Mass(double mass=0.0)
Constructor.
Definition:
Mass.h:31
SurgSim::Physics::Mass::setMass
void setMass(double mass)
Sets the mass.
Definition:
Mass.h:37
Generated on Tue Jun 2 2020 12:47:05 for OpenSurgSim by
1.8.17