UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
u3d_triangle.hpp
1 /* u3d_triangle.hpp */
2 /* $Id: u3d_triangle.hpp,v 1.2 2008/05/13 12:07:38 sad Exp $ */
3 #ifndef __u3d_triangle_hpp
4 #define __u3d_triangle_hpp
5 
6 #include "u3d_point.hpp"
7 #include <cmath> // for sqrt()
8 
9 #define COS_TRIANGLE_EPSILON 1.7e-7
10 
11 //Temporaly:
12 #include <iostream>
13 using std::cout;
14 using std::endl;
15 
16 
19 {
20  U3dTriangle(){};
21 
22  inline U3dTriangle(const int& iind1, const int& iind2, const int& iind3);
23 
24 
31 #if 0
32  bool intersectWithSegmentOld(const U3dPoint& PTr0, const U3dPoint& PTr1, const U3dPoint& PTr2,
33  const U3dPoint& pA, const U3dPoint& pB,
34  const double& A, const double& B, const double& C,
35  double& outX, double& outY, double& outZ) const;
36 
37 
38 
39 
40  bool intersectWithSegmentNew(const U3dPoint& PTr0, const U3dPoint& PTr1, const U3dPoint& PTr2,
41  const U3dPoint& pA, const U3dPoint& pB,
42  const double& A, const double& B, const double& C,
43  double& outX, double& outY, double& outZ) const;
44 #endif
45 
46 
47  bool intersectWithSegment(const U3dPoint& PTr0, const U3dPoint& PTr1, const U3dPoint& PTr2,
48  const U3dPoint& pA, const U3dPoint& pB,
49  const double& A, const double& B, const double& C,
50  double& outX, double& outY, double& outZ) const;
51 
52 
53 
54  int ind1, ind2, ind3;
55  double a, b, c, d;
56 };
57 
58 
59 inline U3dTriangle::U3dTriangle(const int& iind1, const int& iind2, const int& iind3) :
60  ind1(iind1), ind2(iind2), ind3(iind3)
61 {};
62 
63 
64 
65 inline double vectorLength(const double& a1, const double& a2, const double& a3)
66 {
67  return sqrt(a1*a1 + a2*a2 + a3*a3);
68 }
69 
70 
71 void calculateTrigABC(U3dTriangle& trig, const U3dPoint&, const U3dPoint&, const U3dPoint&);
72 
73 
74 
76 typedef std::vector<U3dTriangle*> U3dTrianglesAr;
77 
78 
79 
80 #endif /* u3d_triangle.hpp */
bool intersectWithSegment(const U3dPoint &PTr0, const U3dPoint &PTr1, const U3dPoint &PTr2, const U3dPoint &pA, const U3dPoint &pB, const double &A, const double &B, const double &C, double &outX, double &outY, double &outZ) const
Definition: u3d_triangle.hpp:18
Definition: u3d_point.hpp:16