Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PlaneS3< FT > Class Template Reference

#include <PlaneS3.h>

Public Member Functions

 PlaneS3 ()
 
 PlaneS3 (const PointS3< FT > &p, const PointS3< FT > &q, const PointS3< FT > &r)
 
 PlaneS3 (const PointS3< FT > &p, const DirectionS3< FT > &d)
 
 PlaneS3 (const PointS3< FT > &p, const VectorS3< FT > &v)
 
 PlaneS3 (const FT &a, const FT &b, const FT &c, const FT &d)
 
 PlaneS3 (const LineS3< FT > &l, const PointS3< FT > &p)
 
 PlaneS3 (const SegmentS3< FT > &s, const PointS3< FT > &p)
 
 PlaneS3 (RayS3< FT > &r, const PointS3< FT > &p)
 
bool operator== (const PlaneS3< FT > &p) const
 
bool operator!= (const PlaneS3< FT > &p) const
 
const FT & a () const
 
const FT & b () const
 
const FT & c () const
 
const FT & d () const
 
LineS3< FT > perpendicular_line (const PointS3< FT > &p) const
 
PlaneS3 opposite () const
 
PointS3< FT > point () const
 
PointS3< FT > projection (const PointS3< FT > &p) const
 
VectorS3< FT > orthogonal_vector () const
 
DirectionS3< FT > orthogonal_direction () const
 
VectorS3< FT > base1 () const
 
VectorS3< FT > base2 () const
 
PointS3< FT > to_plane_basis (const PointS3< FT > &p) const
 
PointS2< FT > to_2d (const PointS3< FT > &p) const
 
PointS3< FT > to_3d (const PointS2< FT > &p) const
 
PlaneS3 transform (const Aff_transformationS3< FT > &t) const
 
Oriented_side oriented_side (const PointS3< FT > &p) const
 
bool has_on_boundary (const PointS3< FT > &p) const
 
bool has_on_boundary (const LineS3< FT > &p) const
 
bool has_on_positive_side (const PointS3< FT > &l) const
 
bool has_on_negative_side (const PointS3< FT > &l) const
 
bool is_degenerate () const
 
void new_rep (const PointS3< FT > &p, const PointS3< FT > &q, const PointS3< FT > &r)
 
void new_rep (const FT &a, const FT &b, const FT &c, const FT &d)
 

Public Attributes

FT e0
 
FT e1
 
FT e2
 
FT e3
 

Detailed Description

template<class FT>
class PlaneS3< FT >

Definition at line 61 of file PlaneS3.h.

Constructor & Destructor Documentation

PlaneS3 ( )
inline

Definition at line 64 of file PlaneS3.h.

64 {}
CGAL_END_NAMESPACE CGAL_BEGIN_NAMESPACE PlaneS3 ( const PointS3< FT > &  p,
const PointS3< FT > &  q,
const PointS3< FT > &  r 
)

Definition at line 169 of file PlaneS3.h.

172 { new_rep(p, q, r); }
void new_rep(const PointS3< FT > &p, const PointS3< FT > &q, const PointS3< FT > &r)
Definition: PlaneS3.h:143
PlaneS3 ( const PointS3< FT > &  p,
const DirectionS3< FT > &  d 
)

Definition at line 175 of file PlaneS3.h.

References DirectionS3< FT >::dx(), DirectionS3< FT >::dy(), DirectionS3< FT >::dz(), PointS3< FT >::x(), PointS3< FT >::y(), and PointS3< FT >::z().

176 {
177  new_rep(d.dx(), d.dy(),
178  d.dz(),
179  -d.dx() * p.x() - d.dy() * p.y() - d.dz() * p.z());
180 }
const FT & dx() const
Definition: DirectionS3.h:155
const FT & dz() const
Definition: DirectionS3.h:169
const FT & dy() const
Definition: DirectionS3.h:162
void new_rep(const PointS3< FT > &p, const PointS3< FT > &q, const PointS3< FT > &r)
Definition: PlaneS3.h:143

