GLC_lib  2.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Enumerations | Functions | Variables
glc Namespace Reference

Definition of usefull constants. More...

Enumerations

enum  WidgetEventFlag { AcceptEvent, IgnoreEvent, BlockedEvent }
 3D widget event flag More...
 
enum  RenderMode {
  NormalRenderMode = 0, OverwriteMaterial = 1, OverwriteTransparency = 2, OverwriteTransparencyAndMaterial = 3,
  PrimitiveSelected = 4, OverwritePrimitiveMaterial = 5, BodySelection = 6, PrimitiveSelection = 7
}
 Geometry rendering mode enumeration. More...
 
enum  RenderFlag { ShadingFlag = 800, WireRenderFlag, TransparentRenderFlag, OutlineSilhouetteRenderFlag }
 Geometry rendring flag enumaration. More...
 

Functions

bool extensionIsSupported (const QString &)
 Return true if the extension is supported.
 
bool loadVboExtension ()
 Load VBO extension.
 
bool loadGlSlExtension ()
 Load GLSL extensions.
 
bool loadPointSpriteExtension ()
 Load Point Sprite extension.
 
GLC_LIB_EXPORT GLC_uint GLC_GenID ()
 Simple ID generation.
 
GLC_LIB_EXPORT GLC_uint GLC_GenGeomID ()
 Simple Geom ID generation.
 
GLC_LIB_EXPORT GLC_uint GLC_GenUserID ()
 Simple User ID generation.
 
GLC_LIB_EXPORT GLC_uint GLC_Gen3DWidgetID ()
 Simple 3D widget ID generation.
 
GLC_LIB_EXPORT GLC_uint GLC_GenShaderGroupID ()
 Simple shading group generation.
 
GLC_uint decodeRgbId (const GLubyte *)
 Return the GLC_uint decoded ID from RGB encoded ID.
 
void encodeRgbId (GLC_uint, GLubyte *)
 Return the encoded color of the id.
 
GLC_LIB_EXPORT const QString archivePrefix ()
 Return GLC_lib Archive prefix string.
 
GLC_LIB_EXPORT const QString archiveInfix ()
 Return GLC_lib Archive infix string.
 
GLC_LIB_EXPORT const QString filePrefix ()
 Return GLC_lib File prefix string.
 
GLC_LIB_EXPORT const QString fileInfix ()
 Return GLC_lib File infix string.
 
GLC_LIB_EXPORT bool isArchiveString (const QString &fileName)
 Return true if the given file name is in a archive string.
 
GLC_LIB_EXPORT bool isFileString (const QString &fileName)
 Return true if the given file name is in a File string.
 
GLC_LIB_EXPORT QString builtArchiveString (const QString &Archive, const QString &entry)
 Return archive string form the given archive fileName and fileName entry.
 
GLC_LIB_EXPORT QString builtFileString (const QString &File, const QString &entry)
 Return archive string form the given archive fileName and fileName entry.
 
GLC_LIB_EXPORT QString archiveFileName (const QString &archiveString)
 Return Archive filename from the given archive string.
 
GLC_LIB_EXPORT QString archiveEntryFileName (const QString &archiveString)
 Return Archive entry filname from the given archive string.
 
const QString version ("2.5.0 Alpha 2")
 
const QString description ("GLC_lib is a Open Source C++ class library that enables the quick creation of an OpenGL application based on QT4.")
 
double toRadian (double angleInDegrees)
 Convert the given degrees angle in radian.
 
double toDegrees (double angleInRadians)
 Convert the given radian angle in degre.
 
const GLC_Vector3d X_AXIS (1.0, 0.0, 0.0)
 
const GLC_Vector3d Y_AXIS (0.0, 1.0, 0.0)
 
const GLC_Vector3d Z_AXIS (0.0, 0.0, 1.0)
 
