MediaWiki API result

This is the HTML representation of the JSON format. HTML is good for debugging, but is unsuitable for application use.

Specify the format parameter to change the output format. To see the non-HTML representation of the JSON format, set format=json.

See the complete documentation, or the API help for more information.

{
    "batchcomplete": "",
    "continue": {
        "gapcontinue": "RecipeAddShortcutToStartMenu",
        "continue": "gapcontinue||"
    },
    "warnings": {
        "main": {
            "*": "Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/postorius/lists/mediawiki-api-announce.lists.wikimedia.org/> for notice of API deprecations and breaking changes."
        },
        "revisions": {
            "*": "Because \"rvslots\" was not specified, a legacy format has been used for the output. This format is deprecated, and in the future the new format will always be used."
        }
    },
    "query": {
        "pages": {
            "3592": {
                "pageid": 3592,
                "ns": 0,
                "title": "Read a VTP file",
                "revisions": [
                    {
                        "contentformat": "text/x-wiki",
                        "contentmodel": "wikitext",
                        "*": "As VTP is a very flexible format, there is no way to make a generic reader. You must read the data that you are interested in. A generic reader can only look for points and triangles.\n\n<source lang=\"cpp\">\n#include <iostream>\n#include <vector>\n\n#include \"vtkCellArray.h\"\n#include \"vtkPoints.h\"\n#include \"vtkXMLPolyDataReader.h\"\n#include \"vtkPolyData.h\"\n\nstruct Point\n{\n\tdouble x,y,z;\n\tPoint(const double xin, const double yin, const double zin) : x(xin), y(yin), z(zin) {}\n};\n\nint main()\n{\t\t\n\t//get all data from the file\n\tvtkXMLPolyDataReader* reader = vtkXMLPolyDataReader::New();\n\treader->SetFileName(\"Triangle.vtp\");\n\treader->Update();\n\tvtkPolyData* polydata = reader->GetOutput();\n\n\t//get the number of points the file contains\n\tvtkIdType NumPoints = polydata->GetNumberOfPoints();\n\t\n\t//if there are no points, quit\n\tif(!(NumPoints > 0) )\n\t{\n\t\texit(-1);\n\t}\n\n\t//read in all of the points\n\tstd::vector<Point> Points;\n\tdouble point[3];\n\tfor(vtkIdType i = 0; i < NumPoints; i++)\n\t{\n\t\tpolydata->GetPoint(i, point);\n\t\tPoints.push_back(Point(point[0], point[1], point[2]));\n\t}\n\t\n\t//get the triangles (if there are any)\n\tstd::vector<std::vector<int> > VertexLists;\n\tvtkIdType NumPolys = polydata->GetNumberOfPolys();\n\tif(NumPolys > 0)\n\t{\n\t\tvtkCellArray* TriangleCells = polydata->GetPolys();\n\t\tvtkIdType npts;\n\t\tvtkIdType *pts;\n\n\t\twhile(TriangleCells->GetNextCell(npts, pts))\n\t\t{\n\t\t\tstd::vector<int> List(3);\n\t\t\tList[0] = pts[0];\n\t\t\tList[1] = pts[1];\n\t\t\tList[2] = pts[2];\n\t\t\n\t\t\tVertexLists.push_back(List);\n\t\t}\t\n\t}\n\t\n\tstd::cout << \"Points: \" << Points.size() << std::endl;\n\tfor(unsigned int i = 0; i < Points.size(); i++)\n\t{\n\t\tstd::cout << Points[i].x << \" \" << Points[i].y << \" \" << Points[i].z << std::endl;\n\t}\n\t\n\tstd::cout << std::endl;\n\t\n\tstd::cout << \"Triangles: \" << VertexLists.size() << std::endl;\n\tfor(unsigned int i = 0; i < VertexLists.size(); i++)\n\t{\n\t\tstd::cout << VertexLists[i][0] << \" \" << VertexLists[i][1] << \" \" << VertexLists[i][2] << std::endl;\n\t}\n\treturn 0;\n}\n</source>"
                    }
                ]
            },
            "3048": {
                "pageid": 3048,
                "ns": 0,
                "title": "Really Cool CMake Features",
                "revisions": [
                    {
                        "contentformat": "text/x-wiki",
                        "contentmodel": "wikitext",
                        "*": "{{CMake/Template/Moved}}\n\nThis page has moved [https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/Really-Cool-CMake-Features here]."
                    }
                ]
            }
        }
    }
}