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
2862f8c8
Commit
2862f8c8
authored
17 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
pp
parent
de99432e
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Graphics/Post.cpp
+51
-65
51 additions, 65 deletions
Graphics/Post.cpp
with
51 additions
and
65 deletions
Graphics/Post.cpp
+
51
−
65
View file @
2862f8c8
// $Id: Post.cpp,v 1.13
0
2007-09-1
1 13:54:35
geuzaine Exp $
// $Id: Post.cpp,v 1.13
1
2007-09-1
3 06:57:21
geuzaine Exp $
//
//
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
//
//
...
@@ -1130,43 +1130,35 @@ void drawGlyphs(PView *p)
...
@@ -1130,43 +1130,35 @@ void drawGlyphs(PView *p)
}
}
}
}
// We try to estimate how many primitives will end up in the vertex
class
initPView
{
// arrays, since reallocating the arrays takes a HUGE amount of time
private:
// on Windows/Cygwin. A better way would be to slightly redesign the
// we try to estimate how many primitives will end up in the vertex
// drawing routines so we can have different pre-processing steps
// arrays, since reallocating the arrays takes a huge amount of time
// (like the one we have for smooth normals right now), in order to
// on Windows/Cygwin
// count how many primitives we will have.
int
_estimateNumPoints
(
PView
*
p
)
static
int
estimateNumPoints
(
PView
*
p
)
{
{
PViewData
*
data
=
p
->
getData
();
PViewData
*
data
=
p
->
getData
();
PViewOptions
*
opt
=
p
->
getOptions
();
PViewOptions
*
opt
=
p
->
getOptions
();
int
heuristic
=
data
->
getNumElements
(
PViewData
::
Point
);
int
heuristic
=
data
->
getNumElements
(
PViewData
::
Point
);
return
heuristic
+
10000
;
return
heuristic
+
10000
;
}
}
int
_estimateNumLines
(
PView
*
p
)
static
int
estimateNumLines
(
PView
*
p
)
{
{
PViewData
*
data
=
p
->
getData
();
PViewData
*
data
=
p
->
getData
();
PViewOptions
*
opt
=
p
->
getOptions
();
PViewOptions
*
opt
=
p
->
getOptions
();
int
heuristic
=
data
->
getNumElements
(
PViewData
::
Line
);
int
heuristic
=
data
->
getNumElements
(
PViewData
::
Line
);
return
heuristic
+
10000
;
return
heuristic
+
10000
;
}
}
int
_estimateNumTriangles
(
PView
*
p
)
static
int
estimateNumTriangles
(
PView
*
p
)
{
{
PViewData
*
data
=
p
->
getData
();
PViewData
*
data
=
p
->
getData
();
PViewOptions
*
opt
=
p
->
getOptions
();
PViewOptions
*
opt
=
p
->
getOptions
();
int
tris
=
data
->
getNumElements
(
PViewData
::
Triangle
);
int
tris
=
data
->
getNumElements
(
PViewData
::
Triangle
);
int
quads
=
data
->
getNumElements
(
PViewData
::
Quadrangle
);
int
quads
=
data
->
getNumElements
(
PViewData
::
Quadrangle
);
int
tets
=
data
->
getNumElements
(
PViewData
::
Tetrahedron
);
int
tets
=
data
->
getNumElements
(
PViewData
::
Tetrahedron
);
int
prisms
=
data
->
getNumElements
(
PViewData
::
Prism
);
int
prisms
=
data
->
getNumElements
(
PViewData
::
Prism
);
int
pyrs
=
data
->
getNumElements
(
PViewData
::
Pyramid
);
int
pyrs
=
data
->
getNumElements
(
PViewData
::
Pyramid
);
int
hexas
=
data
->
getNumElements
(
PViewData
::
Hexahedron
);
int
hexas
=
data
->
getNumElements
(
PViewData
::
Hexahedron
);
int
heuristic
=
0
;
int
heuristic
=
0
;
if
(
opt
->
IntervalsType
==
PViewOptions
::
Iso
)
if
(
opt
->
IntervalsType
==
PViewOptions
::
Iso
)
heuristic
=
(
tets
+
prisms
+
pyrs
+
hexas
)
/
10
;
heuristic
=
(
tets
+
prisms
+
pyrs
+
hexas
)
/
10
;
...
@@ -1176,21 +1168,15 @@ static int estimateNumTriangles(PView *p)
...
@@ -1176,21 +1168,15 @@ static int estimateNumTriangles(PView *p)
else
if
(
opt
->
IntervalsType
==
PViewOptions
::
Discrete
)
else
if
(
opt
->
IntervalsType
==
PViewOptions
::
Discrete
)
heuristic
=
(
tris
+
2
*
quads
+
6
*
tets
+
heuristic
=
(
tris
+
2
*
quads
+
6
*
tets
+
8
*
prisms
+
6
*
pyrs
+
12
*
hexas
)
*
2
;
8
*
prisms
+
6
*
pyrs
+
12
*
hexas
)
*
2
;
return
heuristic
+
10000
;
return
heuristic
+
10000
;
}
}
int
_estimateNumVectors
(
PView
*
p
)
static
int
estimateNumVectors
(
PView
*
p
)
{
{
PViewData
*
data
=
p
->
getData
();
PViewData
*
data
=
p
->
getData
();
PViewOptions
*
opt
=
p
->
getOptions
();
PViewOptions
*
opt
=
p
->
getOptions
();
int
heuristic
=
data
->
getNumVectors
();
int
heuristic
=
data
->
getNumVectors
();
return
heuristic
+
1000
;
return
heuristic
+
1000
;
}
}
class
initPView
{
public
:
public
:
void
operator
()
(
PView
*
p
)
void
operator
()
(
PView
*
p
)
{
{
...
@@ -1202,13 +1188,13 @@ class initPView {
...
@@ -1202,13 +1188,13 @@ class initPView {
if
(
!
opt
->
Visible
||
opt
->
Type
!=
PViewOptions
::
Plot3D
)
return
;
if
(
!
opt
->
Visible
||
opt
->
Type
!=
PViewOptions
::
Plot3D
)
return
;
if
(
p
->
va_points
)
delete
p
->
va_points
;
if
(
p
->
va_points
)
delete
p
->
va_points
;
p
->
va_points
=
new
VertexArray
(
1
,
estimateNumPoints
(
p
));
p
->
va_points
=
new
VertexArray
(
1
,
_
estimateNumPoints
(
p
));
if
(
p
->
va_lines
)
delete
p
->
va_lines
;
if
(
p
->
va_lines
)
delete
p
->
va_lines
;
p
->
va_lines
=
new
VertexArray
(
2
,
estimateNumLines
(
p
));
p
->
va_lines
=
new
VertexArray
(
2
,
_
estimateNumLines
(
p
));
if
(
p
->
va_triangles
)
delete
p
->
va_triangles
;
if
(
p
->
va_triangles
)
delete
p
->
va_triangles
;
p
->
va_triangles
=
new
VertexArray
(
3
,
estimateNumTriangles
(
p
));
p
->
va_triangles
=
new
VertexArray
(
3
,
_
estimateNumTriangles
(
p
));
if
(
p
->
va_vectors
)
delete
p
->
va_vectors
;
if
(
p
->
va_vectors
)
delete
p
->
va_vectors
;
p
->
va_vectors
=
new
VertexArray
(
2
,
estimateNumVectors
(
p
));
p
->
va_vectors
=
new
VertexArray
(
2
,
_
estimateNumVectors
(
p
));
if
(
p
->
normals
)
delete
p
->
normals
;
if
(
p
->
normals
)
delete
p
->
normals
;
p
->
normals
=
new
smooth_normals
(
opt
->
AngleSmoothNormals
);
p
->
normals
=
new
smooth_normals
(
opt
->
AngleSmoothNormals
);
...
...
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