glc Namespace Reference

Define render mode enum in glc namespace. More...

Enumerations

enum  WidgetEventFlag { AcceptEvent, IgnoreEvent, BlockedEvent }
 

3D widget event flag

More...
enum  RenderMode {
  NormalRenderMode, OverwriteMaterial, OverwriteTransparency, PrimitiveSelected,
  OverwritePrimitiveMaterial, BodySelection, PrimitiveSelection
}
 

Geometry rendering mode enumeration.

More...
enum  RenderFlag { ShadingFlag = 800, WireRenderFlag, TransparentRenderFlag }
 

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 (void)
 Simple ID generation.
GLC_LIB_EXPORT GLC_uint GLC_GenGeomID (void)
 Simple Geom ID generation.
GLC_LIB_EXPORT GLC_uint GLC_GenUserID (void)
 Simple User ID generation.
GLC_LIB_EXPORT GLC_uint GLC_Gen3DWidgetID (void)
 Simple 3D widget ID 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 bool isArchiveString (const QString &fileName)
 Return true if the given file name is in a archive 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 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.
double toRadian (double angle)
 Convert the given degre angle in radian.
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)
Tools Functions

bool polygon2DIsConvex (const QList< GLC_Point2d > &vertices)
 test if the given 2D polygon is convex
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 intersect 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.

Variables

const int GLC_DISCRET = 70
const int GLC_POLYDISCRET = 60
QMutex iDMutex
QMutex geomIdMutex
QMutex userIdMutex
QMutex widget3dIdMutex
const double EPSILON = 1e-10
const double PI = acos(-1.0)

Detailed Description

Define render mode enum in glc namespace.

Definition of usefull constants.


Enumeration Type Documentation

Geometry rendring flag enumaration.

Enumerator:
ShadingFlag 
WireRenderFlag 
TransparentRenderFlag 

Definition at line 55 of file glc_renderproperties.h.

Geometry rendering mode enumeration.

Enumerator:
NormalRenderMode 
OverwriteMaterial 
OverwriteTransparency 
PrimitiveSelected 
OverwritePrimitiveMaterial 
BodySelection 
PrimitiveSelection 

Definition at line 43 of file glc_renderproperties.h.

3D widget event flag

Enumerator:
AcceptEvent 
IgnoreEvent 
BlockedEvent 

Definition at line 83 of file glc_global.h.


Function Documentation

QString glc::archiveEntryFileName ( const QString &  archiveString  ) 

Return Archive entry filname from the given archive string.

Definition at line 101 of file glc_global.cpp.

References archiveInfix(), and isArchiveString().

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

QString glc::archiveFileName ( const QString &  archiveString  ) 

Return Archive filename from the given archive string.

Definition at line 92 of file glc_global.cpp.

References archiveInfix(), archivePrefix(), and isArchiveString().

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

const QString glc::archiveInfix (  ) 

Return GLC_lib Archive infix string.

Definition at line 75 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 70 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 87 of file glc_global.cpp.

References archiveInfix(), and archivePrefix().

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

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

Return the GLC_uint decoded ID from RGB encoded ID.

Definition at line 111 of file glc_global.h.

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

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 76 of file glc_ext.cpp.

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

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 237 of file glc_geomtools.cpp.

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 82 of file glc_geomtools.cpp.

References EPSILON, GLC_Vector2d::getX(), and GLC_Vector2d::getY().

Referenced by isIntersected().

GLC_uint glc::GLC_Gen3DWidgetID ( void   ) 

Simple 3D widget ID generation.

Definition at line 61 of file glc_global.cpp.

References widget3dIdMutex.

GLC_uint glc::GLC_GenGeomID ( void   ) 

Simple Geom ID generation.

Definition at line 43 of file glc_global.cpp.

References geomIdMutex.

Referenced by GLC_Geometry::operator=().

GLC_uint glc::GLC_GenID ( void   ) 

Simple ID generation.

Definition at line 34 of file glc_global.cpp.

References iDMutex.

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

GLC_uint glc::GLC_GenUserID ( void   ) 

Simple User ID generation.

Definition at line 52 of file glc_global.cpp.

References userIdMutex.

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 346 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 284 of file glc_geomtools.cpp.

References isIntersected(), and segmentInCone().

Referenced by triangulate().

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 141 of file glc_geomtools.cpp.

References EPSILON, findIntersection(), GLC_Vector2d::getX(), and GLC_Vector2d::getY().

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 192 of file glc_geomtools.cpp.

References EPSILON, GLC_Vector2d::getX(), and GLC_Vector2d::getY().

Referenced by isCounterclockwiseOrdered().

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

Return true if the given 3d line intersect 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 500 of file glc_geomtools.cpp.

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

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

bool glc::loadGlSlExtension (  ) 
bool glc::loadPointSpriteExtension (  ) 

Load Point Sprite extension.

Definition at line 156 of file glc_ext.cpp.

References glPointParameterf, and glPointParameterfv.

Referenced by GLC_State::setPointSpriteSupport().

bool glc::loadVboExtension (  ) 
GLC_Point3d glc::midPoint ( const GLC_Point3d point1,
const GLC_Point3d  point2 
) [inline]

Return the midpoint of the two given points.

Definition at line 98 of file glc_geomtools.h.

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

test if the given 2D polygon is convex

Definition at line 37 of file glc_geomtools.cpp.

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

Test if the given 3d polygon is convex.

Definition at line 62 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 523 of file glc_geomtools.cpp.

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

Referenced by GLC_PullManipulator::doManipulate().

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 265 of file glc_geomtools.cpp.

Referenced by isDiagonal().

double glc::toRadian ( double  angle  )  [inline]

Convert the given degre angle in radian.

Definition at line 44 of file glc_utils_maths.h.

References PI.

Referenced by GLC_Viewport::setViewAngle().

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

Triangulate a polygon.

Definition at line 315 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 380 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(), and GLC_ObjToWorld::extractFaceIndex().

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 
)

Variable Documentation

const double glc::EPSILON = 1e-10

Definition at line 30 of file glc_global.cpp.

Referenced by GLC_GenGeomID().

const int glc::GLC_DISCRET = 70

Definition at line 74 of file glc_global.h.

const int glc::GLC_POLYDISCRET = 60

Definition at line 75 of file glc_global.h.

QMutex glc::iDMutex

Definition at line 29 of file glc_global.cpp.

Referenced by GLC_GenID().

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

Definition at line 31 of file glc_global.cpp.

Referenced by GLC_GenUserID().

Definition at line 32 of file glc_global.cpp.

Referenced by GLC_Gen3DWidgetID().

SourceForge.net Logo

©2005-2010 Laurent Ribon