ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/CAD4FE/src/CAD4FE_CoVertexCriteria.cpp
Revision: 1158
Committed: Thu Jun 13 22:18:49 2024 UTC (11 months ago) by francois
File size: 3032 byte(s)
Log Message:
compatibilité Ubuntu 22.04
Suppression des refeences à Windows
Ajout d'une banière

File Contents

# User Rev Content
1 francois 1158 //####//------------------------------------------------------------
2     //####//------------------------------------------------------------
3     //####// MAGiC
4     //####// Jean Christophe Cuilliere et Vincent FRANCOIS
5     //####// Departement de Genie Mecanique - UQTR
6     //####//------------------------------------------------------------
7     //####// MAGIC est un projet de recherche de l equipe ERICCA
8     //####// du departement de genie mecanique de l Universite du Quebec a Trois Rivieres
9     //####// http://www.uqtr.ca/ericca
10     //####// http://www.uqtr.ca/
11     //####//------------------------------------------------------------
12     //####//------------------------------------------------------------
13     //####//
14     //####// CAD4FE_CoVertexCriteria.cpp
15     //####//
16     //####//------------------------------------------------------------
17     //####//------------------------------------------------------------
18     //####// COPYRIGHT 2000-2024
19     //####// jeu 13 jun 2024 11:58:56 EDT
20     //####//------------------------------------------------------------
21     //####//------------------------------------------------------------
22 foucault 27
23     #pragma hdrstop
24    
25 foucault 176 #include "gestionversion.h"
26    
27 foucault 27 #include "CAD4FE_MCBody.h"
28     #include "CAD4FE_PolyCurve.h"
29     #include "CAD4FE_MCEdge.h"
30     #include "CAD4FE_MCVertex.h"
31     #include "CAD4FE_mg_utils.h"
32     #include "CAD4FE_Criteria.h"
33     #include "CAD4FE_ColorMap.h"
34    
35 foucault 569 #include "CAD4FE_CoVertexCriteria.h"
36 foucault 27
37    
38     #pragma package(smart_init)
39    
40     using namespace CAD4FE;
41    
42     CovertexCriteria::CovertexCriteria(MG_COSOMMET * __covertex, double __meshSize)
43     : _covertex(__covertex), _meshSize(__meshSize)
44     {
45     double t = _covertex->get_t();
46     double tmin = _covertex->get_arete()->get_tmin();
47     double tmax = _covertex->get_arete()->get_tmax();
48     _offsetT = ( t < tmax ) ? _meshSize : t - _meshSize;
49    
50     _touchingCovertex = NULL;
51     if (_offsetT < tmin)
52     {
53     _touchingCovertex = _covertex->get_arete()->get_cosommet1();
54     _offsetT = tmin;
55     }
56     else if (_offsetT > tmax)
57     {
58     _touchingCovertex = _covertex->get_arete()->get_cosommet2();
59     _offsetT = tmax;
60     }
61    
62     PolyCurve * polycurve = (PolyCurve *) _covertex->get_arete()->get_courbe();
63     polycurve->evaluer(_offsetT, _offsetPoint, false);
64     _length = polycurve->get_longueur(_offsetT, t);
65     }
66    
67     MG_COSOMMET * CovertexCriteria::GetCovertex() const
68     {
69     return _covertex;
70     }
71    
72     MCEdge * CovertexCriteria::GetEdge() const
73     {
74     return (MCEdge*)_covertex->get_arete();
75     }
76    
77     bool CovertexCriteria::IsTouchingVertex(MCVertex * __mcVertex) const
78     {
79     return (_touchingCovertex->get_sommet() == __mcVertex);
80     }
81    
82     MG_COSOMMET * CovertexCriteria::GetTouchingCovertex() const
83     {
84     return _touchingCovertex;
85     }
86    
87     double CovertexCriteria::GetLength() const
88     {
89     return _length;
90     }
91    
92     OT_VECTEUR_3D CovertexCriteria::GetPoint() const
93     {
94     return _offsetPoint;
95     }