/usr/include/CGAL/Kernel_d/DirectionCd.h is in libcgal-dev 4.2-5ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 | // Copyright (c) 2000,2001
// Utrecht University (The Netherlands),
// ETH Zurich (Switzerland),
// INRIA Sophia-Antipolis (France),
// Max-Planck-Institute Saarbruecken (Germany),
// and Tel-Aviv University (Israel). All rights reserved.
//
// This file is part of CGAL (www.cgal.org); 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.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// $URL$
// $Id$
//
//
// Author(s) : Michael Seel
#ifndef CGAL_DIRECTIONCD_H
#define CGAL_DIRECTIONCD_H
#include <CGAL/basic.h>
#include <CGAL/Kernel_d/Tuple_d.h>
namespace CGAL {
template <class FT, class LA> class DirectionCd;
template <class FT, class LA>
std::istream& operator>>(std::istream&, DirectionCd<FT,LA>&);
template <class FT, class LA>
std::ostream& operator<<(std::ostream&, const DirectionCd<FT,LA>&);
template <class _FT, class _LA>
class DirectionCd : public Handle_for< Tuple_d<_FT,_LA> > {
typedef Tuple_d<_FT,_LA> Tuple;
typedef Handle_for<Tuple> Base;
typedef DirectionCd<_FT,_LA> Self;
using Base::ptr;
const typename _LA::Vector& vector_rep() const { return ptr()->v; }
_FT& entry(int i) { return ptr()->v[i]; }
const _FT& entry(int i) const { return ptr()->v[i]; }
public:
/*{\Mtypes 4}*/
typedef _FT RT;
typedef _FT FT;
typedef _LA LA;
typedef typename Tuple::const_iterator Delta_const_iterator;
class Base_direction {};
friend class VectorCd<FT,LA>;
DirectionCd(int d = 0) : Base( Tuple(d) ) {}
DirectionCd(const VectorCd<FT,LA>& v);
template <class InputIterator>
DirectionCd(int d, InputIterator first, InputIterator last) :
Base( Tuple(d,first,last) ) {}
DirectionCd(int d, Base_direction, int i) : Base( Tuple(d) )
{ if ( d==0 ) return;
CGAL_assertion_msg((0<=i&&i<d), "DirectionCd::base: index out of range.");
entry(i) = 1;
}
DirectionCd(const FT& x, const FT y) : Base( Tuple(x,y) ) {}
DirectionCd(int a, int b) : Base( Tuple(FT(a),FT(b)) ) {}
DirectionCd(const FT& x, const FT& y, const FT& z) :
Base( Tuple(x,y,z) ) {}
DirectionCd(int a, int b, int c) : Base( Tuple(FT(a),FT(b),FT(c), MatchHelper()) ) {}
DirectionCd(const DirectionCd<FT,LA>& p) : Base(p) {}
~DirectionCd() {}
int dimension() const { return ptr()->size(); }
FT delta(int i) const
{ CGAL_assertion_msg((0<=i && i<(dimension())),
"DirectionCd::delta(): index out of range.");
return entry(i);
}
FT D() { return FT(1); }
FT operator[](int i) const
{ return delta(i); }
Delta_const_iterator deltas_begin() const { return ptr()->begin(); }
Delta_const_iterator deltas_end() const { return ptr()->end(); }
VectorCd<FT,LA> vector() const;
bool is_degenerate() const
{ return vector_rep().is_zero(); }
DirectionCd<FT,LA> transform(const Aff_transformationCd<FT,LA>& t) const;
DirectionCd<FT,LA> opposite() const
{ DirectionCd<FT,LA> result(*this); // creates a copied object!
result.copy_on_write(); // creates a copied object!
result.ptr()->invert();
return result;
}
DirectionCd<FT,LA> operator- () const
{ return opposite(); }
static Comparison_result cmp(
const DirectionCd<FT,LA>& h1, const DirectionCd<FT,LA>& h2);
bool operator==(const DirectionCd<FT,LA>& w) const
{ if ( this->identical(w) ) return true;
if ( dimension()!=w.dimension() ) return false;
return (DirectionCd<RT,LA>::cmp(*this,w) == EQUAL);
}
bool operator!=(const DirectionCd<FT,LA>& w) const
{ return !operator==(w); }
FT dx() const { return delta(0); }
FT dy() const { return delta(1); }
FT dz() const { return delta(2); }
friend std::istream& operator>> <>
(std::istream& I, DirectionCd<FT,LA>& d);
friend std::ostream& operator<< <>
(std::ostream& O, const DirectionCd<FT,LA>& d);
}; // end of class DirectionCd
} //namespace CGAL
#endif // CGAL_DIRECTIONCD_H
//----------------------- end of file ----------------------------------
|