GLC_LIB_EXPORT void gluLookAt (GLdouble eyeX, GLdouble eyeY, GLdouble eyeZ, GLdouble centerX, GLdouble centerY, GLdouble centerZ, GLdouble upX, GLdouble upY, GLdouble upZ)
 
GLC_LIB_EXPORT void gluOrtho2D (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top)
 
GLC_LIB_EXPORT void gluPerspective (GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar)
 
GLC_LIB_EXPORT void gluPickMatrix (GLdouble x, GLdouble y, GLdouble delX, GLdouble delY, GLint *viewport)
 
GLC_LIB_EXPORT GLint gluProject (GLdouble objX, GLdouble objY, GLdouble objZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble *winX, GLdouble *winY, GLdouble *winZ)
 
GLC_LIB_EXPORT GLint gluUnProject (GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble *objX, GLdouble *objY, GLdouble *objZ)
 
GLC_LIB_EXPORT GLint gluUnProject4 (GLdouble winX, GLdouble winY, GLdouble winZ, GLdouble clipW, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble nearVal, GLdouble farVal, GLdouble *objX, GLdouble *objY, GLdouble *objZ, GLdouble *objW)
 
Tools Functions
GLC_LIB_EXPORT bool polygon2DIsConvex (const QList< GLC_Point2d > &vertices)
 test if the given 2D polygon is convex
 
GLC_LIB_EXPORT bool polygonIsConvex (QList< GLuint > *pIndexList, const QList< float > &bulkList)
 Test if the given 3d polygon is convex.
 
GLC_LIB_EXPORT QVector
< GLC_Point2d
findIntersection (const GLC_Point2d &, const GLC_Point2d &, const GLC_Point2d &, const GLC_Point2d &)
 find intersection between two 2D segments
 
GLC_LIB_EXPORT bool isIntersected (const GLC_Point2d &, const GLC_Point2d &, const GLC_Point2d &, const GLC_Point2d &)
 Return true if there is an intersection between 2 segments.
 
GLC_LIB_EXPORT bool isIntersectedRaySegment (const GLC_Point2d &, const GLC_Vector2d &, const GLC_Point2d &, const GLC_Point2d &)
 return true if there is an intersection between a ray and a segment
 
GLC_LIB_EXPORT QVector< double > findIntersection (const double &, const double &, const double &, const double &)
 Find intersection of two intervals [u0, u1] and [v0, v1].
 
GLC_LIB_EXPORT bool segmentInCone (const GLC_Point2d &, const GLC_Point2d &, const GLC_Point2d &, const GLC_Point2d &)
 Return true if the segment is in polygon cone.
 
GLC_LIB_EXPORT bool isDiagonal (const QList< GLC_Point2d > &, const int, const int)
 Return true if the segment is a polygon diagonal.
 
GLC_LIB_EXPORT void triangulate (QList< GLC_Point2d > &, QList< int > &, QList< int > &)
 Triangulate a polygon.
 
GLC_LIB_EXPORT bool isCounterclockwiseOrdered (const QList< GLC_Point2d > &)
 Return true if the polygon is couterclockwise ordered.
 
GLC_LIB_EXPORT void triangulatePolygon (QList< GLuint > *, const QList< float > &)
 Triangulate a polygon return true if the polygon is convex.
 
GLC_LIB_EXPORT bool lineIntersectPlane (const GLC_Line3d &line, const GLC_Plane &plane, GLC_Point3d *pPoint)
 Return true if the given 3d line is intersected with the given plane.
 
GLC_LIB_EXPORT GLC_Point3d project (const GLC_Point3d &point, const GLC_Line3d &line)
 Return the projected point on the given line form the given point.
 
GLC_Point3d midPoint (const GLC_Point3d &point1, const GLC_Point3d point2)
 Return the midpoint of the two given points.
 
GLC_Vector2d perpVector (const GLC_Vector2d &vect)
 Return the perpendicular 2D vector of the given 2D vector.
 
