Showing the changes to interface/src/MetavoxelSystem.cpp (1 of 4 files). Show all
Unified · Split
| @@ -140,7 +140,32 @@ bool SpannerRenderVisitor::visit(Spanner* spanner, const glm::vec3& clipMinimum, · 139 unmodified lines | |||
| 140 | return true; | 140 | return true; |
| 141 | } | 141 | } |
| 142 | 142 | ||
| 143 | class RenderVisitor : public MetavoxelVisitor { | ||
| 144 | public: | ||
| 145 | |||
| 146 | RenderVisitor(const MetavoxelLOD& lod); | ||
| 147 | |||
| 148 | virtual int visit(MetavoxelInfo& info); | ||
| 149 | }; | ||
| 150 | |||
| 151 | RenderVisitor::RenderVisitor(const MetavoxelLOD& lod) : | ||
| 152 | MetavoxelVisitor(QVector<AttributePointer>() << AttributeRegistry::getInstance()->getRendererAttribute(), | ||
| 153 | QVector<AttributePointer>(), lod) { | ||
| 154 | } | ||
| 155 | |||
| 156 | int RenderVisitor::visit(MetavoxelInfo& info) { | ||
| 157 | if (!info.isLeaf) { | ||
| 158 | return DEFAULT_ORDER; | ||
| 159 | } | ||
| 160 | static_cast<MetavoxelRenderer*>(info.inputValues.at(0).getInlineValue< | ||
| 161 | SharedObjectPointer>().data())->getImplementation()->render(info); | ||
| 162 | return STOP_RECURSION; | ||
| 163 | } | ||
| 164 | |||
| 143 | void MetavoxelSystem::render() { | 165 | void MetavoxelSystem::render() { |
| 166 | RenderVisitor renderVisitor(getLOD()); | ||
| 167 | guide(renderVisitor); | ||
| 168 | |||
| 144 | int viewport[4]; | 169 | int viewport[4]; |
| 145 | glGetIntegerv(GL_VIEWPORT, viewport); | 170 | glGetIntegerv(GL_VIEWPORT, viewport); |
| 146 | const int VIEWPORT_WIDTH_INDEX = 2; | 171 | const int VIEWPORT_WIDTH_INDEX = 2; |
| @@ -480,6 +505,9 @@ AttributeValue PointBufferAttribute::inherit(const AttributeValue& parentValue) · 333 unmodified lines | |||
| 480 | PointMetavoxelRendererImplementation::PointMetavoxelRendererImplementation() { | 505 | PointMetavoxelRendererImplementation::PointMetavoxelRendererImplementation() { |
| 481 | } | 506 | } |
| 482 | 507 | ||
| 508 | void PointMetavoxelRendererImplementation::render(MetavoxelInfo& info) { | ||
| 509 | } | ||
| 510 | |||
| 483 | static void enableClipPlane(GLenum plane, float x, float y, float z, float w) { | 511 | static void enableClipPlane(GLenum plane, float x, float y, float z, float w) { |
| 484 | GLdouble coefficients[] = { x, y, z, w }; | 512 | GLdouble coefficients[] = { x, y, z, w }; |
| 485 | glClipPlane(plane, coefficients); | 513 | glClipPlane(plane, coefficients); |