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

Method SetCenter

Filters/Sources/vtkPlaneSource.cxx:253–279  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Set the center of the plane. Will modify the Origin, Point1, and Point2 instance variables as necessary (i.e., translate the plane).

Source from the content-addressed store, hash-verified

251// Set the center of the plane. Will modify the Origin, Point1, and Point2
252// instance variables as necessary (i.e., translate the plane).
253void vtkPlaneSource::SetCenter(double center[3])
254{
255 if (this->Center[0] == center[0] && this->Center[1] == center[1] && this->Center[2] == center[2])
256 {
257 return; // no change
258 }
259 else
260 {
261 int i;
262 double v1[3], v2[3];
263
264 for (i = 0; i < 3; i++)
265 {
266 v1[i] = this->Point1[i] - this->Origin[i];
267 v2[i] = this->Point2[i] - this->Origin[i];
268 }
269
270 for (i = 0; i < 3; i++)
271 {
272 this->Center[i] = center[i];
273 this->Origin[i] = this->Center[i] - 0.5 * (v1[i] + v2[i]);
274 this->Point1[i] = this->Origin[i] + v1[i];
275 this->Point2[i] = this->Origin[i] + v2[i];
276 }
277 this->Modified();
278 }
279}
280
281//------------------------------------------------------------------------------
282// Set the center of the plane. Will modify the Origin, Point1, and Point2

Callers 15

SetBoundsMethod · 0.45
RequestDataMethod · 0.45
RecomputeSphereMethod · 0.45
RecomputeConeMethod · 0.45
TestSphereSourceFunction · 0.45
TestPlaneSourceFunction · 0.45
TestPointSourceFunction · 0.45
TestEllipseArcSourceFunction · 0.45

Calls 1

ModifiedMethod · 0.45

Tested by 12

TestSphereSourceFunction · 0.36
TestPlaneSourceFunction · 0.36
TestPointSourceFunction · 0.36
TestEllipseArcSourceFunction · 0.36
TestCylinderSourceFunction · 0.36
TestSuperquadricSourceFunction · 0.36
TestRegularPolygonSourceFunction · 0.36
TestConeSourceFunction · 0.36
TestGlyphSource2DFunction · 0.36
TestCubeSourceFunction · 0.36