Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
20acb677
Commit
20acb677
authored
17 years ago
by
Akash Anand
Browse files
Options
Downloads
Patches
Plain Diff
work on fm
parent
c99be7c3
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Fltk/GUI_Projection.cpp
+325
-87
325 additions, 87 deletions
Fltk/GUI_Projection.cpp
contrib/FourierModel/FPatch.cpp
+16
-9
16 additions, 9 deletions
contrib/FourierModel/FPatch.cpp
contrib/FourierModel/FPatch.h
+5
-1
5 additions, 1 deletion
contrib/FourierModel/FPatch.h
with
346 additions
and
97 deletions
Fltk/GUI_Projection.cpp
+
325
−
87
View file @
20acb677
...
...
@@ -91,8 +91,8 @@ void uvPlot::draw()
sprintf
(
max
,
"%g"
,
_dmax
);
sprintf
(
pts
,
"[%d pts]"
,
_f
.
size
());
fl_draw
(
min
,
5
,
h
()
-
5
);
fl_draw
(
pts
,
pw
/
2
-
fl_width
(
pts
)
/
2
,
h
()
-
5
);
fl_draw
(
max
,
pw
-
fl_width
(
max
)
-
5
,
h
()
-
5
);
fl_draw
(
pts
,
pw
/
2
-
(
int
)
fl_width
(
pts
)
/
2
,
h
()
-
5
);
fl_draw
(
max
,
pw
-
(
int
)
fl_width
(
max
)
-
5
,
h
()
-
5
);
}
projection
::
projection
(
FProjectionFace
*
f
,
int
x
,
int
y
,
int
w
,
int
h
,
int
BB
,
int
BH
,
...
...
@@ -217,6 +217,7 @@ projectionEditor::projectionEditor(std::vector<FProjectionFace*> &faces)
modes
[
3
]
=
new
Fl_Value_Input
(
WB
+
BB
/
2
,
height
-
3
*
WB
-
2
*
BH
,
BB
/
2
,
BH
,
"Chebychev modes along u and v"
);
for
(
int
i
=
0
;
i
<
4
;
i
++
){
modes
[
i
]
->
value
(
8
);
modes
[
i
]
->
maximum
(
128
);
modes
[
i
]
->
minimum
(
1
);
modes
[
i
]
->
step
(
1
);
...
...
@@ -485,12 +486,271 @@ void compute_cb(Fl_Widget *w, void *data)
(
ve
->
z
()
-
p
[
2
])
*
n
[
2
]);
}
}
if
(
f
.
empty
())
return
;
// get options: e->modes[i]->value()
Patch
*
patch
=
new
FPatch
(
0
,
ps
,
u
,
v
,
f
,
3
);
patch
->
SetMinU
(
0.0
);
patch
->
SetMaxU
(
0.5
);
if
(
ps
->
IsUPeriodic
())
{
Patch
*
patchL
=
new
FPatch
(
0
,
ps
,
u
,
v
,
f
,
3
,(
int
)(
e
->
modes
[
0
]
->
value
()),
(
int
)(
e
->
modes
[
1
]
->
value
()),(
int
)(
e
->
modes
[
2
]
->
value
()),
(
int
)(
e
->
modes
[
3
]
->
value
()),
e
->
hardEdges
[
0
]
->
value
(),
e
->
hardEdges
[
1
]
->
value
(),
e
->
hardEdges
[
2
]
->
value
(),
e
->
hardEdges
[
3
]
->
value
());
patchL
->
SetMinU
(
-
0.35
);
patchL
->
SetMaxU
(
0.35
);
double
LL
[
2
],
LR
[
2
],
UL
[
2
],
UR
[
2
];
LL
[
0
]
=
0.0
;
LL
[
1
]
=
0.0
;
LR
[
0
]
=
1.0
;
LR
[
1
]
=
0.0
;
UL
[
0
]
=
0.0
;
UL
[
1
]
=
1.0
;
UR
[
0
]
=
1.0
;
UR
[
1
]
=
1.0
;
int
i1
,
i2
;
double
xx
,
yy
,
zz
;
int
tagVertex
=
GMODEL
->
numVertex
();
patchL
->
F
(
LL
[
0
],
LL
[
1
],
xx
,
yy
,
zz
);
FM_Vertex
*
vLLL
=
new
FM_Vertex
(
++
tagVertex
,
xx
,
yy
,
zz
);
GMODEL
->
add
(
new
FVertex
(
GMODEL
,
vLLL
->
GetTag
(),
vLLL
));
patchL
->
F
(
LR
[
0
],
LR
[
1
],
xx
,
yy
,
zz
);
FM_Vertex
*
vLLR
=
new
FM_Vertex
(
++
tagVertex
,
xx
,
yy
,
zz
);
GMODEL
->
add
(
new
FVertex
(
GMODEL
,
vLLR
->
GetTag
(),
vLLR
));
patchL
->
F
(
UL
[
0
],
UL
[
1
],
xx
,
yy
,
zz
);
FM_Vertex
*
vLUL
=
new
FM_Vertex
(
++
tagVertex
,
xx
,
yy
,
zz
);
GMODEL
->
add
(
new
FVertex
(
GMODEL
,
vLUL
->
GetTag
(),
vLUL
));
patchL
->
F
(
UR
[
0
],
UR
[
1
],
xx
,
yy
,
zz
);
FM_Vertex
*
vLUR
=
new
FM_Vertex
(
++
tagVertex
,
xx
,
yy
,
zz
);
GMODEL
->
add
(
new
FVertex
(
GMODEL
,
vLUR
->
GetTag
(),
vLUR
));
Curve
*
curveLB
=
new
FCurve
(
0
,
patchL
,
LL
,
LR
);
Curve
*
curveLR
=
new
FCurve
(
0
,
patchL
,
LR
,
UR
);
Curve
*
curveLT
=
new
FCurve
(
0
,
patchL
,
UR
,
UL
);
Curve
*
curveLL
=
new
FCurve
(
0
,
patchL
,
UL
,
LL
);
int
tagEdge
=
GMODEL
->
numEdge
();
FM_Edge
*
eLB
=
new
FM_Edge
(
++
tagEdge
,
curveLB
,
vLLL
,
vLLR
);
i1
=
eLB
->
GetStartPoint
()
->
GetTag
();
i2
=
eLB
->
GetEndPoint
()
->
GetTag
();
GMODEL
->
add
(
new
FEdge
(
GMODEL
,
eLB
,
eLB
->
GetTag
(),
GMODEL
->
vertexByTag
(
i1
),
GMODEL
->
vertexByTag
(
i2
)));
FM_Edge
*
eLR
=
new
FM_Edge
(
++
tagEdge
,
curveLR
,
vLLR
,
vLUR
);
i1
=
eLR
->
GetStartPoint
()
->
GetTag
();
i2
=
eLR
->
GetEndPoint
()
->
GetTag
();
GMODEL
->
add
(
new
FEdge
(
GMODEL
,
eLR
,
eLR
->
GetTag
(),
GMODEL
->
vertexByTag
(
i1
),
GMODEL
->
vertexByTag
(
i2
)));
FM_Edge
*
eLT
=
new
FM_Edge
(
++
tagEdge
,
curveLT
,
vLUR
,
vLUL
);
i1
=
eLT
->
GetStartPoint
()
->
GetTag
();
i2
=
eLT
->
GetEndPoint
()
->
GetTag
();
GMODEL
->
add
(
new
FEdge
(
GMODEL
,
eLT
,
eLT
->
GetTag
(),
GMODEL
->
vertexByTag
(
i1
),
GMODEL
->
vertexByTag
(
i2
)));
FM_Edge
*
eLL
=
new
FM_Edge
(
++
tagEdge
,
curveLL
,
vLUL
,
vLLL
);
i1
=
eLL
->
GetStartPoint
()
->
GetTag
();
i2
=
eLL
->
GetEndPoint
()
->
GetTag
();
GMODEL
->
add
(
new
FEdge
(
GMODEL
,
eLL
,
eLL
->
GetTag
(),
GMODEL
->
vertexByTag
(
i1
),
GMODEL
->
vertexByTag
(
i2
)));
FM_Face
*
faceL
=
new
FM_Face
(
GMODEL
->
numFace
()
+
1
,
patchL
);
faceL
->
AddEdge
(
eLB
);
faceL
->
AddEdge
(
eLR
);
faceL
->
AddEdge
(
eLT
);
faceL
->
AddEdge
(
eLL
);
std
::
list
<
GEdge
*>
l_edgesL
;
for
(
int
j
=
0
;
j
<
faceL
->
GetNumEdges
();
j
++
)
{
int
tag
=
faceL
->
GetEdge
(
j
)
->
GetTag
();
l_edgesL
.
push_back
(
GMODEL
->
edgeByTag
(
tag
));
}
GMODEL
->
add
(
new
FFace
(
GMODEL
,
faceL
,
faceL
->
GetTag
(),
l_edgesL
));
Patch
*
patchR
=
new
FPatch
(
0
,
ps
,
u
,
v
,
f
,
3
,(
int
)(
e
->
modes
[
0
]
->
value
()),
(
int
)(
e
->
modes
[
1
]
->
value
()),(
int
)(
e
->
modes
[
2
]
->
value
()),
(
int
)(
e
->
modes
[
3
]
->
value
()),
e
->
hardEdges
[
0
]
->
value
(),
e
->
hardEdges
[
1
]
->
value
(),
e
->
hardEdges
[
2
]
->
value
(),
e
->
hardEdges
[
3
]
->
value
());
patchR
->
SetMinU
(
0.15
);
patchR
->
SetMaxU
(
0.85
);
tagVertex
=
GMODEL
->
numVertex
();
patchR
->
F
(
LL
[
0
],
LL
[
1
],
xx
,
yy
,
zz
);
FM_Vertex
*
vRLL
=
new
FM_Vertex
(
++
tagVertex
,
xx
,
yy
,
zz
);
GMODEL
->
add
(
new
FVertex
(
GMODEL
,
vRLL
->
GetTag
(),
vRLL
));
patchR
->
F
(
LR
[
0
],
LR
[
1
],
xx
,
yy
,
zz
);
FM_Vertex
*
vRLR
=
new
FM_Vertex
(
++
tagVertex
,
xx
,
yy
,
zz
);
GMODEL
->
add
(
new
FVertex
(
GMODEL
,
vRLR
->
GetTag
(),
vRLR
));
patchR
->
F
(
UL
[
0
],
UL
[
1
],
xx
,
yy
,
zz
);
FM_Vertex
*
vRUL
=
new
FM_Vertex
(
++
tagVertex
,
xx
,
yy
,
zz
);
GMODEL
->
add
(
new
FVertex
(
GMODEL
,
vRUL
->
GetTag
(),
vRUL
));
patchR
->
F
(
UR
[
0
],
UR
[
1
],
xx
,
yy
,
zz
);
FM_Vertex
*
vRUR
=
new
FM_Vertex
(
++
tagVertex
,
xx
,
yy
,
zz
);
GMODEL
->
add
(
new
FVertex
(
GMODEL
,
vRUR
->
GetTag
(),
vRUR
));
Curve
*
curveRB
=
new
FCurve
(
0
,
patchR
,
LL
,
LR
);
Curve
*
curveRR
=
new
FCurve
(
0
,
patchR
,
LR
,
UR
);
Curve
*
curveRT
=
new
FCurve
(
0
,
patchR
,
UR
,
UL
);
Curve
*
curveRL
=
new
FCurve
(
0
,
patchR
,
UL
,
LL
);
tagEdge
=
GMODEL
->
numEdge
();
FM_Edge
*
eRB
=
new
FM_Edge
(
++
tagEdge
,
curveRB
,
vRLL
,
vRLR
);
i1
=
eRB
->
GetStartPoint
()
->
GetTag
();
i2
=
eRB
->
GetEndPoint
()
->
GetTag
();
GMODEL
->
add
(
new
FEdge
(
GMODEL
,
eRB
,
eRB
->
GetTag
(),
GMODEL
->
vertexByTag
(
i1
),
GMODEL
->
vertexByTag
(
i2
)));
FM_Edge
*
eRR
=
new
FM_Edge
(
++
tagEdge
,
curveRR
,
vRLR
,
vRUR
);
i1
=
eRR
->
GetStartPoint
()
->
GetTag
();
i2
=
eRR
->
GetEndPoint
()
->
GetTag
();
GMODEL
->
add
(
new
FEdge
(
GMODEL
,
eRR
,
eRR
->
GetTag
(),
GMODEL
->
vertexByTag
(
i1
),
GMODEL
->
vertexByTag
(
i2
)));
FM_Edge
*
eRT
=
new
FM_Edge
(
++
tagEdge
,
curveRT
,
vRUR
,
vRUL
);
i1
=
eRT
->
GetStartPoint
()
->
GetTag
();
i2
=
eRT
->
GetEndPoint
()
->
GetTag
();
GMODEL
->
add
(
new
FEdge
(
GMODEL
,
eRT
,
eRT
->
GetTag
(),
GMODEL
->
vertexByTag
(
i1
),
GMODEL
->
vertexByTag
(
i2
)));
FM_Edge
*
eRL
=
new
FM_Edge
(
++
tagEdge
,
curveRL
,
vRUL
,
vRLL
);
i1
=
eRL
->
GetStartPoint
()
->
GetTag
();
i2
=
eRL
->
GetEndPoint
()
->
GetTag
();
GMODEL
->
add
(
new
FEdge
(
GMODEL
,
eRL
,
eRL
->
GetTag
(),
GMODEL
->
vertexByTag
(
i1
),
GMODEL
->
vertexByTag
(
i2
)));
FM_Face
*
faceR
=
new
FM_Face
(
GMODEL
->
numFace
()
+
1
,
patchR
);
faceR
->
AddEdge
(
eRB
);
faceR
->
AddEdge
(
eRR
);
faceR
->
AddEdge
(
eRT
);
faceR
->
AddEdge
(
eRL
);
std
::
list
<
GEdge
*>
l_edgesR
;
for
(
int
j
=
0
;
j
<
faceR
->
GetNumEdges
();
j
++
)
{
int
tag
=
faceR
->
GetEdge
(
j
)
->
GetTag
();
l_edgesR
.
push_back
(
GMODEL
->
edgeByTag
(
tag
));
}
GMODEL
->
add
(
new
FFace
(
GMODEL
,
faceR
,
faceR
->
GetTag
(),
l_edgesR
));
}
else
if
(
ps
->
IsVPeriodic
())
{
Patch
*
patchL
=
new
FPatch
(
0
,
ps
,
u
,
v
,
f
,
3
,(
int
)(
e
->
modes
[
0
]
->
value
()),
(
int
)(
e
->
modes
[
1
]
->
value
()),(
int
)(
e
->
modes
[
2
]
->
value
()),
(
int
)(
e
->
modes
[
3
]
->
value
()),
e
->
hardEdges
[
0
]
->
value
(),
e
->
hardEdges
[
1
]
->
value
(),
e
->
hardEdges
[
2
]
->
value
(),
e
->
hardEdges
[
3
]
->
value
());
patchL
->
SetMinV
(
-
0.35
);
patchL
->
SetMaxV
(
0.35
);
double
LL
[
2
],
LR
[
2
],
UL
[
2
],
UR
[
2
];
LL
[
0
]
=
0.0
;
LL
[
1
]
=
0.0
;
LR
[
0
]
=
1.0
;
LR
[
1
]
=
0.0
;
UL
[
0
]
=
0.0
;
UL
[
1
]
=
1.0
;
UR
[
0
]
=
1.0
;
UR
[
1
]
=
1.0
;
int
i1
,
i2
;
double
xx
,
yy
,
zz
;
int
tagVertex
=
GMODEL
->
numVertex
();
patchL
->
F
(
LL
[
0
],
LL
[
1
],
xx
,
yy
,
zz
);
FM_Vertex
*
vLLL
=
new
FM_Vertex
(
++
tagVertex
,
xx
,
yy
,
zz
);
GMODEL
->
add
(
new
FVertex
(
GMODEL
,
vLLL
->
GetTag
(),
vLLL
));
patchL
->
F
(
LR
[
0
],
LR
[
1
],
xx
,
yy
,
zz
);
FM_Vertex
*
vLLR
=
new
FM_Vertex
(
++
tagVertex
,
xx
,
yy
,
zz
);
GMODEL
->
add
(
new
FVertex
(
GMODEL
,
vLLR
->
GetTag
(),
vLLR
));
patchL
->
F
(
UL
[
0
],
UL
[
1
],
xx
,
yy
,
zz
);
FM_Vertex
*
vLUL
=
new
FM_Vertex
(
++
tagVertex
,
xx
,
yy
,
zz
);
GMODEL
->
add
(
new
FVertex
(
GMODEL
,
vLUL
->
GetTag
(),
vLUL
));
patchL
->
F
(
UR
[
0
],
UR
[
1
],
xx
,
yy
,
zz
);
FM_Vertex
*
vLUR
=
new
FM_Vertex
(
++
tagVertex
,
xx
,
yy
,
zz
);
GMODEL
->
add
(
new
FVertex
(
GMODEL
,
vLUR
->
GetTag
(),
vLUR
));
Curve
*
curveLB
=
new
FCurve
(
0
,
patchL
,
LL
,
LR
);
Curve
*
curveLR
=
new
FCurve
(
0
,
patchL
,
LR
,
UR
);
Curve
*
curveLT
=
new
FCurve
(
0
,
patchL
,
UR
,
UL
);
Curve
*
curveLL
=
new
FCurve
(
0
,
patchL
,
UL
,
LL
);
int
tagEdge
=
GMODEL
->
numEdge
();
FM_Edge
*
eLB
=
new
FM_Edge
(
++
tagEdge
,
curveLB
,
vLLL
,
vLLR
);
i1
=
eLB
->
GetStartPoint
()
->
GetTag
();
i2
=
eLB
->
GetEndPoint
()
->
GetTag
();
GMODEL
->
add
(
new
FEdge
(
GMODEL
,
eLB
,
eLB
->
GetTag
(),
GMODEL
->
vertexByTag
(
i1
),
GMODEL
->
vertexByTag
(
i2
)));
FM_Edge
*
eLR
=
new
FM_Edge
(
++
tagEdge
,
curveLR
,
vLLR
,
vLUR
);
i1
=
eLR
->
GetStartPoint
()
->
GetTag
();
i2
=
eLR
->
GetEndPoint
()
->
GetTag
();
GMODEL
->
add
(
new
FEdge
(
GMODEL
,
eLR
,
eLR
->
GetTag
(),
GMODEL
->
vertexByTag
(
i1
),
GMODEL
->
vertexByTag
(
i2
)));
FM_Edge
*
eLT
=
new
FM_Edge
(
++
tagEdge
,
curveLT
,
vLUR
,
vLUL
);
i1
=
eLT
->
GetStartPoint
()
->
GetTag
();
i2
=
eLT
->
GetEndPoint
()
->
GetTag
();
GMODEL
->
add
(
new
FEdge
(
GMODEL
,
eLT
,
eLT
->
GetTag
(),
GMODEL
->
vertexByTag
(
i1
),
GMODEL
->
vertexByTag
(
i2
)));
FM_Edge
*
eLL
=
new
FM_Edge
(
++
tagEdge
,
curveLL
,
vLUL
,
vLLL
);
i1
=
eLL
->
GetStartPoint
()
->
GetTag
();
i2
=
eLL
->
GetEndPoint
()
->
GetTag
();
GMODEL
->
add
(
new
FEdge
(
GMODEL
,
eLL
,
eLL
->
GetTag
(),
GMODEL
->
vertexByTag
(
i1
),
GMODEL
->
vertexByTag
(
i2
)));
FM_Face
*
faceL
=
new
FM_Face
(
GMODEL
->
numFace
()
+
1
,
patchL
);
faceL
->
AddEdge
(
eLB
);
faceL
->
AddEdge
(
eLR
);
faceL
->
AddEdge
(
eLT
);
faceL
->
AddEdge
(
eLL
);
std
::
list
<
GEdge
*>
l_edgesL
;
for
(
int
j
=
0
;
j
<
faceL
->
GetNumEdges
();
j
++
)
{
int
tag
=
faceL
->
GetEdge
(
j
)
->
GetTag
();
l_edgesL
.
push_back
(
GMODEL
->
edgeByTag
(
tag
));
}
GMODEL
->
add
(
new
FFace
(
GMODEL
,
faceL
,
faceL
->
GetTag
(),
l_edgesL
));
Patch
*
patchR
=
new
FPatch
(
0
,
ps
,
u
,
v
,
f
,
3
,(
int
)(
e
->
modes
[
0
]
->
value
()),
(
int
)(
e
->
modes
[
1
]
->
value
()),(
int
)(
e
->
modes
[
2
]
->
value
()),
(
int
)(
e
->
modes
[
3
]
->
value
()),
e
->
hardEdges
[
0
]
->
value
(),
e
->
hardEdges
[
1
]
->
value
(),
e
->
hardEdges
[
2
]
->
value
(),
e
->
hardEdges
[
3
]
->
value
());
patchR
->
SetMinV
(
0.15
);
patchR
->
SetMaxV
(
0.85
);
tagVertex
=
GMODEL
->
numVertex
();
patchR
->
F
(
LL
[
0
],
LL
[
1
],
xx
,
yy
,
zz
);
FM_Vertex
*
vRLL
=
new
FM_Vertex
(
++
tagVertex
,
xx
,
yy
,
zz
);
GMODEL
->
add
(
new
FVertex
(
GMODEL
,
vRLL
->
GetTag
(),
vRLL
));
patchR
->
F
(
LR
[
0
],
LR
[
1
],
xx
,
yy
,
zz
);
FM_Vertex
*
vRLR
=
new
FM_Vertex
(
++
tagVertex
,
xx
,
yy
,
zz
);
GMODEL
->
add
(
new
FVertex
(
GMODEL
,
vRLR
->
GetTag
(),
vRLR
));
patchR
->
F
(
UL
[
0
],
UL
[
1
],
xx
,
yy
,
zz
);
FM_Vertex
*
vRUL
=
new
FM_Vertex
(
++
tagVertex
,
xx
,
yy
,
zz
);
GMODEL
->
add
(
new
FVertex
(
GMODEL
,
vRUL
->
GetTag
(),
vRUL
));
patchR
->
F
(
UR
[
0
],
UR
[
1
],
xx
,
yy
,
zz
);
FM_Vertex
*
vRUR
=
new
FM_Vertex
(
++
tagVertex
,
xx
,
yy
,
zz
);
GMODEL
->
add
(
new
FVertex
(
GMODEL
,
vRUR
->
GetTag
(),
vRUR
));
Curve
*
curveRB
=
new
FCurve
(
0
,
patchR
,
LL
,
LR
);
Curve
*
curveRR
=
new
FCurve
(
0
,
patchR
,
LR
,
UR
);
Curve
*
curveRT
=
new
FCurve
(
0
,
patchR
,
UR
,
UL
);
Curve
*
curveRL
=
new
FCurve
(
0
,
patchR
,
UL
,
LL
);
tagEdge
=
GMODEL
->
numEdge
();
FM_Edge
*
eRB
=
new
FM_Edge
(
++
tagEdge
,
curveRB
,
vRLL
,
vRLR
);
i1
=
eRB
->
GetStartPoint
()
->
GetTag
();
i2
=
eRB
->
GetEndPoint
()
->
GetTag
();
GMODEL
->
add
(
new
FEdge
(
GMODEL
,
eRB
,
eRB
->
GetTag
(),
GMODEL
->
vertexByTag
(
i1
),
GMODEL
->
vertexByTag
(
i2
)));
FM_Edge
*
eRR
=
new
FM_Edge
(
++
tagEdge
,
curveRR
,
vRLR
,
vRUR
);
i1
=
eRR
->
GetStartPoint
()
->
GetTag
();
i2
=
eRR
->
GetEndPoint
()
->
GetTag
();
GMODEL
->
add
(
new
FEdge
(
GMODEL
,
eRR
,
eRR
->
GetTag
(),
GMODEL
->
vertexByTag
(
i1
),
GMODEL
->
vertexByTag
(
i2
)));
FM_Edge
*
eRT
=
new
FM_Edge
(
++
tagEdge
,
curveRT
,
vRUR
,
vRUL
);
i1
=
eRT
->
GetStartPoint
()
->
GetTag
();
i2
=
eRT
->
GetEndPoint
()
->
GetTag
();
GMODEL
->
add
(
new
FEdge
(
GMODEL
,
eRT
,
eRT
->
GetTag
(),
GMODEL
->
vertexByTag
(
i1
),
GMODEL
->
vertexByTag
(
i2
)));
FM_Edge
*
eRL
=
new
FM_Edge
(
++
tagEdge
,
curveRL
,
vRUL
,
vRLL
);
i1
=
eRL
->
GetStartPoint
()
->
GetTag
();
i2
=
eRL
->
GetEndPoint
()
->
GetTag
();
GMODEL
->
add
(
new
FEdge
(
GMODEL
,
eRL
,
eRL
->
GetTag
(),
GMODEL
->
vertexByTag
(
i1
),
GMODEL
->
vertexByTag
(
i2
)));
FM_Face
*
faceR
=
new
FM_Face
(
GMODEL
->
numFace
()
+
1
,
patchR
);
faceR
->
AddEdge
(
eRB
);
faceR
->
AddEdge
(
eRR
);
faceR
->
AddEdge
(
eRT
);
faceR
->
AddEdge
(
eRL
);
std
::
list
<
GEdge
*>
l_edgesR
;
for
(
int
j
=
0
;
j
<
faceR
->
GetNumEdges
();
j
++
)
{
int
tag
=
faceR
->
GetEdge
(
j
)
->
GetTag
();
l_edgesR
.
push_back
(
GMODEL
->
edgeByTag
(
tag
));
}
GMODEL
->
add
(
new
FFace
(
GMODEL
,
faceR
,
faceR
->
GetTag
(),
l_edgesR
));
}
else
{
Patch
*
patch
=
new
FPatch
(
0
,
ps
,
u
,
v
,
f
,
3
,(
int
)(
e
->
modes
[
0
]
->
value
()),
(
int
)(
e
->
modes
[
1
]
->
value
()),(
int
)(
e
->
modes
[
2
]
->
value
()),
(
int
)(
e
->
modes
[
3
]
->
value
()),
e
->
hardEdges
[
0
]
->
value
(),
e
->
hardEdges
[
1
]
->
value
(),
e
->
hardEdges
[
2
]
->
value
(),
e
->
hardEdges
[
3
]
->
value
());
double
LL
[
2
],
LR
[
2
],
UL
[
2
],
UR
[
2
];
LL
[
0
]
=
0.0
;
LL
[
1
]
=
0.0
;
...
...
@@ -543,37 +803,15 @@ void compute_cb(Fl_Widget *w, void *data)
GMODEL
->
vertexByTag
(
i2
)));
FM_Face
*
face
=
new
FM_Face
(
GMODEL
->
numFace
()
+
1
,
patch
);
face
->
AddEdge
(
eB
);
face
->
AddEdge
(
eR
);
face
->
AddEdge
(
eT
);
face
->
AddEdge
(
eL
);
face
->
AddEdge
(
eB
);
face
->
AddEdge
(
eR
);
face
->
AddEdge
(
eT
);
face
->
AddEdge
(
eL
);
std
::
list
<
GEdge
*>
l_edges
;
for
(
int
j
=
0
;
j
<
face
->
GetNumEdges
();
j
++
)
{
int
tag
=
face
->
GetEdge
(
j
)
->
GetTag
();
l_edges
.
push_back
(
GMODEL
->
edgeByTag
(
tag
));
}
GMODEL
->
add
(
new
FFace
(
GMODEL
,
face
,
face
->
GetTag
(),
l_edges
));
int
nU
=
64
;
int
nV
=
64
;
std
::
vector
<
int
>
color
(
3
);
std
::
vector
<
std
::
vector
<
double
>
>
x
(
nU
,
std
::
vector
<
double
>
(
nV
));
std
::
vector
<
std
::
vector
<
double
>
>
y
(
nU
,
std
::
vector
<
double
>
(
nV
));
std
::
vector
<
std
::
vector
<
double
>
>
z
(
nU
,
std
::
vector
<
double
>
(
nV
));
std
::
vector
<
std
::
vector
<
int
>
>
mask
=
ones
(
nU
,
nV
);
double
hU
=
1.
/
(
nU
-
1
);
double
hV
=
1.
/
(
nV
-
1
);
for
(
int
j
=
0
;
j
<
nU
;
j
++
)
{
for
(
int
k
=
0
;
k
<
nV
;
k
++
)
{
double
u
=
j
*
hU
;
double
v
=
k
*
hV
;
patch
->
F
(
u
,
v
,
x
[
j
][
k
],
y
[
j
][
k
],
z
[
j
][
k
]);
}
}
color
[
0
]
=
0
;
color
[
1
]
=
0
;
color
[
2
]
=
1
;
plotSceneViewer
(
0
,
"patch.iv"
,
color
,
x
,
y
,
z
,
nU
,
nV
,
mask
);
}
Draw
();
...
...
This diff is collapsed.
Click to expand it.
contrib/FourierModel/FPatch.cpp
+
16
−
9
View file @
20acb677
...
...
@@ -10,7 +10,9 @@ extern "C" {
FPatch
::
FPatch
(
int
tag
,
ProjectionSurface
*
ps
,
std
::
vector
<
double
>
&
u
,
std
::
vector
<
double
>
&
v
,
std
::
vector
<
std
::
complex
<
double
>
>
&
data
,
int
derivative
)
std
::
vector
<
std
::
complex
<
double
>
>
&
data
,
int
derivative
,
int
uModes
,
int
vModes
,
int
uM
,
int
vM
,
bool
hardEdge0
,
bool
hardEdge1
,
bool
hardEdge2
,
bool
hardEdge3
)
:
_coeffOriginalData
(
0
),
_coeffData
(
0
),
_coeffDerivU
(
0
),
_coeffDerivV
(
0
),
_coeffDerivUU
(
0
),
_coeffDerivVV
(
0
),
_coeffDerivUV
(
0
)
{
...
...
@@ -19,16 +21,21 @@ FPatch::FPatch(int tag, ProjectionSurface* ps,
_tag
=
tag
;
_derivative
=
derivative
;
_uModes
=
10
;
_vModes
=
8
;
_uModes
=
uModes
;
_vModes
=
vModes
;
_uM
=
16
+
1
;
_vM
=
16
;
_uM
=
(
int
)(
log
((
double
)
uM
)
/
log
(
2.
))
;
_vM
=
(
int
)(
log
((
double
)
vM
)
/
log
(
2.
))
;
_hardEdge
[
0
]
=
false
;
_hardEdge
[
1
]
=
false
;
_hardEdge
[
2
]
=
false
;
_hardEdge
[
3
]
=
false
;
if
(
_ps
->
IsUPeriodic
())
_uM
++
;
if
(
_ps
->
IsVPeriodic
())
_vM
++
;
_hardEdge
[
0
]
=
hardEdge0
;
_hardEdge
[
1
]
=
hardEdge1
;
_hardEdge
[
2
]
=
hardEdge2
;
_hardEdge
[
3
]
=
hardEdge3
;
if
(
_ps
->
IsUPeriodic
())
_periodicityU
=
1
;
...
...
This diff is collapsed.
Click to expand it.
contrib/FourierModel/FPatch.h
+
5
−
1
View file @
20acb677
#ifndef _F_PATCH_H_
#define _F_PATCH_H_
#include
<cmath>
#include
<vector>
#include
<fftw3.h>
#include
<complex>
...
...
@@ -69,7 +70,10 @@ class FPatch : public Patch {
FPatch
(
int
tag
,
ProjectionSurface
*
ps
,
std
::
vector
<
double
>
&
u
,
std
::
vector
<
double
>
&
v
,
std
::
vector
<
std
::
complex
<
double
>
>
&
data
,
int
derivative
=
0
);
std
::
vector
<
std
::
complex
<
double
>
>
&
data
,
int
derivative
=
3
,
int
uModes
=
10
,
int
vModes
=
8
,
int
uM
=
17
,
int
vM
=
16
,
bool
hardEdge0
=
false
,
bool
hardEdge1
=
false
,
bool
hardEdge2
=
false
,
bool
hardEdge3
=
false
);
virtual
~
FPatch
();
// Abstract functions of Patch
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment