------------------------------------------------------------------------------ Creates points for ticks (minor, major, gridlines) in correct position for a generic axis. ------------------------------------------------------------------------------
| 1746 | // for a generic axis. |
| 1747 | //------------------------------------------------------------------------------ |
| 1748 | bool vtkAxisActor::BuildTickPoints(double p1[3], double p2[3], bool force) |
| 1749 | { |
| 1750 | // Prevent any unwanted computation |
| 1751 | if (!force && (this->AxisPosition == this->LastAxisPosition) && |
| 1752 | (this->TickLocation == this->LastTickLocation) && |
| 1753 | (this->BoundsTime.GetMTime() < this->BuildTime.GetMTime()) && |
| 1754 | (this->Point1Coordinate->GetMTime() < this->BuildTickPointsTime.GetMTime()) && |
| 1755 | (this->Point2Coordinate->GetMTime() < this->BuildTickPointsTime.GetMTime()) && |
| 1756 | (this->Range[0] == this->LastRange[0]) && (this->Range[1] == this->LastRange[1])) |
| 1757 | { |
| 1758 | return false; |
| 1759 | } |
| 1760 | |
| 1761 | // Reset previous objects |
| 1762 | this->MinorTickPts->Reset(); |
| 1763 | this->MajorTickPts->Reset(); |
| 1764 | this->GridlinePts->Reset(); |
| 1765 | this->InnerGridlinePts->Reset(); |
| 1766 | this->GridpolyPts->Reset(); |
| 1767 | |
| 1768 | // As we assume that the Axis is not necessary aligned to the absolute X/Y/Z |
| 1769 | // axis, we will convert the absolute XYZ information to relative one |
| 1770 | // using a base composed as follow (axis, u, v) |
| 1771 | |
| 1772 | double coordSystem[3][3]; // axisVector, uVector, vVector |
| 1773 | |
| 1774 | switch (this->AxisType) |
| 1775 | { |
| 1776 | case VTK_AXIS_TYPE_X: |
| 1777 | memcpy(&coordSystem[0], this->AxisBaseForX, 3 * sizeof(double)); |
| 1778 | memcpy(&coordSystem[1], this->AxisBaseForY, 3 * sizeof(double)); |
| 1779 | memcpy(&coordSystem[2], this->AxisBaseForZ, 3 * sizeof(double)); |
| 1780 | break; |
| 1781 | |
| 1782 | case VTK_AXIS_TYPE_Y: |
| 1783 | memcpy(&coordSystem[0], this->AxisBaseForY, 3 * sizeof(double)); |
| 1784 | memcpy(&coordSystem[1], this->AxisBaseForX, 3 * sizeof(double)); |
| 1785 | memcpy(&coordSystem[2], this->AxisBaseForZ, 3 * sizeof(double)); |
| 1786 | break; |
| 1787 | |
| 1788 | case VTK_AXIS_TYPE_Z: |
| 1789 | memcpy(&coordSystem[0], this->AxisBaseForZ, 3 * sizeof(double)); |
| 1790 | memcpy(&coordSystem[1], this->AxisBaseForX, 3 * sizeof(double)); |
| 1791 | memcpy(&coordSystem[2], this->AxisBaseForY, 3 * sizeof(double)); |
| 1792 | break; |
| 1793 | |
| 1794 | default: |
| 1795 | // shouldn't get here |
| 1796 | break; |
| 1797 | } |
| 1798 | |
| 1799 | //-----------------------------------------------------------------------------* |
| 1800 | // Build Minor Ticks |
| 1801 | //-----------------------------------------------------------------------------* |
| 1802 | if (this->Log) |
| 1803 | { |
| 1804 | this->BuildMinorTicksLog(p1, p2, coordSystem); |
| 1805 | } |
no test coverage detected