Segfault when subclassing vtkProp and vtkPropAssembly
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
When subclassing vtkProp and vtkPropAssembly, rendering and picking are adversely affected by NULL returns from GetMatrix(). Rendering can segfault near line 119 of Filtering/vtkPropAssembly.cxx. Picking can exit early from line 332 of Rendering/vtkPicker.cxx.
Analysis of the crash shows that the vtkAssemblyPath built for these subclasses contain NULL Matrix entries. Thankfully, the virtual GetMatrix() can be overridden in subclasses of vtkProp and vtkPropAssembly. That only gets you halfway there, though. The base classes still try to insert NULL matricies into the vtkAssemblyPath when built for subclasses.
Changes are proposed which will cause subclasses to act correctly. Since the base classes have GetMatrix() defined to return NULL, I predict that the following changes will not adversely affect the operation of VTK.
Common/vtkProp.cxx Line 72: from: path->AddNode(this,NULL); to: path->AddNode(this, this->GetMatrix()); Filtering/vtkPropAssembly.cxx Line 313: from: path->AddNode(this,NULL); to: path->AddNode(this, this->GetMatrix()); Line 346: from: path->AddNode(prop,NULL); to: path->AddNode(prop, prop->GetMatrix());