![]() |
![]() |
![]() |
V_Sim API - Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
objectListobjectList — Gives storage for ids used by OpenGL lists and provides primitive routine for common drawing operations (distances, torus...). |
int visu_openGL_objectList_new (int size
); void initObjectList (void
); enum VisuOpenGLArrowCentering; void visu_openGL_drawSmoothArrow (GLUquadricObj *obj
,int material_id
,VisuOpenGLArrowCentering centering
,float tailLength
,float tailRadius
,float tailN
,gboolean tailUseMat
,float hatLength
,float hatRadius
,float hatN
,gboolean hatUseMat
); void visu_openGL_drawEdgeArrow (int material_id
,VisuOpenGLArrowCentering centering
,float tailLength
,float tailRadius
,gboolean tailUseMat
,float hatLength
,float hatRadius
,gboolean hatUseMat
); void visu_openGL_drawEllipsoid (GLUquadricObj *obj
,int material_id
,float aAxis
,float bAxis
,float n
,gboolean useMat
); void visu_openGL_drawTorus (GLUquadricObj *obj
,int material_id
,float radius
,float ratio
,int nA
,int nB
,gboolean useMat
); void visu_openGL_drawDistance (float xyzRef[3]
,float xyz[3]
,gboolean drawLength
); void visu_openGL_drawAngle (float xyzRef[3]
,float xyzRef2[3]
,float xyz[3]
,guint id
,gboolean drawLength
);
When using OpenGL list, one must specify ids. This module can return unused ids when needed.
Here are also defined the common primitive for drawing, see
visu_openGL_drawDistance()
for instance.
int visu_openGL_objectList_new (int size
);
It returns the id that can be used to link glObjectList. This number is also added to the list of glObjectList to be displayed. The size parameter is the number of lists that could be used by the user for this glObjectList. Then the next call to this function will return the last value plus the size plus one.
|
the requested size. |
Returns : |
an identifier used by OpenGl as a list. |
typedef enum { VISU_OPENGL_ARROW_ORIGIN_CENTERED, VISU_OPENGL_ARROW_BOTTOM_CENTERED, VISU_OPENGL_ARROW_TAIL_CENTERED, VISU_OPENGL_ARROW_CENTERED } VisuOpenGLArrowCentering;
The way to draw arrows (see visu_openGL_drawSmoothArrow()
for instance).
the arrows are positioned with respect to the point between tail and hat. | |
the arrows are positioned with respect to the bottom of the arrow ; | |
the arrows are positioned with respect to the center of the tail part ; | |
the arrows are centered. |
void visu_openGL_drawSmoothArrow (GLUquadricObj *obj
,int material_id
,VisuOpenGLArrowCentering centering
,float tailLength
,float tailRadius
,float tailN
,gboolean tailUseMat
,float hatLength
,float hatRadius
,float hatN
,gboolean hatUseMat
);
Draw arrows, using sqaure edges. For rounded arrows, see
visu_openGL_drawEdgeArrow()
.
|
... |
|
an OpenGL list id for material change. |
|
a flag. |
|
length of tail part. |
|
length of edge of tail part. |
|
number of edges in the approximation. |
|
use the material colour for the tail part. |
|
length of hat part. |
|
length of edge of hat part. |
|
number of edges in the approximation. |
|
use the material colour for the hat part. |
Since 3.6
void visu_openGL_drawEdgeArrow (int material_id
,VisuOpenGLArrowCentering centering
,float tailLength
,float tailRadius
,gboolean tailUseMat
,float hatLength
,float hatRadius
,gboolean hatUseMat
);
Draw arrows, using sqaure edges. For rounded arrows, see
visu_openGL_drawSmoothArrow()
.
|
an OpenGL list id for material change. |
|
a flag. |
|
length of tail part. |
|
length of edge of tail part. |
|
use the material colour for the tail part. |
|
length of hat part. |
|
length of edge of hat part. |
|
use the material colour for the hat part. |
Since 3.6
void visu_openGL_drawEllipsoid (GLUquadricObj *obj
,int material_id
,float aAxis
,float bAxis
,float n
,gboolean useMat
);
Draw an ellipsoid.
|
... |
|
an OpenGL list id for material change. |
|
length of long axis. |
|
length of short axis. |
|
number of edges for the sphere approximation. |
|
a flag to use the material definition or not. |
Since 3.6
void visu_openGL_drawTorus (GLUquadricObj *obj
,int material_id
,float radius
,float ratio
,int nA
,int nB
,gboolean useMat
);
Draw a torus.
|
... |
|
an OpenGL list id for material change. |
|
global radius. |
|
ratio on internal radius over global radius. |
|
number of edges for the global radius. |
|
number of edges for the internal radius. |
|
a flag to use the material definition or not. |
Since 3.5
void visu_openGL_drawDistance (float xyzRef[3]
,float xyz[3]
,gboolean drawLength
);
Draw a distance mark between xyzRef
and xyz
. A distance mark is a
colour inverted line and two squared marks on node. drawLength
is a flag to display or not the distance value.
|
cartesian coordinates of first ref. |
|
cartesian coordinates of current point. |
|
a boolean. |
Since 3.6
void visu_openGL_drawAngle (float xyzRef[3]
,float xyzRef2[3]
,float xyz[3]
,guint id
,gboolean drawLength
);
Draw an angle mark by to distance marks and a disk taking xyzRef
as central point and xyzRef2
and xyz
as the two positions. id
is
a counter to obtain different colours for the disk and drawLength
is a flag to display or not the angle value in degrees.
|
cartesian coordinates of first ref. |
|
cartesian coordinates of second ref. |
|
cartesian coordinates of current point. |
|
a counter. |
|
a boolean. |
Since 3.6