Here is the call graph for this function:

PlaneS3 ( const PointS3< FT > &  p,
const VectorS3< FT > &  v 
)

Definition at line 183 of file PlaneS3.h.

References VectorS3< FT >::x(), PointS3< FT >::x(), VectorS3< FT >::y(), PointS3< FT >::y(), VectorS3< FT >::z(), and PointS3< FT >::z().

184 { new_rep(v.x(), v.y(), v.z(), -v.x() * p.x() - v.y() * p.y() - v.z() * p.z()); }
void new_rep(const PointS3< FT > &p, const PointS3< FT > &q, const PointS3< FT > &r)
Definition: PlaneS3.h:143

Here is the call graph for this function:

PlaneS3 ( const FT &  a,
const FT &  b,
const FT &  c,
const FT &  d 
)

Definition at line 187 of file PlaneS3.h.

188 { new_rep(a, b, c, d); }
const FT & d() const
Definition: PlaneS3.h:234
const FT & c() const
Definition: PlaneS3.h:229
void new_rep(const PointS3< FT > &p, const PointS3< FT > &q, const PointS3< FT > &r)
Definition: PlaneS3.h:143
const FT & b() const
Definition: PlaneS3.h:224
const FT & a() const
Definition: PlaneS3.h:219
PlaneS3 ( const LineS3< FT > &  l,
const PointS3< FT > &  p 
)

Definition at line 191 of file PlaneS3.h.

References LineS3< FT >::direction(), and LineS3< FT >::point().

192 { new_rep(l.point(), l.point()+l.direction().vector(), p); }
void new_rep(const PointS3< FT > &p, const PointS3< FT > &q, const PointS3< FT > &r)
Definition: PlaneS3.h:143
PointS3< FT > point() const
Definition: LineS3.h:145
DirectionS3< FT > direction() const
Definition: LineS3.h:150

Here is the call graph for this function:

PlaneS3 ( const SegmentS3< FT > &  s,
const PointS3< FT > &  p 
)

Definition at line 195 of file PlaneS3.h.

References SegmentS3< FT >::end(), and SegmentS3< FT >::start().

196 { new_rep(s.start(), s.end(), p); }
PointS3< FT > start() const
Definition: SegmentS3.h:115
void new_rep(const PointS3< FT > &p, const PointS3< FT > &q, const PointS3< FT > &r)
Definition: PlaneS3.h:143
PointS3< FT > end() const
Definition: SegmentS3.h:120

Here is the call graph for this function:

PlaneS3 ( RayS3< FT > &  r,
const PointS3< FT > &  p 
)

Definition at line 199 of file PlaneS3.h.

References RayS3< FT >::second_point(), and RayS3< FT >::start().

200 { new_rep(r.start(), r.second_point(), p); }
void new_rep(const PointS3< FT > &p, const PointS3< FT > &q, const PointS3< FT > &r)
Definition: PlaneS3.h:143
PointS3< FT > second_point() const
Definition: RayS3.h:133
PointS3< FT > start() const
Definition: RayS3.h:122

Here is the call graph for this function:

Member Function Documentation

const FT & a ( ) const

Definition at line 219 of file PlaneS3.h.

Referenced by cmp_signed_dist_to_plane(), gp_linear_intersection(), has_larger_signed_dist_to_plane(), has_smaller_signed_dist_to_plane(), projection(), and scaled_distance_to_plane().

220 { return e0; }
FT e0
Definition: PlaneS3.h:122

Here is the caller graph for this function:

const FT & b ( ) const

Definition at line 224 of file PlaneS3.h.

Referenced by cmp_signed_dist_to_plane(), gp_linear_intersection(), has_larger_signed_dist_to_plane(), has_smaller_signed_dist_to_plane(), projection(), and scaled_distance_to_plane().

225 { return e1; }
FT e1
Definition: PlaneS3.h:123

Here is the caller graph for this function:

VectorS3< FT > base1 ( ) const

Definition at line 269 of file PlaneS3.h.

