iMSTK
Interactive Medical Simulation Toolkit
imstkSphObject.cpp
1 /*
2 ** This file is part of the Interactive Medical Simulation Toolkit (iMSTK)
3 ** iMSTK is distributed under the Apache License, Version 2.0.
4 ** See accompanying NOTICE for details.
5 */
6 
7 #include "imstkSphObject.h"
8 #include "imstkSphModel.h"
9 
10 namespace imstk
11 {
12 bool
14 {
15  m_sphModel = std::dynamic_pointer_cast<SphModel>(m_dynamicalModel);
16  if (m_sphModel == nullptr)
17  {
18  LOG(FATAL) << "Dynamics pointer cast failure in SPHObject::initialize()";
19  return false;
20  }
21 
22  // why are we initializing twice?
24  m_sphModel->initialize();
25 
26  return true;
27 }
28 
29 std::shared_ptr<SphModel>
31 {
32  m_sphModel = std::dynamic_pointer_cast<SphModel>(m_dynamicalModel);
33  return m_sphModel;
34 }
35 } // namespace imstk
Compound Geometry.
bool initialize() override
Initialize the scene object.
std::shared_ptr< AbstractDynamicalModel > m_dynamicalModel
Dynamical model.
bool initialize() override
Initialize the SphObject.
std::shared_ptr< SphModel > getSphModel()
Get the model governing the Sph fluid dynamics of this object.