MCPcopy Create free account
hub / github.com/Kitware/VTK / SetMatrix

Method SetMatrix

Filters/Modeling/vtkCollisionDetectionFilter.cxx:196–235  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

194}
195
196void vtkCollisionDetectionFilter::SetMatrix(int i, vtkMatrix4x4* matrix)
197{
198 if (i > 1 || i < 0)
199 {
200 vtkErrorMacro(<< "Index " << i << " is out of range in SetMatrix. Only two matrices allowed!");
201 return;
202 }
203
204 if (matrix == this->Matrix[i])
205 {
206 return;
207 }
208
209 if (this->Transform[i])
210 {
211 this->Transform[i]->Delete();
212 this->Transform[i] = nullptr;
213 }
214
215 if (this->Matrix[i])
216 {
217 this->Matrix[i]->Delete();
218 this->Matrix[i] = nullptr;
219 }
220 vtkDebugMacro(<< "Setting matrix: " << i << " to point to " << matrix << endl);
221
222 if (matrix)
223 {
224 this->Matrix[i] = matrix;
225 }
226 matrix->Register(this);
227 vtkMatrixToLinearTransform* transform = vtkMatrixToLinearTransform::New();
228 // Consistent Register and UnRegisters.
229 transform->Register(this);
230 transform->Delete();
231 transform->SetInput(matrix);
232 this->Transform[i] = transform;
233 vtkDebugMacro(<< "Setting Transform " << i << " to points to: " << transform << endl);
234 this->Modified();
235}
236
237vtkMatrix4x4* vtkCollisionDetectionFilter::GetMatrix(int i)
238{

Callers 9

RequestDataMethod · 0.45
InitializeTransformFunction · 0.45
InitializeTransformFunction · 0.45
DefineTransformMethod · 0.45
TestCollisionDetectionFunction · 0.45
SliceOrderClass · 0.45

Calls 5

DeleteMethod · 0.65
NewFunction · 0.50
RegisterMethod · 0.45
SetInputMethod · 0.45
ModifiedMethod · 0.45

Tested by 4

InitializeTransformFunction · 0.36
InitializeTransformFunction · 0.36
TestCollisionDetectionFunction · 0.36