ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/CAD4FE/src/CAD4FE_CoVertexCriteria.cpp
Revision: 253
Committed: Tue Jul 13 19:40:46 2010 UTC (14 years, 10 months ago) by francois
Original Path: magic/lib/CAD4FE/src/CAD4FE_CovertexCriteria.cpp
File size: 2102 byte(s)
Log Message:
changement de hiearchie et utilisation de ccmake + mise a jour

File Contents

# User Rev Content
1 foucault 27
2     //---------------------------------------------------------------------------
3     #pragma hdrstop
4    
5 foucault 176 #include "gestionversion.h"
6    
7 foucault 27 #include "CAD4FE_MCBody.h"
8     #include "CAD4FE_PolyCurve.h"
9     #include "CAD4FE_MCEdge.h"
10     #include "CAD4FE_MCVertex.h"
11     #include "CAD4FE_mg_utils.h"
12     #include "CAD4FE_Criteria.h"
13     #include "CAD4FE_ColorMap.h"
14    
15     #include "CAD4FE_CovertexCriteria.h"
16    
17     //---------------------------------------------------------------------------
18    
19     #pragma package(smart_init)
20    
21     using namespace CAD4FE;
22    
23     CovertexCriteria::CovertexCriteria(MG_COSOMMET * __covertex, double __meshSize)
24     : _covertex(__covertex), _meshSize(__meshSize)
25     {
26     double t = _covertex->get_t();
27     double tmin = _covertex->get_arete()->get_tmin();
28     double tmax = _covertex->get_arete()->get_tmax();
29     _offsetT = ( t < tmax ) ? _meshSize : t - _meshSize;
30    
31     _touchingCovertex = NULL;
32     if (_offsetT < tmin)
33     {
34     _touchingCovertex = _covertex->get_arete()->get_cosommet1();
35     _offsetT = tmin;
36     }
37     else if (_offsetT > tmax)
38     {
39     _touchingCovertex = _covertex->get_arete()->get_cosommet2();
40     _offsetT = tmax;
41     }
42    
43     PolyCurve * polycurve = (PolyCurve *) _covertex->get_arete()->get_courbe();
44     polycurve->evaluer(_offsetT, _offsetPoint, false);
45     _length = polycurve->get_longueur(_offsetT, t);
46     }
47    
48     MG_COSOMMET * CovertexCriteria::GetCovertex() const
49     {
50     return _covertex;
51     }
52    
53     MCEdge * CovertexCriteria::GetEdge() const
54     {
55     return (MCEdge*)_covertex->get_arete();
56     }
57    
58     bool CovertexCriteria::IsTouchingVertex(MCVertex * __mcVertex) const
59     {
60     return (_touchingCovertex->get_sommet() == __mcVertex);
61     }
62    
63     MG_COSOMMET * CovertexCriteria::GetTouchingCovertex() const
64     {
65     return _touchingCovertex;
66     }
67    
68     double CovertexCriteria::GetLength() const
69     {
70     return _length;
71     }
72    
73     OT_VECTEUR_3D CovertexCriteria::GetPoint() const
74     {
75     return _offsetPoint;
76     }