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

Method RasterizeLine

Rendering/Volume/vtkUnstructuredGridVolumeZSweepMapper.cxx:3803–4058  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

3801
3802//------------------------------------------------------------------------------
3803void vtkUnstructuredGridVolumeZSweepMapper::RasterizeLine(
3804 vtkVertexEntry* v0, vtkVertexEntry* v1, bool exitFace)
3805{
3806 assert("pre: v0_exists" && v0 != nullptr);
3807 assert("pre: v1_exists" && v1 != nullptr);
3808 assert("pre: y_ordered" && v0->GetScreenY() <= v1->GetScreenY());
3809
3810 int lineCase;
3811 int xIncrement; // if true increment x, if false increment y
3812 int dx;
3813 int dy;
3814 int xSign;
3815
3816 // initialization is not useful, it is just to remove compiler warnings
3817 int dx2 = 0;
3818 int dy2 = 0;
3819 int e = 0;
3820
3821 double values[VTK_VALUES_SIZE];
3822 double pValues[VTK_VALUES_SIZE];
3823
3824 double dPv[VTK_VALUES_SIZE];
3825 double dInvW;
3826 double dZ;
3827
3828 double zView;
3829 double invW;
3830
3831 int i;
3832
3833 int x = v0->GetScreenX();
3834 int y = v0->GetScreenY();
3835
3836 // 1. Find the case
3837 dx = v1->GetScreenX() - v0->GetScreenX();
3838 if (dx < 0)
3839 {
3840 dx = -dx;
3841 xSign = -1;
3842 }
3843 else
3844 {
3845 xSign = 1;
3846 }
3847 dy = v1->GetScreenY() - v0->GetScreenY();
3848 xIncrement = dx > dy;
3849 if (xIncrement)
3850 {
3851 if (dy == 0)
3852 {
3853 lineCase = VTK_LINE_CONSTANT;
3854 }
3855 else
3856 {
3857 lineCase = VTK_LINE_BRESENHAM;
3858 dx2 = dx << 1;
3859 dy2 = dy << 1;
3860 e = dx;

Callers 1

RasterizeTriangleMethod · 0.95

Calls 10

GetScreenYMethod · 0.80
GetScreenXMethod · 0.80
AllocateEntryMethod · 0.80
GetListSizeMethod · 0.80
assertFunction · 0.50
GetInvWMethod · 0.45
GetValuesMethod · 0.45
GetZviewMethod · 0.45
InitMethod · 0.45
AddAndSortMethod · 0.45

Tested by

no test coverage detected