/* Version 0.94 */
/*
Copyright 2008-2012
Matthias Ehmann,
Michael Gerhaeuser,
Carsten Miller,
Bianca Valentin,
Alfred Wassermann,
Peter Wilfahrt
This file is part of JSXGraph.
JSXGraph is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
JSXGraph is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with JSXGraph. If not, see .
*/
JXG.IntergeoReader=new function(){this.board=null;this.objects={};this.readIntergeo=function(a,b){this.board=b;this.board.origin={};this.board.origin.usrCoords=[1,0,0];this.board.origin.scrCoords=[1,400,300];this.board.unitX=30;this.board.unitY=30;this.readElements(a.getElementsByTagName("elements"));this.readConstraints(a.getElementsByTagName("constraints"));this.cleanUp();this.board.fullUpdate();this.readDisplay(a.getElementsByTagName("display"));this.board.fullUpdate()};this.readElements=function(a){var b;for(var b=0;b1){return}if(d.nodeName=="point"){JXG.IntergeoReader.storePoint(d)}else{if(d.nodeName=="line"||d.nodeName=="line_segment"||d.nodeName=="ray"||d.nodeName=="vector"){JXG.IntergeoReader.storeLine(d)}else{if(d.nodeName=="circle"){JXG.IntergeoReader.storeConic(d)}else{if(d.nodeName=="conic"){JXG.IntergeoReader.storeConic(d)}else{if(d.nodeName=="polygon"){}else{JXG.debug("Not implemented: "+d.nodeName+" "+d.getAttribute("id"))}}}}}})(b)}};this.addPointOld=function(d){var h=0,f=0,e=0,b,a=d.childNodes[h],k=[],g={strokeColor:"red",fillColor:"red",withLabel:true},m=[];while(a.nodeType>1){h++;a=d.childNodes[h]}g.name=d.getAttribute("id");if(a.nodeName=="homogeneous_coordinates"){for(f=0;f1){e++;g=f.childNodes[e]}if(g.nodeName=="homogeneous_coordinates"){for(d=0;d1){b++;e=d.childNodes[b]}if(e.nodeName=="homogeneous_coordinates"){f=[];for(a=0;a1){b++;e=d.childNodes[b]}if(e.nodeName=="matrix"){f=[];for(a=0;a1){return}if(e.nodeName=="line_through_two_points"){JXG.IntergeoReader.addLineThroughTwoPoints(e,false)}else{if(e.nodeName=="ray_from_point_through_point"){JXG.IntergeoReader.addLineThroughTwoPoints(e,true)}else{if(e.nodeName=="line_through_point"){JXG.IntergeoReader.addLineThroughPoint(e)}else{if(e.nodeName=="line_parallel_to_line_through_point"){JXG.IntergeoReader.addLineParallelToLineThroughPoint(e,false)}else{if(e.nodeName=="ray_from_point_and_vector"){JXG.IntergeoReader.addLineParallelToLineThroughPoint(e,true)}else{if(e.nodeName=="line_perpendicular_to_line_through_point"){JXG.IntergeoReader.addLinePerpendicularToLineThroughPoint(e)}else{if(e.nodeName=="line_segment_by_points"){JXG.IntergeoReader.addLineSegmentByTwoPoints(e)}else{if(e.nodeName=="vector_from_point_to_point"){JXG.IntergeoReader.addVectorFromPointToPoint(e)}else{if(e.nodeName=="endpoints_of_line_segment"){JXG.IntergeoReader.addEndpointsOfLineSegment(e)}else{if(e.nodeName=="free_point"){}else{if(e.nodeName=="free_line"){JXG.IntergeoReader.addFreeLine(e)}else{if(e.nodeName=="point_on_line"){JXG.IntergeoReader.addPointOnLine(e)}else{if(e.nodeName=="point_on_line_segment"){JXG.IntergeoReader.addPointOnLine(e)}else{if(e.nodeName=="point_on_circle"){JXG.IntergeoReader.addPointOnCircle(e)}else{if(e.nodeName=="angular_bisector_of_three_points"){JXG.IntergeoReader.addAngularBisectorOfThreePoints(e,false)}else{if(e.nodeName=="angular_bisectors_of_two_lines"){JXG.IntergeoReader.addAngularBisectorsOfTwoLines(e,false)}else{if(e.nodeName=="line_angular_bisector_of_three_points"){JXG.IntergeoReader.addAngularBisectorOfThreePoints(e,true)}else{if(e.nodeName=="line_angular_bisectors_of_two_lines"){JXG.IntergeoReader.addAngularBisectorsOfTwoLines(e,true)}else{if(e.nodeName=="midpoint_of_two_points"){JXG.IntergeoReader.addMidpointOfTwoPoints(e)}else{if(e.nodeName=="midpoint"){JXG.IntergeoReader.addMidpointOfTwoPoints(e)}else{if(e.nodeName=="midpoint_of_line_segment"||e.nodeName=="midpoint_line_segment"){JXG.IntergeoReader.addMidpointOfLineSegment(e)}else{if(e.nodeName=="point_intersection_of_two_lines"){JXG.IntergeoReader.addPointIntersectionOfTwoLines(e)}else{if(e.nodeName=="locus_defined_by_point"){JXG.IntergeoReader.addLocusDefinedByPoint(e)}else{if(e.nodeName=="locus_defined_by_point_on_line"){JXG.IntergeoReader.addLocusDefinedByPointOnLine(e)}else{if(e.nodeName=="locus_defined_by_point_on_line_segment"){JXG.IntergeoReader.addLocusDefinedByPointOnLine(e)}else{if(e.nodeName=="locus_defined_by_line_through_point"){JXG.IntergeoReader.addLocusDefinedByLineThroughPoint(e)}else{if(e.nodeName=="locus_defined_by_point_on_circle"){JXG.IntergeoReader.addLocusDefinedByPointOnCircle(e)}else{if(e.nodeName=="circle_by_three_points"){JXG.IntergeoReader.addCircleByThreePoints(e)}else{if(e.nodeName=="circle_by_center_and_point"){JXG.IntergeoReader.addCircleByCenterAndPoint(e)}else{if(e.nodeName=="center_of_circle"){JXG.IntergeoReader.addCenterOfCircle(e)}else{if(e.nodeName=="intersection_points_of_two_circles"){JXG.IntergeoReader.addIntersectionPointsOfTwoCircles(e)}else{if(e.nodeName=="intersection_points_of_circle_and_line"){JXG.IntergeoReader.addIntersectionPointsOfCircleAndLine(e)}else{if(e.nodeName=="other_intersection_point_of_two_circles"){JXG.IntergeoReader.addOtherIntersectionPointOfTwoCircles(e)}else{if(e.nodeName=="other_intersection_point_of_circle_and_line"){JXG.IntergeoReader.addOtherIntersectionPointOfCircleAndLine(e)}else{if(e.nodeName=="circle_tangent_lines_by_point"){JXG.IntergeoReader.addCircleTangentLinesByPoint(e)}else{if(e.nodeName=="polygon_by_vertices"){JXG.IntergeoReader.addPolygonByVertices(e)}else{c=JXG.IntergeoReader.readParams(e);JXG.debug("readConstraints: not implemented: "+e.nodeName+": "+c[0])}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}})(b)}};this.setAttributes=function(a){a.setProperty({strokecolor:this.board.options.point.strokeColor,fillColor:this.board.options.point.fillColor})};this.readParams=function(b){var c=[],a;for(a=0;a1){return}if(h.nodeName=="background-color"){this.board.containerObj.style.backgroundColor=h.firstChild.data}else{if(h.nodeName=="style"){f=JXG.getReference(this.board,h.getAttribute("ref"));var i=[],d;for(d=0;d