18VTK_ABI_NAMESPACE_BEGIN
56 int scalarMode,
int arrayAccessMode,
int arrayId,
const char* arrayName,
59 bool needUpdate =
false;
60 bool modified =
false;
82 while (!obsolete && i < 6)
84 obsolete = obsolete || this->
LoadedExtent[i] > textureExtent[i];
86 obsolete = obsolete || this->
LoadedExtent[i] < textureExtent[i];
98 input, scalarMode, arrayAccessMode, arrayId, arrayName, this->
LoadedCellFlag);
105 std::cout <<
"Mask should be VTK_UNSIGNED_CHAR." << std::endl;
109 std::cout <<
"Mask should be a one-component scalar field." << std::endl;
112 GLint internalFormat = GL_R8;
113 GLenum format = GL_RED;
121 textureSize[i] = textureExtent[2 * i + 1] - textureExtent[2 * i] + 1;
126 glGetIntegerv(GL_MAX_3D_TEXTURE_SIZE, &width);
127 this->
Loaded = textureSize[0] <= width && textureSize[1] <= width && textureSize[2] <= width;
131 this->
Loaded = textureSize[0] * textureSize[1] * textureSize[2] *
136 ostate->vtkglPixelStorei(GL_UNPACK_ALIGNMENT, 1);
138 if (!(textureExtent[1] - textureExtent[0] + cellFlag == dim[0]))
140 ostate->vtkglPixelStorei(GL_UNPACK_ROW_LENGTH, dim[0] - cellFlag);
142 if (!(textureExtent[3] - textureExtent[2] + cellFlag == dim[1]))
144 ostate->vtkglPixelStorei(GL_UNPACK_IMAGE_HEIGHT, dim[1] - cellFlag);
148 ((textureExtent[4] * (dim[1] - cellFlag) + textureExtent[2]) * (dim[0] - cellFlag) +
156 textureSize[0], textureSize[1], textureSize[2], 1, scalarType, dataPtr);
165 ostate->vtkglPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
166 ostate->vtkglPixelStorei(GL_UNPACK_IMAGE_HEIGHT, 0);
181 swapBounds[0] = (spacing[0] < 0);
182 swapBounds[1] = (spacing[1] < 0);
183 swapBounds[2] = (spacing[2] < 0);
199 origin[0] +
static_cast<double>(this->
LoadedExtent[0 + swapBounds[0]]) * spacing[0];
201 origin[1] +
static_cast<double>(this->
LoadedExtent[2 + swapBounds[1]]) * spacing[1];
202 this->LoadedBounds[4] =
203 origin[2] +
static_cast<double>(this->
LoadedExtent[4 + swapBounds[2]]) * spacing[2];
204 this->LoadedBounds[1] =
205 origin[0] +
static_cast<double>(this->
LoadedExtent[1 - swapBounds[0]]) * spacing[0];
206 this->LoadedBounds[3] =
207 origin[1] +
static_cast<double>(this->
LoadedExtent[3 - swapBounds[1]]) * spacing[1];
208 this->LoadedBounds[5] =
209 origin[2] +
static_cast<double>(this->
LoadedExtent[5 - swapBounds[2]]) * spacing[2];
213 int wholeTextureExtent[6];
218 wholeTextureExtent[i]--;
225 if (this->
LoadedExtent[2 * i] == wholeTextureExtent[2 * i])
232 origin[i] + (
static_cast<double>(this->
LoadedExtent[2 * i]) + 0.5) * spacing[i];
235 if (this->
LoadedExtent[2 * i + 1] == wholeTextureExtent[2 * i + 1])
237 this->
LoadedBounds[2 * i + 1 - swapBounds[i]] = origin[i] +
238 (
static_cast<double>(this->
LoadedExtent[2 * i + 1]) + 1.0) * spacing[i];
242 this->
LoadedBounds[2 * i + 1 - swapBounds[i]] = origin[i] +
243 (
static_cast<double>(this->
LoadedExtent[2 * i + 1]) + 0.5) * spacing[i];
308 std::map<vtkImageData*, vtkVolumeMask*>
Map;
int GetNumberOfComponents() const
Set/Get the dimension (n) of the components.
virtual int GetDataType() const
Return the underlying data type.
virtual int GetDataTypeSize() const =0
Return the size of the underlying data type.
virtual void * GetVoidPointer(vtkIdType valueIdx)=0
Return a void pointer.
static vtkDataArray * GetScalars(vtkDataSet *input, int scalarMode, int arrayAccessMode, int arrayId, const char *arrayName, int &cellFlag)
Internal helper function for getting the active scalars.
int * GetDimensions()
Get dimensions of this structured points dataset.
virtual int * GetExtent()
Set/Get the extent.
vtkSmartPointer< vtkDataArray > ToAOSDataArray()
If the array is not already in AOS format, return a new array that is with the same data.
vtkMTimeType GetMTime() override
Datasets are composite objects and need to check each part for MTime THIS METHOD IS THREAD SAFE.
topologically and geometrically regular array of data
virtual double * GetOrigin()
Set/Get the origin of the dataset.
virtual double * GetSpacing()
Set the spacing (width,height,length) of the cubical cells that compose the data set.
std::map< vtkImageData *, vtkVolumeMask * > Map
vtkMapMaskTextureId()=default
virtual void Delete()
Delete a VTK object.
static vtkOpenGLRenderWindow * SafeDownCast(vtkObjectBase *o)
virtual vtkOpenGLState * GetState()
abstract specification for renderers
vtkRenderWindow * GetRenderWindow()
Specify the rendering window in which to draw.
In case DepthTextureCompare is true, specify the comparison function in use.
void SetContext(vtkOpenGLRenderWindow *)
Get/Set the context.
virtual void SetWrapT(int)
Wrap mode for the first texture coordinate "t" Valid values are:
void SetInternalFormat(unsigned int glInternalFormat)
Get the format (GLenum) and internal format (GLenum) in use.
virtual void Activate()
Activate and Bind the texture.
virtual void SetMagnificationFilter(int)
Magnification filter mode.
virtual unsigned int GetHandle()
Returns the OpenGL handle.
int GetTextureUnit()
Return the texture unit used for this texture.
virtual void SetBorderColor(float, float, float, float)
Border Color (RGBA).
virtual void ReleaseGraphicsResources(vtkWindow *win)
Deactivate and UnBind the texture.
void SetDataType(unsigned int glType)
Get the data type for the texture as GLenum type.
void Deactivate()
Deactivate and UnBind the texture.
virtual void SetWrapR(int)
Wrap mode for the first texture coordinate "r" Valid values are:
void SetFormat(unsigned int glFormat)
Get/Set format (OpenGL internal format) that should be used.
bool Create3DFromRaw(unsigned int width, unsigned int height, unsigned int depth, int numComps, int dataType, void *data)
Create a 3D texture from client memory numComps must be in [1-4].
virtual void SetMinificationFilter(int)
Minification filter mode.
static vtkTextureObject * New()
virtual void SetWrapS(int)
Wrap mode for the first texture coordinate "s" Valid values are:
record modification and/or execution time
void Modified()
Set this objects time to the current time.
void Update(vtkRenderer *ren, vtkImageData *input, int cellFlag, int textureExtent[6], int scalarMode, int arrayAccessMode, int arrayId, const char *arrayName, vtkIdType maxMemoryInBytes)
vtkTextureObject * Texture
vtkIdType LoadedExtent[6]
vtkTimeStamp GetBuildTime()
vtkIdType * GetLoadedExtent()
void ReleaseGraphicsResources(vtkWindow *window)
double * GetLoadedBounds()
window superclass for vtkRenderWindow
#define VTK_UNSIGNED_CHAR