Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
iMSTK
iMSTK
Commits
7e46707a
Commit
7e46707a
authored
May 17, 2016
by
Alexis Girault
Browse files
ENH: Implement base for CollidingObject
parent
576028d7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Base/Scene/Object/imstkCollidingObject.cpp
0 → 100644
View file @
7e46707a
/*=========================================================================
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
"imstkCollidingObject.h"
namespace
imstk
{
std
::
shared_ptr
<
Geometry
>
CollidingObject
::
getCollidingGeometry
()
const
{
return
m_collidingGeometry
;
}
void
CollidingObject
::
setCollidingGeometry
(
std
::
shared_ptr
<
Geometry
>
geometry
)
{
m_collidingGeometry
=
geometry
;
}
}
Base/Scene/Object/imstkCollidingObject.h
0 → 100644
View file @
7e46707a
/*=========================================================================
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 imstkCollidingObject_h
#define imstkCollidingObject_h
#include
<memory>
#include
"imstkSceneObject.h"
namespace
imstk
{
class
Geometry
;
class
GeometryMap
;
class
CollidingObject
:
public
SceneObject
{
public:
CollidingObject
(
std
::
string
name
)
:
SceneObject
(
name
)
{
m_type
=
Type
::
Static
;
}
~
CollidingObject
()
=
default
;
std
::
shared_ptr
<
Geometry
>
getCollidingGeometry
()
const
;
void
setCollidingGeometry
(
std
::
shared_ptr
<
Geometry
>
geometry
);
protected:
std
::
shared_ptr
<
Geometry
>
m_collidingGeometry
;
///> Geometry for collisions
std
::
shared_ptr
<
GeometryMap
>
m_collidingToVisualMap
;
///> Maps transformations to visual geometry
};
using
StaticObject
=
CollidingObject
;
}
#endif // ifndef imstkCollidingObject_h
Base/Scene/Object/imstkSceneObject.cpp
View file @
7e46707a
...
...
@@ -21,6 +21,8 @@
#include
"imstkSceneObject.h"
#include
"imstkGeometry.h"
namespace
imstk
{
std
::
shared_ptr
<
Geometry
>
SceneObject
::
getVisualGeometry
()
const
...
...
@@ -29,17 +31,23 @@ SceneObject::getVisualGeometry() const
}
void
SceneObject
::
setVisualGeometry
(
std
::
shared_ptr
<
Geometry
>
geometry
)
SceneObject
::
setVisualGeometry
(
std
::
shared_ptr
<
Geometry
>
geometry
)
{
m_visualGeometry
=
geometry
;
}
const
SceneObjectType
&
const
SceneObject
::
Type
&
SceneObject
::
getType
()
const
{
return
m_type
;
}
void
SceneObject
::
setType
(
Type
type
)
{
m_type
=
type
;
}
const
std
::
string
&
SceneObject
::
getName
()
const
{
...
...
Base/Scene/Object/imstkSceneObject.h
View file @
7e46707a
...
...
@@ -24,38 +24,41 @@
#include
<memory>
#include
"imstkGeometry.h"
namespace
imstk
{
enum
class
SceneObjectType
{
Visual
,
Static
,
VirtualCoupled
,
Rigid
,
Deformable
};
class
Geometry
;
class
SceneObject
{
public:
enum
class
Type
{
Visual
,
Static
,
VirtualCoupled
,
Rigid
,
Deformable
};
SceneObject
(
std
::
string
name
)
:
m_name
(
name
)
{}
~
SceneObject
()
=
default
;
const
SceneObject
Type
&
getType
()
const
;
const
Type
&
getType
()
const
;
const
std
::
string
&
getName
()
const
;
void
setName
(
std
::
string
name
);
const
std
::
string
&
getName
()
const
;
void
setName
(
std
::
string
name
);
std
::
shared_ptr
<
Geometry
>
getVisualGeometry
()
const
;
void
setVisualGeometry
(
std
::
shared_ptr
<
Geometry
>
geometry
);
std
::
shared_ptr
<
Geometry
>
getVisualGeometry
()
const
;
void
setVisualGeometry
(
std
::
shared_ptr
<
Geometry
>
geometry
);
protected:
SceneObjectType
m_type
=
SceneObjectType
::
Visual
;
std
::
string
m_name
;
void
setType
(
Type
type
);
Type
m_type
=
Type
::
Visual
;
std
::
string
m_name
;
std
::
shared_ptr
<
Geometry
>
m_visualGeometry
;
///> Geometry for rendering
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment