------------------------------------------------------------------------------
| 3101 | |
| 3102 | //------------------------------------------------------------------------------ |
| 3103 | void vtkUnstructuredGridVolumeZSweepMapper::MainLoop(vtkRenderWindow* renWin) |
| 3104 | { |
| 3105 | // used to know if the next vertex is on the same plane |
| 3106 | double currentZ; // than the previous one. If so, the z-target has to be |
| 3107 | // updated (without calling the compositing function) |
| 3108 | if (this->EventList->GetNumberOfItems() == 0) |
| 3109 | { |
| 3110 | return; // we are done. |
| 3111 | } |
| 3112 | |
| 3113 | // initialize the "previous z-target" to the z-coordinate of the first |
| 3114 | // vertex. |
| 3115 | double previousZTarget = 0.0; |
| 3116 | vtkIdType vertex = this->EventList->Peek(0, previousZTarget); |
| 3117 | |
| 3118 | #ifdef BACK_TO_FRONT |
| 3119 | previousZTarget = -previousZTarget; // because the EventList store -z |
| 3120 | #endif |
| 3121 | |
| 3122 | // (section 2 paragraph 11) |
| 3123 | // initialize the "z-target" with the maximum z-coordinate of the adjacent |
| 3124 | // vertices to the first vertex. The adjacent vertices can be found |
| 3125 | // indirectly by using the "use set" of the first vertex (cells), and |
| 3126 | // by taking the vertices of all those cells. |
| 3127 | // |
| 3128 | double zTarget = previousZTarget; |
| 3129 | std::list<vtkFace*>::iterator it; |
| 3130 | std::list<vtkFace*>::iterator itEnd; |
| 3131 | |
| 3132 | // this->MaxRecordedPixelListSize=0; |
| 3133 | this->MaxPixelListSizeReached = 0; |
| 3134 | this->XBounds[0] = this->ImageInUseSize[0]; |
| 3135 | this->XBounds[1] = 0; |
| 3136 | this->YBounds[0] = this->ImageInUseSize[1]; |
| 3137 | this->YBounds[1] = 0; |
| 3138 | |
| 3139 | vtkIdType progressCount = 0; |
| 3140 | vtkIdType sum = this->EventList->GetNumberOfItems(); |
| 3141 | |
| 3142 | if (this->MemoryManager == nullptr) |
| 3143 | { |
| 3144 | this->MemoryManager = new vtkPixelListEntryMemory; |
| 3145 | } |
| 3146 | |
| 3147 | this->UseSet->SetNotRendered(); |
| 3148 | |
| 3149 | int aborted = 0; |
| 3150 | // for each vertex of the "event list" |
| 3151 | while (this->EventList->GetNumberOfItems() > 0) |
| 3152 | { |
| 3153 | this->UpdateProgress(static_cast<double>(progressCount) / sum); |
| 3154 | |
| 3155 | aborted = renWin->CheckAbortStatus(); |
| 3156 | if (aborted) |
| 3157 | { |
| 3158 | break; |
| 3159 | } |
| 3160 | ++progressCount; |
no test coverage detected