# encoding: utf-8
# module vtkmodules.vtkRenderingOpenGL2
# from C:\Users\xukai\Downloads\发票2\venv\Lib\site-packages\vtkmodules\vtkRenderingOpenGL2.cp311-win_amd64.pyd
# by generator 1.147
# no doc

# imports
import vtkmodules.vtkCommonCore as __vtkmodules_vtkCommonCore
import vtkmodules.vtkRenderingCore as __vtkmodules_vtkRenderingCore
import vtkmodules.vtkRenderingHyperTreeGrid as __vtkmodules_vtkRenderingHyperTreeGrid


class vtkOpenGLInstanceCulling(__vtkmodules_vtkCommonCore.vtkObject):
    """
    vtkOpenGLInstanceCulling - Frustum culling and LOD management.
    
    Superclass: vtkObject
    
    This class is used to cull instances based on their transformation
    matrix. It was designed to improve performances when there is large
    number of instances in vtkOpenGLGlyph3DMapper.
    
    Each instance is tested on the GPU through vertex shader to know if
    it is inside of the frustum view. If it is, the distance to the
    camera is computed to select and send to the geometry shader the
    corresponding LOD index. The geometry shader register the instance to
    the corresponding vertex stream and therefore the corresponding
    transform feedback buffer in video memory.
    
    @warning   GL_ARB_gpu_shader5 extension is required.
    
    {.cpp}
    
    vtkNewculling; vtkIdType nbInstances = 1000000;
    
    // buffer of size 16*nbInstances containing transform matrices.
    vtkOpenGLBufferObject* bufferMatrix = ...;
    
    // buffer of size 4*nbInstances containing color buffer to pass
    through. vtkOpenGLBufferObject* bufferColor = ...;
    
    // Initialize LODs culling->InitLOD(polydata); // LOD0 : full
    geometry culling->AddLOD(2.0, 0.5); // LOD1 : after 2.0, 50%
    triangles culling->AddLOD(5.0, 0.99); // LOD2 : after 5.0, 1%
    triangles
    
    // Build shader and binds culling->BuildCullingShaders(ren, actor,
    nbInstances); culling->RunCullingShaders(nbInstances, bufferMatrix,
    bufferColor);
    
    // Get number of instances in LOD 0 int nbInstInLOD0 =
    culling->GetLOD(0).NumberOfInstances;
    
    // Get VBO and IBO of LOD 1 vtkOpenGLBufferObject* VBO1 =
    culling->GetLOD(1).PositionVBO; vtkOpenGLBufferObject* IBO1 =
    culling->GetLOD(1).IBO;
    
    // Get instances buffer of LOD 2 // buffer is interleaved [
    transformMatrix0 color0 transformMatrix1 color1 ... ]
    vtkOpenGLBufferObject* buffer2 = culling->GetLODBuffer(2);
    """
    def AddLOD(self, distance, targetReduction): # real signature unknown; restored from __doc__
        """
        AddLOD(self, distance:float, targetReduction:float) -> None
        C++: void AddLOD(float distance, float targetReduction)
        
        Add a level of detail. distance is the distance after which LOD
        is enabled targetReduction is the reduction factor applied on
        polydata (vtkDecimatePro is used)
        
        @sa vtkDecimatePro::SetTargetReduction
        """
        pass

    def BuildCullingShaders(self, cache, numInstances, withNormals): # real signature unknown; restored from __doc__
        """
        BuildCullingShaders(self, cache:vtkOpenGLShaderCache,
            numInstances:int, withNormals:bool) -> None
        C++: void BuildCullingShaders(vtkOpenGLShaderCache *cache,
            vtkIdType numInstances, bool withNormals)
        
        Build culling shader program (if not created yet) and binds it.
        """
        pass

    def GetColorLOD(self): # real signature unknown; restored from __doc__
        """
        GetColorLOD(self) -> bool
        C++: virtual bool GetColorLOD()
        """
        return False

    def GetHelper(self): # real signature unknown; restored from __doc__
        """
        GetHelper(self) -> vtkOpenGLHelper
        C++: vtkOpenGLHelper &GetHelper()
        
        Get helper structure.
        """
        return vtkOpenGLHelper

    def GetLODBuffer(self, index): # real signature unknown; restored from __doc__
        """
        GetLODBuffer(self, index:int) -> vtkOpenGLBufferObject
        C++: vtkOpenGLBufferObject *GetLODBuffer(vtkIdType index)
        
        Get the transform feedback buffer generated by the culling
        program.
        """
        return vtkOpenGLBufferObject

    def GetNumberOfGenerationsFromBase(self, type): # real signature unknown; restored from __doc__
        """
        GetNumberOfGenerationsFromBase(self, type:str) -> int
        C++: vtkIdType GetNumberOfGenerationsFromBase(const char *type)
            override;
        
        Given the name of a base class of this class type, return the
        distance of inheritance between this class type and the named
        class (how many generations of inheritance are there between this
        class and the named class). If the named class is not in this
        class's inheritance tree, return a negative value. Valid
        responses will always be nonnegative. This method works in
        combination with vtkTypeMacro found in vtkSetGet.h.
        """
        return 0

    def GetNumberOfGenerationsFromBaseType(self, type): # real signature unknown; restored from __doc__
        """
        GetNumberOfGenerationsFromBaseType(type:str) -> int
        C++: static vtkIdType GetNumberOfGenerationsFromBaseType(
            const char *type)
        
        Given a the name of a base class of this class type, return the
        distance of inheritance between this class type and the named
        class (how many generations of inheritance are there between this
        class and the named class). If the named class is not in this
        class's inheritance tree, return a negative value. Valid
        responses will always be nonnegative. This method works in
        combination with vtkTypeMacro found in vtkSetGet.h.
        """
        return 0

    def GetNumberOfLOD(self): # real signature unknown; restored from __doc__
        """
        GetNumberOfLOD(self) -> int
        C++: vtkIdType GetNumberOfLOD()
        
        Get number of LOD currently declared.
        """
        return 0

    def InitLOD(self, pd): # real signature unknown; restored from __doc__
        """
        InitLOD(self, pd:vtkPolyData) -> None
        C++: void InitLOD(vtkPolyData *pd)
        
        Initialize LOD with a polydata
        """
        pass

    def IsA(self, type): # real signature unknown; restored from __doc__
        """
        IsA(self, type:str) -> int
        C++: vtkTypeBool IsA(const char *type) override;
        
        Return 1 if this class is the same type of (or a subclass of) the
        named class. Returns 0 otherwise. This method works in
        combination with vtkTypeMacro found in vtkSetGet.h.
        """
        return 0

    def IsTypeOf(self, type): # real signature unknown; restored from __doc__
        """
        IsTypeOf(type:str) -> int
        C++: static vtkTypeBool IsTypeOf(const char *type)
        
        Return 1 if this class type is the same type of (or a subclass
        of) the named class. Returns 0 otherwise. This method works in
        combination with vtkTypeMacro found in vtkSetGet.h.
        """
        return 0

    def NewInstance(self): # real signature unknown; restored from __doc__
        """
        NewInstance(self) -> vtkOpenGLInstanceCulling
        C++: vtkOpenGLInstanceCulling *NewInstance()
        """
        return vtkOpenGLInstanceCulling

    def RunCullingShaders(self, numInstances, matrixBuffer, colorBuffer, normalBuffer): # real signature unknown; restored from __doc__
        """
        RunCullingShaders(self, numInstances:int,
            matrixBuffer:vtkOpenGLBufferObject,
            colorBuffer:vtkOpenGLBufferObject,
            normalBuffer:vtkOpenGLBufferObject) -> None
        C++: void RunCullingShaders(vtkIdType numInstances,
            vtkOpenGLBufferObject *matrixBuffer,
            vtkOpenGLBufferObject *colorBuffer,
            vtkOpenGLBufferObject *normalBuffer)
        
        Run the culling program and generate LOD buffers.
        """
        pass

    def SafeDownCast(self, o): # real signature unknown; restored from __doc__
        """
        SafeDownCast(o:vtkObjectBase) -> vtkOpenGLInstanceCulling
        C++: static vtkOpenGLInstanceCulling *SafeDownCast(
            vtkObjectBase *o)
        """
        return vtkOpenGLInstanceCulling

    def SetColorLOD(self, _arg): # real signature unknown; restored from __doc__
        """
        SetColorLOD(self, _arg:bool) -> None
        C++: virtual void SetColorLOD(bool _arg)
        
        Overload color with unique color per LOD.
        """
        pass

    def __delattr__(self, *args, **kwargs): # real signature unknown
        """ Implement delattr(self, name). """
        pass

    def __getattribute__(self, *args, **kwargs): # real signature unknown
        """ Return getattr(self, name). """
        pass

    def __init__(self, *args, **kwargs): # real signature unknown
        pass

    @staticmethod # known case of __new__
    def __new__(*args, **kwargs): # real signature unknown
        """ Create and return a new object.  See help(type) for accurate signature. """
        pass

    def __repr__(self, *args, **kwargs): # real signature unknown
        """ Return repr(self). """
        pass

    def __setattr__(self, *args, **kwargs): # real signature unknown
        """ Implement setattr(self, name, value). """
        pass

    def __str__(self, *args, **kwargs): # real signature unknown
        """ Return str(self). """
        pass

    __this__ = property(lambda self: object(), lambda self, v: None, lambda self: None)  # default
    """Pointer to the C++ object."""


    __dict__ = None # (!) real value is "mappingproxy({'__vtkname__': 'vtkOpenGLInstanceCulling', 'IsTypeOf': <method 'IsTypeOf' of 'vtkmodules.vtkRenderingOpenGL2.vtkOpenGLInstanceCulling' objects>, 'IsA': <method 'IsA' of 'vtkmodules.vtkRenderingOpenGL2.vtkOpenGLInstanceCulling' objects>, 'SafeDownCast': <method 'SafeDownCast' of 'vtkmodules.vtkRenderingOpenGL2.vtkOpenGLInstanceCulling' objects>, 'NewInstance': <method 'NewInstance' of 'vtkmodules.vtkRenderingOpenGL2.vtkOpenGLInstanceCulling' objects>, 'GetNumberOfGenerationsFromBaseType': <method 'GetNumberOfGenerationsFromBaseType' of 'vtkmodules.vtkRenderingOpenGL2.vtkOpenGLInstanceCulling' objects>, 'GetNumberOfGenerationsFromBase': <method 'GetNumberOfGenerationsFromBase' of 'vtkmodules.vtkRenderingOpenGL2.vtkOpenGLInstanceCulling' objects>, 'InitLOD': <method 'InitLOD' of 'vtkmodules.vtkRenderingOpenGL2.vtkOpenGLInstanceCulling' objects>, 'AddLOD': <method 'AddLOD' of 'vtkmodules.vtkRenderingOpenGL2.vtkOpenGLInstanceCulling' objects>, 'BuildCullingShaders': <method 'BuildCullingShaders' of 'vtkmodules.vtkRenderingOpenGL2.vtkOpenGLInstanceCulling' objects>, 'GetHelper': <method 'GetHelper' of 'vtkmodules.vtkRenderingOpenGL2.vtkOpenGLInstanceCulling' objects>, 'GetNumberOfLOD': <method 'GetNumberOfLOD' of 'vtkmodules.vtkRenderingOpenGL2.vtkOpenGLInstanceCulling' objects>, 'GetLODBuffer': <method 'GetLODBuffer' of 'vtkmodules.vtkRenderingOpenGL2.vtkOpenGLInstanceCulling' objects>, 'RunCullingShaders': <method 'RunCullingShaders' of 'vtkmodules.vtkRenderingOpenGL2.vtkOpenGLInstanceCulling' objects>, 'SetColorLOD': <method 'SetColorLOD' of 'vtkmodules.vtkRenderingOpenGL2.vtkOpenGLInstanceCulling' objects>, 'GetColorLOD': <method 'GetColorLOD' of 'vtkmodules.vtkRenderingOpenGL2.vtkOpenGLInstanceCulling' objects>, '__new__': <built-in method __new__ of type object at 0x00007FF8205F7B20>, '__repr__': <slot wrapper '__repr__' of 'vtkmodules.vtkRenderingOpenGL2.vtkOpenGLInstanceCulling' objects>, '__str__': <slot wrapper '__str__' of 'vtkmodules.vtkRenderingOpenGL2.vtkOpenGLInstanceCulling' objects>, '__getattribute__': <slot wrapper '__getattribute__' of 'vtkmodules.vtkRenderingOpenGL2.vtkOpenGLInstanceCulling' objects>, '__setattr__': <slot wrapper '__setattr__' of 'vtkmodules.vtkRenderingOpenGL2.vtkOpenGLInstanceCulling' objects>, '__delattr__': <slot wrapper '__delattr__' of 'vtkmodules.vtkRenderingOpenGL2.vtkOpenGLInstanceCulling' objects>, '__dict__': <attribute '__dict__' of 'vtkmodules.vtkRenderingOpenGL2.vtkOpenGLInstanceCulling' objects>, '__this__': <attribute '__this__' of 'vtkmodules.vtkRenderingOpenGL2.vtkOpenGLInstanceCulling' objects>, '__doc__': 'vtkOpenGLInstanceCulling - Frustum culling and LOD management.\\n\\nSuperclass: vtkObject\\n\\nThis class is used to cull instances based on their transformation\\nmatrix. It was designed to improve performances when there is large\\nnumber of instances in vtkOpenGLGlyph3DMapper.\\n\\nEach instance is tested on the GPU through vertex shader to know if\\nit is inside of the frustum view. If it is, the distance to the\\ncamera is computed to select and send to the geometry shader the\\ncorresponding LOD index. The geometry shader register the instance to\\nthe corresponding vertex stream and therefore the corresponding\\ntransform feedback buffer in video memory.\\n\\n@warning   GL_ARB_gpu_shader5 extension is required.\\n\\n{.cpp}\\n\\nvtkNewculling; vtkIdType nbInstances = 1000000;\\n\\n// buffer of size 16*nbInstances containing transform matrices.\\nvtkOpenGLBufferObject* bufferMatrix = ...;\\n\\n// buffer of size 4*nbInstances containing color buffer to pass\\nthrough. vtkOpenGLBufferObject* bufferColor = ...;\\n\\n// Initialize LODs culling->InitLOD(polydata); // LOD0 : full\\ngeometry culling->AddLOD(2.0, 0.5); // LOD1 : after 2.0, 50%\\ntriangles culling->AddLOD(5.0, 0.99); // LOD2 : after 5.0, 1%\\ntriangles\\n\\n// Build shader and binds culling->BuildCullingShaders(ren, actor,\\nnbInstances); culling->RunCullingShaders(nbInstances, bufferMatrix,\\nbufferColor);\\n\\n// Get number of instances in LOD 0 int nbInstInLOD0 =\\nculling->GetLOD(0).NumberOfInstances;\\n\\n// Get VBO and IBO of LOD 1 vtkOpenGLBufferObject* VBO1 =\\nculling->GetLOD(1).PositionVBO; vtkOpenGLBufferObject* IBO1 =\\nculling->GetLOD(1).IBO;\\n\\n// Get instances buffer of LOD 2 // buffer is interleaved [\\ntransformMatrix0 color0 transformMatrix1 color1 ... ]\\nvtkOpenGLBufferObject* buffer2 = culling->GetLODBuffer(2);\\n\\n'})"
    __vtkname__ = 'vtkOpenGLInstanceCulling'


