Commit cfbf57fb authored by Alexis Girault's avatar Alexis Girault
Browse files

ENH: Add imstkSphere and imstkCube

parent b6ab48b5
......@@ -7,10 +7,14 @@ imstk_add_library( Geometry
imstkGeometry.h
imstkAnalyticalGeometry.h
imstkPlane.h
imstkSphere.h
imstkCube.h
CPP_FILES
imstkGeometry.cpp
imstkAnalyticalGeometry.cpp
imstkPlane.cpp
imstkSphere.cpp
imstkCube.cpp
LIBRARIES
Core
)
......
/*=========================================================================
Library: iMSTK
Copyright (c) Kitware, Inc. & Center for Modeling, Simulation,
& Imaging in Medicine, Rensselaer Polytechnic Institute.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0.txt
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
=========================================================================*/
#include "imstkCube.h"
namespace imstk {
const double&
Cube::getWidth() const
{
return m_width;
}
void
Cube::setWidth(const double& width)
{
m_width = width;
}
}
/*=========================================================================
Library: iMSTK
Copyright (c) Kitware, Inc. & Center for Modeling, Simulation,
& Imaging in Medicine, Rensselaer Polytechnic Institute.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0.txt
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
=========================================================================*/
#ifndef imstkCube_h
#define imstkCube_h
#include "imstkAnalyticalGeometry.h"
namespace imstk {
class Cube : public AnalyticalGeometry
{
public:
Cube(const Vec3d & position = ORIGIN,
const double& width = 10) :
AnalyticalGeometry(GeometryType::Cube,
position,
Quatd()),
m_width(width)
{}
~Cube() = default;
const double& getWidth() const;
void setWidth(const double& width);
protected:
double m_width;
};
}
#endif // ifndef imstkCube_h
/*=========================================================================
Library: iMSTK
Copyright (c) Kitware, Inc. & Center for Modeling, Simulation,
& Imaging in Medicine, Rensselaer Polytechnic Institute.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0.txt
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
=========================================================================*/
#include "imstkSphere.h"
namespace imstk {
const double&
Sphere::getRadius() const
{
return m_radius;
}
void
Sphere::setRadius(const double& radius)
{
m_radius = radius;
}
}
/*=========================================================================
Library: iMSTK
Copyright (c) Kitware, Inc. & Center for Modeling, Simulation,
& Imaging in Medicine, Rensselaer Polytechnic Institute.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0.txt
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
=========================================================================*/
#ifndef imstkSphere_h
#define imstkSphere_h
#include "imstkAnalyticalGeometry.h"
namespace imstk {
class Sphere : public AnalyticalGeometry
{
public:
Sphere(const Vec3d & position = ORIGIN,
const double& radius = 10) :
AnalyticalGeometry(GeometryType::Sphere,
position,
Quatd()),
m_radius(radius)
{}
~Sphere() = default;
const double& getRadius() const;
void setRadius(const double& radius);
protected:
double m_radius;
};
}
#endif // ifndef imstkSphere_h
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment