/[geocaml]/geocaml/src/abrlex.ml
ViewVC logotype

Diff of /geocaml/src/abrlex.ml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by adoniec, Mon Mar 31 07:31:24 2003 UTC revision 1.5 by adoniec, Tue Apr 1 12:33:15 2003 UTC
# Line 202  let treat_exception e = Line 202  let treat_exception e =
202    | Circle_found_line_expected s -> s^" est un cercle,la construction nécessite une droite\n"    | Circle_found_line_expected s -> s^" est un cercle,la construction nécessite une droite\n"
203    
204    
205  let rec add_abr abr fig f =  let rec add_abr_for_im abr fig f =
206    match abr with    match abr with
207      | POINT (p,s) -> Geom.add_point p s fig      | POINT (p,s) -> Geom.add_point p s fig
208      | LINE (l,s) -> Geom.add_line l s fig      | LINE (l,s) -> Geom.add_line l s fig
209      | CIRCLE (c,s) -> Geom.add_circle c s fig      | CIRCLE (c,s) -> Geom.add_circle c s fig
210      | MULTIPLE l -> List.iter (fun a -> add_abr a fig f) l      | MULTIPLE l -> List.iter (fun a -> add_abr_for_im a fig f) l
211      | CONSTRUCT o -> (match o with      | CONSTRUCT o -> (match o with
212                          | POINT (p,s) -> Geom.add_point (Geom.Construct_point p) s fig                          | POINT (p,s) -> Geom.add_point (Geom.Construct_point p) s fig
213                          | LINE (l,s) -> Geom.add_line (Geom.Ruler l) s fig                          | LINE (l,s) -> Geom.add_line (Geom.Ruler l) s fig
214                          | CIRCLE (c,s) -> Geom.add_circle (Geom.Compass c) s fig                          | CIRCLE (c,s) -> Geom.add_circle (Geom.Compass c) s fig
215                          | MULTIPLE l -> List.iter (fun a -> add_abr (CONSTRUCT a) fig f) l)                          | MULTIPLE l -> List.iter (fun a -> add_abr_for_im (CONSTRUCT a) fig f) l)
216      | SUPPR o -> suppr_abr o fig f      | SUPPR o -> suppr_abr_for_im o fig f
217    
218    
219  and suppr_abr abr fig f =  and suppr_abr_for_im abr fig f =
220    match abr with    match abr with
221      | POINT (p,s) -> (Geom.suppr_obj s fig;f#remove_point s)      | POINT (p,s) -> (Geom.suppr_obj s fig;f#remove_point s)
222      | LINE (l,s) -> (Geom.suppr_obj s fig;f#remove_line s)      | LINE (l,s) -> (Geom.suppr_obj s fig;f#remove_line s)
223      | CIRCLE (c,s) -> (Geom.suppr_obj s fig;f#remove_circle s)      | CIRCLE (c,s) -> (Geom.suppr_obj s fig;f#remove_circle s)
224      | _ -> ()      | _ -> ()
225    
226    let rec add_abr abr fig=
227      match abr with
228        | POINT (p,s) -> Geom.add_point p s fig
229        | LINE (l,s) -> Geom.add_line l s fig
230        | CIRCLE (c,s) -> Geom.add_circle c s fig
231        | MULTIPLE l -> List.iter (fun a -> add_abr a fig) l
232        | CONSTRUCT o -> (match o with
233                            | POINT (p,s) -> Geom.add_point (Geom.Construct_point p) s fig
234                            | LINE (l,s) -> Geom.add_line (Geom.Ruler l) s fig
235                            | CIRCLE (c,s) -> Geom.add_circle (Geom.Compass c) s fig
236                            | MULTIPLE l -> List.iter (fun a -> add_abr (CONSTRUCT a) fig) l)
237        | SUPPR o -> suppr_abr o fig
238    
239    
240    and suppr_abr abr fig=
241      match abr with
242        | POINT (p,s) -> (Geom.suppr_obj s fig)
243        | LINE (l,s) -> (Geom.suppr_obj s fig)
244        | CIRCLE (c,s) -> (Geom.suppr_obj s fig)
245        | _ -> ()
246    
247    
248    

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26