2008-08-18 20:39:18 +08:00
|
|
|
|
#include <osg/Notify>
|
2005-03-13 09:47:46 +08:00
|
|
|
|
#include <osg/Version>
|
2005-11-15 01:07:11 +08:00
|
|
|
|
#include <osg/ArgumentParser>
|
|
|
|
|
#include <osg/ApplicationUsage>
|
2008-04-04 02:36:50 +08:00
|
|
|
|
|
|
|
|
|
#include <osg/Matrix>
|
|
|
|
|
#include <osg/Plane>
|
|
|
|
|
#include <osg/BoundingBox>
|
|
|
|
|
#include <osg/BoundingSphere>
|
|
|
|
|
|
2008-11-07 23:08:08 +08:00
|
|
|
|
#include <osgDB/fstream>
|
2008-04-04 02:36:50 +08:00
|
|
|
|
|
2007-09-11 18:10:43 +08:00
|
|
|
|
#include <OpenThreads/Version>
|
2005-03-13 09:47:46 +08:00
|
|
|
|
|
2005-11-15 01:07:11 +08:00
|
|
|
|
#include <set>
|
|
|
|
|
#include <vector>
|
|
|
|
|
#include <iostream>
|
2005-03-13 09:47:46 +08:00
|
|
|
|
|
2005-11-17 23:18:48 +08:00
|
|
|
|
// the majority of the application is dedicated to building the
|
|
|
|
|
// current contribitors list by parsing the ChangeLog, it just takes
|
|
|
|
|
// one line in the main itself to report the version number.
|
|
|
|
|
|
|
|
|
|
#if defined(_MSC_VER)
|
|
|
|
|
#pragma setlocale("C")
|
|
|
|
|
#endif
|
|
|
|
|
|
2005-11-15 01:07:11 +08:00
|
|
|
|
typedef std::pair<std::string, std::string> NamePair;
|
2005-11-15 23:07:17 +08:00
|
|
|
|
typedef std::map<NamePair,unsigned int> NameMap;
|
2005-11-15 04:51:28 +08:00
|
|
|
|
typedef std::vector< std::string > Words;
|
2005-11-15 01:07:11 +08:00
|
|
|
|
|
|
|
|
|
NamePair EmptyNamePair;
|
2005-11-15 23:07:17 +08:00
|
|
|
|
NamePair NameRobertOsfield("Robert","Osfield");
|
|
|
|
|
NamePair NameDonBurns("Don","Burns");
|
2005-11-15 01:07:11 +08:00
|
|
|
|
|
|
|
|
|
bool validName(const std::string& first)
|
|
|
|
|
{
|
2005-12-16 04:56:06 +08:00
|
|
|
|
if (first=="de") return true;
|
2008-08-18 20:39:18 +08:00
|
|
|
|
if (first=="den") return true;
|
|
|
|
|
if (first=="van") return true;
|
2005-12-16 04:56:06 +08:00
|
|
|
|
|
|
|
|
|
|
2005-11-15 01:07:11 +08:00
|
|
|
|
if (first.empty()) return false;
|
|
|
|
|
if (first[0]<'A' || first[0]>'Z') return false;
|
|
|
|
|
|
2005-11-15 05:40:28 +08:00
|
|
|
|
if (first.size()>=2 && (first[1]<'a' || first[1]>'z') && (first[1]!='.') && (first[1]!=',')) return false;
|
2005-11-15 01:07:11 +08:00
|
|
|
|
|
2007-08-23 23:36:45 +08:00
|
|
|
|
if (first=="Xcode") return false;
|
2005-11-15 01:07:11 +08:00
|
|
|
|
if (first=="Added") return false;
|
2005-12-08 20:02:06 +08:00
|
|
|
|
if (first=="Camera") return false;
|
2005-11-15 01:07:11 +08:00
|
|
|
|
if (first=="CameraNode") return false;
|
|
|
|
|
if (first=="CopyOp") return false;
|
|
|
|
|
if (first=="Fixed") return false;
|
2007-04-15 20:09:12 +08:00
|
|
|
|
if (first=="View") return false;
|
|
|
|
|
if (first=="GraphicsContext") return false;
|
|
|
|
|
if (first=="WindowData") return false;
|
|
|
|
|
if (first=="ViewPoint") return false;
|
|
|
|
|
if (first=="PickHandler") return false;
|
|
|
|
|
if (first=="Program") return false;
|
|
|
|
|
if (first=="Object") return false;
|
|
|
|
|
if (first=="OpenSceneGraph") return false;
|
|
|
|
|
if (first=="SpotExponent") return false;
|
|
|
|
|
if (first=="Framstamp") return false;
|
|
|
|
|
if (first=="Stats") return false;
|
2007-09-12 18:43:49 +08:00
|
|
|
|
if (first=="Group") return false;
|
|
|
|
|
if (first=="Texture") return false;
|
|
|
|
|
if (first=="Texture2DArray") return false;
|
2005-11-15 01:07:11 +08:00
|
|
|
|
if (first=="Creator") return false;
|
|
|
|
|
if (first=="CullVisitor") return false;
|
|
|
|
|
if (first=="Drawable") return false;
|
|
|
|
|
if (first=="Geode") return false;
|
|
|
|
|
if (first=="GeoSet") return false;
|
|
|
|
|
if (first=="Image") return false;
|
2007-04-15 20:09:12 +08:00
|
|
|
|
if (first=="Face") return false;
|
2005-11-15 01:07:11 +08:00
|
|
|
|
if (first=="Images/SolarSystem") return false;
|
|
|
|
|
if (first=="IntersectVisitor") return false;
|
|
|
|
|
if (first=="LongIDRecord") return false;
|
|
|
|
|
if (first=="Makefile") return false;
|
|
|
|
|
if (first=="Matrix") return false;
|
|
|
|
|
if (first=="MemoryManager") return false;
|
|
|
|
|
if (first=="MeshRecord") return false;
|
|
|
|
|
if (first=="Multigen") return false;
|
|
|
|
|
if (first=="NewCullVisitor") return false;
|
|
|
|
|
if (first=="Output") return false;
|
|
|
|
|
if (first=="PageLOD") return false;
|
|
|
|
|
if (first=="Improved") return false;
|
|
|
|
|
if (first=="PagedLOD") return false;
|
|
|
|
|
if (first=="Referenced") return false;
|
|
|
|
|
if (first=="StateAttribute") return false;
|
|
|
|
|
if (first=="Switch") return false;
|
|
|
|
|
if (first=="TechniqueEventHandler") return false;
|
|
|
|
|
if (first=="Uniform") return false;
|
|
|
|
|
if (first=="Vec*") return false;
|
|
|
|
|
if (first=="Viewer") return false;
|
|
|
|
|
if (first=="VisualStudio") return false;
|
|
|
|
|
if (first=="X") return false;
|
|
|
|
|
if (first=="Y") return false;
|
|
|
|
|
if (first=="Producer") return false;
|
|
|
|
|
if (first=="New") return false;
|
|
|
|
|
if (first=="Removed") return false;
|
|
|
|
|
if (first=="Ouput") return false;
|
|
|
|
|
if (first=="ReaderWriters") return false;
|
|
|
|
|
if (first=="NodeVisitor") return false;
|
|
|
|
|
if (first=="Fixes") return false;
|
|
|
|
|
if (first=="FontImplementation") return false;
|
|
|
|
|
if (first=="DisplaySettings") return false;
|
2005-11-15 04:51:28 +08:00
|
|
|
|
if (first=="AnimationPath") return false;
|
|
|
|
|
if (first=="AnimationPathCallback") return false;
|
|
|
|
|
if (first=="AnimationPathManipulator") return false;
|
|
|
|
|
if (first=="ArgumentParser") return false;
|
|
|
|
|
if (first=="AttrData") return false;
|
|
|
|
|
if (first=="Azimuth") return false;
|
|
|
|
|
if (first=="CluserCullingCallback") return false;
|
|
|
|
|
if (first=="ClusterCullingCallback") return false;
|
|
|
|
|
if (first=="CoordinateSystem") return false;
|
|
|
|
|
if (first=="CoordinateSystemNode") return false;
|
|
|
|
|
if (first=="CoordinateSystemNode&") return false;
|
|
|
|
|
if (first=="Copyright") return false;
|
|
|
|
|
if (first=="Cygwin") return false;
|
|
|
|
|
if (first=="CullCallbacks") return false;
|
|
|
|
|
if (first=="CullingSettngs") return false;
|
|
|
|
|
if (first=="DataVariance") return false;
|
|
|
|
|
if (first=="DatabasePager") return false;
|
|
|
|
|
if (first=="DrawElementsUByte") return false;
|
|
|
|
|
if (first=="Escape") return false;
|
|
|
|
|
if (first=="FluidProgram") return false;
|
|
|
|
|
if (first=="FrameStats") return false;
|
|
|
|
|
if (first=="FreeBSD") return false;
|
|
|
|
|
if (first=="GraphicsContextImplementation") return false;
|
|
|
|
|
if (first=="GraphicsThread") return false;
|
|
|
|
|
if (first=="Images") return false;
|
|
|
|
|
if (first=="IndexBlock") return false;
|
|
|
|
|
if (first=="Inventor") return false;
|
|
|
|
|
if (first=="Make") return false;
|
|
|
|
|
if (first=="Material") return false;
|
|
|
|
|
if (first=="MergeGeometryVisitor") return false;
|
|
|
|
|
if (first=="Mode") return false;
|
|
|
|
|
if (first=="Prodcuer") return false;
|
|
|
|
|
if (first=="ProxyNode") return false;
|
|
|
|
|
if (first=="ReentrantMutex") return false;
|
|
|
|
|
if (first=="ReferenceFrame") return false;
|
|
|
|
|
if (first=="RemoveLoadedProxyNodes") return false;
|
|
|
|
|
if (first=="RenderTargetFallback") return false;
|
|
|
|
|
if (first=="RenderToTextureStage") return false;
|
|
|
|
|
if (first=="Sequence") return false;
|
|
|
|
|
if (first=="Shape") return false;
|
|
|
|
|
if (first=="TessellationHints") return false;
|
|
|
|
|
if (first=="Support") return false;
|
|
|
|
|
if (first=="State") return false;
|
|
|
|
|
if (first=="SmokeTrailEffect") return false;
|
|
|
|
|
if (first=="TexEnv") return false;
|
|
|
|
|
if (first=="Texture3D") return false;
|
|
|
|
|
if (first=="TextureCubeMap") return false;
|
|
|
|
|
if (first=="TextureObjectManager") return false;
|
|
|
|
|
if (first=="TextureRectangle(Image*") return false;
|
|
|
|
|
if (first=="TextureType") return false;
|
|
|
|
|
if (first=="Texuture") return false;
|
|
|
|
|
if (first=="TriStripVisitor") return false;
|
|
|
|
|
if (first=="UserData") return false;
|
|
|
|
|
if (first=="Viewport") return false;
|
|
|
|
|
if (first=="Visual") return false;
|
|
|
|
|
if (first=="Studio") return false;
|
|
|
|
|
if (first=="Vec2d") return false;
|
|
|
|
|
if (first=="Vec3d") return false;
|
|
|
|
|
if (first=="Windows") return false;
|
|
|
|
|
if (first=="Version") return false;
|
|
|
|
|
if (first=="Viewport") return false;
|
|
|
|
|
if (first=="Core") return false;
|
|
|
|
|
if (first=="DataSet") return false;
|
|
|
|
|
if (first=="Endian") return false;
|
|
|
|
|
if (first=="ImageOptions") return false;
|
|
|
|
|
if (first=="ImageStream") return false;
|
|
|
|
|
if (first=="KeyboardMouse") return false;
|
|
|
|
|
if (first=="KeyboardMouseCallback") return false;
|
|
|
|
|
if (first=="AutoTransform") return false;
|
2005-11-15 23:07:17 +08:00
|
|
|
|
if (first=="AutoTransform.") return false;
|
2005-11-15 04:51:28 +08:00
|
|
|
|
if (first=="LightModel") return false;
|
|
|
|
|
if (first=="MatrixManipulator") return false;
|
|
|
|
|
if (first=="MatrixTransform") return false;
|
|
|
|
|
if (first=="OpenDX") return false;
|
|
|
|
|
if (first=="ParentList") return false;
|
|
|
|
|
if (first=="TerraPage") return false;
|
|
|
|
|
if (first=="OveralyNode") return false;
|
|
|
|
|
if (first=="OpenThreads") return false;
|
|
|
|
|
if (first=="PolygonStipple") return false;
|
|
|
|
|
if (first=="SceneView") return false;
|
|
|
|
|
if (first=="PrimitiveIndexFunctor") return false;
|
|
|
|
|
if (first=="PolytopeVisitor") return false;
|
|
|
|
|
if (first=="Performer") return false;
|
|
|
|
|
if (first=="Paging") return false;
|
2005-11-29 22:20:37 +08:00
|
|
|
|
if (first=="CameraBarrierCallback") return false;
|
2005-12-02 20:30:14 +08:00
|
|
|
|
if (first=="TestSupportCallback") return false;
|
2006-07-05 18:47:38 +08:00
|
|
|
|
if (first=="Quake3") return false;
|
|
|
|
|
if (first=="BlenColour(Vec4") return false;
|
|
|
|
|
if (first=="UseFarLineSegments") return false;
|
|
|
|
|
if (first=="TextureRectangle") return false;
|
2006-07-05 20:51:41 +08:00
|
|
|
|
if (first=="DeleteHandler") return false;
|
|
|
|
|
if (first=="EventQueue") return false;
|
2006-07-06 19:08:51 +08:00
|
|
|
|
if (first=="TrPageViewer") return false;
|
|
|
|
|
if (first=="TestManipulator") return false;
|
|
|
|
|
if (first=="ProducerEventCallback") return false;
|
|
|
|
|
if (first=="OrientationConverter") return false;
|
|
|
|
|
if (first=="Logos") return false;
|
2006-07-15 05:02:02 +08:00
|
|
|
|
if (first=="StatsVisitor") return false;
|
2006-07-06 19:08:51 +08:00
|
|
|
|
if (first=="LineStipple") return false;
|
|
|
|
|
if (first=="Files") return false;
|
|
|
|
|
if (first=="Mr") return false;
|
|
|
|
|
if (first=="Osfields") return false;
|
2006-07-18 21:17:40 +08:00
|
|
|
|
if (first=="Optimizer") return false;
|
2006-07-19 04:59:22 +08:00
|
|
|
|
if (first=="RenderStage") return false;
|
2006-08-11 17:50:32 +08:00
|
|
|
|
if (first=="Matrix*") return false;
|
|
|
|
|
if (first=="Vec4ub") return false;
|
2006-08-12 15:59:36 +08:00
|
|
|
|
if (first=="Proxy") return false;
|
2006-08-13 16:40:06 +08:00
|
|
|
|
if (first=="CullVistor") return false;
|
2007-06-05 05:31:17 +08:00
|
|
|
|
if (first=="SimpleViewer") return false;
|
2006-09-05 23:22:54 +08:00
|
|
|
|
if (first=="TexMat(Matrix") return false;
|
2007-07-24 22:52:51 +08:00
|
|
|
|
if (first=="GraphicsWindowX11") return false;
|
|
|
|
|
if (first=="OperationThread") return false;
|
2007-12-18 05:52:29 +08:00
|
|
|
|
if (first=="SimpleViewer") return false;
|
|
|
|
|
if (first=="IndexFaceSets") return false;
|
2008-01-04 20:03:24 +08:00
|
|
|
|
if (first=="Quicktime") return false;
|
2008-03-14 19:53:44 +08:00
|
|
|
|
if (first=="SceneGraphBuilder") return false;
|
|
|
|
|
if (first=="LightPointNode") return false;
|
2008-04-22 21:00:52 +08:00
|
|
|
|
if (first=="GeometryTechnique") return false;
|
|
|
|
|
if (first=="GeoemtryTechnique") return false;
|
2008-08-05 23:27:37 +08:00
|
|
|
|
if (first=="KdTree") return false;
|
|
|
|
|
if (first=="LineSegment") return false;
|
2008-08-18 20:39:18 +08:00
|
|
|
|
if (first=="Canvas") return false;
|
|
|
|
|
if (first=="OpenSceneGraph-2") return false;
|
2008-11-29 20:16:04 +08:00
|
|
|
|
if (first=="OpenSceneGraph-osgWidget-dev") return false;
|
|
|
|
|
if (first=="Valve") return false;
|
|
|
|
|
if (first=="Source") return false;
|
2008-12-13 03:19:01 +08:00
|
|
|
|
if (first=="PixelDataBufferObject") return false;
|
2005-11-15 01:07:11 +08:00
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::string typoCorrection(const std::string& name)
|
|
|
|
|
{
|
|
|
|
|
#if 0
|
|
|
|
|
if (name=="") return "";
|
|
|
|
|
if (name=="") return "";
|
|
|
|
|
if (name=="") return "";
|
2005-11-19 20:18:51 +08:00
|
|
|
|
if (name=="") return "";
|
2005-11-15 01:07:11 +08:00
|
|
|
|
#endif
|
2008-08-18 20:39:18 +08:00
|
|
|
|
if (name=="Aderian") return "Adrian";
|
2007-07-09 19:37:06 +08:00
|
|
|
|
if (name=="Adndre") return "Andre";
|
2008-08-18 20:39:18 +08:00
|
|
|
|
if (name=="Adrain") return "Adrian";
|
|
|
|
|
if (name=="Andew") return "Andrew";
|
|
|
|
|
if (name=="André") return "Andr<EFBFBD>";
|
|
|
|
|
if (name=="Antione") return "Antoine";
|
|
|
|
|
if (name=="Antonoine") return "Antoine";
|
|
|
|
|
if (name=="Atr") return "Art";
|
2006-07-05 20:51:41 +08:00
|
|
|
|
if (name=="Baverage") return "Beverage";
|
2005-11-15 01:07:11 +08:00
|
|
|
|
if (name=="Bistroviae") return "Bistrovic";
|
2008-08-18 20:39:18 +08:00
|
|
|
|
if (name=="Callue") return "Callu";
|
2005-11-15 01:07:11 +08:00
|
|
|
|
if (name=="Christaiansen") return "Christiansen";
|
2006-07-05 20:51:41 +08:00
|
|
|
|
if (name=="Cobin") return "Corbin";
|
2008-08-18 20:39:18 +08:00
|
|
|
|
if (name=="Comporesi") return "Camporesi";
|
2006-07-05 20:51:41 +08:00
|
|
|
|
if (name=="Connel") return "Connell";
|
2008-08-18 20:39:18 +08:00
|
|
|
|
if (name=="Cullu") return "Callu";
|
|
|
|
|
if (name=="Daneil") return "Daniel";
|
2005-11-15 01:07:11 +08:00
|
|
|
|
if (name=="Daust") return "Daoust";
|
|
|
|
|
if (name=="Daved") return "David";
|
2008-01-22 19:13:07 +08:00
|
|
|
|
if (name=="Drederic") return "Frederic";
|
2008-08-18 20:39:18 +08:00
|
|
|
|
if (name=="Eileman") return "Eilemann";
|
|
|
|
|
if (name=="Elgi") return "Egli";
|
2008-10-08 21:18:14 +08:00
|
|
|
|
if (name=="Frashid") return "Farshid";
|
2008-08-18 20:39:18 +08:00
|
|
|
|
if (name=="Fred") return "Frederic";
|
2005-11-15 01:07:11 +08:00
|
|
|
|
if (name=="Fredrick") return "Frederic";
|
2005-11-15 01:21:49 +08:00
|
|
|
|
if (name=="Fredric") return "Frederic";
|
2008-08-18 20:39:18 +08:00
|
|
|
|
if (name=="Froechlich") return "Fr<EFBFBD>hlich";
|
2008-10-08 21:18:14 +08:00
|
|
|
|
if (name=="Froehilch") return "Fr<EFBFBD>hlich";
|
2009-01-30 21:05:07 +08:00
|
|
|
|
if (name=="Froehlich") return "Fr<EFBFBD>hlich";
|
2008-08-18 20:39:18 +08:00
|
|
|
|
if (name=="Froelich") return "Fr<EFBFBD>hlich";
|
|
|
|
|
if (name=="Froenlich") return "Fr<EFBFBD>hlich";
|
|
|
|
|
if (name=="Fröhlich") return "Fr<EFBFBD>hlich";
|
|
|
|
|
if (name=="Fruciel") return "Frauciel";
|
|
|
|
|
if (name=="García") return "Garcea";
|
2008-05-12 20:16:14 +08:00
|
|
|
|
if (name=="Garrat") return "Garrett";
|
2008-08-18 20:39:18 +08:00
|
|
|
|
if (name=="Garret") return "Garrett";
|
2005-11-15 01:21:49 +08:00
|
|
|
|
if (name=="Geof") return "Geoff";
|
2008-08-18 20:39:18 +08:00
|
|
|
|
if (name=="Giatan") return "Gaitan";
|
2005-11-15 01:21:49 +08:00
|
|
|
|
if (name=="Gronenger") return "Gronager";
|
|
|
|
|
if (name=="Gronger") return "Gronager";
|
2008-08-18 20:39:18 +08:00
|
|
|
|
if (name=="Hebelin") return "Herbelin";
|
2006-07-05 18:47:38 +08:00
|
|
|
|
if (name=="Heirtlein") return "Hertlein";
|
2005-11-15 01:21:49 +08:00
|
|
|
|
if (name=="Heirtlein") return "Hertlein";
|
2006-07-05 20:51:41 +08:00
|
|
|
|
if (name=="Heirtlein") return "Hertlein";
|
2009-01-30 21:05:07 +08:00
|
|
|
|
if (name=="Hertleinm") return "Hertlein";
|
2005-11-15 01:07:11 +08:00
|
|
|
|
if (name=="Hertlien") return "Hertlein";
|
|
|
|
|
if (name=="Hi") return "He";
|
2006-07-05 20:51:41 +08:00
|
|
|
|
if (name=="Hooper") return "Hopper";
|
2005-11-15 01:07:11 +08:00
|
|
|
|
if (name=="Inverson") return "Iverson";
|
|
|
|
|
if (name=="Iversion") return "Iverson";
|
2008-08-18 20:39:18 +08:00
|
|
|
|
if (name=="Jean-Sebastian") return "Jean-Sebastien";
|
2008-10-08 21:18:14 +08:00
|
|
|
|
if (name=="Jean-Sebastirn") return "Jean-Sebastien";
|
2008-08-18 20:39:18 +08:00
|
|
|
|
if (name=="Jea-Sebastien") return "Jean-Sebastien";
|
2005-11-15 01:07:11 +08:00
|
|
|
|
if (name=="Johhansen") return "Johansen";
|
|
|
|
|
if (name=="Johnansen") return "Johansen";
|
2005-11-15 01:21:49 +08:00
|
|
|
|
if (name=="Johnasen") return "Johansen";
|
2005-11-15 04:54:53 +08:00
|
|
|
|
if (name=="Jolly") return "Jolley";
|
2005-11-15 01:21:49 +08:00
|
|
|
|
if (name=="Jose") return "Jos<EFBFBD>";
|
2008-08-18 20:39:18 +08:00
|
|
|
|
if (name=="José") return "Jos<EFBFBD>";
|
2006-07-05 20:51:41 +08:00
|
|
|
|
if (name=="Joson") return "Jason";
|
2005-11-15 01:15:58 +08:00
|
|
|
|
if (name=="J") return "Jos<EFBFBD>";
|
2005-11-15 01:07:11 +08:00
|
|
|
|
if (name=="Keuhne") return "Kuehne";
|
|
|
|
|
if (name=="Kheune") return "Kuehne";
|
2009-01-30 21:05:07 +08:00
|
|
|
|
if (name=="Lagrade") return "Lagarde";
|
2008-08-18 20:39:18 +08:00
|
|
|
|
if (name=="Larshkari") return "Lashkari";
|
2006-07-05 20:51:41 +08:00
|
|
|
|
if (name=="Lashakari") return "Lashkari";
|
2005-11-15 01:07:11 +08:00
|
|
|
|
if (name=="Lashari") return "Lashkari";
|
2006-07-05 18:47:38 +08:00
|
|
|
|
if (name=="Lasharki") return "Lashkari";
|
2006-07-05 20:51:41 +08:00
|
|
|
|
if (name=="Laskari") return "Lashkari";
|
2008-08-18 20:39:18 +08:00
|
|
|
|
if (name=="Leandowski" || name=="Lawandowski") return "Lewandowski";
|
2009-01-30 21:05:07 +08:00
|
|
|
|
if (name=="Lucas") return "Luaces";
|
2008-08-18 20:39:18 +08:00
|
|
|
|
if (name=="Lugi") return "Luigi";
|
2009-01-30 21:05:07 +08:00
|
|
|
|
if (name=="Lweandowski") return "Lewandowski";
|
2008-08-18 20:39:18 +08:00
|
|
|
|
if (name=="Machler") return "M<EFBFBD>chler";
|
2005-11-15 01:21:49 +08:00
|
|
|
|
if (name=="Macro") return "Marco";
|
2008-08-18 20:39:18 +08:00
|
|
|
|
if (name=="Maechler") return "M<EFBFBD>chler";
|
|
|
|
|
if (name=="Mahai") return "Mihai";
|
2005-11-15 01:07:11 +08:00
|
|
|
|
if (name=="Mammond") return "Marmond";
|
2005-11-15 01:21:49 +08:00
|
|
|
|
if (name=="March") return "Marco";
|
2008-08-18 20:39:18 +08:00
|
|
|
|
if (name=="Martsz") return "Martz";
|
2005-11-15 01:07:11 +08:00
|
|
|
|
if (name=="Marz") return "Martz";
|
2008-08-18 20:39:18 +08:00
|
|
|
|
if (name=="Matz") return "Martz";
|
|
|
|
|
if (name=="Melchoir") return "Melchior";
|
|
|
|
|
if (name=="Mellis") return "Melis";
|
|
|
|
|
if (name=="Messerschimdt") return "Messerschmidt";
|
2006-07-05 20:51:41 +08:00
|
|
|
|
if (name=="Micheal") return "Michael";
|
2008-08-18 20:39:18 +08:00
|
|
|
|
if (name=="Mihair") return "Mihai";
|
2006-07-05 20:51:41 +08:00
|
|
|
|
if (name=="Molishtan") return "Moloshtan";
|
2005-11-15 01:21:49 +08:00
|
|
|
|
if (name=="Molishtan") return "Moloshtan";
|
2005-11-15 01:07:11 +08:00
|
|
|
|
if (name=="Moloshton") return "Moloshtan";
|
2008-08-18 20:39:18 +08:00
|
|
|
|
if (name=="Morné") return "Morn<EFBFBD>";
|
2009-02-12 04:26:06 +08:00
|
|
|
|
if (name=="Morne") return "Morn<EFBFBD>";
|
2005-11-15 01:21:49 +08:00
|
|
|
|
if (name=="Moule") return "Moiule";
|
2008-08-18 20:39:18 +08:00
|
|
|
|
if (name=="Narache") return "Marache";
|
2005-11-15 01:07:11 +08:00
|
|
|
|
if (name=="Nicklov") return "Nikolov";
|
2007-07-09 19:37:06 +08:00
|
|
|
|
if (name=="Nickolov") return "Nikolov";
|
2005-11-15 01:07:11 +08:00
|
|
|
|
if (name=="Olad") return "Olaf";
|
2007-06-05 05:31:17 +08:00
|
|
|
|
if (name=="Olar") return "Olaf";
|
2006-07-05 20:51:41 +08:00
|
|
|
|
if (name=="Oritz") return "Ortiz";
|
2009-01-30 21:05:07 +08:00
|
|
|
|
if (name=="Osfeld") return "Osfield";
|
2005-11-15 01:07:11 +08:00
|
|
|
|
if (name=="Osfied") return "Osfield";
|
|
|
|
|
if (name=="Pail") return "Paul";
|
2008-08-18 20:39:18 +08:00
|
|
|
|
if (name=="Rajce") return "Trajce";
|
2006-07-05 20:51:41 +08:00
|
|
|
|
if (name=="Randal") return "Randall";
|
2008-08-18 20:39:18 +08:00
|
|
|
|
if (name=="Robet") return "Robert";
|
2006-07-05 20:51:41 +08:00
|
|
|
|
if (name=="Rodger") return "Roger";
|
2009-01-30 21:05:07 +08:00
|
|
|
|
if (name=="Rolad") return "Roland";
|
|
|
|
|
if (name=="Rucard") return "Richard";
|
|
|
|
|
if (name=="Sekender") return "Sukender";
|
2005-11-15 01:21:49 +08:00
|
|
|
|
if (name=="Sewel") return "Sewell";
|
2008-08-18 20:39:18 +08:00
|
|
|
|
if (name=="Simmonson") return "Simonsson";
|
|
|
|
|
if (name=="Simmonsson") return "Simonsson";
|
2005-11-15 01:21:49 +08:00
|
|
|
|
if (name=="Sjolie") return "Sj<EFBFBD>lie";
|
2008-08-18 20:39:18 +08:00
|
|
|
|
if (name=="Sjölie") return "Sj<EFBFBD>lie";
|
|
|
|
|
if (name=="Skinnder") return "Skinner";
|
2005-11-15 01:07:11 +08:00
|
|
|
|
if (name=="Sokolosky") return "Sokolowsky";
|
2008-08-18 20:39:18 +08:00
|
|
|
|
if (name=="Sokolowki") return "Sokolowsky";
|
2006-07-05 20:51:41 +08:00
|
|
|
|
if (name=="Sokolowski") return "Sokolowsky";
|
2005-11-15 01:07:11 +08:00
|
|
|
|
if (name=="Sokolsky") return "Sokolowsky";
|
2008-08-18 20:39:18 +08:00
|
|
|
|
if (name=="Sokolwsky") return "Sokolowsky";
|
2005-11-15 01:07:11 +08:00
|
|
|
|
if (name=="Sonda") return "Sondra";
|
|
|
|
|
if (name=="Stansilav") return "Stanislav";
|
|
|
|
|
if (name=="Stefan") return "Stephan";
|
|
|
|
|
if (name=="Stell") return "Steel";
|
2008-08-18 20:39:18 +08:00
|
|
|
|
if (name=="Sylvan") return "Sylvain";
|
2006-07-05 20:51:41 +08:00
|
|
|
|
if (name=="Takeahei") return "Takahei";
|
|
|
|
|
if (name=="Takehei") return "Takahei";
|
2005-11-15 01:21:49 +08:00
|
|
|
|
if (name=="Tarantilils") return "Tarantilis";
|
2008-08-18 20:39:18 +08:00
|
|
|
|
if (name=="Trastenjak") return "Trstenjak";
|
2009-01-30 21:05:07 +08:00
|
|
|
|
if (name=="Urlich") return "Ulrich";
|
2006-07-05 20:51:41 +08:00
|
|
|
|
if (name=="Vines") return "Vine";
|
2008-08-18 20:39:18 +08:00
|
|
|
|
if (name=="Waldrom") return "Waldron";
|
2009-01-30 21:05:07 +08:00
|
|
|
|
if (name=="Wedner") return "Weidner";
|
2008-08-18 20:39:18 +08:00
|
|
|
|
if (name=="Weidemann") return "Wiedemann";
|
2005-11-15 01:21:49 +08:00
|
|
|
|
if (name=="Wieblen") return "Weiblen";
|
2009-01-30 21:05:07 +08:00
|
|
|
|
if (name=="Woesnner") return "Woessner";
|
2008-08-18 20:39:18 +08:00
|
|
|
|
if (name=="Wojiech" || name=="Wojchiech") return "Wojciech";
|
2005-11-15 01:07:11 +08:00
|
|
|
|
if (name=="Xennon") return "Hanson";
|
2006-07-05 20:51:41 +08:00
|
|
|
|
if (name=="Yefrei") return "Yefei";
|
2005-11-15 01:07:11 +08:00
|
|
|
|
if (name=="Yfei") return "Yefei";
|
2009-01-30 21:05:07 +08:00
|
|
|
|
if (name=="Jean-Sebastein") return "Jean-Sebastien";
|
2009-02-12 04:26:06 +08:00
|
|
|
|
if (name=="Haritchablaet") return "Haritchabalet";
|
2009-02-23 18:50:42 +08:00
|
|
|
|
if (name=="Fautre") return "Fautr<EFBFBD>";
|
|
|
|
|
if (name=="Maceij") return "Maciej";
|
|
|
|
|
if (name=="Fabian") return "Fabien";
|
2005-11-15 01:07:11 +08:00
|
|
|
|
return name;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void nameCorrection(NamePair& name)
|
|
|
|
|
{
|
2009-03-13 21:25:00 +08:00
|
|
|
|
if (name.first=="Mick" && name.second=="")
|
|
|
|
|
{
|
|
|
|
|
name.first = "Maik";
|
|
|
|
|
name.second = "Keller";
|
|
|
|
|
}
|
|
|
|
|
|
2009-02-12 04:26:06 +08:00
|
|
|
|
if (name.first=="Gary" && name.second=="Quin")
|
|
|
|
|
{
|
|
|
|
|
name.first = "Gary";
|
|
|
|
|
name.second = "Quinn";
|
|
|
|
|
}
|
|
|
|
|
|
2008-11-29 20:16:04 +08:00
|
|
|
|
if (name.first=="BjornHein" && name.second=="")
|
|
|
|
|
{
|
|
|
|
|
name.first = "Bj<EFBFBD>rn";
|
|
|
|
|
name.second = "Hein";
|
|
|
|
|
}
|
|
|
|
|
|
2009-01-30 21:05:07 +08:00
|
|
|
|
if (name.first=="Mattias" && name.second=="Fr<EFBFBD>hlich")
|
|
|
|
|
{
|
|
|
|
|
name.first = "Mathias";
|
|
|
|
|
name.second = "Fr<EFBFBD>hlich";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (name.first=="Mathias" && name.second=="Helsing")
|
|
|
|
|
{
|
|
|
|
|
name.first = "Mattias";
|
|
|
|
|
name.second = "Helsing";
|
|
|
|
|
}
|
|
|
|
|
|
2008-11-29 20:16:04 +08:00
|
|
|
|
if (name.first=="Bjorn" && name.second=="Hein")
|
|
|
|
|
{
|
|
|
|
|
name.first = "Bj<EFBFBD>rn";
|
|
|
|
|
name.second = "Hein";
|
|
|
|
|
}
|
2009-01-30 21:05:07 +08:00
|
|
|
|
|
2008-08-18 20:39:18 +08:00
|
|
|
|
if (name.first=="Erik" && name.second=="van")
|
|
|
|
|
{
|
|
|
|
|
name.first = "Erik";
|
|
|
|
|
name.second = "den Dekker";
|
|
|
|
|
}
|
|
|
|
|
|
2008-10-08 21:18:14 +08:00
|
|
|
|
if (name.first=="Erik" && name.second=="den")
|
|
|
|
|
{
|
|
|
|
|
name.first = "Erik";
|
|
|
|
|
name.second = "den Dekker";
|
|
|
|
|
}
|
|
|
|
|
|
2008-08-18 20:39:18 +08:00
|
|
|
|
if (name.first=="Jeoen" && name.second=="den")
|
|
|
|
|
{
|
|
|
|
|
name.first = "Jeoen";
|
|
|
|
|
name.second = "den Dekker";
|
|
|
|
|
}
|
|
|
|
|
|
2008-05-31 05:23:49 +08:00
|
|
|
|
if (name.first=="John" && name.second=="Vidar")
|
|
|
|
|
{
|
|
|
|
|
name.first = "John";
|
|
|
|
|
name.second = "Vidar Larring";
|
|
|
|
|
}
|
|
|
|
|
|
2008-10-08 21:18:14 +08:00
|
|
|
|
if (name.first=="John" && name.second=="Vida")
|
|
|
|
|
{
|
|
|
|
|
name.first = "John";
|
|
|
|
|
name.second = "Vidar Larring";
|
|
|
|
|
}
|
|
|
|
|
|
2008-05-12 20:16:14 +08:00
|
|
|
|
if (name.first=="Sebastien" && name.second=="Messerschmidt")
|
|
|
|
|
{
|
|
|
|
|
name.first = "Sebastian";
|
|
|
|
|
name.second = "Messerschmidt";
|
|
|
|
|
}
|
|
|
|
|
|
2008-04-11 22:33:24 +08:00
|
|
|
|
if ((name.first=="Jose" || name.first=="Jos<EFBFBD>") && name.second=="Delport")
|
|
|
|
|
{
|
|
|
|
|
name.first = "J.P.";
|
|
|
|
|
name.second = "Delport";
|
|
|
|
|
}
|
2008-03-14 19:53:44 +08:00
|
|
|
|
if (name.first=="Franz" && name.second=="Melchior")
|
|
|
|
|
{
|
|
|
|
|
name.first = "Melchior";
|
|
|
|
|
name.second = "Franz";
|
|
|
|
|
}
|
2008-01-30 06:14:26 +08:00
|
|
|
|
if (name.first=="Glen" && name.second=="Waldon")
|
|
|
|
|
{
|
|
|
|
|
name.first = "Glenn";
|
|
|
|
|
name.second = "Waldron";
|
|
|
|
|
}
|
2007-12-18 05:52:29 +08:00
|
|
|
|
if (name.first=="Ralf" && name.second=="Karn")
|
|
|
|
|
{
|
|
|
|
|
name.first = "Ralf";
|
|
|
|
|
name.second = "Kern";
|
|
|
|
|
}
|
|
|
|
|
if (name.first=="Donny" && name.second=="Cipperly")
|
|
|
|
|
{
|
|
|
|
|
name.first = "Donald";
|
|
|
|
|
name.second = "Cipperly";
|
|
|
|
|
}
|
2008-08-18 20:39:18 +08:00
|
|
|
|
if (name.first=="Gino" && name.second=="van")
|
2007-12-18 05:52:29 +08:00
|
|
|
|
{
|
|
|
|
|
name.first = "Gino";
|
|
|
|
|
name.second = "van den Bergen";
|
|
|
|
|
}
|
2007-10-04 07:44:24 +08:00
|
|
|
|
if (name.first=="Radu" && name.second=="Mihai")
|
|
|
|
|
{
|
|
|
|
|
name.first = "Mihai";
|
|
|
|
|
name.second = "Radu";
|
|
|
|
|
}
|
2007-09-12 18:43:49 +08:00
|
|
|
|
if (name.first=="Art" && name.second=="Trevs")
|
|
|
|
|
{
|
|
|
|
|
name.first = "Art";
|
|
|
|
|
name.second = "Tevs";
|
|
|
|
|
}
|
2007-08-06 19:50:40 +08:00
|
|
|
|
if (name.first=="Tim" && name.second=="More")
|
|
|
|
|
{
|
|
|
|
|
name.first = "Tim";
|
|
|
|
|
name.second = "Moore";
|
|
|
|
|
}
|
2007-07-09 19:37:06 +08:00
|
|
|
|
if (name.first=="Andre" && name.second=="Garneau")
|
|
|
|
|
{
|
|
|
|
|
name.first = "Andr<EFBFBD>";
|
|
|
|
|
name.second = "Garneau";
|
|
|
|
|
}
|
2005-11-15 01:07:11 +08:00
|
|
|
|
if (name.first=="Eric" && name.second=="Hammil")
|
|
|
|
|
{
|
|
|
|
|
name.first = "Chris";
|
|
|
|
|
name.second = "Hanson";
|
|
|
|
|
}
|
2005-12-16 04:56:06 +08:00
|
|
|
|
if (name.first=="Paul" && name.second=="de")
|
|
|
|
|
{
|
|
|
|
|
name.first = "Paul";
|
2006-07-06 21:06:24 +08:00
|
|
|
|
name.second = "de Repentigny";
|
2005-12-16 04:56:06 +08:00
|
|
|
|
}
|
2008-05-08 23:14:13 +08:00
|
|
|
|
if (name.first=="Raymond" && name.second=="de")
|
|
|
|
|
{
|
|
|
|
|
name.first = "Raymond";
|
|
|
|
|
name.second = "de Vries";
|
|
|
|
|
}
|
2005-11-15 01:21:49 +08:00
|
|
|
|
if (name.first=="Nick" && name.second=="")
|
|
|
|
|
{
|
|
|
|
|
name.first = "Trajce";
|
|
|
|
|
name.second = "Nikolov";
|
|
|
|
|
}
|
2006-07-15 05:02:02 +08:00
|
|
|
|
if (name.first=="Daniel" && name.second=="")
|
|
|
|
|
{
|
|
|
|
|
name.first = "Daniel";
|
|
|
|
|
name.second = "Sj<EFBFBD>lie";
|
|
|
|
|
}
|
2005-11-15 01:21:49 +08:00
|
|
|
|
if (name.first=="Julia" && name.second=="Ortiz")
|
|
|
|
|
{
|
|
|
|
|
name.first = "Julian";
|
|
|
|
|
name.second = "Ortiz";
|
|
|
|
|
}
|
2005-11-15 04:51:28 +08:00
|
|
|
|
if (name.first=="Rune" && name.second=="Schmidt")
|
|
|
|
|
{
|
|
|
|
|
name.first = "Rune";
|
|
|
|
|
name.second = "Schmidt Jensen";
|
|
|
|
|
}
|
|
|
|
|
if (name.first=="Romano" && name.second=="Jos<EFBFBD>")
|
|
|
|
|
{
|
|
|
|
|
name.first = "Romano";
|
|
|
|
|
name.second = "Jos<EFBFBD> Magacho da Silva";
|
|
|
|
|
}
|
|
|
|
|
if (name.first=="Rommano" && name.second=="Silva")
|
|
|
|
|
{
|
|
|
|
|
name.first = "Romano";
|
|
|
|
|
name.second = "Jos<EFBFBD> Magacho da Silva";
|
|
|
|
|
}
|
2005-11-15 05:40:28 +08:00
|
|
|
|
if (name.first=="Leandro" && name.second=="Motta")
|
|
|
|
|
{
|
|
|
|
|
name.first = "Leandro";
|
|
|
|
|
name.second = "Motta Barros";
|
|
|
|
|
}
|
|
|
|
|
if (name.first=="A" && name.second=="Botorabi")
|
|
|
|
|
{
|
|
|
|
|
name.first = "Ali";
|
|
|
|
|
name.second = "Botorabi";
|
|
|
|
|
}
|
2005-11-15 18:05:31 +08:00
|
|
|
|
|
|
|
|
|
if (name.first=="Waltice" && name.second=="")
|
|
|
|
|
{
|
|
|
|
|
name.first = "Walter";
|
|
|
|
|
name.second = "J. Altice";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (name.first=="Drew" && name.second=="")
|
|
|
|
|
{
|
|
|
|
|
name.first = "Drew";
|
|
|
|
|
name.second = "Whitehouse";
|
|
|
|
|
}
|
2005-11-16 20:07:21 +08:00
|
|
|
|
if (name.first=="Douglas" && name.second=="A")
|
|
|
|
|
{
|
|
|
|
|
name.first = "Douglas";
|
|
|
|
|
name.second = "A. Pouk";
|
|
|
|
|
}
|
2006-07-11 17:06:31 +08:00
|
|
|
|
if (name.first=="Colin" && name.second=="MacDonald")
|
|
|
|
|
{
|
|
|
|
|
name.first = "Colin";
|
|
|
|
|
name.second = "McDonald";
|
|
|
|
|
}
|
2006-07-13 21:00:22 +08:00
|
|
|
|
if (name.first=="Nikolov" && name.second=="Trajce")
|
|
|
|
|
{
|
|
|
|
|
name.first = "Trajce";
|
|
|
|
|
name.second = "Nikolov";
|
|
|
|
|
}
|
2007-08-13 19:59:19 +08:00
|
|
|
|
if (name.first=="Frauciel" && name.second=="Luc")
|
|
|
|
|
{
|
|
|
|
|
name.first = "Luc";
|
|
|
|
|
name.second = "Frauciel";
|
|
|
|
|
}
|
2005-11-15 01:07:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void lastValidCharacter(const std::string& name, unsigned int& pos,char c)
|
|
|
|
|
{
|
|
|
|
|
for(unsigned int i=0;i<pos;++i)
|
|
|
|
|
{
|
|
|
|
|
if (name[i]==c)
|
|
|
|
|
{
|
|
|
|
|
pos = i;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void lastValidCharacter(const std::string& name, unsigned int& last)
|
|
|
|
|
{
|
|
|
|
|
lastValidCharacter(name, last, '.');
|
|
|
|
|
lastValidCharacter(name, last, ',');
|
|
|
|
|
lastValidCharacter(name, last, '\'');
|
|
|
|
|
lastValidCharacter(name, last, '/');
|
|
|
|
|
lastValidCharacter(name, last, '\\');
|
|
|
|
|
lastValidCharacter(name, last, ':');
|
|
|
|
|
lastValidCharacter(name, last, ';');
|
|
|
|
|
lastValidCharacter(name, last, ')');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
NamePair createName(const std::string& first, const std::string& second)
|
2005-03-13 09:47:46 +08:00
|
|
|
|
{
|
2005-11-15 01:07:11 +08:00
|
|
|
|
if (first.empty()) return EmptyNamePair;
|
|
|
|
|
|
2008-08-18 20:39:18 +08:00
|
|
|
|
// osg::notify(osg::NOTICE)<<"first = "<<first<<" second = "<<second<<std::endl;
|
|
|
|
|
|
2005-11-15 01:07:11 +08:00
|
|
|
|
unsigned int last = first.size();
|
|
|
|
|
lastValidCharacter(first, last);
|
|
|
|
|
|
|
|
|
|
if (last==0) return EmptyNamePair;
|
|
|
|
|
|
|
|
|
|
std::string name;
|
|
|
|
|
|
|
|
|
|
name.append(first.begin(), first.begin()+last);
|
|
|
|
|
|
|
|
|
|
if (!validName(name)) return EmptyNamePair;
|
|
|
|
|
|
|
|
|
|
name = typoCorrection(name);
|
|
|
|
|
|
2005-11-15 18:05:31 +08:00
|
|
|
|
if (second.empty() ||
|
|
|
|
|
!validName(second))
|
|
|
|
|
{
|
|
|
|
|
// filter any single or two letter words as unlike to be names.
|
|
|
|
|
if (name.size()<=2) return EmptyNamePair;
|
|
|
|
|
|
|
|
|
|
return NamePair(name,"");
|
|
|
|
|
}
|
2005-11-15 01:07:11 +08:00
|
|
|
|
|
|
|
|
|
last = second.size();
|
|
|
|
|
|
|
|
|
|
lastValidCharacter(second, last);
|
|
|
|
|
|
|
|
|
|
if (last>0)
|
|
|
|
|
{
|
|
|
|
|
std::string surname(second.begin(), second.begin()+last);
|
2005-11-15 23:07:17 +08:00
|
|
|
|
|
|
|
|
|
if (validName(surname))
|
|
|
|
|
{
|
|
|
|
|
surname = typoCorrection(surname);
|
|
|
|
|
return NamePair(name, surname);
|
|
|
|
|
}
|
2005-11-15 01:07:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
2005-11-15 18:05:31 +08:00
|
|
|
|
// filter any single or two letter words as unlike to be names.
|
|
|
|
|
if (name.size()<=2) return EmptyNamePair;
|
|
|
|
|
|
2005-11-15 01:07:11 +08:00
|
|
|
|
return NamePair(name,"");
|
|
|
|
|
}
|
|
|
|
|
|
2005-11-15 04:51:28 +08:00
|
|
|
|
bool submissionsSequence(const Words& words, unsigned int& i)
|
2005-11-15 01:07:11 +08:00
|
|
|
|
{
|
2005-11-15 04:51:28 +08:00
|
|
|
|
if (i+1>=words.size()) return false;
|
|
|
|
|
|
|
|
|
|
if (words[i]=="From" ||
|
|
|
|
|
words[i]=="from" ||
|
|
|
|
|
words[i]=="From:" ||
|
|
|
|
|
words[i]=="from:" ||
|
|
|
|
|
words[i]=="Merged" ||
|
|
|
|
|
words[i]=="Integrated") return true;
|
|
|
|
|
|
|
|
|
|
if (i+2>=words.size()) return false;
|
|
|
|
|
|
|
|
|
|
if (words[i]=="submitted" && words[i+1]=="by")
|
|
|
|
|
{
|
|
|
|
|
i+=1;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (words[i]=="Folded" && words[i+1]=="in")
|
|
|
|
|
{
|
|
|
|
|
i+=1;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2005-11-15 23:07:17 +08:00
|
|
|
|
if (words[i]=="Rolled" && words[i+1]=="in")
|
|
|
|
|
{
|
|
|
|
|
i+=1;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2005-11-15 04:51:28 +08:00
|
|
|
|
if (words[i]=="Checked" && words[i+1]=="in")
|
|
|
|
|
{
|
|
|
|
|
i+=1;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (i+3>=words.size()) return false;
|
2005-11-15 01:07:11 +08:00
|
|
|
|
|
2005-11-15 04:51:28 +08:00
|
|
|
|
if (words[i]=="sent" && words[i+1]=="in" && words[i+2]=="by")
|
|
|
|
|
{
|
|
|
|
|
i+=2;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2005-11-15 05:40:28 +08:00
|
|
|
|
|
2005-11-15 04:51:28 +08:00
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2005-11-15 23:07:17 +08:00
|
|
|
|
void readContributors(NameMap& names, const std::string& file)
|
2005-11-15 04:51:28 +08:00
|
|
|
|
{
|
2008-11-07 23:08:08 +08:00
|
|
|
|
osgDB::ifstream fin(file.c_str());
|
2005-11-15 01:07:11 +08:00
|
|
|
|
|
|
|
|
|
Words words;
|
|
|
|
|
while(fin)
|
|
|
|
|
{
|
|
|
|
|
std::string keyword;
|
|
|
|
|
fin >> keyword;
|
|
|
|
|
words.push_back(keyword);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::string blank_string;
|
|
|
|
|
|
|
|
|
|
for(unsigned int i=0; i< words.size(); ++i)
|
|
|
|
|
{
|
2005-11-15 04:51:28 +08:00
|
|
|
|
if (submissionsSequence(words,i))
|
2005-11-15 01:07:11 +08:00
|
|
|
|
{
|
|
|
|
|
if (i+2<words.size() && validName(words[i+1]))
|
|
|
|
|
{
|
|
|
|
|
NamePair name = createName(words[i+1], words[i+2]);
|
|
|
|
|
nameCorrection(name);
|
2005-11-15 23:07:17 +08:00
|
|
|
|
if (!name.first.empty()) ++names[name];
|
2005-11-15 01:07:11 +08:00
|
|
|
|
i+=2;
|
|
|
|
|
}
|
|
|
|
|
else if (i+1<words.size() && validName(words[i+1]))
|
|
|
|
|
{
|
|
|
|
|
NamePair name = createName(words[i+1], blank_string);
|
|
|
|
|
nameCorrection(name);
|
2005-11-15 23:07:17 +08:00
|
|
|
|
if (!name.first.empty()) ++names[name];
|
2005-11-15 01:07:11 +08:00
|
|
|
|
i+=1;
|
|
|
|
|
}
|
|
|
|
|
}
|
2005-11-15 23:07:17 +08:00
|
|
|
|
else
|
|
|
|
|
{
|
2008-12-13 03:19:01 +08:00
|
|
|
|
if (words[i]=="robert")
|
2005-11-15 23:07:17 +08:00
|
|
|
|
{
|
|
|
|
|
++names[NameRobertOsfield];
|
|
|
|
|
}
|
2008-12-13 03:19:01 +08:00
|
|
|
|
else if (words[i]=="don")
|
2005-11-15 23:07:17 +08:00
|
|
|
|
{
|
|
|
|
|
++names[NameDonBurns];
|
|
|
|
|
}
|
|
|
|
|
}
|
2005-11-15 01:07:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
2005-11-15 23:07:17 +08:00
|
|
|
|
// reassign fisrt name entries to their full names entries
|
2005-11-15 01:07:11 +08:00
|
|
|
|
if (names.size()>1)
|
|
|
|
|
{
|
2005-11-15 23:07:17 +08:00
|
|
|
|
for(NameMap::iterator itr = names.begin();
|
2005-11-15 01:07:11 +08:00
|
|
|
|
itr != names.end();
|
|
|
|
|
)
|
|
|
|
|
{
|
2005-11-15 23:07:17 +08:00
|
|
|
|
if (itr->first.second.empty())
|
2005-11-15 01:07:11 +08:00
|
|
|
|
{
|
2005-11-15 23:07:17 +08:00
|
|
|
|
NameMap::iterator next_itr = itr;
|
2005-11-15 01:07:11 +08:00
|
|
|
|
++next_itr;
|
|
|
|
|
|
2005-11-15 23:07:17 +08:00
|
|
|
|
if (next_itr!=names.end() && itr->first.first==next_itr->first.first)
|
2005-11-15 01:07:11 +08:00
|
|
|
|
{
|
2005-11-15 23:07:17 +08:00
|
|
|
|
next_itr->second += itr->second;
|
2005-11-15 01:07:11 +08:00
|
|
|
|
names.erase(itr);
|
|
|
|
|
itr = next_itr;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
++itr;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
++itr;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2005-11-15 23:07:17 +08:00
|
|
|
|
|
|
|
|
|
// remove the double entries from Robert's contributions
|
|
|
|
|
if (names.size()>1)
|
|
|
|
|
{
|
|
|
|
|
for(NameMap::iterator itr = names.begin();
|
|
|
|
|
itr != names.end();
|
|
|
|
|
++itr)
|
|
|
|
|
{
|
|
|
|
|
if (itr->first != NameRobertOsfield && itr->first != NameDonBurns )
|
|
|
|
|
{
|
|
|
|
|
names[NameRobertOsfield] -= itr->second;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2005-11-15 01:07:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
2005-11-15 23:07:17 +08:00
|
|
|
|
void buildContributors(NameMap& names)
|
2005-11-15 01:07:11 +08:00
|
|
|
|
{
|
2005-11-15 23:07:17 +08:00
|
|
|
|
// top five contributors
|
|
|
|
|
++names[NamePair("Robert","Osfield")];
|
|
|
|
|
++names[NamePair("Don","Burns")];
|
|
|
|
|
++names[NamePair("Marco","Jez")];
|
|
|
|
|
++names[NamePair("Mike","Weiblen")];
|
2005-11-16 20:07:21 +08:00
|
|
|
|
++names[NamePair("Geoff","Michel")];
|
2007-08-14 20:47:26 +08:00
|
|
|
|
++names[NamePair("Ben","van Basten")];
|
2005-11-15 23:07:17 +08:00
|
|
|
|
|
|
|
|
|
// contributors that don't appear in the ChangeLog due to their contributions
|
|
|
|
|
// being before CVS started for the OSG, or before the name logging began.
|
|
|
|
|
++names[NamePair("Karsten","Weiss")];
|
|
|
|
|
++names[NamePair("Graeme","Harkness")];
|
|
|
|
|
++names[NamePair("Axel","Volley")];
|
|
|
|
|
++names[NamePair("Nikolaus","Hanekamp")];
|
|
|
|
|
++names[NamePair("Kristopher","Bixler")];
|
|
|
|
|
++names[NamePair("Tanguy","Fautr<EFBFBD>")];
|
|
|
|
|
++names[NamePair("J.E.","Hoffmann")];
|
2005-11-15 01:07:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int main( int argc, char **argv)
|
|
|
|
|
{
|
|
|
|
|
osg::ArgumentParser arguments(&argc,argv);
|
|
|
|
|
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options]");
|
|
|
|
|
arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information");
|
2005-11-15 23:07:17 +08:00
|
|
|
|
arguments.getApplicationUsage()->addCommandLineOption("--entries","Print out number of entries into the ChangeLog file for each contributor.");
|
2007-04-23 05:40:46 +08:00
|
|
|
|
arguments.getApplicationUsage()->addCommandLineOption("--version-number","Print out version number only");
|
2008-03-11 04:30:56 +08:00
|
|
|
|
arguments.getApplicationUsage()->addCommandLineOption("--major-number","Print out major version number only");
|
|
|
|
|
arguments.getApplicationUsage()->addCommandLineOption("--minor-number","Print out minor version number only");
|
|
|
|
|
arguments.getApplicationUsage()->addCommandLineOption("--patch-number","Print out patch version number only");
|
|
|
|
|
arguments.getApplicationUsage()->addCommandLineOption("--so-number ","Print out shared object version number only");
|
2007-09-11 18:10:43 +08:00
|
|
|
|
arguments.getApplicationUsage()->addCommandLineOption("--openthreads-version-number","Print out version number for OpenThreads only");
|
|
|
|
|
arguments.getApplicationUsage()->addCommandLineOption("--openthreads-soversion-number","Print out shared object version number for OpenThreads only");
|
2008-04-04 02:36:50 +08:00
|
|
|
|
arguments.getApplicationUsage()->addCommandLineOption("Matrix::value_type","Print the value of Matrix::value_type");
|
|
|
|
|
arguments.getApplicationUsage()->addCommandLineOption("Plane::value_type","Print the value of Plane::value_type");
|
|
|
|
|
arguments.getApplicationUsage()->addCommandLineOption("BoundingSphere::value_type","Print the value of BoundingSphere::value_type");
|
|
|
|
|
arguments.getApplicationUsage()->addCommandLineOption("BoundingBox::value_type","Print the value of BoundingBox::value_type");
|
2005-11-15 23:07:17 +08:00
|
|
|
|
arguments.getApplicationUsage()->addCommandLineOption("-r <file> or --read <file>","Read the ChangeLog to generate an estimated contributors list.");
|
2005-11-15 01:07:11 +08:00
|
|
|
|
|
2007-04-23 05:40:46 +08:00
|
|
|
|
if (arguments.read("--version-number"))
|
|
|
|
|
{
|
|
|
|
|
std::cout<<osgGetVersion()<<std::endl;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2007-09-25 20:34:01 +08:00
|
|
|
|
if (arguments.read("--major-number"))
|
|
|
|
|
{
|
|
|
|
|
std::cout<<OPENSCENEGRAPH_MAJOR_VERSION<<std::endl;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (arguments.read("--minor-number"))
|
|
|
|
|
{
|
|
|
|
|
std::cout<<OPENSCENEGRAPH_MINOR_VERSION<<std::endl;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (arguments.read("--patch-number"))
|
|
|
|
|
{
|
|
|
|
|
std::cout<<OPENSCENEGRAPH_PATCH_VERSION<<std::endl;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2008-03-11 04:30:56 +08:00
|
|
|
|
if (arguments.read("--soversion-number") || arguments.read("--so-number") )
|
2007-09-11 18:10:43 +08:00
|
|
|
|
{
|
|
|
|
|
std::cout<<osgGetSOVersion()<<std::endl;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2007-09-25 20:34:01 +08:00
|
|
|
|
|
2007-09-11 18:10:43 +08:00
|
|
|
|
if (arguments.read("--openthreads-version-number"))
|
|
|
|
|
{
|
|
|
|
|
std::cout<<OpenThreadsGetVersion()<<std::endl;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2007-09-25 20:34:01 +08:00
|
|
|
|
|
|
|
|
|
if (arguments.read("--openthreads-major-number"))
|
|
|
|
|
{
|
|
|
|
|
std::cout<<OPENTHREADS_MAJOR_VERSION<<std::endl;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (arguments.read("--openthreads-minor-number"))
|
|
|
|
|
{
|
|
|
|
|
std::cout<<OPENTHREADS_MINOR_VERSION<<std::endl;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (arguments.read("--openthreads-patch-number"))
|
|
|
|
|
{
|
|
|
|
|
std::cout<<OPENTHREADS_PATCH_VERSION<<std::endl;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2007-09-11 18:10:43 +08:00
|
|
|
|
if (arguments.read("--openthreads-soversion-number"))
|
|
|
|
|
{
|
|
|
|
|
std::cout<<OpenThreadsGetSOVersion()<<std::endl;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
2008-04-04 02:36:50 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (arguments.read("Matrix::value_type"))
|
|
|
|
|
{
|
|
|
|
|
std::cout<<((sizeof(osg::Matrix::value_type)==4)?"float":"double")<<std::endl;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (arguments.read("Plane::value_type"))
|
|
|
|
|
{
|
|
|
|
|
std::cout<<((sizeof(osg::Plane::value_type)==4)?"float":"double")<<std::endl;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (arguments.read("BoundingSphere::value_type"))
|
|
|
|
|
{
|
|
|
|
|
std::cout<<((sizeof(osg::BoundingSphere::value_type)==4)?"float":"double")<<std::endl;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
if (arguments.read("BoundingBox::value_type"))
|
|
|
|
|
{
|
|
|
|
|
std::cout<<((sizeof(osg::BoundingBox::value_type)==4)?"float":"double")<<std::endl;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
2007-09-11 18:10:43 +08:00
|
|
|
|
|
2005-11-15 04:51:28 +08:00
|
|
|
|
std::cout<<osgGetLibraryName()<< " "<< osgGetVersion()<<std::endl<<std::endl;
|
2005-11-15 01:07:11 +08:00
|
|
|
|
|
|
|
|
|
bool printContributors = false;
|
2005-11-15 23:07:17 +08:00
|
|
|
|
bool printNumEntries = false;
|
|
|
|
|
while ( arguments.read("--entries"))
|
|
|
|
|
{
|
|
|
|
|
printContributors = true;
|
|
|
|
|
printNumEntries = true;
|
|
|
|
|
}
|
2005-11-15 01:07:11 +08:00
|
|
|
|
|
|
|
|
|
std::string changeLog;
|
|
|
|
|
while ( arguments.read("-r",changeLog) || arguments.read("--read",changeLog)) printContributors = true;
|
|
|
|
|
|
|
|
|
|
// if user request help write it out to cout.
|
|
|
|
|
if (arguments.read("-h") || arguments.read("--help"))
|
|
|
|
|
{
|
|
|
|
|
std::cout<<arguments.getApplicationUsage()->getCommandLineUsage()<<std::endl;
|
|
|
|
|
arguments.getApplicationUsage()->write(std::cout,arguments.getApplicationUsage()->getCommandLineOptions());
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (printContributors)
|
|
|
|
|
{
|
2005-11-15 23:07:17 +08:00
|
|
|
|
NameMap names;
|
2005-11-15 01:07:11 +08:00
|
|
|
|
buildContributors(names);
|
|
|
|
|
if (!changeLog.empty())
|
|
|
|
|
{
|
|
|
|
|
readContributors(names, changeLog);
|
|
|
|
|
}
|
|
|
|
|
|
2005-11-15 23:07:17 +08:00
|
|
|
|
typedef std::multimap<unsigned int, NamePair> SortedNameMap;
|
|
|
|
|
|
|
|
|
|
SortedNameMap sortedNames;
|
|
|
|
|
for(NameMap::iterator itr = names.begin();
|
2005-11-15 01:07:11 +08:00
|
|
|
|
itr != names.end();
|
|
|
|
|
++itr)
|
|
|
|
|
{
|
2005-11-15 23:07:17 +08:00
|
|
|
|
sortedNames.insert(SortedNameMap::value_type(itr->second, itr->first));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::cout<<names.size()<<" Contributors:"<<std::endl<<std::endl;
|
|
|
|
|
|
|
|
|
|
if (printNumEntries)
|
|
|
|
|
{
|
|
|
|
|
std::cout<<"Entries Firstname Surname"<<std::endl;
|
|
|
|
|
std::cout<<"-------------------------"<<std::endl;
|
|
|
|
|
for(SortedNameMap::reverse_iterator sitr = sortedNames.rbegin();
|
|
|
|
|
sitr != sortedNames.rend();
|
|
|
|
|
++sitr)
|
|
|
|
|
{
|
|
|
|
|
std::cout<<sitr->first<<"\t"<<sitr->second.first<<" "<<sitr->second.second<<std::endl;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
std::cout<<"Firstname Surname"<<std::endl;
|
|
|
|
|
std::cout<<"-----------------"<<std::endl;
|
|
|
|
|
for(SortedNameMap::reverse_iterator sitr = sortedNames.rbegin();
|
|
|
|
|
sitr != sortedNames.rend();
|
|
|
|
|
++sitr)
|
|
|
|
|
{
|
|
|
|
|
std::cout<<sitr->second.first<<" "<<sitr->second.second<<std::endl;
|
|
|
|
|
}
|
2005-11-15 01:07:11 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2005-03-13 09:47:46 +08:00
|
|
|
|
return 0;
|
|
|
|
|
}
|