Giter VIP home page Giter VIP logo

vtkexamples's Introduction

This site is no longer maintained

Please go to vtk-examples.

Bill Lorensen, the owner of this site died on December 12 2019. If you want to read more about Bill's life and achievements, please see his obituary and the announcement on VTK Discourse: Bill Lorensen.

He devoted hundreds of hours creating this site for the VTK Examples. The new vtk-examples site builds upon his efforts. We deeply appreciate all the time and effort he invested.

vtkexamples's People

Contributors

adithyakoundinya avatar ajpmaclean avatar alvarosan avatar aronhelser avatar bdemin avatar chakravarthi589 avatar chethanab16 avatar chichilalescu avatar cquammen avatar danlipsa avatar gnastacast avatar jcfr avatar jhlegarreta avatar lassoan avatar lorensen avatar mathstuf avatar nicholaswon47 avatar pavankumarbn avatar pawelkurzynski avatar pieper avatar robsdedude avatar sankhesh avatar seanm avatar shuhaowu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vtkexamples's Issues

Guidelines to produce consistent Markdown and LaTeX files

I've noticed a number of inconsistencies throughout the Markdown/LaTeX files. In order to have a set of guidelines, I think having some answers to the following issues would be nice:

  • General comments

    • Should we use bold font when referring to examples?
    • How should we refer to subfigures?
    Figure \ref{fig:Figure3-25} (b)
    

    or let both markdown (?) and LaTeX do the job?

    Figure \ref{fig:Figure3-25b}
    
    • How should we refer to The VTK User's Guide VTK User's Guide or The VTK User's Guide?
    • How should we write URL's in hyperlinks: www.whaterver.ext or protocol://www.whaterver.ext?
    • Should we use the ampesand symbol (&) in headings or should we avoid it and use and?
  • LaTeX version

    • subsubsection are labeled as label{subsec:particular_label}. They should be label{subsubsec:particular_label}` to be consistent.
    • Not all subsubsections have a label. Adding a label to them would allow cross-referencing them.
    • Some chapter labels use lower cases with underscores, whereas others use cammel case with no underscores. Using a single criterion would help making all consistent.
    • Do we have a rule to distinguish the labels for the sections that can be potentially duplicated (Chapter Summary, Bibliographic Notes, References, Exercises), e.g. Add the Chap0X prefix.
    • Do we have a rule to use a different text style (whether it is `\texttt{}) when referring to actual code?
    • Do we have a rule to use a different text style (i.e. a strategy to link with the Doxygen documentation) when referring to actual VTK classes?
    • How do we want to write the chapter, section, etc. labels: just the same as their names, or dropping linking words such as and, articles such as the, an, etc.?
  • Markdowon version

    • Should we use the asterisk symbol (*) or undescores (_) to produce italics?

Point to Cxx examples for Figures 3-12 and 3-13

@lorensen,
Figures 3-12 and 3-13 should point to the the Cxx examples (Cxx/Visiualization/CameraModel1.cxx and Cxx/Visiualization/CameraModel2.cxx) instead of camera.tcl and camera2.tcl, right?

I tried to find instruction on how to edit the VTKBookFigures table but did not find the way.

If my assumption is fine, can you tell me how to change these?

Thanks

why AreaPicking demo can't picking more than one point?

hi,everybody:
i have question when i run the demo of the src/cxx/Picking/AreaPicking,I use the default RubberBandPick style.
first ,i select a box which only contains a point,then i see the debug output is right.
but,when i select a box contains more than one point, the output is not right.
i see that the debug output shows only one point which was be selected.
who can help me ?

Why do obj files read more vertices

