7 #include "imstkCamera.h" 8 #include "imstkDataArray.h" 9 #include "imstkDirectionalLight.h" 10 #include "imstkImageData.h" 11 #include "imstkMeshIO.h" 13 #include "imstkQuadricDecimate.h" 14 #include "imstkRenderMaterial.h" 15 #include "imstkScene.h" 16 #include "imstkSceneManager.h" 17 #include "imstkSceneObject.h" 18 #include "imstkSimulationManager.h" 19 #include "imstkSurfaceMesh.h" 20 #include "imstkSurfaceMeshDistanceTransform.h" 21 #include "imstkSurfaceMeshFlyingEdges.h" 22 #include "imstkTetrahedralMesh.h" 23 #include "imstkVisualModel.h" 24 #include "imstkVTKViewer.h" 26 using namespace imstk;
38 scene->getActiveCamera()->setPosition(Vec3d(0.0, 12.0, 12.0));
40 auto coarseTetMesh = MeshIO::read<TetrahedralMesh>(iMSTK_DATA_ROOT
"/asianDragon/asianDragon.veg");
41 std::shared_ptr<SurfaceMesh> coarseSurfMesh = coarseTetMesh->extractSurfaceMesh();
46 createSdf->setDimensions(50, 50, 50);
50 const double erosionDist = 0.2;
52 for (
int i = 0; i < scalars.
size(); i++)
54 scalars[i] += erosionDist;
65 reduce->setTargetReduction(0.5);
73 surfMeshModel->setGeometry(reduce->
getOutput());
75 material->setDisplayMode(RenderMaterial::DisplayMode::Surface);
76 material->setLineWidth(4.0);
77 material->setEdgeColor(Color::Color::Orange);
79 sceneObj->addVisualModel(surfMeshModel);
84 surfMeshModel->setGeometry(coarseSurfMesh);
86 material->setColor(Color::Red);
87 material->setDisplayMode(RenderMaterial::DisplayMode::Surface);
88 material->setLineWidth(1.0);
89 material->setOpacity(0.2f);
91 sceneObj->addVisualModel(surfMeshModel);
93 scene->addSceneObject(sceneObj);
99 scene->addLight(
"light", light);
void setActiveScene(std::shared_ptr< Scene > scene) override
Set scene to be rendered.
int size() const
Get number of values/tuples.
void setInputMesh(std::shared_ptr< SurfaceMesh > inputMesh)
Required input, port 0.
void addModule(std::shared_ptr< Module > module) override
Add a module to run.
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...
std::shared_ptr< Geometry > getOutput(size_t port=0) const
Returns output geometry given port, returns nullptr if doesn't exist.
void update()
Do the actual algorithm.
void setInputImage(std::shared_ptr< ImageData > inputImage)
Required input, port 0.
void setRenderMaterial(std::shared_ptr< RenderMaterial > renderMaterial)
Set/Get render material.
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.
void setInputMesh(std::shared_ptr< SurfaceMesh > surfMesh)
Required input, port 0.