Moka libraries
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
corefine-3d-tools.hh
Go to the documentation of this file.
1 /*
2  * lib-corefinement : Opérations de corafinement.
3  * Copyright (C) 2004, Moka Team, Université de Poitiers, Laboratoire SIC
4  * http://www.sic.sp2mi.univ-poitiers.fr/
5  * Copyright (C) 2009, Guillaume Damiand, CNRS, LIRIS,
6  * guillaume.damiand@liris.cnrs.fr, http://liris.cnrs.fr/
7  *
8  * This file is part of lib-corefinement
9  *
10  * This program is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU Lesser General Public License as published by
12  * the Free Software Foundation, either version 3 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * along with this program. If not, see <http://www.gnu.org/licenses/>.
22  */
23 
24 #ifndef COREFINE_3D_TOOLS_HH
25 #define COREFINE_3D_TOOLS_HH
26 
27 #include "g-map-vertex.hh"
28 #include "plane.hh"
29 #include "corefine-2d-tools.hh"
30 #include "attribute-bounding-box.hh"
31 
32 namespace GMap3d {
33 
35  {
36  public:
37 
38  CCorefine3dTools(CGMapVertex * AMap, TCoordinate AEpsilon = 1E-4);
39 
40  bool isVectorInSector(const CVertex & AVector,
41  const CVertex & ASectorVector1,
42  const CVertex & ASectorVector2,
43  const CPlane & APlane,
44  bool AThickVector1 = false,
45  bool AThickVector2 = false);
46 
47  bool isVectorInSector(const CVertex & AVector, CDart * ASector,
48  const CPlane & APlane,
49  bool ATestBorders = false,
50  int AVertexDI = -1);
51 
52  virtual bool areVectorsColinear(const CVertex & AVector1,
53  const CVertex & AVector2);
54 
55  virtual TCoordinate pointParameterOnLine(const CVertex & APoint,
56  const CVertex & ALineVertex1,
57  const CVertex & ALineVertex2);
58 
59  CDart * findSectorOfVector(const CVertex & AVector, CDart * AVertex,
60  const CPlane & APlane, int AVertexDI = -1);
61 
62  bool areFacesCoplanar(const CVertex & AVertex1,
63  const CPlane & APlane1,
64  const CVertex & AVertex2,
65  const CPlane & APlane2);
66 
67  virtual CDart * findWellOrientedDart(CDart * AVertex, int AVertexDI = -1);
68 
69  virtual TPositionOnEdge localizeEdgesIntersection(const CVertex & ALinePoint1,
70  const CVertex & ALinePoint2,
71  const CVertex & AEdgePoint1,
72  const CVertex & AEdgePoint2,
73  TCoordinate * ALineParam,
74  TCoordinate * AEdgeParam);
75 
77  CVertex AEdgePoint2,
78  const CPlane & APlane,
79  TCoordinate * AEdgeParam);
80 
81  CEdgeIntersection findNearestIntersectionInFace(const CVertex & AOrigin,
82  const CVertex & ADirection,
83  CDart * AFace,
84  const CPlane & APlane,
85  bool AExcludeOrigin = true,
86  int AVertexDI = -1);
87 
88  CEdgeIntersection findNearestIntersectionInFace(const CVertex & AOrigin,
89  const CVertex & ADirection,
90  CDart * AFace,
91  const CPlane & AFacePlane,
92  const CPlane & ACutPlane,
93  bool AExcludeOrigin = true,
94  int AVertexDI = -1);
95 
96  CEdgeIntersection findNearestIntersectionInOrbit(const CVertex & AOrigin,
97  const CVertex & ADirection,
98  CDart * ADart,
99  TOrbit AOrbit,
100  int AVertexDI = -1);
101 
102  virtual bool isPointInFace(const CVertex & APoint, CDart * AFace,
103  const CPlane * APlane = NULL,
104  int AVertexDI = -1);
105 
106  void sortFacesAroundEdges_Naive(CDart * AEdge1, CDart * AEdge2,
107  int ALinkDirectInfo, int AVertexDI = -1);
108 
109  void sortFacesAroundEdges_NaiveBis(CDart * AEdge1, CDart * AEdge2,
110  int ALinkDirectInfo, int AVertexDI = -1);
111 
112  bool sortFacesAroundEdges_Optimized(CDart * AEdge1, CDart * AEdge2,
113  int ALinkDirectInfo,
114  int AVertexDI = -1);
115 
116  void sortFacesAroundEdges_SuperNaive(CDart * AEdge1, CDart * AEdge2,
117  int ALinkDirectInfo,
118  int AVertexDI = -1);
119 
120  TCoordinate matrixDet(TCoordinate AMat[3][3]);
121 
122  void vectProduct4d(const CVertex & AV1, const CVertex & AV2,
123  const CVertex & AV3, TCoordinate ANormal[4]);
124 
125  void volumeNormalVector(CDart * AVolume, TCoordinate ANormal[4],
126  int AVertexDI = -1);
127 
128  protected:
129  };
130 
131 } // namespace GMap3d
132 
133 #endif