Exemple #1
0
 rule(const rule& rhs, bool deep_copy = false)
     : name_(rhs.name_),
       title_(rhs.title_),
       abstract_(rhs.abstract_),
       min_scale_(rhs.min_scale_),
       max_scale_(rhs.max_scale_),
       syms_(rhs.syms_),
       filter_(rhs.filter_),
       else_filter_(rhs.else_filter_), 
       also_filter_(rhs.also_filter_) 
 {
     if (deep_copy) {
         //std::string expr = to_expression_string(rhs.filter_);
         //filter_ = parse_expression(expr,"utf8");
         
         symbolizers::iterator it  = syms_.begin(),
                               end = syms_.end();
         
         // FIXME - metawriter_ptr?
         
         for(; it != end; ++it) {
             
             /*if (polygon_symbolizer *sym = boost::get<polygon_symbolizer>(&(*it))) {
                 // no shared pointers
             } else if (line_symbolizer *sym = boost::get<line_symbolizer>(&(*it))) {
                 // no shared pointers
             } else if (building_symbolizer *sym = boost::get<building_symbolizer>(&(*it))) {
                 // no shared pointers
             }*/
             
             if (markers_symbolizer *sym = boost::get<markers_symbolizer>(&(*it))) {
                 copy_path_ptr(sym);
             } else if (point_symbolizer *sym = boost::get<point_symbolizer>(&(*it))) {
                 copy_path_ptr(sym);
             } else if (polygon_pattern_symbolizer *sym = boost::get<polygon_pattern_symbolizer>(&(*it))) {
                 copy_path_ptr(sym);
             } else if (line_pattern_symbolizer *sym = boost::get<line_pattern_symbolizer>(&(*it))) {
                 copy_path_ptr(sym);
             } else if (raster_symbolizer *sym = boost::get<raster_symbolizer>(&(*it))) {
                 raster_colorizer_ptr old_colorizer = sym->get_colorizer(),
                                      new_colorizer = raster_colorizer_ptr();
                 
                 new_colorizer->set_stops( old_colorizer->get_stops());
                 new_colorizer->set_default_mode( old_colorizer->get_default_mode() );
                 new_colorizer->set_default_color( old_colorizer->get_default_color() );
                 new_colorizer->set_epsilon( old_colorizer->get_epsilon() );
                 
                 sym->set_colorizer(new_colorizer);
             } else if (shield_symbolizer *sym = boost::get<shield_symbolizer>(&(*it))) {
                 copy_path_ptr(sym);
                 copy_text_ptr(sym);
             } else if (text_symbolizer *sym = boost::get<text_symbolizer>(&(*it))) {
                 copy_text_ptr(sym);
             }
         }
     }
 }
Exemple #2
0
 void operator () (shield_symbolizer & sym) const
 {
     copy_path_ptr(sym);
     copy_text_ptr(sym);
 }
Exemple #3
0
 void operator () (text_symbolizer & sym) const
 {
     copy_text_ptr(sym);
 }