GLC_LIB_EXPORT double pointLineDistance (const GLC_Point3d &point, const GLC_Line3d &line)
 Return the distance between the given point and line.
 
GLC_LIB_EXPORT bool pointsAreCollinear (const GLC_Point3d &p1, const GLC_Point3d &p2, const GLC_Point3d &p3)
 Return true if the given 3 points are collinear.
 
GLC_LIB_EXPORT bool compare (double p1, double p2)
 
GLC_LIB_EXPORT bool compare (double p1, double p2, double accuracy)
 
GLC_LIB_EXPORT bool compareAngle (double p1, double p2)
 
GLC_LIB_EXPORT bool compare (const GLC_Vector3d &v1, const GLC_Vector3d &v2)
 
GLC_LIB_EXPORT bool compare (const GLC_Vector3d &v1, const GLC_Vector3d &v2, double accuracy)
 
GLC_LIB_EXPORT bool compare (const GLC_Vector2d &v1, const GLC_Vector2d &v2)
 
GLC_LIB_EXPORT bool compare (const GLC_Vector2d &v1, const GLC_Vector2d &v2, double accuracy)
 
GLC_LIB_EXPORT bool compare (const QPointF &v1, const QPointF &v2)
 
GLC_LIB_EXPORT bool compare (const QPointF &v1, const QPointF &v2, double accuracy)
 
GLC_LIB_EXPORT double round (double value)
 
GLC_LIB_EXPORT double round (double value, double accuracy)
 
GLC_LIB_EXPORT QPointF round (const QPointF &point)
 
GLC_LIB_EXPORT QPointF round (const QPointF &point, double accuracy)
 
GLC_LIB_EXPORT GLC_Vector2d round (const GLC_Vector2d &vector)
 
GLC_LIB_EXPORT GLC_Vector2d round (const GLC_Vector2d &vector, double accuracy)
 
GLC_LIB_EXPORT GLC_Vector3d round (const GLC_Vector3d &vector)
 
GLC_LIB_EXPORT GLC_Vector3d round (const GLC_Vector3d &vector, double accuracy)
 
GLC_LIB_EXPORT bool pointInPolygon (const GLC_Point2d &point, const QList< GLC_Point2d > &polygon)
 Return true if the given 2d point is inside the given polygon.
 
GLC_LIB_EXPORT double zeroTo2PIAngle (double angle)
 Return the angle from 0 to 2PI from an given angle from -PI to PI.
 
GLC_LIB_EXPORT QList< GLC_Point2dpolygonIn2d (QList< GLC_Point3d > polygon3d)
 Return the 2D polygon from the given plane 3D polygon.
 
GLC_LIB_EXPORT QList< GLC_Point2dnormalyzePolygon (const QList< GLC_Point2d > &polygon)
 Return 2D polygon with normalyze coordinate.
 

Variables

const int GLC_DISCRET = 70
 
const int GLC_POLYDISCRET = 60
 
QMutex iDMutex
 
QMutex geomIdMutex
 
QMutex userIdMutex
 
QMutex widget3dIdMutex
 
QMutex shadingGroupIdMutex
 
const double defaultPrecision = 0.01
 
GLC_LIB_EXPORT double comparedPrecision = glc::defaultPrecision
 
const double EPSILON = 1e-10
 
const double PI = acos(-1.0)
 

Detailed Description

Definition of usefull constants.

Define render mode enum in glc namespace.

Enumeration Type Documentation

Geometry rendring flag enumaration.

Enumerator
ShadingFlag 
WireRenderFlag 
TransparentRenderFlag 
OutlineSilhouetteRenderFlag 

Definition at line 54 of file glc_renderproperties.h.

Geometry rendering mode enumeration.

Enumerator
NormalRenderMode 
OverwriteMaterial 
OverwriteTransparency 
OverwriteTransparencyAndMaterial 
PrimitiveSelected 
OverwritePrimitiveMaterial 
BodySelection 
PrimitiveSelection 

