def testUsedAttributes(self): renderer = QgsPointCloudRgbRenderer() renderer.setBlueAttribute('b') renderer.setGreenAttribute('g') renderer.setRedAttribute('r') rc = QgsRenderContext() prc = QgsPointCloudRenderContext(rc, QgsVector3D(), QgsVector3D()) self.assertEqual(renderer.usedAttributes(prc), {'r', 'g', 'b'}) # if context is filtering by z, we also need the z attribute rc.setZRange(QgsDoubleRange(1, 10)) prc = QgsPointCloudRenderContext(rc, QgsVector3D(), QgsVector3D()) self.assertEqual(renderer.usedAttributes(prc), {'r', 'g', 'b', 'Z'})
def testUsedAttributes(self): renderer = QgsPointCloudAttributeByRampRenderer() renderer.setAttribute('attr') rc = QgsRenderContext() prc = QgsPointCloudRenderContext(rc, QgsVector3D(), QgsVector3D()) self.assertEqual(renderer.usedAttributes(prc), {'attr'})
def testUsedAttributes(self): renderer = QgsPointCloudRgbRenderer() renderer.setBlueAttribute('b') renderer.setGreenAttribute('g') renderer.setRedAttribute('r') rc = QgsRenderContext() prc = QgsPointCloudRenderContext(rc, QgsVector3D(), QgsVector3D()) self.assertEqual(renderer.usedAttributes(prc), {'r', 'g', 'b'})