⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 aff_transformationh3.h

📁 很多二维 三维几何计算算法 C++ 类库
💻 H
📖 第 1 页 / 共 2 页
字号:
                                                   t21, t22, t23,     // i 01                                                   RT0, RT0, t33 ),                           det3x3_by_formula( t01, t02, t03,                                                   t11, t12, t13,     // i 02                                                   RT0, RT0, t33 ),                        -  det3x3_by_formula( t01, t02, t03,                                                   t11, t12, t13,     // i 03                                                   t21, t22, t23 ),                        -  det3x3_by_formula( t10, t12, t13,                                                   t20, t22, t23,     // i 10                                                   RT0, RT0, t33 ),                           det3x3_by_formula( t00, t02, t03,                                                   t20, t22, t23,     // i 11                                                   RT0, RT0, t33 ),                        -  det3x3_by_formula( t00, t02, t03,                                                   t10, t12, t13,     // i 12                                                   RT0, RT0, t33 ),                           det3x3_by_formula( t00, t02, t03,                                                   t10, t12, t13,     // i 13                                                   t20, t22, t23 ),                           det3x3_by_formula( t10, t11, t13,                                                   t20, t21, t23,     // i 20                                                   RT0, RT0, t33 ),                        -  det3x3_by_formula( t00, t01, t03,                                                   t20, t21, t23,     // i 21                                                   RT0, RT0, t33 ),                           det3x3_by_formula( t00, t01, t03,                                                   t10, t11, t13,     // i 22                                                   RT0, RT0, t33 ),                        -  det3x3_by_formula( t00, t01, t03,                                                   t10, t11, t13,     // i 23                                                   t20, t21, t23 ),                           det3x3_by_formula( t00, t01, t02,                                                   t10, t11, t12,     // i 33                                                   t20, t21, t22 )                                                       ) ;}template < class R >inlineAff_transformation_repH3<R>Aff_transformation_repH3<R>::general_form() const{ return *this; }template < class R >CGAL_KERNEL_INLINEtypename Aff_transformation_repH3<R>::Aff_transformation_3Aff_transformation_repH3<R>::transpose() const{  typedef typename R::RT RT;  const RT  RT0(0);  return Aff_transformation_3( t00,    t10,    t20,    RT0,                               t01,    t11,    t21,    RT0,                               t02,    t12,    t22,    RT0,                                                              t33);}template < class R >CGAL_KERNEL_INLINEboolAff_transformation_repH3<R>::is_even() const{  return (CGAL_NTS sign<RT>( t33 *	                    det3x3_by_formula(t00, t01, t02,                                              t10, t11, t12,                                              t20, t21, t22 ) ) == POSITIVE );}template < class R >CGAL_KERNEL_LARGE_INLINEtypename Aff_transformation_repH3<R>::RTAff_transformation_repH3<R>::homogeneous(int i, int j) const{  typedef typename R::RT RT;  CGAL_kernel_precondition( (i >= 0) && (i <= 3) && (j >= 0) && (j <= 3) );  const RT  RT0(0);  switch (i)  {    case 0: switch (j)            {              case 0: return t00;              case 1: return t01;              case 2: return t02;              case 3: return t03;            }    case 1: switch (j)            {              case 0: return t10;              case 1: return t11;              case 2: return t12;              case 3: return t13;            }    case 2: switch (j)            {              case 0: return t20;              case 1: return t21;              case 2: return t22;              case 3: return t23;            }    case 3: switch (j)            {              case 0: return RT0;              case 1: return RT0;              case 2: return RT0;              case 3: return t33;            }  }  return RT0;}template < class R >inlinetypename Aff_transformation_repH3<R>::FTAff_transformation_repH3<R>::cartesian(int i, int j) const{  typedef typename R::FT FT;  return  FT(homogeneous(i,j)) / FT(t33);}template <class R>Aff_transformation_repH3<R>Identity_repH3<R>::general_form() const{  typedef typename R::RT RT;  const RT  RT0(0);  const RT  RT1(1);  return Aff_transformation_repH3<R>(RT1, RT0, RT0, RT0,                                         RT0, RT1, RT0, RT0,                                         RT0, RT0, RT1, RT0,                                                        RT1 );}template < class R >inlineTranslation_repH3<R>::Translation_repH3( const typename Translation_repH3<R>::Vector_3& v) : tv(v){}template < class R >CGAL_KERNEL_INLINEtypename Translation_repH3<R>::Point_3Translation_repH3<R>::transform(const typename Translation_repH3<R>::Point_3& p) const{  return Point_3( tv.hw() * p.hx() + tv.hx() * p.hw(),                  tv.hw() * p.hy() + tv.hy() * p.hw(),                  tv.hw() * p.hz() + tv.hz() * p.hw(),                  tv.hw() * p.hw() );}template < class R >inlinetypename Translation_repH3<R>::Vector_3Translation_repH3<R>::transform(const typename Translation_repH3<R>::Vector_3& v) const{ return v; }template < class R >inlinetypename Translation_repH3<R>::Direction_3Translation_repH3<R>::transform(const typename Translation_repH3<R>::Direction_3& dir) const{ return dir; }template < class R >inlinetypename Translation_repH3<R>::Plane_3Translation_repH3<R>::transform(const typename Translation_repH3<R>::Plane_3& pl) const{  return Plane_3( transform( pl.point() ), pl.orthogonal_vector() );}template < class R >inlinetypename Translation_repH3<R>::Aff_transformation_3Translation_repH3<R>::inverse() const{ return Aff_transformation_3(TRANSLATION, - tv ); }template < class R >CGAL_KERNEL_INLINEAff_transformation_repH3<R>Translation_repH3<R>::general_form() const{  const RT  RT0(0);  return Aff_transformation_repH3<R>(tv.hw(), RT0,  RT0,  tv.hx(),                                         RT0,  tv.hw(), RT0,  tv.hy(),                                         RT0,  RT0,  tv.hw(), tv.hz(),                                                              tv.hw() );}template < class R >CGAL_KERNEL_INLINEtypename Translation_repH3<R>::Aff_transformation_3Translation_repH3<R>::transpose() const{  typedef typename R::RT RT;  const RT  RT0(0);  const RT  RT1(1);  return Aff_transformation_3( RT1,  RT0,  RT0,  RT0,                               RT0,  RT1,  RT0,  RT0,                               RT0,  RT0,  RT1,  RT0,                               RT1 );}template < class R >inlineboolTranslation_repH3<R>::is_even() const{ return true; }template < class R >CGAL_KERNEL_LARGE_INLINEtypename Translation_repH3<R>::RTTranslation_repH3<R>::homogeneous(int i, int j) const{  CGAL_kernel_precondition( (i >= 0) && (i <= 3) && (j >= 0) && (j <= 3) );  const RT  RT0(0);  switch (i)  {    case 0: switch (j)            {              case 0: return tv.hw();              case 1: return RT0;              case 2: return RT0;              case 3: return tv.hx();            }    case 1: switch (j)            {              case 0: return RT0;              case 1: return tv.hw();              case 2: return RT0;              case 3: return tv.hy();            }    case 2: switch (j)            {              case 0: return RT0;              case 1: return RT0;              case 2: return tv.hw();              case 3: return tv.hz();            }    case 3: switch (j)            {              case 0: return RT0;              case 1: return RT0;              case 2: return RT0;              case 3: return tv.hw();            }  }  return RT0;}template < class R >inlinetypename Translation_repH3<R>::FTTranslation_repH3<R>::cartesian(int i, int j) const{  return FT(homogeneous(i,j)) / FT(tv.hw());}template < class R >CGAL_KERNEL_INLINEAff_transformationH3<R>_general_transformation_composition(    Aff_transformation_repH3<R> l,    Aff_transformation_repH3<R> r ){  return Aff_transformationH3<R>(            l.t00*r.t00 + l.t01*r.t10 + l.t02*r.t20,            l.t00*r.t01 + l.t01*r.t11 + l.t02*r.t21,            l.t00*r.t02 + l.t01*r.t12 + l.t02*r.t22,            l.t00*r.t03 + l.t01*r.t13 + l.t02*r.t23 + l.t03*r.t33,            l.t10*r.t00 + l.t11*r.t10 + l.t12*r.t20,            l.t10*r.t01 + l.t11*r.t11 + l.t12*r.t21,            l.t10*r.t02 + l.t11*r.t12 + l.t12*r.t22,            l.t10*r.t03 + l.t11*r.t13 + l.t12*r.t23 + l.t13*r.t33,            l.t20*r.t00 + l.t21*r.t10 + l.t22*r.t20,            l.t20*r.t01 + l.t21*r.t11 + l.t22*r.t21,            l.t20*r.t02 + l.t21*r.t12 + l.t22*r.t22,            l.t20*r.t03 + l.t21*r.t13 + l.t22*r.t23 + l.t23*r.t33,            l.t33*r.t33 );}template < class R >CGAL_KERNEL_INLINEAff_transformationH3<R>::Aff_transformationH3(){ initialize_with(Aff_transformation_repH3<R>()); }template < class R >CGAL_KERNEL_INLINEAff_transformationH3<R>::Aff_transformationH3(const Identity_transformation&){ initialize_with(Identity_repH3<R>()); }template < class R >CGAL_KERNEL_INLINEAff_transformationH3<R>::Aff_transformationH3(const Translation&,	             const typename Aff_transformationH3<R>::Vector_3& v){ initialize_with(Translation_repH3<R>( v )); }template < class R >CGAL_KERNEL_INLINEAff_transformationH3<R>::Aff_transformationH3(const Scaling&, const RT& num, const RT& den){  const RT RT0(0);  initialize_with(Aff_transformation_repH3<R>(num, RT0, RT0, RT0,                                            RT0, num, RT0, RT0,                                            RT0, RT0, num, RT0,                                                           den ));}template < class R >CGAL_KERNEL_INLINEAff_transformationH3<R>::Aff_transformationH3(                  const RT& m00, const RT& m01, const RT& m02, const RT& m03,                  const RT& m10, const RT& m11, const RT& m12, const RT& m13,                  const RT& m20, const RT& m21, const RT& m22, const RT& m23,                                                               const RT& m33){  initialize_with(Aff_transformation_repH3<R>(m00, m01, m02, m03,                                            m10, m11, m12, m13,                                            m20, m21, m22, m23,                                                           m33 ));}template < class R >CGAL_KERNEL_INLINEAff_transformationH3<R>::Aff_transformationH3(                  const RT& m00, const RT& m01, const RT& m02,                  const RT& m10, const RT& m11, const RT& m12,                  const RT& m20, const RT& m21, const RT& m22,                                                               const RT& m33){  const RT RT0 = RT(0);  initialize_with(Aff_transformation_repH3<R>(m00, m01, m02, RT0,                                            m10, m11, m12, RT0,                                            m20, m21, m22, RT0,                                                           m33 ));}template < class R >inlinetypename Aff_transformationH3<R>::Point_3Aff_transformationH3<R>::transform(const typename Aff_transformationH3<R>::Point_3& p) const{ return this->Ptr()->transform(p); }template < class R >inlinetypename Aff_transformationH3<R>::Vector_3Aff_transformationH3<R>::transform(const typename Aff_transformationH3<R>::Vector_3& v) const{ return this->Ptr()->transform(v); }template < class R >inlinetypename Aff_transformationH3<R>::Direction_3Aff_transformationH3<R>::transform(const typename Aff_transformationH3<R>::Direction_3& d) const{ return this->Ptr()->transform(d); }template < class R >inlinetypename Aff_transformationH3<R>::Plane_3Aff_transformationH3<R>::transform(const typename Aff_transformationH3<R>::Plane_3& pl) const{ return this->Ptr()->transform(pl); }template < class R >inlinetypename Aff_transformationH3<R>::Aff_transformation_3Aff_transformationH3<R>::inverse() const{ return this->Ptr()->inverse(); }template < class R >inlineAff_transformationH3<R>Aff_transformationH3<R>::transpose() const{ return this->Ptr()->transpose(); }template < class R >inlineboolAff_transformationH3<R>::is_even() const{ return this->Ptr()->is_even(); }template < class R >inlineboolAff_transformationH3<R>::is_odd() const{ return ( ! (this->Ptr()->is_even() )); }template < class R >CGAL_KERNEL_INLINEAff_transformationH3<R>operator*(const Aff_transformationH3<R>& left_argument,          const Aff_transformationH3<R>& right_argument ){ return _general_transformation_composition(              left_argument.Ptr() ->general_form(),              right_argument.Ptr()->general_form() );}template < class R >std::ostream &operator<< ( std::ostream & out,             const Aff_transformationH3<R>& t){ typename R::RT RT0(0); Aff_transformation_repH3<R> r = t.Ptr()->general_form(); return  out << "| "<< r.t00 <<' '<< r.t01 <<' '<< r.t02 <<' '<< r.t03 << " |\n" << "| "<< r.t10 <<' '<< r.t11 <<' '<< r.t12 <<' '<< r.t13 << " |\n" << "| "<< r.t20 <<' '<< r.t21 <<' '<< r.t22 <<' '<< r.t23 << " |\n" << "| "<< RT0   <<' '<< RT0   <<' '<< RT0   <<' '<< r.t33 << " |\n";}CGAL_END_NAMESPACE#endif // CGAL_AFF_TRANSFORMATIONH3_H

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -