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

Method Load

Rendering/OpenGL2/vtkOpenGLTexture.cxx:118–404  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Implement base class method.

Source from the content-addressed store, hash-verified

116//------------------------------------------------------------------------------
117// Implement base class method.
118void vtkOpenGLTexture::Load(vtkRenderer* ren)
119{
120 vtkOpenGLRenderWindow* renWin = static_cast<vtkOpenGLRenderWindow*>(ren->GetRenderWindow());
121 vtkOpenGLState* ostate = renWin->GetState();
122
123 if (!this->ExternalTextureObject)
124 {
125 if (this->GetInputDataObject(0, 0) == nullptr)
126 {
127 return;
128 }
129 vtkImageData* input = this->GetInput();
130 int numIns = 1;
131 vtkMTimeType inputTime = input->GetMTime();
132
133 if (this->CubeMap)
134 {
135 for (int i = 1; i < this->GetNumberOfInputPorts(); ++i)
136 {
137 vtkImageData* in = vtkImageData::SafeDownCast(this->GetInputDataObject(i, 0));
138 if (!in)
139 {
140 break;
141 }
142 inputTime = std::max(inputTime, in->GetMTime());
143 numIns++;
144 }
145
146 if (numIns < 6)
147 {
148 vtkErrorMacro("Cube Maps require 6 inputs");
149 return;
150 }
151 }
152
153 if (this->RenderWindow == nullptr && this->LoadTime.GetMTime() > this->GetMTime())
154 {
155 vtkErrorMacro("A render window was deleted without releasing graphics resources");
156 }
157
158 // Need to reload the texture.
159 // There used to be a check on the render window's mtime, but
160 // this is too broad of a check (e.g. it would cause all textures
161 // to load when only the desired update rate changed).
162 // If a better check is required, check something more specific,
163 // like the graphics context.
164
165 // has something changed so that we need to rebuild the texture?
166 if (this->GetMTime() > this->LoadTime.GetMTime() || inputTime > this->LoadTime.GetMTime() ||
167 (this->GetLookupTable() && this->GetLookupTable()->GetMTime() > this->LoadTime.GetMTime()) ||
168 (this->RenderWindow == nullptr ||
169 renWin->GetGenericContext() != this->RenderWindow->GetGenericContext()) ||
170 renWin->GetContextCreationTime() > this->LoadTime)
171 {
172 int size[3];
173 int xsize, ysize;
174
175 this->RenderWindow = renWin;

Callers 11

RenderMethod · 0.95
RenderFunction · 0.45
RenderPieceStartMethod · 0.45
RenderFunction · 0.45
RenderPieceStartMethod · 0.45
DeviceRenderMethod · 0.45
RenderPieceStartMethod · 0.45
RenderFunction · 0.45
RenderFunction · 0.45
PreDrawMethod · 0.45
RenderPieceStartMethod · 0.45

Calls 15

ResampleToPowerOfTwoMethod · 0.95
GetInputDataObjectMethod · 0.80
ResetFormatAndTypeMethod · 0.80
vtkglGetIntegervMethod · 0.80
CreateDepthFromRawMethod · 0.80
CreateCubeFromRawMethod · 0.80
Create2DFromRawMethod · 0.80
GetOpenGLVersionMethod · 0.80
GetVTKWindowMethod · 0.80
SendParametersMethod · 0.80

Tested by

no test coverage detected