Definition at line 41 of file glc_renderproperties.h.

3D widget event flag

Enumerator
AcceptEvent 
IgnoreEvent 
BlockedEvent 

Definition at line 85 of file glc_global.h.

Function Documentation

QString glc::archiveEntryFileName ( const QString &  archiveString)
QString glc::archiveFileName ( const QString &  archiveString)

Return Archive filename from the given archive string.

Definition at line 123 of file glc_global.cpp.

References archiveInfix(), archivePrefix(), fileInfix(), filePrefix(), isArchiveString(), and isFileString().

Referenced by GLC_3dxmlToWorld::create3DrepFrom3dxmlRep(), and GLC_Texture::loadFromFile().

const QString glc::archiveInfix ( )

Return GLC_lib Archive infix string.

Definition at line 83 of file glc_global.cpp.

Referenced by archiveEntryFileName(), archiveFileName(), builtArchiveString(), and isArchiveString().

const QString glc::archivePrefix ( )

Return GLC_lib Archive prefix string.

Definition at line 78 of file glc_global.cpp.

Referenced by archiveFileName(), builtArchiveString(), and isArchiveString().

QString glc::builtArchiveString ( const QString &  Archive,
const QString &  entry 
)

Return archive string form the given archive fileName and fileName entry.

Definition at line 112 of file glc_global.cpp.

References archiveInfix(), and archivePrefix().

Referenced by GLC_3dxmlToWorld::loadExternalRef3D(), GLC_3dxmlToWorld::loadExternRepresentations(), GLC_3dxmlToWorld::loadTexture(), and GLC_3dxmlToWorld::setRepresentationFileName().

QString glc::builtFileString ( const QString &  File,
const QString &  entry 
)

Return archive string form the given archive fileName and fileName entry.

Definition at line 117 of file glc_global.cpp.

References fileInfix(), and filePrefix().

Referenced by GLC_3dxmlToWorld::loadExternalRef3D(), and GLC_3dxmlToWorld::loadExternRepresentations().

bool glc::compare ( double  p1,
double  p2 
)
bool glc::compare ( double  p1,
double  p2,
double  accuracy 
)

Definition at line 561 of file glc_geomtools.cpp.

bool glc::compare ( const GLC_Vector3d v1,
const GLC_Vector3d v2 
)
bool glc::compare ( const GLC_Vector3d v1,
const GLC_Vector3d v2,
double  accuracy 
)

Definition at line 581 of file glc_geomtools.cpp.

References GLC_Vector3d::x(), GLC_Vector3d::y(), and GLC_Vector3d::z().

bool glc::compare ( const GLC_Vector2d v1,
const GLC_Vector2d v2 
)

Definition at line 590 of file glc_geomtools.cpp.

References comparedPrecision, GLC_Vector2d::x(), and GLC_Vector2d::y().

bool glc::compare ( const GLC_Vector2d v1,
const GLC_Vector2d v2,
double  accuracy 
)

Definition at line 596 of file glc_geomtools.cpp.

References GLC_Vector2d::x(), and GLC_Vector2d::y().

bool glc::compare ( const QPointF &  v1,
const QPointF &  v2 
)

Definition at line 602 of file glc_geomtools.cpp.

References comparedPrecision.

bool glc::compare ( const QPointF &  v1,
const QPointF &  v2,
double  accuracy 
)

Definition at line 608 of file glc_geomtools.cpp.

bool glc::compareAngle ( double  p1,
double  p2 
)

Definition at line 566 of file glc_geomtools.cpp.

References comparedPrecision, and toRadian().

GLC_uint glc::decodeRgbId ( const GLubyte *  pcolorId)
inline

Return the GLC_uint decoded ID from RGB encoded ID.

Definition at line 129 of file glc_global.h.

Referenced by GLC_Viewport::listOfIdInsideSquare(), and GLC_Viewport::meaningfulIdInsideSquare().

