Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-11-16 09:28:42

0001 /*
0002   Copyright 2008 Intel Corporation
0003 
0004   Use, modification and distribution are subject to the Boost Software License,
0005   Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0006   http://www.boost.org/LICENSE_1_0.txt).
0007 */
0008 #ifndef BOOST_POLYGON_POLYGON_90_SET_VIEW_HPP
0009 #define BOOST_POLYGON_POLYGON_90_SET_VIEW_HPP
0010 namespace boost { namespace polygon{
0011   struct operator_provides_storage {};
0012   struct operator_requires_copy {};
0013 
0014   template <typename value_type, typename arg_type>
0015   inline void insert_into_view_arg(value_type& dest, const arg_type& arg, orientation_2d orient);
0016 
0017   template <typename ltype, typename rtype, typename op_type>
0018   class polygon_90_set_view;
0019 
0020   template <typename ltype, typename rtype, typename op_type>
0021   struct polygon_90_set_traits<polygon_90_set_view<ltype, rtype, op_type> > {
0022     typedef typename polygon_90_set_view<ltype, rtype, op_type>::coordinate_type coordinate_type;
0023     typedef typename polygon_90_set_view<ltype, rtype, op_type>::iterator_type iterator_type;
0024     typedef typename polygon_90_set_view<ltype, rtype, op_type>::operator_arg_type operator_arg_type;
0025 
0026     static inline iterator_type begin(const polygon_90_set_view<ltype, rtype, op_type>& polygon_set);
0027     static inline iterator_type end(const polygon_90_set_view<ltype, rtype, op_type>& polygon_set);
0028 
0029     static inline orientation_2d orient(const polygon_90_set_view<ltype, rtype, op_type>& polygon_set);
0030 
0031     static inline bool clean(const polygon_90_set_view<ltype, rtype, op_type>& polygon_set);
0032 
0033     static inline bool sorted(const polygon_90_set_view<ltype, rtype, op_type>& polygon_set);
0034   };
0035 
0036     template <typename value_type, typename ltype, typename rtype, typename op_type>
0037     struct compute_90_set_value {
0038       static
0039       void value(value_type& output_, const ltype& lvalue_, const rtype& rvalue_, orientation_2d orient_) {
0040         value_type linput_(orient_);
0041         value_type rinput_(orient_);
0042         orientation_2d orient_l = polygon_90_set_traits<ltype>::orient(lvalue_);
0043         orientation_2d orient_r = polygon_90_set_traits<rtype>::orient(rvalue_);
0044         //std::cout << "compute_90_set_value-0 orientations (left, right, out):\t" << orient_l.to_int()
0045         //        << "," << orient_r.to_int() << "," << orient_.to_int() << std::endl;
0046         insert_into_view_arg(linput_, lvalue_, orient_l);
0047         insert_into_view_arg(rinput_, rvalue_, orient_r);
0048         output_.applyBooleanBinaryOp(linput_.begin(), linput_.end(),
0049                                      rinput_.begin(), rinput_.end(), boolean_op::BinaryCount<op_type>());
0050       }
0051     };
0052 
0053     template <typename value_type, typename lcoord, typename rcoord, typename op_type>
0054     struct compute_90_set_value<value_type, polygon_90_set_data<lcoord>, polygon_90_set_data<rcoord>, op_type> {
0055       static
0056       void value(value_type& output_, const polygon_90_set_data<lcoord>& lvalue_,
0057                  const polygon_90_set_data<rcoord>& rvalue_, orientation_2d orient_) {
0058         orientation_2d orient_l = lvalue_.orient();
0059         orientation_2d orient_r = rvalue_.orient();
0060         value_type linput_(orient_);
0061         value_type rinput_(orient_);
0062         //std::cout << "compute_90_set_value-1 orientations (left, right, out):\t" << orient_l.to_int()
0063         //          << "," << orient_r.to_int() << "," << orient_.to_int() << std::endl;
0064         if((orient_ == orient_l) && (orient_== orient_r)){ // assume that most of the time this condition is met
0065           lvalue_.sort();
0066           rvalue_.sort();
0067           output_.applyBooleanBinaryOp(lvalue_.begin(), lvalue_.end(),
0068                                        rvalue_.begin(), rvalue_.end(), boolean_op::BinaryCount<op_type>());
0069         }else if((orient_ != orient_l) && (orient_!= orient_r)){ // both the orientations are not equal to input
0070           // easier way is to ignore the input orientation and use the input data's orientation, but not done so
0071           insert_into_view_arg(linput_, lvalue_, orient_l);
0072           insert_into_view_arg(rinput_, rvalue_, orient_r);
0073           output_.applyBooleanBinaryOp(linput_.begin(), linput_.end(),
0074                                        rinput_.begin(), rinput_.end(), boolean_op::BinaryCount<op_type>());
0075         }else if(orient_ != orient_l){ // left hand side orientation is different
0076           insert_into_view_arg(linput_, lvalue_, orient_l);
0077           rvalue_.sort();
0078           output_.applyBooleanBinaryOp(linput_.begin(), linput_.end(),
0079                                        rvalue_.begin(), rvalue_.end(), boolean_op::BinaryCount<op_type>());
0080         } else if(orient_ != orient_r){ // right hand side orientation is different
0081           insert_into_view_arg(rinput_, rvalue_, orient_r);
0082           lvalue_.sort();
0083           output_.applyBooleanBinaryOp(lvalue_.begin(), lvalue_.end(),
0084                                        rinput_.begin(), rinput_.end(), boolean_op::BinaryCount<op_type>());
0085         }
0086       }
0087     };
0088 
0089     template <typename value_type, typename lcoord, typename rtype, typename op_type>
0090     struct compute_90_set_value<value_type, polygon_90_set_data<lcoord>, rtype, op_type> {
0091       static
0092       void value(value_type& output_, const polygon_90_set_data<lcoord>& lvalue_,
0093                  const rtype& rvalue_, orientation_2d orient_) {
0094          value_type rinput_(orient_);
0095          lvalue_.sort();
0096          orientation_2d orient_r = polygon_90_set_traits<rtype>::orient(rvalue_);
0097          //std::cout << "compute_90_set_value-2 orientations (right, out):\t" << orient_r.to_int()
0098          //          << "," << orient_.to_int() << std::endl;
0099          insert_into_view_arg(rinput_, rvalue_, orient_r);
0100          output_.applyBooleanBinaryOp(lvalue_.begin(), lvalue_.end(),
0101                                       rinput_.begin(), rinput_.end(), boolean_op::BinaryCount<op_type>());
0102       }
0103     };
0104 
0105     template <typename value_type, typename ltype, typename rcoord, typename op_type>
0106     struct compute_90_set_value<value_type, ltype, polygon_90_set_data<rcoord>, op_type> {
0107       static
0108       void value(value_type& output_, const ltype& lvalue_,
0109                  const polygon_90_set_data<rcoord>& rvalue_, orientation_2d orient_) {
0110         value_type linput_(orient_);
0111         orientation_2d orient_l = polygon_90_set_traits<ltype>::orient(lvalue_);
0112         insert_into_view_arg(linput_, lvalue_, orient_l);
0113         rvalue_.sort();
0114         //std::cout << "compute_90_set_value-3 orientations (left, out):\t" << orient_l.to_int()
0115         //          << "," << orient_.to_int() << std::endl;
0116 
0117         output_.applyBooleanBinaryOp(linput_.begin(), linput_.end(),
0118                                      rvalue_.begin(), rvalue_.end(), boolean_op::BinaryCount<op_type>());
0119       }
0120     };
0121 
0122   template <typename ltype, typename rtype, typename op_type>
0123   class polygon_90_set_view {
0124   public:
0125     typedef typename polygon_90_set_traits<ltype>::coordinate_type coordinate_type;
0126     typedef polygon_90_set_data<coordinate_type> value_type;
0127     typedef typename value_type::iterator_type iterator_type;
0128     typedef polygon_90_set_view operator_arg_type;
0129   private:
0130     const ltype& lvalue_;
0131     const rtype& rvalue_;
0132     orientation_2d orient_;
0133     op_type op_;
0134     mutable value_type output_;
0135     mutable bool evaluated_;
0136     polygon_90_set_view& operator=(const polygon_90_set_view&);
0137   public:
0138     polygon_90_set_view(const ltype& lvalue,
0139                      const rtype& rvalue,
0140                      orientation_2d orient,
0141                      op_type op) :
0142       lvalue_(lvalue), rvalue_(rvalue), orient_(orient), op_(op), output_(orient), evaluated_(false) {}
0143 
0144     // get iterator to begin vertex data
0145   private:
0146     const value_type& value() const {
0147       if(!evaluated_) {
0148         evaluated_ = true;
0149         compute_90_set_value<value_type, ltype, rtype, op_type>::value(output_, lvalue_, rvalue_, orient_);
0150       }
0151       return output_;
0152     }
0153   public:
0154     iterator_type begin() const { return value().begin(); }
0155     iterator_type end() const { return value().end(); }
0156 
0157     orientation_2d orient() const { return orient_; }
0158     bool dirty() const { return false; } //result of a boolean is clean
0159     bool sorted() const { return true; } //result of a boolean is sorted
0160 
0161 //     template <typename input_iterator_type>
0162 //     void set(input_iterator_type input_begin, input_iterator_type input_end,
0163 //              orientation_2d orient) const {
0164 //       orient_ = orient;
0165 //       output_.clear();
0166 //       output_.insert(output_.end(), input_begin, input_end);
0167 //       polygon_sort(output_.begin(), output_.end());
0168 //     }
0169     void sort() const {} //is always sorted
0170   };
0171 
0172   template <typename ltype, typename rtype, typename op_type>
0173   struct geometry_concept<polygon_90_set_view<ltype, rtype, op_type> > {
0174     typedef polygon_90_set_concept type;
0175   };
0176 
0177   template <typename ltype, typename rtype, typename op_type>
0178   typename polygon_90_set_traits<polygon_90_set_view<ltype, rtype, op_type> >::iterator_type
0179   polygon_90_set_traits<polygon_90_set_view<ltype, rtype, op_type> >::
0180   begin(const polygon_90_set_view<ltype, rtype, op_type>& polygon_set) {
0181     return polygon_set.begin();
0182   }
0183   template <typename ltype, typename rtype, typename op_type>
0184   typename polygon_90_set_traits<polygon_90_set_view<ltype, rtype, op_type> >::iterator_type
0185   polygon_90_set_traits<polygon_90_set_view<ltype, rtype, op_type> >::
0186   end(const polygon_90_set_view<ltype, rtype, op_type>& polygon_set) {
0187     return polygon_set.end();
0188   }
0189 //   template <typename ltype, typename rtype, typename op_type>
0190 //   template <typename input_iterator_type>
0191 //   void polygon_90_set_traits<polygon_90_set_view<ltype, rtype, op_type> >::
0192 //   set(polygon_90_set_view<ltype, rtype, op_type>& polygon_set,
0193 //       input_iterator_type input_begin, input_iterator_type input_end,
0194 //       orientation_2d orient) {
0195 //     polygon_set.set(input_begin, input_end, orient);
0196 //   }
0197   template <typename ltype, typename rtype, typename op_type>
0198   orientation_2d polygon_90_set_traits<polygon_90_set_view<ltype, rtype, op_type> >::
0199   orient(const polygon_90_set_view<ltype, rtype, op_type>& polygon_set) {
0200     return polygon_set.orient(); }
0201   template <typename ltype, typename rtype, typename op_type>
0202   bool polygon_90_set_traits<polygon_90_set_view<ltype, rtype, op_type> >::
0203   clean(const polygon_90_set_view<ltype, rtype, op_type>& polygon_set) {
0204     return !polygon_set.dirty(); }
0205   template <typename ltype, typename rtype, typename op_type>
0206   bool polygon_90_set_traits<polygon_90_set_view<ltype, rtype, op_type> >::
0207   sorted(const polygon_90_set_view<ltype, rtype, op_type>& polygon_set) {
0208     return polygon_set.sorted(); }
0209 
0210   template <typename value_type, typename arg_type>
0211   inline void insert_into_view_arg(value_type& dest, const arg_type& arg, orientation_2d orient) {
0212     typedef typename polygon_90_set_traits<arg_type>::iterator_type literator;
0213     literator itr1, itr2;
0214     itr1 = polygon_90_set_traits<arg_type>::begin(arg);
0215     itr2 = polygon_90_set_traits<arg_type>::end(arg);
0216     dest.insert(itr1, itr2, orient);
0217     dest.sort();
0218   }
0219 
0220   template <typename T>
0221   template <typename ltype, typename rtype, typename op_type>
0222   inline polygon_90_set_data<T>& polygon_90_set_data<T>::operator=(const polygon_90_set_view<ltype, rtype, op_type>& that) {
0223     set(that.begin(), that.end(), that.orient());
0224     dirty_ = false;
0225     unsorted_ = false;
0226     return *this;
0227   }
0228 
0229   template <typename T>
0230   template <typename ltype, typename rtype, typename op_type>
0231   inline polygon_90_set_data<T>::polygon_90_set_data(const polygon_90_set_view<ltype, rtype, op_type>& that) :
0232     orient_(that.orient()), data_(that.begin(), that.end()), dirty_(false), unsorted_(false) {}
0233 
0234   template <typename geometry_type_1, typename geometry_type_2>
0235   struct self_assign_operator_lvalue {
0236     typedef geometry_type_1& type;
0237   };
0238 
0239   template <typename type_1, typename type_2>
0240   struct by_value_binary_operator {
0241     typedef type_1 type;
0242   };
0243 
0244     template <typename geometry_type_1, typename geometry_type_2, typename op_type>
0245     geometry_type_1& self_assignment_boolean_op(geometry_type_1& lvalue_, const geometry_type_2& rvalue_) {
0246       typedef geometry_type_1 ltype;
0247       typedef geometry_type_2 rtype;
0248       typedef typename polygon_90_set_traits<ltype>::coordinate_type coordinate_type;
0249       typedef polygon_90_set_data<coordinate_type> value_type;
0250       orientation_2d orient_ = polygon_90_set_traits<ltype>::orient(lvalue_);
0251       //BM: rvalue_ data set may have its own orientation for scanline
0252       orientation_2d orient_r = polygon_90_set_traits<rtype>::orient(rvalue_);
0253       //std::cout << "self-assignment boolean-op (left, right, out):\t" << orient_.to_int()
0254       //          << "," << orient_r.to_int() << "," << orient_.to_int() << std::endl;
0255       value_type linput_(orient_);
0256       // BM: the rinput_ set's (that stores the rvalue_ dataset  polygons) scanline orientation is *forced*
0257       // to be same as linput
0258       value_type rinput_(orient_);
0259       //BM: The output dataset's scanline orient is set as equal to first input dataset's (lvalue_) orientation
0260       value_type output_(orient_);
0261       insert_into_view_arg(linput_, lvalue_, orient_);
0262       // BM: The last argument orient_r is the user initialized scanline orientation for rvalue_ data set.
0263       // But since rinput (see above) is initialized to scanline orientation consistent with the lvalue_
0264       // data set, this insertion operation will change the incoming rvalue_ dataset's scanline orientation
0265       insert_into_view_arg(rinput_, rvalue_, orient_r);
0266       // BM: boolean operation and output uses lvalue_ dataset's scanline orientation.
0267       output_.applyBooleanBinaryOp(linput_.begin(), linput_.end(),
0268                                    rinput_.begin(), rinput_.end(), boolean_op::BinaryCount<op_type>());
0269       polygon_90_set_mutable_traits<geometry_type_1>::set(lvalue_, output_.begin(), output_.end(), orient_);
0270       return lvalue_;
0271     }
0272 
0273   namespace operators {
0274   struct y_ps90_b : gtl_yes {};
0275 
0276   template <typename geometry_type_1, typename geometry_type_2>
0277   typename enable_if< typename gtl_and_3< y_ps90_b,
0278     typename is_polygon_90_set_type<geometry_type_1>::type,
0279     typename is_polygon_90_set_type<geometry_type_2>::type>::type,
0280                        polygon_90_set_view<geometry_type_1, geometry_type_2, boolean_op::BinaryOr> >::type
0281   operator|(const geometry_type_1& lvalue, const geometry_type_2& rvalue) {
0282     return polygon_90_set_view<geometry_type_1, geometry_type_2, boolean_op::BinaryOr>
0283       (lvalue, rvalue,
0284        polygon_90_set_traits<geometry_type_1>::orient(lvalue),
0285        boolean_op::BinaryOr());
0286   }
0287 
0288   struct y_ps90_p : gtl_yes {};
0289 
0290   template <typename geometry_type_1, typename geometry_type_2>
0291   typename enable_if<
0292     typename gtl_and_3< y_ps90_p,
0293       typename gtl_if<typename is_polygon_90_set_type<geometry_type_1>::type>::type,
0294       typename gtl_if<typename is_polygon_90_set_type<geometry_type_2>::type>::type>::type,
0295     polygon_90_set_view<geometry_type_1, geometry_type_2, boolean_op::BinaryOr> >::type
0296   operator+(const geometry_type_1& lvalue, const geometry_type_2& rvalue) {
0297     return polygon_90_set_view<geometry_type_1, geometry_type_2, boolean_op::BinaryOr>
0298       (lvalue, rvalue,
0299        polygon_90_set_traits<geometry_type_1>::orient(lvalue),
0300        boolean_op::BinaryOr());
0301   }
0302 
0303   struct y_ps90_s : gtl_yes {};
0304 
0305   template <typename geometry_type_1, typename geometry_type_2>
0306   typename enable_if< typename gtl_and_3< y_ps90_s,
0307     typename is_polygon_90_set_type<geometry_type_1>::type,
0308     typename is_polygon_90_set_type<geometry_type_2>::type>::type,
0309                        polygon_90_set_view<geometry_type_1, geometry_type_2, boolean_op::BinaryAnd> >::type
0310   operator*(const geometry_type_1& lvalue, const geometry_type_2& rvalue) {
0311     return polygon_90_set_view<geometry_type_1, geometry_type_2, boolean_op::BinaryAnd>
0312       (lvalue, rvalue,
0313        polygon_90_set_traits<geometry_type_1>::orient(lvalue),
0314        boolean_op::BinaryAnd());
0315   }
0316 
0317   struct y_ps90_a : gtl_yes {};
0318 
0319   template <typename geometry_type_1, typename geometry_type_2>
0320   typename enable_if< typename gtl_and_3< y_ps90_a,
0321     typename is_polygon_90_set_type<geometry_type_1>::type,
0322     typename is_polygon_90_set_type<geometry_type_2>::type>::type,
0323                        polygon_90_set_view<geometry_type_1, geometry_type_2, boolean_op::BinaryAnd> >::type
0324   operator&(const geometry_type_1& lvalue, const geometry_type_2& rvalue) {
0325     return polygon_90_set_view<geometry_type_1, geometry_type_2, boolean_op::BinaryAnd>
0326       (lvalue, rvalue,
0327        polygon_90_set_traits<geometry_type_1>::orient(lvalue),
0328        boolean_op::BinaryAnd());
0329   }
0330 
0331   struct y_ps90_x : gtl_yes {};
0332 
0333   template <typename geometry_type_1, typename geometry_type_2>
0334   typename enable_if< typename gtl_and_3< y_ps90_x,
0335     typename is_polygon_90_set_type<geometry_type_1>::type,
0336     typename is_polygon_90_set_type<geometry_type_2>::type>::type,
0337                        polygon_90_set_view<geometry_type_1, geometry_type_2, boolean_op::BinaryXor> >::type
0338   operator^(const geometry_type_1& lvalue, const geometry_type_2& rvalue) {
0339     return polygon_90_set_view<geometry_type_1, geometry_type_2, boolean_op::BinaryXor>
0340       (lvalue, rvalue,
0341        polygon_90_set_traits<geometry_type_1>::orient(lvalue),
0342        boolean_op::BinaryXor());
0343   }
0344 
0345   struct y_ps90_m : gtl_yes {};
0346 
0347   template <typename geometry_type_1, typename geometry_type_2>
0348   typename enable_if< typename gtl_and_3< y_ps90_m,
0349     typename gtl_if<typename is_polygon_90_set_type<geometry_type_1>::type>::type,
0350     typename gtl_if<typename is_polygon_90_set_type<geometry_type_2>::type>::type>::type,
0351                        polygon_90_set_view<geometry_type_1, geometry_type_2, boolean_op::BinaryNot> >::type
0352   operator-(const geometry_type_1& lvalue, const geometry_type_2& rvalue) {
0353     return polygon_90_set_view<geometry_type_1, geometry_type_2, boolean_op::BinaryNot>
0354       (lvalue, rvalue,
0355        polygon_90_set_traits<geometry_type_1>::orient(lvalue),
0356        boolean_op::BinaryNot());
0357   }
0358 
0359   struct y_ps90_pe : gtl_yes {};
0360 
0361   template <typename coordinate_type_1, typename geometry_type_2>
0362   typename enable_if< typename gtl_and< y_ps90_pe, typename is_polygon_90_set_type<geometry_type_2>::type>::type,
0363                        polygon_90_set_data<coordinate_type_1> >::type &
0364   operator+=(polygon_90_set_data<coordinate_type_1>& lvalue, const geometry_type_2& rvalue) {
0365     lvalue.insert(polygon_90_set_traits<geometry_type_2>::begin(rvalue), polygon_90_set_traits<geometry_type_2>::end(rvalue),
0366                   polygon_90_set_traits<geometry_type_2>::orient(rvalue));
0367     return lvalue;
0368   }
0369 
0370   struct y_ps90_be : gtl_yes {};
0371   //
0372   template <typename coordinate_type_1, typename geometry_type_2>
0373   typename enable_if< typename gtl_and< y_ps90_be, typename is_polygon_90_set_type<geometry_type_2>::type>::type,
0374                        polygon_90_set_data<coordinate_type_1> >::type &
0375   operator|=(polygon_90_set_data<coordinate_type_1>& lvalue, const geometry_type_2& rvalue) {
0376     return lvalue += rvalue;
0377   }
0378 
0379   struct y_ps90_pe2 : gtl_yes {};
0380 
0381   //normal self assignment boolean operations
0382   template <typename geometry_type_1, typename geometry_type_2>
0383   typename enable_if< typename gtl_and_3< y_ps90_pe2, typename is_mutable_polygon_90_set_type<geometry_type_1>::type,
0384                                          typename is_polygon_90_set_type<geometry_type_2>::type>::type,
0385                        geometry_type_1>::type &
0386   operator+=(geometry_type_1& lvalue, const geometry_type_2& rvalue) {
0387     return self_assignment_boolean_op<geometry_type_1, geometry_type_2, boolean_op::BinaryOr>(lvalue, rvalue);
0388   }
0389 
0390   struct y_ps90_be2 : gtl_yes {};
0391 
0392   template <typename geometry_type_1, typename geometry_type_2>
0393   typename enable_if< typename gtl_and_3<y_ps90_be2, typename is_mutable_polygon_90_set_type<geometry_type_1>::type,
0394                                          typename is_polygon_90_set_type<geometry_type_2>::type>::type,
0395                        geometry_type_1>::type &
0396   operator|=(geometry_type_1& lvalue, const geometry_type_2& rvalue) {
0397     return self_assignment_boolean_op<geometry_type_1, geometry_type_2, boolean_op::BinaryOr>(lvalue, rvalue);
0398   }
0399 
0400   struct y_ps90_se : gtl_yes {};
0401 
0402   template <typename geometry_type_1, typename geometry_type_2>
0403   typename enable_if< typename gtl_and_3<y_ps90_se, typename is_mutable_polygon_90_set_type<geometry_type_1>::type,
0404                                          typename is_polygon_90_set_type<geometry_type_2>::type>::type,
0405                        geometry_type_1>::type &
0406   operator*=(geometry_type_1& lvalue, const geometry_type_2& rvalue) {
0407     return self_assignment_boolean_op<geometry_type_1, geometry_type_2, boolean_op::BinaryAnd>(lvalue, rvalue);
0408   }
0409 
0410   struct y_ps90_ae : gtl_yes {};
0411 
0412   template <typename geometry_type_1, typename geometry_type_2>
0413   typename enable_if< typename gtl_and_3<y_ps90_ae, typename is_mutable_polygon_90_set_type<geometry_type_1>::type,
0414                                          typename is_polygon_90_set_type<geometry_type_2>::type>::type,
0415                        geometry_type_1>::type &
0416   operator&=(geometry_type_1& lvalue, const geometry_type_2& rvalue) {
0417     return self_assignment_boolean_op<geometry_type_1, geometry_type_2, boolean_op::BinaryAnd>(lvalue, rvalue);
0418   }
0419 
0420   struct y_ps90_xe : gtl_yes {};
0421 
0422   template <typename geometry_type_1, typename geometry_type_2>
0423   typename enable_if< typename gtl_and_3<y_ps90_xe, typename is_mutable_polygon_90_set_type<geometry_type_1>::type,
0424                                          typename is_polygon_90_set_type<geometry_type_2>::type>::type,
0425                        geometry_type_1>::type &
0426   operator^=(geometry_type_1& lvalue, const geometry_type_2& rvalue) {
0427     return self_assignment_boolean_op<geometry_type_1, geometry_type_2, boolean_op::BinaryXor>(lvalue, rvalue);
0428   }
0429 
0430   struct y_ps90_me : gtl_yes {};
0431 
0432   template <typename geometry_type_1, typename geometry_type_2>
0433   typename enable_if< typename gtl_and_3< y_ps90_me, typename is_mutable_polygon_90_set_type<geometry_type_1>::type,
0434                                          typename is_polygon_90_set_type<geometry_type_2>::type>::type,
0435                        geometry_type_1>::type &
0436   operator-=(geometry_type_1& lvalue, const geometry_type_2& rvalue) {
0437     return self_assignment_boolean_op<geometry_type_1, geometry_type_2, boolean_op::BinaryNot>(lvalue, rvalue);
0438   }
0439 
0440   struct y_ps90_rpe : gtl_yes {};
0441 
0442   template <typename geometry_type_1, typename coordinate_type_1>
0443   typename enable_if< typename gtl_and_3<y_ps90_rpe,
0444     typename is_mutable_polygon_90_set_type<geometry_type_1>::type,
0445     typename gtl_same_type<typename geometry_concept<coordinate_type_1>::type, coordinate_concept>::type>::type,
0446                        geometry_type_1>::type &
0447   operator+=(geometry_type_1& lvalue, coordinate_type_1 rvalue) {
0448     return resize(lvalue, rvalue);
0449   }
0450 
0451   struct y_ps90_rme : gtl_yes {};
0452 
0453   template <typename geometry_type_1, typename coordinate_type_1>
0454   typename enable_if< typename gtl_and_3<y_ps90_rme,
0455     typename is_mutable_polygon_90_set_type<geometry_type_1>::type,
0456     typename gtl_same_type<typename geometry_concept<coordinate_type_1>::type, coordinate_concept>::type>::type,
0457                        geometry_type_1>::type &
0458   operator-=(geometry_type_1& lvalue, coordinate_type_1 rvalue) {
0459     return resize(lvalue, -rvalue);
0460   }
0461 
0462   struct y_ps90_rp : gtl_yes {};
0463 
0464   template <typename geometry_type_1, typename coordinate_type_1>
0465   typename enable_if< typename gtl_and_3<y_ps90_rp,
0466     typename gtl_if<typename is_mutable_polygon_90_set_type<geometry_type_1>::type>::type,
0467     typename gtl_if<typename gtl_same_type<typename geometry_concept<coordinate_type_1>::type, coordinate_concept>::type>::type>::type,
0468   geometry_type_1>::type
0469   operator+(const geometry_type_1& lvalue, coordinate_type_1 rvalue) {
0470     geometry_type_1 retval(lvalue);
0471     retval += rvalue;
0472     return retval;
0473   }
0474 
0475   struct y_ps90_rm : gtl_yes {};
0476 
0477   template <typename geometry_type_1, typename coordinate_type_1>
0478   typename enable_if< typename gtl_and_3<y_ps90_rm,
0479     typename gtl_if<typename is_mutable_polygon_90_set_type<geometry_type_1>::type>::type,
0480     typename gtl_if<typename gtl_same_type<typename geometry_concept<coordinate_type_1>::type, coordinate_concept>::type>::type>::type,
0481   geometry_type_1>::type
0482   operator-(const geometry_type_1& lvalue, coordinate_type_1 rvalue) {
0483     geometry_type_1 retval(lvalue);
0484     retval -= rvalue;
0485     return retval;
0486   }
0487   }
0488 }
0489 }
0490 #endif