270 {
271  if( a() == FT(0) ) // parallel to x-axis
272  return VectorS3<FT>(FT(1), FT(0), FT(0));
273 
274  if( b() == FT(0) ) // parallel to y-axis
275  return VectorS3<FT>(FT(0), FT(1), FT(0));
276 
277  if (c() == FT(0) ) // parallel to z-axis
278  return VectorS3<FT>(FT(0), FT(0), FT(1));
279 
280  return VectorS3<FT>(-b(), a(), FT(0));
281 }
const FT & c() const
Definition: PlaneS3.h:229
const FT & b() const
Definition: PlaneS3.h:224
const FT & a() const
Definition: PlaneS3.h:219
VectorS3< FT > base2 ( ) const

Definition at line 285 of file PlaneS3.h.

286 {
287  if ( a() == FT(0) ) // parallel to x-axis x-axis already returned in base1
288  {
289  if (b() == FT(0) ) // parallel to y-axis
290  return VectorS3<FT>(FT(0), FT(1), FT(0));
291 
292  if (c() == FT(0) ) // parallel to z-axis
293  return VectorS3<FT>(FT(0), FT(0), FT(1));
294 
295  return VectorS3<FT>(FT(0), -b(), c());
296  }
297  if (b() == FT(0) )
298  return VectorS3<FT>(c(), FT(0), -a());
299 
300  if (c() == FT(0) )
301  return VectorS3<FT>(-b(), a(), FT(0));
302 
303  return VectorS3<FT>(FT(0), -c(), b());
304 }
const FT & c() const
Definition: PlaneS3.h:229
const FT & b() const
Definition: PlaneS3.h:224
const FT & a() const
Definition: PlaneS3.h:219
const FT & c ( ) const

Definition at line 229 of file PlaneS3.h.

Referenced by cmp_signed_dist_to_plane(), gp_linear_intersection(), has_larger_signed_dist_to_plane(), has_smaller_signed_dist_to_plane(), projection(), and scaled_distance_to_plane().

230 { return e2; }
FT e2
Definition: PlaneS3.h:124

Here is the caller graph for this function:

const FT & d ( ) const

Definition at line 234 of file PlaneS3.h.

Referenced by gp_linear_intersection(), projection(), and scaled_distance_to_plane().

235 { return e3; }
FT e3
Definition: PlaneS3.h:125

Here is the caller graph for this function:

bool has_on_boundary ( const PointS3< FT > &  p) const

Definition at line 380 of file PlaneS3.h.

References d, PointS3< FT >::x(), PointS3< FT >::y(), and PointS3< FT >::z().

381 {
382  return (a()*p.x() + b()*p.y() + c()*p.z() +d()) == FT(0);
383 }
const FT & d() const
Definition: PlaneS3.h:234
const FT & c() const
Definition: PlaneS3.h:229
const FT & b() const
Definition: PlaneS3.h:224
const FT & a() const
Definition: PlaneS3.h:219

Here is the call graph for this function:

bool has_on_boundary ( const LineS3< FT > &  p) const

Definition at line 386 of file PlaneS3.h.

References LineS3< FT >::direction(), and LineS3< FT >::point().

387 {
388  return has_on_boundary(l.point())
389  && has_on_boundary(l.point() + l.direction().vector());
390 }
bool has_on_boundary(const PointS3< FT > &p) const
Definition: PlaneS3.h:380

Here is the call graph for this function:

bool has_on_negative_side ( const PointS3< FT > &  l) const

Definition at line 399 of file PlaneS3.h.

References d, PointS3< FT >::x(), PointS3< FT >::y(), and PointS3< FT >::z().

400 {
401  return (a()*p.x() + b()*p.y() + c()*p.z() +d()) < FT(0);
402 }
const FT & d() const
Definition: PlaneS3.h:234
const FT & c() const
Definition: PlaneS3.h:229
const FT & b() const
Definition: PlaneS3.h:224
const FT & a() const
Definition: PlaneS3.h:219

Here is the call graph for this function:

