void ClipVisitor::visit(ShapePtr shape) { ShapeRendererStatePtr renderer_state = shape->getRendererState(renderer); D2DShapeRendererStatePtr shape_renderer = dynamic_pointer_cast<D2DShapeRendererState>(renderer_state); vector<ID2D1Geometry*> temp_geometry; shape_renderer->getGeometry(&temp_geometry); for (size_t i = 0; i < temp_geometry.size(); i++) { ID2D1TransformedGeometry* transformed_geometry; HRESULT hr = renderer->m_pFactory->CreateTransformedGeometry( temp_geometry[i], &d2dMatrix(matrix_stack.top()), &transformed_geometry); if (SUCCEEDED(hr)) { geometry.push_back(transformed_geometry); } } }
void Draw::visit(ShapePtr shape) { ShapeRendererStatePtr renderer_state = shape->getRendererState(renderer); D2DShapeRendererStatePtr shape_renderer = dynamic_pointer_cast<D2DShapeRendererState>(renderer_state); shape_renderer->draw(); }