const QString glc::description ( "GLC_lib is a Open Source C++ class library that enables the quick creation of an OpenGL application based on QT4."  )
void glc::encodeRgbId ( GLC_uint  id,
GLubyte *  colorId 
)
inline
bool glc::extensionIsSupported ( const QString &  extension)

Return true if the extension is supported.

Definition at line 41 of file glc_ext.cpp.

Referenced by GLC_State::setGlslSupport(), GLC_State::setPointSpriteSupport(), and GLC_State::setVboSupport().

const QString glc::fileInfix ( )

Return GLC_lib File infix string.

Definition at line 93 of file glc_global.cpp.

Referenced by archiveEntryFileName(), archiveFileName(), builtFileString(), and isFileString().

const QString glc::filePrefix ( )

Return GLC_lib File prefix string.

Definition at line 88 of file glc_global.cpp.

Referenced by archiveFileName(), builtFileString(), and isFileString().

QVector< GLC_Point2d > glc::findIntersection ( const GLC_Point2d s1p1,
const GLC_Point2d s1p2,
const GLC_Point2d s2p1,
const GLC_Point2d s2p2 
)

find intersection between two 2D segments

Return the intersection as QVector of GLC_Point2d

  • Empty QVector if there is no intersection
  • Qvector size 1 if there is a unique intersection
  • Qvector size 2 if the segement overlap

Definition at line 83 of file glc_geomtools.cpp.

References EPSILON, GLC_Vector2d::x(), and GLC_Vector2d::y().

Referenced by isIntersected().

QVector< double > glc::findIntersection ( const double &  u0,
const double &  u1,
const double &  v0,
const double &  v1 
)

Find intersection of two intervals [u0, u1] and [v0, v1].

Return the intersection as QVector of GLC_Vector2d

  • Empty QVector if there is no intersection
  • Qvector size 1 if there is a unique intersection
  • Qvector size 2 if the segement overlap

Definition at line 238 of file glc_geomtools.cpp.

GLC_uint glc::GLC_Gen3DWidgetID ( void  )

Simple 3D widget ID generation.

Definition at line 60 of file glc_global.cpp.

References widget3dIdMutex.

GLC_uint glc::GLC_GenGeomID ( void  )

Simple Geom ID generation.

Definition at line 42 of file glc_global.cpp.

References geomIdMutex.

Referenced by GLC_Geometry::operator=().

GLC_uint glc::GLC_GenID ( void  )

Simple ID generation.

Definition at line 33 of file glc_global.cpp.

References iDMutex.

Referenced by GLC_3DViewInstance::instanciate(), and operator>>().

GLC_uint glc::GLC_GenShaderGroupID ( )

Simple shading group generation.

Definition at line 69 of file glc_global.cpp.

References shadingGroupIdMutex.

GLC_uint glc::GLC_GenUserID ( void  )

Simple User ID generation.

Definition at line 51 of file glc_global.cpp.

References userIdMutex.

Referenced by GLC_SelectionMaterial::useMaterial().

void glc::gluLookAt ( GLdouble  eyeX,
GLdouble  eyeY,
GLdouble  eyeZ,
GLdouble  centerX,
GLdouble  centerY,
GLdouble  centerZ,
GLdouble  upX,
GLdouble  upY,
GLdouble  upZ 
)
void glc::gluOrtho2D ( GLdouble  left,
GLdouble  right,
GLdouble  bottom,
GLdouble  top 
)

Definition at line 78 of file glc_project.cpp.

References GLC_Context::current(), and GLC_Context::glcOrtho().

