KiCad PCB EDA Suite
Loading...
Searching...
No Matches
opengl_utils.h File Reference

Go to the source code of this file.

Functions

void DrawRoundArrow (SFVEC3F aPosition, SFVEC3F aTargetPos, float aSize)
 Draw a round arrow.
 
void DrawBoundingBox (const BBOX_3D &aBBox)
 Draw the bounding box lines.
 
void DrawHalfOpenCylinder (unsigned int aNrSidesPerCircle)
 Draw a half open cylinder with diameter 1.0f and height 1.0f.
 
void DrawSegment (const ROUND_SEGMENT_2D &aSegment, unsigned int aNrSidesPerCircle)
 Draw a thick line segment with rounded ends.
 

Function Documentation

◆ DrawBoundingBox()

void DrawBoundingBox ( const BBOX_3D aBBox)

Draw the bounding box lines.

Parameters
aBBoxis the box to draw.

Definition at line 102 of file opengl_utils.cpp.

References BBOX_3D::IsInitialized(), BBOX_3D::Max(), and BBOX_3D::Min().

◆ DrawHalfOpenCylinder()

void DrawHalfOpenCylinder ( unsigned int  aNrSidesPerCircle)

Draw a half open cylinder with diameter 1.0f and height 1.0f.

The bottom center is at (0,0,0) and top center is at (0,0,1).

Parameters
aNrSidesPerCircleis the number of segments to approximate a circle.

Definition at line 142 of file opengl_utils.cpp.

References ANGLE_0, ANGLE_180, ANGLE_360, delta, and RotatePoint().

Referenced by DrawSegment().

◆ DrawRoundArrow()

void DrawRoundArrow ( SFVEC3F  aPosition,
SFVEC3F  aTargetPos,
float  aSize 
)

Draw a round arrow.

Parameters
aPositionis the start position of the arrow.
aTargetPosis the end position of the arrow.
aSizeis the diameter of the arrow.

Definition at line 32 of file opengl_utils.cpp.

References RADPERDEG.

Referenced by EDA_3D_MODEL_VIEWER::OnPaint(), and RENDER_3D_OPENGL::render3dArrows().

◆ DrawSegment()

void DrawSegment ( const ROUND_SEGMENT_2D aSegment,
unsigned int  aNrSidesPerCircle 
)

Draw a thick line segment with rounded ends.

Parameters
aSegmentis the thick segment to draw
aNrSidesPerCircleis the number of segments to approximate the circle used to draw the rounded ends of the segment.

Definition at line 202 of file opengl_utils.cpp.

References DrawHalfOpenCylinder(), ROUND_SEGMENT_2D::GetEnd_minus_Start(), ROUND_SEGMENT_2D::GetLength(), ROUND_SEGMENT_2D::GetRadius(), ROUND_SEGMENT_2D::GetStart(), ROUND_SEGMENT_2D::GetWidth(), and RADPERDEG.