------------------------------------------------------------------------------
| 1835 | |
| 1836 | //------------------------------------------------------------------------------ |
| 1837 | void vtkAxisActor::BuildAxisGridLines(double p1[3], double p2[3], double localCoordSys[3][3]) |
| 1838 | { |
| 1839 | int uIndex = 0, vIndex = 0; |
| 1840 | double uGridLength = 0.0, vGridLength = 0.0; |
| 1841 | double gridPointClosest[3], gridPointFarest[3], gridPointU[3], gridPointV[3]; |
| 1842 | double innerGridPointClosestU[3], innerGridPointClosestV[3]; |
| 1843 | double innerGridPointFarestU[3], innerGridPointFarestV[3]; |
| 1844 | double deltaVector[3]; |
| 1845 | |
| 1846 | int uMult = vtkAxisActorMultiplierTable1[this->AxisPosition]; |
| 1847 | int vMult = vtkAxisActorMultiplierTable2[this->AxisPosition]; |
| 1848 | |
| 1849 | double* axisVector = localCoordSys[0]; |
| 1850 | double* uVector = localCoordSys[1]; |
| 1851 | double* vVector = localCoordSys[2]; |
| 1852 | |
| 1853 | switch (this->AxisType) |
| 1854 | { |
| 1855 | case VTK_AXIS_TYPE_X: |
| 1856 | uGridLength = this->GridlineYLength; |
| 1857 | vGridLength = this->GridlineZLength; |
| 1858 | uIndex = 1; |
| 1859 | vIndex = 2; |
| 1860 | break; |
| 1861 | case VTK_AXIS_TYPE_Y: |
| 1862 | uGridLength = this->GridlineXLength; |
| 1863 | vGridLength = this->GridlineZLength; |
| 1864 | uIndex = 0; |
| 1865 | vIndex = 2; |
| 1866 | break; |
| 1867 | case VTK_AXIS_TYPE_Z: |
| 1868 | uGridLength = this->GridlineXLength; |
| 1869 | vGridLength = this->GridlineYLength; |
| 1870 | uIndex = 0; |
| 1871 | vIndex = 1; |
| 1872 | break; |
| 1873 | default: |
| 1874 | // shouldn't get here |
| 1875 | break; |
| 1876 | } |
| 1877 | |
| 1878 | bool hasOrthogonalVectorBase = this->AxisBaseForX[0] == 1 && this->AxisBaseForX[1] == 0 && |
| 1879 | this->AxisBaseForX[2] == 0 && this->AxisBaseForY[0] == 0 && this->AxisBaseForY[1] == 1 && |
| 1880 | this->AxisBaseForY[2] == 0 && this->AxisBaseForZ[0] == 0 && this->AxisBaseForZ[1] == 0 && |
| 1881 | this->AxisBaseForZ[2] == 1; |
| 1882 | |
| 1883 | // - Initialize all points to be on the axis |
| 1884 | for (int i = 0; i < 3; i++) |
| 1885 | { |
| 1886 | gridPointClosest[i] = gridPointFarest[i] = gridPointU[i] = gridPointV[i] = p1[i]; |
| 1887 | deltaVector[i] = (p2[i] - p1[i]); |
| 1888 | } |
| 1889 | |
| 1890 | double axisLength = vtkMath::Norm(deltaVector); |
| 1891 | double rangeScale = axisLength / (this->Range[1] - this->Range[0]); |
| 1892 | |
| 1893 | // - Test that the delta is numerically different from zero |
| 1894 | if (fabs(this->DeltaMajor[this->AxisType]) <= FLT_EPSILON) |
nothing calls this directly
no test coverage detected