7 #include "imstkCamera.h" 8 #include "imstkDirectionalLight.h" 9 #include "imstkGeometryUtilities.h" 10 #include "imstkKeyboardDeviceClient.h" 11 #include "imstkKeyboardSceneControl.h" 12 #include "imstkMeshIO.h" 13 #include "imstkMouseDeviceClient.h" 14 #include "imstkMouseSceneControl.h" 16 #include "imstkRenderMaterial.h" 17 #include "imstkScene.h" 18 #include "imstkSceneManager.h" 19 #include "imstkSceneObject.h" 20 #include "imstkSimulationManager.h" 21 #include "imstkSimulationUtils.h" 22 #include "imstkSurfaceMesh.h" 23 #include "imstkTetrahedralMesh.h" 24 #include "imstkVisualModel.h" 25 #include "imstkVTKViewer.h" 27 using namespace imstk;
29 const size_t nx = 80 / 2, ny = 40 / 2, nz = 40 / 2;
40 scene->getActiveCamera()->setPosition(0.0, 2.0, 15.0);
45 auto surfMesh = MeshIO::read<SurfaceMesh>(iMSTK_DATA_ROOT
"/asianDragon/asianDragon.obj");
49 material->setDisplayMode(RenderMaterial::DisplayMode::Surface);
50 material->setColor(Color::LightGray);
52 visualModel->setGeometry(surfMesh);
54 surfObj->addVisualModel(visualModel);
57 scene->addSceneObject(surfObj);
59 std::shared_ptr<TetrahedralMesh> tetMesh =
65 tetMaterial->setDisplayMode(RenderMaterial::DisplayMode::Wireframe);
66 tetMaterial->setColor(Color::Teal);
67 tetMaterial->setPointSize(7.0);
68 tetMaterial->setLineWidth(3.0);
70 tetVisualModel->setGeometry(tetMesh);
72 volObject->addVisualModel(tetVisualModel);
74 scene->addSceneObject(volObject);
80 scene->addLight(
"light0", light);
99 std::shared_ptr<Entity> mouseAndKeyControls =
100 SimulationUtils::createDefaultSceneControl(driver);
101 scene->addSceneObject(mouseAndKeyControls);
void setActiveScene(std::shared_ptr< Scene > scene) override
Set scene to be rendered.
void addModule(std::shared_ptr< Module > module) override
Add a module to run.
virtual void setBackgroundColors(const Color color1, const Color color2=Color(0.0, 0.0, 0.0), const bool gradientBackground=false) override
Set the coloring of the screen background If 'gradientBackground' is false or not supplied color1 wil...
void setIntensity(const double intensity)
Set the light intensity. This value is unbounded.
std::shared_ptr<T> obj = std::make_shared<T>(); equivalent, convenience class for STL shared allocati...
void setRenderMaterial(std::shared_ptr< RenderMaterial > renderMaterial)
Set/Get render material.
std::shared_ptr< TetrahedralMesh > createTetrahedralMeshCover(std::shared_ptr< SurfaceMesh > surfMesh, const int nx, const int ny, int nz)
Create a tetrahedral mesh cover.
void setFocalPoint(const Vec3d &p)
Get/Set the light focal point.
void setActiveScene(std::string newSceneName)
Sets the currently updating scene.
static LoggerG3 & startLogger()
Starts logger with default sinks, use getInstance to create a logger with no sinks.