1 |
//---------------------------------------------------------------------------
|
2 |
|
3 |
#ifndef CAD4FE_GlobalEdgeCriteriaH
|
4 |
#define CAD4FE_GlobalEdgeCriteriaH
|
5 |
|
6 |
#include "CAD4FE_MCT_Platform.h"
|
7 |
|
8 |
#include <vector>
|
9 |
#include <map>
|
10 |
|
11 |
//---------------------------------------------------------------------------
|
12 |
class MG_SEGMENT;
|
13 |
class MG_MAILLAGE;
|
14 |
//---------------------------------------------------------------------------
|
15 |
namespace CAD4FE {
|
16 |
|
17 |
class MCAA;
|
18 |
class MCEdge;
|
19 |
class MCVertex;
|
20 |
class LocalEdgeCriteria;
|
21 |
|
22 |
class CAD4FE_MCT_ITEM GlobalEdgeCriteria {
|
23 |
public:
|
24 |
typedef std::map <MG_SEGMENT *, LocalEdgeCriteria*> LEC;
|
25 |
typedef std::map <MG_SEGMENT *, LocalEdgeCriteria*>::iterator LEC_Iterator;
|
26 |
typedef std::map <MG_SEGMENT *, LocalEdgeCriteria*>::const_iterator LEC_CIterator;
|
27 |
|
28 |
GlobalEdgeCriteria (MCEdge *, MCAA *);
|
29 |
~GlobalEdgeCriteria();
|
30 |
|
31 |
void Init();
|
32 |
void Init(MG_SEGMENT * __seg);
|
33 |
LocalEdgeCriteria * CreateLocalEdgeCriteria(MG_SEGMENT* __seg);
|
34 |
bool Delete(MG_SEGMENT * __seg);
|
35 |
|
36 |
void ReInit(MG_SEGMENT * __touchingSeg); |
37 |
void Update(MG_SEGMENT * __touchingSeg, bool __reconstructNormalOffsets); |
38 |
void Update(MCEdge * __touchingEdge, bool __reconstructNormalOffsets); |
39 |
void Update(bool __reconstructNormalOffsets);
|
40 |
|
41 |
MCEdge * GetEdge();
|
42 |
|
43 |
std::vector <LocalEdgeCriteria *> GetLocalEdgeCriteria();
|
44 |
LocalEdgeCriteria * GetFirstLocalEdgeCriteria(LEC_Iterator & __it); |
45 |
LocalEdgeCriteria * GetNextLocalEdgeCriteria(LEC_Iterator & __it);
|
46 |
|
47 |
LocalEdgeCriteria * GetLocalEdgeCriteria(MG_SEGMENT *);
|
48 |
void ChangeTopo(GlobalEdgeCriteria * __src); |
49 |
void CheckMCTess(); |
50 |
|
51 |
/// score of MCT operators
|
52 |
double DeletionScore();
|
53 |
double CollapseToVertexScore(MCVertex **);
|
54 |
double SplitScore(double __splitPoint[3]);
|
55 |
static double SplitScore(MCAA * __mcaa, MCVertex * __mcVertex);
|
56 |
static double SplitScore(LocalEdgeCriteria * vecEC[2]);
|
57 |
|
58 |
/// global criteria
|
59 |
/// deletion score regarding minimum edge length (> L_lim)
|
60 |
double DeletionScore_EdgeLength() const;
|
61 |
|
62 |
/// total length of all local segments
|
63 |
double GetLength() const;
|
64 |
|
65 |
// average value of local criteria regarding meshing problems
|
66 |
/// deletion score regarding minimum width of face
|
67 |
double DeletionScore_FaceWidth() const;
|
68 |
/// deletion score regarding deviation angle problem
|
69 |
double DeletionScore_DeviationAngle() const;
|
70 |
|
71 |
private:
|
72 |
void _Update();
|
73 |
|
74 |
MCEdge * _mcEdge;
|
75 |
MCAA * _mcaa;
|
76 |
LEC _lec;
|
77 |
};
|
78 |
|
79 |
}
|
80 |
|
81 |
#endif
|