All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PlaneShape.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_MATH_PLANESHAPE_H
17 #define SURGSIM_MATH_PLANESHAPE_H
18 
20 #include "SurgSim/Math/Shape.h"
21 
22 namespace SurgSim
23 {
24 
25 namespace Math
26 {
27 SURGSIM_STATIC_REGISTRATION(PlaneShape);
28 
36 class PlaneShape: public Shape
37 {
38 public:
39 
41  PlaneShape();
42 
44 
46  virtual int getType() override;
47 
50  virtual double getVolume() const override;
51 
54  virtual Vector3d getCenter() const override;
55 
59  virtual Matrix33d getSecondMomentOfVolume() const override;
60 
63  double getD() const;
64 
67  Vector3d getNormal() const;
68 
71  virtual bool isValid() const override;
72 };
73 
74 }; // Math
75 }; // SurgSim
76 
77 #endif // SURGSIM_MATH_PLANESHAPE_H
virtual double getVolume() const override
Get the volume of the shape.
Definition: PlaneShape.cpp:33
SURGSIM_STATIC_REGISTRATION(BoxShape)
virtual Matrix33d getSecondMomentOfVolume() const override
Get the second central moment of the volume, commonly used to calculate the moment of inertia matrix...
Definition: PlaneShape.cpp:43
virtual Vector3d getCenter() const override
Get the volumetric center of the shape.
Definition: PlaneShape.cpp:38
::SurgSim::Math::Vector3d Vector3d
Definition: Shape.h:62
virtual int getType() override
Definition: PlaneShape.cpp:28
SURGSIM_CLASSNAME(SurgSim::Math::PlaneShape)
double getD() const
Gets the d of the plane equation.
Definition: PlaneShape.cpp:48
virtual bool isValid() const override
A PlaneShape is always valid.
Definition: PlaneShape.cpp:58
Vector3d getNormal() const
Gets the normal of the plane equation.
Definition: PlaneShape.cpp:53
::SurgSim::Math::Matrix33d Matrix33d
Definition: Shape.h:63
The XZ plane (d = 0) with normal pointing along positive Y axis.
Definition: PlaneShape.h:36
PlaneShape()
Constructor: No members to initialize.
Definition: PlaneShape.cpp:24
Generic rigid shape class defining a shape.
Definition: Shape.h:59