bool has_on_positive_side ( const PointS3< FT > &  l) const

Definition at line 393 of file PlaneS3.h.

References d, PointS3< FT >::x(), PointS3< FT >::y(), and PointS3< FT >::z().

394 {
395  return (a()*p.x() + b()*p.y() + c()*p.z() +d()) > FT(0);
396 }
const FT & d() const
Definition: PlaneS3.h:234
const FT & c() const
Definition: PlaneS3.h:229
const FT & b() const
Definition: PlaneS3.h:224
const FT & a() const
Definition: PlaneS3.h:219

Here is the call graph for this function:

bool is_degenerate ( ) const

Definition at line 406 of file PlaneS3.h.

407 {
408  return (a() == FT(0)) && (b() == FT(0)) && (c() == FT(0));
409 }
const FT & c() const
Definition: PlaneS3.h:229
const FT & b() const
Definition: PlaneS3.h:224
const FT & a() const
Definition: PlaneS3.h:219
void new_rep ( const PointS3< FT > &  p,
const PointS3< FT > &  q,
const PointS3< FT > &  r 
)
inline

Definition at line 143 of file PlaneS3.h.

References PointS3< FT >::x(), PointS3< FT >::y(), and PointS3< FT >::z().

146 {
147  FT rpx = p.x()-r.x();
148  FT rpy = p.y()-r.y();
149  FT rpz = p.z()-r.z();
150  FT rqx = q.x()-r.x();
151  FT rqy = q.y()-r.y();
152  FT rqz = q.z()-r.z();
153  // Cross product rp * rq.
154  e0 = rpy*rqz - rqy*rpz;
155  e1 = rpz*rqx - rqz*rpx;
156  e2 = rpx*rqy - rqx*rpy;
157  e3 = - e0*r.x() - e1*r.y() - e2*r.z();
158 }
FT e2
Definition: PlaneS3.h:124
FT e3
Definition: PlaneS3.h:125
FT e1
Definition: PlaneS3.h:123
FT e0
Definition: PlaneS3.h:122

Here is the call graph for this function:

void new_rep ( const FT &  a,
const FT &  b,
const FT &  c,
const FT &  d 
)
inline

Definition at line 132 of file PlaneS3.h.

References d.

133 {
134  e0 = a;
135  e1 = b;
136  e2 = c;
137  e3 = d;
138 }
const FT & d() const
Definition: PlaneS3.h:234
FT e2
Definition: PlaneS3.h:124
const FT & c() const
Definition: PlaneS3.h:229
FT e3
Definition: PlaneS3.h:125
const FT & b() const
Definition: PlaneS3.h:224
FT e1
Definition: PlaneS3.h:123
const FT & a() const
Definition: PlaneS3.h:219
FT e0
Definition: PlaneS3.h:122
bool operator!= ( const PlaneS3< FT > &  p) const

Definition at line 212 of file PlaneS3.h.

213 {
214  return !(*this == p);
215 }
bool operator== ( const PlaneS3< FT > &  p) const

Definition at line 204 of file PlaneS3.h.

References PlaneS3< FT >::orthogonal_direction(), and PlaneS3< FT >::point().

205 {
206  return has_on_boundary(p.point()) &&
208 
209 }
PointS3< FT > point() const
Definition: PlaneS3.h:238
bool has_on_boundary(const PointS3< FT > &p) const
Definition: PlaneS3.h:380
DirectionS3< FT > orthogonal_direction() const
Definition: PlaneS3.h:263

Here is the call graph for this function:

PlaneS3< FT > opposite ( ) const

Definition at line 356 of file PlaneS3.h.

References d.

357 { return PlaneS3<FT>(-a(),-b(),-c(),-d()); }
const FT & d() const
Definition: PlaneS3.h:234
const FT & c() const
Definition: PlaneS3.h:229
const FT & b() const
Definition: PlaneS3.h:224
const FT & a() const
Definition: PlaneS3.h:219
Oriented_side oriented_side ( const PointS3< FT > &  p) const

Definition at line 376 of file PlaneS3.h.

