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

Method SizeHandles

Interaction/Widgets/vtk3DWidget.cxx:127–164  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

125
126//------------------------------------------------------------------------------
127double vtk3DWidget::SizeHandles(double factor)
128{
129 int i;
130 vtkRenderer* renderer;
131
132 if (!this->ValidPick || !(renderer = this->CurrentRenderer) || !renderer->GetActiveCamera())
133 {
134 return (this->HandleSize * factor * this->InitialLength);
135 }
136 else
137 {
138 double radius, z;
139 double windowLowerLeft[4], windowUpperRight[4];
140 double* viewport = renderer->GetViewport();
141 const int* winSize = renderer->GetRenderWindow()->GetSize();
142 double focalPoint[4];
143
144 this->ComputeWorldToDisplay(
145 this->LastPickPosition[0], this->LastPickPosition[1], this->LastPickPosition[2], focalPoint);
146 z = focalPoint[2];
147
148 double x = winSize[0] * viewport[0];
149 double y = winSize[1] * viewport[1];
150 this->ComputeDisplayToWorld(x, y, z, windowLowerLeft);
151
152 x = winSize[0] * viewport[2];
153 y = winSize[1] * viewport[3];
154 this->ComputeDisplayToWorld(x, y, z, windowUpperRight);
155
156 for (radius = 0.0, i = 0; i < 3; i++)
157 {
158 radius +=
159 (windowUpperRight[i] - windowLowerLeft[i]) * (windowUpperRight[i] - windowLowerLeft[i]);
160 }
161
162 return (sqrt(radius) * factor * this->HandleSize);
163 }
164}
165
166//------------------------------------------------------------------------------
167void vtk3DWidget::PrintSelf(ostream& os, vtkIndent indent)

Callers 2

BuildRepresentationMethod · 0.45
BuildRepresentationMethod · 0.45

Calls 7

GetActiveCameraMethod · 0.80
GetViewportMethod · 0.80
ComputeWorldToDisplayMethod · 0.80
ComputeDisplayToWorldMethod · 0.80
sqrtFunction · 0.50
GetSizeMethod · 0.45
GetRenderWindowMethod · 0.45

Tested by

no test coverage detected