| 1 | #include <osg/Notify> |
|---|
| 2 | #include <osg/Version> |
|---|
| 3 | #include <osg/ArgumentParser> |
|---|
| 4 | #include <osg/ApplicationUsage> |
|---|
| 5 | |
|---|
| 6 | #include <osg/Matrix> |
|---|
| 7 | #include <osg/Plane> |
|---|
| 8 | #include <osg/BoundingBox> |
|---|
| 9 | #include <osg/BoundingSphere> |
|---|
| 10 | |
|---|
| 11 | #include <osgDB/fstream> |
|---|
| 12 | |
|---|
| 13 | #include <OpenThreads/Version> |
|---|
| 14 | |
|---|
| 15 | #include <set> |
|---|
| 16 | #include <vector> |
|---|
| 17 | #include <iostream> |
|---|
| 18 | |
|---|
| 19 | |
|---|
| 20 | |
|---|
| 21 | |
|---|
| 22 | |
|---|
| 23 | #if defined(_MSC_VER) |
|---|
| 24 | #pragma setlocale("C") |
|---|
| 25 | #endif |
|---|
| 26 | |
|---|
| 27 | typedef std::pair<std::string, std::string> NamePair; |
|---|
| 28 | typedef std::map<NamePair,unsigned int> NameMap; |
|---|
| 29 | typedef std::vector< std::string > Words; |
|---|
| 30 | |
|---|
| 31 | NamePair EmptyNamePair; |
|---|
| 32 | NamePair NameRobertOsfield("Robert","Osfield"); |
|---|
| 33 | NamePair NameDonBurns("Don","Burns"); |
|---|
| 34 | |
|---|
| 35 | bool validName(const std::string& first) |
|---|
| 36 | { |
|---|
| 37 | if (first=="de") return true; |
|---|
| 38 | if (first=="den") return true; |
|---|
| 39 | if (first=="van") return true; |
|---|
| 40 | |
|---|
| 41 | |
|---|
| 42 | if (first.empty()) return false; |
|---|
| 43 | if (first[0]<'A' || first[0]>'Z') return false; |
|---|
| 44 | |
|---|
| 45 | if (first.size()>=2 && (first[1]<'a' || first[1]>'z') && (first[1]!='.') && (first[1]!=',')) return false; |
|---|
| 46 | |
|---|
| 47 | if (first=="Xcode") return false; |
|---|
| 48 | if (first=="Added") return false; |
|---|
| 49 | if (first=="Camera") return false; |
|---|
| 50 | if (first=="CameraNode") return false; |
|---|
| 51 | if (first=="CopyOp") return false; |
|---|
| 52 | if (first=="Fixed") return false; |
|---|
| 53 | if (first=="View") return false; |
|---|
| 54 | if (first=="GraphicsContext") return false; |
|---|
| 55 | if (first=="WindowData") return false; |
|---|
| 56 | if (first=="ViewPoint") return false; |
|---|
| 57 | if (first=="PickHandler") return false; |
|---|
| 58 | if (first=="Program") return false; |
|---|
| 59 | if (first=="Object") return false; |
|---|
| 60 | if (first=="OpenSceneGraph") return false; |
|---|
| 61 | if (first=="SpotExponent") return false; |
|---|
| 62 | if (first=="Framstamp") return false; |
|---|
| 63 | if (first=="Stats") return false; |
|---|
| 64 | if (first=="Group") return false; |
|---|
| 65 | if (first=="Texture") return false; |
|---|
| 66 | if (first=="Texture2DArray") return false; |
|---|
| 67 | if (first=="Creator") return false; |
|---|
| 68 | if (first=="CullVisitor") return false; |
|---|
| 69 | if (first=="Drawable") return false; |
|---|
| 70 | if (first=="Geode") return false; |
|---|
| 71 | if (first=="GeoSet") return false; |
|---|
| 72 | if (first=="Image") return false; |
|---|
| 73 | if (first=="Face") return false; |
|---|
| 74 | if (first=="Images/SolarSystem") return false; |
|---|
| 75 | if (first=="IntersectVisitor") return false; |
|---|
| 76 | if (first=="LongIDRecord") return false; |
|---|
| 77 | if (first=="Makefile") return false; |
|---|
| 78 | if (first=="Matrix") return false; |
|---|
| 79 | if (first=="MemoryManager") return false; |
|---|
| 80 | if (first=="MeshRecord") return false; |
|---|
| 81 | if (first=="Multigen") return false; |
|---|
| 82 | if (first=="NewCullVisitor") return false; |
|---|
| 83 | if (first=="Output") return false; |
|---|
| 84 | if (first=="PageLOD") return false; |
|---|
| 85 | if (first=="Improved") return false; |
|---|
| 86 | if (first=="PagedLOD") return false; |
|---|
| 87 | if (first=="Referenced") return false; |
|---|
| 88 | if (first=="StateAttribute") return false; |
|---|
| 89 | if (first=="Switch") return false; |
|---|
| 90 | if (first=="TechniqueEventHandler") return false; |
|---|
| 91 | if (first=="Uniform") return false; |
|---|
| 92 | if (first=="Vec*") return false; |
|---|
| 93 | if (first=="Viewer") return false; |
|---|
| 94 | if (first=="VisualStudio") return false; |
|---|
| 95 | if (first=="X") return false; |
|---|
| 96 | if (first=="Y") return false; |
|---|
| 97 | if (first=="Producer") return false; |
|---|
| 98 | if (first=="New") return false; |
|---|
| 99 | if (first=="Removed") return false; |
|---|
| 100 | if (first=="Ouput") return false; |
|---|
| 101 | if (first=="ReaderWriters") return false; |
|---|
| 102 | if (first=="NodeVisitor") return false; |
|---|
| 103 | if (first=="Fixes") return false; |
|---|
| 104 | if (first=="FontImplementation") return false; |
|---|
| 105 | if (first=="DisplaySettings") return false; |
|---|
| 106 | if (first=="AnimationPath") return false; |
|---|
| 107 | if (first=="AnimationPathCallback") return false; |
|---|
| 108 | if (first=="AnimationPathManipulator") return false; |
|---|
| 109 | if (first=="ArgumentParser") return false; |
|---|
| 110 | if (first=="AttrData") return false; |
|---|
| 111 | if (first=="Azimuth") return false; |
|---|
| 112 | if (first=="CluserCullingCallback") return false; |
|---|
| 113 | if (first=="ClusterCullingCallback") return false; |
|---|
| 114 | if (first=="CoordinateSystem") return false; |
|---|
| 115 | if (first=="CoordinateSystemNode") return false; |
|---|
| 116 | if (first=="CoordinateSystemNode&") return false; |
|---|
| 117 | if (first=="Copyright") return false; |
|---|
| 118 | if (first=="Cygwin") return false; |
|---|
| 119 | if (first=="CullCallbacks") return false; |
|---|
| 120 | if (first=="CullingSettngs") return false; |
|---|
| 121 | if (first=="DataVariance") return false; |
|---|
| 122 | if (first=="DatabasePager") return false; |
|---|
| 123 | if (first=="DrawElementsUByte") return false; |
|---|
| 124 | if (first=="Escape") return false; |
|---|
| 125 | if (first=="FluidProgram") return false; |
|---|
| 126 | if (first=="FrameStats") return false; |
|---|
| 127 | if (first=="FreeBSD") return false; |
|---|
| 128 | if (first=="GraphicsContextImplementation") return false; |
|---|
| 129 | if (first=="GraphicsThread") return false; |
|---|
| 130 | if (first=="Images") return false; |
|---|
| 131 | if (first=="IndexBlock") return false; |
|---|
| 132 | if (first=="Inventor") return false; |
|---|
| 133 | if (first=="Make") return false; |
|---|
| 134 | if (first=="Material") return false; |
|---|
| 135 | if (first=="MergeGeometryVisitor") return false; |
|---|
| 136 | if (first=="Mode") return false; |
|---|
| 137 | if (first=="Prodcuer") return false; |
|---|
| 138 | if (first=="ProxyNode") return false; |
|---|
| 139 | if (first=="ReentrantMutex") return false; |
|---|
| 140 | if (first=="ReferenceFrame") return false; |
|---|
| 141 | if (first=="RemoveLoadedProxyNodes") return false; |
|---|
| 142 | if (first=="RenderTargetFallback") return false; |
|---|
| 143 | if (first=="RenderToTextureStage") return false; |
|---|
| 144 | if (first=="Sequence") return false; |
|---|
| 145 | if (first=="Shape") return false; |
|---|
| 146 | if (first=="TessellationHints") return false; |
|---|
| 147 | if (first=="Support") return false; |
|---|
| 148 | if (first=="State") return false; |
|---|
| 149 | if (first=="SmokeTrailEffect") return false; |
|---|
| 150 | if (first=="TexEnv") return false; |
|---|
| 151 | if (first=="Texture3D") return false; |
|---|
| 152 | if (first=="TextureCubeMap") return false; |
|---|
| 153 | if (first=="TextureObjectManager") return false; |
|---|
| 154 | if (first=="TextureRectangle(Image*") return false; |
|---|
| 155 | if (first=="TextureType") return false; |
|---|
| 156 | if (first=="Texuture") return false; |
|---|
| 157 | if (first=="TriStripVisitor") return false; |
|---|
| 158 | if (first=="UserData") return false; |
|---|
| 159 | if (first=="Viewport") return false; |
|---|
| 160 | if (first=="Visual") return false; |
|---|
| 161 | if (first=="Studio") return false; |
|---|
| 162 | if (first=="Vec2d") return false; |
|---|
| 163 | if (first=="Vec3d") return false; |
|---|
| 164 | if (first=="Windows") return false; |
|---|
| 165 | if (first=="Version") return false; |
|---|
| 166 | if (first=="Viewport") return false; |
|---|
| 167 | if (first=="Core") return false; |
|---|
| 168 | if (first=="DataSet") return false; |
|---|
| 169 | if (first=="Endian") return false; |
|---|
| 170 | if (first=="ImageOptions") return false; |
|---|
| 171 | if (first=="ImageStream") return false; |
|---|
| 172 | if (first=="KeyboardMouse") return false; |
|---|
| 173 | if (first=="KeyboardMouseCallback") return false; |
|---|
| 174 | if (first=="AutoTransform") return false; |
|---|
| 175 | if (first=="AutoTransform.") return false; |
|---|
| 176 | if (first=="LightModel") return false; |
|---|
| 177 | if (first=="MatrixManipulator") return false; |
|---|
| 178 | if (first=="MatrixTransform") return false; |
|---|
| 179 | if (first=="OpenDX") return false; |
|---|
| 180 | if (first=="ParentList") return false; |
|---|
| 181 | if (first=="TerraPage") return false; |
|---|
| 182 | if (first=="OveralyNode") return false; |
|---|
| 183 | if (first=="OpenThreads") return false; |
|---|
| 184 | if (first=="PolygonStipple") return false; |
|---|
| 185 | if (first=="SceneView") return false; |
|---|
| 186 | if (first=="PrimitiveIndexFunctor") return false; |
|---|
| 187 | if (first=="PolytopeVisitor") return false; |
|---|
| 188 | if (first=="Performer") return false; |
|---|
| 189 | if (first=="Paging") return false; |
|---|
| 190 | if (first=="CameraBarrierCallback") return false; |
|---|
| 191 | if (first=="TestSupportCallback") return false; |
|---|
| 192 | if (first=="Quake3") return false; |
|---|
| 193 | if (first=="BlenColour(Vec4") return false; |
|---|
| 194 | if (first=="UseFarLineSegments") return false; |
|---|
| 195 | if (first=="TextureRectangle") return false; |
|---|
| 196 | if (first=="DeleteHandler") return false; |
|---|
| 197 | if (first=="EventQueue") return false; |
|---|
| 198 | if (first=="TrPageViewer") return false; |
|---|
| 199 | if (first=="TestManipulator") return false; |
|---|
| 200 | if (first=="ProducerEventCallback") return false; |
|---|
| 201 | if (first=="OrientationConverter") return false; |
|---|
| 202 | if (first=="Logos") return false; |
|---|
| 203 | if (first=="StatsVisitor") return false; |
|---|
| 204 | if (first=="LineStipple") return false; |
|---|
| 205 | if (first=="Files") return false; |
|---|
| 206 | if (first=="Mr") return false; |
|---|
| 207 | if (first=="Osfields") return false; |
|---|
| 208 | if (first=="Optimizer") return false; |
|---|
| 209 | if (first=="RenderStage") return false; |
|---|
| 210 | if (first=="Matrix*") return false; |
|---|
| 211 | if (first=="Vec4ub") return false; |
|---|
| 212 | if (first=="Proxy") return false; |
|---|
| 213 | if (first=="CullVistor") return false; |
|---|
| 214 | if (first=="SimpleViewer") return false; |
|---|
| 215 | if (first=="TexMat(Matrix") return false; |
|---|
| 216 | if (first=="GraphicsWindowX11") return false; |
|---|
| 217 | if (first=="OperationThread") return false; |
|---|
| 218 | if (first=="SimpleViewer") return false; |
|---|
| 219 | if (first=="IndexFaceSets") return false; |
|---|
| 220 | if (first=="Quicktime") return false; |
|---|
| 221 | if (first=="SceneGraphBuilder") return false; |
|---|
| 222 | if (first=="LightPointNode") return false; |
|---|
| 223 | if (first=="GeometryTechnique") return false; |
|---|
| 224 | if (first=="GeoemtryTechnique") return false; |
|---|
| 225 | if (first=="KdTree") return false; |
|---|
| 226 | if (first=="LineSegment") return false; |
|---|
| 227 | if (first=="Canvas") return false; |
|---|
| 228 | if (first=="OpenSceneGraph-2") return false; |
|---|
| 229 | if (first=="OpenSceneGraph-osgWidget-dev") return false; |
|---|
| 230 | if (first=="Valve") return false; |
|---|
| 231 | if (first=="Source") return false; |
|---|
| 232 | if (first=="PixelDataBufferObject") return false; |
|---|
| 233 | return true; |
|---|
| 234 | } |
|---|
| 235 | |
|---|
| 236 | std::string typoCorrection(const std::string& name) |
|---|
| 237 | { |
|---|
| 238 | #if 0 |
|---|
| 239 | if (name=="") return ""; |
|---|
| 240 | if (name=="") return ""; |
|---|
| 241 | if (name=="") return ""; |
|---|
| 242 | if (name=="") return ""; |
|---|
| 243 | #endif |
|---|
| 244 | if (name=="Aderian") return "Adrian"; |
|---|
| 245 | if (name=="Adndre") return "Andre"; |
|---|
| 246 | if (name=="Adrain") return "Adrian"; |
|---|
| 247 | if (name=="Andew") return "Andrew"; |
|---|
| 248 | if (name=="André") return "André"; |
|---|
| 249 | if (name=="Antione") return "Antoine"; |
|---|
| 250 | if (name=="Antonoine") return "Antoine"; |
|---|
| 251 | if (name=="Atr") return "Art"; |
|---|
| 252 | if (name=="Baverage") return "Beverage"; |
|---|
| 253 | if (name=="Bistroviae") return "Bistrovic"; |
|---|
| 254 | if (name=="Callue") return "Callu"; |
|---|
| 255 | if (name=="Christaiansen") return "Christiansen"; |
|---|
| 256 | if (name=="Cobin") return "Corbin"; |
|---|
| 257 | if (name=="Comporesi") return "Camporesi"; |
|---|
| 258 | if (name=="Connel") return "Connell"; |
|---|
| 259 | if (name=="Cullu") return "Callu"; |
|---|
| 260 | if (name=="Daneil") return "Daniel"; |
|---|
| 261 | if (name=="Daust") return "Daoust"; |
|---|
| 262 | if (name=="Daved") return "David"; |
|---|
| 263 | if (name=="Drederic") return "Frederic"; |
|---|
| 264 | if (name=="Eileman") return "Eilemann"; |
|---|
| 265 | if (name=="Elgi") return "Egli"; |
|---|
| 266 | if (name=="Frashid") return "Farshid"; |
|---|
| 267 | if (name=="Fred") return "Frederic"; |
|---|
| 268 | if (name=="Fredrick") return "Frederic"; |
|---|
| 269 | if (name=="Fredric") return "Frederic"; |
|---|
| 270 | if (name=="Froechlich") return "Fröhlich"; |
|---|
| 271 | if (name=="Froehilch") return "Fröhlich"; |
|---|
| 272 | if (name=="Froehlich") return "Fröhlich"; |
|---|
| 273 | if (name=="Froelich") return "Fröhlich"; |
|---|
| 274 | if (name=="Froenlich") return "Fröhlich"; |
|---|
| 275 | if (name=="Fröhlich") return "Fröhlich"; |
|---|
| 276 | if (name=="Fruciel") return "Frauciel"; |
|---|
| 277 | if (name=="GarcÃa") return "Garcea"; |
|---|
| 278 | if (name=="Garrat") return "Garrett"; |
|---|
| 279 | if (name=="Garret") return "Garrett"; |
|---|
| 280 | if (name=="Geof") return "Geoff"; |
|---|
| 281 | if (name=="Giatan") return "Gaitan"; |
|---|
| 282 | if (name=="Gronenger") return "Gronager"; |
|---|
| 283 | if (name=="Gronger") return "Gronager"; |
|---|
| 284 | if (name=="Hebelin") return "Herbelin"; |
|---|
| 285 | if (name=="Heirtlein") return "Hertlein"; |
|---|
| 286 | if (name=="Heirtlein") return "Hertlein"; |
|---|
| 287 | if (name=="Heirtlein") return "Hertlein"; |
|---|
| 288 | if (name=="Hertleinm") return "Hertlein"; |
|---|
| 289 | if (name=="Hertlien") return "Hertlein"; |
|---|
| 290 | if (name=="Hi") return "He"; |
|---|
| 291 | if (name=="Hooper") return "Hopper"; |
|---|
| 292 | if (name=="Inverson") return "Iverson"; |
|---|
| 293 | if (name=="Iversion") return "Iverson"; |
|---|
| 294 | if (name=="Jean-Sebastian") return "Jean-Sebastien"; |
|---|
| 295 | if (name=="Jean-Sebastirn") return "Jean-Sebastien"; |
|---|
| 296 | if (name=="Jea-Sebastien") return "Jean-Sebastien"; |
|---|
| 297 | if (name=="Johhansen") return "Johansen"; |
|---|
| 298 | if (name=="Johnansen") return "Johansen"; |
|---|
| 299 | if (name=="Johnasen") return "Johansen"; |
|---|
| 300 | if (name=="Jolly") return "Jolley"; |
|---|
| 301 | if (name=="Jose") return "José"; |
|---|
| 302 | if (name=="José") return "José"; |
|---|
| 303 | if (name=="Joson") return "Jason"; |
|---|
| 304 | if (name=="J") return "José"; |
|---|
| 305 | if (name=="Keuhne") return "Kuehne"; |
|---|
| 306 | if (name=="Kheune") return "Kuehne"; |
|---|
| 307 | if (name=="Lagrade") return "Lagarde"; |
|---|
| 308 | if (name=="Larshkari") return "Lashkari"; |
|---|
| 309 | if (name=="Lashakari") return "Lashkari"; |
|---|
| 310 | if (name=="Lashari") return "Lashkari"; |
|---|
| 311 | if (name=="Lasharki") return "Lashkari"; |
|---|
| 312 | if (name=="Laskari") return "Lashkari"; |
|---|
| 313 | if (name=="Leandowski" || name=="Lawandowski") return "Lewandowski"; |
|---|
| 314 | if (name=="Lucas") return "Luaces"; |
|---|
| 315 | if (name=="Lugi") return "Luigi"; |
|---|
| 316 | if (name=="Lweandowski") return "Lewandowski"; |
|---|
| 317 | if (name=="Machler") return "Mächler"; |
|---|
| 318 | if (name=="Macro") return "Marco"; |
|---|
| 319 | if (name=="Maechler") return "Mächler"; |
|---|
| 320 | if (name=="Mahai") return "Mihai"; |
|---|
| 321 | if (name=="Mammond") return "Marmond"; |
|---|
| 322 | if (name=="March") return "Marco"; |
|---|
| 323 | if (name=="Martsz") return "Martz"; |
|---|
| 324 | if (name=="Marz") return "Martz"; |
|---|
| 325 | if (name=="Matz") return "Martz"; |
|---|
| 326 | if (name=="Melchoir") return "Melchior"; |
|---|
| 327 | if (name=="Mellis") return "Melis"; |
|---|
| 328 | if (name=="Messerschimdt") return "Messerschmidt"; |
|---|
| 329 | if (name=="Micheal") return "Michael"; |
|---|
| 330 | if (name=="Mihair") return "Mihai"; |
|---|
| 331 | if (name=="Molishtan") return "Moloshtan"; |
|---|
| 332 | if (name=="Molishtan") return "Moloshtan"; |
|---|
| 333 | if (name=="Moloshton") return "Moloshtan"; |
|---|
| 334 | if (name=="Morné") return "Morné"; |
|---|
| 335 | if (name=="Morne") return "Morné"; |
|---|
| 336 | if (name=="Moule") return "Moiule"; |
|---|
| 337 | if (name=="Narache") return "Marache"; |
|---|
| 338 | if (name=="Nicklov") return "Nikolov"; |
|---|
| 339 | if (name=="Nickolov") return "Nikolov"; |
|---|
| 340 | if (name=="Olad") return "Olaf"; |
|---|
| 341 | if (name=="Olar") return "Olaf"; |
|---|
| 342 | if (name=="Oritz") return "Ortiz"; |
|---|
| 343 | if (name=="Osfeld") return "Osfield"; |
|---|
| 344 | if (name=="Osfied") return "Osfield"; |
|---|
| 345 | if (name=="Pail") return "Paul"; |
|---|
| 346 | if (name=="Rajce") return "Trajce"; |
|---|
| 347 | if (name=="Randal") return "Randall"; |
|---|
| 348 | if (name=="Robet") return "Robert"; |
|---|
| 349 | if (name=="Rodger") return "Roger"; |
|---|
| 350 | if (name=="Rolad") return "Roland"; |
|---|
| 351 | if (name=="Rucard") return "Richard"; |
|---|
| 352 | if (name=="Sekender") return "Sukender"; |
|---|
| 353 | if (name=="Sewel") return "Sewell"; |
|---|
| 354 | if (name=="Simmonson") return "Simonsson"; |
|---|
| 355 | if (name=="Simmonsson") return "Simonsson"; |
|---|
| 356 | if (name=="Sjolie") return "Sjölie"; |
|---|
| 357 | if (name=="Sjölie") return "Sjölie"; |
|---|
| 358 | if (name=="Skinnder") return "Skinner"; |
|---|
| 359 | if (name=="Sokolosky") return "Sokolowsky"; |
|---|
| 360 | if (name=="Sokolowki") return "Sokolowsky"; |
|---|
| 361 | if (name=="Sokolowski") return "Sokolowsky"; |
|---|
| 362 | if (name=="Sokolsky") return "Sokolowsky"; |
|---|
| 363 | if (name=="Sokolwsky") return "Sokolowsky"; |
|---|
| 364 | if (name=="Sonda") return "Sondra"; |
|---|
| 365 | if (name=="Stansilav") return "Stanislav"; |
|---|
| 366 | if (name=="Stefan") return "Stephan"; |
|---|
| 367 | if (name=="Stell") return "Steel"; |
|---|
| 368 | if (name=="Sylvan") return "Sylvain"; |
|---|
| 369 | if (name=="Takeahei") return "Takahei"; |
|---|
| 370 | if (name=="Takehei") return "Takahei"; |
|---|
| 371 | if (name=="Tarantilils") return "Tarantilis"; |
|---|
| 372 | if (name=="Trastenjak") return "Trstenjak"; |
|---|
| 373 | if (name=="Urlich") return "Ulrich"; |
|---|
| 374 | if (name=="Vines") return "Vine"; |
|---|
| 375 | if (name=="Waldrom") return "Waldron"; |
|---|
| 376 | if (name=="Wedner") return "Weidner"; |
|---|
| 377 | if (name=="Weidemann") return "Wiedemann"; |
|---|
| 378 | if (name=="Wieblen") return "Weiblen"; |
|---|
| 379 | if (name=="Woesnner") return "Woessner"; |
|---|
| 380 | if (name=="Wojiech" || name=="Wojchiech") return "Wojciech"; |
|---|
| 381 | if (name=="Xennon") return "Hanson"; |
|---|
| 382 | if (name=="Yefrei") return "Yefei"; |
|---|
| 383 | if (name=="Yfei") return "Yefei"; |
|---|
| 384 | if (name=="Jean-Sebastein") return "Jean-Sebastien"; |
|---|
| 385 | if (name=="Haritchablaet") return "Haritchabalet"; |
|---|
| 386 | if (name=="Fautre") return "Fautré"; |
|---|
| 387 | if (name=="Maceij") return "Maciej"; |
|---|
| 388 | if (name=="Fabian") return "Fabien"; |
|---|
| 389 | return name; |
|---|
| 390 | } |
|---|
| 391 | |
|---|
| 392 | void nameCorrection(NamePair& name) |
|---|
| 393 | { |
|---|
| 394 | if (name.first=="Mick" && name.second=="") |
|---|
| 395 | { |
|---|
| 396 | name.first = "Maik"; |
|---|
| 397 | name.second = "Keller"; |
|---|
| 398 | } |
|---|
| 399 | |
|---|
| 400 | if (name.first=="Gary" && name.second=="Quin") |
|---|
| 401 | { |
|---|
| 402 | name.first = "Gary"; |
|---|
| 403 | name.second = "Quinn"; |
|---|
| 404 | } |
|---|
| 405 | |
|---|
| 406 | if (name.first=="BjornHein" && name.second=="") |
|---|
| 407 | { |
|---|
| 408 | name.first = "Björn"; |
|---|
| 409 | name.second = "Hein"; |
|---|
| 410 | } |
|---|
| 411 | |
|---|
| 412 | if (name.first=="Mattias" && name.second=="Fröhlich") |
|---|
| 413 | { |
|---|
| 414 | name.first = "Mathias"; |
|---|
| 415 | name.second = "Fröhlich"; |
|---|
| 416 | } |
|---|
| 417 | |
|---|
| 418 | if (name.first=="Mathias" && name.second=="Helsing") |
|---|
| 419 | { |
|---|
| 420 | name.first = "Mattias"; |
|---|
| 421 | name.second = "Helsing"; |
|---|
| 422 | } |
|---|
| 423 | |
|---|
| 424 | if (name.first=="Bjorn" && name.second=="Hein") |
|---|
| 425 | { |
|---|
| 426 | name.first = "Björn"; |
|---|
| 427 | name.second = "Hein"; |
|---|
| 428 | } |
|---|
| 429 | |
|---|
| 430 | if (name.first=="Erik" && name.second=="van") |
|---|
| 431 | { |
|---|
| 432 | name.first = "Erik"; |
|---|
| 433 | name.second = "den Dekker"; |
|---|
| 434 | } |
|---|
| 435 | |
|---|
| 436 | if (name.first=="Erik" && name.second=="den") |
|---|
| 437 | { |
|---|
| 438 | name.first = "Erik"; |
|---|
| 439 | name.second = "den Dekker"; |
|---|
| 440 | } |
|---|
| 441 | |
|---|
| 442 | if (name.first=="Jeoen" && name.second=="den") |
|---|
| 443 | { |
|---|
| 444 | name.first = "Jeoen"; |
|---|
| 445 | name.second = "den Dekker"; |
|---|
| 446 | } |
|---|
| 447 | |
|---|
| 448 | if (name.first=="John" && name.second=="Vidar") |
|---|
| 449 | { |
|---|
| 450 | name.first = "John"; |
|---|
| 451 | name.second = "Vidar Larring"; |
|---|
| 452 | } |
|---|
| 453 | |
|---|
| 454 | if (name.first=="John" && name.second=="Vida") |
|---|
| 455 | { |
|---|
| 456 | name.first = "John"; |
|---|
| 457 | name.second = "Vidar Larring"; |
|---|
| 458 | } |
|---|
| 459 | |
|---|
| 460 | if (name.first=="Sebastien" && name.second=="Messerschmidt") |
|---|
| 461 | { |
|---|
| 462 | name.first = "Sebastian"; |
|---|
| 463 | name.second = "Messerschmidt"; |
|---|
| 464 | } |
|---|
| 465 | |
|---|
| 466 | if ((name.first=="Jose" || name.first=="José") && name.second=="Delport") |
|---|
| 467 | { |
|---|
| 468 | name.first = "J.P."; |
|---|
| 469 | name.second = "Delport"; |
|---|
| 470 | } |
|---|
| 471 | if (name.first=="Franz" && name.second=="Melchior") |
|---|
| 472 | { |
|---|
| 473 | name.first = "Melchior"; |
|---|
| 474 | name.second = "Franz"; |
|---|
| 475 | } |
|---|
| 476 | if (name.first=="Glen" && name.second=="Waldon") |
|---|
| 477 | { |
|---|
| 478 | name.first = "Glenn"; |
|---|
| 479 | name.second = "Waldron"; |
|---|
| 480 | } |
|---|
| 481 | if (name.first=="Ralf" && name.second=="Karn") |
|---|
| 482 | { |
|---|
| 483 | name.first = "Ralf"; |
|---|
| 484 | name.second = "Kern"; |
|---|
| 485 | } |
|---|
| 486 | if (name.first=="Donny" && name.second=="Cipperly") |
|---|
| 487 | { |
|---|
| 488 | name.first = "Donald"; |
|---|
| 489 | name.second = "Cipperly"; |
|---|
| 490 | } |
|---|
| 491 | if (name.first=="Gino" && name.second=="van") |
|---|
| 492 | { |
|---|
| 493 | name.first = "Gino"; |
|---|
| 494 | name.second = "van den Bergen"; |
|---|
| 495 | } |
|---|
| 496 | if (name.first=="Radu" && name.second=="Mihai") |
|---|
| 497 | { |
|---|
| 498 | name.first = "Mihai"; |
|---|
| 499 | name.second = "Radu"; |
|---|
| 500 | } |
|---|
| 501 | if (name.first=="Art" && name.second=="Trevs") |
|---|
| 502 | { |
|---|
| 503 | name.first = "Art"; |
|---|
| 504 | name.second = "Tevs"; |
|---|
| 505 | } |
|---|
| 506 | if (name.first=="Tim" && name.second=="More") |
|---|
| 507 | { |
|---|
| 508 | name.first = "Tim"; |
|---|
| 509 | name.second = "Moore"; |
|---|
| 510 | } |
|---|
| 511 | if (name.first=="Andre" && name.second=="Garneau") |
|---|
| 512 | { |
|---|
| 513 | name.first = "André"; |
|---|
| 514 | name.second = "Garneau"; |
|---|
| 515 | } |
|---|
| 516 | if (name.first=="Eric" && name.second=="Hammil") |
|---|
| 517 | { |
|---|
| 518 | name.first = "Chris"; |
|---|
| 519 | name.second = "Hanson"; |
|---|
| 520 | } |
|---|
| 521 | if (name.first=="Paul" && name.second=="de") |
|---|
| 522 | { |
|---|
| 523 | name.first = "Paul"; |
|---|
| 524 | name.second = "de Repentigny"; |
|---|
| 525 | } |
|---|
| 526 | if (name.first=="Raymond" && name.second=="de") |
|---|
| 527 | { |
|---|
| 528 | name.first = "Raymond"; |
|---|
| 529 | name.second = "de Vries"; |
|---|
| 530 | } |
|---|
| 531 | if (name.first=="Nick" && name.second=="") |
|---|
| 532 | { |
|---|
| 533 | name.first = "Trajce"; |
|---|
| 534 | name.second = "Nikolov"; |
|---|
| 535 | } |
|---|
| 536 | if (name.first=="Daniel" && name.second=="") |
|---|
| 537 | { |
|---|
| 538 | name.first = "Daniel"; |
|---|
| 539 | name.second = "Sjölie"; |
|---|
| 540 | } |
|---|
| 541 | if (name.first=="Julia" && name.second=="Ortiz") |
|---|
| 542 | { |
|---|
| 543 | name.first = "Julian"; |
|---|
| 544 | name.second = "Ortiz"; |
|---|
| 545 | } |
|---|
| 546 | if (name.first=="Rune" && name.second=="Schmidt") |
|---|
| 547 | { |
|---|
| 548 | name.first = "Rune"; |
|---|
| 549 | name.second = "Schmidt Jensen"; |
|---|
| 550 | } |
|---|
| 551 | if (name.first=="Romano" && name.second=="José") |
|---|
| 552 | { |
|---|
| 553 | name.first = "Romano"; |
|---|
| 554 | name.second = "José Magacho da Silva"; |
|---|
| 555 | } |
|---|
| 556 | if (name.first=="Rommano" && name.second=="Silva") |
|---|
| 557 | { |
|---|
| 558 | name.first = "Romano"; |
|---|
| 559 | name.second = "José Magacho da Silva"; |
|---|
| 560 | } |
|---|
| 561 | if (name.first=="Leandro" && name.second=="Motta") |
|---|
| 562 | { |
|---|
| 563 | name.first = "Leandro"; |
|---|
| 564 | name.second = "Motta Barros"; |
|---|
| 565 | } |
|---|
| 566 | if (name.first=="A" && name.second=="Botorabi") |
|---|
| 567 | { |
|---|
| 568 | name.first = "Ali"; |
|---|
| 569 | name.second = "Botorabi"; |
|---|
| 570 | } |
|---|
| 571 | |
|---|
| 572 | if (name.first=="Waltice" && name.second=="") |
|---|
| 573 | { |
|---|
| 574 | name.first = "Walter"; |
|---|
| 575 | name.second = "J. Altice"; |
|---|
| 576 | } |
|---|
| 577 | |
|---|
| 578 | if (name.first=="Drew" && name.second=="") |
|---|
| 579 | { |
|---|
| 580 | name.first = "Drew"; |
|---|
| 581 | name.second = "Whitehouse"; |
|---|
| 582 | } |
|---|
| 583 | if (name.first=="Douglas" && name.second=="A") |
|---|
| 584 | { |
|---|
| 585 | name.first = "Douglas"; |
|---|
| 586 | name.second = "A. Pouk"; |
|---|
| 587 | } |
|---|
| 588 | if (name.first=="Colin" && name.second=="MacDonald") |
|---|
| 589 | { |
|---|
| 590 | name.first = "Colin"; |
|---|
| 591 | name.second = "McDonald"; |
|---|
| 592 | } |
|---|
| 593 | if (name.first=="Nikolov" && name.second=="Trajce") |
|---|
| 594 | { |
|---|
| 595 | name.first = "Trajce"; |
|---|
| 596 | name.second = "Nikolov"; |
|---|
| 597 | } |
|---|
| 598 | if (name.first=="Frauciel" && name.second=="Luc") |
|---|
| 599 | { |
|---|
| 600 | name.first = "Luc"; |
|---|
| 601 | name.second = "Frauciel"; |
|---|
| 602 | } |
|---|
| 603 | } |
|---|
| 604 | |
|---|
| 605 | void lastValidCharacter(const std::string& name, unsigned int& pos,char c) |
|---|
| 606 | { |
|---|
| 607 | for(unsigned int i=0;i<pos;++i) |
|---|
| 608 | { |
|---|
| 609 | if (name[i]==c) |
|---|
| 610 | { |
|---|
| 611 | pos = i; |
|---|
| 612 | return; |
|---|
| 613 | } |
|---|
| 614 | } |
|---|
| 615 | } |
|---|
| 616 | |
|---|
| 617 | void lastValidCharacter(const std::string& name, unsigned int& last) |
|---|
| 618 | { |
|---|
| 619 | lastValidCharacter(name, last, '.'); |
|---|
| 620 | lastValidCharacter(name, last, ','); |
|---|
| 621 | lastValidCharacter(name, last, '\''); |
|---|
| 622 | lastValidCharacter(name, last, '/'); |
|---|
| 623 | lastValidCharacter(name, last, '\\'); |
|---|
| 624 | lastValidCharacter(name, last, ':'); |
|---|
| 625 | lastValidCharacter(name, last, ';'); |
|---|
| 626 | lastValidCharacter(name, last, ')'); |
|---|
| 627 | } |
|---|
| 628 | |
|---|
| 629 | |
|---|
| 630 | |
|---|
| 631 | NamePair createName(const std::string& first, const std::string& second) |
|---|
| 632 | { |
|---|
| 633 | if (first.empty()) return EmptyNamePair; |
|---|
| 634 | |
|---|
| 635 | |
|---|
| 636 | |
|---|
| 637 | unsigned int last = first.size(); |
|---|
| 638 | lastValidCharacter(first, last); |
|---|
| 639 | |
|---|
| 640 | if (last==0) return EmptyNamePair; |
|---|
| 641 | |
|---|
| 642 | std::string name; |
|---|
| 643 | |
|---|
| 644 | name.append(first.begin(), first.begin()+last); |
|---|
| 645 | |
|---|
| 646 | if (!validName(name)) return EmptyNamePair; |
|---|
| 647 | |
|---|
| 648 | name = typoCorrection(name); |
|---|
| 649 | |
|---|
| 650 | if (second.empty() || |
|---|
| 651 | !validName(second)) |
|---|
| 652 | { |
|---|
| 653 | |
|---|
| 654 | if (name.size()<=2) return EmptyNamePair; |
|---|
| 655 | |
|---|
| 656 | return NamePair(name,""); |
|---|
| 657 | } |
|---|
| 658 | |
|---|
| 659 | last = second.size(); |
|---|
| 660 | |
|---|
| 661 | lastValidCharacter(second, last); |
|---|
| 662 | |
|---|
| 663 | if (last>0) |
|---|
| 664 | { |
|---|
| 665 | std::string surname(second.begin(), second.begin()+last); |
|---|
| 666 | |
|---|
| 667 | if (validName(surname)) |
|---|
| 668 | { |
|---|
| 669 | surname = typoCorrection(surname); |
|---|
| 670 | return NamePair(name, surname); |
|---|
| 671 | } |
|---|
| 672 | } |
|---|
| 673 | |
|---|
| 674 | |
|---|
| 675 | if (name.size()<=2) return EmptyNamePair; |
|---|
| 676 | |
|---|
| 677 | return NamePair(name,""); |
|---|
| 678 | } |
|---|
| 679 | |
|---|
| 680 | bool submissionsSequence(const Words& words, unsigned int& i) |
|---|
| 681 | { |
|---|
| 682 | if (i+1>=words.size()) return false; |
|---|
| 683 | |
|---|
| 684 | if (words[i]=="From" || |
|---|
| 685 | words[i]=="from" || |
|---|
| 686 | words[i]=="From:" || |
|---|
| 687 | words[i]=="from:" || |
|---|
| 688 | words[i]=="Merged" || |
|---|
| 689 | words[i]=="Integrated") return true; |
|---|
| 690 | |
|---|
| 691 | if (i+2>=words.size()) return false; |
|---|
| 692 | |
|---|
| 693 | if (words[i]=="submitted" && words[i+1]=="by") |
|---|
| 694 | { |
|---|
| 695 | i+=1; |
|---|
| 696 | return true; |
|---|
| 697 | } |
|---|
| 698 | |
|---|
| 699 | if (words[i]=="Folded" && words[i+1]=="in") |
|---|
| 700 | { |
|---|
| 701 | i+=1; |
|---|
| 702 | return true; |
|---|
| 703 | } |
|---|
| 704 | |
|---|
| 705 | if (words[i]=="Rolled" && words[i+1]=="in") |
|---|
| 706 | { |
|---|
| 707 | i+=1; |
|---|
| 708 | return true; |
|---|
| 709 | } |
|---|
| 710 | |
|---|
| 711 | if (words[i]=="Checked" && words[i+1]=="in") |
|---|
| 712 | { |
|---|
| 713 | i+=1; |
|---|
| 714 | return true; |
|---|
| 715 | } |
|---|
| 716 | |
|---|
| 717 | if (i+3>=words.size()) return false; |
|---|
| 718 | |
|---|
| 719 | if (words[i]=="sent" && words[i+1]=="in" && words[i+2]=="by") |
|---|
| 720 | { |
|---|
| 721 | i+=2; |
|---|
| 722 | return true; |
|---|
| 723 | } |
|---|
| 724 | |
|---|
| 725 | return false; |
|---|
| 726 | } |
|---|
| 727 | |
|---|
| 728 | void readContributors(NameMap& names, const std::string& file) |
|---|
| 729 | { |
|---|
| 730 | osgDB::ifstream fin(file.c_str()); |
|---|
| 731 | |
|---|
| 732 | Words words; |
|---|
| 733 | while(fin) |
|---|
| 734 | { |
|---|
| 735 | std::string keyword; |
|---|
| 736 | fin >> keyword; |
|---|
| 737 | words.push_back(keyword); |
|---|
| 738 | } |
|---|
| 739 | |
|---|
| 740 | std::string blank_string; |
|---|
| 741 | |
|---|
| 742 | for(unsigned int i=0; i< words.size(); ++i) |
|---|
| 743 | { |
|---|
| 744 | if (submissionsSequence(words,i)) |
|---|
| 745 | { |
|---|
| 746 | if (i+2<words.size() && validName(words[i+1])) |
|---|
| 747 | { |
|---|
| 748 | NamePair name = createName(words[i+1], words[i+2]); |
|---|
| 749 | nameCorrection(name); |
|---|
| 750 | if (!name.first.empty()) ++names[name]; |
|---|
| 751 | i+=2; |
|---|
| 752 | } |
|---|
| 753 | else if (i+1<words.size() && validName(words[i+1])) |
|---|
| 754 | { |
|---|
| 755 | NamePair name = createName(words[i+1], blank_string); |
|---|
| 756 | nameCorrection(name); |
|---|
| 757 | if (!name.first.empty()) ++names[name]; |
|---|
| 758 | i+=1; |
|---|
| 759 | } |
|---|
| 760 | } |
|---|
| 761 | else |
|---|
| 762 | { |
|---|
| 763 | if (words[i]=="robert") |
|---|
| 764 | { |
|---|
| 765 | ++names[NameRobertOsfield]; |
|---|
| 766 | } |
|---|
| 767 | else if (words[i]=="don") |
|---|
| 768 | { |
|---|
| 769 | ++names[NameDonBurns]; |
|---|
| 770 | } |
|---|
| 771 | } |
|---|
| 772 | } |
|---|
| 773 | |
|---|
| 774 | |
|---|
| 775 | if (names.size()>1) |
|---|
| 776 | { |
|---|
| 777 | for(NameMap::iterator itr = names.begin(); |
|---|
| 778 | itr != names.end(); |
|---|
| 779 | ) |
|---|
| 780 | { |
|---|
| 781 | if (itr->first.second.empty()) |
|---|
| 782 | { |
|---|
| 783 | NameMap::iterator next_itr = itr; |
|---|
| 784 | ++next_itr; |
|---|
| 785 | |
|---|
| 786 | if (next_itr!=names.end() && itr->first.first==next_itr->first.first) |
|---|
| 787 | { |
|---|
| 788 | next_itr->second += itr->second; |
|---|
| 789 | names.erase(itr); |
|---|
| 790 | itr = next_itr; |
|---|
| 791 | } |
|---|
| 792 | else |
|---|
| 793 | { |
|---|
| 794 | ++itr; |
|---|
| 795 | } |
|---|
| 796 | } |
|---|
| 797 | else |
|---|
| 798 | { |
|---|
| 799 | ++itr; |
|---|
| 800 | } |
|---|
| 801 | } |
|---|
| 802 | } |
|---|
| 803 | |
|---|
| 804 | |
|---|
| 805 | if (names.size()>1) |
|---|
| 806 | { |
|---|
| 807 | for(NameMap::iterator itr = names.begin(); |
|---|
| 808 | itr != names.end(); |
|---|
| 809 | ++itr) |
|---|
| 810 | { |
|---|
| 811 | if (itr->first != NameRobertOsfield && itr->first != NameDonBurns ) |
|---|
| 812 | { |
|---|
| 813 | names[NameRobertOsfield] -= itr->second; |
|---|
| 814 | } |
|---|
| 815 | } |
|---|
| 816 | } |
|---|
| 817 | |
|---|
| 818 | |
|---|
| 819 | } |
|---|
| 820 | |
|---|
| 821 | void buildContributors(NameMap& names) |
|---|
| 822 | { |
|---|
| 823 | |
|---|
| 824 | ++names[NamePair("Robert","Osfield")]; |
|---|
| 825 | ++names[NamePair("Don","Burns")]; |
|---|
| 826 | ++names[NamePair("Marco","Jez")]; |
|---|
| 827 | ++names[NamePair("Mike","Weiblen")]; |
|---|
| 828 | ++names[NamePair("Geoff","Michel")]; |
|---|
| 829 | ++names[NamePair("Ben","van Basten")]; |
|---|
| 830 | |
|---|
| 831 | |
|---|
| 832 | |
|---|
| 833 | ++names[NamePair("Karsten","Weiss")]; |
|---|
| 834 | ++names[NamePair("Graeme","Harkness")]; |
|---|
| 835 | ++names[NamePair("Axel","Volley")]; |
|---|
| 836 | ++names[NamePair("Nikolaus","Hanekamp")]; |
|---|
| 837 | ++names[NamePair("Kristopher","Bixler")]; |
|---|
| 838 | ++names[NamePair("Tanguy","Fautré")]; |
|---|
| 839 | ++names[NamePair("J.E.","Hoffmann")]; |
|---|
| 840 | } |
|---|
| 841 | |
|---|
| 842 | int main( int argc, char **argv) |
|---|
| 843 | { |
|---|
| 844 | osg::ArgumentParser arguments(&argc,argv); |
|---|
| 845 | arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options]"); |
|---|
| 846 | arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information"); |
|---|
| 847 | arguments.getApplicationUsage()->addCommandLineOption("--entries","Print out number of entries into the ChangeLog file for each contributor."); |
|---|
| 848 | arguments.getApplicationUsage()->addCommandLineOption("--version-number","Print out version number only"); |
|---|
| 849 | arguments.getApplicationUsage()->addCommandLineOption("--major-number","Print out major version number only"); |
|---|
| 850 | arguments.getApplicationUsage()->addCommandLineOption("--minor-number","Print out minor version number only"); |
|---|
| 851 | arguments.getApplicationUsage()->addCommandLineOption("--patch-number","Print out patch version number only"); |
|---|
| 852 | arguments.getApplicationUsage()->addCommandLineOption("--so-number ","Print out shared object version number only"); |
|---|
| 853 | arguments.getApplicationUsage()->addCommandLineOption("--openthreads-version-number","Print out version number for OpenThreads only"); |
|---|
| 854 | arguments.getApplicationUsage()->addCommandLineOption("--openthreads-soversion-number","Print out shared object version number for OpenThreads only"); |
|---|
| 855 | arguments.getApplicationUsage()->addCommandLineOption("Matrix::value_type","Print the value of Matrix::value_type"); |
|---|
| 856 | arguments.getApplicationUsage()->addCommandLineOption("Plane::value_type","Print the value of Plane::value_type"); |
|---|
| 857 | arguments.getApplicationUsage()->addCommandLineOption("BoundingSphere::value_type","Print the value of BoundingSphere::value_type"); |
|---|
| 858 | arguments.getApplicationUsage()->addCommandLineOption("BoundingBox::value_type","Print the value of BoundingBox::value_type"); |
|---|
| 859 | arguments.getApplicationUsage()->addCommandLineOption("-r <file> or --read <file>","Read the ChangeLog to generate an estimated contributors list."); |
|---|
| 860 | |
|---|
| 861 | if (arguments.read("--version-number")) |
|---|
| 862 | { |
|---|
| 863 | std::cout<<osgGetVersion()<<std::endl; |
|---|
| 864 | return 0; |
|---|
| 865 | } |
|---|
| 866 | |
|---|
| 867 | if (arguments.read("--major-number")) |
|---|
| 868 | { |
|---|
| 869 | std::cout<<OPENSCENEGRAPH_MAJOR_VERSION<<std::endl; |
|---|
| 870 | return 0; |
|---|
| 871 | } |
|---|
| 872 | |
|---|
| 873 | if (arguments.read("--minor-number")) |
|---|
| 874 | { |
|---|
| 875 | std::cout<<OPENSCENEGRAPH_MINOR_VERSION<<std::endl; |
|---|
| 876 | return 0; |
|---|
| 877 | } |
|---|
| 878 | |
|---|
| 879 | if (arguments.read("--patch-number")) |
|---|
| 880 | { |
|---|
| 881 | std::cout<<OPENSCENEGRAPH_PATCH_VERSION<<std::endl; |
|---|
| 882 | return 0; |
|---|
| 883 | } |
|---|
| 884 | |
|---|
| 885 | if (arguments.read("--soversion-number") || arguments.read("--so-number") ) |
|---|
| 886 | { |
|---|
| 887 | std::cout<<osgGetSOVersion()<<std::endl; |
|---|
| 888 | return 0; |
|---|
| 889 | } |
|---|
| 890 | |
|---|
| 891 | |
|---|
| 892 | if (arguments.read("--openthreads-version-number")) |
|---|
| 893 | { |
|---|
| 894 | std::cout<<OpenThreadsGetVersion()<<std::endl; |
|---|
| 895 | return 0; |
|---|
| 896 | } |
|---|
| 897 | |
|---|
| 898 | |
|---|
| 899 | if (arguments.read("--openthreads-major-number")) |
|---|
| 900 | { |
|---|
| 901 | std::cout<<OPENTHREADS_MAJOR_VERSION<<std::endl; |
|---|
| 902 | return 0; |
|---|
| 903 | } |
|---|
| 904 | |
|---|
| 905 | if (arguments.read("--openthreads-minor-number")) |
|---|
| 906 | { |
|---|
| 907 | std::cout<<OPENTHREADS_MINOR_VERSION<<std::endl; |
|---|
| 908 | return 0; |
|---|
| 909 | } |
|---|
| 910 | |
|---|
| 911 | if (arguments.read("--openthreads-patch-number")) |
|---|
| 912 | { |
|---|
| 913 | std::cout<<OPENTHREADS_PATCH_VERSION<<std::endl; |
|---|
| 914 | return 0; |
|---|
| 915 | } |
|---|
| 916 | |
|---|
| 917 | if (arguments.read("--openthreads-soversion-number")) |
|---|
| 918 | { |
|---|
| 919 | std::cout<<OpenThreadsGetSOVersion()<<std::endl; |
|---|
| 920 | return 0; |
|---|
| 921 | } |
|---|
| 922 | |
|---|
| 923 | |
|---|
| 924 | if (arguments.read("Matrix::value_type")) |
|---|
| 925 | { |
|---|
| 926 | std::cout<<((sizeof(osg::Matrix::value_type)==4)?"float":"double")<<std::endl; |
|---|
| 927 | return 0; |
|---|
| 928 | } |
|---|
| 929 | |
|---|
| 930 | if (arguments.read("Plane::value_type")) |
|---|
| 931 | { |
|---|
| 932 | std::cout<<((sizeof(osg::Plane::value_type)==4)?"float":"double")<<std::endl; |
|---|
| 933 | return 0; |
|---|
| 934 | } |
|---|
| 935 | |
|---|
| 936 | if (arguments.read("BoundingSphere::value_type")) |
|---|
| 937 | { |
|---|
| 938 | std::cout<<((sizeof(osg::BoundingSphere::value_type)==4)?"float":"double")<<std::endl; |
|---|
| 939 | return 0; |
|---|
| 940 | } |
|---|
| 941 | if (arguments.read("BoundingBox::value_type")) |
|---|
| 942 | { |
|---|
| 943 | std::cout<<((sizeof(osg::BoundingBox::value_type)==4)?"float":"double")<<std::endl; |
|---|
| 944 | return 0; |
|---|
| 945 | } |
|---|
| 946 | |
|---|
| 947 | std::cout<<osgGetLibraryName()<< " "<< osgGetVersion()<<std::endl<<std::endl; |
|---|
| 948 | |
|---|
| 949 | bool printContributors = false; |
|---|
| 950 | bool printNumEntries = false; |
|---|
| 951 | while ( arguments.read("--entries")) |
|---|
| 952 | { |
|---|
| 953 | printContributors = true; |
|---|
| 954 | printNumEntries = true; |
|---|
| 955 | } |
|---|
| 956 | |
|---|
| 957 | std::string changeLog; |
|---|
| 958 | while ( arguments.read("-r",changeLog) || arguments.read("--read",changeLog)) printContributors = true; |
|---|
| 959 | |
|---|
| 960 | |
|---|
| 961 | if (arguments.read("-h") || arguments.read("--help")) |
|---|
| 962 | { |
|---|
| 963 | std::cout<<arguments.getApplicationUsage()->getCommandLineUsage()<<std::endl; |
|---|
| 964 | arguments.getApplicationUsage()->write(std::cout,arguments.getApplicationUsage()->getCommandLineOptions()); |
|---|
| 965 | return 1; |
|---|
| 966 | } |
|---|
| 967 | |
|---|
| 968 | if (printContributors) |
|---|
| 969 | { |
|---|
| 970 | NameMap names; |
|---|
| 971 | buildContributors(names); |
|---|
| 972 | if (!changeLog.empty()) |
|---|
| 973 | { |
|---|
| 974 | readContributors(names, changeLog); |
|---|
| 975 | } |
|---|
| 976 | |
|---|
| 977 | typedef std::multimap<unsigned int, NamePair> SortedNameMap; |
|---|
| 978 | |
|---|
| 979 | SortedNameMap sortedNames; |
|---|
| 980 | for(NameMap::iterator itr = names.begin(); |
|---|
| 981 | itr != names.end(); |
|---|
| 982 | ++itr) |
|---|
| 983 | { |
|---|
| 984 | sortedNames.insert(SortedNameMap::value_type(itr->second, itr->first)); |
|---|
| 985 | } |
|---|
| 986 | |
|---|
| 987 | std::cout<<names.size()<<" Contributors:"<<std::endl<<std::endl; |
|---|
| 988 | |
|---|
| 989 | if (printNumEntries) |
|---|
| 990 | { |
|---|
| 991 | std::cout<<"Entries Firstname Surname"<<std::endl; |
|---|
| 992 | std::cout<<"-------------------------"<<std::endl; |
|---|
| 993 | for(SortedNameMap::reverse_iterator sitr = sortedNames.rbegin(); |
|---|
| 994 | sitr != sortedNames.rend(); |
|---|
| 995 | ++sitr) |
|---|
| 996 | { |
|---|
| 997 | std::cout<<sitr->first<<"\t"<<sitr->second.first<<" "<<sitr->second.second<<std::endl; |
|---|
| 998 | } |
|---|
| 999 | } |
|---|
| 1000 | else |
|---|
| 1001 | { |
|---|
| 1002 | std::cout<<"Firstname Surname"<<std::endl; |
|---|
| 1003 | std::cout<<"-----------------"<<std::endl; |
|---|
| 1004 | for(SortedNameMap::reverse_iterator sitr = sortedNames.rbegin(); |
|---|
| 1005 | sitr != sortedNames.rend(); |
|---|
| 1006 | ++sitr) |
|---|
| 1007 | { |
|---|
| 1008 | std::cout<<sitr->second.first<<" "<<sitr->second.second<<std::endl; |
|---|
| 1009 | } |
|---|
| 1010 | } |
|---|
| 1011 | } |
|---|
| 1012 | |
|---|
| 1013 | return 0; |
|---|
| 1014 | } |
|---|