void glc::gluPerspective ( GLdouble  fovy,
GLdouble  aspect,
GLdouble  zNear,
GLdouble  zFar 
)
GLC_LIB_EXPORT void glc::gluPickMatrix ( GLdouble  x,
GLdouble  y,
GLdouble  delX,
GLdouble  delY,
GLint *  viewport 
)
GLC_LIB_EXPORT GLint glc::gluProject ( GLdouble  objX,
GLdouble  objY,
GLdouble  objZ,
const GLdouble *  model,
const GLdouble *  proj,
const GLint *  view,
GLdouble *  winX,
GLdouble *  winY,
GLdouble *  winZ 
)
GLC_LIB_EXPORT GLint glc::gluUnProject ( GLdouble  winX,
GLdouble  winY,
GLdouble  winZ,
const GLdouble *  model,
const GLdouble *  proj,
const GLint *  view,
GLdouble *  objX,
GLdouble *  objY,
GLdouble *  objZ 
)
GLC_LIB_EXPORT GLint glc::gluUnProject4 ( GLdouble  winX,
GLdouble  winY,
GLdouble  winZ,
GLdouble  clipW,
const GLdouble *  model,
const GLdouble *  proj,
const GLint *  view,
GLdouble  nearVal,
GLdouble  farVal,
GLdouble *  objX,
GLdouble *  objY,
GLdouble *  objZ,
GLdouble *  objW 
)
bool glc::isArchiveString ( const QString &  fileName)
bool glc::isCounterclockwiseOrdered ( const QList< GLC_Point2d > &  polygon)

Return true if the polygon is couterclockwise ordered.

Definition at line 347 of file glc_geomtools.cpp.

References isIntersectedRaySegment().

Referenced by triangulatePolygon().

bool glc::isDiagonal ( const QList< GLC_Point2d > &  polygon,
const int  i0,
const int  i1 
)

Return true if the segment is a polygon diagonal.

Definition at line 285 of file glc_geomtools.cpp.

References isIntersected(), and segmentInCone().

Referenced by triangulate().

bool glc::isFileString ( const QString &  fileName)

Return true if the given file name is in a File string.

Definition at line 105 of file glc_global.cpp.

References fileInfix(), and filePrefix().

Referenced by archiveEntryFileName(), archiveFileName(), GLC_3dxmlToWorld::create3DrepFrom3dxmlRep(), and GLC_WorldTo3dxml::representationFileName().

bool glc::isIntersected ( const GLC_Point2d s1p1,
const GLC_Point2d s1p2,
const GLC_Point2d s2p1,
const GLC_Point2d s2p2 
)

Return true if there is an intersection between 2 segments.

Definition at line 142 of file glc_geomtools.cpp.

References EPSILON, findIntersection(), GLC_Vector2d::x(), and GLC_Vector2d::y().

Referenced by isDiagonal().

bool glc::isIntersectedRaySegment ( const GLC_Point2d s1p1,
const GLC_Vector2d s1p2,
const GLC_Point2d s2p1,
const GLC_Point2d s2p2 
)

return true if there is an intersection between a ray and a segment

Definition at line 193 of file glc_geomtools.cpp.

References EPSILON, GLC_Vector2d::x(), and GLC_Vector2d::y().

Referenced by isCounterclockwiseOrdered().

bool glc::lineIntersectPlane ( const GLC_Line3d line,
const GLC_Plane plane,
GLC_Point3d pPoint 
)

Return true if the given 3d line is intersected with the given plane.

If there is an intersection point is set to the given 3d point If the line lie on the plane this method return false

Definition at line 501 of file glc_geomtools.cpp.

References GLC_Plane::coefD(), GLC_Line3d::direction(), GLC_Plane::normal(), and GLC_Line3d::startingPoint().

Referenced by GLC_PullManipulator::doManipulate(), and GLC_RotationManipulator::doManipulate().

bool glc::loadGlSlExtension ( )

Load GLSL extensions.

Definition at line 57 of file glc_ext.cpp.

Referenced by GLC_State::setGlslSupport().

bool glc::loadPointSpriteExtension ( )

Load Point Sprite extension.

Definition at line 63 of file glc_ext.cpp.

References glPointParameterf, and glPointParameterfv.

Referenced by GLC_State::setPointSpriteSupport().

