ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/CAD4FE/src/CAD4FE_CovertexCriteria.cpp
Revision: 27
Committed: Thu Jul 5 15:26:40 2007 UTC (17 years, 10 months ago) by foucault
Original Path: magic/lib/CAD4FE/CAD4FE/src/CAD4FE_CovertexCriteria.cpp
File size: 2071 byte(s)
Log Message:

File Contents

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