I use it meshlab.exe Open an obj file, or use Notepad to open an obj file. There are only 26408 vertices in it。
The obj file format is as follows (I removed the annotation symbol#)
Wavefront OBJ mtllib model.mtl 26408 vertices v -0.0495170839 0.7720808848 0.4657617399 v -0.0456603417 0.7741941402 0.4641847307 v -0.1665510523 0.7487052447 -0.0761576362 v 0.0980114390 0.7601768368 -0.0284780685 v 0.0954305225 0.7593402284 -0.0304180109 v 0.2112363794 0.7507016730 0.0587138140 v 0.2117039923 0.7513025276 0.0564567301 v 0.2442548111 0.7516214668 0.0573516367 v -0.1019155675 0.7483195137 -0.0658163599 v 0.3240373672 0.6416865419 -0.0256790367 v 0.2156865962 0.7512316044 0.0407874909 v 0.2910738839 0.7496361757 0.0008729120 v 0.2914005528 0.7498561777 -0.0001805026 v -0.1002491918 0.7556102703 0.0010426163 v -0.0954618129 0.7603561897 0.0031562183 v -0.0957103628 0.7601207650 0.0028731435 v 0.2860406632 0.7503417712 0.0227865344 v 0.2859714883 0.7505213540 0.0225769585 v -0.1583670350 0.7480347469 -0.1123186190 v -0.0569953775 0.7926299248 -0.0253003932 v -0.0781332995 0.7749295899 0.6390007532 v 0.1873167278 0.7809761373 0.6831041962 v 0.1824798420 0.7812302528 0.6822939733 v 0.0946332339 0.7807375689 0.6676606828 v 0.1271371529 0.7810844599 0.6730712102 v 0.0919379506 0.7801290763 0.6672108222 v 0.2039010933 0.7810425682 0.6858654135 v -0.2348067498 0.7754054320 0.6128682305 v -0.2638290460 0.7761159476 0.6080135198 ......

The code is as follows:

`

   auto reader =vtkSmartPointer<vtkOBJReader>::New();

reader->SetFileName(fileName.c_str());

reader->Update();

polyData = reader->GetOutput();

    std::cout << "There are " << polyData->GetNumberOfPoints() << " GetNumberOfPoints." << std::endl;

`

but the output is
There are 156909 GetNumberOfPoints.

How to make the number of points output with vtkobjreader as many as the number of vertices?

Question about how to export scene as EPS

Firstly, I have found your examples very useful and my apologies if this is not the right place to ask such questions. I'm attempting to export a scene as an EPS using vtk.vtkGL2PSExporter() but I receive the following message: NotImplementedError: no concrete implementation exists for this class. I installed vtk for python3 from http://www.lfd.uci.edu/~gohlke/pythonlibs/
I realize the GL2PS program is separate from VTK but I'm not sure how to install it or whether it would be possible to get vtk to use it from the python interface.

CSharp example custom interactor exception

This CSharp example:
https://lorensen.github.io/VTKExamples/site/CSharp/IO/ReadDICOMSeries/

Produces the following exception somewhat randomly:

System.Exception: 'error: could not get registered type - mteIndex='4294967295' classNameKey='''

If you scroll through enough slices, eventually you should get the exception. The exception appears to be caused by the custom vtkObjectEventHandlers that are added to interactorStyle on these two lines:

     interactorStyle.MouseWheelForwardEvt += new vtkObject.vtkObjectEventHandler(interactor_MouseWheelForwardEvt);
     interactorStyle.MouseWheelBackwardEvt += new vtkObject.vtkObjectEventHandler(interactor_MouseWheelBackwardEvt);

build fails since vtkActor.h is not found

I built vtk from the master branch and installed in /opt/vtk.
Distro is Arch Linux.
I've set the paths to my vtk installation as

export VTK_DIR=/opt/vtk
VTKPYTHONPATH=$VTK_DIR/lib/python3.8/site-packages
export PYTHONPATH=$PYTHONPATH:$VTKPYTHONPATH
export PATH=$PATH:/opt/vtk/bin

I created /etc/ld.so.conf.d/vtk.conf with the contents and used sudo ldconfig for dynamic linking.

[jaswant@arch-devine build]$ cat /etc/ld.so.conf.d/vtk.conf 
/opt/vtk/lib

I can import and use vtk in python with no issues. But when I attempt to build these examples,
I get the error.

[jaswant@arch-devine build]$ cmake ..
-- The C compiler identification is GNU 9.2.1
-- The CXX compiler identification is GNU 9.2.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- VTKWikiExamples: Building VTKWikiExamples stand-alone
-- VTKWikiExamples: Building VTKWikiExamples stand-alone - yes
-- VTKWikiExamples: Setting executables prefix
-- VTKWikiExamples: Setting executables prefix - no
-- VTKWikiExamples: VTK VERSION: 8.90.0(OpenGL2)
-- VTKWikiExamples: Example executables are stored in /home/jaswant/Downloads/VTKExamples/build/bin
-- VTKWikiExamples: Tests will not be built
-- VTKWikiExamples: GenericClip requires the setting BUILD_TESTING:BOOL=ON and will not be built
-- VTKWikiExamples: OpenVRCone requires VTK module RenderingOpenVR and will not be built
-- VTKWikiExamples: OpenVRCube requires VTK module RenderingOpenVR and will not be built
-- VTKWikiExamples: OpenVRCylinder requires VTK module RenderingOpenVR and will not be built
-- VTKWikiExamples: OpenVRFrustm requires VTK module RenderingOpenVR and will not be built
-- VTKWikiExamples: OpenVROrientedArrow requires VTK module RenderingOpenVR and will not be built
-- VTKWikiExamples: OpenVROrientedCylinder requires VTK module RenderingOpenVR and will not be built
-- VTKWikiExamples: OpenVRSphere requires VTK module RenderingOpenVR and will not be built
-- VTKWikiExamples: OpenVRTessellatedBoxSource requires VTK module RenderingOpenVR and will not be built
-- VTKWikiExamples: TreeMapView requires the setting BUILD_TESTING:BOOL=ON and will not be built
-- VTKWikiExamples: WordCloudDemo requires VTK class vtkWordCloud and will not be built
-- VTKWikiExamples: PKMeansClustering requires VTK_PARALLEL and will not be built
-- VTKWikiExamples: DEMReader requires git lfs to be installed and will not be built
-- VTKWikiExamples: GLTFImporter requires git lfs to be installed and will not be built
-- VTKWikiExamples: ReadSLC requires git lfs to be installed and will not be built
-- VTKWikiExamples: GenerateModelsFromLabels requires git lfs to be installed and will not be built
-- VTKWikiExamples: GenerateCubesFromLabels requires git lfs to be installed and will not be built
-- VTKWikiExamples: ExtractLargestIsosurface requires git lfs to be installed and will not be built
-- VTKWikiExamples:  requires vtkPolyDataBooleanFilter and will not be built
-- optional: 
-- VTKWikiExamples: PowercrustExtractSurface requires VTK module Powercrust and will not be built
-- VTKWikiExamples: PoissonExtractSurface requires VTK module PoissonReconstruction and will not be built
-- VTKWikiExamples: CompareExtractSurface requires VTK module Powercrust and will not be built
-- VTKWikiExamples: CompareExtractSurface requires VTK module PoissonReconstruction and will not be built
-- VTKWikiExamples: FrenetSerretFrame requires VTK module SplineDrivenImageSlicer and will not be built
-- VTKWikiExamples: FrenetSerretFrameDemo requires VTK module SplineDrivenImageSlicer and will not be built
-- VTKWikiExamples: GetDataRoot requires the setting BUILD_TESTING:BOOL=ON and will not be built
-- VTKWikiExamples: AVI requires the setting VTK_USE_VIDEO_FOR_WINDOWS:BOOL=ON and will not be built
-- VTKWikiExamples: MPEG2 requires the setting VTK_USE_MPEG2_ENCODER:BOOL=ON and will not be built
-- VTKWikiExamples: FFMPEG requires the setting VTK_USE_FFMPEG2_ENCODER:BOOL=ON and will not be built
-- VTKWikiExamples: OggTheora requires the setting VTK_USE_OGGTHEORA_ENCODER:BOOL=ON and will not be built
-- VTKWikiExamples: ExtrudePolyDataAlongLine requires VTK module SplineDrivenImageSlicer and will not be built
-- VTKWikiExamples: ShadowsOpenGL requires VTK module RenderingOpenGL and will not be built
-- VTKWikiExamples: Hawaii requires git lfs to be installed and will not be built
-- VTKWikiExamples: FlyingFrogSkinAndTissue requires git lfs to be installed and will not be built
-- VTKWikiExamples: FlyingFrogSkinAndTissueB requires git lfs to be installed and will not be built
-- VTKWikiExamples: FlyingFrogSkinAndTissueC requires git lfs to be installed and will not be built
-- VTKWikiExamples: FrogSlice requires git lfs to be installed and will not be built
-- VTKWikiExamples: ViewFrog requires git lfs to be installed and will not be built
-- VTKWikiExamples: ViewFrogA requires git lfs to be installed and will not be built
-- VTKWikiExamples: ViewFrogBoth requires git lfs to be installed and will not be built
-- VTKWikiExamples: ViewFrogSkinAndTissue requires git lfs to be installed and will not be built
-- VTKWikiExamples: PineRootConnectivity requires git lfs to be installed and will not be built
-- VTKWikiExamples: PineRootConnectivityA requires git lfs to be installed and will not be built
-- VTKWikiExamples: PineRootDecimation requires git lfs to be installed and will not be built
-- VTKWikiExamples: DecimateHawaii requires git lfs to be installed and will not be built
-- VTKWikiExamples: Building Qt examples
-- VTKWikiExamples: git lfs is not installed. Some tests will not be created.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/jaswant/Downloads/VTKExamples/build
[jaswant@arch-devine build]$ make
make[1]: Entering directory '/home/jaswant/Downloads/VTKExamples/build'
make[2]: Entering directory '/home/jaswant/Downloads/VTKExamples/build'
Scanning dependencies of target AnimateActors
make[2]: Leaving directory '/home/jaswant/Downloads/VTKExamples/build'
make[2]: Entering directory '/home/jaswant/Downloads/VTKExamples/build'
[  0%] Building CXX object src/Cxx/Animation/CMakeFiles/AnimateActors.dir/AnimateActors.cxx.o
[  0%] Linking CXX executable ../../../bin/AnimateActors
make[2]: Leaving directory '/home/jaswant/Downloads/VTKExamples/build'
[  0%] Built target AnimateActors
make[2]: Entering directory '/home/jaswant/Downloads/VTKExamples/build'
Scanning dependencies of target RotatingSphere
make[2]: Leaving directory '/home/jaswant/Downloads/VTKExamples/build'
make[2]: Entering directory '/home/jaswant/Downloads/VTKExamples/build'
[  0%] Building CXX object src/Cxx/Animation/CMakeFiles/RotatingSphere.dir/RotatingSphere.cxx.o
[  0%] Linking CXX executable ../../../bin/RotatingSphere
make[2]: Leaving directory '/home/jaswant/Downloads/VTKExamples/build'
[  0%] Built target RotatingSphere
make[2]: Entering directory '/home/jaswant/Downloads/VTKExamples/build'
Scanning dependencies of target Generate2DAMRDataSetWithPulse
make[2]: Leaving directory '/home/jaswant/Downloads/VTKExamples/build'
make[2]: Entering directory '/home/jaswant/Downloads/VTKExamples/build'
[  0%] Building CXX object src/Cxx/CompositeData/CMakeFiles/Generate2DAMRDataSetWithPulse.dir/Generate2DAMRDataSetWithPulse.cxx.o
[  0%] Linking CXX executable ../../../bin/Generate2DAMRDataSetWithPulse
make[2]: Leaving directory '/home/jaswant/Downloads/VTKExamples/build'
[  0%] Built target Generate2DAMRDataSetWithPulse
make[2]: Entering directory '/home/jaswant/Downloads/VTKExamples/build'
Scanning dependencies of target CompositePolyDataMapper
make[2]: Leaving directory '/home/jaswant/Downloads/VTKExamples/build'
make[2]: Entering directory '/home/jaswant/Downloads/VTKExamples/build'
[  1%] Building CXX object src/Cxx/CompositeData/CMakeFiles/CompositePolyDataMapper.dir/CompositePolyDataMapper.cxx.o
[  1%] Linking CXX executable ../../../bin/CompositePolyDataMapper
make[2]: Leaving directory '/home/jaswant/Downloads/VTKExamples/build'
[  1%] Built target CompositePolyDataMapper
make[2]: Entering directory '/home/jaswant/Downloads/VTKExamples/build'
Scanning dependencies of target Generate3DAMRDataSetWithPulse
make[2]: Leaving directory '/home/jaswant/Downloads/VTKExamples/build'
make[2]: Entering directory '/home/jaswant/Downloads/VTKExamples/build'
[  1%] Building CXX object src/Cxx/CompositeData/CMakeFiles/Generate3DAMRDataSetWithPulse.dir/Generate3DAMRDataSetWithPulse.cxx.o
[  1%] Linking CXX executable ../../../bin/Generate3DAMRDataSetWithPulse
make[2]: Leaving directory '/home/jaswant/Downloads/VTKExamples/build'
[  1%] Built target Generate3DAMRDataSetWithPulse
make[2]: Entering directory '/home/jaswant/Downloads/VTKExamples/build'
Scanning dependencies of target MultiBlockDataSet
make[2]: Leaving directory '/home/jaswant/Downloads/VTKExamples/build'
make[2]: Entering directory '/home/jaswant/Downloads/VTKExamples/build'
[  1%] Building CXX object src/Cxx/CompositeData/CMakeFiles/MultiBlockDataSet.dir/MultiBlockDataSet.cxx.o
[  1%] Linking CXX executable ../../../bin/MultiBlockDataSet
make[2]: Leaving directory '/home/jaswant/Downloads/VTKExamples/build'
[  1%] Built target MultiBlockDataSet
make[2]: Entering directory '/home/jaswant/Downloads/VTKExamples/build'
Scanning dependencies of target OverlappingAMR
make[2]: Leaving directory '/home/jaswant/Downloads/VTKExamples/build'
make[2]: Entering directory '/home/jaswant/Downloads/VTKExamples/build'
[  1%] Building CXX object src/Cxx/CompositeData/CMakeFiles/OverlappingAMR.dir/OverlappingAMR.cxx.o
[  1%] Linking CXX executable ../../../bin/OverlappingAMR
make[2]: Leaving directory '/home/jaswant/Downloads/VTKExamples/build'
[  1%] Built target OverlappingAMR
make[2]: Entering directory '/home/jaswant/Downloads/VTKExamples/build'
Scanning dependencies of target VisualizeKDTree
make[2]: Leaving directory '/home/jaswant/Downloads/VTKExamples/build'
make[2]: Entering directory '/home/jaswant/Downloads/VTKExamples/build'
[  1%] Building CXX object src/Cxx/DataStructures/CMakeFiles/VisualizeKDTree.dir/VisualizeKDTree.cxx.o
/home/jaswant/Downloads/VTKExamples/src/Cxx/DataStructures/VisualizeKDTree.cxx:1:10: fatal error: vtkActor.h: No such file or directory
    1 | #include <vtkActor.h>
      |          ^~~~~~~~~~~~
compilation terminated.
make[2]: *** [src/Cxx/DataStructures/CMakeFiles/VisualizeKDTree.dir/build.make:63: src/Cxx/DataStructures/CMakeFiles/VisualizeKDTree.dir/VisualizeKDTree.cxx.o] Error 1
make[2]: Leaving directory '/home/jaswant/Downloads/VTKExamples/build'
make[1]: *** [CMakeFiles/Makefile2:2995: src/Cxx/DataStructures/CMakeFiles/VisualizeKDTree.dir/all] Error 2
make[1]: Leaving directory '/home/jaswant/Downloads/VTKExamples/build'
make: *** [Makefile:84: all] Error 2

(CellPicking)difference of vtkInteractorStyleTrackballActor and vtkInteractorStyleTrackballCamera

today i study the demo of cxx/picking/cellpicking.
default ,the demo use the Interactor Style of vtkInteractorStyleTrackballCamera,the demo is ok.
in the demo,when we move mouse,Actually it change the camera postion.
the demo can't move single actor.
then i see the class vtkInteractorStyleTrackballActor, it can move single actor.
so i rewrite the demo.
i change the MouseInteractorStyle's parent class from vtkInteractorStyleTrackballCamera to vtkInteractorStyleTrackballActor, then the running result is not right.
for example,we run the demo again,we move the plane ,then pick the plane ,then the highlight part is always at the original postion, not the postion of actor when after moveing actor.

so, how to fix the problem?

Failed to build if PoissonReconstruction enabled in VTK build

From @lorensen :

I have enabled PoissonReconstruction in my vtk build, but the VTKExample that uses it
gets the following error( It worked before @jcfr VTK changes)

$ make PoissonExtractSurface
Building CXX object
src/Cxx/Points/CMakeFiles/PoissonExtractSurface.dir/PoissonExtractSurface.cxx.o
/Users/lorensen/ProjectsGIT/VTKExamples/src/Cxx/Points/PoissonExtractSurface.cxx:9:10:
fatal error:
      'vtkPoissonReconstruction.h' file not found
#include <vtkPoissonReconstruction.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[3]: *** [src/Cxx/Points/CMakeFiles/PoissonExtractSurface.dir/PoissonExtractSurface.cxx.o]
Error 1
make[2]: *** [src/Cxx/Points/CMakeFiles/PoissonExtractSurface.dir/all] Error 2
make[1]: *** [src/Cxx/Points/CMakeFiles/PoissonExtractSurface.dir/rule] Error 2
make: *** [PoissonExtractSurface] Error 2

Fix: Compilation issues with Cxx examples

Hi,
This issue is to address problems with compiling the Cxx examples on Linux.
I opened a PR #245

Background:
As a Developer I want to contribute to this project.
When following the instructions here:
https://lorensen.github.io/VTKExamples/site/Instructions/ForDevelopers/
I found that building all the examples does not succeed, using the default CMake configuration, to varying degrees depending on what version of VTK you are using.

How to reproduce:

  • Install Ubuntu 16.04
  • Use VTK 6.2 from Ubuntu repo, or compile VTK 6.2 to 8.1.0 from source
  • Use default CMake config, including without C++11
  • Complete all steps to "7. Build the VTKExamples", which is to runmake
  • The compilation will not finish
    .

Issues:
I found that many of the Cxx examples would not compile "out of the box" for me, due to:

  1. Missing a header include
  2. Need a specific version of VTK
  3. Need C++11

.

Fixes made in this PR:

1. Missing headers
These were added.

2. Need specific version of VTK
For these examples, the missing guard was added so the example only compiles if you have the minimum version.
Either using the macro:

Requires_Version()

or

if(NOT ${VTK_VERSION} VERSION_EQUAL "7.0.0")
endif()

3. Need C++ 11
Whilst we could debate this, the VTK documentation says that the C++03 standard is used: https://www.vtk.org/Wiki/VTK/Wrapping_C%2B%2B11_Code

Most of the examples do not require C++11, but a few do, which breaks the build.

Therefore, where possible, example code was changed to follow the older standard.
e.g. by removing auto
If the change was not easy, because a new feature is used or affects too many lines, a guard was added so the example will only compile if the user has enabled C++11.

Using either a new macro:

Requires_CxxVersion()

or

if (USING_CPP11)
endif()

I added a script CheckCxxStandard.cmake that attempts to handle that users can do either:
Set the "-std=c++11" flag, possibly via some IDE
OR use the newer CMake command : set(CMAKE_CXX_STANDARD 11)

The script can detect the flags "std=c++11" or "std=gnu++11"
and is compatible if the user enables set(CMAKE_CXX_STANDARD 11) or set(CMAKE_CXX_STANDARD 14)

.

Tests:
These changes were tested with multiple versions of VTK using:

  • Ubuntu 16.04
  • CXX compiler GNU 5.4.0
  • the default CMake options for VTK, except for enabling Qt5 starting from VTK 7.1.0

Qt4
VTK 6.2.0
VTK 6.2.0 C++11
VTK 7.0.0
VTK 7.0.0 C++11
VTK 7.1.0

Qt5
VTK 7.1.0 C++11
VTK 8.0.0
VTK 8.0.0
VTK 8.1.0
VTK 8.1.0 C++11

.

Hopefully this work will help other users. Your feedback is welcome.

.

Shadows example looks weird

Hi there!

I'm trying to run the Python Rendering/Shadows example with vtk8.1.0, on windows 10 (through anaconda3).

The result seems a bit odd to me. I can't understand where the rectangular shaded area comes from. What is casting that long straight shadow on the floor? It can't be from the sphere as a sphere would only cast oblong shadows.

the code is just as in master, the lights are at [0, 1, 0.2], and [1.0, 1.0, 1.0]

image

Missing vtkHausdorffDistancePointSetFilter in VTK

Hi,

I'm trying to align two polydata sets using the following example:
https://lorensen.github.io/VTKExamples/site/Python/PolyData/AlignTwoPolyDatas/

But VTK is unable to import the vtkHausdorffDistancePointSetFilter. I google the issue and searched the local files and it seems like this feature isen't implemented in the current release?

I'm looking for guidance on how I can get this to work. Is there a build that can be downloaded or is there a manual way to add this filter?

Best regards,
Patrik

Improve this so the repositories do not contain all the data

This repository should be improved to reduce it's size (currently over 1Gb)

  • Data and Baseline could be stored in VTK data and baselines with on demand download
  • .html file could be stored as a secondary submodule

This would allow this repository integration into VTK so the examples could be considered actual tests and more easy to maintain for developers.

Another solution would be to put all the source files directly in VTK and this repository would use them to build the website.

Possible error on python ElevationBandsWithGlyphs example

VTKExamples/Python/Visualization/ElevationBandsWithGlyphs

On ReverseLUT, I think we also need to reverse the annotations. Fixed by add the line "revList = reversed(list(range(t + 1))) after the second t assignment.

def ReverseLUT(lut):
"""
Create a lookup table with the colors reversed.
:param: lut - An indexed lookup table.
:return: The reversed indexed lookup table.
"""
lutr = vtk.vtkLookupTable()
lutr.DeepCopy(lut)
t = lut.GetNumberOfTableValues() - 1
revList = reversed(list(range(t + 1)))
for i in revList:
rgba = [0, 0, 0]
v = float(i)
lut.GetColor(v, rgba)
rgba.append(lut.GetOpacity(v))
lutr.SetTableValue(t - i, rgba)
t = lut.GetNumberOfAnnotatedValues() - 1
------>revList = reversed(list(range(t + 1)))<-------------
for i in revList:
lutr.SetAnnotation(t - i, lut.GetAnnotation(i))
return lutr

Invalid .dll Error adding item to Toolbox in VS 2019 c# Windows Forms.

Hello,
I am tring to use VTK for a C# project of mine.
I made a new Windows Forms Project and installed Kitware ActiViz 5.8 with NuGet.
I added a new tab to the Toolbox and tried adding the "Kitware.VTK.dll" as a new Control element.
When I click on "Choose item" a window pops up with 4 different tabs: .NET Framework Components, COM Components, Universal WIndows Components, WPF Components.
I tried following for all three tabs. I clicked "Browse..." and navigated to the "Kitware.CTK.dll" file in following directory:

C:\Folder\ProjectName\packages\Activiz.NET.x64.5.8.0\lib\net20\  

Following error pops up

The file  'C:\Folder\ProjectName\packages\Activiz.NET.x64.5.8.0\lib\net20\Kitware.VTK.dll' is not valid.

I am using Windows 10 Version 10.0.18363

x64-based machine
I have Visual Studio 2019 SDK installed. 

Microsoft Visual Studio Community 2019
Version 16.7.4
VisualStudio.16.Release/16.7.4+30517.126
Microsoft .NET Framework
Version 4.8.03752

Installed Version: Community

Visual C++ 2019   00435-60000-00000-AA016
Microsoft Visual C++ 2019

ASP.NET and Web Tools 2019   16.7.532.28833
ASP.NET and Web Tools 2019

Azure App Service Tools v3.0.0   16.7.532.28833
Azure App Service Tools v3.0.0

C# Tools   3.7.0-6.20459.4+7ee7c540e3bf19765695b1331c946ddf986d1516
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools   1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

IntelliCode Extension   1.0
IntelliCode Visual Studio Extension Detailed Info

Microsoft JVM Debugger   1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft MI-Based Debugger   1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual C++ Wizards   1.0
Microsoft Visual C++ Wizards

Microsoft Visual Studio VC Package   1.0
Microsoft Visual Studio VC Package

NuGet Package Manager   5.7.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

ProjectServicesPackage Extension   1.0
ProjectServicesPackage Visual Studio Extension Detailed Info

Syntax Visualizer   1.0
An extension for visualizing Roslyn SyntaxTrees.

Visual Basic Tools   3.7.0-6.20459.4+7ee7c540e3bf19765695b1331c946ddf986d1516
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools 10.10.0.0 for F# 4.7   16.7.0-beta.20361.3+3ef6f0b514198c0bfa6c2c09fefe41a740b024d5
Microsoft Visual F# Tools 10.10.0.0 for F# 4.7

Visual Studio Code Debug Adapter Host Package   1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Tools for CMake   1.0
Visual Studio Tools for CMake

Visual Studio Tools for Unity   4.7.1.0
Visual Studio Tools for Unity

Thank you very much for your help.

VisualDebugging bugs.

There are a few bugs in the VisualDebugging Cxx demo, some linked to the pipeline changes introduced in vtk 6.

  1. The angled brackets should be changed to quotes when including vtkTestFilter.h in VisualDebugging.cxx and vtkTestFilter.cxx, to change:

     #include <vtkTestFilter.h>
    

    to

     #include "vtkTestFilter.h"
    
  2. The line 35 of VisualDebugging.cxx should be modified from:

     this->Mapper->SetInput(intermediate);
    

    to

     this->Mapper->SetInputData(intermediate);
    
  3. The line 57 in vtkTestFilter.cxx should be changed from:

     appendFilter->AddInputConnection(this->Output->GetProducerPort());
    

    to

     appendFilter->AddInputData(this->Output);
    

I've attached a patch fix below.

Kind regards,

Francois.

patch.txt

Python Hardwareselector example needs updating

I have been trying to work with the hardware selector (https://lorensen.github.io/VTKExamples/site/Python/Visualization/HardwareSelector/) and had been having problems until it was pointed out to me that the x and y values in hsel.SetArea(0, 0, x, y) should be replaced with x-1 and y-1 respectively to give hsel.SetArea(0, 0, x-1, y-1).

My original question and the proposed solution on this issue (and one of the rendering on an intel gpu) is at the following link. The above modification fixed the behaviour of the selector and a workaround for the rendering was also found.
https://discourse.vtk.org/t/visible-cell-selection-hardwareselector-py-example-is-not-working-reliably/1262/10

Issues running the ReadOBJ sample

Hi,

I'm new to VTK and amazed by the abundance of algorithms, examples and detailed tutorials.
Outstanding work from the whole team!

I have tried to the ReadOBJ example, however I see a warning then the program exits:

2021-03-29 19:00:21.828 (   0.058s) [                ]vtkInteractorStyleSwitc:37    WARN| vtkInteractorStyleSwitchBase (000002080DD8E1C0): Warning: Link to vtkInteractionStyle for default style selection.

This is using VTK-9.0.1 build from source using Visual Studio 2019 on Windows 10.

I've tried several obj modules, including the VTK trumpet.obj mesh, saved in the same folder as ReadOBJ.exe to avoid any confusion around paths.

I'm hoping I'm missing something simple here.
Any hints/tips on how I may use this sample and view the loaded OBJ file ?

Many thanks,
George

Strange problem for QT and VTK

./RenderWindowUISingleInheritance: relocation error: /home/wjl/Qt5.12.2/5.12.2/gcc_64/lib/libQt5Widgets.so.5: symbol _ZN23QPlatformSystemTrayIcon20contextMenuRequestedE6QPointPK15QPlatformScreen version Qt_5_PRIVATE_API not defined in file libQt5Gui.so.5 with link time reference

Compling is OK.
but can not run.

Ubuntu 18.04
VTK 8.2.0 QT 5.12

Some questions about Cellpicking

recently i rewrite the cellpicking example,i can pick vertex, line,plane.
in this example, it create only one plane with triangle filter
what i rewrite contains as followed:
A. i create a plane,using four points.
B.then I create three vtkCellArray with the above four point,contains the line,vertex,and the polygon(the plane).
C.at the creation of vtkPolyData, i call the member function of vtkPolyData to set the line,vertex,and the plane. the functions are setpoints,setlines, setverts,and the setpolys.
D.In the rewrite class MouseInteractorStyle, i set the point size of selected.
after above,i can pick the point,line and plane. everything looks well.

then i want to move one actor Individually.
but the MouseInteractorStyle Derived from the vtkInteractorStyleTrackballCamera class.

default, when we use the vtkInteractorStyleTrackballCamera style, i move one actor by the mouse,all of the actor in the scene move.
so i see that ,the vtkInteractorStyleTrackballCamera class only can move the scene,it can't move the one actor Individually.
then i see the vtkiteraactorStyleTrackballActor class, it can help me .
when i change the parent class to the vtkiteraactorStyleTrackballActor ,it works.
but ,something unexcepted happened:

in the OnLeftButtonDown function, it create new actor to show in the actor.

so i have some questiones:

in the OnLeftButtonDown function, is there some methods to avoid create the actor.
because i move the actor of selected,the actor of the created will show.
so ,i confused.

How can I change scalar value for points in structured grid data?

Hi there,

I'm really new to paraview and vtk and I'm trying to write a programable filter in paraview and it seems need vtk functions. I'm trying to modify the content of my structured data's point value (not xyz but a scalar value), however, it seems structuredGrid don't have any scalar value to give a point besides its coordinates? May I check what will be a better way to do this?

Thanks!

Unused #if

In this code the #if execute the same code in the two branches

#if VTK890
this->qvtkWidgetLeft->setRenderWindow(renderWindowLeft);
this->qvtkWidgetRight->setRenderWindow(renderWindowRight);
#else
this->qvtkWidgetLeft->SetRenderWindow(renderWindowLeft);
this->qvtkWidgetRight->SetRenderWindow(renderWindowRight);
#endif

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.