bool glc::loadVboExtension ( )

Load VBO extension.

Definition at line 48 of file glc_ext.cpp.

Referenced by GLC_State::setVboSupport().

GLC_Point3d glc::midPoint ( const GLC_Point3d point1,
const GLC_Point3d  point2 
)
inline

Return the midpoint of the two given points.

Definition at line 99 of file glc_geomtools.h.

QList< GLC_Point2d > glc::normalyzePolygon ( const QList< GLC_Point2d > &  polygon)
GLC_Vector2d glc::perpVector ( const GLC_Vector2d vect)
inline

Return the perpendicular 2D vector of the given 2D vector.

Definition at line 103 of file glc_geomtools.h.

References GLC_Vector2d::x(), and GLC_Vector2d::y().

bool glc::pointInPolygon ( const GLC_Point2d point,
const QList< GLC_Point2d > &  polygon 
)

Return true if the given 2d point is inside the given polygon.

Definition at line 670 of file glc_geomtools.cpp.

References GLC_Vector2d::x(), and GLC_Vector2d::y().

double glc::pointLineDistance ( const GLC_Point3d point,
const GLC_Line3d line 
)

Return the distance between the given point and line.

Definition at line 532 of file glc_geomtools.cpp.

References GLC_Line3d::direction(), GLC_Vector3d::length(), GLC_Vector3d::normalize(), and GLC_Line3d::startingPoint().

bool glc::pointsAreCollinear ( const GLC_Point3d p1,
const GLC_Point3d p2,
const GLC_Point3d p3 
)

Return true if the given 3 points are collinear.

Definition at line 540 of file glc_geomtools.cpp.

References compare(), and GLC_Vector3d::inverted().

bool glc::polygon2DIsConvex ( const QList< GLC_Point2d > &  vertices)

test if the given 2D polygon is convex

Definition at line 38 of file glc_geomtools.cpp.

QList< GLC_Point2d > glc::polygonIn2d ( QList< GLC_Point3d polygon3d)
bool glc::polygonIsConvex ( QList< GLuint > *  pIndexList,
const QList< float > &  bulkList 
)

Test if the given 3d polygon is convex.

Definition at line 63 of file glc_geomtools.cpp.

References GLC_Vector3d::angleWithVect(), PI, and GLC_Vector3d::setVect().

Referenced by triangulatePolygon().

GLC_Point3d glc::project ( const GLC_Point3d point,
const GLC_Line3d line 
)

Return the projected point on the given line form the given point.

Definition at line 524 of file glc_geomtools.cpp.

References GLC_Line3d::direction(), GLC_Vector3d::normalize(), and GLC_Line3d::startingPoint().

Referenced by GLC_PullManipulator::doManipulate().

double glc::round ( double  value)

Definition at line 614 of file glc_geomtools.cpp.

References comparedPrecision.

Referenced by round().

double glc::round ( double  value,
double  accuracy 
)

Definition at line 622 of file glc_geomtools.cpp.

QPointF glc::round ( const QPointF &  point)

Definition at line 630 of file glc_geomtools.cpp.

References round().

QPointF glc::round ( const QPointF &  point,
double  accuracy 
)

Definition at line 636 of file glc_geomtools.cpp.

References round().

GLC_LIB_EXPORT GLC_Vector2d glc::round ( const GLC_Vector2d vector)

Definition at line 642 of file glc_geomtools.cpp.

References round(), GLC_Vector2d::x(), and GLC_Vector2d::y().

GLC_LIB_EXPORT GLC_Vector2d glc::round ( const GLC_Vector2d vector,
double  accuracy 
)

Definition at line 649 of file glc_geomtools.cpp.

References round(), GLC_Vector2d::x(), and GLC_Vector2d::y().

GLC_LIB_EXPORT GLC_Vector3d glc::round ( const GLC_Vector3d vector)

Definition at line 656 of file glc_geomtools.cpp.

