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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
0cec6fb2
Commit
0cec6fb2
authored
11 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
fix compile woth MSVC 2012 (thanks to Wendy!)
parent
a811e902
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Geo/GEdge.cpp
+6
-3
6 additions, 3 deletions
Geo/GEdge.cpp
Numeric/decasteljau.cpp
+14
-7
14 additions, 7 deletions
Numeric/decasteljau.cpp
with
20 additions
and
10 deletions
Geo/GEdge.cpp
+
6
−
3
View file @
0cec6fb2
...
@@ -547,7 +547,8 @@ static void _discretize(double tol, GEdge * edge, std::vector<sortedPoint> &upts
...
@@ -547,7 +547,8 @@ static void _discretize(double tol, GEdge * edge, std::vector<sortedPoint> &upts
const
double
d2
=
sqDistPointSegment
(
pmid
,
p0
,
p1
);
const
double
d2
=
sqDistPointSegment
(
pmid
,
p0
,
p1
);
if
(
d2
<
tol
*
tol
)
if
(
d2
<
tol
*
tol
)
return
;
return
;
upts
.
push_back
((
sortedPoint
){
pmid
,
tmid
,
pos1
});
sortedPoint
pnt
=
{
pmid
,
tmid
,
pos1
};
upts
.
push_back
(
pnt
);
const
int
posmid
=
upts
.
size
()
-
1
;
const
int
posmid
=
upts
.
size
()
-
1
;
upts
[
pos0
].
next
=
posmid
;
upts
[
pos0
].
next
=
posmid
;
_discretize
(
tol
,
edge
,
upts
,
pos0
);
_discretize
(
tol
,
edge
,
upts
,
pos0
);
...
@@ -557,8 +558,10 @@ static void _discretize(double tol, GEdge * edge, std::vector<sortedPoint> &upts
...
@@ -557,8 +558,10 @@ static void _discretize(double tol, GEdge * edge, std::vector<sortedPoint> &upts
void
GEdge
::
discretize
(
double
tol
,
std
::
vector
<
SPoint3
>
&
dpts
,
std
::
vector
<
double
>
&
ts
)
void
GEdge
::
discretize
(
double
tol
,
std
::
vector
<
SPoint3
>
&
dpts
,
std
::
vector
<
double
>
&
ts
)
{
{
std
::
vector
<
sortedPoint
>
upts
;
std
::
vector
<
sortedPoint
>
upts
;
upts
.
push_back
((
sortedPoint
){
getBeginVertex
()
->
xyz
(),
0.
,
1
});
sortedPoint
pnt1
=
{
getBeginVertex
()
->
xyz
(),
0.
,
1
};
upts
.
push_back
((
sortedPoint
){
getEndVertex
()
->
xyz
(),
1.
,
-
1
});
upts
.
push_back
(
pnt1
);
sortedPoint
pnt2
=
{
getEndVertex
()
->
xyz
(),
1.
,
-
1
};
upts
.
push_back
(
pnt2
);
_discretize
(
tol
,
this
,
upts
,
0
);
_discretize
(
tol
,
this
,
upts
,
0
);
dpts
.
clear
();
dpts
.
clear
();
dpts
.
reserve
(
upts
.
size
());
dpts
.
reserve
(
upts
.
size
());
...
...
This diff is collapsed.
Click to expand it.
Numeric/decasteljau.cpp
+
14
−
7
View file @
0cec6fb2
...
@@ -10,7 +10,8 @@ typedef struct {
...
@@ -10,7 +10,8 @@ typedef struct {
static
int
sortedPointInsert
(
const
SPoint3
&
p
,
const
double
t
,
std
::
vector
<
sortedPoint
>
&
pts
,
int
pos
)
static
int
sortedPointInsert
(
const
SPoint3
&
p
,
const
double
t
,
std
::
vector
<
sortedPoint
>
&
pts
,
int
pos
)
{
{
pts
.
push_back
((
sortedPoint
)
{
p
,
t
,
pts
[
pos
].
next
});
sortedPoint
pnt
=
{
p
,
t
,
pts
[
pos
].
next
};
pts
.
push_back
(
pnt
);
int
newp
=
pts
.
size
()
-
1
;
int
newp
=
pts
.
size
()
-
1
;
pts
[
pos
].
next
=
newp
;
pts
[
pos
].
next
=
newp
;
return
newp
;
return
newp
;
...
@@ -55,8 +56,10 @@ static void decasteljau(double tol, std::vector<sortedPoint> &discrete, int pos,
...
@@ -55,8 +56,10 @@ static void decasteljau(double tol, std::vector<sortedPoint> &discrete, int pos,
void
decasteljau
(
double
tol
,
const
SPoint3
&
p0
,
const
SPoint3
&
p1
,
const
SPoint3
&
p2
,
std
::
vector
<
SPoint3
>
&
pts
,
std
::
vector
<
double
>
&
ts
)
void
decasteljau
(
double
tol
,
const
SPoint3
&
p0
,
const
SPoint3
&
p1
,
const
SPoint3
&
p2
,
std
::
vector
<
SPoint3
>
&
pts
,
std
::
vector
<
double
>
&
ts
)
{
{
std
::
vector
<
sortedPoint
>
discrete
;
std
::
vector
<
sortedPoint
>
discrete
;
discrete
.
push_back
((
sortedPoint
)
{
p0
,
0.
,
1
});
sortedPoint
pnt1
=
{
p0
,
0.
,
1
};
discrete
.
push_back
((
sortedPoint
)
{
p2
,
1.
,
-
1
});
discrete
.
push_back
(
pnt1
);
sortedPoint
pnt2
=
{
p2
,
1.
,
-
1
};
discrete
.
push_back
(
pnt2
);
decasteljau
(
tol
,
discrete
,
0
,
p0
,
p1
,
p2
,
0.
,
1
);
decasteljau
(
tol
,
discrete
,
0
,
p0
,
p1
,
p2
,
0.
,
1
);
sortedPointToVector
(
discrete
,
pts
,
ts
);
sortedPointToVector
(
discrete
,
pts
,
ts
);
}
}
...
@@ -80,8 +83,10 @@ static void decasteljau(double tol, std::vector<sortedPoint> &discrete, int pos,
...
@@ -80,8 +83,10 @@ static void decasteljau(double tol, std::vector<sortedPoint> &discrete, int pos,
void
decasteljau
(
double
tol
,
const
SPoint3
&
p0
,
const
SPoint3
&
p1
,
const
SPoint3
&
p2
,
const
SPoint3
&
p3
,
std
::
vector
<
SPoint3
>
&
pts
,
std
::
vector
<
double
>
&
ts
)
void
decasteljau
(
double
tol
,
const
SPoint3
&
p0
,
const
SPoint3
&
p1
,
const
SPoint3
&
p2
,
const
SPoint3
&
p3
,
std
::
vector
<
SPoint3
>
&
pts
,
std
::
vector
<
double
>
&
ts
)
{
{
std
::
vector
<
sortedPoint
>
discrete
;
std
::
vector
<
sortedPoint
>
discrete
;
discrete
.
push_back
((
sortedPoint
)
{
p0
,
0.
,
1
});
sortedPoint
pnt1
=
{
p0
,
0.
,
1
};
discrete
.
push_back
((
sortedPoint
)
{
p3
,
1.
,
-
1
});
discrete
.
push_back
(
pnt1
);
sortedPoint
pnt2
=
{
p3
,
1.
,
-
1
};
discrete
.
push_back
(
pnt2
);
decasteljau
(
tol
,
discrete
,
0
,
p0
,
p1
,
p2
,
p3
,
0.
,
1
);
decasteljau
(
tol
,
discrete
,
0
,
p0
,
p1
,
p2
,
p3
,
0.
,
1
);
sortedPointToVector
(
discrete
,
pts
,
ts
);
sortedPointToVector
(
discrete
,
pts
,
ts
);
}
}
...
@@ -110,8 +115,10 @@ static void decasteljau(double tol, std::vector<sortedPoint> &discrete, int pos,
...
@@ -110,8 +115,10 @@ static void decasteljau(double tol, std::vector<sortedPoint> &discrete, int pos,
void
decasteljau
(
double
tol
,
const
std
::
vector
<
SPoint3
>
&
controlPoints
,
std
::
vector
<
SPoint3
>
&
pts
,
std
::
vector
<
double
>
&
ts
)
void
decasteljau
(
double
tol
,
const
std
::
vector
<
SPoint3
>
&
controlPoints
,
std
::
vector
<
SPoint3
>
&
pts
,
std
::
vector
<
double
>
&
ts
)
{
{
std
::
vector
<
sortedPoint
>
discrete
;
std
::
vector
<
sortedPoint
>
discrete
;
discrete
.
push_back
((
sortedPoint
)
{
controlPoints
[
0
],
0.
,
1
});
sortedPoint
pnt1
=
{
controlPoints
[
0
],
0.
,
1
};
discrete
.
push_back
((
sortedPoint
)
{
controlPoints
.
back
(),
1.
,
-
1
});
discrete
.
push_back
(
pnt1
);
sortedPoint
pnt2
=
{
controlPoints
.
back
(),
1.
,
-
1
};
discrete
.
push_back
(
pnt2
);
decasteljau
(
tol
,
discrete
,
0
,
controlPoints
,
0.
,
1
);
decasteljau
(
tol
,
discrete
,
0
,
controlPoints
,
0.
,
1
);
sortedPointToVector
(
discrete
,
pts
,
ts
);
sortedPointToVector
(
discrete
,
pts
,
ts
);
}
}
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