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
b726b0bd
Commit
b726b0bd
authored
19 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
opt to shade plane in bbox
parent
eb3174c6
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Graphics/Draw.h
+1
-1
1 addition, 1 deletion
Graphics/Draw.h
Graphics/Entity.cpp
+33
-7
33 additions, 7 deletions
Graphics/Entity.cpp
with
34 additions
and
8 deletions
Graphics/Draw.h
+
1
−
1
View file @
b726b0bd
...
@@ -94,7 +94,7 @@ void Draw_Vector(int Type, int Fill,
...
@@ -94,7 +94,7 @@ void Draw_Vector(int Type, int Fill,
int
light
);
int
light
);
void
Draw_PlaneInBoundingBox
(
double
xmin
,
double
ymin
,
double
zmin
,
void
Draw_PlaneInBoundingBox
(
double
xmin
,
double
ymin
,
double
zmin
,
double
xmax
,
double
ymax
,
double
zmax
,
double
xmax
,
double
ymax
,
double
zmax
,
double
a
,
double
b
,
double
c
,
double
d
);
double
a
,
double
b
,
double
c
,
double
d
,
int
shade
=
0
);
void
Draw_SmallAxes
(
void
);
void
Draw_SmallAxes
(
void
);
void
Draw_Axes
(
int
mode
,
int
tics
[
3
],
char
format
[
3
][
256
],
char
label
[
3
][
256
],
void
Draw_Axes
(
int
mode
,
int
tics
[
3
],
char
format
[
3
][
256
],
char
label
[
3
][
256
],
double
bbox
[
6
]);
double
bbox
[
6
]);
...
...
This diff is collapsed.
Click to expand it.
Graphics/Entity.cpp
+
33
−
7
View file @
b726b0bd
// $Id: Entity.cpp,v 1.6
2
2006-01-0
6
00:
34:24
geuzaine Exp $
// $Id: Entity.cpp,v 1.6
3
2006-01-
2
0 00:
29:59
geuzaine Exp $
//
//
// Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
// Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
//
//
...
@@ -399,11 +399,11 @@ void Draw_Vector(int Type, int Fill,
...
@@ -399,11 +399,11 @@ void Draw_Vector(int Type, int Fill,
class
point
{
class
point
{
public:
public:
double
x
,
y
,
z
;
double
x
,
y
,
z
;
bool
valid
;
bool
valid
;
point
()
:
x
(
0.
),
y
(
0.
),
z
(
0.
),
valid
(
false
)
{;};
point
()
:
x
(
0.
),
y
(
0.
),
z
(
0.
),
valid
(
false
)
{;};
point
(
double
xi
,
double
yi
,
double
zi
)
:
point
(
double
xi
,
double
yi
,
double
zi
)
:
x
(
xi
),
y
(
yi
),
z
(
zi
),
valid
(
true
)
{;};
x
(
xi
),
y
(
yi
),
z
(
zi
),
valid
(
true
)
{;};
};
};
class
plane
{
class
plane
{
...
@@ -439,7 +439,8 @@ public:
...
@@ -439,7 +439,8 @@ public:
void
Draw_PlaneInBoundingBox
(
double
xmin
,
double
ymin
,
double
zmin
,
void
Draw_PlaneInBoundingBox
(
double
xmin
,
double
ymin
,
double
zmin
,
double
xmax
,
double
ymax
,
double
zmax
,
double
xmax
,
double
ymax
,
double
zmax
,
double
a
,
double
b
,
double
c
,
double
d
)
double
a
,
double
b
,
double
c
,
double
d
,
int
shade
)
{
{
plane
pl
(
a
,
b
,
c
,
d
);
plane
pl
(
a
,
b
,
c
,
d
);
...
@@ -480,6 +481,9 @@ void Draw_PlaneInBoundingBox(double xmin, double ymin, double zmin,
...
@@ -480,6 +481,9 @@ void Draw_PlaneInBoundingBox(double xmin, double ymin, double zmin,
n
[
2
]
*=
ll
*
CTX
.
pixel_equiv_x
/
CTX
.
s
[
2
];
n
[
2
]
*=
ll
*
CTX
.
pixel_equiv_x
/
CTX
.
s
[
2
];
double
length
=
sqrt
(
n
[
0
]
*
n
[
0
]
+
n
[
1
]
*
n
[
1
]
+
n
[
2
]
*
n
[
2
]);
double
length
=
sqrt
(
n
[
0
]
*
n
[
0
]
+
n
[
1
]
*
n
[
1
]
+
n
[
2
]
*
n
[
2
]);
int
n_shade
=
0
;
point
p_shade
[
24
];
for
(
int
i
=
0
;
i
<
6
;
i
++
){
for
(
int
i
=
0
;
i
<
6
;
i
++
){
int
nb
=
0
;
int
nb
=
0
;
point
p
[
4
];
point
p
[
4
];
...
@@ -498,9 +502,31 @@ void Draw_PlaneInBoundingBox(double xmin, double ymin, double zmin,
...
@@ -498,9 +502,31 @@ void Draw_PlaneInBoundingBox(double xmin, double ymin, double zmin,
Draw_3DArrow
(
CTX
.
arrow_rel_head_radius
,
Draw_3DArrow
(
CTX
.
arrow_rel_head_radius
,
CTX
.
arrow_rel_stem_length
,
CTX
.
arrow_rel_stem_radius
,
CTX
.
arrow_rel_stem_length
,
CTX
.
arrow_rel_stem_radius
,
p
[
j
].
x
,
p
[
j
].
y
,
p
[
j
].
z
,
n
[
0
],
n
[
1
],
n
[
2
],
length
,
1
);
p
[
j
].
x
,
p
[
j
].
y
,
p
[
j
].
z
,
n
[
0
],
n
[
1
],
n
[
2
],
length
,
1
);
if
(
shade
){
p_shade
[
n_shade
].
x
=
p
[
j
].
x
;
p_shade
[
n_shade
].
y
=
p
[
j
].
y
;
p_shade
[
n_shade
].
z
=
p
[
j
].
z
;
n_shade
++
;
}
}
}
}
}
}
}
if
(
shade
){
// disable two-side lighting beacuse polygon can overlap itself
GLboolean
twoside
;
glGetBooleanv
(
GL_LIGHT_MODEL_TWO_SIDE
,
&
twoside
);
glLightModelf
(
GL_LIGHT_MODEL_TWO_SIDE
,
GL_FALSE
);
glEnable
(
GL_LIGHTING
);
glBegin
(
GL_POLYGON
);
glNormal3d
(
n
[
0
],
n
[
1
],
n
[
2
]);
for
(
int
j
=
0
;
j
<
n_shade
;
j
++
){
glVertex3d
(
p_shade
[
j
].
x
,
p_shade
[
j
].
y
,
p_shade
[
j
].
z
);
}
glEnd
();
glDisable
(
GL_LIGHTING
);
glLightModelf
(
GL_LIGHT_MODEL_TWO_SIDE
,
twoside
);
}
}
}
void
Draw_SmallAxes
()
void
Draw_SmallAxes
()
...
...
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