References round(), GLC_Vector3d::x(), GLC_Vector3d::y(), and GLC_Vector3d::z().

GLC_LIB_EXPORT GLC_Vector3d glc::round ( const GLC_Vector3d vector,
double  accuracy 
)

Definition at line 663 of file glc_geomtools.cpp.

References round(), GLC_Vector3d::x(), GLC_Vector3d::y(), and GLC_Vector3d::z().

bool glc::segmentInCone ( const GLC_Point2d V0,
const GLC_Point2d V1,
const GLC_Point2d VM,
const GLC_Point2d VP 
)

Return true if the segment is in polygon cone.

Definition at line 266 of file glc_geomtools.cpp.

Referenced by isDiagonal().

double glc::toDegrees ( double  angleInRadians)
inline

Convert the given radian angle in degre.

Definition at line 46 of file glc_utils_maths.h.

References PI.

double glc::toRadian ( double  angleInDegrees)
inline

Convert the given degrees angle in radian.

Definition at line 42 of file glc_utils_maths.h.

References PI.

Referenced by compareAngle(), and GLC_Viewport::setViewAngle().

void glc::triangulate ( QList< GLC_Point2d > &  polygon,
QList< int > &  index,
QList< int > &  tList 
)

Triangulate a polygon.

Definition at line 316 of file glc_geomtools.cpp.

References isDiagonal().

Referenced by triangulatePolygon().

void glc::triangulatePolygon ( QList< GLuint > *  pIndexList,
const QList< float > &  bulkList 
)

Triangulate a polygon return true if the polygon is convex.

If the polygon is convex the returned index is a fan

Definition at line 381 of file glc_geomtools.cpp.

References isCounterclockwiseOrdered(), GLC_Vector3d::isNull(), GLC_Vector3d::normalize(), polygonIsConvex(), GLC_Matrix4x4::setMatRot(), triangulate(), and Z_AXIS().

Referenced by GLC_ColladaToWorld::addPolylistToCurrentMesh(), GLC_ExtrudedMesh::createMesh(), and GLC_ObjToWorld::extractFaceIndex().

const QString glc::version ( "2.5.0 Alpha 2"  )
const GLC_Vector3d glc::X_AXIS ( 1.  0,
0.  0,
0.  0 
)
const GLC_Vector3d glc::Y_AXIS ( 0.  0,
1.  0,
0.  0 
)
const GLC_Vector3d glc::Z_AXIS ( 0.  0,
0.  0,
1.  0 
)
double glc::zeroTo2PIAngle ( double  angle)

Return the angle from 0 to 2PI from an given angle from -PI to PI.

Definition at line 705 of file glc_geomtools.cpp.

References PI.

Variable Documentation

double glc::comparedPrecision = glc::defaultPrecision

Definition at line 31 of file glc_geomtools.cpp.

Referenced by compare(), compareAngle(), and round().

const double glc::defaultPrecision = 0.01

Definition at line 42 of file glc_geomtools.h.

const double glc::EPSILON = 1e-10
QMutex glc::geomIdMutex

Definition at line 28 of file glc_global.cpp.

Referenced by GLC_GenGeomID().

const int glc::GLC_DISCRET = 70

Definition at line 75 of file glc_global.h.

const int glc::GLC_POLYDISCRET = 60

Definition at line 76 of file glc_global.h.

QMutex glc::iDMutex

Definition at line 27 of file glc_global.cpp.

Referenced by GLC_GenID().

const double glc::PI = acos(-1.0)
QMutex glc::shadingGroupIdMutex

Definition at line 31 of file glc_global.cpp.

Referenced by GLC_GenShaderGroupID().

QMutex glc::userIdMutex

Definition at line 29 of file glc_global.cpp.

Referenced by GLC_GenUserID().

QMutex glc::widget3dIdMutex

Definition at line 30 of file glc_global.cpp.

Referenced by GLC_Gen3DWidgetID().

©2005-2013 Laurent Ribon