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
90e9bbfb
Commit
90e9bbfb
authored
17 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
*** empty log message ***
parent
555b9c11
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Graphics/Entity.cpp
+41
-33
41 additions, 33 deletions
Graphics/Entity.cpp
with
41 additions
and
33 deletions
Graphics/Entity.cpp
+
41
−
33
View file @
90e9bbfb
// $Id: Entity.cpp,v 1.
79
2008-01-1
1
1
3:56:22 remacl
e Exp $
// $Id: Entity.cpp,v 1.
80
2008-01-1
2
1
5:14:40 geuzain
e Exp $
//
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
//
...
...
@@ -621,7 +621,7 @@ void Draw_SmallAxes()
}
int
Draw_Tics
(
int
comp
,
int
n
,
char
*
format
,
char
*
label
,
double
p1
[
3
],
double
p2
[
3
],
double
perp
[
3
],
int
mikado
)
double
p1
[
3
],
double
p2
[
3
],
double
perp
[
3
],
int
mikado
)
{
// draws n tic marks (in direction perp) and labels along the line p1->p2
...
...
@@ -746,27 +746,33 @@ void Draw_Axes(int mode, int tics[3], char format[3][256], char label[3][256],
Draw_Axes
(
mode
,
tics
,
format
,
label
,
bbox
,
mikado
);
}
void
Draw_Axe
(
double
xmin
,
double
ymin
,
double
zmin
,
double
xmax
,
double
ymax
,
double
zmax
,
int
nticks
,
int
mikado
){
if
(
mikado
){
nticks
=
(
nticks
-
1
)
*
mikado
;
if
(
nticks
<
1
)
nticks
=
1
;
double
dd
[
3
]
=
{(
xmax
-
xmin
)
/
nticks
,(
ymax
-
ymin
)
/
nticks
,(
zmax
-
zmin
)
/
nticks
};
double
axe_color
[
4
];
glGetDoublev
(
GL_CURRENT_COLOR
,
axe_color
);
for
(
int
i
=
1
;
i
<=
nticks
;
i
++
){
if
(
i
%
2
)
glColor4dv
(
axe_color
);
else
glColor3f
(
1
,
1
,
1
);
double
cx
[
2
]
=
{
xmin
+
(
i
-
1
)
*
dd
[
0
],
xmin
+
i
*
dd
[
0
]};
double
cy
[
2
]
=
{
ymin
+
(
i
-
1
)
*
dd
[
1
],
ymin
+
i
*
dd
[
1
]};
double
cz
[
2
]
=
{
zmin
+
(
i
-
1
)
*
dd
[
2
],
zmin
+
i
*
dd
[
2
]};
Draw_Cylinder
(
3.5
,
cx
,
cy
,
cz
,
1
);
}
glColor4dv
(
axe_color
);
}
else
{
glBegin
(
GL_LINES
);
glVertex3d
(
xmin
,
ymin
,
zmin
);
glVertex3d
(
xmax
,
ymax
,
zmax
);
glEnd
();
}
void
Draw_Axe
(
double
xmin
,
double
ymin
,
double
zmin
,
double
xmax
,
double
ymax
,
double
zmax
,
int
nticks
,
int
mikado
)
{
if
(
mikado
){
nticks
=
(
nticks
-
1
)
*
mikado
;
if
(
nticks
<
1
)
nticks
=
1
;
double
dd
[
3
]
=
{(
xmax
-
xmin
)
/
nticks
,
(
ymax
-
ymin
)
/
nticks
,
(
zmax
-
zmin
)
/
nticks
};
double
axe_color
[
4
];
glGetDoublev
(
GL_CURRENT_COLOR
,
axe_color
);
for
(
int
i
=
1
;
i
<=
nticks
;
i
++
){
if
(
i
%
2
)
glColor4dv
(
axe_color
);
else
glColor3f
(
1
,
1
,
1
);
double
cx
[
2
]
=
{
xmin
+
(
i
-
1
)
*
dd
[
0
],
xmin
+
i
*
dd
[
0
]};
double
cy
[
2
]
=
{
ymin
+
(
i
-
1
)
*
dd
[
1
],
ymin
+
i
*
dd
[
1
]};
double
cz
[
2
]
=
{
zmin
+
(
i
-
1
)
*
dd
[
2
],
zmin
+
i
*
dd
[
2
]};
Draw_Cylinder
(
3.5
,
cx
,
cy
,
cz
,
1
);
}
glColor4dv
(
axe_color
);
}
else
{
glBegin
(
GL_LINES
);
glVertex3d
(
xmin
,
ymin
,
zmin
);
glVertex3d
(
xmax
,
ymax
,
zmax
);
glEnd
();
}
}
void
Draw_Axes
(
int
mode
,
int
tics
[
3
],
char
format
[
3
][
256
],
char
label
[
3
][
256
],
...
...
@@ -798,8 +804,8 @@ void Draw_Axes(int mode, int tics[3], char format[3][256], char label[3][256],
else
{
perp
[
0
]
=
0.
;
perp
[
1
]
=
dir
[
2
];
perp
[
2
]
=
-
dir
[
1
];
}
Draw_Tics
(
-
1
,
tics
[
0
],
format
[
0
],
label
[
0
],
orig
,
end
,
perp
,
mikado
);
Draw_Axe
(
xmin
,
ymin
,
zmin
,
xmax
,
ymax
,
zmax
,
tics
[
0
],
mikado
);
Draw_Tics
(
-
1
,
tics
[
0
],
format
[
0
],
label
[
0
],
orig
,
end
,
perp
,
mikado
);
Draw_Axe
(
xmin
,
ymin
,
zmin
,
xmax
,
ymax
,
zmax
,
tics
[
0
],
mikado
);
return
;
}
double
xx
[
3
]
=
{
xmax
,
ymin
,
zmin
};
...
...
@@ -809,14 +815,16 @@ void Draw_Axes(int mode, int tics[3], char format[3][256], char label[3][256],
double
dym
[
3
]
=
{(
xmin
!=
xmax
)
?
-
1.
:
0.
,
0.
,
(
zmin
!=
zmax
)
?
-
1.
:
0.
};
double
dzm
[
3
]
=
{(
xmin
!=
xmax
)
?
-
1.
:
0.
,
(
ymin
!=
ymax
)
?
-
1.
:
0.
,
0.
};
int
nx
=
(
xmin
!=
xmax
)
?
Draw_Tics
(
0
,
tics
[
0
],
format
[
0
],
label
[
0
],
orig
,
xx
,
dxm
,
mikado
)
:
0
;
int
ny
=
(
ymin
!=
ymax
)
?
Draw_Tics
(
1
,
tics
[
1
],
format
[
1
],
label
[
1
],
orig
,
yy
,
dym
,
mikado
)
:
0
;
int
nz
=
(
zmin
!=
zmax
)
?
Draw_Tics
(
2
,
tics
[
2
],
format
[
2
],
label
[
2
],
orig
,
zz
,
dzm
,
mikado
)
:
0
;
Draw_Axe
(
xmin
,
ymin
,
zmin
,
xmax
,
ymin
,
zmin
,
nx
,
mikado
);
Draw_Axe
(
xmin
,
ymin
,
zmin
,
xmin
,
ymax
,
zmin
,
ny
,
mikado
);
Draw_Axe
(
xmin
,
ymin
,
zmin
,
xmin
,
ymin
,
zmax
,
nz
,
mikado
);
int
nx
=
(
xmin
!=
xmax
)
?
Draw_Tics
(
0
,
tics
[
0
],
format
[
0
],
label
[
0
],
orig
,
xx
,
dxm
,
mikado
)
:
0
;
int
ny
=
(
ymin
!=
ymax
)
?
Draw_Tics
(
1
,
tics
[
1
],
format
[
1
],
label
[
1
],
orig
,
yy
,
dym
,
mikado
)
:
0
;
int
nz
=
(
zmin
!=
zmax
)
?
Draw_Tics
(
2
,
tics
[
2
],
format
[
2
],
label
[
2
],
orig
,
zz
,
dzm
,
mikado
)
:
0
;
Draw_Axe
(
xmin
,
ymin
,
zmin
,
xmax
,
ymin
,
zmin
,
nx
,
mikado
);
Draw_Axe
(
xmin
,
ymin
,
zmin
,
xmin
,
ymax
,
zmin
,
ny
,
mikado
);
Draw_Axe
(
xmin
,
ymin
,
zmin
,
xmin
,
ymin
,
zmax
,
nz
,
mikado
);
// open box
if
(
mode
>
1
){
...
...
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