References CGAL_NTS, d, sign(), PointS3< FT >::x(), PointS3< FT >::y(), and PointS3< FT >::z().

377 { return Oriented_side(CGAL_NTS sign(a()*p.x() + b()*p.y() + c()*p.z() +d())); }
const FT & d() const
Definition: PlaneS3.h:234
static SURF_BEGIN_NAMESPACE double sign(double x)
const FT & c() const
Definition: PlaneS3.h:229
Oriented_side
Definition: enum.h:78
const FT & b() const
Definition: PlaneS3.h:224
const FT & a() const
Definition: PlaneS3.h:219
#define CGAL_NTS

Here is the call graph for this function:

DirectionS3< FT > orthogonal_direction ( ) const

Definition at line 263 of file PlaneS3.h.

Referenced by PlaneS3< FT >::operator==().

264 {
265  return DirectionS3<FT>(a(), b(), c());
266 }
const FT & c() const
Definition: PlaneS3.h:229
const FT & b() const
Definition: PlaneS3.h:224
const FT & a() const
Definition: PlaneS3.h:219

Here is the caller graph for this function:

VectorS3< FT > orthogonal_vector ( ) const

Definition at line 256 of file PlaneS3.h.

257 {
258  return VectorS3<FT>(a(), b(), c());
259 }
const FT & c() const
Definition: PlaneS3.h:229
const FT & b() const
Definition: PlaneS3.h:224
const FT & a() const
Definition: PlaneS3.h:219
LineS3< FT > perpendicular_line ( const PointS3< FT > &  p) const

Definition at line 351 of file PlaneS3.h.

352 { return LineS3<FT>(p, orthogonal_direction()); }
DirectionS3< FT > orthogonal_direction() const
Definition: PlaneS3.h:263
Definition: LineS3.h:59
PointS3< FT > point ( ) const

Definition at line 238 of file PlaneS3.h.

References d.

Referenced by PlaneS3< FT >::operator==().

239 {
240  if (a() != FT(0)) // not parallel to x-axis
241  return PointS3<FT>(-d()/a(), FT(0), FT(0));
242  if (b() != FT(0)) // not parallel to y-axis
243  return PointS3<FT>(FT(0), -d()/b(), FT(0));
244  // parallel to xy-plane => intersects z-axis
245  return PointS3<FT>(FT(0), FT(0), -d()/c());
246 }
const FT & d() const
Definition: PlaneS3.h:234
const FT & c() const
Definition: PlaneS3.h:229
const FT & b() const
Definition: PlaneS3.h:224
const FT & a() const
Definition: PlaneS3.h:219

Here is the caller graph for this function:

PointS3< FT > projection ( const PointS3< FT > &  p) const

Definition at line 250 of file PlaneS3.h.

References projection().

251 {
252  return CGAL::projection(p, *this);
253 }
CGAL_KERNEL_LARGE_INLINE PointS3< FT > projection(const PointS3< FT > &p, const PlaneS3< FT > &h)

Here is the call graph for this function:

PointS2< FT > to_2d ( const PointS3< FT > &  p) const

Definition at line 324 of file PlaneS3.h.

References solve(), VectorS3< FT >::x(), VectorS3< FT >::y(), and VectorS3< FT >::z().

325 {
326  const VectorS3<FT>& v0 = base1();
327  const VectorS3<FT>& v1 = base2();
329  VectorS3<FT> v3 = p - point();
330  FT alpha, beta, gamma;
331 
332  solve(v0.x(), v0.y(), v0.z(),
333  v1.x(), v1.y(), v1.z(),
334  v2.x(), v2.y(), v2.z(),
335  v3.x(), v3.y(), v3.z(),
336  alpha, beta, gamma);
337 
338  return PointS2<FT>(alpha, beta);
339 }
PointS3< FT > point() const
Definition: PlaneS3.h:238
VectorS3< FT > orthogonal_vector() const
Definition: PlaneS3.h:256
VectorS3< FT > base2() const
Definition: PlaneS3.h:285
VectorS3< FT > base1() const
Definition: PlaneS3.h:269
CGAL_BEGIN_NAMESPACE void solve(const FT &a1, const FT &a2, const FT &a3, const FT &b1, const FT &b2, const FT &b3, const FT &c1, const FT &c2, const FT &c3, const FT &d1, const FT &d2, const FT &d3, FT &x, FT &y, FT &z)
Definition: solve.h:57

