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

Method Scale

Interaction/Widgets/vtkTensorRepresentation.cxx:809–834  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

807
808//------------------------------------------------------------------------------
809void vtkTensorRepresentation::Scale(
810 const double* vtkNotUsed(p1), const double* vtkNotUsed(p2), int vtkNotUsed(X), int Y)
811{
812 double* pts = static_cast<vtkDoubleArray*>(this->Points->GetData())->GetPointer(0);
813 double* center = static_cast<vtkDoubleArray*>(this->Points->GetData())->GetPointer(3 * 14);
814 double sf;
815
816 if (Y > this->LastEventPosition[1])
817 {
818 sf = 1.03;
819 }
820 else
821 {
822 sf = 0.97;
823 }
824
825 // Move the corners
826 for (int i = 0; i < 8; i++, pts += 3)
827 {
828 pts[0] = sf * (pts[0] - center[0]) + center[0];
829 pts[1] = sf * (pts[1] - center[1]) + center[1];
830 pts[2] = sf * (pts[2] - center[2]) + center[2];
831 }
832 this->PositionHandles();
833 this->UpdateTensorFromWidget();
834}
835
836//------------------------------------------------------------------------------
837void vtkTensorRepresentation::ComputeNormals()

Callers 2

WidgetInteractionMethod · 0.95

Calls 4

PositionHandlesMethod · 0.95
GetPointerMethod · 0.45
GetDataMethod · 0.45

Tested by

no test coverage detected