Here is the call graph for this function:

PointS3< FT > to_3d ( const PointS2< FT > &  p) const

Definition at line 343 of file PlaneS3.h.

References PointS2< FT >::x(), and PointS2< FT >::y().

344 {
345  VectorS3<FT> e1 = base1(),
346  e2 = base2();
347  return point() + p.x() * e1 + p.y() * e2;
348 }
FT e2
Definition: PlaneS3.h:124
PointS3< FT > point() const
Definition: PlaneS3.h:238
FT e1
Definition: PlaneS3.h:123
VectorS3< FT > base2() const
Definition: PlaneS3.h:285
VectorS3< FT > base1() const
Definition: PlaneS3.h:269

Here is the call graph for this function:

PointS3< FT > to_plane_basis ( const PointS3< FT > &  p) const

Definition at line 306 of file PlaneS3.h.

References solve(), VectorS3< FT >::x(), VectorS3< FT >::y(), and VectorS3< FT >::z().

307 {
308  const VectorS3<FT>& v0 = base1();
309  const VectorS3<FT>& v1 = base2();
311  VectorS3<FT> v3 = p - point();
312  FT alpha, beta, gamma;
313 
314  solve(v0.x(), v0.y(), v0.z(),
315  v1.x(), v1.y(), v1.z(),
316  v2.x(), v2.y(), v2.z(),
317  v3.x(), v3.y(), v3.z(),
318  alpha, beta, gamma);
319 
320  return PointS3<FT>(alpha, beta, gamma);
321 }
PointS3< FT > point() const
Definition: PlaneS3.h:238
VectorS3< FT > orthogonal_vector() const
Definition: PlaneS3.h:256
VectorS3< FT > base2() const
Definition: PlaneS3.h:285
VectorS3< FT > base1() const
Definition: PlaneS3.h:269
CGAL_BEGIN_NAMESPACE void solve(const FT &a1, const FT &a2, const FT &a3, const FT &b1, const FT &b2, const FT &b3, const FT &c1, const FT &c2, const FT &c3, const FT &d1, const FT &d2, const FT &d3, FT &x, FT &y, FT &z)
Definition: solve.h:57

Here is the call graph for this function:

PlaneS3< FT > transform ( const Aff_transformationS3< FT > &  t) const

Definition at line 361 of file PlaneS3.h.

References Aff_transformationS3< FT >::is_even(), Aff_transformationS3< FT >::transform(), and Aff_transformationS3< FT >::transpose().

Referenced by Aff_transformationS3< FT >::transform().

362 {
363  DirectionS3<FT> dir = t.transpose().inverse().transform(orthogonal_direction());
364  if (!t.is_even()) dir = -dir;
365  return PlaneS3<FT>( t.transform(point()), dir);
366 
367 /*
368  return PlaneS3<FT>( t.transform(point()), (t.is_even())
369  ? t.transpose().inverse().transform(orthogonal_direction())
370  : - t.transpose().inverse().transform(orthogonal_direction()) );
371 */
372 }
Aff_transformationS3< FT > transpose() const
PointS3< FT > point() const
Definition: PlaneS3.h:238
PointS3< FT > transform(const PointS3< FT > &p) const
DirectionS3< FT > orthogonal_direction() const
Definition: PlaneS3.h:263

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

FT e0

Definition at line 122 of file PlaneS3.h.

FT e1

Definition at line 123 of file PlaneS3.h.

FT e2

Definition at line 124 of file PlaneS3.h.

FT e3

Definition at line 125 of file PlaneS3.h.


The documentation for this class was generated from the following file: